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

Method answer

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

Call the LLM to generate an answer from context.

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

Source from the content-addressed store, hash-verified

293impl LlmProvider {
294 /// Call the LLM to generate an answer from context.
295 pub async fn answer(&self, context: &str, query: &str) -> Result<LlmResponse, AiError> {
296 match self.provider {
297 AiProvider::Anthropic => self.call_anthropic(context, query).await,
298 AiProvider::OpenAi => self.call_openai(context, query).await,
299 _ => Err(AiError::NoApiKey),
300 }
301 }
302
303 /// Synchronous answer (for non-async contexts).
304 pub fn answer_sync(&self, context: &str, query: &str) -> Result<LlmResponse, AiError> {

Callers 1

answer_syncMethod · 0.80

Calls 2

call_anthropicMethod · 0.80
call_openaiMethod · 0.80

Tested by

no test coverage detected