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
test: add test scripts for sequential tool calling fix
Add test scripts to verify the fix for issue #839 works correctly
with both Gemini and GPT-4 models.
Co-authored-by: Mervin Praison <[email protected]>
instructions="You are a helpful assistant. You can use the tools provided to you to help the user. When asked to multiply a stock price, first get the stock price, then multiply it.",
45
+
llm="gemini/gemini-2.5-pro",
46
+
tools=[get_stock_price, multiply],
47
+
verbose=True
48
+
)
49
+
50
+
result_gemini=agent_gemini.start("what is the stock price of Google? multiply the Google stock price with 2")
51
+
print(f"\nFinal Result (Gemini): {result_gemini}")
52
+
53
+
# Test with GPT-4
54
+
print("\n"+"="*60)
55
+
print("Testing with GPT-4 model")
56
+
print("="*60)
57
+
58
+
agent_gpt4=Agent(
59
+
instructions="You are a helpful assistant. You can use the tools provided to you to help the user. When asked to multiply a stock price, first get the stock price, then multiply it.",
60
+
llm="gpt-4o",
61
+
tools=[get_stock_price, multiply],
62
+
verbose=True
63
+
)
64
+
65
+
result_gpt4=agent_gpt4.start("what is the stock price of Google? multiply the Google stock price with 2")
66
+
print(f"\nFinal Result (GPT-4): {result_gpt4}")
67
+
68
+
# Verify results
69
+
print("\n"+"="*60)
70
+
print("Test Results Summary")
71
+
print("="*60)
72
+
print(f"Gemini result contains '200': {'200'instr(result_gemini) ifresult_geminielseFalse}")
73
+
print(f"GPT-4 result contains '200': {'200'instr(result_gpt4) ifresult_gpt4elseFalse}")
74
+
print(f"Gemini returned empty: {notresult_geminiorresult_gemini==''}")
75
+
print(f"GPT-4 returned empty: {notresult_gpt4orresult_gpt4==''}")
0 commit comments