(
client: AsyncAnthropic, *, tools: list[Any], messages: list[BetaMessageParam]
)
| 127 | |
| 128 | |
| 129 | async def _run_async( |
| 130 | client: AsyncAnthropic, *, tools: list[Any], messages: list[BetaMessageParam] |
| 131 | ) -> list[BetaUserMessageParam]: |
| 132 | runner = client.beta.messages.tool_runner(max_tokens=1024, model="claude-haiku-4-5", tools=tools, messages=messages) |
| 133 | responses: list[BetaUserMessageParam] = [] |
| 134 | async for _ in runner: |
| 135 | response = await runner.generate_tool_call_response() |
| 136 | if response is not None: |
| 137 | responses.append(response) |
| 138 | return responses |
| 139 | |
| 140 | |
| 141 | def _sent_tools(respx_mock: MockRouter) -> list[dict[str, Any]]: |
no test coverage detected