Files

1 line
28 KiB
JSON
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{"repo": "abhii-04/openagent", "files": {"multiagents.ipynb": {"ebf5ff21bcc80e7de4488a3bd08bdd3c69e2a137": {"t": 1785745471.3683753, "n": 11032, "h": "af4d68f433c96286", "c": "{\n \"cells\": [\n {\n \"cell_type\": \"code\",\n \"execution_count\": 27,\n \"id\": \"a3938e6a\",\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"from agents import Agent, WebSearchTool, FileSearchTool , function_tool,Runner\\n\",\n \"from agents.model_settings import ModelSettings\\n\",\n \"from pydantic import BaseModel, Field\\n\",\n \"import asyncio\\n\",\n \"import os\\n\",\n \"from typing import Dict\\n\",\n \"from dotenv import load_dotenv\\n\",\n \"from openai import AsyncOpenAI\\n\",\n \"import requests\\n\",\n \"from agents import RunConfig\\n\",\n \"from agents import set_default_openai_client\\n\",\n \"from agents.models.openai_chatcompletions import OpenAIChatCompletionsModel\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 28,\n \"id\": \"221587ff\",\n \"metadata\": {},\n \"outputs\": [\n {\n \"data\": {\n \"text/plain\": [\n \"True\"\n ]\n },\n \"execution_count\": 28,\n \"metadata\": {},\n \"output_type\": \"execute_result\"\n }\n ],\n \"source\": [\n \"load_dotenv(override=True)\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 29,\n \"id\": \"b0c2e124\",\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"from agents import set_tracing_disabled\\n\",\n \"\\n\",\n \"set_tracing_disabled(True)\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 30,\n \"id\": \"1f5d9983\",\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"pushover_token=os.getenv('PUSHOVER_TOKEN')\\n\",\n \"pushover_url = \\\"https://api.pushover.net/1/messages.json\\\"\\n\",\n \"pushover_user= os.getenv('PUSHOVER_USER')\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 31,\n \"id\": \"53f213ef\",\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"def push(message):\\n\",\n \" payload={\\\"user\\\":pushover_user, \\\"token\\\":pushover_token,\\\"message\\\":message}\\n\",\n \" requests.post(pushover_url,data=payload)\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 32,\n \"id\": \"6de8997e\",\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"from openai import base_url\\n\",\n \"\\n\",\n \"\\n\",\n \"client = AsyncOpenAI(\\n\",\n \" api_key = os.getenv('DEEPSEEK_API_KEY'),\\n\",\n \" base_url = \\\"https://api.deepseek.com\\\"\\n\",\n \")\\n\",\n \"\\n\",\n \"set_default_openai_client(client)\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 33,\n \"id\": \"abf916b3\",\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"orchestrator_instructions = \\\"\\\"\\\"You are the orchestrator.\\n\",\n \"\\n\",\n \"Workflow:\\n\",\n \"1. Call worker exactly once for the user task.\\n\",\n \"2. Call eval exactly once to review the worker output.\\n\",\n \"3. Return the final answer to the user.\\n\",\n \"Do not call tools repeatedly.\\n\",\n \"Do not delegate again after evaluation.\\\"\\\"\\\"\\n\",\n \"\\n\",\n \"\\n\",\n \"\\n\",\n \"evaluator_instructions = \\\"\\\"\\\"You are the Evaluator Agent.\\n\",\n \"\\n\",\n \"Your role is to critically review outputs generated by Worker Agents.\\n\",\n \"\\n\",\n \"Responsibilities:\\n\",\n \"\\n\",\n \"Check factual correctness\\n\",\n \"Detect hallucinations or unsupported claims\\n\",\n \"Verify completeness relative to the assigned task\\n\",\n \"Ensure formatting and structure are correct\\n\",\n \"Identify logical inconsistencies\\n\",\n \"Suggest improvements or corrections if needed\\n\",\n \"\\n\",\n \"Evaluation Criteria:\\n\",\n \"\\n\",\n \"Accuracy\\n\",\n \"Relevance\\n\",\n \"Completeness\\n\",\n \"Clarity\\n\",\n \"Reliability\\n\",\n \"\\n\",\n \"Rules:\\n\",\n \"\\n\",\n \"Be strict and analytical.\\n\",\n \"Never assume outputs are correct.\\n\",\n \"If output quality is poor, explain exactly what should be fixed.\\n\",\n \"If output is acceptable, explicitly approve it.\\n\",\n \"\\n\",\n \"Output Format:\\n\",\n \"\\n\",\n \"Verdict: PASS / FAIL\\n\",\n \"Issues Found\\n\",\n \"Suggested Fixes\\n\",\n \"Confidence Score (1-10) \\\"\\\"\\\"\\n\",\n \"\\n\",\n \"worker_instruction = \\\"\\\"\\\" You are a Worker Agent specialized in executing assigned tasks.\\n\",\n \"\\n\",\n \"Your responsibilities:\\n\",\n \"\\n\",\n \"Focus only on the assigned subtask\\n\",\n \"Produce accurate and concise outputs\\n\",\n \"Avoid unnecessary explanations\\n\",\n \"Return structured and actionable results\\n\",\n \"Ask for clarification only if critical information is missing\\n\",\n \"\\n\",\n \"Rules:\\n\",\n \"\\n\",\n \"Do not change the task objective.\\n\",\n \"Do not perform unrelated actions.\\n\",\n \"Optimize for correctness and efficiency.\\n\",\n \"Return outputs in a machine-readable format whenever possible.\\n\",\n \"If the task cannot be completed, explain why clearly.\\n\",\n \"\\n\",\n \"Behavior:\\n\",\n \"\\n\",\n \"Execute first\\n\",\n \"Minimize reasoning verbosity\\n\",\n \"Stay task-focused\\n\",\n \"Be reliable and deterministic\\n\",\n \"\\n\",\n \"Output Format:\\n\",\n \"\\n\",\n \"Task Summary\\n\",\n \"Execution Result\\n\",\n \"Errors/Limitations (if any)\\\"\\\"\\\"\\n\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 34,\n \"id\": \"4b00e552\",\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"\\n\",\n \"\\n\",\n \"evaluator_agent = Agent(\\n\",\n \" name='evaluator',\\n\",\n \" instructions = evaluator_instructions,\\n\",\n \" model=OpenAIChatCompletionsModel(\\n\",\n \" model='deepseek-v4-flash',\\n\",\n \" openai_client=client\\n\",\n \" )\\n\",\n \")\\n\",\n \"\\n\",\n \"worker_agent=Agent(\\n\",\n \" name='worker',\\n\",\n \" instructions = worker_instruction,\\n\",\n \" model=OpenAIChatCompletionsModel(\\n\",\n \" model='deepseek-v4-flash',\\n\",\n \" openai_client=client\\n\",\n \" )\\n\",\n \" \\n\",\n \")\\n\",\n \"\\n\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 35,\n \"id\": \"3694ad9d\",\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"\\n\",\n \"evaluator_tool = evaluator_agent.as_tool(tool_name='eval', tool_description='you are an evaluator.')\\n\",\n \"worker_tool = worker_agent.as_tool(tool_name='worker', tool_description='you are a worker whose job is to peform all tasks provided to you')\\n\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 36,\n \"id\": \"bad854ee\",\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"get_tools=[worker_tool,evaluator_tool]\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 37,\n \"id\": \"34c5d924\",\n \"metadata\": {},\n \"outputs\": [\n {\n \"name\": \"stdout\",\n \"output_type\": \"stream\",\n \"text\": [\n \"got tools\\n\"\n ]\n }\n ],\n \"source\": [\n \"orchestrator_agent = Agent(\\n\",\n \" name='orchestrator',\\n\",\n \" instructions = orchestrator_instructions,\\n\",\n \" model = OpenAIChatCompletionsModel(\\n\",\n \" model = 'deepseek-v4-flash',\\n\",\n \" openai_client = client\\n\",\n \" ),\\n\",\n \" tools = get_tools\\n\",\n \")\\n\",\n \"print(\\\"got tools\\\")\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 38,\n \"id\": \"8337939c\",\n \"metadata\": {},\n \"outputs\": [\n {\n \"name\": \"stdout\",\n \"output_type\": \"stream\",\n \"text\": [\n \"[FunctionTool(name='worker', description='you are a worker whose job is to peform all tasks provided to you', params_json_schema={'description': 'Default input schema for agent-as-tool calls.', 'properties': {'input': {'title': 'Input', 'type': 'string'}}, 'required': ['input'], 'title': 'AgentAsToolInput', 'type': 'object', 'additionalProperties': False}, on_invoke_tool=<agents.tool._FailureHandlingFunctionToolInvoker object at 0x7ae2bc871d90>, strict_json_schema=True, is_enabled=True, tool_input_guardrails=None, tool_output_guardrails=None, needs_approval=False, timeout_seconds=None, timeout_behavior='error_as_result', timeout_error_function=None, defer_loading=False), FunctionTool(name='eval', description='you are an evaluator.', params_json_schema={'description': 'Default input schema for agent-as-tool calls.', 'properties': {'input': {'title': 'Input', 'type': 'string'}}, 'required': ['input'], 'title': 'AgentAsToolInput', 'type': 'object', 'additionalProperties': False}, on_invoke_tool=<agents.tool._FailureHandlingFunctionToolInvoker object at 0x7ae2bc84dc10>, strict_json_schema=True, is_enabled=True, tool_input_guardrails=None, tool_output_guardrails=None, needs_approval=False, timeout_seconds=None, timeout_behavior='error_as_result', timeout_error_function=None, defer_loading=False)]\\n\"\n ]\n }\n ],\n \"source\": [\n \"type(get_tools)\\n\",\n \"print(get_tools)\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 39,\n \"id\": \"aa965ddc\",\n \"metadata\": {},\n \"outputs\": [\n {\n \"name\": \"stdout\",\n \"output_type\": \"stream\",\n \"text\": [\n \"# Max Verstappen 🏎️\\n\",\n \"\\n\",\n \"Max Verstappen is a **Dutch Formula 1 driver**, born **September 30, 1997**, who races for **Red Bull Racing**. He is widely regarded as one of the greatest talents in F1 history.\\n\",\n \"\\n\",\n \"---\\n\",\n \"\\n\",\n \"## 🏆 Championships\\n\",\n \"- **4-time World Drivers' Champion** (2021, 2022, 2023, 2024)\\n\",\n \"\\n\",\n \"## 🚀 Career Journey\\n\",\n \"- Debuted in F1 in **2015** with Scuderia Toro Rosso at just **17 years old** — becoming the **youngest driver in F1 history**\\n\",\n \"- Moved to Red Bull in **2016** and won his **first race on debut** at the Spanish Grand Prix\\n\",\n \"- Has since become the dominant force in modern F1\\n\",\n \"\\n\",\n \"## 🔥 Major Achievements & Records\\n\",\n \"- **Most wins in a single season**: 19 (2023)\\n\",\n \"- **Most consecutive wins**: 10 (2023)\\n\",\n \"- **Youngest Grand Prix winner ever** (18 years, 228 days)\\n\",\n \"- **2023 season**: Broke records for most wins, most podium finishes (21), and most points in a season\\n\",\n \"- **2024**: Secured his fourth consecutive world title\\n\",\n \"\\n\",\n \"## 💡 Key Facts\\n\",\n \"- Son of former F1 driver **Jos Verstappen** and karting champion **Sophie Kumpen**\\n\",\n \"- Known for his **aggressive driving style** and exceptional **overtaking skills**\\n\",\n \"- His **2021 title win** was decided on the final lap of the Abu Dhabi Grand Prix under highly controversial Safety Car procedures\\n\",\n \"- Holds the record for **most podium finishes in a single season** (21 out of 22 races in 2023)\\n\",\n \"\\n\",\n \"Verstappen's rise from a teenage prodigy to a four-time world champion has cemented his legacy as one of the all-time greats in Formula 1.\\n\"\n ]\n }\n ],\n \"source\": [\n \"result = await Runner.run(\\n\",\n \" orchestrator_agent,\\n\",\n \" \\\"Tell me about max verstappen\\\",\\n\",\n \" max_turns=3\\n\",\n \")\\n\",\n \"print(result.final_output)\\n\",\n \"push(result.final_output)\"\n ]\n }\n ],\n \"metadata\": {\n \"kernelspec\": {\n \"display_name\": \"X-Agent2\",\n \"language\": \"python\",\n \"name\": \"python3\"\n },\n \"language_info\": {\n \"codemirror_mode\": {\n \"name\": \"ipython\",\n \"version\": 3\n },\n \"file_extension\": \".py\",\n \"mimetype\": \"text/x-python\",\n \"name\": \"python\",\n \"nbconvert_exporter\": \"python\",\n \"pygments_lexer\": \"ipython3\",\n \"version\": \"3.11.15\"\n }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 5\n}\n"}, "1579004bf15a307eb9ad25ddf30376bb07548891": {"t": 1785753578.4792337, "n": 13870, "h": "b3d99cc636b4e8bf", "c": "{\n \"cells\": [\n {\n \"cell_type\": \"code\",\n \"execution_count\": 66,\n \"id\": \"a3938e6a\",\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"from agents import Agent, WebSearchTool, FileSearchTool , function_tool,Runner\\n\",\n \"from agents.model_settings import ModelSettings\\n\",\n \"from pydantic import BaseModel, Field\\n\",\n \"import asyncio\\n\",\n \"import os\\n\",\n \"from typing import Dict\\n\",\n \"from dotenv import load_dotenv\\n\",\n \"from openai import AsyncOpenAI\\n\",\n \"import requests\\n\",\n \"from agents import RunConfig\\n\",\n \"from agents import set_default_openai_client\\n\",\n \"from agents.models.openai_chatcompletions import OpenAIChatCompletionsModel\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 67,\n \"id\": \"221587ff\",\n \"metadata\": {},\n \"outputs\": [\n {\n \"data\": {\n \"text/plain\": [\n \"True\"\n ]\n },\n \"execution_count\": 67,\n \"metadata\": {},\n \"output_type\": \"execute_result\"\n }\n ],\n \"source\": [\n \"load_dotenv(override=True)\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 77,\n \"id\": \"b0c2e124\",\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"from agents import set_tracing_disabled\\n\",\n \"\\n\",\n \"set_tracing_disabled(True)\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 68,\n \"id\": \"1f5d9983\",\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"pushover_token=os.getenv('PUSHOVER_TOKEN')\\n\",\n \"pushover_url = \\\"https://api.pushover.net/1/messages.json\\\"\\n\",\n \"pushover_user= os.getenv('PUSHOVER_USER')\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 69,\n \"id\": \"53f213ef\",\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"def push(message):\\n\",\n \" payload={\\\"user\\\":pushover_user, \\\"token\\\":pushover_token,\\\"message\\\":message}\\n\",\n \" requests.post(pushover_url,data=payload)\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 70,\n \"id\": \"6de8997e\",\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"from openai import base_url\\n\",\n \"\\n\",\n \"\\n\",\n \"client = AsyncOpenAI(\\n\",\n \" api_key = os.getenv('DEEPSEEK_API_KEY'),\\n\",\n \" base_url = \\\"https://api.deepseek.com\\\"\\n\",\n \")\\n\",\n \"\\n\",\n \"set_default_openai_client(client)\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 71,\n \"id\": \"abf916b3\",\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"orchestrator_instructions = \\\"\\\"\\\"You are the Orchestrator Agent.\\n\",\n \"\\n\",\n \"Your job is to:\\n\",\n \"\\n\",\n \"Understand the user's goal\\n\",\n \"Break the task into smaller actionable subtasks\\n\",\n \"Decide which Worker Agent should handle each task\\n\",\n \"Maintain execution flow and context\\n\",\n \"Combine all outputs into a final coherent response\\n\",\n \"\\n\",\n \"Rules:\\n\",\n \"\\n\",\n \"Never directly solve complex subtasks yourself unless trivial.\\n\",\n \"Delegate tasks clearly and efficiently.\\n\",\n \"Keep track of completed vs pending tasks.\\n\",\n \"Validate whether worker outputs satisfy the original objective.\\n\",\n \"If a worker fails or gives incomplete output, retry with improved instructions.\\n\",\n \"Optimize for accuracy, speed, and minimal token usage.\\n\",\n \"Always think step-by-step before assigning work.\\n\",\n \"\\n\",\n \"Output Format:\\n\",\n \"\\n\",\n \"Objective\\n\",\n \"Task Breakdown\\n\",\n \"Assigned Workers\\n\",\n \"Current Status\\n\",\n \"Final Combined Output\\\"\\\"\\\"\\n\",\n \"\\n\",\n \"\\n\",\n \"\\n\",\n \"evaluator_instructions = \\\"\\\"\\\"You are the Evaluator Agent.\\n\",\n \"\\n\",\n \"Your role is to critically review outputs generated by Worker Agents.\\n\",\n \"\\n\",\n \"Responsibilities:\\n\",\n \"\\n\",\n \"Check factual correctness\\n\",\n \"Detect hallucinations or unsupported claims\\n\",\n \"Verify completeness relative to the assigned task\\n\",\n \"Ensure formatting and structure are correct\\n\",\n \"Identify logical inconsistencies\\n\",\n \"Suggest improvements or corrections if needed\\n\",\n \"\\n\",\n \"Evaluation Criteria:\\n\",\n \"\\n\",\n \"Accuracy\\n\",\n \"Relevance\\n\",\n \"Completeness\\n\",\n \"Clarity\\n\",\n \"Reliability\\n\",\n \"\\n\",\n \"Rules:\\n\",\n \"\\n\",\n \"Be strict and analytical.\\n\",\n \"Never assume outputs are correct.\\n\",\n \"If output quality is poor, explain exactly what should be fixed.\\n\",\n \"If output is acceptable, explicitly approve it.\\n\",\n \"\\n\",\n \"Output Format:\\n\",\n \"\\n\",\n \"Verdict: PASS / FAIL\\n\",\n \"Issues Found\\n\",\n \"Suggested Fixes\\n\",\n \"Confidence Score (1-10) \\\"\\\"\\\"\\n\",\n \"\\n\",\n \"worker_instruction = \\\"\\\"\\\" You are a Worker Agent specialized in executing assigned tasks.\\n\",\n \"\\n\",\n \"Your responsibilities:\\n\",\n \"\\n\",\n \"Focus only on the assigned subtask\\n\",\n \"Produce accurate and concise outputs\\n\",\n \"Avoid unnecessary explanations\\n\",\n \"Return structured and actionable results\\n\",\n \"Ask for clarification only if critical information is missing\\n\",\n \"\\n\",\n \"Rules:\\n\",\n \"\\n\",\n \"Do not change the task objective.\\n\",\n \"Do not perform unrelated actions.\\n\",\n \"Optimize for correctness and efficiency.\\n\",\n \"Return outputs in a machine-readable format whenever possible.\\n\",\n \"If the task cannot be completed, explain why clearly.\\n\",\n \"\\n\",\n \"Behavior:\\n\",\n \"\\n\",\n \"Execute first\\n\",\n \"Minimize reasoning verbosity\\n\",\n \"Stay task-focused\\n\",\n \"Be reliable and deterministic\\n\",\n \"\\n\",\n \"Output Format:\\n\",\n \"\\n\",\n \"Task Summary\\n\",\n \"Execution Result\\n\",\n \"Errors/Limitations (if any)\\\"\\\"\\\"\\n\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 72,\n \"id\": \"4b00e552\",\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"\\n\",\n \"\\n\",\n \"evaluator_agent = Agent(\\n\",\n \" name='evaluator',\\n\",\n \" instructions = 'you are an evaluator',\\n\",\n \" model=OpenAIChatCompletionsModel(\\n\",\n \" model='deepseek-v4-flash',\\n\",\n \" openai_client=client\\n\",\n \" )\\n\",\n \")\\n\",\n \"\\n\",\n \"worker_agent=Agent(\\n\",\n \" name='worker',\\n\",\n \" instructions = 'you are a worker agent whose tasks is to peform the work given to you',\\n\",\n \" model=OpenAIChatCompletionsModel(\\n\",\n \" model='deepseek-v4-flash',\\n\",\n \" openai_client=client\\n\",\n \" )\\n\",\n \" \\n\",\n \")\\n\",\n \"\\n\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 73,\n \"id\": \"3694ad9d\",\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"\\n\",\n \"evaluator_tool = evaluator_agent.as_tool(tool_name='eval', tool_description='you are an evaluator.')\\n\",\n \"worker_tool = worker_agent.as_tool(tool_name='worker', tool_description='you are a worker whose job is to peform all tasks provided to you')\\n\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 74,\n \"id\": \"bad854ee\",\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"tools=[worker_tool,evaluator_tool]\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 75,\n \"id\": \"34c5d924\",\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"orchestrator_agent = Agent(\\n\",\n \" name='orchestrator',\\n\",\n \" instructions = 'You are the Orchestrator Agent',\\n\",\n \" model = OpenAIChatCompletionsModel(\\n\",\n \" model = 'deepseek-v4-flash',\\n\",\n \" openai_client = client\\n\",\n \" ),\\n\",\n \" tools = tools\\n\",\n \")\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 76,\n \"id\": \"aa965ddc\",\n \"metadata\": {},\n \"outputs\": [\n {\n \"name\": \"stderr\",\n \"output_type\": \"stream\",\n \"text\": [\n \"[non-fatal] Tracing client error 401: {\\n\",\n \" \\\"error\\\": {\\n\",\n \" \\\"message\\\": \\\"Incorrect API key provided: sk-d1509***********************73b3. You can find your API key at https://platform.openai.com/account/api-keys.\\\",\\n\",\n \" \\\"type\\\": \\\"invalid_request_error\\\",\\n\",\n \" \\\"code\\\": \\\"invalid_api_key\\\",\\n\",\n \" \\\"param\\\": null\\n\",\n \" },\\n\",\n \" \\\"status\\\": 401\\n\",\n \"}\\n\",\n \"[non-fatal] Tracing client error 401: {\\n\",\n \" \\\"error\\\": {\\n\",\n \" \\\"message\\\": \\\"Incorrect API key provided: sk-d1509***********************73b3. You can find your API key at https://platform.openai.com/account/api-keys.\\\",\\n\",\n \" \\\"type\\\": \\\"invalid_request_error\\\",\\n\",\n \" \\\"code\\\": \\\"invalid_api_key\\\",\\n\",\n \" \\\"param\\\": null\\n\",\n \" },\\n\",\n \" \\\"status\\\": 401\\n\",\n \"}\\n\",\n \"[non-fatal] Tracing client error 401: {\\n\",\n \" \\\"error\\\": {\\n\",\n \" \\\"message\\\": \\\"Incorrect API key provided: sk-d1509***********************73b3. You can find your API key at https://platform.openai.com/account/api-keys.\\\",\\n\",\n \" \\\"type\\\": \\\"invalid_request_error\\\",\\n\",\n \" \\\"code\\\": \\\"invalid_api_key\\\",\\n\",\n \" \\\"param\\\": null\\n\",\n \" },\\n\",\n \" \\\"status\\\": 401\\n\",\n \"}\\n\"\n ]\n },\n {\n \"name\": \"stdout\",\n \"output_type\": \"stream\",\n \"text\": [\n \"# 🏎️ Max Verstappen - The Reigning King of Formula 1\\n\",\n \"\\n\",\n \"Here's a comprehensive look at one of the most dominant drivers in F1 history!\\n\",\n \"\\n\",\n \"---\\n\",\n \"\\n\",\n \"## 📋 Quick Facts\\n\",\n \"\\n\",\n \"| Detail | Info |\\n\",\n \"|--------|------|\\n\",\n \"| **Full Name** | Max Emilian Verstappen |\\n\",\n \"| **Nationality** | 🇳🇱 Dutch (also holds Belgian nationality) |\\n\",\n \"| **Date of Birth** | September 30, 1997 (27 years old) |\\n\",\n \"| **Team** | Oracle Red Bull Racing |\\n\",\n \"| **Car Number** | #1 (previously #33) |\\n\",\n \"\\n\",\n \"---\\n\",\n \"\\n\",\n \"## 🏆 Championship Titles (4 Consecutive!)\\n\",\n \"\\n\",\n \"| Year | Key Stats | The Story |\\n\",\n \"|------|-----------|-----------|\\n\",\n \"| **2021** | 10 wins, 18 podiums | Won his **first title** in a legendary, controversial battle against Lewis Hamilton in Abu Dhabi — final lap decider! |\\n\",\n \"| **2022** | 15 wins (record at the time) | Full dominance began with the new regulations. Won 15 of 22 races. |\\n\",\n \"| **2023** | **19 wins** out of 22! | Arguably the most dominant season **ever** in F1. Won **10 consecutive races**! |\\n\",\n \"| **2024** | 9 wins, 14 podiums | Showed incredible resilience — started strong, then navigated a 10-race winless streak to still take the title. |\\n\",\n \"\\n\",\n \"---\\n\",\n \"\\n\",\n \"## 🔥 Mind-Blowing Records\\n\",\n \"\\n\",\n \"- **Youngest F1 winner ever** — 18 years & 228 days (2016 Spanish GP, his *debut* for Red Bull!)\\n\",\n \"- **Most wins in a season** — 19 (2023)\\n\",\n \"- **Most consecutive wins** — 10 (2023)\\n\",\n \"- **Most consecutive seasons with a win** — 10 (2015–2024) — literally every season he's raced!\\n\",\n \"- **63 career Grand Prix wins** — 3rd all-time (behind only Hamilton & Schumacher)\\n\",\n \"- **40 pole positions**, **112 podiums**\\n\",\n \"\\n\",\n \"---\\n\",\n \"\\n\",\n \"## 🚀 The Early Days\\n\",\n \"\\n\",\n \"Verstappen was a **karting prodigy** — winning world championships before jumping directly into European Formula 3 (skipping F4!). He made his F1 debut at **just 17 years old** with Toro Rosso in 2015, the youngest driver ever to start a Grand Prix.\\n\",\n \"\\n\",\n \"In 2016, after just 5 races, Red Bull promoted him... and he **won his first race for them** instantly. In his entire F1 career, he's won at least one race every single season.\\n\",\n \"\\n\",\n \"---\\n\",\n \"\\n\",\n \"## 🎮 Beyond Racing\\n\",\n \"\\n\",\n \"- **Sim racing enthusiast** — competes in events like the iRacing 24 Hours of Le Mans with Team Redline\\n\",\n \"- **Personality** — Known for being refreshingly candid and unfiltered. Says he \\\"drives on feel\\\" rather than data\\n\",\n \"- **Family** — Son of ex-F1 driver Jos Verstappen. In a relationship with Kelly Piquet (daughter of 3-time F1 champion Nelson Piquet)\\n\",\n \"\\n\",\n \"---\\n\",\n \"\\n\",\n \"## 💭 What Makes Him Special?\\n\",\n \"\\n\",\n \"Driving style experts describe him as having:\\n\",\n \"- **Unreal car control** — can catch slides no one else can\\n\",\n \"- **Late-braking king** — overtakes where others wouldn't dare\\n\",\n \"- **Rain master** — often in a league of his own in wet conditions (see Brazil 2016, Japan 2022)\\n\",\n \"- **Fierce competitor** — races with a \\\"win or nothing\\\" mentality\\n\",\n \"\\n\",\n \"At just **27 years old** with 4 titles already, he's well on his way to challenging the all-time greats like Hamilton and Schumacher. And he's not done yet! 🏁\\n\",\n \"\\n\",\n \"---\\n\",\n \"\\n\",\n \"**Is there a specific aspect of Max's career you'd like to dive deeper into?**\\n\"\n ]\n },\n {\n \"name\": \"stderr\",\n \"output_type\": \"stream\",\n \"text\": [\n \"[non-fatal] Tracing client error 401: {\\n\",\n \" \\\"error\\\": {\\n\",\n \" \\\"message\\\": \\\"Incorrect API key provided: sk-d1509***********************73b3. You can find your API key at https://platform.openai.com/account/api-keys.\\\",\\n\",\n \" \\\"type\\\": \\\"invalid_request_error\\\",\\n\",\n \" \\\"code\\\": \\\"invalid_api_key\\\",\\n\",\n \" \\\"param\\\": null\\n\",\n \" },\\n\",\n \" \\\"status\\\": 401\\n\",\n \"}\\n\"\n ]\n }\n ],\n \"source\": [\n \"result = await Runner.run(\\n\",\n \" orchestrator_agent,\\n\",\n \" \\\"Tell me about max verstappen\\\"\\n\",\n \")\\n\",\n \"print(result.final_output)\\n\",\n \"push(result.final_output)\"\n ]\n }\n ],\n \"metadata\": {\n \"kernelspec\": {\n \"display_name\": \".venv\",\n \"language\": \"python\",\n \"name\": \"python3\"\n },\n \"language_info\": {\n \"codemirror_mode\": {\n \"name\": \"ipython\",\n \"version\": 3\n },\n \"file_extension\": \".py\",\n \"mimetype\": \"text/x-python\",\n \"name\": \"python\",\n \"nbconvert_exporter\": \"python\",\n \"pygments_lexer\": \"ipython3\",\n \"version\": \"3.11.15\"\n }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 5\n}\n"}}}}