Make RunContext internal (#386)

* Make RunContext internal

* Mypy
This commit is contained in:
Eric Zhu
2024-08-21 13:59:59 -07:00
committed by GitHub
parent 09ceef4b4a
commit ed0890525d
40 changed files with 2360 additions and 2329 deletions

View File

@@ -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__":

View File

@@ -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__":

View File

@@ -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__":

View File

@@ -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__":