"use strict";(self.webpackChunkelementary_public_docs=self.webpackChunkelementary_public_docs||[]).push([[47256],{15680:(e,t,n)=>{n.d(t,{xA:()=>g,yg:()=>d});var a=n(96540);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function o(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var i=a.createContext({}),p=function(e){var t=a.useContext(i),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},g=function(e){var t=p(e.components);return a.createElement(i.Provider,{value:t},e.children)},u="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},y=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,l=e.originalType,i=e.parentName,g=s(e,["components","mdxType","originalType","parentName"]),u=p(n),y=r,d=u["".concat(i,".").concat(y)]||u[y]||m[y]||l;return n?a.createElement(d,o(o({ref:t},g),{},{components:n})):a.createElement(d,o({ref:t},g))}));function d(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var l=n.length,o=new Array(l);o[0]=y;var s={};for(var i in t)hasOwnProperty.call(t,i)&&(s[i]=t[i]);s.originalType=e,s[u]="string"==typeof e?e:r,o[1]=s;for(var p=2;p{n.r(t),n.d(t,{assets:()=>i,contentTitle:()=>o,default:()=>m,frontMatter:()=>l,metadata:()=>s,toc:()=>p});var a=n(58168),r=(n(96540),n(15680));const l={sidebar_position:1,title:"\u521b\u5efa\u4f1a\u8bdd"},o="\u521b\u5efa\u4f1a\u8bdd\uff08\u6709\u4f1a\u8bdd\u5386\u53f2\uff09",s={unversionedId:"model-as-a-service/nova/chat/ChatCompletions/ChatConversations/ChatSessions",id:"model-as-a-service/nova/chat/ChatCompletions/ChatConversations/ChatSessions",title:"\u521b\u5efa\u4f1a\u8bdd",description:"\u63a5\u53e3\u63cf\u8ff0\uff08Description\uff09",source:"@site/docs/model-as-a-service/nova/chat/ChatCompletions/ChatConversations/ChatSessions.md",sourceDirName:"model-as-a-service/nova/chat/ChatCompletions/ChatConversations",slug:"/model-as-a-service/nova/chat/ChatCompletions/ChatConversations/ChatSessions",permalink:"/help/docs/model-as-a-service/nova/chat/ChatCompletions/ChatConversations/ChatSessions",draft:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/model-as-a-service/nova/chat/ChatCompletions/ChatConversations/ChatSessions.md",tags:[],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1,title:"\u521b\u5efa\u4f1a\u8bdd"},sidebar:"tutorialSidebar",previous:{title:"\u5bf9\u8bdd\u751f\u6210\uff08\u65e0\u4f1a\u8bdd\u5386\u53f2\uff09",permalink:"/help/docs/model-as-a-service/nova/chat/ChatCompletions/ChatCompletion"},next:{title:"\u57fa\u4e8e\u4f1a\u8bdd\u751f\u6210\u5bf9\u8bdd",permalink:"/help/docs/model-as-a-service/nova/chat/ChatCompletions/ChatConversations/ChatConversation"}},i={},p=[{value:"\u63a5\u53e3\u63cf\u8ff0\uff08Description\uff09",id:"\u63a5\u53e3\u63cf\u8ff0description",level:3},{value:"\u8bf7\u6c42\u5730\u5740\uff08Request URL\uff09",id:"\u8bf7\u6c42\u5730\u5740request-url",level:3},{value:"\u8bf7\u6c42\u5934\uff08Request Header\uff09",id:"\u8bf7\u6c42\u5934request-header",level:3},{value:"\u8bf7\u6c42\u4f53\uff08Request Body\uff09",id:"\u8bf7\u6c42\u4f53request-body",level:3},{value:"\u8bf7\u6c42\u793a\u4f8b\uff08Request Example\uff09",id:"\u8bf7\u6c42\u793a\u4f8brequest-example",level:3},{value:"\u54cd\u5e94\uff08Response\uff09",id:"\u54cd\u5e94response",level:3},{value:"\u54cd\u5e94\u793a\u4f8b\uff08Response Example\uff09",id:"\u54cd\u5e94\u793a\u4f8bresponse-example",level:3},{value:"\u9519\u8bef\u4fe1\u606f",id:"\u9519\u8bef\u4fe1\u606f",level:3}],g={toc:p},u="wrapper";function m(e){let{components:t,...n}=e;return(0,r.yg)(u,(0,a.A)({},g,n,{components:t,mdxType:"MDXLayout"}),(0,r.yg)("h1",{id:"\u521b\u5efa\u4f1a\u8bdd\u6709\u4f1a\u8bdd\u5386\u53f2"},"\u521b\u5efa\u4f1a\u8bdd\uff08\u6709\u4f1a\u8bdd\u5386\u53f2\uff09"),(0,r.yg)("h3",{id:"\u63a5\u53e3\u63cf\u8ff0description"},(0,r.yg)("strong",{parentName:"h3"},"\u63a5\u53e3\u63cf\u8ff0\uff08Description\uff09")),(0,r.yg)("p",null,"\u521b\u5efa\u6709\u5386\u53f2\u7684\u4f1a\u8bdd"),(0,r.yg)("br",null),(0,r.yg)("h3",{id:"\u8bf7\u6c42\u5730\u5740request-url"},(0,r.yg)("strong",{parentName:"h3"},"\u8bf7\u6c42\u5730\u5740\uff08Request URL\uff09")),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre"},"[POST] https://api.sensenova.cn/v1/llm/chat/sessions\n")),(0,r.yg)("br",null),(0,r.yg)("h3",{id:"\u8bf7\u6c42\u5934request-header"},(0,r.yg)("strong",{parentName:"h3"},"\u8bf7\u6c42\u5934\uff08Request Header\uff09")),(0,r.yg)("p",null,"\u65e0\u7279\u6b8aHeader\uff0c\u8bf7\u53c2\u8003",(0,r.yg)("a",{parentName:"p",href:"/help/docs/model-as-a-service/nova/overview/Authorization"},"\u63a5\u53e3\u9274\u6743")),(0,r.yg)("br",null),(0,r.yg)("h3",{id:"\u8bf7\u6c42\u4f53request-body"},(0,r.yg)("strong",{parentName:"h3"},"\u8bf7\u6c42\u4f53\uff08Request Body\uff09")),(0,r.yg)("table",null,(0,r.yg)("thead",{parentName:"table"},(0,r.yg)("tr",{parentName:"thead"},(0,r.yg)("th",{parentName:"tr",align:null},"\u540d\u79f0"),(0,r.yg)("th",{parentName:"tr",align:null},"\u7c7b\u578b"),(0,r.yg)("th",{parentName:"tr",align:null},"\u5fc5\u987b"),(0,r.yg)("th",{parentName:"tr",align:null},"\u9ed8\u8ba4\u503c"),(0,r.yg)("th",{parentName:"tr",align:null},"\u53ef\u9009\u503c"),(0,r.yg)("th",{parentName:"tr",align:null},"\u63cf\u8ff0"))),(0,r.yg)("tbody",{parentName:"table"},(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:null},"system_prompt"),(0,r.yg)("td",{parentName:"tr",align:null},"object[]"),(0,r.yg)("td",{parentName:"tr",align:null},"\u5426"),(0,r.yg)("td",{parentName:"tr",align:null},"-"),(0,r.yg)("td",{parentName:"tr",align:null},"-"),(0,r.yg)("td",{parentName:"tr",align:null},"\u4f1a\u8bdd\u7684\u7cfb\u7edf\u63d0\u793a\u8bcd")))),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},"\u5176\u4e2d ",(0,r.yg)("inlineCode",{parentName:"li"},"system_prompt")," \u90e8\u5206\u53c2\u6570\u5982\u4e0b\uff1a")),(0,r.yg)("table",null,(0,r.yg)("thead",{parentName:"table"},(0,r.yg)("tr",{parentName:"thead"},(0,r.yg)("th",{parentName:"tr",align:null},"\u540d\u79f0"),(0,r.yg)("th",{parentName:"tr",align:null},"\u7c7b\u578b"),(0,r.yg)("th",{parentName:"tr",align:null},"\u5fc5\u987b"),(0,r.yg)("th",{parentName:"tr",align:null},"\u9ed8\u8ba4\u503c"),(0,r.yg)("th",{parentName:"tr",align:null},"\u53ef\u9009\u503c"),(0,r.yg)("th",{parentName:"tr",align:null},"\u63cf\u8ff0"))),(0,r.yg)("tbody",{parentName:"table"},(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:null},"role"),(0,r.yg)("td",{parentName:"tr",align:null},"string"),(0,r.yg)("td",{parentName:"tr",align:null},"\u662f"),(0,r.yg)("td",{parentName:"tr",align:null},"-"),(0,r.yg)("td",{parentName:"tr",align:null},"\u679a\u4e3e\u503c ",(0,r.yg)("br",null)," ",(0,r.yg)("inlineCode",{parentName:"td"},"user")," ",(0,r.yg)("br",null)," ",(0,r.yg)("inlineCode",{parentName:"td"},"assistant")," ",(0,r.yg)("br",null)," ",(0,r.yg)("inlineCode",{parentName:"td"},"system")),(0,r.yg)("td",{parentName:"tr",align:null},"\u6d88\u606f\u4f5c\u8005\u7684\u89d2\u8272\uff0c\u679a\u4e3e\u503c")),(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:null},"content"),(0,r.yg)("td",{parentName:"tr",align:null},"string"),(0,r.yg)("td",{parentName:"tr",align:null},"\u662f"),(0,r.yg)("td",{parentName:"tr",align:null},"-"),(0,r.yg)("td",{parentName:"tr",align:null},"-"),(0,r.yg)("td",{parentName:"tr",align:null},"\u6d88\u606f\u7684\u5185\u5bb9")))),(0,r.yg)("br",null),(0,r.yg)("h3",{id:"\u8bf7\u6c42\u793a\u4f8brequest-example"},(0,r.yg)("strong",{parentName:"h3"},"\u8bf7\u6c42\u793a\u4f8b\uff08Request Example\uff09")),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-bash"},'curl --request POST "https://api.sensenova.cn/v1/llm/chat/sessions" \\\n -H "Content-Type: application/json" \\\n -H "Authorization: Bearer $API_TOKEN" \\\n -d \'{\n "system_prompt": [\n {\n "content": "string",\n "role": "user"\n }\n ]\n }\'\n')),(0,r.yg)("br",null),(0,r.yg)("h3",{id:"\u54cd\u5e94response"},(0,r.yg)("strong",{parentName:"h3"},"\u54cd\u5e94\uff08Response\uff09")),(0,r.yg)("table",null,(0,r.yg)("thead",{parentName:"table"},(0,r.yg)("tr",{parentName:"thead"},(0,r.yg)("th",{parentName:"tr",align:null},"\u540d\u79f0"),(0,r.yg)("th",{parentName:"tr",align:null},"\u7c7b\u578b"),(0,r.yg)("th",{parentName:"tr",align:null},"\u63cf\u8ff0"))),(0,r.yg)("tbody",{parentName:"table"},(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:null},"session_id"),(0,r.yg)("td",{parentName:"tr",align:null},"string"),(0,r.yg)("td",{parentName:"tr",align:null},"\u4f1a\u8bddID")))),(0,r.yg)("br",null),(0,r.yg)("h3",{id:"\u54cd\u5e94\u793a\u4f8bresponse-example"},(0,r.yg)("strong",{parentName:"h3"},"\u54cd\u5e94\u793a\u4f8b\uff08Response Example\uff09")),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-json"},'{\n "session_id": "string" \n}\n')),(0,r.yg)("br",null),(0,r.yg)("h3",{id:"\u9519\u8bef\u4fe1\u606f"},(0,r.yg)("strong",{parentName:"h3"},"\u9519\u8bef\u4fe1\u606f")),(0,r.yg)("p",null,"\u53c2\u8003",(0,r.yg)("a",{parentName:"p",href:"/help/docs/model-as-a-service/nova/overview/ErrorCode"},"\u9519\u8bef\u7801")))}m.isMDXComponent=!0}}]);