MCPcopy Create free account
hub / github.com/anthropics/anthropic-sdk-python / _run_async

Function _run_async

tests/lib/tools/toolsets/test_runner.py:129–138  ·  view source on GitHub ↗
(
    client: AsyncAnthropic, *, tools: list[Any], messages: list[BetaMessageParam]
)

Source from the content-addressed store, hash-verified

127
128
129async 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
141def _sent_tools(respx_mock: MockRouter) -> list[dict[str, Any]]:

Calls 3

tool_runnerMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected