|
6 | 6 | "metadata": {}, |
7 | 7 | "outputs": [], |
8 | 8 | "source": [ |
9 | | - "# Install dependencies. \n", |
| 9 | + "# Install dependencies.\n", |
10 | 10 | "!pip install -U agentops openai-agents" |
11 | 11 | ] |
12 | 12 | }, |
|
19 | 19 | "# Set the API keys for your AgentOps and OpenAI accounts.\n", |
20 | 20 | "import os\n", |
21 | 21 | "\n", |
22 | | - "os.environ[\"OPENAI_API_KEY\"] = ''\n", |
23 | | - "os.environ[\"AGENTOPS_API_KEY\"] = ''\n", |
| 22 | + "os.environ[\"OPENAI_API_KEY\"] = \"\"\n", |
| 23 | + "os.environ[\"AGENTOPS_API_KEY\"] = \"\"\n", |
24 | 24 | "\n", |
25 | | - "if os.environ[\"OPENAI_API_KEY\"] == '':\n", |
| 25 | + "if os.environ[\"OPENAI_API_KEY\"] == \"\":\n", |
26 | 26 | " raise ValueError(\"OPENAI_API_KEY is not set. You can get one at https://platform.openai.com/api-keys\")\n", |
27 | | - "if os.environ[\"AGENTOPS_API_KEY\"] == '':\n", |
28 | | - " raise ValueError(\"AGENTOPS_API_KEY is not set. You can get one at https://app.agentops.ai/\")\n" |
| 27 | + "if os.environ[\"AGENTOPS_API_KEY\"] == \"\":\n", |
| 28 | + " raise ValueError(\"AGENTOPS_API_KEY is not set. You can get one at https://app.agentops.ai/\")" |
29 | 29 | ] |
30 | 30 | }, |
31 | 31 | { |
|
73 | 73 | "### TOOLS\n", |
74 | 74 | "\n", |
75 | 75 | "\n", |
76 | | - "@function_tool(\n", |
77 | | - " name_override=\"faq_lookup_tool\", description_override=\"Lookup frequently asked questions.\"\n", |
78 | | - ")\n", |
| 76 | + "@function_tool(name_override=\"faq_lookup_tool\", description_override=\"Lookup frequently asked questions.\")\n", |
79 | 77 | "async def faq_lookup_tool(question: str) -> str:\n", |
80 | 78 | " if \"bag\" in question or \"baggage\" in question:\n", |
81 | 79 | " return (\n", |
|
95 | 93 | "\n", |
96 | 94 | "\n", |
97 | 95 | "@function_tool\n", |
98 | | - "async def update_seat(\n", |
99 | | - " context: RunContextWrapper[AirlineAgentContext], confirmation_number: str, new_seat: str\n", |
100 | | - ") -> str:\n", |
| 96 | + "async def update_seat(context: RunContextWrapper[AirlineAgentContext], confirmation_number: str, new_seat: str) -> str:\n", |
101 | 97 | " \"\"\"\n", |
102 | 98 | " Update the seat for a given confirmation number.\n", |
103 | 99 | "\n", |
|
190 | 186 | " if isinstance(new_item, MessageOutputItem):\n", |
191 | 187 | " print(f\"{agent_name}: {ItemHelpers.text_message_output(new_item)}\")\n", |
192 | 188 | " elif isinstance(new_item, HandoffOutputItem):\n", |
193 | | - " print(\n", |
194 | | - " f\"Handed off from {new_item.source_agent.name} to {new_item.target_agent.name}\"\n", |
195 | | - " )\n", |
| 189 | + " print(f\"Handed off from {new_item.source_agent.name} to {new_item.target_agent.name}\")\n", |
196 | 190 | " elif isinstance(new_item, ToolCallItem):\n", |
197 | 191 | " print(f\"{agent_name}: Calling a tool\")\n", |
198 | 192 | " elif isinstance(new_item, ToolCallOutputItem):\n", |
|
0 commit comments