MCPcopy Create free account
hub / github.com/bcefghj/miniClaudeCode / _call_api

Method _call_api

miniclaudecode/agent_loop.py:86–94  ·  view source on GitHub ↗

Call the Anthropic API with current context.

(self)

Source from the content-addressed store, hash-verified

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."""

Callers 1

runMethod · 0.95

Calls 2

api_schemasMethod · 0.80
get_api_messagesMethod · 0.80

Tested by

no test coverage detected