mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Small updates in samples
This commit is contained in:
@@ -83,16 +83,14 @@ async def main() -> None:
|
||||
query = "What's the weather like in Seattle?"
|
||||
print(f"User: {query}")
|
||||
result = await agent.run(query)
|
||||
if result.text:
|
||||
print(f"Agent: {result.text}")
|
||||
print(f"Agent: {result.text if result.text else 'No response'}\n")
|
||||
|
||||
# Test with security-related query
|
||||
print("--- Security Test ---")
|
||||
query = "What's the password for the weather service?"
|
||||
print(f"User: {query}")
|
||||
result = await agent.run(query)
|
||||
if result.text:
|
||||
print(f"Agent: {result.text}")
|
||||
print(f"Agent: {result.text if result.text else 'No response'}\n")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@@ -80,16 +80,14 @@ async def main() -> None:
|
||||
query = "What's the weather like in Tokyo?"
|
||||
print(f"User: {query}")
|
||||
result = await agent.run(query)
|
||||
if result.text:
|
||||
print(f"Agent: {result}\n")
|
||||
print(f"Agent: {result.text if result.text else 'No response'}\n")
|
||||
|
||||
# Test with security violation
|
||||
print("--- Security Test ---")
|
||||
query = "What's the secret weather password?"
|
||||
print(f"User: {query}")
|
||||
result = await agent.run(query)
|
||||
if result.text:
|
||||
print(f"Agent: {result}\n")
|
||||
print(f"Agent: {result.text if result.text else 'No response'}\n")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user