Call the Anthropic API with current context.
(self)
| 84 | return final_text |
| 85 | |
| 86 | def _call_api(self) -> Any: |
| 87 | """Call the Anthropic API with current context.""" |
| 88 | return self.client.messages.create( |
| 89 | model=self.config.model, |
| 90 | max_tokens=8192, |
| 91 | system=self.context.system_prompt, |
| 92 | tools=self.registry.api_schemas(), |
| 93 | messages=self.context.get_api_messages(), |
| 94 | ) |
| 95 | |
| 96 | def _parse_response(self, response: Any) -> tuple[list[dict], list[str]]: |
| 97 | """Extract tool_use blocks and text blocks from the API response.""" |
no test coverage detected