You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description="Save the calculation result. Must be called to persist the result.",
40
45
parameters={
41
46
"type": "object",
42
47
"properties": {
43
-
"result": {"type": "string", "description": "The result"},
48
+
"calculation": {"type": "string", "description": "Description of the calculation"},
49
+
"result": {"type": "string", "description": "The numerical result"},
44
50
},
45
-
"required": ["result"],
51
+
"required": ["calculation", "result"],
46
52
"additionalProperties": False,
47
53
},
48
54
strict=True,
49
55
)
50
56
51
-
# Create agent
57
+
# Create agent with explicit instructions to use both tools
52
58
agent=project_client.agents.create_version(
53
59
agent_name="code-func-agent",
54
60
definition=PromptAgentDefinition(
55
61
model=model,
56
-
instructions="Run calculations and save results.",
62
+
instructions="You are a calculator assistant. Use code interpreter to perform calculations, then ALWAYS save the result using the save_result function.",
instructions="Generate data using code and create reports with the generate_report function.",
124
+
instructions="You are a data analyst. Use code interpreter to generate and analyze data, then ALWAYS create a report using the generate_report function with the exact statistics you computed.",
# Request data generation and report - use a fixed seed for reproducibility in verification
122
135
response=openai_client.responses.create(
123
-
input="Generate a list of 10 random numbers between 1 and 100, calculate their average, and create a report.",
136
+
input="Using Python with random.seed(42), generate exactly 10 random integers between 1 and 100, calculate their average, and create a report with the results.",
0 commit comments