File tree Expand file tree Collapse file tree
examples/zero-code-examples/anthropic Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4040 "description" : "Roll a single die with the given number of sides and return the result." ,
4141 "input_schema" : {
4242 "type" : "object" ,
43- "properties" : {
44- "n_sides" : {"type" : "integer" , "description" : "Number of sides on the die." }
45- },
43+ "properties" : {"n_sides" : {"type" : "integer" , "description" : "Number of sides on the die." }},
4644 "required" : ["n_sides" ],
4745 },
4846 },
5149 "description" : "Return true if the given number is prime, false otherwise." ,
5250 "input_schema" : {
5351 "type" : "object" ,
54- "properties" : {
55- "number" : {"type" : "integer" , "description" : "The number to check." }
56- },
52+ "properties" : {"number" : {"type" : "integer" , "description" : "The number to check." }},
5753 "required" : ["number" ],
5854 },
5955 },
@@ -99,9 +95,7 @@ def run_agent(client: anthropic.Anthropic, query: str) -> str:
9995 result = check_prime (** block .input )
10096 else :
10197 result = "Unknown tool"
102- tool_results .append (
103- {"type" : "tool_result" , "tool_use_id" : block .id , "content" : json .dumps (result )}
104- )
98+ tool_results .append ({"type" : "tool_result" , "tool_use_id" : block .id , "content" : json .dumps (result )})
10599
106100 messages .append ({"role" : "assistant" , "content" : response .content })
107101 messages .append ({"role" : "user" , "content" : tool_results })
You can’t perform that action at this time.
0 commit comments