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

Function main

examples/tools_runner.py:44–53  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

42
43
44def main() -> None:
45 runner = client.beta.messages.tool_runner(
46 max_tokens=1024,
47 model="claude-sonnet-5",
48 # alternatively, you can use `tools=[anthropic.beta_tool(get_weather)]`
49 tools=[get_weather],
50 messages=[{"role": "user", "content": "What is the weather in SF?"}],
51 )
52 for message in runner:
53 rich.print(message)
54
55
56main()

Callers 1

tools_runner.pyFile · 0.70

Calls 1

tool_runnerMethod · 0.45

Tested by

no test coverage detected