@@ -68,7 +68,7 @@ from dotenv import load_dotenv
68
68
69
69
load_dotenv()
70
70
71
- # Define some custom python function
71
+ # Define a custom Python function.
72
72
def fetch_weather (location : str ) -> str :
73
73
"""
74
74
Fetches the weather information for the specified location.
@@ -89,14 +89,14 @@ user_functions: Set[Callable[..., Any]] = {
89
89
fetch_weather,
90
90
}
91
91
92
- # Adding Tools to be used by Agent
92
+ # Add tools that agent will use.
93
93
functions = FunctionTool(user_functions)
94
94
95
95
toolset = ToolSet()
96
96
toolset.add(functions)
97
97
98
98
99
- # Create the agent
99
+ # Create the agent.
100
100
AGENT_NAME = " Seattle Tourist Assistant"
101
101
102
102
project_client = AIProjectClient.from_connection_string(
@@ -115,7 +115,7 @@ print(f"Created agent, ID: {agent.id}")
115
115
thread = project_client.agents.create_thread()
116
116
print (f " Created thread, ID: { thread.id} " )
117
117
118
- # Create message to thread
118
+ # Create a message to thread.
119
119
MESSAGE = " Can you fetch me the weather in Seattle?"
120
120
121
121
message = project_client.agents.create_message(
@@ -134,7 +134,7 @@ if run.status == "failed":
134
134
135
135
print (f " Run ID: { run.id} " )
136
136
137
- # display messages
137
+ # Display messages.
138
138
for message in project_client.agents.list_messages(thread.id, order = " asc" ).data:
139
139
print (f " Role: { message.role} " )
140
140
print (f " Content: { message.content[0 ].text.value} " )
@@ -149,10 +149,10 @@ After you create agent runs, you can easily use our converter to transform the A
149
149
import json, os
150
150
from azure.ai.evaluation import AIAgentConverter, IntentResolutionEvaluator
151
151
152
- # Initialize the converter for Azure AI agents
152
+ # Initialize the converter for Azure AI agents.
153
153
converter = AIAgentConverter(project_client)
154
154
155
- # Specify the thread and run id
155
+ # Specify the thread and run the ID.
156
156
thread_id = thread.id
157
157
run_id = run.id
158
158
0 commit comments