Skip to content

armgit / burr

Public Imported from GitHub
0

Build applications that make decisions (chatbots, agents, simulations, etc...). Monitor, trace, persist, and execute on your own infrastructure.

Fixes google colab use of hamilton notebook

Stefan Krawczyk7ccdca8b8432
diff --git a/examples/multi-agent-collaboration/hamilton/notebook.ipynb b/examples/multi-agent-collaboration/hamilton/notebook.ipynb
index c809f9eb..f51f6273 100644
--- a/examples/multi-agent-collaboration/hamilton/notebook.ipynb
+++ b/examples/multi-agent-collaboration/hamilton/notebook.ipynb
@@ -40,7 +40,7 @@
},
{
"cell_type": "code",
- "execution_count": 2,
+ "execution_count": 1,
"id": "642649bc6414efb4",
"metadata": {
"ExecuteTime": {
@@ -63,7 +63,7 @@
},
{
"cell_type": "code",
- "execution_count": 20,
+ "execution_count": 2,
"id": "1bd6ddb8fb909d38",
"metadata": {
"ExecuteTime": {
@@ -90,8 +90,289 @@
"from burr.lifecycle import PostRunStepHook\n",
"from burr.tracking import client as burr_tclient\n",
"\n",
- "# our hamilton module -- see below\n",
- "import func_agent"
+ "# load hamilton plugin for notebooks\n",
+ "%load_ext hamilton.plugins.jupyter_magic"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "id": "a1ddfc29-ca7b-469f-840e-787ab713e026",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "%%cell_to_module -m func_agent \n",
+ "\"\"\"\n",
+ "Hamilton module that defines the pipeline for\n",
+ "hitting an LLM model and asking it what to do.\n",
+ "You can find this code in `func_agent.py` but we \"inline\" it here\n",
+ "to work in google colab.\n",
+ "\"\"\"\n",
+ "\n",
+ "import inspect\n",
+ "import json\n",
+ "from typing import Callable\n",
+ "\n",
+ "import openai\n",
+ "from langchain_core.utils.function_calling import convert_to_openai_function\n",
+ "\n",
+ "\n",
+ "def llm_client() -> openai.OpenAI:\n",
+ " return openai.OpenAI()\n",
+ "\n",
+ "\n",
+ "def tool_names(tool_function_specs: list[dict]) -> list[str]:\n",
+ " \"\"\"Get the names of the tools from the tool function specs.\"\"\"\n",
+ " return [tool[\"function\"][\"name\"] for tool in tool_function_specs]\n",
+ "\n",
+ "\n",
+ "def _langchain_tool_spec(tool: Callable) -> dict:\n",
+ " \"\"\"Converts a tool to a langchain tool spec.\"\"\"\n",
+ " t = convert_to_openai_function(tool)\n",
+ " # print(t)\n",
+ " return t\n",
+ "\n",
+ "\n",
+ "def _tool_function_spec(tool: Callable) -> dict:\n",
+ " \"\"\"Converts a python function into a specification for function calling.\n",
+ "\n",
+ " This is a little hacky. But it works.\n",
+ "\n",
+ " It takes a function, introspects it, and returns a spec.\n",
+ "\n",
+ " :param tool:\n",
+ " :return:\n",
+ " \"\"\"\n",
+ " # TODO: maybe just get people to wrap any external tool in a function\n",
+ " # to make it clear what is going on.\n",
+ " if hasattr(tool, \"name\") and hasattr(tool, \"description\") and hasattr(tool, \"args_schema\"):\n",
+ " return {\"type\": \"function\", \"function\": _langchain_tool_spec(tool)}\n",
+ " func_sig = inspect.signature(tool)\n",
+ " name = tool.__name__\n",
+ " docstring = inspect.getdoc(tool)\n",
+ " doc_lines = docstring.split(\"\\n\") if docstring else []\n",
+ " description = \"\"\n",
+ " for line in doc_lines:\n",
+ " stripped = line.strip()\n",
+ " if stripped.startswith(\":\"):\n",
+ " # we have reached the end of the description\n",
+ " break\n",
+ " description += stripped + \"\\n\"\n",
+ " description = description.strip()\n",
+ " param_descriptions = {}\n",
+ " for line in doc_lines:\n",
+ " stripped = line.strip()\n",
+ " if stripped.startswith(\":param\"):\n",
+ " parts = stripped.split(\" \", 2)\n",
+ " param_name = parts[1].strip(\":\")\n",
+ " param_description = parts[2]\n",
+ " param_descriptions[param_name] = param_description\n",
+ " parameters = func_sig.parameters\n",
+ " func_parameters = {}\n",
+ " required = []\n",
+ " for param_name, param in parameters.items():\n",
+ " param_type = param.annotation\n",
+ " param_description = param_descriptions.get(param_name, \"\")\n",
+ " if param_type == str:\n",
+ " param_type = \"string\"\n",
+ " elif param_type == int:\n",
+ " param_type = \"integer\"\n",
+ " elif param_type == float:\n",
+ " param_type = \"float\"\n",
+ " else:\n",
+ " raise ValueError(f\"Unsupported parameter type: {param_type}\")\n",
+ " func_parameters[param_name] = {\n",
+ " \"type\": param_type,\n",
+ " \"description\": param_description,\n",
+ " }\n",
+ " if param.default == inspect.Parameter.empty:\n",
+ " required.append(param_name)\n",
+ " else:\n",
+ " func_parameters[param_name][\"description\"] += f\" Defaults to {param.default}.\"\n",
+ "\n",
+ " return {\n",
+ " \"type\": \"function\",\n",
+ " \"function\": {\n",
+ " \"name\": name,\n",
+ " \"description\": description,\n",
+ " \"parameters\": {\n",
+ " \"type\": \"object\",\n",
+ " \"properties\": func_parameters,\n",
+ " \"required\": required,\n",
+ " },\n",
+ " },\n",
+ " }\n",
+ "\n",
+ "\n",
+ "def tool_function_specs(tools: list[Callable]) -> list[dict]:\n",
+ " \"\"\"Converts a list of tools into a list of tool function specs.\"\"\"\n",
+ " return [_tool_function_spec(tool) for tool in tools]\n",
+ "\n",
+ "\n",
+ "def base_system_prompt(tool_names: list[str], system_message: str) -> str:\n",
+ " \"\"\"Creates the base system prompt for the pipeline.\"\"\"\n",
+ " return (\n",
+ " \"You are a helpful AI assistant, collaborating with other assistants.\"\n",
+ " \" Use the provided tools to progress towards answering the question.\"\n",
+ " \" If you are unable to fully answer, that's OK, another assistant with different tools \"\n",
+ " \" will help where you left off. Execute what you can to make progress.\\n\\n\"\n",
+ " \"If you or any of the other assistants have the final answer or deliverable,\"\n",
+ " \" prefix your response with 'FINAL ANSWER' so the team knows to stop.\\n\\n\"\n",
+ " f\"You have access to the following tools: {tool_names}.\\n{system_message}\\n\\n\"\n",
+ " \"Remember to prefix your response with 'FINAL ANSWER' if you or another assistant \"\n",
+ " \"thinks the task is complete; assume the user can visualize the result.\"\n",
+ " )\n",
+ "\n",
+ "\n",
+ "def message_history(base_system_prompt: str, user_query: str, messages: list[dict]) -> list[dict]:\n",
+ " \"\"\"Creates the message history for the LLM model.\n",
+ "\n",
+ " :param base_system_prompt:\n",
+ " :param user_query:\n",
+ " :param messages:\n",
+ " :return:\n",
+ " \"\"\"\n",
+ " base = [\n",
+ " {\"role\": \"system\", \"content\": base_system_prompt},\n",
+ " {\"role\": \"user\", \"content\": user_query},\n",
+ " ]\n",
+ " sanitized_messages = []\n",
+ " for message in messages:\n",
+ " message_copy = message.copy()\n",
+ " if not isinstance(message_copy[\"content\"], str) and message_copy[\"content\"] is not None:\n",
+ " message_copy[\"content\"] = (\n",
+ " json.dumps(message_copy[\"content\"]) if message_copy[\"content\"] else None\n",
+ " )\n",
+ " sanitized_messages.append(message_copy)\n",
+ " return base + sanitized_messages\n",
+ "\n",
+ "\n",
+ "def llm_function_response(\n",
+ " message_history: list[dict],\n",
+ " tool_function_specs: list[dict],\n",
+ " llm_client: openai.OpenAI,\n",
+ ") -> openai.types.chat.chat_completion.ChatCompletion:\n",
+ " \"\"\"Creates the function response from the LLM model for the given prompt & functions.\n",
+ "\n",
+ " :param message_history:\n",
+ " :param tool_function_specs:\n",
+ " :param llm_client:\n",
+ " :return:\n",
+ " \"\"\"\n",
+ " response = llm_client.chat.completions.create(\n",
+ " model=\"gpt-4-1106-preview\",\n",
+ " messages=message_history,\n",
+ " tools=tool_function_specs,\n",
+ " tool_choice=\"auto\",\n",
+ " )\n",
+ " return response\n",
+ "\n",
+ "\n",
+ "def llm_function_message(\n",
+ " llm_function_response: openai.types.chat.chat_completion.ChatCompletion,\n",
+ ") -> dict:\n",
+ " \"\"\"Parses the LLM response message. Does extra parsing for tool invocations.\"\"\"\n",
+ " response_message = llm_function_response.choices[0].message\n",
+ " if response_message.tool_calls:\n",
+ " return {\n",
+ " \"role\": response_message.role,\n",
+ " \"content\": None,\n",
+ " \"tool_calls\": [\n",
+ " {\n",
+ " \"id\": t.id,\n",
+ " \"type\": \"function\",\n",
+ " \"function\": {\"name\": t.function.name, \"arguments\": t.function.arguments},\n",
+ " }\n",
+ " for t in response_message.tool_calls\n",
+ " ],\n",
+ " }\n",
+ " return {\n",
+ " \"role\": \"assistant\",\n",
+ " \"content\": response_message.content,\n",
+ " }\n",
+ "\n",
+ "\n",
+ "def parsed_tool_calls(\n",
+ " llm_function_response: openai.types.chat.chat_completion.ChatCompletion,\n",
+ ") -> list[dict]:\n",
+ " \"\"\"Parses the tool calls from the LLM response message.\n",
+ "\n",
+ " :param llm_function_response: The response from the LLM model.\n",
+ " :return: The parsed tool calls.\n",
+ " \"\"\"\n",
+ " response_message = llm_function_response.choices[0].message\n",
+ " tool_calls = response_message.tool_calls\n",
+ " parsed_calls = []\n",
+ " if tool_calls:\n",
+ " for tool_call in tool_calls:\n",
+ " func_call = {\n",
+ " \"id\": tool_call.id,\n",
+ " \"function_name\": tool_call.function.name,\n",
+ " \"function_args\": tool_call.function.arguments,\n",
+ " }\n",
+ " parsed_calls.append(func_call)\n",
+ " return parsed_calls\n",
+ "\n",
+ "\n",
+ "def executed_tool_calls(\n",
+ " parsed_tool_calls: list[dict], tools: list[Callable]\n",
+ ") -> list[tuple[str, dict]]:\n",
+ " \"\"\"Executes the parsed tool calls.\n",
+ "\n",
+ " :param parsed_tool_calls: The parsed tool calls.\n",
+ " :param tools: The tools to execute.\n",
+ " :return: The results of the tool calls.\n",
+ " \"\"\"\n",
+ " results = []\n",
+ " for tool_call in parsed_tool_calls:\n",
+ " tool_name = tool_call[\"function_name\"]\n",
+ " tool_args = tool_call[\"function_args\"]\n",
+ " tool_found = False\n",
+ " for tool in tools:\n",
+ " name = getattr(tool, \"name\", None)\n",
+ " if name is None:\n",
+ " name = tool.__name__\n",
+ " if name == tool_name:\n",
+ " tool_found = True\n",
+ " kwargs = json.loads(tool_args)\n",
+ " if hasattr(tool, \"_run\"):\n",
+ " result = tool._run(**kwargs)\n",
+ " else:\n",
+ " result = tool(**kwargs)\n",
+ " results.append(\n",
+ " (\n",
+ " tool_name,\n",
+ " {\n",
+ " \"tool_call_id\": tool_call[\"id\"],\n",
+ " \"role\": \"tool\",\n",
+ " \"name\": tool_name,\n",
+ " \"content\": result, # note: might not be a string.\n",
+ " },\n",
+ " )\n",
+ " )\n",
+ " if not tool_found:\n",
+ " raise ValueError(f\"Tool {tool_name} not found.\")\n",
+ " # TODO: do we add a sentinel if no tool call was required.\n",
+ " return results\n",
+ "\n",
+ "\n",
+ "def _get_current_weather(location: str, unit: str = \"fahrenheit\") -> str:\n",
+ " \"\"\"Get the current weather in a given location\n",
+ "\n",
+ " Dummy function to simulate a weather API call.\n",
+ "\n",
+ " :param location: the location to get the weather for.\n",
+ " :param unit: the unit of temperature to return. Celsius or Fahrenheit.\n",
+ " :return: JSON string with the location and temperature, and unit.\n",
+ " \"\"\"\n",
+ " if \"tokyo\" in location.lower():\n",
+ " return json.dumps({\"location\": \"Tokyo\", \"temperature\": \"10\", \"unit\": unit})\n",
+ " elif \"san francisco\" in location.lower():\n",
+ " return json.dumps({\"location\": \"San Francisco\", \"temperature\": \"72\", \"unit\": unit})\n",
+ " elif \"paris\" in location.lower():\n",
+ " return json.dumps({\"location\": \"Paris\", \"temperature\": \"22\", \"unit\": unit})\n",
+ " else:\n",
+ " return json.dumps({\"location\": location, \"temperature\": \"unknown\"})\n"
]
},
{
@@ -187,203 +468,203 @@
"<!-- Generated by graphviz version 9.0.0 (20230911.1827)\n",
" -->\n",
"<!-- Pages: 1 -->\n",
- "<svg width=\"1395pt\" height=\"227pt\"\n",
- " viewBox=\"0.00 0.00 1394.67 226.80\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
- "<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 222.8)\">\n",
- "<polygon fill=\"white\" stroke=\"none\" points=\"-4,4 -4,-222.8 1390.67,-222.8 1390.67,4 -4,4\"/>\n",
+ "<svg width=\"1395pt\" height=\"343pt\"\n",
+ " viewBox=\"0.00 0.00 1394.67 342.80\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
+ "<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 338.8)\">\n",
+ "<polygon fill=\"white\" stroke=\"none\" points=\"-4,4 -4,-338.8 1390.67,-338.8 1390.67,4 -4,4\"/>\n",
"<g id=\"clust1\" class=\"cluster\">\n",
"<title>cluster__legend</title>\n",
- "<polygon fill=\"#ffffff\" stroke=\"black\" points=\"8,-80.8 8,-210.8 92.85,-210.8 92.85,-80.8 8,-80.8\"/>\n",
- "<text text-anchor=\"middle\" x=\"50.42\" y=\"-193.5\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">Legend</text>\n",
+ "<polygon fill=\"#ffffff\" stroke=\"black\" points=\"8,-196.8 8,-326.8 92.85,-326.8 92.85,-196.8 8,-196.8\"/>\n",
+ "<text text-anchor=\"middle\" x=\"50.42\" y=\"-309.5\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">Legend</text>\n",
"</g>\n",
- "<!-- message_history -->\n",
+ "<!-- llm_function_message -->\n",
"<g id=\"node1\" class=\"node\">\n",
+ "<title>llm_function_message</title>\n",
+ "<path fill=\"#b4d8e4\" stroke=\"black\" d=\"M1195.82,-164.6C1195.82,-164.6 1051.22,-164.6 1051.22,-164.6 1045.22,-164.6 1039.22,-158.6 1039.22,-152.6 1039.22,-152.6 1039.22,-113 1039.22,-113 1039.22,-107 1045.22,-101 1051.22,-101 1051.22,-101 1195.82,-101 1195.82,-101 1201.82,-101 1207.82,-107 1207.82,-113 1207.82,-113 1207.82,-152.6 1207.82,-152.6 1207.82,-158.6 1201.82,-164.6 1195.82,-164.6\"/>\n",
+ "<text text-anchor=\"start\" x=\"1050.02\" y=\"-141.5\" font-family=\"Helvetica,sans-Serif\" font-weight=\"bold\" font-size=\"14.00\">llm_function_message</text>\n",
+ "<text text-anchor=\"start\" x=\"1113.02\" y=\"-113.5\" font-family=\"Helvetica,sans-Serif\" font-style=\"italic\" font-size=\"14.00\">dict</text>\n",
+ "</g>\n",
+ "<!-- message_history -->\n",
+ "<g id=\"node2\" class=\"node\">\n",
"<title>message_history</title>\n",
- "<path fill=\"#b4d8e4\" stroke=\"black\" d=\"M799.12,-104.6C799.12,-104.6 690.52,-104.6 690.52,-104.6 684.52,-104.6 678.52,-98.6 678.52,-92.6 678.52,-92.6 678.52,-53 678.52,-53 678.52,-47 684.52,-41 690.52,-41 690.52,-41 799.12,-41 799.12,-41 805.12,-41 811.12,-47 811.12,-53 811.12,-53 811.12,-92.6 811.12,-92.6 811.12,-98.6 805.12,-104.6 799.12,-104.6\"/>\n",
- "<text text-anchor=\"start\" x=\"689.32\" y=\"-81.5\" font-family=\"Helvetica,sans-Serif\" font-weight=\"bold\" font-size=\"14.00\">message_history</text>\n",
- "<text text-anchor=\"start\" x=\"736.57\" y=\"-53.5\" font-family=\"Helvetica,sans-Serif\" font-style=\"italic\" font-size=\"14.00\">list</text>\n",
+ "<path fill=\"#b4d8e4\" stroke=\"black\" d=\"M799.12,-184.6C799.12,-184.6 690.52,-184.6 690.52,-184.6 684.52,-184.6 678.52,-178.6 678.52,-172.6 678.52,-172.6 678.52,-133 678.52,-133 678.52,-127 684.52,-121 690.52,-121 690.52,-121 799.12,-121 799.12,-121 805.12,-121 811.12,-127 811.12,-133 811.12,-133 811.12,-172.6 811.12,-172.6 811.12,-178.6 805.12,-184.6 799.12,-184.6\"/>\n",
+ "<text text-anchor=\"start\" x=\"689.32\" y=\"-161.5\" font-family=\"Helvetica,sans-Serif\" font-weight=\"bold\" font-size=\"14.00\">message_history</text>\n",
+ "<text text-anchor=\"start\" x=\"736.57\" y=\"-133.5\" font-family=\"Helvetica,sans-Serif\" font-style=\"italic\" font-size=\"14.00\">list</text>\n",
"</g>\n",
"<!-- llm_function_response -->\n",
- "<g id=\"node3\" class=\"node\">\n",
+ "<g id=\"node9\" class=\"node\">\n",
"<title>llm_function_response</title>\n",
- "<path fill=\"#b4d8e4\" stroke=\"black\" d=\"M998.22,-104.6C998.22,-104.6 852.12,-104.6 852.12,-104.6 846.12,-104.6 840.12,-98.6 840.12,-92.6 840.12,-92.6 840.12,-53 840.12,-53 840.12,-47 846.12,-41 852.12,-41 852.12,-41 998.22,-41 998.22,-41 1004.22,-41 1010.22,-47 1010.22,-53 1010.22,-53 1010.22,-92.6 1010.22,-92.6 1010.22,-98.6 1004.22,-104.6 998.22,-104.6\"/>\n",
- "<text text-anchor=\"start\" x=\"850.92\" y=\"-81.5\" font-family=\"Helvetica,sans-Serif\" font-weight=\"bold\" font-size=\"14.00\">llm_function_response</text>\n",
- "<text text-anchor=\"start\" x=\"876.42\" y=\"-53.5\" font-family=\"Helvetica,sans-Serif\" font-style=\"italic\" font-size=\"14.00\">ChatCompletion</text>\n",
+ "<path fill=\"#b4d8e4\" stroke=\"black\" d=\"M998.22,-123.6C998.22,-123.6 852.12,-123.6 852.12,-123.6 846.12,-123.6 840.12,-117.6 840.12,-111.6 840.12,-111.6 840.12,-72 840.12,-72 840.12,-66 846.12,-60 852.12,-60 852.12,-60 998.22,-60 998.22,-60 1004.22,-60 1010.22,-66 1010.22,-72 1010.22,-72 1010.22,-111.6 1010.22,-111.6 1010.22,-117.6 1004.22,-123.6 998.22,-123.6\"/>\n",
+ "<text text-anchor=\"start\" x=\"850.92\" y=\"-100.5\" font-family=\"Helvetica,sans-Serif\" font-weight=\"bold\" font-size=\"14.00\">llm_function_response</text>\n",
+ "<text text-anchor=\"start\" x=\"876.42\" y=\"-72.5\" font-family=\"Helvetica,sans-Serif\" font-style=\"italic\" font-size=\"14.00\">ChatCompletion</text>\n",
"</g>\n",
"<!-- message_history&#45;&gt;llm_function_response -->\n",
- "<g id=\"edge3\" class=\"edge\">\n",
+ "<g id=\"edge11\" class=\"edge\">\n",
"<title>message_history&#45;&gt;llm_function_response</title>\n",
- "<path fill=\"none\" stroke=\"black\" d=\"M811.48,-72.8C817.1,-72.8 822.87,-72.8 828.67,-72.8\"/>\n",
- "<polygon fill=\"black\" stroke=\"black\" points=\"828.33,-76.3 838.33,-72.8 828.33,-69.3 828.33,-76.3\"/>\n",
+ "<path fill=\"none\" stroke=\"black\" d=\"M811.48,-130.35C817.25,-128.37 823.16,-126.35 829.11,-124.31\"/>\n",
+ "<polygon fill=\"black\" stroke=\"black\" points=\"830.08,-127.68 838.41,-121.13 827.81,-121.06 830.08,-127.68\"/>\n",
"</g>\n",
"<!-- llm_client -->\n",
- "<g id=\"node2\" class=\"node\">\n",
+ "<g id=\"node3\" class=\"node\">\n",
"<title>llm_client</title>\n",
- "<path fill=\"#b4d8e4\" stroke=\"black\" d=\"M775.12,-186.6C775.12,-186.6 714.52,-186.6 714.52,-186.6 708.52,-186.6 702.52,-180.6 702.52,-174.6 702.52,-174.6 702.52,-135 702.52,-135 702.52,-129 708.52,-123 714.52,-123 714.52,-123 775.12,-123 775.12,-123 781.12,-123 787.12,-129 787.12,-135 787.12,-135 787.12,-174.6 787.12,-174.6 787.12,-180.6 781.12,-186.6 775.12,-186.6\"/>\n",
- "<text text-anchor=\"start\" x=\"713.32\" y=\"-163.5\" font-family=\"Helvetica,sans-Serif\" font-weight=\"bold\" font-size=\"14.00\">llm_client</text>\n",
- "<text text-anchor=\"start\" x=\"721.57\" y=\"-135.5\" font-family=\"Helvetica,sans-Serif\" font-style=\"italic\" font-size=\"14.00\">OpenAI</text>\n",
+ "<path fill=\"#b4d8e4\" stroke=\"black\" d=\"M775.12,-63.6C775.12,-63.6 714.52,-63.6 714.52,-63.6 708.52,-63.6 702.52,-57.6 702.52,-51.6 702.52,-51.6 702.52,-12 702.52,-12 702.52,-6 708.52,0 714.52,0 714.52,0 775.12,0 775.12,0 781.12,0 787.12,-6 787.12,-12 787.12,-12 787.12,-51.6 787.12,-51.6 787.12,-57.6 781.12,-63.6 775.12,-63.6\"/>\n",
+ "<text text-anchor=\"start\" x=\"713.32\" y=\"-40.5\" font-family=\"Helvetica,sans-Serif\" font-weight=\"bold\" font-size=\"14.00\">llm_client</text>\n",
+ "<text text-anchor=\"start\" x=\"721.57\" y=\"-12.5\" font-family=\"Helvetica,sans-Serif\" font-style=\"italic\" font-size=\"14.00\">OpenAI</text>\n",
"</g>\n",
"<!-- llm_client&#45;&gt;llm_function_response -->\n",
- "<g id=\"edge5\" class=\"edge\">\n",
- "<title>llm_client&#45;&gt;llm_function_response</title>\n",
- "<path fill=\"none\" stroke=\"black\" d=\"M787.19,-135.78C804.03,-128.04 824.09,-118.82 843.6,-109.85\"/>\n",
- "<polygon fill=\"black\" stroke=\"black\" points=\"845.04,-113.04 852.66,-105.68 842.12,-106.68 845.04,-113.04\"/>\n",
- "</g>\n",
- "<!-- parsed_tool_calls -->\n",
- "<g id=\"node6\" class=\"node\">\n",
- "<title>parsed_tool_calls</title>\n",
- "<path fill=\"#b4d8e4\" stroke=\"black\" d=\"M1179.32,-145.6C1179.32,-145.6 1067.72,-145.6 1067.72,-145.6 1061.72,-145.6 1055.72,-139.6 1055.72,-133.6 1055.72,-133.6 1055.72,-94 1055.72,-94 1055.72,-88 1061.72,-82 1067.72,-82 1067.72,-82 1179.32,-82 1179.32,-82 1185.32,-82 1191.32,-88 1191.32,-94 1191.32,-94 1191.32,-133.6 1191.32,-133.6 1191.32,-139.6 1185.32,-145.6 1179.32,-145.6\"/>\n",
- "<text text-anchor=\"start\" x=\"1066.52\" y=\"-122.5\" font-family=\"Helvetica,sans-Serif\" font-weight=\"bold\" font-size=\"14.00\">parsed_tool_calls</text>\n",
- "<text text-anchor=\"start\" x=\"1115.27\" y=\"-94.5\" font-family=\"Helvetica,sans-Serif\" font-style=\"italic\" font-size=\"14.00\">list</text>\n",
- "</g>\n",
- "<!-- llm_function_response&#45;&gt;parsed_tool_calls -->\n",
- "<g id=\"edge9\" class=\"edge\">\n",
- "<title>llm_function_response&#45;&gt;parsed_tool_calls</title>\n",
- "<path fill=\"none\" stroke=\"black\" d=\"M1010.58,-90.43C1021.81,-92.77 1033.28,-95.16 1044.39,-97.49\"/>\n",
- "<polygon fill=\"black\" stroke=\"black\" points=\"1043.38,-100.85 1053.88,-99.47 1044.81,-94 1043.38,-100.85\"/>\n",
- "</g>\n",
- "<!-- llm_function_message -->\n",
- "<g id=\"node9\" class=\"node\">\n",
- "<title>llm_function_message</title>\n",
- "<path fill=\"#b4d8e4\" stroke=\"black\" d=\"M1195.82,-63.6C1195.82,-63.6 1051.22,-63.6 1051.22,-63.6 1045.22,-63.6 1039.22,-57.6 1039.22,-51.6 1039.22,-51.6 1039.22,-12 1039.22,-12 1039.22,-6 1045.22,0 1051.22,0 1051.22,0 1195.82,0 1195.82,0 1201.82,0 1207.82,-6 1207.82,-12 1207.82,-12 1207.82,-51.6 1207.82,-51.6 1207.82,-57.6 1201.82,-63.6 1195.82,-63.6\"/>\n",
- "<text text-anchor=\"start\" x=\"1050.02\" y=\"-40.5\" font-family=\"Helvetica,sans-Serif\" font-weight=\"bold\" font-size=\"14.00\">llm_function_message</text>\n",
- "<text text-anchor=\"start\" x=\"1113.02\" y=\"-12.5\" font-family=\"Helvetica,sans-Serif\" font-style=\"italic\" font-size=\"14.00\">dict</text>\n",
- "</g>\n",
- "<!-- llm_function_response&#45;&gt;llm_function_message -->\n",
"<g id=\"edge13\" class=\"edge\">\n",
- "<title>llm_function_response&#45;&gt;llm_function_message</title>\n",
- "<path fill=\"none\" stroke=\"black\" d=\"M1010.58,-55.17C1016.29,-53.98 1022.05,-52.78 1027.8,-51.58\"/>\n",
- "<polygon fill=\"black\" stroke=\"black\" points=\"1028.25,-55.06 1037.33,-49.59 1026.82,-48.21 1028.25,-55.06\"/>\n",
+ "<title>llm_client&#45;&gt;llm_function_response</title>\n",
+ "<path fill=\"none\" stroke=\"black\" d=\"M787.19,-45.72C799.86,-49.98 814.36,-54.86 829.07,-59.8\"/>\n",
+ "<polygon fill=\"black\" stroke=\"black\" points=\"827.77,-63.06 838.36,-62.93 830,-56.43 827.77,-63.06\"/>\n",
"</g>\n",
"<!-- executed_tool_calls -->\n",
"<g id=\"node4\" class=\"node\">\n",
"<title>executed_tool_calls</title>\n",
- "<path fill=\"#b4d8e4\" stroke=\"black\" d=\"M1374.67,-181.6C1374.67,-181.6 1248.83,-181.6 1248.83,-181.6 1242.83,-181.6 1236.83,-175.6 1236.83,-169.6 1236.83,-169.6 1236.83,-130 1236.83,-130 1236.83,-124 1242.83,-118 1248.83,-118 1248.83,-118 1374.67,-118 1374.67,-118 1380.67,-118 1386.67,-124 1386.67,-130 1386.67,-130 1386.67,-169.6 1386.67,-169.6 1386.67,-175.6 1380.67,-181.6 1374.67,-181.6\"/>\n",
- "<text text-anchor=\"start\" x=\"1247.62\" y=\"-158.5\" font-family=\"Helvetica,sans-Serif\" font-weight=\"bold\" font-size=\"14.00\">executed_tool_calls</text>\n",
- "<text text-anchor=\"start\" x=\"1303.5\" y=\"-130.5\" font-family=\"Helvetica,sans-Serif\" font-style=\"italic\" font-size=\"14.00\">list</text>\n",
+ "<path fill=\"#b4d8e4\" stroke=\"black\" d=\"M1374.67,-159.6C1374.67,-159.6 1248.83,-159.6 1248.83,-159.6 1242.83,-159.6 1236.83,-153.6 1236.83,-147.6 1236.83,-147.6 1236.83,-108 1236.83,-108 1236.83,-102 1242.83,-96 1248.83,-96 1248.83,-96 1374.67,-96 1374.67,-96 1380.67,-96 1386.67,-102 1386.67,-108 1386.67,-108 1386.67,-147.6 1386.67,-147.6 1386.67,-153.6 1380.67,-159.6 1374.67,-159.6\"/>\n",
+ "<text text-anchor=\"start\" x=\"1247.62\" y=\"-136.5\" font-family=\"Helvetica,sans-Serif\" font-weight=\"bold\" font-size=\"14.00\">executed_tool_calls</text>\n",
+ "<text text-anchor=\"start\" x=\"1303.5\" y=\"-108.5\" font-family=\"Helvetica,sans-Serif\" font-style=\"italic\" font-size=\"14.00\">list</text>\n",
"</g>\n",
"<!-- tool_names -->\n",
"<g id=\"node5\" class=\"node\">\n",
"<title>tool_names</title>\n",
- "<path fill=\"#b4d8e4\" stroke=\"black\" d=\"M416.8,-109.6C416.8,-109.6 343.45,-109.6 343.45,-109.6 337.45,-109.6 331.45,-103.6 331.45,-97.6 331.45,-97.6 331.45,-58 331.45,-58 331.45,-52 337.45,-46 343.45,-46 343.45,-46 416.8,-46 416.8,-46 422.8,-46 428.8,-52 428.8,-58 428.8,-58 428.8,-97.6 428.8,-97.6 428.8,-103.6 422.8,-109.6 416.8,-109.6\"/>\n",
- "<text text-anchor=\"start\" x=\"342.25\" y=\"-86.5\" font-family=\"Helvetica,sans-Serif\" font-weight=\"bold\" font-size=\"14.00\">tool_names</text>\n",
- "<text text-anchor=\"start\" x=\"371.87\" y=\"-58.5\" font-family=\"Helvetica,sans-Serif\" font-style=\"italic\" font-size=\"14.00\">list</text>\n",
+ "<path fill=\"#b4d8e4\" stroke=\"black\" d=\"M416.8,-267.6C416.8,-267.6 343.45,-267.6 343.45,-267.6 337.45,-267.6 331.45,-261.6 331.45,-255.6 331.45,-255.6 331.45,-216 331.45,-216 331.45,-210 337.45,-204 343.45,-204 343.45,-204 416.8,-204 416.8,-204 422.8,-204 428.8,-210 428.8,-216 428.8,-216 428.8,-255.6 428.8,-255.6 428.8,-261.6 422.8,-267.6 416.8,-267.6\"/>\n",
+ "<text text-anchor=\"start\" x=\"342.25\" y=\"-244.5\" font-family=\"Helvetica,sans-Serif\" font-weight=\"bold\" font-size=\"14.00\">tool_names</text>\n",
+ "<text text-anchor=\"start\" x=\"371.87\" y=\"-216.5\" font-family=\"Helvetica,sans-Serif\" font-style=\"italic\" font-size=\"14.00\">list</text>\n",
"</g>\n",
"<!-- base_system_prompt -->\n",
- "<g id=\"node7\" class=\"node\">\n",
+ "<g id=\"node6\" class=\"node\">\n",
"<title>base_system_prompt</title>\n",
- "<path fill=\"#b4d8e4\" stroke=\"black\" d=\"M637.52,-187.6C637.52,-187.6 499.67,-187.6 499.67,-187.6 493.67,-187.6 487.67,-181.6 487.67,-175.6 487.67,-175.6 487.67,-136 487.67,-136 487.67,-130 493.67,-124 499.67,-124 499.67,-124 637.52,-124 637.52,-124 643.52,-124 649.52,-130 649.52,-136 649.52,-136 649.52,-175.6 649.52,-175.6 649.52,-181.6 643.52,-187.6 637.52,-187.6\"/>\n",
- "<text text-anchor=\"start\" x=\"498.47\" y=\"-164.5\" font-family=\"Helvetica,sans-Serif\" font-weight=\"bold\" font-size=\"14.00\">base_system_prompt</text>\n",
- "<text text-anchor=\"start\" x=\"561.1\" y=\"-136.5\" font-family=\"Helvetica,sans-Serif\" font-style=\"italic\" font-size=\"14.00\">str</text>\n",
+ "<path fill=\"#b4d8e4\" stroke=\"black\" d=\"M637.52,-267.6C637.52,-267.6 499.67,-267.6 499.67,-267.6 493.67,-267.6 487.67,-261.6 487.67,-255.6 487.67,-255.6 487.67,-216 487.67,-216 487.67,-210 493.67,-204 499.67,-204 499.67,-204 637.52,-204 637.52,-204 643.52,-204 649.52,-210 649.52,-216 649.52,-216 649.52,-255.6 649.52,-255.6 649.52,-261.6 643.52,-267.6 637.52,-267.6\"/>\n",
+ "<text text-anchor=\"start\" x=\"498.47\" y=\"-244.5\" font-family=\"Helvetica,sans-Serif\" font-weight=\"bold\" font-size=\"14.00\">base_system_prompt</text>\n",
+ "<text text-anchor=\"start\" x=\"561.1\" y=\"-216.5\" font-family=\"Helvetica,sans-Serif\" font-style=\"italic\" font-size=\"14.00\">str</text>\n",
"</g>\n",
"<!-- tool_names&#45;&gt;base_system_prompt -->\n",
- "<g id=\"edge10\" class=\"edge\">\n",
+ "<g id=\"edge7\" class=\"edge\">\n",
"<title>tool_names&#45;&gt;base_system_prompt</title>\n",
- "<path fill=\"none\" stroke=\"black\" d=\"M429.15,-97.89C444.75,-104.41 462.59,-111.88 480.15,-119.22\"/>\n",
- "<polygon fill=\"black\" stroke=\"black\" points=\"478.47,-122.31 489.04,-122.94 481.17,-115.85 478.47,-122.31\"/>\n",
- "</g>\n",
- "<!-- parsed_tool_calls&#45;&gt;executed_tool_calls -->\n",
- "<g id=\"edge6\" class=\"edge\">\n",
- "<title>parsed_tool_calls&#45;&gt;executed_tool_calls</title>\n",
- "<path fill=\"none\" stroke=\"black\" d=\"M1191.76,-126.8C1202.62,-128.9 1213.99,-131.09 1225.21,-133.26\"/>\n",
- "<polygon fill=\"black\" stroke=\"black\" points=\"1224.39,-136.67 1234.88,-135.13 1225.72,-129.8 1224.39,-136.67\"/>\n",
+ "<path fill=\"none\" stroke=\"black\" d=\"M429.15,-235.8C443.53,-235.8 459.8,-235.8 476.01,-235.8\"/>\n",
+ "<polygon fill=\"black\" stroke=\"black\" points=\"475.68,-239.3 485.68,-235.8 475.68,-232.3 475.68,-239.3\"/>\n",
"</g>\n",
"<!-- base_system_prompt&#45;&gt;message_history -->\n",
- "<g id=\"edge1\" class=\"edge\">\n",
+ "<g id=\"edge2\" class=\"edge\">\n",
"<title>base_system_prompt&#45;&gt;message_history</title>\n",
- "<path fill=\"none\" stroke=\"black\" d=\"M636.96,-123.71C647.09,-118.89 657.59,-113.88 667.88,-108.98\"/>\n",
- "<polygon fill=\"black\" stroke=\"black\" points=\"669.19,-112.23 676.71,-104.77 666.18,-105.91 669.19,-112.23\"/>\n",
+ "<path fill=\"none\" stroke=\"black\" d=\"M636.96,-203.71C647.09,-198.89 657.59,-193.88 667.88,-188.98\"/>\n",
+ "<polygon fill=\"black\" stroke=\"black\" points=\"669.19,-192.23 676.71,-184.77 666.18,-185.91 669.19,-192.23\"/>\n",
"</g>\n",
"<!-- tool_function_specs -->\n",
- "<g id=\"node8\" class=\"node\">\n",
+ "<g id=\"node7\" class=\"node\">\n",
"<title>tool_function_specs</title>\n",
- "<path fill=\"#b4d8e4\" stroke=\"black\" d=\"M260.57,-79.6C260.57,-79.6 131.72,-79.6 131.72,-79.6 125.72,-79.6 119.72,-73.6 119.72,-67.6 119.72,-67.6 119.72,-28 119.72,-28 119.72,-22 125.72,-16 131.72,-16 131.72,-16 260.57,-16 260.57,-16 266.57,-16 272.57,-22 272.57,-28 272.57,-28 272.57,-67.6 272.57,-67.6 272.57,-73.6 266.57,-79.6 260.57,-79.6\"/>\n",
- "<text text-anchor=\"start\" x=\"130.52\" y=\"-56.5\" font-family=\"Helvetica,sans-Serif\" font-weight=\"bold\" font-size=\"14.00\">tool_function_specs</text>\n",
- "<text text-anchor=\"start\" x=\"187.9\" y=\"-28.5\" font-family=\"Helvetica,sans-Serif\" font-style=\"italic\" font-size=\"14.00\">list</text>\n",
+ "<path fill=\"#b4d8e4\" stroke=\"black\" d=\"M260.57,-195.6C260.57,-195.6 131.72,-195.6 131.72,-195.6 125.72,-195.6 119.72,-189.6 119.72,-183.6 119.72,-183.6 119.72,-144 119.72,-144 119.72,-138 125.72,-132 131.72,-132 131.72,-132 260.57,-132 260.57,-132 266.57,-132 272.57,-138 272.57,-144 272.57,-144 272.57,-183.6 272.57,-183.6 272.57,-189.6 266.57,-195.6 260.57,-195.6\"/>\n",
+ "<text text-anchor=\"start\" x=\"130.52\" y=\"-172.5\" font-family=\"Helvetica,sans-Serif\" font-weight=\"bold\" font-size=\"14.00\">tool_function_specs</text>\n",
+ "<text text-anchor=\"start\" x=\"187.9\" y=\"-144.5\" font-family=\"Helvetica,sans-Serif\" font-style=\"italic\" font-size=\"14.00\">list</text>\n",
+ "</g>\n",
+ "<!-- tool_function_specs&#45;&gt;tool_names -->\n",
+ "<g id=\"edge6\" class=\"edge\">\n",
+ "<title>tool_function_specs&#45;&gt;tool_names</title>\n",
+ "<path fill=\"none\" stroke=\"black\" d=\"M273.01,-193.81C289.01,-200.15 305.66,-206.73 320.9,-212.76\"/>\n",
+ "<polygon fill=\"black\" stroke=\"black\" points=\"319.2,-215.85 329.78,-216.28 321.77,-209.34 319.2,-215.85\"/>\n",
"</g>\n",
"<!-- tool_function_specs&#45;&gt;llm_function_response -->\n",
- "<g id=\"edge4\" class=\"edge\">\n",
+ "<g id=\"edge12\" class=\"edge\">\n",
"<title>tool_function_specs&#45;&gt;llm_function_response</title>\n",
- "<path fill=\"none\" stroke=\"black\" d=\"M273.03,-36.06C389.73,-20.19 619.83,2.43 811.12,-31.8 818.97,-33.2 826.98,-35.1 834.95,-37.31\"/>\n",
- "<polygon fill=\"black\" stroke=\"black\" points=\"833.72,-40.6 844.3,-40.07 835.7,-33.88 833.72,-40.6\"/>\n",
+ "<path fill=\"none\" stroke=\"black\" d=\"M272.91,-139.67C282.49,-137.1 292.22,-134.73 301.57,-132.8 485.35,-94.95 705.48,-89.55 828.62,-90.01\"/>\n",
+ "<polygon fill=\"black\" stroke=\"black\" points=\"828.33,-93.51 838.35,-90.07 828.37,-86.51 828.33,-93.51\"/>\n",
"</g>\n",
- "<!-- tool_function_specs&#45;&gt;tool_names -->\n",
- "<g id=\"edge8\" class=\"edge\">\n",
- "<title>tool_function_specs&#45;&gt;tool_names</title>\n",
- "<path fill=\"none\" stroke=\"black\" d=\"M273.01,-60.31C288.7,-62.89 305.02,-65.58 320.02,-68.06\"/>\n",
- "<polygon fill=\"black\" stroke=\"black\" points=\"319.26,-71.48 329.7,-69.65 320.4,-64.57 319.26,-71.48\"/>\n",
+ "<!-- parsed_tool_calls -->\n",
+ "<g id=\"node8\" class=\"node\">\n",
+ "<title>parsed_tool_calls</title>\n",
+ "<path fill=\"#b4d8e4\" stroke=\"black\" d=\"M1179.32,-82.6C1179.32,-82.6 1067.72,-82.6 1067.72,-82.6 1061.72,-82.6 1055.72,-76.6 1055.72,-70.6 1055.72,-70.6 1055.72,-31 1055.72,-31 1055.72,-25 1061.72,-19 1067.72,-19 1067.72,-19 1179.32,-19 1179.32,-19 1185.32,-19 1191.32,-25 1191.32,-31 1191.32,-31 1191.32,-70.6 1191.32,-70.6 1191.32,-76.6 1185.32,-82.6 1179.32,-82.6\"/>\n",
+ "<text text-anchor=\"start\" x=\"1066.52\" y=\"-59.5\" font-family=\"Helvetica,sans-Serif\" font-weight=\"bold\" font-size=\"14.00\">parsed_tool_calls</text>\n",
+ "<text text-anchor=\"start\" x=\"1115.27\" y=\"-31.5\" font-family=\"Helvetica,sans-Serif\" font-style=\"italic\" font-size=\"14.00\">list</text>\n",
+ "</g>\n",
+ "<!-- parsed_tool_calls&#45;&gt;executed_tool_calls -->\n",
+ "<g id=\"edge4\" class=\"edge\">\n",
+ "<title>parsed_tool_calls&#45;&gt;executed_tool_calls</title>\n",
+ "<path fill=\"none\" stroke=\"black\" d=\"M1191.76,-78.6C1202.84,-83.18 1214.46,-87.99 1225.91,-92.72\"/>\n",
+ "<polygon fill=\"black\" stroke=\"black\" points=\"1224.39,-95.88 1234.96,-96.46 1227.06,-89.41 1224.39,-95.88\"/>\n",
+ "</g>\n",
+ "<!-- llm_function_response&#45;&gt;llm_function_message -->\n",
+ "<g id=\"edge1\" class=\"edge\">\n",
+ "<title>llm_function_response&#45;&gt;llm_function_message</title>\n",
+ "<path fill=\"none\" stroke=\"black\" d=\"M1010.58,-109.43C1016.29,-110.62 1022.05,-111.82 1027.8,-113.02\"/>\n",
+ "<polygon fill=\"black\" stroke=\"black\" points=\"1026.82,-116.39 1037.33,-115.01 1028.25,-109.54 1026.82,-116.39\"/>\n",
+ "</g>\n",
+ "<!-- llm_function_response&#45;&gt;parsed_tool_calls -->\n",
+ "<g id=\"edge10\" class=\"edge\">\n",
+ "<title>llm_function_response&#45;&gt;parsed_tool_calls</title>\n",
+ "<path fill=\"none\" stroke=\"black\" d=\"M1010.58,-74.17C1021.81,-71.83 1033.28,-69.44 1044.39,-67.11\"/>\n",
+ "<polygon fill=\"black\" stroke=\"black\" points=\"1044.81,-70.6 1053.88,-65.13 1043.38,-63.75 1044.81,-70.6\"/>\n",
"</g>\n",
"<!-- _message_history_inputs -->\n",
"<g id=\"node10\" class=\"node\">\n",
"<title>_message_history_inputs</title>\n",
- "<polygon fill=\"#ffffff\" stroke=\"black\" stroke-dasharray=\"5,2\" points=\"627.9,-105.6 509.3,-105.6 509.3,-40 627.9,-40 627.9,-105.6\"/>\n",
- "<text text-anchor=\"start\" x=\"526.47\" y=\"-77.5\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">messages</text>\n",
- "<text text-anchor=\"start\" x=\"596.85\" y=\"-77.5\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">list</text>\n",
- "<text text-anchor=\"start\" x=\"523.85\" y=\"-56.5\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">user_query</text>\n",
- "<text text-anchor=\"start\" x=\"597.6\" y=\"-56.5\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">str</text>\n",
+ "<polygon fill=\"#ffffff\" stroke=\"black\" stroke-dasharray=\"5,2\" points=\"627.9,-185.6 509.3,-185.6 509.3,-120 627.9,-120 627.9,-185.6\"/>\n",
+ "<text text-anchor=\"start\" x=\"523.85\" y=\"-157.5\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">user_query</text>\n",
+ "<text text-anchor=\"start\" x=\"597.6\" y=\"-157.5\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">str</text>\n",
+ "<text text-anchor=\"start\" x=\"526.47\" y=\"-136.5\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">messages</text>\n",
+ "<text text-anchor=\"start\" x=\"596.85\" y=\"-136.5\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">list</text>\n",
"</g>\n",
"<!-- _message_history_inputs&#45;&gt;message_history -->\n",
- "<g id=\"edge2\" class=\"edge\">\n",
+ "<g id=\"edge3\" class=\"edge\">\n",
"<title>_message_history_inputs&#45;&gt;message_history</title>\n",
- "<path fill=\"none\" stroke=\"black\" d=\"M628.1,-72.8C640.56,-72.8 653.9,-72.8 666.94,-72.8\"/>\n",
- "<polygon fill=\"black\" stroke=\"black\" points=\"666.77,-76.3 676.77,-72.8 666.77,-69.3 666.77,-76.3\"/>\n",
+ "<path fill=\"none\" stroke=\"black\" d=\"M628.1,-152.8C640.56,-152.8 653.9,-152.8 666.94,-152.8\"/>\n",
+ "<polygon fill=\"black\" stroke=\"black\" points=\"666.77,-156.3 676.77,-152.8 666.77,-149.3 666.77,-156.3\"/>\n",
"</g>\n",
"<!-- _executed_tool_calls_inputs -->\n",
"<g id=\"node11\" class=\"node\">\n",
"<title>_executed_tool_calls_inputs</title>\n",
- "<polygon fill=\"#ffffff\" stroke=\"black\" stroke-dasharray=\"5,2\" points=\"1163.82,-208.1 1083.22,-208.1 1083.22,-163.5 1163.82,-163.5 1163.82,-208.1\"/>\n",
- "<text text-anchor=\"start\" x=\"1098.02\" y=\"-180\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">tools</text>\n",
- "<text text-anchor=\"start\" x=\"1132.52\" y=\"-180\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">list</text>\n",
+ "<polygon fill=\"#ffffff\" stroke=\"black\" stroke-dasharray=\"5,2\" points=\"1163.82,-227.1 1083.22,-227.1 1083.22,-182.5 1163.82,-182.5 1163.82,-227.1\"/>\n",
+ "<text text-anchor=\"start\" x=\"1098.02\" y=\"-199\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">tools</text>\n",
+ "<text text-anchor=\"start\" x=\"1132.52\" y=\"-199\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">list</text>\n",
"</g>\n",
"<!-- _executed_tool_calls_inputs&#45;&gt;executed_tool_calls -->\n",
- "<g id=\"edge7\" class=\"edge\">\n",
+ "<g id=\"edge5\" class=\"edge\">\n",
"<title>_executed_tool_calls_inputs&#45;&gt;executed_tool_calls</title>\n",
- "<path fill=\"none\" stroke=\"black\" d=\"M1164.02,-178.17C1181.93,-174.7 1203.86,-170.46 1225.24,-166.33\"/>\n",
- "<polygon fill=\"black\" stroke=\"black\" points=\"1225.71,-169.8 1234.87,-164.47 1224.39,-162.93 1225.71,-169.8\"/>\n",
+ "<path fill=\"none\" stroke=\"black\" d=\"M1164.13,-190.65C1178.02,-185.53 1193.69,-179.58 1207.82,-173.8 1214.97,-170.88 1222.35,-167.77 1229.73,-164.59\"/>\n",
+ "<polygon fill=\"black\" stroke=\"black\" points=\"1230.97,-167.87 1238.75,-160.68 1228.18,-161.45 1230.97,-167.87\"/>\n",
"</g>\n",
"<!-- _base_system_prompt_inputs -->\n",
"<g id=\"node12\" class=\"node\">\n",
"<title>_base_system_prompt_inputs</title>\n",
- "<polygon fill=\"#ffffff\" stroke=\"black\" stroke-dasharray=\"5,2\" points=\"458.67,-178.1 301.57,-178.1 301.57,-133.5 458.67,-133.5 458.67,-178.1\"/>\n",
- "<text text-anchor=\"start\" x=\"316.37\" y=\"-150\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">system_message</text>\n",
- "<text text-anchor=\"start\" x=\"428.87\" y=\"-150\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">str</text>\n",
+ "<polygon fill=\"#ffffff\" stroke=\"black\" stroke-dasharray=\"5,2\" points=\"458.67,-186.1 301.57,-186.1 301.57,-141.5 458.67,-141.5 458.67,-186.1\"/>\n",
+ "<text text-anchor=\"start\" x=\"316.37\" y=\"-158\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">system_message</text>\n",
+ "<text text-anchor=\"start\" x=\"428.87\" y=\"-158\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">str</text>\n",
"</g>\n",
"<!-- _base_system_prompt_inputs&#45;&gt;base_system_prompt -->\n",
- "<g id=\"edge11\" class=\"edge\">\n",
+ "<g id=\"edge8\" class=\"edge\">\n",
"<title>_base_system_prompt_inputs&#45;&gt;base_system_prompt</title>\n",
- "<path fill=\"none\" stroke=\"black\" d=\"M459.13,-155.8C464.64,-155.8 470.22,-155.8 475.8,-155.8\"/>\n",
- "<polygon fill=\"black\" stroke=\"black\" points=\"475.7,-159.3 485.7,-155.8 475.7,-152.3 475.7,-159.3\"/>\n",
+ "<path fill=\"none\" stroke=\"black\" d=\"M440.13,-186.58C451.88,-191.12 464.48,-195.98 477.01,-200.82\"/>\n",
+ "<polygon fill=\"black\" stroke=\"black\" points=\"475.5,-203.99 486.09,-204.33 478.02,-197.46 475.5,-203.99\"/>\n",
"</g>\n",
"<!-- _tool_function_specs_inputs -->\n",
"<g id=\"node13\" class=\"node\">\n",
"<title>_tool_function_specs_inputs</title>\n",
- "<polygon fill=\"#ffffff\" stroke=\"black\" stroke-dasharray=\"5,2\" points=\"90.72,-70.1 10.12,-70.1 10.12,-25.5 90.72,-25.5 90.72,-70.1\"/>\n",
- "<text text-anchor=\"start\" x=\"24.92\" y=\"-42\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">tools</text>\n",
- "<text text-anchor=\"start\" x=\"59.42\" y=\"-42\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">list</text>\n",
+ "<polygon fill=\"#ffffff\" stroke=\"black\" stroke-dasharray=\"5,2\" points=\"90.72,-186.1 10.12,-186.1 10.12,-141.5 90.72,-141.5 90.72,-186.1\"/>\n",
+ "<text text-anchor=\"start\" x=\"24.92\" y=\"-158\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">tools</text>\n",
+ "<text text-anchor=\"start\" x=\"59.42\" y=\"-158\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">list</text>\n",
"</g>\n",
"<!-- _tool_function_specs_inputs&#45;&gt;tool_function_specs -->\n",
- "<g id=\"edge12\" class=\"edge\">\n",
+ "<g id=\"edge9\" class=\"edge\">\n",
"<title>_tool_function_specs_inputs&#45;&gt;tool_function_specs</title>\n",
- "<path fill=\"none\" stroke=\"black\" d=\"M91.08,-47.8C96.45,-47.8 102.12,-47.8 107.93,-47.8\"/>\n",
- "<polygon fill=\"black\" stroke=\"black\" points=\"107.71,-51.3 117.71,-47.8 107.71,-44.3 107.71,-51.3\"/>\n",
+ "<path fill=\"none\" stroke=\"black\" d=\"M91.08,-163.8C96.45,-163.8 102.12,-163.8 107.93,-163.8\"/>\n",
+ "<polygon fill=\"black\" stroke=\"black\" points=\"107.71,-167.3 117.71,-163.8 107.71,-160.3 107.71,-167.3\"/>\n",
"</g>\n",
"<!-- input -->\n",
"<g id=\"node14\" class=\"node\">\n",
"<title>input</title>\n",
- "<polygon fill=\"#ffffff\" stroke=\"black\" stroke-dasharray=\"5,2\" points=\"77.42,-180.1 23.42,-180.1 23.42,-143.5 77.42,-143.5 77.42,-180.1\"/>\n",
- "<text text-anchor=\"middle\" x=\"50.42\" y=\"-156\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">input</text>\n",
+ "<polygon fill=\"#ffffff\" stroke=\"black\" stroke-dasharray=\"5,2\" points=\"77.42,-296.1 23.42,-296.1 23.42,-259.5 77.42,-259.5 77.42,-296.1\"/>\n",
+ "<text text-anchor=\"middle\" x=\"50.42\" y=\"-272\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">input</text>\n",
"</g>\n",
"<!-- function -->\n",
"<g id=\"node15\" class=\"node\">\n",
"<title>function</title>\n",
- "<path fill=\"#b4d8e4\" stroke=\"black\" d=\"M72.85,-125.1C72.85,-125.1 28,-125.1 28,-125.1 22,-125.1 16,-119.1 16,-113.1 16,-113.1 16,-100.5 16,-100.5 16,-94.5 22,-88.5 28,-88.5 28,-88.5 72.85,-88.5 72.85,-88.5 78.85,-88.5 84.85,-94.5 84.85,-100.5 84.85,-100.5 84.85,-113.1 84.85,-113.1 84.85,-119.1 78.85,-125.1 72.85,-125.1\"/>\n",
- "<text text-anchor=\"middle\" x=\"50.42\" y=\"-101\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">function</text>\n",
+ "<path fill=\"#b4d8e4\" stroke=\"black\" d=\"M72.85,-241.1C72.85,-241.1 28,-241.1 28,-241.1 22,-241.1 16,-235.1 16,-229.1 16,-229.1 16,-216.5 16,-216.5 16,-210.5 22,-204.5 28,-204.5 28,-204.5 72.85,-204.5 72.85,-204.5 78.85,-204.5 84.85,-210.5 84.85,-216.5 84.85,-216.5 84.85,-229.1 84.85,-229.1 84.85,-235.1 78.85,-241.1 72.85,-241.1\"/>\n",
+ "<text text-anchor=\"middle\" x=\"50.42\" y=\"-217\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">function</text>\n",
"</g>\n",
"</g>\n",
"</svg>\n"
],
"text/plain": [
- "<hamilton.driver.Driver at 0x12b12fdf0>"
+ "<hamilton.driver.Driver at 0x122efda20>"
]
},
"execution_count": 5,