Migrates GAIA to try_get_underlying_agent_instance (#250)

This commit is contained in:
afourney 2024-07-23 17:07:04 -07:00 committed by GitHub
parent 3ba7a48b13
commit b33c9602b2

View File

@ -148,8 +148,7 @@ async def main() -> None:
run_context = runtime.start() run_context = runtime.start()
actual_surfer = runtime._get_agent(web_surfer.id) # type: ignore actual_surfer = await runtime.try_get_underlying_agent_instance(web_surfer.id, type=MultimodalWebSurfer)
assert isinstance(actual_surfer, MultimodalWebSurfer)
await actual_surfer.init(model_client=client, downloads_folder=os.getcwd(), browser_channel="chromium") await actual_surfer.init(model_client=client, downloads_folder=os.getcwd(), browser_channel="chromium")
#await runtime.send_message(RequestReplyMessage(), user_proxy.id) #await runtime.send_message(RequestReplyMessage(), user_proxy.id)
@ -186,8 +185,7 @@ async def main() -> None:
await run_context.stop_when_idle() await run_context.stop_when_idle()
# Output the final answer # Output the final answer
actual_orchestrator = runtime._get_agent(orchestrator.id) # type: ignore actual_orchestrator = await runtime.try_get_underlying_agent_instance(orchestrator.id, type=LedgerOrchestrator)
assert isinstance(actual_orchestrator, LedgerOrchestrator)
transcript: List[LLMMessage] = actual_orchestrator._chat_history # type: ignore transcript: List[LLMMessage] = actual_orchestrator._chat_history # type: ignore
print(await response_preparer(task=task, source=(await orchestrator.metadata)["name"], client=client, transcript=transcript)) print(await response_preparer(task=task, source=(await orchestrator.metadata)["name"], client=client, transcript=transcript))