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

Method chat_with_tools

atomic-repository/src/ai/tools.rs:159–176  ·  view source on GitHub ↗

Send a tool-aware chat request to the configured provider.

(
        &self,
        messages: &[ToolMessage],
        tools: &[ToolDefinition],
        max_tokens: u32,
    )

Source from the content-addressed store, hash-verified

157impl LlmProvider {
158 /// Send a tool-aware chat request to the configured provider.
159 pub async fn chat_with_tools(
160 &self,
161 messages: &[ToolMessage],
162 tools: &[ToolDefinition],
163 max_tokens: u32,
164 ) -> Result<ToolAwareResponse, AiError> {
165 match self.provider {
166 AiProvider::Anthropic => {
167 self.chat_with_tools_anthropic(messages, tools, max_tokens)
168 .await
169 }
170 AiProvider::OpenAi => {
171 self.chat_with_tools_openai(messages, tools, max_tokens)
172 .await
173 }
174 _ => Err(AiError::NoApiKey),
175 }
176 }
177
178 // ── Anthropic ───────────────────────────────────────────────
179

Callers 1

run_tool_loopFunction · 0.80

Calls 2

Tested by

no test coverage detected