mirror of
https://github.com/microsoft/autogen.git
synced 2026-04-20 03:02:16 -04:00
@@ -125,7 +125,7 @@ async def main() -> None:
|
||||
),
|
||||
)
|
||||
|
||||
run_context = runtime.start()
|
||||
runtime.start()
|
||||
|
||||
# Send a task to the tool user.
|
||||
response = await runtime.send_message(
|
||||
@@ -134,7 +134,7 @@ async def main() -> None:
|
||||
print(response.content)
|
||||
|
||||
# Run the runtime until the task is completed.
|
||||
await run_context.stop()
|
||||
await runtime.stop()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@@ -66,7 +66,7 @@ async def main() -> None:
|
||||
),
|
||||
)
|
||||
|
||||
run_context = runtime.start()
|
||||
runtime.start()
|
||||
|
||||
# Send a task to the tool user.
|
||||
response = await runtime.send_message(
|
||||
@@ -75,7 +75,7 @@ async def main() -> None:
|
||||
print(response.content)
|
||||
|
||||
# Run the runtime until the task is completed.
|
||||
await run_context.stop()
|
||||
await runtime.stop()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@@ -210,14 +210,14 @@ async def main() -> None:
|
||||
)
|
||||
await runtime.add_subscription(TypeSubscription("default", "tool_use_agent"))
|
||||
|
||||
run_context = runtime.start()
|
||||
runtime.start()
|
||||
|
||||
# Publish a task.
|
||||
await runtime.publish_message(
|
||||
UserRequest("Run the following Python code: print('Hello, World!')"), topic_id=TopicId("default", "default")
|
||||
)
|
||||
|
||||
await run_context.stop_when_idle()
|
||||
await runtime.stop_when_idle()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@@ -63,7 +63,7 @@ async def main() -> None:
|
||||
)
|
||||
tool_use_agent = AgentId("tool_enabled_agent", "default")
|
||||
|
||||
run_context = runtime.start()
|
||||
runtime.start()
|
||||
|
||||
# Send a task to the tool user.
|
||||
response = await runtime.send_message(Message("What is the stock price of NVDA on 2024/06/01"), tool_use_agent)
|
||||
@@ -72,7 +72,7 @@ async def main() -> None:
|
||||
print(response.content)
|
||||
|
||||
# Run the runtime until the task is completed.
|
||||
await run_context.stop()
|
||||
await runtime.stop()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user