mirror of
https://gitee.com/270580156/weiyu.git
synced 2026-05-17 20:57:51 +00:00
1 line
12 KiB
JavaScript
1 line
12 KiB
JavaScript
"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[4186],{3342:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>a,contentTitle:()=>c,default:()=>h,frontMatter:()=>r,metadata:()=>s,toc:()=>o});const s=JSON.parse('{"id":"provider/dashscope","title":"\u901a\u4e49\u5343\u95ee DashScope \u5bf9\u63a5","description":"\u5fae\u8bed\u5bf9\u63a5\u963f\u91cc\u4e91\u901a\u4e49\u5343\u95ee DashScope \u5927\u6a21\u578b\u7684\u914d\u7f6e\u8bf4\u660e\u548c\u6b65\u9aa4\u6307\u5357","source":"@site/i18n/zh-CN/docusaurus-plugin-content-docs/current/provider/dashscope.md","sourceDirName":"provider","slug":"/provider/dashscope","permalink":"/docs/zh-CN/docs/provider/dashscope","draft":false,"unlisted":false,"editUrl":"https://github.com/bytedesk/bytedesk/docs/provider/dashscope.md","tags":[],"version":"current","sidebarPosition":4,"frontMatter":{"title":"\u901a\u4e49\u5343\u95ee DashScope \u5bf9\u63a5","sidebar_label":"DashScope","sidebar_position":4,"description":"\u5fae\u8bed\u5bf9\u63a5\u963f\u91cc\u4e91\u901a\u4e49\u5343\u95ee DashScope \u5927\u6a21\u578b\u7684\u914d\u7f6e\u8bf4\u660e\u548c\u6b65\u9aa4\u6307\u5357"},"sidebar":"tutorialSidebar","previous":{"title":"Zhipu","permalink":"/docs/zh-CN/docs/provider/zhipu"},"next":{"title":"SiliconFlow","permalink":"/docs/zh-CN/docs/provider/siliconflow"}}');var l=i(5723),d=i(6246);const r={title:"\u901a\u4e49\u5343\u95ee DashScope \u5bf9\u63a5",sidebar_label:"DashScope",sidebar_position:4,description:"\u5fae\u8bed\u5bf9\u63a5\u963f\u91cc\u4e91\u901a\u4e49\u5343\u95ee DashScope \u5927\u6a21\u578b\u7684\u914d\u7f6e\u8bf4\u660e\u548c\u6b65\u9aa4\u6307\u5357"},c=void 0,a={},o=[{value:"\u914d\u7f6e\u8bf4\u660e",id:"\u914d\u7f6e\u8bf4\u660e",level:2},{value:"Docker\u90e8\u7f72\u914d\u7f6e\u53c2\u6570",id:"docker\u90e8\u7f72\u914d\u7f6e\u53c2\u6570",level:3},{value:"\u6e90\u7801\u90e8\u7f72\u914d\u7f6e\u53c2\u6570",id:"\u6e90\u7801\u90e8\u7f72\u914d\u7f6e\u53c2\u6570",level:3},{value:"\u914d\u7f6e\u6b65\u9aa4",id:"\u914d\u7f6e\u6b65\u9aa4",level:2},{value:"1. \u83b7\u53d6 API Key",id:"1-\u83b7\u53d6-api-key",level:3},{value:"2. \u4fee\u6539\u914d\u7f6e\u6587\u4ef6",id:"2-\u4fee\u6539\u914d\u7f6e\u6587\u4ef6",level:3},{value:"3. \u7ba1\u7406\u540e\u53f0\u914d\u7f6e",id:"3-\u7ba1\u7406\u540e\u53f0\u914d\u7f6e",level:3},{value:"4. \u83b7\u53d6\u804a\u5929\u4ee3\u7801",id:"4-\u83b7\u53d6\u804a\u5929\u4ee3\u7801",level:3},{value:"\u6548\u679c\u5c55\u793a",id:"\u6548\u679c\u5c55\u793a",level:2},{value:"\u5e38\u89c1\u95ee\u9898",id:"\u5e38\u89c1\u95ee\u9898",level:2},{value:"\u76f8\u5173\u8d44\u6e90",id:"\u76f8\u5173\u8d44\u6e90",level:2}];function t(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,d.R)(),...e.components};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(n.admonition,{title:"\u524d\u7f6e\u6761\u4ef6",type:"tip",children:(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsx)(n.li,{children:"\u5df2\u90e8\u7f72\u5fae\u8bed\u7cfb\u7edf"}),"\n",(0,l.jsxs)(n.li,{children:["\u5df2\u7533\u8bf7\u963f\u91cc\u4e91\u767e\u70bc\u5927\u6a21\u578b API Key\uff08\u7533\u8bf7\u5730\u5740\uff1a",(0,l.jsx)(n.a,{href:"https://bailian.console.aliyun.com/?apiKey=1#/api-key",children:"https://bailian.console.aliyun.com/?apiKey=1#/api-key"}),"\uff09"]}),"\n"]})}),"\n",(0,l.jsx)(n.h2,{id:"\u914d\u7f6e\u8bf4\u660e",children:"\u914d\u7f6e\u8bf4\u660e"}),"\n",(0,l.jsx)(n.h3,{id:"docker\u90e8\u7f72\u914d\u7f6e\u53c2\u6570",children:"Docker\u90e8\u7f72\u914d\u7f6e\u53c2\u6570"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-bash",children:"# \u901a\u4e49\u5343\u95ee API \u914d\u7f6e\nSPRING_AI_DASHSCOPE_BASE_URL: https://dashscope.aliyuncs.com/compatible-mode\nSPRING_AI_DASHSCOPE_API_KEY: 'sk-xxx' # \u66ff\u6362\u4e3a\u4f60\u7684\u901a\u4e49\u5343\u95ee API Key\nSPRING_AI_DASHSCOPE_CHAT_ENABLED: true # \u542f\u7528\u901a\u4e49\u5343\u95ee\u5bf9\u8bdd\u529f\u80fd\n\n# \u6a21\u578b\u914d\u7f6e\nSPRING_AI_DASHSCOPE_CHAT_OPTIONS_MODEL: deepseek-r1 # \u6a21\u578b\u540d\u79f0\nSPRING_AI_DASHSCOPE_CHAT_OPTIONS_TEMPERATURE: 0.7 # \u6e29\u5ea6\u53c2\u6570\uff0c\u63a7\u5236\u8f93\u51fa\u7684\u968f\u673a\u6027\uff0c\u8303\u56f4 0-1\n\n# \u529f\u80fd\u5f00\u5173\u914d\u7f6e\nSPRING_AI_DASHSCOPE_AUDIO_TRANSCRIPTION_ENABLED: false # \u8bed\u97f3\u8f6c\u6587\u5b57\u529f\u80fd\nSPRING_AI_DASHSCOPE_IMAGE_ENABLED: false # \u56fe\u50cf\u5904\u7406\u529f\u80fd\nSPRING_AI_DASHSCOPE_EMBEDDING_ENABLED: true # \u6587\u672c\u5d4c\u5165\u529f\u80fd\nSPRING_AI_DASHSCOPE_AUDIO_SYNTHESIS_ENABLED: false # \u8bed\u97f3\u5408\u6210\u529f\u80fd\nSPRING_AI_NACOS_PROMPT_TEMPLATE_ENABLED: false # Nacos \u63d0\u793a\u8bcd\u6a21\u677f\u529f\u80fd\n"})}),"\n",(0,l.jsx)(n.h3,{id:"\u6e90\u7801\u90e8\u7f72\u914d\u7f6e\u53c2\u6570",children:"\u6e90\u7801\u90e8\u7f72\u914d\u7f6e\u53c2\u6570"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-bash",children:"# \u901a\u4e49\u5343\u95ee API \u914d\u7f6e\nspring.ai.dashscope.base-url=https://dashscope.aliyuncs.com/compatible-mode\nspring.ai.dashscope.api-key=sk-xxx # \u66ff\u6362\u4e3a\u4f60\u7684\u901a\u4e49\u5343\u95ee API Key\nspring.ai.dashscope.chat.enabled=true # \u542f\u7528\u901a\u4e49\u5343\u95ee\u5bf9\u8bdd\u529f\u80fd\n\n# \u6a21\u578b\u914d\u7f6e\nspring.ai.dashscope.chat.options.model=deepseek-r1 # \u6a21\u578b\u540d\u79f0\nspring.ai.dashscope.chat.options.temperature=0.7 # \u6e29\u5ea6\u53c2\u6570\uff0c\u63a7\u5236\u8f93\u51fa\u7684\u968f\u673a\u6027\uff0c\u8303\u56f4 0-1\nspring.ai.dashscope.chat.options.topP=3 # \u91c7\u6837\u53c2\u6570\n\n# \u529f\u80fd\u5f00\u5173\u914d\u7f6e\nspring.ai.dashscope.audio.transcription.enabled=false # \u8bed\u97f3\u8f6c\u6587\u5b57\u529f\u80fd\nspring.ai.dashscope.image.enabled=false # \u56fe\u50cf\u5904\u7406\u529f\u80fd\nspring.ai.dashscope.embedding.enabled=true # \u6587\u672c\u5d4c\u5165\u529f\u80fd\nspring.ai.dashscope.audio.synthesis.enabled=false # \u8bed\u97f3\u5408\u6210\u529f\u80fd\nspring.ai.nacos.prompt.template.enabled=false # Nacos \u63d0\u793a\u8bcd\u6a21\u677f\u529f\u80fd\n"})}),"\n",(0,l.jsx)(n.h2,{id:"\u914d\u7f6e\u6b65\u9aa4",children:"\u914d\u7f6e\u6b65\u9aa4"}),"\n",(0,l.jsx)(n.h3,{id:"1-\u83b7\u53d6-api-key",children:"1. \u83b7\u53d6 API Key"}),"\n",(0,l.jsxs)(n.ol,{children:["\n",(0,l.jsxs)(n.li,{children:["\u8bbf\u95ee\u963f\u91cc\u4e91\u767e\u70bc\u5927\u6a21\u578b\u63a7\u5236\u53f0\uff1a",(0,l.jsx)(n.a,{href:"https://bailian.console.aliyun.com/?apiKey=1#/api-key",children:"https://bailian.console.aliyun.com/?apiKey=1#/api-key"})]}),"\n",(0,l.jsx)(n.li,{children:"\u6ce8\u518c\u5e76\u767b\u5f55\u963f\u91cc\u4e91\u8d26\u53f7"}),"\n",(0,l.jsx)(n.li,{children:"\u5728\u63a7\u5236\u53f0\u521b\u5efa API Key"}),"\n",(0,l.jsx)(n.li,{children:"\u4fdd\u5b58\u751f\u6210\u7684 API Key"}),"\n"]}),"\n",(0,l.jsx)(n.h3,{id:"2-\u4fee\u6539\u914d\u7f6e\u6587\u4ef6",children:"2. \u4fee\u6539\u914d\u7f6e\u6587\u4ef6"}),"\n",(0,l.jsx)(n.admonition,{title:"\u914d\u7f6e\u8bf4\u660e",type:"tip",children:(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:["\u5c06\u914d\u7f6e\u6587\u4ef6\u4e2d\u7684 ",(0,l.jsx)(n.code,{children:"sk-xxx"})," \u66ff\u6362\u4e3a\u4f60\u83b7\u53d6\u7684 API Key"]}),"\n",(0,l.jsx)(n.li,{children:"\u6839\u636e\u5b9e\u9645\u9700\u6c42\u8c03\u6574 temperature \u548c topP \u53c2\u6570"}),"\n",(0,l.jsx)(n.li,{children:"\u6839\u636e\u9700\u6c42\u5f00\u542f\u6216\u5173\u95ed\u76f8\u5173\u529f\u80fd\uff08\u8bed\u97f3\u8f6c\u6587\u5b57\u3001\u56fe\u50cf\u5904\u7406\u7b49\uff09"}),"\n"]})}),"\n",(0,l.jsx)(n.h3,{id:"3-\u7ba1\u7406\u540e\u53f0\u914d\u7f6e",children:"3. \u7ba1\u7406\u540e\u53f0\u914d\u7f6e"}),"\n",(0,l.jsxs)(n.ol,{children:["\n",(0,l.jsx)(n.li,{children:"\u767b\u5f55\u5fae\u8bed\u7ba1\u7406\u540e\u53f0"}),"\n",(0,l.jsx)(n.li,{children:"\u8fdb\u5165 AI \u6a21\u578b\u914d\u7f6e\u9875\u9762"}),"\n",(0,l.jsx)(n.li,{children:"\u9009\u62e9\u901a\u4e49\u5343\u95ee\u4f5c\u4e3a\u9ed8\u8ba4\u6a21\u578b"}),"\n",(0,l.jsx)(n.li,{children:"\u4fdd\u5b58\u914d\u7f6e"}),"\n"]}),"\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.img,{alt:"provider",src:i(7206).A+"",width:"2304",height:"1396"}),"\n",(0,l.jsx)(n.img,{alt:"provider-choose",src:i(9294).A+"",width:"3032",height:"1394"})]}),"\n",(0,l.jsx)(n.h3,{id:"4-\u83b7\u53d6\u804a\u5929\u4ee3\u7801",children:"4. \u83b7\u53d6\u804a\u5929\u4ee3\u7801"}),"\n",(0,l.jsxs)(n.ol,{children:["\n",(0,l.jsx)(n.li,{children:'\u5728\u7ba1\u7406\u540e\u53f0\u627e\u5230"\u83b7\u53d6\u804a\u5929\u4ee3\u7801"\u9009\u9879'}),"\n",(0,l.jsx)(n.li,{children:"\u590d\u5236\u751f\u6210\u7684\u4ee3\u7801"}),"\n",(0,l.jsx)(n.li,{children:"\u5c06\u4ee3\u7801\u96c6\u6210\u5230\u4f60\u7684\u7f51\u7ad9\u4e2d"}),"\n"]}),"\n",(0,l.jsx)(n.p,{children:(0,l.jsx)(n.img,{alt:"provider-code",src:i(3914).A+"",width:"2240",height:"1038"})}),"\n",(0,l.jsx)(n.h2,{id:"\u6548\u679c\u5c55\u793a",children:"\u6548\u679c\u5c55\u793a"}),"\n",(0,l.jsx)(n.p,{children:"\u914d\u7f6e\u5b8c\u6210\u540e\uff0c\u4f60\u53ef\u4ee5\u5728\u7f51\u7ad9\u4e2d\u770b\u5230\u5982\u4e0b\u6548\u679c\uff1a"}),"\n",(0,l.jsx)(n.p,{children:(0,l.jsx)(n.img,{alt:"provider-chat",src:i(4691).A+"",width:"834",height:"1210"})}),"\n",(0,l.jsx)(n.h2,{id:"\u5e38\u89c1\u95ee\u9898",children:"\u5e38\u89c1\u95ee\u9898"}),"\n",(0,l.jsxs)(n.ol,{children:["\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"API Key \u65e0\u6548"})}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsx)(n.li,{children:"\u68c0\u67e5 API Key \u662f\u5426\u6b63\u786e\u590d\u5236"}),"\n",(0,l.jsx)(n.li,{children:"\u786e\u8ba4 API Key \u662f\u5426\u5df2\u6fc0\u6d3b"}),"\n",(0,l.jsx)(n.li,{children:"\u9a8c\u8bc1 API Key \u7684\u6743\u9650\u8bbe\u7f6e"}),"\n"]}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"\u5bf9\u8bdd\u54cd\u5e94\u6162"})}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsx)(n.li,{children:"\u68c0\u67e5\u7f51\u7edc\u8fde\u63a5"}),"\n",(0,l.jsx)(n.li,{children:"\u786e\u8ba4\u670d\u52a1\u5668\u914d\u7f6e\u662f\u5426\u6ee1\u8db3\u8981\u6c42"}),"\n",(0,l.jsx)(n.li,{children:"\u53ef\u4ee5\u9002\u5f53\u8c03\u6574 temperature \u548c topP \u53c2\u6570"}),"\n"]}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"\u529f\u80fd\u5f02\u5e38"})}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsx)(n.li,{children:"\u68c0\u67e5\u76f8\u5e94\u529f\u80fd\u7684\u5f00\u5173\u662f\u5426\u5df2\u542f\u7528"}),"\n",(0,l.jsx)(n.li,{children:"\u786e\u8ba4 API Key \u662f\u5426\u652f\u6301\u8be5\u529f\u80fd"}),"\n",(0,l.jsx)(n.li,{children:"\u67e5\u770b\u670d\u52a1\u5668\u65e5\u5fd7\u6392\u67e5\u5177\u4f53\u539f\u56e0"}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,l.jsx)(n.h2,{id:"\u76f8\u5173\u8d44\u6e90",children:"\u76f8\u5173\u8d44\u6e90"}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.a,{href:"https://bailian.console.aliyun.com/?spm=a2c4g.11186623.0.0.11c67980m5X2VR#/model-market",children:"\u963f\u91cc\u4e91\u767e\u70bc\u5927\u6a21\u578b\u6587\u6863"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.a,{href:"https://docs.spring.io/spring-ai/reference/api/chat/dashscope-chat.html",children:"Spring AI \u6587\u6863"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.a,{href:"/docs/intro",children:"\u5fae\u8bed\u6587\u6863\u4e2d\u5fc3"})}),"\n"]})]})}function h(e={}){const{wrapper:n}={...(0,d.R)(),...e.components};return n?(0,l.jsx)(n,{...e,children:(0,l.jsx)(t,{...e})}):t(e)}},3914:(e,n,i)=>{i.d(n,{A:()=>s});const s=i.p+"assets/images/provider-code-dd2f519bb074cc9099f6db27022f4e64.png"},4691:(e,n,i)=>{i.d(n,{A:()=>s});const s=i.p+"assets/images/provider-chat-5765d80a7d692bd0d90708fad9115a15.png"},6246:(e,n,i)=>{i.d(n,{R:()=>r,x:()=>c});var s=i(2155);const l={},d=s.createContext(l);function r(e){const n=s.useContext(d);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(l):e.components||l:r(e.components),s.createElement(d.Provider,{value:n},e.children)}},7206:(e,n,i)=>{i.d(n,{A:()=>s});const s=i.p+"assets/images/provider-e66a8752306150814f886a41ec453fc8.png"},9294:(e,n,i)=>{i.d(n,{A:()=>s});const s=i.p+"assets/images/provider-choose-1683a1a889ce5941081af8dc52613fd2.png"}}]); |