Skip to content

Commit 7772fd6

Browse files
authored
Howie/validate sample by agent (#44345)
Use LLM to validate print content in agents tools samples.
1 parent 30c6d22 commit 7772fd6

23 files changed

+256
-432
lines changed

sdk/ai/azure-ai-projects/assets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"AssetsRepo": "Azure/azure-sdk-assets",
33
"AssetsRepoPrefixPath": "python",
44
"TagPrefix": "python/ai/azure-ai-projects",
5-
"Tag": "python/ai/azure-ai-projects_314598932e"
5+
"Tag": "python/ai/azure-ai-projects_93d1dc0fe7"
66
}

sdk/ai/azure-ai-projects/samples/agents/tools/computer_use_util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,4 +159,4 @@ def print_final_output(response):
159159
final_output += getattr(part, "text", None) or getattr(part, "refusal", None) or "" + "\n"
160160

161161
print(f"Final status: {response.status}")
162-
print(f"==> Result: {final_output.strip()}")
162+
print(f"Final result: {final_output.strip()}")

sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_ai_search.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
)
109109
elif event.type == "response.completed":
110110
print(f"\nFollow-up completed!")
111-
print(f"==> Result: {event.response.output_text}")
111+
print(f"Agent response: {event.response.output_text}")
112112

113113
print("\nCleaning up...")
114114
project_client.agents.delete_version(agent_name=agent.name, agent_version=agent.version)

sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_code_interpreter.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@
108108
file_path = os.path.join(tempfile.gettempdir(), filename)
109109
with open(file_path, "wb") as f:
110110
f.write(file_content.read())
111-
# Print result (should contain "file")
112-
print(f"==> Result: file, {file_path} downloaded successfully.")
111+
print(f"File downloaded successfully: {file_path}")
113112
else:
114113
print("No file generated in response")

sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_code_interpreter_async.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,7 @@ async def main() -> None:
112112
file_path = os.path.join(tempfile.gettempdir(), filename)
113113
with open(file_path, "wb") as f:
114114
f.write(file_content.read())
115-
# Print result (should contain "file")
116-
print(f"==> Result: file, {file_path} downloaded successfully.")
115+
print(f"File downloaded successfully: {file_path}")
117116
else:
118117
print("No file generated in response")
119118

sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_file_search.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
input="Tell me about Contoso products",
7979
extra_body={"agent": {"name": agent.name, "type": "agent_reference"}},
8080
)
81-
print(f"==> Result: {response.output_text}")
81+
print(f"Agent response: {response.output_text}")
8282
print("\nCleaning up...")
8383
project_client.agents.delete_version(agent_name=agent.name, agent_version=agent.version)
8484
print("Agent deleted")

sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_file_search_in_stream.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@
140140
print(f"File Citation - Filename: {annotation.filename}, File ID: {annotation.file_id}")
141141
elif event.type == "response.completed":
142142
print(f"\nFollow-up completed!")
143-
print(f"==> Result: {event.response.output_text}")
143+
print(f"Agent response: {event.response.output_text}")
144144

145145
# Clean up resources
146146
print("\n" + "=" * 60)

sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_file_search_in_stream_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ async def main() -> None:
145145
print(f"File Citation - Filename: {annotation.filename}, File ID: {annotation.file_id}")
146146
elif event.type == "response.completed":
147147
print(f"\nFollow-up completed!")
148-
print(f"==> Result: {event.response.output_text}")
148+
print(f"Agent response: {event.response.output_text}")
149149

150150
# Clean up resources
151151
print("\n" + "=" * 60)

sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_function_tool.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,7 @@ def get_horoscope(sign: str) -> str:
108108
extra_body={"agent": {"name": agent.name, "type": "agent_reference"}},
109109
)
110110

111-
# Print result (should contain "Tuesday")
112-
print(f"==> Result: {response.output_text}")
111+
print(f"Agent response: {response.output_text}")
113112

114113
print("\nCleaning up...")
115114
project_client.agents.delete_version(agent_name=agent.name, agent_version=agent.version)

sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_function_tool_async.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,7 @@ async def main():
109109
extra_body={"agent": {"name": agent.name, "type": "agent_reference"}},
110110
)
111111

112-
# Print result (should contain "Tuesday")
113-
print(f"==> Result: {response.output_text}")
112+
print(f"Agent response: {response.output_text}")
114113

115114

116115
if __name__ == "__main__":

0 commit comments

Comments
 (0)