Send a tool-aware chat request to the configured provider.
(
&self,
messages: &[ToolMessage],
tools: &[ToolDefinition],
max_tokens: u32,
)
| 157 | impl 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 |
no test coverage detected