Skip to content

Commit fb1727c

Browse files
salma-elshafeySalma Elshafey
andauthored
Fix tool call accuracy sample (#43847)
Co-authored-by: Salma Elshafey <[email protected]>
1 parent 8be0fa3 commit fb1727c

File tree

1 file changed

+21
-14
lines changed

1 file changed

+21
-14
lines changed

sdk/ai/azure-ai-projects/samples/evaluation/agentic_evaluators/sample_tool_call_accuracy.py

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -102,26 +102,32 @@ def main() -> None:
102102

103103
# Example 1: Simple tool call evaluation
104104
query1 = "What's the weather like in New York?"
105-
tool_definitions1 = {
106-
"name": "get_weather",
107-
"description": "Get weather information for a location",
108-
"parameters": {
109-
"type": "object",
110-
"properties": {"location": {"type": "string", "description": "The city name"}},
111-
},
112-
}
105+
tool_definitions1 = [
106+
{
107+
"type": "function",
108+
"name": "get_weather",
109+
"description": "Get weather information for a location",
110+
"parameters": {
111+
"type": "object",
112+
"properties": {"location": {"type": "string", "description": "The city name"}},
113+
},
114+
}
115+
]
113116

114-
tool_calls1 = {
115-
"type": "tool_call",
116-
"tool_call_id": "call_1",
117-
"name": "get_weather",
118-
"arguments": {"location": "New York"},
119-
}
117+
tool_calls1 = [
118+
{
119+
"type": "tool_call",
120+
"tool_call_id": "call_1",
121+
"name": "get_weather",
122+
"arguments": {"location": "New York"},
123+
}
124+
]
120125

121126
# Example 2: Multiple tool calls
122127
query2 = "Search for customer orders and send an email update"
123128
tool_definitions2 = [
124129
{
130+
"type": "function",
125131
"id": "search_database_tool",
126132
"name": "search_database",
127133
"description": "Search database for information",
@@ -131,6 +137,7 @@ def main() -> None:
131137
},
132138
},
133139
{
140+
"type": "function",
134141
"id": "send_email_tool",
135142
"name": "send_email",
136143
"description": "Send an email",

0 commit comments

Comments
 (0)