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

Function _run_sync

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

Source from the content-addressed store, hash-verified

117
118
119def _run_sync(client: Anthropic, *, tools: list[Any], messages: list[BetaMessageParam]) -> list[BetaUserMessageParam]:
120 runner = client.beta.messages.tool_runner(max_tokens=1024, model="claude-haiku-4-5", tools=tools, messages=messages)
121 responses: list[BetaUserMessageParam] = []
122 for _ in runner:
123 response = runner.generate_tool_call_response()
124 if response is not None:
125 responses.append(response)
126 return responses
127
128
129async def _run_async(

Calls 3

tool_runnerMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected