MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / answer_sync

Method answer_sync

atomic-repository/src/ai/mod.rs:304–310  ·  view source on GitHub ↗

Synchronous answer (for non-async contexts).

(&self, context: &str, query: &str)

Source from the content-addressed store, hash-verified

302
303 /// Synchronous answer (for non-async contexts).
304 pub fn answer_sync(&self, context: &str, query: &str) -> Result<LlmResponse, AiError> {
305 let rt = tokio::runtime::Builder::new_current_thread()
306 .enable_all()
307 .build()
308 .map_err(|e| AiError::Runtime(e.to_string()))?;
309 rt.block_on(self.answer(context, query))
310 }
311
312 async fn call_anthropic(&self, context: &str, query: &str) -> Result<LlmResponse, AiError> {
313 let url = format!("{}/messages", self.base_url);

Callers

nothing calls this directly

Calls 2

answerMethod · 0.80
buildMethod · 0.45

Tested by

no test coverage detected