You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is the error I get and I don't understand why. The model I'm using supports json schemas.
openai.BadRequestError: Error code: 400 - {'error': "'response_format.type' must be 'json_schema'"}
This is in my example file
"""This example demonstrates MagenticOne performing a task given by the user and returning a final answer."""importargparseimportasyncioimportjsonimportloggingimportosfromautogen_coreimportEVENT_LOGGER_NAME, AgentId, AgentProxy, SingleThreadedAgentRuntimefromautogen_core.code_executorimportCodeBlockfromautogen_core.models._model_clientimportChatCompletionClientfromautogen_ext.code_executors.dockerimportDockerCommandLineCodeExecutorfromautogen_magentic_one.agents.coderimportCoder, Executorfromautogen_magentic_one.agents.file_surferimportFileSurferfromautogen_magentic_one.agents.multimodal_web_surferimportMultimodalWebSurferfromautogen_magentic_one.agents.orchestratorimportLedgerOrchestratorfromautogen_magentic_one.agents.user_proxyimportUserProxyfromautogen_magentic_one.messagesimportRequestReplyMessagefromautogen_magentic_one.utilsimportLogHandlerfromautogen_core.modelsimportUserMessagefromautogen_ext.models.openaiimportOpenAIChatCompletionClient# NOTE: Don't forget to 'playwright install --with-deps chromium'asyncdefconfirm_code(code: CodeBlock) ->bool:
response=awaitasyncio.to_thread(
input,
f"Executor is about to execute code (lang: {code.language}):\n{code.code}\n\nDo you want to proceed? (yes/no): ",
)
returnresponse.lower() =="yes"asyncdefmain(logs_dir: str, hil_mode: bool, save_screenshots: bool) ->None:
# Create the runtime.runtime=SingleThreadedAgentRuntime()
# Create an appropriate client# client = ChatCompletionClient.load_component(json.loads(os.environ["CHAT_COMPLETION_CLIENT_CONFIG"]))# assert client.model_info["family"] == "gpt-4o", "This example requires the gpt-4o model"client=OpenAIChatCompletionClient(
model="qwen2-vl-2b-instruct",
base_url="http://localhost:1234/v1",
api_key="lm-studio",
model_info={
"vision": True,
"function_calling": True,
"json_output": True,
"family": "unknown",
},
)
asyncwithDockerCommandLineCodeExecutor(work_dir=logs_dir) ascode_executor:
# Register agents.awaitCoder.register(runtime, "Coder", lambda: Coder(model_client=client))
coder=AgentProxy(AgentId("Coder", "default"), runtime)
awaitExecutor.register(
runtime,
"Executor",
lambda: Executor("A agent for executing code", executor=code_executor, confirm_execution=confirm_code),
)
executor=AgentProxy(AgentId("Executor", "default"), runtime)
# Register agents.awaitMultimodalWebSurfer.register(runtime, "WebSurfer", MultimodalWebSurfer)
web_surfer=AgentProxy(AgentId("WebSurfer", "default"), runtime)
awaitFileSurfer.register(runtime, "file_surfer", lambda: FileSurfer(model_client=client))
file_surfer=AgentProxy(AgentId("file_surfer", "default"), runtime)
awaitUserProxy.register(
runtime,
"UserProxy",
lambda: UserProxy(description="The current user interacting with you."),
)
user_proxy=AgentProxy(AgentId("UserProxy", "default"), runtime)
agent_list= [web_surfer, coder, executor, file_surfer]
ifhil_mode:
agent_list.append(user_proxy)
awaitLedgerOrchestrator.register(
runtime,
"Orchestrator",
lambda: LedgerOrchestrator(
agents=agent_list,
model_client=client,
max_rounds=30,
max_time=25*60,
return_final_answer=True,
),
)
# orchestrator = AgentProxy(AgentId("Orchestrator", "default"), runtime)runtime.start()
actual_surfer=awaitruntime.try_get_underlying_agent_instance(web_surfer.id, type=MultimodalWebSurfer)
awaitactual_surfer.init(
model_client=client,
downloads_folder=logs_dir,
start_page="https://www.duckduckgo.com",
browser_channel="chromium",
headless=True,
debug_dir=logs_dir,
to_save_screenshots=save_screenshots,
)
awaitruntime.send_message(RequestReplyMessage(), user_proxy.id)
awaitruntime.stop_when_idle()
if__name__=="__main__":
parser=argparse.ArgumentParser(description="Run MagenticOne example with log directory.")
parser.add_argument("--logs_dir", type=str, required=True, help="Directory to store log files and downloads")
parser.add_argument("--hil_mode", action="store_true", default=False, help="Run in human-in-the-loop mode")
parser.add_argument(
"--save_screenshots", action="store_true", default=False, help="Save additional browser screenshots to file"
)
args=parser.parse_args()
# Ensure the log directory existsifnotos.path.exists(args.logs_dir):
os.makedirs(args.logs_dir)
logger=logging.getLogger(EVENT_LOGGER_NAME)
logger.setLevel(logging.INFO)
log_handler=LogHandler(filename=os.path.join(args.logs_dir, "log.jsonl"))
logger.handlers= [log_handler]
asyncio.run(main(args.logs_dir, args.hil_mode, args.save_screenshots))
This is the output
<>pythonexample.py--logs_dir ./logsINFO:autogen_core.events:{"payload": "{}", "sender": null, "receiver": "UserProxy/default", "kind": "MessageKind.DIRECT", "delivery_stage": "DeliveryStage.SEND", "type": "Message"}
INFO:autogen_core.events:{"payload": "{}", "sender": null, "receiver": "UserProxy/default", "kind": "MessageKind.DIRECT", "delivery_stage": "DeliveryStage.DELIVER", "type": "Message"}
Userinput ('exit'toquit): tiramisurecipeINFO:autogen_core.events:{"payload": "{\"content\":{\"content\":\"tiramisu recipe\",\"source\":\"UserProxy\",\"type\":\"UserMessage\"},\"request_halt\":false}", "sender": "UserProxy/default", "receiver": "default/default", "kind": "MessageKind.PUBLISH", "delivery_stage": "DeliveryStage.SEND", "type": "Message"}
INFO:autogen_core.events:{"payload": "Message could not be serialized", "sender": "UserProxy/default", "receiver": null, "kind": "MessageKind.RESPOND", "delivery_stage": "DeliveryStage.SEND", "type": "Message"}
INFO:autogen_core.events:{"payload": "{\"content\":{\"content\":\"tiramisu recipe\",\"source\":\"UserProxy\",\"type\":\"UserMessage\"},\"request_halt\":false}", "sender": "UserProxy/default", "receiver": null, "kind": "MessageKind.PUBLISH", "delivery_stage": "DeliveryStage.DELIVER", "type": "Message"}
INFO:autogen_core.events:{"payload": "{\"content\":{\"content\":\"tiramisu recipe\",\"source\":\"UserProxy\",\"type\":\"UserMessage\"},\"request_halt\":false}", "sender": "UserProxy/default", "receiver": null, "kind": "MessageKind.PUBLISH", "delivery_stage": "DeliveryStage.DELIVER", "type": "Message"}
INFO:autogen_core.events:{"payload": "{\"content\":{\"content\":\"tiramisu recipe\",\"source\":\"UserProxy\",\"type\":\"UserMessage\"},\"request_halt\":false}", "sender": "UserProxy/default", "receiver": null, "kind": "MessageKind.PUBLISH", "delivery_stage": "DeliveryStage.DELIVER", "type": "Message"}
INFO:autogen_core.events:{"payload": "{\"content\":{\"content\":\"tiramisu recipe\",\"source\":\"UserProxy\",\"type\":\"UserMessage\"},\"request_halt\":false}", "sender": "UserProxy/default", "receiver": null, "kind": "MessageKind.PUBLISH", "delivery_stage": "DeliveryStage.DELIVER", "type": "Message"}
INFO:autogen_core.events:{"payload": "{\"content\":{\"content\":\"tiramisu recipe\",\"source\":\"UserProxy\",\"type\":\"UserMessage\"},\"request_halt\":false}", "sender": "UserProxy/default", "receiver": null, "kind": "MessageKind.PUBLISH", "delivery_stage": "DeliveryStage.DELIVER", "type": "Message"}
INFO:autogen_core.events:{"payload": "Message could not be serialized", "sender": "UserProxy/default", "receiver": null, "kind": "MessageKind.RESPOND", "delivery_stage": "DeliveryStage.DELIVER", "type": "Message"}
---------------------------------------------------------------------------
[2025-01-29T18:09:27.376378], UserProxy:
tiramisurecipeINFO:autogen_core.events.default.orchestrator:{"timestamp": "2025-01-29T18:09:27.376378", "source": "UserProxy", "message": "tiramisu recipe", "type": "OrchestrationEvent"}
INFO:autogen_core.events:{"timestamp": "2025-01-29T18:09:31.453103", "prompt_tokens": 315, "completion_tokens": 32, "type": "LLMCallEvent"}
INFO:autogen_core.events:{"timestamp": "2025-01-29T18:30:08.109391", "prompt_tokens": 560, "completion_tokens": 393, "type": "LLMCallEvent"}
INFO:autogen_core.events:{"payload": "{\"content\":{\"content\":\"\\nWe are working to address the following user request:\\n\\ntiramisu recipe\\n\\n\\nTo answer this request we have assembled the following team:\\n\\nWebSurfer: A helpful assistant with access to a web browser. Ask them to perform web searches, open pages, and interact with content (e.g., clicking links, scrolling the viewport, etc., filling in form fields, etc.) It can also summarize the entire page, or answer questions based on the content of the page. It can also be asked to sleep and wait for pages to load, in cases where the pages seem to be taking a while to load.\\nCoder: A helpful and general-purpose AI assistant that has strong language skills, Python skills, and Linux command line skills.\\nExecutor: A agent for executing code\\nfile_surfer: An agent that can handle local files.\\n\\n\\n\\nHere is an initial fact sheet to consider:\\n\\n1. GIVEN OR VERIFIED FACTS\\n2. FACTS TO LOOK UP\\n3. FACTS TO DERIVE\\n4. EDUCATED GUESSES\\n\\n\\nHere is the plan to follow as best as possible:\\n\\n1. WebSurfer: Search for a recipe for tiramisu.\\n2. Coder: Write a Python script that fetches and processes the recipe from the web.\\n3. Executor: Execute the Python script to retrieve the recipe.\\n4. FileSurfer: Open the recipe file and display it to the user.\\n5. WebSurfer: Search for a recipe for tiramisu again, this time using the Python script.\\n6. Coder: Write another Python script that fetches and processes the recipe from the web.\\n7. Executor: Execute the Python script to retrieve the recipe.\\n8. FileSurfer: Open the recipe file and display it to the user.\\n9. WebSurfer: Search for a recipe for tiramisu again, this time using the Python scripts.\\n10. Coder: Write another Python script that fetches and processes the recipe from the web.\\n11. Executor: Execute the Python script to retrieve the recipe.\\n12. FileSurfer: Open the recipe file and display it to the user.\\n13. WebSurfer: Search for a recipe for tiramisu again, this time using the Python scripts.\\n14. Coder: Write another Python script that fetches and processes the recipe from the web.\\n15. Executor: Execute the Python script to retrieve the recipe.\\n16. FileSurfer: Open the recipe file and display it to the user.\\n17. WebSurfer: Search for a recipe for tiramisu again, this time using the Python scripts.\\n18. Coder: Write another Python script that fetches and processes the recipe from the web.\\n19. Executor: Execute the Python script to retrieve the recipe.\\n20. FileSurfer: Open the recipe file and display it to the user.\\n\\nNote: The above plan is a rough outline, and may need to be adjusted based on the specific requirements of the request.\\n\",\"source\":\"Orchestrator\",\"type\":\"UserMessage\"},\"request_halt\":false}", "sender": "Orchestrator/default", "receiver": "default/default", "kind": "MessageKind.PUBLISH", "delivery_stage": "DeliveryStage.SEND", "type": "Message"}
---------------------------------------------------------------------------
[2025-01-29T18:30:08.110392], Orchestrator (thought):
Initialplan:
Weareworkingtoaddressthefollowinguserrequest:
tiramisurecipeToanswerthisrequestwehaveassembledthefollowingteam:
WebSurfer: Ahelpfulassistantwithaccesstoawebbrowser. Askthemtoperformwebsearches, openpages, andinteractwithcontent (e.g., clickinglinks, scrollingtheviewport, etc., fillinginformfields, etc.) Itcanalsosummarizetheentirepage, oranswerquestionsbasedonthecontentofthepage. Itcanalsobeaskedtosleepandwaitforpagestoload, incaseswherethepagesseemtobetakingawhiletoload.
Coder: Ahelpfulandgeneral-purposeAIassistantthathasstronglanguageskills, Pythonskills, andLinuxcommandlineskills.
Executor: Aagentforexecutingcodefile_surfer: Anagentthatcanhandlelocalfiles.
Hereisaninitialfactsheettoconsider:
1.GIVENORVERIFIEDFACTS2.FACTSTOLOOKUP3.FACTSTODERIVE4.EDUCATEDGUESSESHereistheplantofollowasbestaspossible:
1.WebSurfer: Searchforarecipefortiramisu.
2.Coder: WriteaPythonscriptthatfetchesandprocessestherecipefromtheweb.
3.Executor: ExecutethePythonscripttoretrievetherecipe.
4.FileSurfer: Opentherecipefileanddisplayittotheuser.
5.WebSurfer: Searchforarecipefortiramisuagain, thistimeusingthePythonscript.
6.Coder: WriteanotherPythonscriptthatfetchesandprocessestherecipefromtheweb.
7.Executor: ExecutethePythonscripttoretrievetherecipe.
8.FileSurfer: Opentherecipefileanddisplayittotheuser.
9.WebSurfer: Searchforarecipefortiramisuagain, thistimeusingthePythonscripts.
10.Coder: WriteanotherPythonscriptthatfetchesandprocessestherecipefromtheweb.
11.Executor: ExecutethePythonscripttoretrievetherecipe.
12.FileSurfer: Opentherecipefileanddisplayittotheuser.
13.WebSurfer: Searchforarecipefortiramisuagain, thistimeusingthePythonscripts.
14.Coder: WriteanotherPythonscriptthatfetchesandprocessestherecipefromtheweb.
15.Executor: ExecutethePythonscripttoretrievetherecipe.
16.FileSurfer: Opentherecipefileanddisplayittotheuser.
17.WebSurfer: Searchforarecipefortiramisuagain, thistimeusingthePythonscripts.
18.Coder: WriteanotherPythonscriptthatfetchesandprocessestherecipefromtheweb.
19.Executor: ExecutethePythonscripttoretrievetherecipe.
20.FileSurfer: Opentherecipefileanddisplayittotheuser.
Note: Theaboveplanisaroughoutline, andmayneedtobeadjustedbasedonthespecificrequirementsoftherequest.
INFO:autogen_core.events.default.orchestrator:{"timestamp": "2025-01-29T18:30:08.110392", "source": "Orchestrator (thought)", "message": "Initial plan:\n\nWe are working to address the following user request:\n\ntiramisu recipe\n\n\nTo answer this request we have assembled the following team:\n\nWebSurfer: A helpful assistant with access to a web browser. Ask them to perform web searches, open pages, and interact with content (e.g., clicking links, scrolling the viewport, etc., filling in form fields, etc.) It can also summarize the entire page, or answer questions based on the content of the page. It can also be asked to sleep and wait for pages to load, in cases where the pages seem to be taking a while to load.\nCoder: A helpful and general-purpose AI assistant that has strong language skills, Python skills, and Linux command line skills.\nExecutor: A agent for executing code\nfile_surfer: An agent that can handle local files.\n\n\n\nHere is an initial fact sheet to consider:\n\n1. GIVEN OR VERIFIED FACTS\n2. FACTS TO LOOK UP\n3. FACTS TO DERIVE\n4. EDUCATED GUESSES\n\n\nHere is the plan to follow as best as possible:\n\n1. WebSurfer: Search for a recipe for tiramisu.\n2. Coder: Write a Python script that fetches and processes the recipe from the web.\n3. Executor: Execute the Python script to retrieve the recipe.\n4. FileSurfer: Open the recipe file and display it to the user.\n5. WebSurfer: Search for a recipe for tiramisu again, this time using the Python script.\n6. Coder: Write another Python script that fetches and processes the recipe from the web.\n7. Executor: Execute the Python script to retrieve the recipe.\n8. FileSurfer: Open the recipe file and display it to the user.\n9. WebSurfer: Search for a recipe for tiramisu again, this time using the Python scripts.\n10. Coder: Write another Python script that fetches and processes the recipe from the web.\n11. Executor: Execute the Python script to retrieve the recipe.\n12. FileSurfer: Open the recipe file and display it to the user.\n13. WebSurfer: Search for a recipe for tiramisu again, this time using the Python scripts.\n14. Coder: Write another Python script that fetches and processes the recipe from the web.\n15. Executor: Execute the Python script to retrieve the recipe.\n16. FileSurfer: Open the recipe file and display it to the user.\n17. WebSurfer: Search for a recipe for tiramisu again, this time using the Python scripts.\n18. Coder: Write another Python script that fetches and processes the recipe from the web.\n19. Executor: Execute the Python script to retrieve the recipe.\n20. FileSurfer: Open the recipe file and display it to the user.\n\nNote: The above plan is a rough outline, and may need to be adjusted based on the specific requirements of the request.\n", "type": "OrchestrationEvent"}
INFO:autogen_core.events:{"payload": "{\"content\":{\"content\":\"\\nWe are working to address the following user request:\\n\\ntiramisu recipe\\n\\n\\nTo answer this request we have assembled the following team:\\n\\nWebSurfer: A helpful assistant with access to a web browser. Ask them to perform web searches, open pages, and interact with content (e.g., clicking links, scrolling the viewport, etc., filling in form fields, etc.) It can also summarize the entire page, or answer questions based on the content of the page. It can also be asked to sleep and wait for pages to load, in cases where the pages seem to be taking a while to load.\\nCoder: A helpful and general-purpose AI assistant that has strong language skills, Python skills, and Linux command line skills.\\nExecutor: A agent for executing code\\nfile_surfer: An agent that can handle local files.\\n\\n\\n\\nHere is an initial fact sheet to consider:\\n\\n1. GIVEN OR VERIFIED FACTS\\n2. FACTS TO LOOK UP\\n3. FACTS TO DERIVE\\n4. EDUCATED GUESSES\\n\\n\\nHere is the plan to follow as best as possible:\\n\\n1. WebSurfer: Search for a recipe for tiramisu.\\n2. Coder: Write a Python script that fetches and processes the recipe from the web.\\n3. Executor: Execute the Python script to retrieve the recipe.\\n4. FileSurfer: Open the recipe file and display it to the user.\\n5. WebSurfer: Search for a recipe for tiramisu again, this time using the Python script.\\n6. Coder: Write another Python script that fetches and processes the recipe from the web.\\n7. Executor: Execute the Python script to retrieve the recipe.\\n8. FileSurfer: Open the recipe file and display it to the user.\\n9. WebSurfer: Search for a recipe for tiramisu again, this time using the Python scripts.\\n10. Coder: Write another Python script that fetches and processes the recipe from the web.\\n11. Executor: Execute the Python script to retrieve the recipe.\\n12. FileSurfer: Open the recipe file and display it to the user.\\n13. WebSurfer: Search for a recipe for tiramisu again, this time using the Python scripts.\\n14. Coder: Write another Python script that fetches and processes the recipe from the web.\\n15. Executor: Execute the Python script to retrieve the recipe.\\n16. FileSurfer: Open the recipe file and display it to the user.\\n17. WebSurfer: Search for a recipe for tiramisu again, this time using the Python scripts.\\n18. Coder: Write another Python script that fetches and processes the recipe from the web.\\n19. Executor: Execute the Python script to retrieve the recipe.\\n20. FileSurfer: Open the recipe file and display it to the user.\\n\\nNote: The above plan is a rough outline, and may need to be adjusted based on the specific requirements of the request.\\n\",\"source\":\"Orchestrator\",\"type\":\"UserMessage\"},\"request_halt\":false}", "sender": "Orchestrator/default", "receiver": null, "kind": "MessageKind.PUBLISH", "delivery_stage": "DeliveryStage.DELIVER", "type": "Message"}
INFO:autogen_core.events:{"payload": "{\"content\":{\"content\":\"\\nWe are working to address the following user request:\\n\\ntiramisu recipe\\n\\n\\nTo answer this request we have assembled the following team:\\n\\nWebSurfer: A helpful assistant with access to a web browser. Ask them to perform web searches, open pages, and interact with content (e.g., clicking links, scrolling the viewport, etc., filling in form fields, etc.) It can also summarize the entire page, or answer questions based on the content of the page. It can also be asked to sleep and wait for pages to load, in cases where the pages seem to be taking a while to load.\\nCoder: A helpful and general-purpose AI assistant that has strong language skills, Python skills, and Linux command line skills.\\nExecutor: A agent for executing code\\nfile_surfer: An agent that can handle local files.\\n\\n\\n\\nHere is an initial fact sheet to consider:\\n\\n1. GIVEN OR VERIFIED FACTS\\n2. FACTS TO LOOK UP\\n3. FACTS TO DERIVE\\n4. EDUCATED GUESSES\\n\\n\\nHere is the plan to follow as best as possible:\\n\\n1. WebSurfer: Search for a recipe for tiramisu.\\n2. Coder: Write a Python script that fetches and processes the recipe from the web.\\n3. Executor: Execute the Python script to retrieve the recipe.\\n4. FileSurfer: Open the recipe file and display it to the user.\\n5. WebSurfer: Search for a recipe for tiramisu again, this time using the Python script.\\n6. Coder: Write another Python script that fetches and processes the recipe from the web.\\n7. Executor: Execute the Python script to retrieve the recipe.\\n8. FileSurfer: Open the recipe file and display it to the user.\\n9. WebSurfer: Search for a recipe for tiramisu again, this time using the Python scripts.\\n10. Coder: Write another Python script that fetches and processes the recipe from the web.\\n11. Executor: Execute the Python script to retrieve the recipe.\\n12. FileSurfer: Open the recipe file and display it to the user.\\n13. WebSurfer: Search for a recipe for tiramisu again, this time using the Python scripts.\\n14. Coder: Write another Python script that fetches and processes the recipe from the web.\\n15. Executor: Execute the Python script to retrieve the recipe.\\n16. FileSurfer: Open the recipe file and display it to the user.\\n17. WebSurfer: Search for a recipe for tiramisu again, this time using the Python scripts.\\n18. Coder: Write another Python script that fetches and processes the recipe from the web.\\n19. Executor: Execute the Python script to retrieve the recipe.\\n20. FileSurfer: Open the recipe file and display it to the user.\\n\\nNote: The above plan is a rough outline, and may need to be adjusted based on the specific requirements of the request.\\n\",\"source\":\"Orchestrator\",\"type\":\"UserMessage\"},\"request_halt\":false}", "sender": "Orchestrator/default", "receiver": null, "kind": "MessageKind.PUBLISH", "delivery_stage": "DeliveryStage.DELIVER", "type": "Message"}
INFO:autogen_core.events:{"payload": "{\"content\":{\"content\":\"\\nWe are working to address the following user request:\\n\\ntiramisu recipe\\n\\n\\nTo answer this request we have assembled the following team:\\n\\nWebSurfer: A helpful assistant with access to a web browser. Ask them to perform web searches, open pages, and interact with content (e.g., clicking links, scrolling the viewport, etc., filling in form fields, etc.) It can also summarize the entire page, or answer questions based on the content of the page. It can also be asked to sleep and wait for pages to load, in cases where the pages seem to be taking a while to load.\\nCoder: A helpful and general-purpose AI assistant that has strong language skills, Python skills, and Linux command line skills.\\nExecutor: A agent for executing code\\nfile_surfer: An agent that can handle local files.\\n\\n\\n\\nHere is an initial fact sheet to consider:\\n\\n1. GIVEN OR VERIFIED FACTS\\n2. FACTS TO LOOK UP\\n3. FACTS TO DERIVE\\n4. EDUCATED GUESSES\\n\\n\\nHere is the plan to follow as best as possible:\\n\\n1. WebSurfer: Search for a recipe for tiramisu.\\n2. Coder: Write a Python script that fetches and processes the recipe from the web.\\n3. Executor: Execute the Python script to retrieve the recipe.\\n4. FileSurfer: Open the recipe file and display it to the user.\\n5. WebSurfer: Search for a recipe for tiramisu again, this time using the Python script.\\n6. Coder: Write another Python script that fetches and processes the recipe from the web.\\n7. Executor: Execute the Python script to retrieve the recipe.\\n8. FileSurfer: Open the recipe file and display it to the user.\\n9. WebSurfer: Search for a recipe for tiramisu again, this time using the Python scripts.\\n10. Coder: Write another Python script that fetches and processes the recipe from the web.\\n11. Executor: Execute the Python script to retrieve the recipe.\\n12. FileSurfer: Open the recipe file and display it to the user.\\n13. WebSurfer: Search for a recipe for tiramisu again, this time using the Python scripts.\\n14. Coder: Write another Python script that fetches and processes the recipe from the web.\\n15. Executor: Execute the Python script to retrieve the recipe.\\n16. FileSurfer: Open the recipe file and display it to the user.\\n17. WebSurfer: Search for a recipe for tiramisu again, this time using the Python scripts.\\n18. Coder: Write another Python script that fetches and processes the recipe from the web.\\n19. Executor: Execute the Python script to retrieve the recipe.\\n20. FileSurfer: Open the recipe file and display it to the user.\\n\\nNote: The above plan is a rough outline, and may need to be adjusted based on the specific requirements of the request.\\n\",\"source\":\"Orchestrator\",\"type\":\"UserMessage\"},\"request_halt\":false}", "sender": "Orchestrator/default", "receiver": null, "kind": "MessageKind.PUBLISH", "delivery_stage": "DeliveryStage.DELIVER", "type": "Message"}
INFO:autogen_core.events:{"payload": "{\"content\":{\"content\":\"\\nWe are working to address the following user request:\\n\\ntiramisu recipe\\n\\n\\nTo answer this request we have assembled the following team:\\n\\nWebSurfer: A helpful assistant with access to a web browser. Ask them to perform web searches, open pages, and interact with content (e.g., clicking links, scrolling the viewport, etc., filling in form fields, etc.) It can also summarize the entire page, or answer questions based on the content of the page. It can also be asked to sleep and wait for pages to load, in cases where the pages seem to be taking a while to load.\\nCoder: A helpful and general-purpose AI assistant that has strong language skills, Python skills, and Linux command line skills.\\nExecutor: A agent for executing code\\nfile_surfer: An agent that can handle local files.\\n\\n\\n\\nHere is an initial fact sheet to consider:\\n\\n1. GIVEN OR VERIFIED FACTS\\n2. FACTS TO LOOK UP\\n3. FACTS TO DERIVE\\n4. EDUCATED GUESSES\\n\\n\\nHere is the plan to follow as best as possible:\\n\\n1. WebSurfer: Search for a recipe for tiramisu.\\n2. Coder: Write a Python script that fetches and processes the recipe from the web.\\n3. Executor: Execute the Python script to retrieve the recipe.\\n4. FileSurfer: Open the recipe file and display it to the user.\\n5. WebSurfer: Search for a recipe for tiramisu again, this time using the Python script.\\n6. Coder: Write another Python script that fetches and processes the recipe from the web.\\n7. Executor: Execute the Python script to retrieve the recipe.\\n8. FileSurfer: Open the recipe file and display it to the user.\\n9. WebSurfer: Search for a recipe for tiramisu again, this time using the Python scripts.\\n10. Coder: Write another Python script that fetches and processes the recipe from the web.\\n11. Executor: Execute the Python script to retrieve the recipe.\\n12. FileSurfer: Open the recipe file and display it to the user.\\n13. WebSurfer: Search for a recipe for tiramisu again, this time using the Python scripts.\\n14. Coder: Write another Python script that fetches and processes the recipe from the web.\\n15. Executor: Execute the Python script to retrieve the recipe.\\n16. FileSurfer: Open the recipe file and display it to the user.\\n17. WebSurfer: Search for a recipe for tiramisu again, this time using the Python scripts.\\n18. Coder: Write another Python script that fetches and processes the recipe from the web.\\n19. Executor: Execute the Python script to retrieve the recipe.\\n20. FileSurfer: Open the recipe file and display it to the user.\\n\\nNote: The above plan is a rough outline, and may need to be adjusted based on the specific requirements of the request.\\n\",\"source\":\"Orchestrator\",\"type\":\"UserMessage\"},\"request_halt\":false}", "sender": "Orchestrator/default", "receiver": null, "kind": "MessageKind.PUBLISH", "delivery_stage": "DeliveryStage.DELIVER", "type": "Message"}
INFO:autogen_core.events:{"payload": "{\"content\":{\"content\":\"\\nWe are working to address the following user request:\\n\\ntiramisu recipe\\n\\n\\nTo answer this request we have assembled the following team:\\n\\nWebSurfer: A helpful assistant with access to a web browser. Ask them to perform web searches, open pages, and interact with content (e.g., clicking links, scrolling the viewport, etc., filling in form fields, etc.) It can also summarize the entire page, or answer questions based on the content of the page. It can also be asked to sleep and wait for pages to load, in cases where the pages seem to be taking a while to load.\\nCoder: A helpful and general-purpose AI assistant that has strong language skills, Python skills, and Linux command line skills.\\nExecutor: A agent for executing code\\nfile_surfer: An agent that can handle local files.\\n\\n\\n\\nHere is an initial fact sheet to consider:\\n\\n1. GIVEN OR VERIFIED FACTS\\n2. FACTS TO LOOK UP\\n3. FACTS TO DERIVE\\n4. EDUCATED GUESSES\\n\\n\\nHere is the plan to follow as best as possible:\\n\\n1. WebSurfer: Search for a recipe for tiramisu.\\n2. Coder: Write a Python script that fetches and processes the recipe from the web.\\n3. Executor: Execute the Python script to retrieve the recipe.\\n4. FileSurfer: Open the recipe file and display it to the user.\\n5. WebSurfer: Search for a recipe for tiramisu again, this time using the Python script.\\n6. Coder: Write another Python script that fetches and processes the recipe from the web.\\n7. Executor: Execute the Python script to retrieve the recipe.\\n8. FileSurfer: Open the recipe file and display it to the user.\\n9. WebSurfer: Search for a recipe for tiramisu again, this time using the Python scripts.\\n10. Coder: Write another Python script that fetches and processes the recipe from the web.\\n11. Executor: Execute the Python script to retrieve the recipe.\\n12. FileSurfer: Open the recipe file and display it to the user.\\n13. WebSurfer: Search for a recipe for tiramisu again, this time using the Python scripts.\\n14. Coder: Write another Python script that fetches and processes the recipe from the web.\\n15. Executor: Execute the Python script to retrieve the recipe.\\n16. FileSurfer: Open the recipe file and display it to the user.\\n17. WebSurfer: Search for a recipe for tiramisu again, this time using the Python scripts.\\n18. Coder: Write another Python script that fetches and processes the recipe from the web.\\n19. Executor: Execute the Python script to retrieve the recipe.\\n20. FileSurfer: Open the recipe file and display it to the user.\\n\\nNote: The above plan is a rough outline, and may need to be adjusted based on the specific requirements of the request.\\n\",\"source\":\"Orchestrator\",\"type\":\"UserMessage\"},\"request_halt\":false}", "sender": "Orchestrator/default", "receiver": null, "kind": "MessageKind.PUBLISH", "delivery_stage": "DeliveryStage.DELIVER", "type": "Message"}
ERROR:autogen_core:ErrorprocessingpublishmessageforOrchestrator/defaultTraceback (mostrecentcalllast):
File"C:\Users\Username\autogen\python\packages\autogen-core\src\autogen_core\_single_threaded_agent_runtime.py", line505, in_on_messagereturnawaitagent.on_message(
File"C:\Users\Username\autogen\python\packages\autogen-core\src\autogen_core\_base_agent.py", line113, inon_messagereturnawaitself.on_message_impl(message, ctx)
File"C:\Users\Username\autogen\python\packages\autogen-core\src\autogen_core\_routed_agent.py", line485, inon_message_implreturnawaith(self, message, ctx)
File"C:\Users\Username\autogen\python\packages\autogen-core\src\autogen_core\_routed_agent.py", line149, inwrapperreturn_value=awaitfunc(self, message, ctx)
File"C:\Users\Username\autogen\python\packages\autogen-magentic-one\src\autogen_magentic_one\agents\base_agent.py", line81, inhandle_incoming_messageawaitfutureFile"C:\Users\Username\autogen\python\packages\autogen-magentic-one\src\autogen_magentic_one\agents\base_agent.py", line47, in_processawaitself._handle_broadcast(message, ctx)
File"C:\Users\Username\autogen\python\packages\autogen-magentic-one\src\autogen_magentic_one\agents\orchestrator.py", line278, in_handle_broadcastawaitsuper()._handle_broadcast(message, ctx)
File"C:\Users\Username\autogen\python\packages\autogen-magentic-one\src\autogen_magentic_one\agents\base_orchestrator.py", line75, in_handle_broadcastnext_agent=awaitself._select_next_agent(message.content)
File"C:\Users\Username\autogen\python\packages\autogen-magentic-one\src\autogen_magentic_one\agents\orchestrator.py", line319, in_select_next_agentreturnawaitself._select_next_agent(synthesized_message, cancellation_token)
File"C:\Users\Username\autogen\python\packages\autogen-magentic-one\src\autogen_magentic_one\agents\orchestrator.py", line322, in_select_next_agentledger_dict=awaitself.update_ledger(cancellation_token)
File"C:\Users\Username\autogen\python\packages\autogen-magentic-one\src\autogen_magentic_one\agents\orchestrator.py", line216, inupdate_ledgerledger_response=awaitself._model_client.create(
File"C:\Users\Username\autogen\python\packages\autogen-ext\src\autogen_ext\models\openai\_openai_client.py", line517, increateresult: Union[ParsedChatCompletion[BaseModel], ChatCompletion] =awaitfutureFile"C:\Users\Username\autogen\python\.venv\lib\site-packages\openai\resources\chat\completions.py", line1702, increatereturnawaitself._post(
File"C:\Users\Username\autogen\python\.venv\lib\site-packages\openai\_base_client.py", line1849, inpostreturnawaitself.request(cast_to, opts, stream=stream, stream_cls=stream_cls)
File"C:\Users\Username\autogen\python\.venv\lib\site-packages\openai\_base_client.py", line1543, inrequestreturnawaitself._request(
File"C:\Users\Username\autogen\python\.venv\lib\site-packages\openai\_base_client.py", line1644, in_requestraiseself._make_status_error_from_response(err.response) fromNoneopenai.BadRequestError: Errorcode: 400- {'error': "'response_format.type' must be 'json_schema'"}
INFO:autogen_core.events:{"payload": "{\"content\":{\"content\":\"tiramisu recipe\",\"source\":\"UserProxy\",\"type\":\"UserMessage\"},\"request_halt\":false}", "handling_agent": "Orchestrator/default", "exception": "Error code: 400 - {'error': \"'response_format.type' must be 'json_schema'\"}", "type": "MessageHandlerException"}
Exceptionignoredin: <function_ProactorBasePipeTransport.__del__at0x000002A362A332E0>Traceback (mostrecentcalllast):
File"C:\Users\Username\AppData\Local\Programs\Python\Python310\lib\asyncio\proactor_events.py", line115, in__del___warn(f"unclosed transport {self!r}", ResourceWarning, source=self)
File"C:\Users\Username\AppData\Local\Programs\Python\Python310\lib\asyncio\proactor_events.py", line79, in__repr__info.append(f'fd={self._sock.fileno()}')
File"C:\Users\Username\AppData\Local\Programs\Python\Python310\lib\asyncio\windows_utils.py", line102, infilenoraiseValueError("I/O operation on closed pipe")
ValueError: I/OoperationonclosedpipeExceptionignoredin: <functionBaseSubprocessTransport.__del__at0x000002A362A31870>Traceback (mostrecentcalllast):
File"C:\Users\Username\AppData\Local\Programs\Python\Python310\lib\asyncio\base_subprocess.py", line125, in__del___warn(f"unclosed transport {self!r}", ResourceWarning, source=self)
File"C:\Users\Username\AppData\Local\Programs\Python\Python310\lib\asyncio\base_subprocess.py", line70, in__repr__info.append(f'stdin={stdin.pipe}')
File"C:\Users\Username\AppData\Local\Programs\Python\Python310\lib\asyncio\proactor_events.py", line79, in__repr__info.append(f'fd={self._sock.fileno()}')
File"C:\Users\Username\AppData\Local\Programs\Python\Python310\lib\asyncio\windows_utils.py", line102, infilenoraiseValueError("I/O operation on closed pipe")
ValueError: I/OoperationonclosedpipeExceptionignoredin: <function_ProactorBasePipeTransport.__del__at0x000002A362A332E0>Traceback (mostrecentcalllast):
File"C:\Users\Username\AppData\Local\Programs\Python\Python310\lib\asyncio\proactor_events.py", line115, in__del___warn(f"unclosed transport {self!r}", ResourceWarning, source=self)
File"C:\Users\Username\AppData\Local\Programs\Python\Python310\lib\asyncio\proactor_events.py", line79, in__repr__info.append(f'fd={self._sock.fileno()}')
File"C:\Users\Username\AppData\Local\Programs\Python\Python310\lib\asyncio\windows_utils.py", line102, infilenoraiseValueError("I/O operation on closed pipe")
ValueError: I/Ooperationonclosedpipe
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
This is the error I get and I don't understand why. The model I'm using supports json schemas.
openai.BadRequestError: Error code: 400 - {'error': "'response_format.type' must be 'json_schema'"}
This is in my example file
This is the output
Beta Was this translation helpful? Give feedback.
All reactions