浏览代码

agno练习+转账agent

iTTsShuu 1 月之前
父节点
当前提交
6c611a1a39
共有 7 个文件被更改,包括 560 次插入348 次删除
  1. 二进制
      transfer/tmp/agents.db
  2. 23 0
      曹航/2/chatbot.ipynb
  3. 71 0
      曹航/3/agent_test1.ipynb
  4. 200 348
      曹航/3/agent_test2.ipynb
  5. 258 0
      曹航/3/agno_transfer_agent.ipynb
  6. 8 0
      曹航/3/agno_transfer_agent.py
  7. 二进制
      曹航/3/tmp/agent.db

二进制
transfer/tmp/agents.db


+ 23 - 0
曹航/2/chatbot.ipynb

@@ -31,15 +31,22 @@
   {
    "cell_type": "code",
 <<<<<<< HEAD
+<<<<<<< HEAD
    "execution_count": null,
 =======
    "execution_count": 4,
 >>>>>>> bad0e67 (多轮对话+agno agent学习实践)
+=======
+   "execution_count": null,
+>>>>>>> d788ac0 (agno练习+转账agent)
    "id": "30401a75",
    "metadata": {},
    "outputs": [
     {
 <<<<<<< HEAD
+<<<<<<< HEAD
+=======
+>>>>>>> d788ac0 (agno练习+转账agent)
      "ename": "NotFoundError",
      "evalue": "Error code: 404",
      "output_type": "error",
@@ -53,6 +60,7 @@
       "\u001b[36mFile \u001b[39m\u001b[32md:\\yusys\\ai_learning\\.venv\\Lib\\site-packages\\openai\\_base_client.py:1037\u001b[39m, in \u001b[36mSyncAPIClient.request\u001b[39m\u001b[34m(self, cast_to, options, stream, stream_cls)\u001b[39m\n\u001b[32m   1034\u001b[39m             err.response.read()\n\u001b[32m   1036\u001b[39m         log.debug(\u001b[33m\"\u001b[39m\u001b[33mRe-raising status error\u001b[39m\u001b[33m\"\u001b[39m)\n\u001b[32m-> \u001b[39m\u001b[32m1037\u001b[39m         \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;28mself\u001b[39m._make_status_error_from_response(err.response) \u001b[38;5;28;01mfrom\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[32m   1039\u001b[39m     \u001b[38;5;28;01mbreak\u001b[39;00m\n\u001b[32m   1041\u001b[39m \u001b[38;5;28;01massert\u001b[39;00m response \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m, \u001b[33m\"\u001b[39m\u001b[33mcould not resolve response (should never happen)\u001b[39m\u001b[33m\"\u001b[39m\n",
       "\u001b[31mNotFoundError\u001b[39m: Error code: 404"
      ]
+<<<<<<< HEAD
 =======
      "data": {
       "application/vnd.jupyter.widget-view+json": {
@@ -81,6 +89,8 @@
      "metadata": {},
      "output_type": "display_data"
 >>>>>>> bad0e67 (多轮对话+agno agent学习实践)
+=======
+>>>>>>> d788ac0 (agno练习+转账agent)
     }
    ],
    "source": [
@@ -95,10 +105,14 @@
     "    \"\"\"保存用户消息\"\"\"\n",
     "    user_message = f\"\"\"\n",
 <<<<<<< HEAD
+<<<<<<< HEAD
     "    用户发来新的消息(在<>中提供),如果用户询问一些其他问题时,请礼貌地告诉用户,你是一个信息收集助手,不回答其它不相关问题。\n",
 =======
     "    用户发来新的消息(在<>中提供),用户询问一些其他问题时,请礼貌地告诉用户,你是一个信息收集助手,不回答其它不相关问题。\n",
 >>>>>>> bad0e67 (多轮对话+agno agent学习实践)
+=======
+    "    用户发来新的消息(在<>中提供),如果用户询问一些其他问题时,请礼貌地告诉用户,你是一个信息收集助手,不回答其它不相关问题。\n",
+>>>>>>> d788ac0 (agno练习+转账agent)
     "    用户消息:\n",
     "    <{content}>\n",
     "    \"\"\"\n",
@@ -129,15 +143,21 @@
     "        model=\"qwen3-30b-a3b\",\n",
     "        messages= [{\"role\": \"system\", \"content\": system_prompt}] + messages,\n",
 <<<<<<< HEAD
+<<<<<<< HEAD
 =======
     "        \n",
 >>>>>>> bad0e67 (多轮对话+agno agent学习实践)
+=======
+>>>>>>> d788ac0 (agno练习+转账agent)
     "        extra_body={\"enable_thinking\": False},\n",
     "        temperature=0.7,\n",
     "    )\n",
     "    return response.choices[0].message.content\n",
     "\n",
 <<<<<<< HEAD
+<<<<<<< HEAD
+=======
+>>>>>>> d788ac0 (agno练习+转账agent)
     "    # response = client.responses.create(\n",
     "    #     model=\"qwen3-30b-a3b\",\n",
     "    #     input= [{\"role\": \"system\", \"content\": system_prompt}] + messages,\n",
@@ -146,8 +166,11 @@
     "    # )\n",
     "    # return response.output_text\n",
     "\n",
+<<<<<<< HEAD
 =======
 >>>>>>> bad0e67 (多轮对话+agno agent学习实践)
+=======
+>>>>>>> d788ac0 (agno练习+转账agent)
     "# 用户输入的消息\n",
     "user_message = \"Hello, how are you?\"\n",
     "save_user_message(\"user\", user_message)\n",

+ 71 - 0
曹航/3/agent_test1.ipynb

@@ -3,10 +3,14 @@
   {
    "cell_type": "code",
 <<<<<<< HEAD
+<<<<<<< HEAD
    "execution_count": 1,
 =======
    "execution_count": 8,
 >>>>>>> bad0e67 (多轮对话+agno agent学习实践)
+=======
+   "execution_count": 1,
+>>>>>>> d788ac0 (agno练习+转账agent)
    "id": "8f58232e",
    "metadata": {},
    "outputs": [],
@@ -51,10 +55,14 @@
      "data": {
       "application/vnd.jupyter.widget-view+json": {
 <<<<<<< HEAD
+<<<<<<< HEAD
        "model_id": "a917f0961fca4339bce6bb54a2e494c9",
 =======
        "model_id": "b8dba8b1142d4e78b13a51496be46d95",
 >>>>>>> bad0e67 (多轮对话+agno agent学习实践)
+=======
+       "model_id": "a917f0961fca4339bce6bb54a2e494c9",
+>>>>>>> d788ac0 (agno练习+转账agent)
        "version_major": 2,
        "version_minor": 0
       },
@@ -119,10 +127,14 @@
   {
    "cell_type": "code",
 <<<<<<< HEAD
+<<<<<<< HEAD
    "execution_count": 3,
 =======
    "execution_count": null,
 >>>>>>> bad0e67 (多轮对话+agno agent学习实践)
+=======
+   "execution_count": 3,
+>>>>>>> d788ac0 (agno练习+转账agent)
    "id": "389236b4",
    "metadata": {},
    "outputs": [
@@ -130,10 +142,14 @@
      "data": {
       "application/vnd.jupyter.widget-view+json": {
 <<<<<<< HEAD
+<<<<<<< HEAD
        "model_id": "c557671b95194a308e03957184726d5f",
 =======
        "model_id": "b1683a2f5e664bd58207674eae611741",
 >>>>>>> bad0e67 (多轮对话+agno agent学习实践)
+=======
+       "model_id": "c557671b95194a308e03957184726d5f",
+>>>>>>> d788ac0 (agno练习+转账agent)
        "version_major": 2,
        "version_minor": 0
       },
@@ -409,10 +425,14 @@
   {
    "cell_type": "code",
 <<<<<<< HEAD
+<<<<<<< HEAD
    "execution_count": 4,
 =======
    "execution_count": 10,
 >>>>>>> bad0e67 (多轮对话+agno agent学习实践)
+=======
+   "execution_count": 4,
+>>>>>>> d788ac0 (agno练习+转账agent)
    "id": "595e81bb",
    "metadata": {},
    "outputs": [
@@ -420,10 +440,14 @@
      "data": {
       "application/vnd.jupyter.widget-view+json": {
 <<<<<<< HEAD
+<<<<<<< HEAD
        "model_id": "15d791b433274c4ab422b583169426f5",
 =======
        "model_id": "d30e05211dbc466caa6cfbe96855dd52",
 >>>>>>> bad0e67 (多轮对话+agno agent学习实践)
+=======
+       "model_id": "15d791b433274c4ab422b583169426f5",
+>>>>>>> d788ac0 (agno练习+转账agent)
        "version_major": 2,
        "version_minor": 0
       },
@@ -448,10 +472,14 @@
      "data": {
       "application/vnd.jupyter.widget-view+json": {
 <<<<<<< HEAD
+<<<<<<< HEAD
        "model_id": "17467c587eec477fb111cb58cb20dc82",
 =======
        "model_id": "c1da05284d4b4438a77e421352c5274e",
 >>>>>>> bad0e67 (多轮对话+agno agent学习实践)
+=======
+       "model_id": "17467c587eec477fb111cb58cb20dc82",
+>>>>>>> d788ac0 (agno练习+转账agent)
        "version_major": 2,
        "version_minor": 0
       },
@@ -476,10 +504,14 @@
      "data": {
       "application/vnd.jupyter.widget-view+json": {
 <<<<<<< HEAD
+<<<<<<< HEAD
        "model_id": "d0c6a7cada684caa82ac98fd745f4990",
 =======
        "model_id": "8c0296dac7464ca48c8ffbf97485c3fa",
 >>>>>>> bad0e67 (多轮对话+agno agent学习实践)
+=======
+       "model_id": "d0c6a7cada684caa82ac98fd745f4990",
+>>>>>>> d788ac0 (agno练习+转账agent)
        "version_major": 2,
        "version_minor": 0
       },
@@ -504,10 +536,14 @@
      "data": {
       "application/vnd.jupyter.widget-view+json": {
 <<<<<<< HEAD
+<<<<<<< HEAD
        "model_id": "328410a4e1f144c2b19d0d286c247e0c",
 =======
        "model_id": "dde342ffffe6412bb7dd7de7a5e10063",
 >>>>>>> bad0e67 (多轮对话+agno agent学习实践)
+=======
+       "model_id": "328410a4e1f144c2b19d0d286c247e0c",
+>>>>>>> d788ac0 (agno练习+转账agent)
        "version_major": 2,
        "version_minor": 0
       },
@@ -532,10 +568,14 @@
      "data": {
       "application/vnd.jupyter.widget-view+json": {
 <<<<<<< HEAD
+<<<<<<< HEAD
        "model_id": "486e315eeb5e4130967fdcd53cdf5e1d",
 =======
        "model_id": "f7d74a23df1b4396bcfb012cd1f88b03",
 >>>>>>> bad0e67 (多轮对话+agno agent学习实践)
+=======
+       "model_id": "486e315eeb5e4130967fdcd53cdf5e1d",
+>>>>>>> d788ac0 (agno练习+转账agent)
        "version_major": 2,
        "version_minor": 0
       },
@@ -594,10 +634,14 @@
   {
    "cell_type": "code",
 <<<<<<< HEAD
+<<<<<<< HEAD
    "execution_count": null,
 =======
    "execution_count": 14,
 >>>>>>> bad0e67 (多轮对话+agno agent学习实践)
+=======
+   "execution_count": null,
+>>>>>>> d788ac0 (agno练习+转账agent)
    "id": "54fce47a",
    "metadata": {},
    "outputs": [
@@ -605,10 +649,14 @@
      "data": {
       "application/vnd.jupyter.widget-view+json": {
 <<<<<<< HEAD
+<<<<<<< HEAD
        "model_id": "3bdc3e79f1444be680451ae5566bd84a",
 =======
        "model_id": "a813b71508b3424eac865edc9902a814",
 >>>>>>> bad0e67 (多轮对话+agno agent学习实践)
+=======
+       "model_id": "3bdc3e79f1444be680451ae5566bd84a",
+>>>>>>> d788ac0 (agno练习+转账agent)
        "version_major": 2,
        "version_minor": 0
       },
@@ -633,10 +681,14 @@
      "data": {
       "application/vnd.jupyter.widget-view+json": {
 <<<<<<< HEAD
+<<<<<<< HEAD
        "model_id": "9402012548f345c8899a30bb3c07a0a0",
 =======
        "model_id": "8c38d9d97ddf4afe8a771cc80bb8264c",
 >>>>>>> bad0e67 (多轮对话+agno agent学习实践)
+=======
+       "model_id": "9402012548f345c8899a30bb3c07a0a0",
+>>>>>>> d788ac0 (agno练习+转账agent)
        "version_major": 2,
        "version_minor": 0
       },
@@ -661,10 +713,14 @@
      "data": {
       "application/vnd.jupyter.widget-view+json": {
 <<<<<<< HEAD
+<<<<<<< HEAD
        "model_id": "6723870b70ec488c8c311ff3749060ef",
 =======
        "model_id": "c94473f3849348acaa1f3e6680cb81da",
 >>>>>>> bad0e67 (多轮对话+agno agent学习实践)
+=======
+       "model_id": "6723870b70ec488c8c311ff3749060ef",
+>>>>>>> d788ac0 (agno练习+转账agent)
        "version_major": 2,
        "version_minor": 0
       },
@@ -689,10 +745,14 @@
      "data": {
       "application/vnd.jupyter.widget-view+json": {
 <<<<<<< HEAD
+<<<<<<< HEAD
        "model_id": "880b75df788f47fcb02dceacf699b090",
 =======
        "model_id": "5c2cf0fb836d4dce9d70341053947065",
 >>>>>>> bad0e67 (多轮对话+agno agent学习实践)
+=======
+       "model_id": "880b75df788f47fcb02dceacf699b090",
+>>>>>>> d788ac0 (agno练习+转账agent)
        "version_major": 2,
        "version_minor": 0
       },
@@ -717,10 +777,14 @@
      "data": {
       "application/vnd.jupyter.widget-view+json": {
 <<<<<<< HEAD
+<<<<<<< HEAD
        "model_id": "59643333ac1549dc97188ae1fdea365d",
 =======
        "model_id": "d4081a2d82bb45df9682265dd5d0388c",
 >>>>>>> bad0e67 (多轮对话+agno agent学习实践)
+=======
+       "model_id": "59643333ac1549dc97188ae1fdea365d",
+>>>>>>> d788ac0 (agno练习+转账agent)
        "version_major": 2,
        "version_minor": 0
       },
@@ -752,10 +816,14 @@
     "agent.search_previous_sessions_history=True\n",
     "agent.num_history_sessions=5\n",
 <<<<<<< HEAD
+<<<<<<< HEAD
     "agent.storage=SqliteStorage(table_name=\"agent_history\",db_file=\"temp/agent_history.db\")\n",
 =======
     "# agent.storage=SqliteStorage(table_name=\"agent_history\",db_file=\"temp/agent_history.db\")\n",
 >>>>>>> bad0e67 (多轮对话+agno agent学习实践)
+=======
+    "agent.storage=SqliteStorage(table_name=\"agent_history\",db_file=\"temp/agent_history.db\")\n",
+>>>>>>> d788ac0 (agno练习+转账agent)
     "\n",
     "#session设置\n",
     "session_1_id = \"session_1_id\"\n",
@@ -773,6 +841,7 @@
     ")  # It should only include the last 2 sessions"
    ]
 <<<<<<< HEAD
+<<<<<<< HEAD
 =======
   },
   {
@@ -783,6 +852,8 @@
     "**Agent state**"
    ]
 >>>>>>> bad0e67 (多轮对话+agno agent学习实践)
+=======
+>>>>>>> d788ac0 (agno练习+转账agent)
   }
  ],
  "metadata": {

+ 200 - 348
曹航/3/agent_test2.ipynb

@@ -3,10 +3,14 @@
   {
    "cell_type": "code",
 <<<<<<< HEAD
+<<<<<<< HEAD
    "execution_count": 1,
 =======
    "execution_count": 11,
 >>>>>>> bad0e67 (多轮对话+agno agent学习实践)
+=======
+   "execution_count": 1,
+>>>>>>> d788ac0 (agno练习+转账agent)
    "id": "a4856341",
    "metadata": {},
    "outputs": [
@@ -17,10 +21,14 @@
       ]
      },
 <<<<<<< HEAD
+<<<<<<< HEAD
      "execution_count": 1,
 =======
      "execution_count": 11,
 >>>>>>> bad0e67 (多轮对话+agno agent学习实践)
+=======
+     "execution_count": 1,
+>>>>>>> d788ac0 (agno练习+转账agent)
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -28,6 +36,7 @@
    "source": [
     "from textwrap import dedent\n",
 <<<<<<< HEAD
+<<<<<<< HEAD
     "\n",
     "from agno.agent import Agent\n",
     "from agno.models.openai import OpenAILike\n",
@@ -52,19 +61,37 @@
     "import json\n",
     "load_dotenv()\n"
 =======
+=======
+    "\n",
+>>>>>>> d788ac0 (agno练习+转账agent)
     "from agno.agent import Agent\n",
-    "from dotenv import load_dotenv \n",
     "from agno.models.openai import OpenAILike\n",
     "from agno.memory.v2.db.sqlite import SqliteMemoryDb\n",
+    "from agno.exceptions import StopAgentRun\n",
     "from agno.memory.v2.memory import Memory\n",
-    "from rich.pretty import pprint\n",
+    "from agno.tools import tool,FunctionCall\n",
+    "from agno.tools.dalle import DalleTools\n",
     "from agno.storage.sqlite import SqliteStorage\n",
-    "from typing import List,Dict\n",
+    "\n",
+    "from dotenv import load_dotenv \n",
+    "\n",
+    "from typing import List,Iterator\n",
     "from pydantic import BaseModel, Field\n",
+    "\n",
+    "from rich.console import Console\n",
+    "from rich.prompt import Prompt\n",
+    "from rich.pretty import pprint\n",
+    "\n",
+    "import httpx\n",
     "import os\n",
+<<<<<<< HEAD
     "load_dotenv()\n",
     "\n"
 >>>>>>> bad0e67 (多轮对话+agno agent学习实践)
+=======
+    "import json\n",
+    "load_dotenv()\n"
+>>>>>>> d788ac0 (agno练习+转账agent)
    ]
   },
   {
@@ -78,10 +105,14 @@
   {
    "cell_type": "code",
 <<<<<<< HEAD
+<<<<<<< HEAD
    "execution_count": 2,
 =======
    "execution_count": null,
 >>>>>>> bad0e67 (多轮对话+agno agent学习实践)
+=======
+   "execution_count": 2,
+>>>>>>> d788ac0 (agno练习+转账agent)
    "id": "46403d1a",
    "metadata": {},
    "outputs": [
@@ -89,10 +120,14 @@
      "data": {
       "application/vnd.jupyter.widget-view+json": {
 <<<<<<< HEAD
+<<<<<<< HEAD
        "model_id": "b5e36e3099374134807dcb494a113ff1",
 =======
        "model_id": "9b3d2e36a97047dcaf90b8a373c1c2c1",
 >>>>>>> bad0e67 (多轮对话+agno agent学习实践)
+=======
+       "model_id": "b5e36e3099374134807dcb494a113ff1",
+>>>>>>> d788ac0 (agno练习+转账agent)
        "version_major": 2,
        "version_minor": 0
       },
@@ -118,10 +153,14 @@
      "output_type": "stream",
      "text": [
 <<<<<<< HEAD
+<<<<<<< HEAD
       "Final session state: {'shopping_list': ['milk', 'eggs', 'bread'], 'current_session_id': 'c0e056e2-5ea1-4e62-a955-227f6485ffa6'}\n"
 =======
       "Final session state: {'shopping_list': ['milk', 'eggs', 'bread'], 'current_session_id': 'fb205638-5e39-40e7-8722-1aedcd7995e0'}\n"
 >>>>>>> bad0e67 (多轮对话+agno agent学习实践)
+=======
+      "Final session state: {'shopping_list': ['milk', 'eggs', 'bread'], 'current_session_id': 'c0e056e2-5ea1-4e62-a955-227f6485ffa6'}\n"
+>>>>>>> d788ac0 (agno练习+转账agent)
      ]
     }
    ],
@@ -160,6 +199,7 @@
   {
    "cell_type": "code",
 <<<<<<< HEAD
+<<<<<<< HEAD
    "execution_count": null,
    "id": "8e7e7a5b",
    "metadata": {},
@@ -169,168 +209,19 @@
     "@tool(description=\"Add an item to the shopping list.\")\n",
 =======
    "execution_count": 6,
+=======
+   "execution_count": null,
+>>>>>>> d788ac0 (agno练习+转账agent)
    "id": "8e7e7a5b",
    "metadata": {},
-   "outputs": [
-    {
-     "data": {
-      "application/vnd.jupyter.widget-view+json": {
-       "model_id": "1dbdd22b0ef44e0ca820d7469715ad9c",
-       "version_major": 2,
-       "version_minor": 0
-      },
-      "text/plain": [
-       "Output()"
-      ]
-     },
-     "metadata": {},
-     "output_type": "display_data"
-    },
-    {
-     "data": {
-      "text/html": [
-       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"></pre>\n"
-      ],
-      "text/plain": []
-     },
-     "metadata": {},
-     "output_type": "display_data"
-    },
-    {
-     "name": "stdout",
-     "output_type": "stream",
-     "text": [
-      "Session state: {'shopping_list': ['milk', 'eggs', 'bread'], 'current_session_id': '7d5889cc-c85a-46a8-bd6d-617eb4fc56fb'}\n"
-     ]
-    },
-    {
-     "data": {
-      "application/vnd.jupyter.widget-view+json": {
-       "model_id": "df0130bb33ad4782a54af20fd62e96ca",
-       "version_major": 2,
-       "version_minor": 0
-      },
-      "text/plain": [
-       "Output()"
-      ]
-     },
-     "metadata": {},
-     "output_type": "display_data"
-    },
-    {
-     "data": {
-      "text/html": [
-       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"></pre>\n"
-      ],
-      "text/plain": []
-     },
-     "metadata": {},
-     "output_type": "display_data"
-    },
-    {
-     "name": "stdout",
-     "output_type": "stream",
-     "text": [
-      "Session state: {'shopping_list': ['milk', 'eggs'], 'current_session_id': '7d5889cc-c85a-46a8-bd6d-617eb4fc56fb'}\n"
-     ]
-    },
-    {
-     "data": {
-      "application/vnd.jupyter.widget-view+json": {
-       "model_id": "33b95577fd9a41f4b1ba01af0d8c9d16",
-       "version_major": 2,
-       "version_minor": 0
-      },
-      "text/plain": [
-       "Output()"
-      ]
-     },
-     "metadata": {},
-     "output_type": "display_data"
-    },
-    {
-     "data": {
-      "text/html": [
-       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"></pre>\n"
-      ],
-      "text/plain": []
-     },
-     "metadata": {},
-     "output_type": "display_data"
-    },
-    {
-     "name": "stdout",
-     "output_type": "stream",
-     "text": [
-      "Session state: {'shopping_list': ['milk', 'eggs', 'apples', 'oranges'], 'current_session_id': '7d5889cc-c85a-46a8-bd6d-617eb4fc56fb'}\n"
-     ]
-    },
-    {
-     "data": {
-      "application/vnd.jupyter.widget-view+json": {
-       "model_id": "22a01dc2c8cf44ca8fee0e64115ccf46",
-       "version_major": 2,
-       "version_minor": 0
-      },
-      "text/plain": [
-       "Output()"
-      ]
-     },
-     "metadata": {},
-     "output_type": "display_data"
-    },
-    {
-     "data": {
-      "text/html": [
-       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"></pre>\n"
-      ],
-      "text/plain": []
-     },
-     "metadata": {},
-     "output_type": "display_data"
-    },
-    {
-     "name": "stdout",
-     "output_type": "stream",
-     "text": [
-      "Session state: {'shopping_list': ['milk', 'eggs', 'apples', 'oranges'], 'current_session_id': '7d5889cc-c85a-46a8-bd6d-617eb4fc56fb'}\n"
-     ]
-    },
-    {
-     "data": {
-      "application/vnd.jupyter.widget-view+json": {
-       "model_id": "c3f890d603fa4dbb9497ec8481340014",
-       "version_major": 2,
-       "version_minor": 0
-      },
-      "text/plain": [
-       "Output()"
-      ]
-     },
-     "metadata": {},
-     "output_type": "display_data"
-    },
-    {
-     "data": {
-      "text/html": [
-       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"></pre>\n"
-      ],
-      "text/plain": []
-     },
-     "metadata": {},
-     "output_type": "display_data"
-    },
-    {
-     "name": "stdout",
-     "output_type": "stream",
-     "text": [
-      "Session state: {'shopping_list': ['bananas', 'yogurt'], 'current_session_id': '7d5889cc-c85a-46a8-bd6d-617eb4fc56fb'}\n"
-     ]
-    }
-   ],
+   "outputs": [],
    "source": [
     "# Define tools to manage our shopping list\n",
+<<<<<<< HEAD
 >>>>>>> bad0e67 (多轮对话+agno agent学习实践)
+=======
+    "@tool(description=\"Add an item to the shopping list.\")\n",
+>>>>>>> d788ac0 (agno练习+转账agent)
     "def add_item(agent: Agent, item: str) -> str:\n",
     "    \"\"\"Add an item to the shopping list and return confirmation.\"\"\"\n",
     "    # Add the item if it's not already in the list\n",
@@ -347,10 +238,14 @@
     "        return f\"'{item}' is already in the shopping list\"\n",
     "\n",
 <<<<<<< HEAD
+<<<<<<< HEAD
     "@tool(description=\"Remove an item from the shopping list by name.\")\n",
 =======
     "\n",
 >>>>>>> bad0e67 (多轮对话+agno agent学习实践)
+=======
+    "@tool(description=\"Remove an item from the shopping list by name.\")\n",
+>>>>>>> d788ac0 (agno练习+转账agent)
     "def remove_item(agent: Agent, item: str) -> str:\n",
     "    \"\"\"Remove an item from the shopping list by name.\"\"\"\n",
     "    # Case-insensitive search\n",
@@ -367,10 +262,14 @@
     "    return f\"'{item}' was not found in the shopping list\"\n",
     "\n",
 <<<<<<< HEAD
+<<<<<<< HEAD
     "@tool(description=\"List all items in the shopping list.\")\n",
 =======
     "\n",
 >>>>>>> bad0e67 (多轮对话+agno agent学习实践)
+=======
+    "@tool(description=\"List all items in the shopping list.\")\n",
+>>>>>>> d788ac0 (agno练习+转账agent)
     "def list_items(agent: Agent) -> str:\n",
     "    \"\"\"List all items in the shopping list.\"\"\"\n",
     "    if agent.session_state is None:\n",
@@ -437,6 +336,7 @@
   {
    "cell_type": "code",
 <<<<<<< HEAD
+<<<<<<< HEAD
    "execution_count": null,
    "id": "1f118e71",
    "metadata": {},
@@ -568,6 +468,12 @@
     }
    ],
 >>>>>>> bad0e67 (多轮对话+agno agent学习实践)
+=======
+   "execution_count": null,
+   "id": "1f118e71",
+   "metadata": {},
+   "outputs": [],
+>>>>>>> d788ac0 (agno练习+转账agent)
    "source": [
     "# UserId for the memories\n",
     "user_id = \"ava\"\n",
@@ -579,6 +485,7 @@
     "    # Use any model for creating memories\n",
     "    model=OpenAILike(id=\"qwen3-30b-a3b\", \n",
 <<<<<<< HEAD
+<<<<<<< HEAD
     "                    api_key=os.getenv(\"BAILIAN_API_KEY\"), \n",
     "                    base_url=os.getenv(\"BAILIAN_API_BASE_URL\"),\n",
     "                    request_params={\"extra_body\": {\"enable_thinking\": False}},),\n",
@@ -587,6 +494,11 @@
     "    base_url=os.getenv(\"BAILIAN_API_BASE_URL\"),\n",
     "    request_params={\"extra_body\": {\"enable_thinking\": False}},),\n",
 >>>>>>> bad0e67 (多轮对话+agno agent学习实践)
+=======
+    "                    api_key=os.getenv(\"BAILIAN_API_KEY\"), \n",
+    "                    base_url=os.getenv(\"BAILIAN_API_BASE_URL\"),\n",
+    "                    request_params={\"extra_body\": {\"enable_thinking\": False}},),\n",
+>>>>>>> d788ac0 (agno练习+转账agent)
     "    db=SqliteMemoryDb(table_name=\"user_memories\", db_file=db_file),\n",
     ")\n",
     "# Initialize storage\n",
@@ -644,6 +556,7 @@
   {
    "cell_type": "code",
 <<<<<<< HEAD
+<<<<<<< HEAD
    "execution_count": null,
    "id": "5cddde6d",
    "metadata": {},
@@ -790,220 +703,159 @@
     "**Multimodal Agent**"
 =======
    "execution_count": 13,
+=======
+   "execution_count": null,
+>>>>>>> d788ac0 (agno练习+转账agent)
    "id": "5cddde6d",
    "metadata": {},
-   "outputs": [
-    {
-     "data": {
-      "application/vnd.jupyter.widget-view+json": {
-       "model_id": "7745304024a946c3b1e7bcba04f464ca",
-       "version_major": 2,
-       "version_minor": 0
-      },
-      "text/plain": [
-       "Output()"
-      ]
-     },
-     "metadata": {},
-     "output_type": "display_data"
-    },
-    {
-     "data": {
-      "text/html": [
-       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #808000; text-decoration-color: #808000\">WARNING </span> Failed to parse cleaned JSON: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">6</span> validation errors for MovieScript                                         \n",
-       "         setting                                                                                                   \n",
-       "           Input should be a valid string <span style=\"font-weight: bold\">[</span><span style=\"color: #808000; text-decoration-color: #808000\">type</span>=<span style=\"color: #800080; text-decoration-color: #800080\">string_type</span>, <span style=\"color: #808000; text-decoration-color: #808000\">input_value</span>=<span style=\"font-weight: bold\">{</span><span style=\"color: #008000; text-decoration-color: #008000\">'location'</span>: <span style=\"color: #008000; text-decoration-color: #008000\">'New York Ci...t hold hidden </span>\n",
-       "         <span style=\"color: #008000; text-decoration-color: #008000\">stories.'</span><span style=\"font-weight: bold\">}</span>, <span style=\"color: #808000; text-decoration-color: #808000\">input_type</span>=<span style=\"color: #800080; text-decoration-color: #800080\">dict</span><span style=\"font-weight: bold\">]</span>                                                                              \n",
-       "             For further information visit <span style=\"color: #0000ff; text-decoration-color: #0000ff; text-decoration: underline\">https://errors.pydantic.dev/2.11/v/string_type</span>                          \n",
-       "         ending                                                                                                    \n",
-       "           Field required <span style=\"font-weight: bold\">[</span><span style=\"color: #808000; text-decoration-color: #808000\">type</span>=<span style=\"color: #800080; text-decoration-color: #800080\">missing</span>, <span style=\"color: #808000; text-decoration-color: #808000\">input_value</span>=<span style=\"font-weight: bold\">{</span><span style=\"color: #008000; text-decoration-color: #008000\">'title'</span>: <span style=\"color: #008000; text-decoration-color: #008000\">'New York'</span>, <span style=\"color: #008000; text-decoration-color: #008000\">'ge...s a central character.'</span><span style=\"font-weight: bold\">}</span>,         \n",
-       "         <span style=\"color: #808000; text-decoration-color: #808000\">input_type</span>=<span style=\"color: #800080; text-decoration-color: #800080\">dict</span><span style=\"font-weight: bold\">]</span>                                                                                          \n",
-       "             For further information visit <span style=\"color: #0000ff; text-decoration-color: #0000ff; text-decoration: underline\">https://errors.pydantic.dev/2.11/v/missing</span>                              \n",
-       "         name                                                                                                      \n",
-       "           Field required <span style=\"font-weight: bold\">[</span><span style=\"color: #808000; text-decoration-color: #808000\">type</span>=<span style=\"color: #800080; text-decoration-color: #800080\">missing</span>, <span style=\"color: #808000; text-decoration-color: #808000\">input_value</span>=<span style=\"font-weight: bold\">{</span><span style=\"color: #008000; text-decoration-color: #008000\">'title'</span>: <span style=\"color: #008000; text-decoration-color: #008000\">'New York'</span>, <span style=\"color: #008000; text-decoration-color: #008000\">'ge...s a central character.'</span><span style=\"font-weight: bold\">}</span>,         \n",
-       "         <span style=\"color: #808000; text-decoration-color: #808000\">input_type</span>=<span style=\"color: #800080; text-decoration-color: #800080\">dict</span><span style=\"font-weight: bold\">]</span>                                                                                          \n",
-       "             For further information visit <span style=\"color: #0000ff; text-decoration-color: #0000ff; text-decoration: underline\">https://errors.pydantic.dev/2.11/v/missing</span>                              \n",
-       "         characters                                                                                                \n",
-       "           Field required <span style=\"font-weight: bold\">[</span><span style=\"color: #808000; text-decoration-color: #808000\">type</span>=<span style=\"color: #800080; text-decoration-color: #800080\">missing</span>, <span style=\"color: #808000; text-decoration-color: #808000\">input_value</span>=<span style=\"font-weight: bold\">{</span><span style=\"color: #008000; text-decoration-color: #008000\">'title'</span>: <span style=\"color: #008000; text-decoration-color: #008000\">'New York'</span>, <span style=\"color: #008000; text-decoration-color: #008000\">'ge...s a central character.'</span><span style=\"font-weight: bold\">}</span>,         \n",
-       "         <span style=\"color: #808000; text-decoration-color: #808000\">input_type</span>=<span style=\"color: #800080; text-decoration-color: #800080\">dict</span><span style=\"font-weight: bold\">]</span>                                                                                          \n",
-       "             For further information visit <span style=\"color: #0000ff; text-decoration-color: #0000ff; text-decoration: underline\">https://errors.pydantic.dev/2.11/v/missing</span>                              \n",
-       "         storyline                                                                                                 \n",
-       "           Field required <span style=\"font-weight: bold\">[</span><span style=\"color: #808000; text-decoration-color: #808000\">type</span>=<span style=\"color: #800080; text-decoration-color: #800080\">missing</span>, <span style=\"color: #808000; text-decoration-color: #808000\">input_value</span>=<span style=\"font-weight: bold\">{</span><span style=\"color: #008000; text-decoration-color: #008000\">'title'</span>: <span style=\"color: #008000; text-decoration-color: #008000\">'New York'</span>, <span style=\"color: #008000; text-decoration-color: #008000\">'ge...s a central character.'</span><span style=\"font-weight: bold\">}</span>,         \n",
-       "         <span style=\"color: #808000; text-decoration-color: #808000\">input_type</span>=<span style=\"color: #800080; text-decoration-color: #800080\">dict</span><span style=\"font-weight: bold\">]</span>                                                                                          \n",
-       "             For further information visit <span style=\"color: #0000ff; text-decoration-color: #0000ff; text-decoration: underline\">https://errors.pydantic.dev/2.11/v/missing</span>                              \n",
-       "         rating                                                                                                    \n",
-       "           Field required <span style=\"font-weight: bold\">[</span><span style=\"color: #808000; text-decoration-color: #808000\">type</span>=<span style=\"color: #800080; text-decoration-color: #800080\">missing</span>, <span style=\"color: #808000; text-decoration-color: #808000\">input_value</span>=<span style=\"font-weight: bold\">{</span><span style=\"color: #008000; text-decoration-color: #008000\">'title'</span>: <span style=\"color: #008000; text-decoration-color: #008000\">'New York'</span>, <span style=\"color: #008000; text-decoration-color: #008000\">'ge...s a central character.'</span><span style=\"font-weight: bold\">}</span>,         \n",
-       "         <span style=\"color: #808000; text-decoration-color: #808000\">input_type</span>=<span style=\"color: #800080; text-decoration-color: #800080\">dict</span><span style=\"font-weight: bold\">]</span>                                                                                          \n",
-       "             For further information visit <span style=\"color: #0000ff; text-decoration-color: #0000ff; text-decoration: underline\">https://errors.pydantic.dev/2.11/v/missing</span>                              \n",
-       "</pre>\n"
-      ],
-      "text/plain": [
-       "\u001b[33mWARNING \u001b[0m Failed to parse cleaned JSON: \u001b[1;36m6\u001b[0m validation errors for MovieScript                                         \n",
-       "         setting                                                                                                   \n",
-       "           Input should be a valid string \u001b[1m[\u001b[0m\u001b[33mtype\u001b[0m=\u001b[35mstring_type\u001b[0m, \u001b[33minput_value\u001b[0m=\u001b[1m{\u001b[0m\u001b[32m'location'\u001b[0m: \u001b[32m'New York Ci...t hold hidden \u001b[0m\n",
-       "         \u001b[32mstories.'\u001b[0m\u001b[1m}\u001b[0m, \u001b[33minput_type\u001b[0m=\u001b[35mdict\u001b[0m\u001b[1m]\u001b[0m                                                                              \n",
-       "             For further information visit \u001b[4;94mhttps://errors.pydantic.dev/2.11/v/string_type\u001b[0m                          \n",
-       "         ending                                                                                                    \n",
-       "           Field required \u001b[1m[\u001b[0m\u001b[33mtype\u001b[0m=\u001b[35mmissing\u001b[0m, \u001b[33minput_value\u001b[0m=\u001b[1m{\u001b[0m\u001b[32m'title'\u001b[0m: \u001b[32m'New York'\u001b[0m, \u001b[32m'ge...s a central character.'\u001b[0m\u001b[1m}\u001b[0m,         \n",
-       "         \u001b[33minput_type\u001b[0m=\u001b[35mdict\u001b[0m\u001b[1m]\u001b[0m                                                                                          \n",
-       "             For further information visit \u001b[4;94mhttps://errors.pydantic.dev/2.11/v/missing\u001b[0m                              \n",
-       "         name                                                                                                      \n",
-       "           Field required \u001b[1m[\u001b[0m\u001b[33mtype\u001b[0m=\u001b[35mmissing\u001b[0m, \u001b[33minput_value\u001b[0m=\u001b[1m{\u001b[0m\u001b[32m'title'\u001b[0m: \u001b[32m'New York'\u001b[0m, \u001b[32m'ge...s a central character.'\u001b[0m\u001b[1m}\u001b[0m,         \n",
-       "         \u001b[33minput_type\u001b[0m=\u001b[35mdict\u001b[0m\u001b[1m]\u001b[0m                                                                                          \n",
-       "             For further information visit \u001b[4;94mhttps://errors.pydantic.dev/2.11/v/missing\u001b[0m                              \n",
-       "         characters                                                                                                \n",
-       "           Field required \u001b[1m[\u001b[0m\u001b[33mtype\u001b[0m=\u001b[35mmissing\u001b[0m, \u001b[33minput_value\u001b[0m=\u001b[1m{\u001b[0m\u001b[32m'title'\u001b[0m: \u001b[32m'New York'\u001b[0m, \u001b[32m'ge...s a central character.'\u001b[0m\u001b[1m}\u001b[0m,         \n",
-       "         \u001b[33minput_type\u001b[0m=\u001b[35mdict\u001b[0m\u001b[1m]\u001b[0m                                                                                          \n",
-       "             For further information visit \u001b[4;94mhttps://errors.pydantic.dev/2.11/v/missing\u001b[0m                              \n",
-       "         storyline                                                                                                 \n",
-       "           Field required \u001b[1m[\u001b[0m\u001b[33mtype\u001b[0m=\u001b[35mmissing\u001b[0m, \u001b[33minput_value\u001b[0m=\u001b[1m{\u001b[0m\u001b[32m'title'\u001b[0m: \u001b[32m'New York'\u001b[0m, \u001b[32m'ge...s a central character.'\u001b[0m\u001b[1m}\u001b[0m,         \n",
-       "         \u001b[33minput_type\u001b[0m=\u001b[35mdict\u001b[0m\u001b[1m]\u001b[0m                                                                                          \n",
-       "             For further information visit \u001b[4;94mhttps://errors.pydantic.dev/2.11/v/missing\u001b[0m                              \n",
-       "         rating                                                                                                    \n",
-       "           Field required \u001b[1m[\u001b[0m\u001b[33mtype\u001b[0m=\u001b[35mmissing\u001b[0m, \u001b[33minput_value\u001b[0m=\u001b[1m{\u001b[0m\u001b[32m'title'\u001b[0m: \u001b[32m'New York'\u001b[0m, \u001b[32m'ge...s a central character.'\u001b[0m\u001b[1m}\u001b[0m,         \n",
-       "         \u001b[33minput_type\u001b[0m=\u001b[35mdict\u001b[0m\u001b[1m]\u001b[0m                                                                                          \n",
-       "             For further information visit \u001b[4;94mhttps://errors.pydantic.dev/2.11/v/missing\u001b[0m                              \n"
-      ]
-     },
-     "metadata": {},
-     "output_type": "display_data"
-    },
-    {
-     "data": {
-      "text/html": [
-       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #808000; text-decoration-color: #808000\">WARNING </span> Validation failed on merged data: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">6</span> validation errors for MovieScript                                     \n",
-       "         setting                                                                                                   \n",
-       "           Input should be a valid string <span style=\"font-weight: bold\">[</span><span style=\"color: #808000; text-decoration-color: #808000\">type</span>=<span style=\"color: #800080; text-decoration-color: #800080\">string_type</span>, <span style=\"color: #808000; text-decoration-color: #808000\">input_value</span>=<span style=\"font-weight: bold\">{</span><span style=\"color: #008000; text-decoration-color: #008000\">'location'</span>: <span style=\"color: #008000; text-decoration-color: #008000\">'New York Ci...t hold hidden </span>\n",
-       "         <span style=\"color: #008000; text-decoration-color: #008000\">stories.'</span><span style=\"font-weight: bold\">}</span>, <span style=\"color: #808000; text-decoration-color: #808000\">input_type</span>=<span style=\"color: #800080; text-decoration-color: #800080\">dict</span><span style=\"font-weight: bold\">]</span>                                                                              \n",
-       "             For further information visit <span style=\"color: #0000ff; text-decoration-color: #0000ff; text-decoration: underline\">https://errors.pydantic.dev/2.11/v/string_type</span>                          \n",
-       "         ending                                                                                                    \n",
-       "           Field required <span style=\"font-weight: bold\">[</span><span style=\"color: #808000; text-decoration-color: #808000\">type</span>=<span style=\"color: #800080; text-decoration-color: #800080\">missing</span>, <span style=\"color: #808000; text-decoration-color: #808000\">input_value</span>=<span style=\"font-weight: bold\">{</span><span style=\"color: #008000; text-decoration-color: #008000\">'setting'</span>: <span style=\"font-weight: bold\">{</span><span style=\"color: #008000; text-decoration-color: #008000\">'location'</span>: <span style=\"color: #808000; text-decoration-color: #808000\">...</span>genre': <span style=\"color: #008000; text-decoration-color: #008000\">'Drama / Crime'</span><span style=\"font-weight: bold\">}</span>,         \n",
-       "         <span style=\"color: #808000; text-decoration-color: #808000\">input_type</span>=<span style=\"color: #800080; text-decoration-color: #800080\">dict</span><span style=\"font-weight: bold\">]</span>                                                                                          \n",
-       "             For further information visit <span style=\"color: #0000ff; text-decoration-color: #0000ff; text-decoration: underline\">https://errors.pydantic.dev/2.11/v/missing</span>                              \n",
-       "         name                                                                                                      \n",
-       "           Field required <span style=\"font-weight: bold\">[</span><span style=\"color: #808000; text-decoration-color: #808000\">type</span>=<span style=\"color: #800080; text-decoration-color: #800080\">missing</span>, <span style=\"color: #808000; text-decoration-color: #808000\">input_value</span>=<span style=\"font-weight: bold\">{</span><span style=\"color: #008000; text-decoration-color: #008000\">'setting'</span>: <span style=\"font-weight: bold\">{</span><span style=\"color: #008000; text-decoration-color: #008000\">'location'</span>: <span style=\"color: #808000; text-decoration-color: #808000\">...</span>genre': <span style=\"color: #008000; text-decoration-color: #008000\">'Drama / Crime'</span><span style=\"font-weight: bold\">}</span>,         \n",
-       "         <span style=\"color: #808000; text-decoration-color: #808000\">input_type</span>=<span style=\"color: #800080; text-decoration-color: #800080\">dict</span><span style=\"font-weight: bold\">]</span>                                                                                          \n",
-       "             For further information visit <span style=\"color: #0000ff; text-decoration-color: #0000ff; text-decoration: underline\">https://errors.pydantic.dev/2.11/v/missing</span>                              \n",
-       "         characters                                                                                                \n",
-       "           Field required <span style=\"font-weight: bold\">[</span><span style=\"color: #808000; text-decoration-color: #808000\">type</span>=<span style=\"color: #800080; text-decoration-color: #800080\">missing</span>, <span style=\"color: #808000; text-decoration-color: #808000\">input_value</span>=<span style=\"font-weight: bold\">{</span><span style=\"color: #008000; text-decoration-color: #008000\">'setting'</span>: <span style=\"font-weight: bold\">{</span><span style=\"color: #008000; text-decoration-color: #008000\">'location'</span>: <span style=\"color: #808000; text-decoration-color: #808000\">...</span>genre': <span style=\"color: #008000; text-decoration-color: #008000\">'Drama / Crime'</span><span style=\"font-weight: bold\">}</span>,         \n",
-       "         <span style=\"color: #808000; text-decoration-color: #808000\">input_type</span>=<span style=\"color: #800080; text-decoration-color: #800080\">dict</span><span style=\"font-weight: bold\">]</span>                                                                                          \n",
-       "             For further information visit <span style=\"color: #0000ff; text-decoration-color: #0000ff; text-decoration: underline\">https://errors.pydantic.dev/2.11/v/missing</span>                              \n",
-       "         storyline                                                                                                 \n",
-       "           Field required <span style=\"font-weight: bold\">[</span><span style=\"color: #808000; text-decoration-color: #808000\">type</span>=<span style=\"color: #800080; text-decoration-color: #800080\">missing</span>, <span style=\"color: #808000; text-decoration-color: #808000\">input_value</span>=<span style=\"font-weight: bold\">{</span><span style=\"color: #008000; text-decoration-color: #008000\">'setting'</span>: <span style=\"font-weight: bold\">{</span><span style=\"color: #008000; text-decoration-color: #008000\">'location'</span>: <span style=\"color: #808000; text-decoration-color: #808000\">...</span>genre': <span style=\"color: #008000; text-decoration-color: #008000\">'Drama / Crime'</span><span style=\"font-weight: bold\">}</span>,         \n",
-       "         <span style=\"color: #808000; text-decoration-color: #808000\">input_type</span>=<span style=\"color: #800080; text-decoration-color: #800080\">dict</span><span style=\"font-weight: bold\">]</span>                                                                                          \n",
-       "             For further information visit <span style=\"color: #0000ff; text-decoration-color: #0000ff; text-decoration: underline\">https://errors.pydantic.dev/2.11/v/missing</span>                              \n",
-       "         rating                                                                                                    \n",
-       "           Field required <span style=\"font-weight: bold\">[</span><span style=\"color: #808000; text-decoration-color: #808000\">type</span>=<span style=\"color: #800080; text-decoration-color: #800080\">missing</span>, <span style=\"color: #808000; text-decoration-color: #808000\">input_value</span>=<span style=\"font-weight: bold\">{</span><span style=\"color: #008000; text-decoration-color: #008000\">'setting'</span>: <span style=\"font-weight: bold\">{</span><span style=\"color: #008000; text-decoration-color: #008000\">'location'</span>: <span style=\"color: #808000; text-decoration-color: #808000\">...</span>genre': <span style=\"color: #008000; text-decoration-color: #008000\">'Drama / Crime'</span><span style=\"font-weight: bold\">}</span>,         \n",
-       "         <span style=\"color: #808000; text-decoration-color: #808000\">input_type</span>=<span style=\"color: #800080; text-decoration-color: #800080\">dict</span><span style=\"font-weight: bold\">]</span>                                                                                          \n",
-       "             For further information visit <span style=\"color: #0000ff; text-decoration-color: #0000ff; text-decoration: underline\">https://errors.pydantic.dev/2.11/v/missing</span>                              \n",
-       "</pre>\n"
-      ],
-      "text/plain": [
-       "\u001b[33mWARNING \u001b[0m Validation failed on merged data: \u001b[1;36m6\u001b[0m validation errors for MovieScript                                     \n",
-       "         setting                                                                                                   \n",
-       "           Input should be a valid string \u001b[1m[\u001b[0m\u001b[33mtype\u001b[0m=\u001b[35mstring_type\u001b[0m, \u001b[33minput_value\u001b[0m=\u001b[1m{\u001b[0m\u001b[32m'location'\u001b[0m: \u001b[32m'New York Ci...t hold hidden \u001b[0m\n",
-       "         \u001b[32mstories.'\u001b[0m\u001b[1m}\u001b[0m, \u001b[33minput_type\u001b[0m=\u001b[35mdict\u001b[0m\u001b[1m]\u001b[0m                                                                              \n",
-       "             For further information visit \u001b[4;94mhttps://errors.pydantic.dev/2.11/v/string_type\u001b[0m                          \n",
-       "         ending                                                                                                    \n",
-       "           Field required \u001b[1m[\u001b[0m\u001b[33mtype\u001b[0m=\u001b[35mmissing\u001b[0m, \u001b[33minput_value\u001b[0m=\u001b[1m{\u001b[0m\u001b[32m'setting'\u001b[0m: \u001b[1m{\u001b[0m\u001b[32m'location'\u001b[0m: \u001b[33m...\u001b[0mgenre': \u001b[32m'Drama / Crime'\u001b[0m\u001b[1m}\u001b[0m,         \n",
-       "         \u001b[33minput_type\u001b[0m=\u001b[35mdict\u001b[0m\u001b[1m]\u001b[0m                                                                                          \n",
-       "             For further information visit \u001b[4;94mhttps://errors.pydantic.dev/2.11/v/missing\u001b[0m                              \n",
-       "         name                                                                                                      \n",
-       "           Field required \u001b[1m[\u001b[0m\u001b[33mtype\u001b[0m=\u001b[35mmissing\u001b[0m, \u001b[33minput_value\u001b[0m=\u001b[1m{\u001b[0m\u001b[32m'setting'\u001b[0m: \u001b[1m{\u001b[0m\u001b[32m'location'\u001b[0m: \u001b[33m...\u001b[0mgenre': \u001b[32m'Drama / Crime'\u001b[0m\u001b[1m}\u001b[0m,         \n",
-       "         \u001b[33minput_type\u001b[0m=\u001b[35mdict\u001b[0m\u001b[1m]\u001b[0m                                                                                          \n",
-       "             For further information visit \u001b[4;94mhttps://errors.pydantic.dev/2.11/v/missing\u001b[0m                              \n",
-       "         characters                                                                                                \n",
-       "           Field required \u001b[1m[\u001b[0m\u001b[33mtype\u001b[0m=\u001b[35mmissing\u001b[0m, \u001b[33minput_value\u001b[0m=\u001b[1m{\u001b[0m\u001b[32m'setting'\u001b[0m: \u001b[1m{\u001b[0m\u001b[32m'location'\u001b[0m: \u001b[33m...\u001b[0mgenre': \u001b[32m'Drama / Crime'\u001b[0m\u001b[1m}\u001b[0m,         \n",
-       "         \u001b[33minput_type\u001b[0m=\u001b[35mdict\u001b[0m\u001b[1m]\u001b[0m                                                                                          \n",
-       "             For further information visit \u001b[4;94mhttps://errors.pydantic.dev/2.11/v/missing\u001b[0m                              \n",
-       "         storyline                                                                                                 \n",
-       "           Field required \u001b[1m[\u001b[0m\u001b[33mtype\u001b[0m=\u001b[35mmissing\u001b[0m, \u001b[33minput_value\u001b[0m=\u001b[1m{\u001b[0m\u001b[32m'setting'\u001b[0m: \u001b[1m{\u001b[0m\u001b[32m'location'\u001b[0m: \u001b[33m...\u001b[0mgenre': \u001b[32m'Drama / Crime'\u001b[0m\u001b[1m}\u001b[0m,         \n",
-       "         \u001b[33minput_type\u001b[0m=\u001b[35mdict\u001b[0m\u001b[1m]\u001b[0m                                                                                          \n",
-       "             For further information visit \u001b[4;94mhttps://errors.pydantic.dev/2.11/v/missing\u001b[0m                              \n",
-       "         rating                                                                                                    \n",
-       "           Field required \u001b[1m[\u001b[0m\u001b[33mtype\u001b[0m=\u001b[35mmissing\u001b[0m, \u001b[33minput_value\u001b[0m=\u001b[1m{\u001b[0m\u001b[32m'setting'\u001b[0m: \u001b[1m{\u001b[0m\u001b[32m'location'\u001b[0m: \u001b[33m...\u001b[0mgenre': \u001b[32m'Drama / Crime'\u001b[0m\u001b[1m}\u001b[0m,         \n",
-       "         \u001b[33minput_type\u001b[0m=\u001b[35mdict\u001b[0m\u001b[1m]\u001b[0m                                                                                          \n",
-       "             For further information visit \u001b[4;94mhttps://errors.pydantic.dev/2.11/v/missing\u001b[0m                              \n"
-      ]
-     },
-     "metadata": {},
-     "output_type": "display_data"
-    },
-    {
-     "data": {
-      "text/html": [
-       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #808000; text-decoration-color: #808000\">WARNING </span> All parsing attempts failed.                                                                              \n",
-       "</pre>\n"
-      ],
-      "text/plain": [
-       "\u001b[33mWARNING \u001b[0m All parsing attempts failed.                                                                              \n"
-      ]
-     },
-     "metadata": {},
-     "output_type": "display_data"
-    },
-    {
-     "data": {
-      "text/html": [
-       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #808000; text-decoration-color: #808000\">WARNING </span> Failed to convert response to response_model                                                              \n",
-       "</pre>\n"
-      ],
-      "text/plain": [
-       "\u001b[33mWARNING \u001b[0m Failed to convert response to response_model                                                              \n"
-      ]
-     },
-     "metadata": {},
-     "output_type": "display_data"
-    },
-    {
-     "data": {
-      "text/html": [
-       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"></pre>\n"
-      ],
-      "text/plain": []
-     },
-     "metadata": {},
-     "output_type": "display_data"
-    }
-   ],
+   "outputs": [],
    "source": [
     "class MovieScript(BaseModel):\n",
     "    setting: str = Field(\n",
-    "        ..., description=\"Provide a nice setting for a blockbuster movie.\"\n",
+    "        ...,\n",
+    "        description=\"A richly detailed, atmospheric description of the movie's primary location and time period. Include sensory details and mood.\",\n",
     "    )\n",
     "    ending: str = Field(\n",
     "        ...,\n",
-    "        description=\"Ending of the movie. If not available, provide a happy ending.\",\n",
+    "        description=\"The movie's powerful conclusion that ties together all plot threads. Should deliver emotional impact and satisfaction.\",\n",
     "    )\n",
     "    genre: str = Field(\n",
     "        ...,\n",
-    "        description=\"Genre of the movie. If not available, select action, thriller or romantic comedy.\",\n",
+    "        description=\"The film's primary and secondary genres (e.g., 'Sci-fi Thriller', 'Romantic Comedy'). Should align with setting and tone.\",\n",
     "    )\n",
-    "    name: str = Field(..., description=\"Give a name to this movie\")\n",
-    "    characters: List[str] = Field(..., description=\"Name of characters for this movie.\")\n",
-    "    storyline: str = Field(\n",
-    "        ..., description=\"3 sentence storyline for the movie. Make it exciting!\"\n",
+    "    name: str = Field(\n",
+    "        ...,\n",
+    "        description=\"An attention-grabbing, memorable title that captures the essence of the story and appeals to target audience.\",\n",
     "    )\n",
-    "    rating: Dict[str, int] = Field(\n",
+    "    characters: List[str] = Field(\n",
     "        ...,\n",
-    "        description=\"Your own rating of the movie. 1-10. Return a dictionary with the keys 'story' and 'acting'.\",\n",
+    "        description=\"4-6 main characters with distinctive names and brief role descriptions (e.g., 'Sarah Chen - brilliant quantum physicist with a dark secret').\",\n",
     "    )\n",
+    "    storyline: str = Field(\n",
+    "        ...,\n",
+    "        description=\"A compelling three-sentence plot summary: Setup, Conflict, and Stakes. Hook readers with intrigue and emotion.\",\n",
+    "    )\n",
+    "\n",
+    "\n",
+    "# Agent that uses JSON mode\n",
+    "json_mode_agent = Agent(\n",
+    "    model=OpenAILike(id=\"qwen3-30b-a3b\", \n",
+    "                    api_key=os.getenv(\"BAILIAN_API_KEY\"), \n",
+    "                    base_url=os.getenv(\"BAILIAN_API_BASE_URL\"),\n",
+    "                    request_params={\"extra_body\": {\"enable_thinking\": False}},),\n",
+    "    description=dedent(\"\"\"\\\n",
+    "        You are an acclaimed Hollywood screenwriter known for creating unforgettable blockbusters! 🎬\n",
+    "        With the combined storytelling prowess of Christopher Nolan, Aaron Sorkin, and Quentin Tarantino,\n",
+    "        you craft unique stories that captivate audiences worldwide.\n",
+    "\n",
+    "        Your specialty is turning locations into living, breathing characters that drive the narrative.\\\n",
+    "    \"\"\"),\n",
+    "    instructions=dedent(\"\"\"\\\n",
+    "        When crafting movie concepts, follow these principles:\n",
+    "\n",
+    "        1. Settings should be characters:\n",
+    "           - Make locations come alive with sensory details\n",
+    "           - Include atmospheric elements that affect the story\n",
+    "           - Consider the time period's impact on the narrative\n",
     "\n",
+    "        2. Character Development:\n",
+    "           - Give each character a unique voice and clear motivation\n",
+    "           - Create compelling relationships and conflicts\n",
+    "           - Ensure diverse representation and authentic backgrounds\n",
     "\n",
-    "# Agent that uses structured outputs with streaming\n",
+    "        3. Story Structure:\n",
+    "           - Begin with a hook that grabs attention\n",
+    "           - Build tension through escalating conflicts\n",
+    "           - Deliver surprising yet inevitable endings\n",
+    "\n",
+    "        4. Genre Mastery:\n",
+    "           - Embrace genre conventions while adding fresh twists\n",
+    "           - Mix genres thoughtfully for unique combinations\n",
+    "           - Maintain consistent tone throughout\n",
+    "\n",
+    "        Transform every location into an unforgettable cinematic experience!\\\n",
+    "    \"\"\"),\n",
+    "    response_model=MovieScript,\n",
+    "    use_json_mode=True,\n",
+    ")\n",
+    "\n",
+    "# Agent that uses structured outputs\n",
     "structured_output_agent = Agent(\n",
     "    model=OpenAILike(id=\"qwen3-30b-a3b\", \n",
-    "        api_key=os.getenv(\"BAILIAN_API_KEY\"), \n",
-    "        base_url=os.getenv(\"BAILIAN_API_BASE_URL\"),\n",
-    "        request_params={\"extra_body\": {\"enable_thinking\": False}},),\n",
-    "    description=\"You write movie json scripts.\",\n",
+    "                    api_key=os.getenv(\"BAILIAN_API_KEY\"), \n",
+    "                    base_url=os.getenv(\"BAILIAN_API_BASE_URL\"),\n",
+    "                    request_params={\"extra_body\": {\"enable_thinking\": False}},),\n",
+    "    description=dedent(\"\"\"\\\n",
+    "        You are an acclaimed Hollywood screenwriter known for creating unforgettable blockbusters! 🎬\n",
+    "        With the combined storytelling prowess of Christopher Nolan, Aaron Sorkin, and Quentin Tarantino,\n",
+    "        you craft unique stories that captivate audiences worldwide.\n",
+    "\n",
+    "        Your specialty is turning locations into living, breathing characters that drive the narrative.\\\n",
+    "    \"\"\"),\n",
+    "    instructions=dedent(\"\"\"\\\n",
+    "        When crafting movie concepts in json, follow these principles:\n",
+    "\n",
+    "        1. Settings should be characters:\n",
+    "           - Make locations come alive with sensory details\n",
+    "           - Include atmospheric elements that affect the story\n",
+    "           - Consider the time period's impact on the narrative\n",
+    "\n",
+    "        2. Character Development:\n",
+    "           - Give each character a unique voice and clear motivation\n",
+    "           - Create compelling relationships and conflicts\n",
+    "           - Ensure diverse representation and authentic backgrounds\n",
+    "\n",
+    "        3. Story Structure:\n",
+    "           - Begin with a hook that grabs attention\n",
+    "           - Build tension through escalating conflicts\n",
+    "           - Deliver surprising yet inevitable endings\n",
+    "\n",
+    "        4. Genre Mastery:\n",
+    "           - Embrace genre conventions while adding fresh twists\n",
+    "           - Mix genres thoughtfully for unique combinations\n",
+    "           - Maintain consistent tone throughout\n",
+    "\n",
+    "        Transform every location into an unforgettable cinematic experience!\\\n",
+    "    \"\"\"),\n",
     "    response_model=MovieScript,\n",
     ")\n",
     "\n",
+<<<<<<< HEAD
     "structured_output_agent.print_response(\n",
     "    \"New York\", stream=True, stream_intermediate_steps=True\n",
     ")"
 >>>>>>> bad0e67 (多轮对话+agno agent学习实践)
+=======
+    "# Example usage with different locations\n",
+    "json_mode_agent.print_response(\"Tokyo\", stream=True)\n",
+    "structured_output_agent.print_response(\"Ancient Rome\", stream=True)\n",
+    "\n",
+    "# More examples to try:\n",
+    "\"\"\"\n",
+    "Creative location prompts to explore:\n",
+    "1. \"Underwater Research Station\" - For a claustrophobic sci-fi thriller\n",
+    "2. \"Victorian London\" - For a gothic mystery\n",
+    "3. \"Dubai 2050\" - For a futuristic heist movie\n",
+    "4. \"Antarctic Research Base\" - For a survival horror story\n",
+    "5. \"Caribbean Island\" - For a tropical adventure romance\n",
+    "\"\"\"\n",
+    "\n",
+    "# To get the response in a variable:\n",
+    "# from rich.pretty import pprint\n",
+    "\n",
+    "# json_mode_response: RunResponse = json_mode_agent.run(\"New York\")\n",
+    "# pprint(json_mode_response.content)\n",
+    "# structured_output_response: RunResponse = structured_output_agent.run(\"New York\")\n",
+    "# pprint(structured_output_response.content)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "80d94c56",
+   "metadata": {},
+   "source": [
+    "**Multimodal Agent**"
+>>>>>>> d788ac0 (agno练习+转账agent)
    ]
   },
   {

+ 258 - 0
曹航/3/agno_transfer_agent.ipynb

@@ -0,0 +1,258 @@
+{
+ "cells": [
+  {
+   "cell_type": "code",
+   "execution_count": 4,
+   "id": "38787c0b",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "from textwrap import dedent\n",
+    "\n",
+    "from agno.agent import Agent\n",
+    "from agno.models.openai import OpenAILike\n",
+    "from agno.playground import Playground\n",
+    "from agno.storage.sqlite import SqliteStorage\n",
+    "from agno.tools.yfinance import YFinanceTools\n",
+    "from agno.tools import tool\n",
+    "\n",
+    "import os\n",
+    "from dotenv import load_dotenv\n",
+    "load_dotenv()\n",
+    "#数据存储位置\n",
+    "agent_storage: str = \"transfer/tmp/agents.db\"\n",
+    "\n",
+    "#测试\n",
+    "finance_agent = Agent(\n",
+    "    name=\"Finance Agent\",\n",
+    "    model=OpenAILike(id=\"qwen3-32b\",\n",
+    "                    api_key=os.getenv(\"BAILIAN_API_KEY\"), \n",
+    "                    base_url=os.getenv(\"BAILIAN_API_BASE_URL\"),\n",
+    "                    request_params={\"extra_body\": {\"enable_thinking\": False}},),\n",
+    "    tools=[YFinanceTools(stock_price=True, analyst_recommendations=True, company_info=True, company_news=True)],\n",
+    "    instructions=[\"Always use tables to display data\"],\n",
+    "    storage=SqliteStorage(table_name=\"finance_agent\", db_file=agent_storage),\n",
+    "    add_datetime_to_instructions=True,\n",
+    "    add_history_to_messages=True,\n",
+    "    num_history_responses=5,\n",
+    "    markdown=True,\n",
+    ")"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 5,
+   "id": "ee6a0633",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "# 从transfer/prompt目录读取prompt文件\n",
+    "# with open(\"transfer/prompt/prompt.txt\", \"r\", encoding=\"utf-8\") as f:\n",
+    "#     prompt_text = f.read()\n",
+    "\n",
+    "prompt_text=\"\"\"\n",
+    "    ## 背景与目标\n",
+    "    你是一个金融助手 Agent,使用 Qwen3-32B 模型驱动,负责协助用户完成向他人账户转账的流程。/\n",
+    "    当用户提问你其它与转账不相关的问题时,你应该时刻提醒并保持礼貌。/\n",
+    "    你将通过自然语言与用户对话,收集必要信息,确认并调用转账接口完成操作。\n",
+    "    请根据以下流程与规则进行对话与操作。\n",
+    "\n",
+    "    ## 任务流程\n",
+    "\n",
+    "    ### 第一步:信息收集\n",
+    "    请通过对话与用户交互,依次确认并记录以下三项转账信息:\n",
+    "\n",
+    "    1. 通过对方姓名查询账户是否存在(`get_contact`)\n",
+    "    2. 确认转账金额是否大于账户余额(`get_balance`)\n",
+    "    3. 余额不足时,请重新向用户收集信息,继续转账(`replay_to_user`)\n",
+    "\n",
+    "    > 请在用户表达不清或信息缺失时,请通过方法 `replay_to_user` 发起澄清。\n",
+    "\n",
+    "    ### 第二步:执行转账\n",
+    "    请使用适当方法发起转账(`transfer`)\n",
+    "\n",
+    "\"\"\"\n",
+    "# 创建用户列表\n",
+    "users = [\n",
+    "    {\"name\": \"张三\",\"phone\": \"13800138000\",\"amount\": 1000.0},\n",
+    "    {\"name\": \"李四\",\"phone\": \"13800138001\",\"amount\": 500.0},\n",
+    "]\n",
+    "\n",
+    "# 定义转账相关的工具函数\n",
+    "def get_contact(user_name: str) -> bool:\n",
+    "    \"\"\"\n",
+    "    检查账户是否存在\n",
+    "    Args:\n",
+    "        account_number: 账号\n",
+    "    Returns:\n",
+    "        bool: 账户是否存在\n",
+    "    \"\"\"\n",
+    "    # 这里模拟账户检查逻辑\n",
+    "    if user_name == \"张三\":\n",
+    "        return True\n",
+    "    else:\n",
+    "        return False\n",
+    "\n",
+    "def get_balance() -> float:\n",
+    "    \"\"\"\n",
+    "    查询账户余额\n",
+    "    Returns:\n",
+    "        float: 账户余额\n",
+    "    \"\"\"\n",
+    "    balance=users[1][\"amount\"]\n",
+    "    return balance\n",
+    "\n",
+    "#TODO 做用户确认\n",
+    "# @tool(requires_user_input=True,user_input_fields=[\"amount\"])\n",
+    "def transfer(user_name, phone: str, amount: float) -> bool:\n",
+    "    \"\"\"\n",
+    "    执行转账操作\n",
+    "    Args:\n",
+    "        to_account: 转入账号 \n",
+    "        amount: 转账金额\n",
+    "    Returns:\n",
+    "        bool: 转账是否成功\n",
+    "    \"\"\"\n",
+    "    # 这里模拟转账逻辑\n",
+    "    users[0][\"amount\"] += amount\n",
+    "    print(f\"向{user_name}转账{amount}元成功\")\n",
+    "    return True\n",
+    "\n",
+    "def replay_to_user(message: str) -> str:\n",
+    "    \"\"\"\n",
+    "    当当前步骤需要用户输入时,请通过此方法向用户提问\n",
+    "    向用户提问获取信息\n",
+    "    Args:\n",
+    "    Returns:\n",
+    "        str: 用户回答\n",
+    "    \"\"\"\n",
+    "    # 这里实现向用户提问的逻辑\n",
+    "    return input(message)\n",
+    "\n",
+    "\n",
+    "transfer_agent = Agent(\n",
+    "    name=\"Transfer Agent\",\n",
+    "    model=OpenAILike(id=\"qwen3-32b\",\n",
+    "                    api_key=os.getenv(\"BAILIAN_API_KEY\"), \n",
+    "                    base_url=os.getenv(\"BAILIAN_API_BASE_URL\"),\n",
+    "                    request_params={\"extra_body\": {\"enable_thinking\": False}},),\n",
+    "    tools=[get_contact,get_balance,transfer,replay_to_user],\n",
+    "    #TODO memory记忆\n",
+    "    # memory=SqliteStorage(table_name=\"transfer_agent\", db_file=agent_storage),\n",
+    "    instructions=dedent(prompt_text),\n",
+    "    # Store the agent sessions in a sqlite database\n",
+    "    storage=SqliteStorage(table_name=\"transfer_agent\", db_file=agent_storage),\n",
+    "    show_tool_calls=True,\n",
+    "    # Adds the current date and time to the instructions\n",
+    "    add_datetime_to_instructions=True,\n",
+    "    # Adds the history of the conversation to the messages\n",
+    "    add_history_to_messages=True,\n",
+    "    # Number of history responses to add to the messages\n",
+    "    num_history_responses=5,\n",
+    "    # Adds markdown formatting to the messages\n",
+    "    markdown=True,\n",
+    ")"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "id": "df67e40a",
+   "metadata": {},
+   "outputs": [],
+   "source": []
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "id": "c5c13c01",
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/html": [
+       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #000080; text-decoration-color: #000080\">INFO</span> Starting playground on <span style=\"color: #0000ff; text-decoration-color: #0000ff; text-decoration: underline\">http://localhost:7777</span>                                                                  \n",
+       "</pre>\n"
+      ],
+      "text/plain": [
+       "\u001b[34mINFO\u001b[0m Starting playground on \u001b[4;94mhttp://localhost:7777\u001b[0m                                                                  \n"
+      ]
+     },
+     "metadata": {},
+     "output_type": "display_data"
+    },
+    {
+     "data": {
+      "text/html": [
+       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #008080; text-decoration-color: #008080\">┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Agent Playground ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓</span>\n",
+       "<span style=\"color: #008080; text-decoration-color: #008080\">┃</span>                                                                                <span style=\"color: #008080; text-decoration-color: #008080\">┃</span>\n",
+       "<span style=\"color: #008080; text-decoration-color: #008080\">┃</span>                                                                                <span style=\"color: #008080; text-decoration-color: #008080\">┃</span>\n",
+       "<span style=\"color: #008080; text-decoration-color: #008080\">┃</span>  <span style=\"color: #008000; text-decoration-color: #008000; font-weight: bold\">Playground URL:</span> <a href=\"https://app.agno.com/playground?endpoint=localhost%3A7777/v1\" target=\"_blank\">https://app.agno.com/playground?endpoint=localhost%3A7777/v1</a>  <span style=\"color: #008080; text-decoration-color: #008080\">┃</span>\n",
+       "<span style=\"color: #008080; text-decoration-color: #008080\">┃</span>                                                                                <span style=\"color: #008080; text-decoration-color: #008080\">┃</span>\n",
+       "<span style=\"color: #008080; text-decoration-color: #008080\">┃</span>                                                                                <span style=\"color: #008080; text-decoration-color: #008080\">┃</span>\n",
+       "<span style=\"color: #008080; text-decoration-color: #008080\">┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛</span>\n",
+       "</pre>\n"
+      ],
+      "text/plain": [
+       "\u001b[36m┏━\u001b[0m\u001b[36m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[36m Agent Playground \u001b[0m\u001b[36m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[36m━┓\u001b[0m\n",
+       "\u001b[36m┃\u001b[0m                                                                                \u001b[36m┃\u001b[0m\n",
+       "\u001b[36m┃\u001b[0m                                                                                \u001b[36m┃\u001b[0m\n",
+       "\u001b[36m┃\u001b[0m  \u001b[1;32mPlayground URL:\u001b[0m \u001b]8;id=527383;https://app.agno.com/playground?endpoint=localhost%3A7777/v1\u001b\\https://app.agno.com/playground?endpoint=localhost%3A7777/v1\u001b]8;;\u001b\\  \u001b[36m┃\u001b[0m\n",
+       "\u001b[36m┃\u001b[0m                                                                                \u001b[36m┃\u001b[0m\n",
+       "\u001b[36m┃\u001b[0m                                                                                \u001b[36m┃\u001b[0m\n",
+       "\u001b[36m┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛\u001b[0m\n"
+      ]
+     },
+     "metadata": {},
+     "output_type": "display_data"
+    },
+    {
+     "name": "stderr",
+     "output_type": "stream",
+     "text": [
+      "INFO:     Will watch for changes in these directories: ['d:\\\\yusys\\\\ai_learning\\\\曹航\\\\3']\n",
+      "INFO:     Uvicorn running on http://localhost:7777 (Press CTRL+C to quit)\n",
+      "INFO:     Started reloader process [21576] using WatchFiles\n",
+      "INFO:     Stopping reloader process [21576]\n"
+     ]
+    }
+   ],
+   "source": [
+    "# 启动playground-server\n",
+    "playground = Playground(agents=[transfer_agent, finance_agent])\n",
+    "app = playground.get_app()\n",
+    "\n",
+    "playground.serve(\"agno_transfer_agent:app\", reload=True)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "id": "bc32bba1",
+   "metadata": {},
+   "outputs": [],
+   "source": []
+  }
+ ],
+ "metadata": {
+  "kernelspec": {
+   "display_name": ".venv",
+   "language": "python",
+   "name": "python3"
+  },
+  "language_info": {
+   "codemirror_mode": {
+    "name": "ipython",
+    "version": 3
+   },
+   "file_extension": ".py",
+   "mimetype": "text/x-python",
+   "name": "python",
+   "nbconvert_exporter": "python",
+   "pygments_lexer": "ipython3",
+   "version": "3.11.13"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 5
+}

+ 8 - 0
曹航/3/agno_transfer_agent.py

@@ -13,7 +13,11 @@ from agno.utils.log import log_info
 from dotenv import load_dotenv
 load_dotenv()
 #数据存储位置
+<<<<<<< HEAD
 agent_storage: str = "./曹航/3/transfer/tmp/agents.db"
+=======
+agent_storage: str = "transfer/tmp/agents.db"
+>>>>>>> d788ac0 (agno练习+转账agent)
 
 #测试
 finance_agent = Agent(
@@ -126,7 +130,11 @@ transfer_agent = Agent(
     # memory=SqliteStorage(table_name="transfer_agent", db_file=agent_storage),
     instructions=dedent(prompt_text),
     # Store the agent sessions in a sqlite database
+<<<<<<< HEAD
     storage=SqliteStorage(table_name="transfer_agent_session", db_file=agent_storage),
+=======
+    storage=SqliteStorage(table_name="transfer_agent", db_file=agent_storage),
+>>>>>>> d788ac0 (agno练习+转账agent)
     show_tool_calls=True,
     # Adds the current date and time to the instructions
     add_datetime_to_instructions=True,

二进制
曹航/3/tmp/agent.db