PageSourceSearch

https://java2ai.com/assets/js/7f2b23d3.7a4e26f9.js

js java2ai.com collected 2026-10-03 21:35:42 UTC 27,321 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkspring_ai_alibaba_website=self.webpackChunkspring_ai_alibaba_website||[]).push([[5102],{11463:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>d,contentTitle:()=>l,default:()=>o,frontMatter:()=>a,metadata:()=>t,toc:()=>c});const t=JSON.parse('{"id":"assistantagent/quick-start","title":"Assistant Agent \u5feb\u901f\u5f00\u59cb","description":"Assistant Agent \u662f\u57fa\u4e8e Spring AI Alibaba \u6784\u5efa\u7684\u4f01\u4e1a\u7ea7\u667a\u80fd\u52a9\u624b\u6846\u67b6\uff0c\u91c7\u7528\u4ee3\u7801\u5373\u884c\u52a8\uff08Code-as-Action\uff09\u8303\u5f0f\uff0c\u901a\u8fc7\u751f\u6210\u548c\u6267\u884c\u4ee3\u7801\u6765\u7f16\u6392\u5de5\u5177\u3001\u5b8c\u6210\u4efb\u52a1","source":"@site/agents-docs/assistantagent/quick-start.md","sourceDirName":"assistantagent","slug":"/assistantagent/quick-start","permalink":"/agents/assistantagent/quick-start","draft":false,"unlisted":false,"editUrl":"https://github.com/spring-ai-alibaba/website/tree/main/agents-docs/assistantagent/quick-start.md","tags":[],"version":"current","lastUpdatedBy":"Ken Liu","lastUpdatedAt":1768271906000,"frontMatter":{"title":"Assistant Agent \u5feb\u901f\u5f00\u59cb","description":"Assistant Agent \u662f\u57fa\u4e8e Spring AI Alibaba \u6784\u5efa\u7684\u4f01\u4e1a\u7ea7\u667a\u80fd\u52a9\u624b\u6846\u67b6\uff0c\u91c7\u7528\u4ee3\u7801\u5373\u884c\u52a8\uff08Code-as-Action\uff09\u8303\u5f0f\uff0c\u901a\u8fc7\u751f\u6210\u548c\u6267\u884c\u4ee3\u7801\u6765\u7f16\u6392\u5de5\u5177\u3001\u5b8c\u6210\u4efb\u52a1","keywords":["Assistant Agent","CodeAct","\u667a\u80fd\u52a9\u624b","Spring AI Alibaba","GraalVM","\u4f01\u4e1a\u7ea7Agent","\u4ee3\u7801\u5373\u884c\u52a8"]},"sidebar":"agentsSidebar","previous":{"title":"JManus \u5feb\u901f\u5f00\u59cb","permalink":"/agents/jmanus/quick-start"},"next":{"title":"\u4e8c\u6b21\u5f00\u53d1\u6307\u5357","permalink":"/agents/assistantagent/secondary-development"}}');var i=s(74848),r=s(28453);const a={title:"Assistant Agent \u5feb\u901f\u5f00\u59cb",description:"Assistant Agent \u662f\u57fa\u4e8e Spring AI Alibaba \u6784\u5efa\u7684\u4f01\u4e1a\u7ea7\u667a\u80fd\u52a9\u624b\u6846\u67b6\uff0c\u91c7\u7528\u4ee3\u7801\u5373\u884c\u52a8\uff08Code-as-Action\uff09\u8303\u5f0f\uff0c\u901a\u8fc7\u751f\u6210\u548c\u6267\u884c\u4ee3\u7801\u6765\u7f16\u6392\u5de5\u5177\u3001\u5b8c\u6210\u4efb\u52a1",keywords:["Assistant Agent","CodeAct","\u667a\u80fd\u52a9\u624b","Spring AI Alibaba","GraalVM","\u4f01\u4e1a\u7ea7Agent","\u4ee3\u7801\u5373\u884c\u52a8"]},l="\u9879\u76ee\u7b80\u4ecb",d={},c=[{value:"\u6838\u5fc3\u80fd\u529b",id:"\u6838\u5fc3\u80fd\u529b",level:2},{value:"\u9002\u7528\u573a\u666f",id:"\u9002\u7528\u573a\u666f",level:2},{value:"Quick Start",id:"quick-start",level:2},{value:"\u524d\u7f6e\u8981\u6c42",id:"\u524d\u7f6e\u8981\u6c42",level:3},{value:"\u514b\u9686\u5e76\u6784\u5efa",id:"\u514b\u9686\u5e76\u6784\u5efa",level:3},{value:"\u914d\u7f6e API Key",id:"\u914d\u7f6e-api-key",level:3},{value:"\u542f\u52a8\u5e94\u7528",id:"\u542f\u52a8\u5e94\u7528",level:3},{value:"\u4f7f\u7528\u65b9\u5f0f",id:"\u4f7f\u7528\u65b9\u5f0f",level:2},{value:"\u65b9\u5f0f\u4e00\uff1aChat UI\uff08\u53ef\u89c6\u5316\u5bf9\u8bdd\uff09",id:"\u65b9\u5f0f\u4e00chat-ui\u53ef\u89c6\u5316\u5bf9\u8bdd",level:3},{value:"\u65b9\u5f0f\u4e8c\uff1aAPI \u96c6\u6210",id:"\u65b9\u5f0f\u4e8capi-\u96c6\u6210",level:3},{value:"1. \u672c\u5730\u5b89\u88c5\u4f9d\u8d56",id:"1-\u672c\u5730\u5b89\u88c5\u4f9d\u8d56",level:4},{value:"2. \u6dfb\u52a0\u4f9d\u8d56",id:"2-\u6dfb\u52a0\u4f9d\u8d56",level:4},{value:"3. \u6ce8\u5165\u5e76\u4f7f\u7528 Agent",id:"3-\u6ce8\u5165\u5e76\u4f7f\u7528-agent",level:4},{value:"\u63a5\u5165\u77e5\u8bc6\u5e93",id:"\u63a5\u5165\u77e5\u8bc6\u5e93",level:2},{value:"\u5feb\u901f\u4f53\u9a8c\uff08\u4f7f\u7528\u5185\u7f6e Mock \u5b9e\u73b0\uff09",id:"\u5feb\u901f\u4f53\u9a8c\u4f7f\u7528\u5185\u7f6e-mock-\u5b9e\u73b0",level:3},{value:"\u63a5\u5165\u771f\u5b9e\u77e5\u8bc6\u5e93\uff08\u63a8\u8350\uff09",id:"\u63a5\u5165\u771f\u5b9e\u77e5\u8bc6\u5e93\u63a8\u8350",level:3},{value:"\u5e38\u89c1\u77e5\u8bc6\u6e90\u63a5\u5165\u65b9\u5f0f",id:"\u5e38\u89c1\u77e5\u8bc6\u6e90\u63a5\u5165\u65b9\u5f0f",level:3},{value:"SPI \u6269\u5c55\u70b9",id:"spi-\u6269\u5c55\u70b9",level:2}
1,{value:"\u4e8c\u6b21\u5f00\u53d1",id:"\u4e8c\u6b21\u5f00\u53d1",level:2},{value:"\u5f00\u53d1\u601d\u8def",id:"\u5f00\u53d1\u601d\u8def",level:3},{value:"\u8be6\u7ec6\u914d\u7f6e",id:"\u8be6\u7ec6\u914d\u7f6e",level:3},{value:"Roadmap",id:"roadmap",level:2},{value:"\u53c2\u8003\u6587\u6863",id:"\u53c2\u8003\u6587\u6863",level:2},{value:"Contributing",id:"contributing",level:2},{value:"License",id:"license",level:2}];function h(e){const n={a:"a",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",h4:"h4",header:"header",hr:"hr",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,r.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.header,{children:(0,i.jsx)(n.h1,{id:"\u9879\u76ee\u7b80\u4ecb",children:"\u9879\u76ee\u7b80\u4ecb"})}),"\n",(0,i.jsxs)(n.p,{children:["Assistant Agent \u662f\u4e00\u4e2a\u57fa\u4e8e ",(0,i.jsx)(n.a,{href:"https://github.com/alibaba/spring-ai-alibaba",children:"Spring AI Alibaba"})," \u6784\u5efa\u7684\u4f01\u4e1a\u7ea7\u667a\u80fd\u52a9\u624b\u6846\u67b6\uff0c\u91c7\u7528\u4ee3\u7801\u5373\u884c\u52a8\uff08Code-as-Action\uff09\u8303\u5f0f\uff0cAgent \u901a\u8fc7\u751f\u6210\u5e76\u6267\u884c\u4ee3\u7801\u5b8c\u6210\u4efb\u52a1\uff0c\u7075\u6d3b\u7ec4\u5408\u591a\u4e2a\u5de5\u5177\u5b9e\u73b0\u590d\u6742\u6d41\u7a0b\u3002"]}),"\n",(0,i.jsxs)(n.blockquote,{children:["\n",(0,i.jsxs)(n.p,{children:["Github repository: ",(0,i.jsx)(n.a,{href:"https://github.com/spring-ai-alibaba/AssistantAgent",children:"https://github.com/spring-ai-alibaba/AssistantAgent"})]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"\u6838\u5fc3\u80fd\u529b",children:"\u6838\u5fc3\u80fd\u529b"}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"\u80fd\u529b"}),(0,i.jsx)(n.th,{children:"\u8bf4\u660e"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsxs)(n.td,{children:["\ud83d\ude80 ",(0,i.jsx)(n.strong,{children:"\u4ee3\u7801\u5373\u884c\u52a8"})]}),(0,i.jsx)(n.td,{children:"Agent \u901a\u8fc7\u751f\u6210\u5e76\u6267\u884c\u4ee3\u7801\u5b8c\u6210\u4efb\u52a1\uff0c\u7075\u6d3b\u7ec4\u5408\u591a\u4e2a\u5de5\u5177\u5b9e\u73b0\u590d\u6742\u6d41\u7a0b"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsxs)(n.td,{children:["\ud83d\udd12 ",(0,i.jsx)(n.strong,{children:"\u5b89\u5168\u6c99\u7bb1"})]}),(0,i.jsx)(n.td,{children:"AI \u751f\u6210\u7684\u4ee3\u7801\u5728 GraalVM \u591a\u8bed\u8a00\u6c99\u7bb1\u4e2d\u5b89\u5168\u8fd0\u884c\uff0c\u5177\u5907\u8d44\u6e90\u9694\u79bb\u80fd\u529b"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsxs)(n.td,{children:["\ud83d\udcca ",(0,i.jsx)(n.strong,{children:"\u591a\u7ef4\u8bc4\u4f30"})]}),(0,i.jsx)(n.td,{children:"\u901a\u8fc7\u8bc4\u4f30\u56fe\u8fdb\u884c\u591a\u5c42\u6b21\u610f\u56fe\u8bc6\u522b\uff0c\u7cbe\u51c6\u6307\u5bfc Agent \u884c\u4e3a"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsxs)(n.td,{children:["\ud83d\udd04 ",(0,i.jsx)(n.strong,{children:"\u52a8\u6001 Prompt"})]}),(0,i.jsx)(n.td,{children:"\u6839\u636e\u573a\u666f\u53ca\u524d\u7f6e\u8bc4\u4f30\u7ed3\u679c\u52a8\u6001\u6ce8\u5165\u4e0a\u4e0b\u6587\u5230 Prompt \u4e2d"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsxs)(n.td,{children:["\ud83e\udde0 ",(0,i.jsx)(n.strong,{children:"\u7ecf\u9a8c\u5b66\u4e60"})]}),(0,i.jsx)(n.td,{children:"\u81ea\u52a8\u79ef\u7d2f\u6210\u529f\u7ecf\u9a8c\uff0c\u6301\u7eed\u63d0\u5347\u540e\u7eed\u4efb\u52a1\u7684\u8868\u73b0"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsxs)(n.td,{children:["\u26a1 ",(0,i.jsx)(n.strong,{children:"\u5feb\u901f\u54cd\u5e94"})]}),(0,i.jsx)(n.td,{children:"\u719f\u6089\u573a\u666f\u4e0b\u8df3\u8fc7 LLM \u63a8\u7406\uff0c\u57fa\u4e8e\u7ecf\u9a8c\u5feb\u901f\u54cd\u5e94"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsxs)(n.td,{children:["\ud83d\udd0d ",(0,i.jsx)(n.strong,{children:"\u667a\u80fd\u95ee\u7b54"})]}),(0,i.jsx)(n.td,{children:"\u652f\u6301\u591a\u6570\u636e\u6e90\u7edf\u4e00\u68c0\u7d22\u67b6\u6784\uff08\u901a\u8fc7 SPI \u53ef\u6269\u5c55\u77e5\u8bc6\u5e93\u3001Web \u7b49\u6570\u636e\u6e90\uff09"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsxs)(n.td,{children:["\ud83d\udee0\ufe0f ",(0,i.jsx)(n.strong,{children:"\u5de5\u5177\u8c03\u7528"})]}),(0,i.jsx)(n.td,{children:"\u652f\u6301 MCP\u3001HTTP API\uff08OpenAPI\uff09\u7b49\u534f\u8bae\uff0c\u7075\u6d3b\u63a5\u5165\u6d77\u91cf\u5de5\u5177"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsxs)(n.td,{children:["\u23f0 ",(0,i.jsx)(n.strong,{children:"\u4e3b\u52a8\u
1670d\u52a1"})]}),(0,i.jsx)(n.td,{children:"\u652f\u6301\u5b9a\u65f6\u4efb\u52a1\u3001\u5ef6\u8fdf\u6267\u884c\u3001\u4e8b\u4ef6\u56de\u8c03"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsxs)(n.td,{children:["\ud83d\udcec ",(0,i.jsx)(n.strong,{children:"\u591a\u6e20\u9053\u89e6\u8fbe"})]}),(0,i.jsx)(n.td,{children:"\u5185\u7f6e IDE \u56de\u590d\uff0c\u901a\u8fc7 SPI \u53ef\u6269\u5c55\u9489\u9489\u3001\u98de\u4e66\u3001\u4f01\u5fae\u3001Webhook \u7b49"})]})]})]}),"\n",(0,i.jsx)(n.h2,{id:"\u9002\u7528\u573a\u666f",children:"\u9002\u7528\u573a\u666f"}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"\u573a\u666f"}),(0,i.jsx)(n.th,{children:"\u8bf4\u660e"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.strong,{children:"\u667a\u80fd\u5ba2\u670d"})}),(0,i.jsx)(n.td,{children:"\u63a5\u5165\u4f01\u4e1a\u77e5\u8bc6\u5e93\uff0c\u667a\u80fd\u89e3\u7b54\u7528\u6237\u54a8\u8be2"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.strong,{children:"\u8fd0\u7ef4\u52a9\u624b"})}),(0,i.jsx)(n.td,{children:"\u5bf9\u63a5\u76d1\u63a7\u3001\u5de5\u5355\u7cfb\u7edf\uff0c\u81ea\u52a8\u5904\u7406\u544a\u8b66\u3001\u67e5\u8be2\u72b6\u6001\u3001\u6267\u884c\u64cd\u4f5c"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.strong,{children:"\u4e1a\u52a1\u52a9\u7406"})}),(0,i.jsx)(n.td,{children:"\u8fde\u63a5 CRM\u3001ERP \u7b49\u4e1a\u52a1\u7cfb\u7edf\uff0c\u8f85\u52a9\u5458\u5de5\u5b8c\u6210\u65e5\u5e38\u5de5\u4f5c"})]})]})]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.h2,{id:"quick-start",children:"Quick Start"}),"\n",(0,i.jsx)(n.h3,{id:"\u524d\u7f6e\u8981\u6c42",children:"\u524d\u7f6e\u8981\u6c42"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\u2615 ",(0,i.jsx)(n.strong,{children:"Java 17+"})]}),"\n",(0,i.jsxs)(n.li,{children:["\ud83d\udce6 ",(0,i.jsx)(n.strong,{children:"Maven 3.8+"})]}),"\n",(0,i.jsxs)(n.li,{children:["\ud83c\udf10 ",(0,i.jsx)(n.strong,{children:"DashScope API Key"})," - \u4ece ",(0,i.jsx)(n.a,{href:"https://dashscope.console.aliyun.com/",children:"\u963f\u91cc\u4e91\u767e\u70bc"})," \u83b7\u53d6"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"\u514b\u9686\u5e76\u6784\u5efa",children:"\u514b\u9686\u5e76\u6784\u5efa"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"git clone https://github.com/alibaba/assistant-agent.git\ncd assistant-agent\nmvn clean install -DskipTests\n"})}),"\n",(0,i.jsx)(n.h3,{id:"\u914d\u7f6e-api-key",children:"\u914d\u7f6e API Key"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"export DASHSCOPE_API_KEY=your-api-key-here\n"})}),"\n",(0,i.jsx)(n.h3,{id:"\u542f\u52a8\u5e94\u7528",children:"\u542f\u52a8\u5e94\u7528"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"cd assistant-agent-start\nmvn spring-boot:run\n"})}),"\n",(0,i.jsx)(n.p,{children:"\u542f\u52a8\u540e\u5373\u53ef\u4f53\u9a8c\u5185\u7f6e Mock \u5b9e\u73b0\u7684 CodeAct Agent\u3002"}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.h2,{id:"\u4f7f\u7528\u65b9\u5f0f",children:"\u4f7f\u7528\u65b9\u5f0f"}),"\n",(0,i.jsx)(n.h3,{id:"\u65b9\u5f0f\u4e00chat-ui\u53ef\u89c6\u5316\u5bf9\u8bdd",children:"\u65b9\u5f0f\u4e00\uff1aChat UI\uff08\u53ef\u89c6\u5316\u5bf9\u8bdd\uff09"}),"\n",(0,i.jsxs)(n.p,{children:["\u542f\u52a8\u540e\uff0c\u8bbf\u95ee ",(0,i.jsx)(n.code,{children:"http://localhost:8080/chatui/index.html"})," \u5373\u53ef\u4e0e Agent \u8fdb\u884c\u53ef\u89c6\u5316\u5bf9\u8bdd\u3002"]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{alt:"Agent Chat UI",src:s(70826).A+"",width:"3360",height:"1860"})}),"\n",(0,i.jsxs)(n.blockquote,{children:["\n",(0,i.jsxs)(n.p,{children:["\u9879\u76ee\u9ed8\u8ba4\u96c6\u6210\u4e86 ",(0,i.jsx)(n.a,{href:"/docs/frameworks/studio/quick-start",children:"Spring AI Alibaba Studio"}),"\uff0c\u63d0\u4f9b\u5f00\u7bb1\u5373\u7528\u7684\u53ef\u89c6\u5316\u5bf9\u8bdd\u754c\u9762\u3002"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"\u65b9\u5f0f\u4e8capi-\u96c6\u6210",children:"\u65b9\u5f0f\u4e8c\uff1aAPI \u96c6\u62
110"}),"\n",(0,i.jsx)(n.p,{children:"\u5c06 Agent \u80fd\u529b\u96c6\u6210\u5230\u5df2\u6709\u9879\u76ee\u4e2d\uff0c\u901a\u8fc7 API \u65b9\u5f0f\u8c03\u7528\u3002"}),"\n",(0,i.jsxs)(n.blockquote,{children:["\n",(0,i.jsxs)(n.p,{children:["\u26a0\ufe0f ",(0,i.jsx)(n.strong,{children:"\u6ce8\u610f"}),"\uff1a\u76ee\u524dJar\u5305\u5c1a\u672a\u53d1\u5e03\u5230\u516c\u7f51 Maven \u4ed3\u5e93\uff0c\u9700\u8981\u5148\u514b\u9686\u9879\u76ee\u5e76\u672c\u5730\u5b89\u88c5\u540e\u624d\u80fd\u4f7f\u7528\u3002\u540e\u7eed\u89c4\u5212\u4e2d\u5c06\u63d0\u4f9b\u516c\u7f51Jar\u5305\uff0c\u5c4a\u65f6\u53ef\u76f4\u63a5\u6dfb\u52a0\u4f9d\u8d56\u4f7f\u7528\u3002"]}),"\n"]}),"\n",(0,i.jsx)(n.h4,{id:"1-\u672c\u5730\u5b89\u88c5\u4f9d\u8d56",children:"1. \u672c\u5730\u5b89\u88c5\u4f9d\u8d56"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"git clone https://github.com/alibaba/assistant-agent.git\ncd assistant-agent\nmvn clean install -DskipTests\n"})}),"\n",(0,i.jsx)(n.h4,{id:"2-\u6dfb\u52a0\u4f9d\u8d56",children:"2. \u6dfb\u52a0\u4f9d\u8d56"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-xml",children:"<dependency>\n    <groupId>com.alibaba.assistant</groupId>\n    <artifactId>assistant-agent-autoconfigure</artifactId>\n    <version>${assistant-agent.version}</version>\n</dependency>\n"})}),"\n",(0,i.jsx)(n.h4,{id:"3-\u6ce8\u5165\u5e76\u4f7f\u7528-agent",children:"3. \u6ce8\u5165\u5e76\u4f7f\u7528 Agent"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-java",children:'@RestController\npublic class ChatController {\n\n    @Autowired\n    private CodeactAgent codeactAgent;\n\n\n    @GetMapping("/test-chat")\n    public String chat(@RequestParam("message") String message) throws GraphRunnerException {\n\n        // 1. \u8c03\u7528 invokeAndGetOutput \u83b7\u53d6\u7ed3\u679c\n        Optional<NodeOutput> nodeOutputOptional = codeactAgent.invokeAndGetOutput(message);\n\n        // 2. \u4ece NodeOutput \u4e2d\u63d0\u53d6\u6700\u7ec8\u7ed3\u679c\n        if (nodeOutputOptional.isPresent()) {\n            NodeOutput nodeOutput = nodeOutputOptional.get();\n\n            // \u83b7\u53d6\u5b8c\u6574\u72b6\u6001\uff0c\u5305\u542b messages\n            OverAllState state = nodeOutput.state();\n\n            // \u4ece state \u4e2d\u83b7\u53d6 messages\uff08\u6838\u5fc3\u7ed3\u679c\uff09\n            Optional<List<Message>> messagesOpt = state.value("messages");\n            if (messagesOpt.isPresent()) {\n                List<Message> messages = messagesOpt.get();\n                // \u6700\u540e\u4e00\u6761\u6d88\u606f\u901a\u5e38\u662f AssistantMessage\uff0c\u5305\u542b\u6700\u7ec8\u7b54\u6848\n                Message lastMessage = messages.get(messages.size() - 1);\n                if (lastMessage instanceof AssistantMessage assistantMessage) {\n                    String finalAnswer = assistantMessage.getText();\n                    System.out.println("\u6700\u7ec8\u7b54\u6848: " + finalAnswer);\n                    return finalAnswer;\n                }\n            }\n        }\n        return "No Response";\n    }\n}\n'})}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.h2,{id:"\u63a5\u5165\u77e5\u8bc6\u5e93",children:"\u63a5\u5165\u77e5\u8bc6\u5e93"}),"\n",(0,i.jsxs)(n.p,{children:["\u77e5\u8bc6\u5e93\u662f Agent \u56de\u7b54\u4e1a\u52a1\u95ee\u9898\u7684\u6838\u5fc3\u6570\u636e\u6765\u6e90\u3002\u6846\u67b6\u9ed8\u8ba4\u63d0\u4f9b Mock \u77e5\u8bc6\u5e93\u5b9e\u73b0\u7528\u4e8e\u6f14\u793a\u6d4b\u8bd5\uff0c",(0,i.jsx)(n.strong,{children:"\u751f\u4ea7\u73af\u5883\u9700\u8981\u63a5\u5165\u771f\u5b9e\u77e5\u8bc6\u6e90"}),"\u3002"]}),"\n",(0,i.jsx)(n.h3,{id:"\u5feb\u901f\u4f53\u9a8c\u4f7f\u7528\u5185\u7f6e-mock-\u5b9e\u73b0",children:"\u5feb\u901f\u4f53\u9a8c\uff08\u4f7f\u7528\u5185\u7f6e Mock \u5b9e\u73b0\uff09"}),"\n",(0,i.jsx)(n.p,{children:"\u9ed8\u8ba4\u914d\u7f6e\u5df2\u542f\u7528\u77e5\u8bc6\u5e93\u641c\u7d22\uff0c\u53ef\u76f4\u63a5\u4f53\u9a8c\uff1a"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-yaml",children:"spring:\n  ai:\n    alibaba:\n      codeact:\n        extension:\n          search:\n            enabled: true\n            knowledge-search-enabled: true  # \u9ed8\u8ba4\u5f00\u542f\n"})}),"\n",(0,i.jsx)(n.h3,{id:"\u63a5\u5165\u771f\u5b9e\u77e5\u8bc6\u5e93\u63a8\u8350",children:"\u63a5\u5165\u771f\u5b9e\u77e5\u8bc6\u5e93\uff08\u63a8\u8350\uff09"}),"\n",(0,i.jsxs)(n.p,{children:["\u5b9e\u73b0 ",(0,i.jsx)(n.code,{children:"SearchProvider"})," SPI \u63a5\u53e3\uff0c\u63a5\u5165\u4f60\u7684\u4e1a\u52a1\u7
17e5\u8bc6\u6e90\uff1a"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-java",children:'@Component\npublic class MyKnowledgeSearchProvider implements SearchProvider {\n\n    @Override\n    public boolean supports(SearchSourceType type) {\n        return SearchSourceType.KNOWLEDGE == type;\n    }\n\n    @Override\n    public List<SearchResultItem> search(SearchRequest request) {\n        List<SearchResultItem> results = new ArrayList<>();\n        \n        // \u4ece\u4f60\u7684\u77e5\u8bc6\u6e90\u67e5\u8be2\uff08\u5411\u91cf\u6570\u636e\u5e93\u3001ES\u3001API \u7b49\uff09\n        // List<Doc> docs = vectorStore.similaritySearch(request.getQuery());\n        \n        // \u8f6c\u6362\u4e3a SearchResultItem \u5e76\u8fd4\u56de\n        return results;\n    }\n\n    @Override\n    public String getName() {\n        return "MyKnowledgeSearchProvider";\n    }\n}\n'})}),"\n",(0,i.jsx)(n.h3,{id:"\u5e38\u89c1\u77e5\u8bc6\u6e90\u63a5\u5165\u65b9\u5f0f",children:"\u5e38\u89c1\u77e5\u8bc6\u6e90\u63a5\u5165\u65b9\u5f0f"}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"\u77e5\u8bc6\u6e90\u7c7b\u578b"}),(0,i.jsx)(n.th,{children:"\u63a5\u5165\u65b9\u5f0f"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsxs)(n.td,{children:[(0,i.jsx)(n.strong,{children:"\u5411\u91cf\u6570\u636e\u5e93"}),"\uff08\u963f\u91cc\u4e91 AnalyticDB\u3001Milvus\u3001Pinecone\uff09"]}),(0,i.jsxs)(n.td,{children:["\u5728 ",(0,i.jsx)(n.code,{children:"search()"})," \u65b9\u6cd5\u4e2d\u8c03\u7528\u5411\u91cf\u76f8\u4f3c\u5ea6\u68c0\u7d22 API"]})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.strong,{children:"Elasticsearch"})}),(0,i.jsx)(n.td,{children:"\u4f7f\u7528 ES \u5ba2\u6237\u7aef\u6267\u884c\u5168\u6587\u68c0\u7d22\u6216\u5411\u91cf\u68c0\u7d22"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.strong,{children:"\u4f01\u4e1a\u77e5\u8bc6\u5e93 API"})}),(0,i.jsx)(n.td,{children:"\u8c03\u7528\u5185\u90e8\u77e5\u8bc6\u5e93 REST API"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.strong,{children:"\u672c\u5730\u6587\u6863"})}),(0,i.jsx)(n.td,{children:"\u8bfb\u53d6\u5e76\u7d22\u5f15\u672c\u5730 Markdown/PDF \u6587\u4ef6"})]})]})]}),"\n",(0,i.jsxs)(n.blockquote,{children:["\n",(0,i.jsxs)(n.p,{children:["\ud83d\udcd6 \u66f4\u591a\u7ec6\u8282\u8bf7\u53c2\u8003\uff1a",(0,i.jsx)(n.a,{href:"/agents/assistantagent/features/search/quickstart",children:"\u77e5\u8bc6\u68c0\u7d22\u6a21\u5757\u6587\u6863"})]}),"\n"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.h2,{id:"spi-\u6269\u5c55\u70b9",children:"SPI \u6269\u5c55\u70b9"}),"\n",(0,i.jsx)(n.p,{children:"Assistant Agent \u63d0\u4f9b\u4e30\u5bcc\u7684 SPI \u6269\u5c55\u70b9\uff0c\u652f\u6301\u5feb\u901f\u4e8c\u6b21\u5f00\u53d1\uff1a"}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"\u6269\u5c55\u70b9"}),(0,i.jsx)(n.th,{children:"\u8be6\u7ec6\u6587\u6863"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"SearchProvider"})}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.a,{href:"/agents/assistantagent/features/search/quickstart",children:"\u77e5\u8bc6\u68c0\u7d22\u6a21\u5757"})})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"ReplyChannelDefinition"})}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.a,{href:"/agents/assistantagent/features/reply/quickstart",children:"\u56de\u590d\u6e20\u9053\u6a21\u5757"})})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"CodeactTool"})}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.a,{href:"/agents/assistantagent/features/custom-codeact-tool/quickstart",children:"\u81ea\u5b9a\u4e49 CodeAct \u5de5\u5177"})})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"PromptBuilder"})}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.a,{href:"/agents/assistantagent/features/prompt-builder/quickstart",children:"Prompt Builder \u6a21\u5757"})})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsxs)(n.td,{children:[(0,i.jsx)(n.code,{children:"LearningExtractor"})," / ",(0,i.jsx)(n.code,{children:"LearningRepository"})]}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.a,{href:"/agents/assistantagent/features/learning/quickstart",children:"\u5b66\u4e60\u6a21\u5757"})})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"ExperienceProvider"})}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.a,{href:"/agents/assistantagent/features/experience/quickstart",children:"\u7ecf\u9a8c\u6a21\u5757"})})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"TriggerDefinition"})}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.a,{href:"/agents/assistantagent/features/trigger/quickstart",children:"\u89e6\u53d1\u5668\u6a21\u5757"})})]})]})]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.h2,{id:"\u4e8c\u6b21\u5f00\u53d1",children:"\u4e8c\u6b21\u5f00\u53d1"}),"\n",(0,i.jsx)(n.p,{children:"Assistant Agent \u91c7\u7528\u6a21\u5757\u5316\u8bbe\u8ba1\uff0c\u652f\u6301\u7075\u6d3b\u7684\u4e8c\u6b21\u5f00\u53d1\u3002\u6838\u5fc3\u601d\u8def\u5982\u4e0b\uff1a"}),"\n",(0,i.jsx)(n.h3,{id:"\u5f00\u53d1\u601d\u8def",children:"\u5f00\u53d1\u601d\u8def"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"\u63a5\u5165\u77e5\u8bc6"}),"\uff1a\u5b9e\u73b0 ",(0,i.jsx)(n.code,{children:"SearchProvider"})," \u63a5\u5165\u4f01\u4e1a\u77e5\u8bc6\u5e93\uff0c\u8ba9 Agent \u80fd\u591f\u56de\u7b54\u4e1a\u52a1\u95ee\u9898"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"\u6269\u5c55\u5de5\u5177"}),"\uff1a\u5b9e\u73b0 ",(0,i.jsx)(n.code,{children:"CodeactTool"})," \u6216\u901a\u8fc7 MCP/HTTP \u63a5\u5165\u5916\u90e8\u5de5\u5177\uff0c\u8d4b\u4e88 Agent \u6267\u884c\u80fd\u529b"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"\u5b9a\u5236 Prompt"}),"\uff1a\u5b9e\u73b0 ",(0,i.jsx)(n.code,{children:"PromptBuilder"}
1)," \u6839\u636e\u573a\u666f\u52a8\u6001\u7ec4\u88c5 Prompt"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"\u591a\u6e20\u9053\u89e6\u8fbe"}),"\uff1a\u5b9e\u73b0 ",(0,i.jsx)(n.code,{children:"ReplyChannelDefinition"})," \u63a5\u5165\u9489\u9489\u3001\u98de\u4e66\u7b49\u6d88\u606f\u6e20\u9053"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"\u7ecf\u9a8c\u79ef\u7d2f"}),"\uff1a\u5b9e\u73b0 ",(0,i.jsx)(n.code,{children:"LearningExtractor"})," \u548c ",(0,i.jsx)(n.code,{children:"ExperienceProvider"})," \u81ea\u52a8\u5b66\u4e60\u548c\u590d\u7528\u7ecf\u9a8c"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"\u8be6\u7ec6\u914d\u7f6e",children:"\u8be6\u7ec6\u914d\u7f6e"}),"\n",(0,i.jsx)(n.p,{children:"\u5173\u4e8e\u5404\u6a21\u5757\u7684\u8be6\u7ec6\u914d\u7f6e\u65b9\u5f0f\u548c\u9ad8\u7ea7\u7528\u6cd5\uff0c\u8bf7\u53c2\u8003\uff1a"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"/agents/assistantagent/secondary-development",children:"\u4e8c\u6b21\u5f00\u53d1\u8be6\u7ec6\u6307\u5357"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"./features/evaluation/quickstart",children:"\u5404\u6a21\u5757 Feature \u6587\u6863"})}),"\n"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.h2,{id:"roadmap",children:"Roadmap"}),"\n",(0,i.jsx)(n.p,{children:"Assistant Agent \u9879\u76ee\u91c7\u7528\u6e10\u8fdb\u5f0f\u53d1\u5c55\u7b56\u7565\uff1a"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"\u7b2c\u4e00\u9636\u6bb5\uff08\u5f53\u524d\uff09"}),"\uff1a\u534a\u96c6\u6210\u6846\u67b6\uff0c\u63d0\u4f9b\u5b8c\u6574\u7684 SPI \u6269\u5c55\u673a\u5236\uff0c\u4f9b\u5f00\u53d1\u8005\u5feb\u901f\u4e8c\u6b21\u5f00\u53d1"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"\u7b2c\u4e8c\u9636\u6bb5"}),"\uff1a\u516c\u5171\u80fd\u529b\u4e0b\u6c89\u5230 Spring AI Alibaba\uff0c\u63d0\u4f9b\u66f4\u591a\u5f00\u7bb1\u5373\u7528\u7684\u573a\u666f\u5b9e\u73b0"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"\u7b2c\u4e09\u9636\u6bb5"}),"\uff1a\u53ef\u89c6\u5316\u914d\u7f6e\uff0c\u96f6\u4ee3\u7801\u63a5\u5165\uff0c\u5feb\u901f\u90e8\u7f72"]}),"\n"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.h2,{id:"\u53c2\u8003\u6587\u6863",children:"\u53c2\u8003\u6587\u6863"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"https://github.com/alibaba/spring-ai-alibaba",children:"Spring AI Alibaba \u6587\u6863"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"./features/evaluation/quickstart",children:"Feature \u8be6\u7ec6\u6587\u6863"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"/agents/assistantagent/secondary-development",children:"\u4e8c\u6b21\u5f00\u53d1\u8be6\u7ec6\u6307\u5357"})}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"contributing",children:"Contributing"}),"\n",(0,i.jsxs)(n.p,{children:["\u6b22\u8fce\u8d21\u732e\uff01\u8bf7\u53c2\u9605 ",(0,i.jsx)(n.a,{href:"https://github.com/alibaba/assistant-agent/blob/main/CONTRIBUTING.md",children:"CONTRIBUTING.md"})," \u4e86\u89e3\u6307\u5357\u3002"]}),"\n",(0,i.jsx)(n.h2,{id:"license",children:"License"}),"\n",(0,i.jsx)(n.p,{children:"\u672c\u9879\u76ee\u91c7\u7528 Apache License 2.0 \u8bb8\u53ef\u8bc1\u3002"})]})}function o(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(h,{...e})}):h(e)}},28453:(e,n,s)=>{s.d(n,{R:()=>a,x:()=>l});var t=s(96540);const i={},r=t.createContext(i);function a(e){const n=t.useContext(r);return t.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:a(e.components),t.createElement(r.Provider,{value:n},e.children)}},70826:(e,n,s)=>{s.d(n,{A:()=>t});const t=s.p+"assets/images/agent-chat-ui-8f41a0ad3766483bed5037e88744dfa4.gif"}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.