deploy: c02864facc
This commit is contained in:
@@ -11,7 +11,7 @@ curl --location --request POST 'https://api.fastgpt.in/api/v1/chat/compl
|
||||
🤖
|
||||
传入的model,temperature等参数字段均无效,这些字段由编排决定,不会根据 API 参数改变。
|
||||
不会返回实际消耗Token值,如果需要,可以设置detail=true,并手动计算 responseData 里的tokens值。
|
||||
请求 link detail=false,stream=false 响应 detail=false,stream=true 响应 detail=true,stream=false 响应 detail=true,stream=true 响应 event值 { &#34;id&#34;: &#34;adsfasf&#34;, &#34;model&#34;: &#34;&#34;, &#34;usage&#34;: { &#34;prompt_tokens&#34;: 1, &#34;completion_tokens&#34;: 1, &#34;total_tokens&#34;: 1 }, &#34;choices&#34;: [ { &#34;message&#34;: { &#34;role&#34;: &#34;assistant&#34;, &#34;content&#34;: &#34;电影《铃芽之旅》的导演是新海诚。&#34; }, &#34;finish_reason&#34;: &#34;stop&#34;, &#34;index&#34;: 0 } ] } data: {&#34;id&#34;:&#34;&#34;,&#34;object&#34;:&#34;&#34;,&#34;created&#34;:0,&#34;choices&#34;:[{&#34;delta&#34;:{&#34;content&#34;:&#34;&#34;},&#34;index&#34;:0,&#34;finish_reason&#34;:null}]} data: {&#34;id&#34;:&#34;&#34;,&#34;object&#34;:&#34;&#34;,&#34;created&#34;:0,&#34;choices&#34;:[{&#34;delta&#34;:{&#34;content&#34;:&#34;电&#34;},&#34;index&#34;:0,&#34;finish_reason&#34;:null}]} data: {&#34;id&#34;:&#34;&#34;,&#34;object&#34;:&#34;&#34;,&#34;created&#34;:0,&#34;choices&#34;:[{&#34;delta&#34;:{&#34;content&#34;:&#34;影&#34;},&#34;index&#34;:0,&#34;finish_reason&#34;:null}]} data: {&#34;id&#34;:&#34;&#34;,&#34;object&#34;:&#34;&#34;,&#34;created&#34;:0,&#34;choices&#34;:[{&#34;delta&#34;:{&#34;content&#34;:&#34;《&#34;},&#34;index&#34;:0,&#34;finish_reason&#34;:null}]} { &#34;responseData&#34;: [ // 不同模块的响应值, 不同版本具体值可能有差异,可先 log 自行查看最新值。 { &#34;moduleName&#34;: &#34;Dataset Search&#34;, &#34;price&#34;: 1.</description></item><item><title>知识库接口</title><link>https://doc.tryfastgpt.ai/docs/development/openapi/dataset/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://doc.tryfastgpt.ai/docs/development/openapi/dataset/</guid><description>如何获取知识库ID(datasetId) 如何获取文件集合ID(collection_id) 创建训练订单 link 请求示例 响应示例 新例子
|
||||
请求 link 基础请求示例 图片/文件请求示例 参数说明 curl --location --request POST &#39;http://localhost:3000/api/v1/chat/completions&#39; \ --header &#39;Authorization: Bearer fastgpt-xxxxxx&#39; \ --header &#39;Content-Type: application/json&#39; \ --data-raw &#39;{ &#34;chatId&#34;: &#34;my_chatId&#34;, &#34;stream&#34;: false, &#34;detail&#34;: false, &#34;responseChatItemId&#34;: &#34;my_responseChatItemId&#34;, &#34;variables&#34;: { &#34;uid&#34;: &#34;asdfadsfasfd2323&#34;, &#34;name&#34;: &#34;张三&#34; }, &#34;messages&#34;: [ { &#34;role&#34;: &#34;user&#34;, &#34;content&#34;: &#34;导演是谁&#34; } ] }&#39; 仅messages有部分区别,其他参数一致。 目前不支持上传文件,需上传到自己的对象存储中,获取对应的文件链接。 curl --location --request POST &#39;http://localhost:3000/api/v1/chat/completions&#39; \ --header &#39;Authorization: Bearer fastgpt-xxxxxx&#39; \ --header &#39;Content-Type: application/json&#39; \ --data-raw &#39;{ &#34;chatId&#34;: &#34;abcd&#34;, &#34;stream&#34;: false, &#34;messages&#34;: [ { &#34;role&#34;: &#34;user&#34;, &#34;content&#34;: [ { &#34;type&#34;: &#34;text&#34;, &#34;text&#34;: &#34;导演是谁&#34; }, { &#34;type&#34;: &#34;image_url&#34;, &#34;image_url&#34;: { &#34;url&#34;: &#34;图片链接&#34; } }, { &#34;type&#34;: &#34;file_url&#34;, &#34;name&#34;: &#34;文件名&#34;, &#34;url&#34;: &#34;文档链接,支持 txt md html word pdf ppt csv excel&#34; } ] } ] }&#39; info headers.</description></item><item><title>知识库接口</title><link>https://doc.tryfastgpt.ai/docs/development/openapi/dataset/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://doc.tryfastgpt.ai/docs/development/openapi/dataset/</guid><description>如何获取知识库ID(datasetId) 如何获取文件集合ID(collection_id) 创建训练订单 link 请求示例 响应示例 新例子
|
||||
curl --location --request POST &#39;http://localhost:3000/api/support/wallet/usage/createTrainingUsage&#39; \ --header &#39;Authorization: Bearer {{apikey}}&#39; \ --header &#39;Content-Type: application/json&#39; \ --data-raw &#39;{ &#34;datasetId&#34;: &#34;知识库 ID&#34;, &#34;name&#34;: &#34;可选,自定义订单名称,例如:文档训练-fastgpt.docx&#34; }&#39; data 为 billId,可用于添加知识库数据时进行账单聚合。
|
||||
{ &#34;code&#34;: 200, &#34;statusText&#34;: &#34;&#34;, &#34;message&#34;: &#34;&#34;, &#34;data&#34;: &#34;65112ab717c32018f4156361&#34; } 知识库 link创建一个知识库 link 请求示例 参数说明 响应示例 curl --location --request POST &#39;http://localhost:3000/api/core/dataset/create&#39; \ --header &#39;Authorization: Bearer {{authorization}}&#39; \ --header &#39;Content-Type: application/json&#39; \ --data-raw &#39;{ &#34;parentId&#34;: null, &#34;type&#34;: &#34;dataset&#34;, &#34;name&#34;:&#34;测试&#34;, &#34;intro&#34;:&#34;介绍&#34;, &#34;avatar&#34;: &#34;&#34;, &#34;vectorModel&#34;: &#34;text-embedding-ada-002&#34;, &#34;agentModel&#34;: &#34;gpt-3.</description></item><item><title>分享链接身份鉴权</title><link>https://doc.tryfastgpt.ai/docs/development/openapi/share/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://doc.tryfastgpt.ai/docs/development/openapi/share/</guid><description>介绍 link在 FastGPT V4.6.4 中,我们修改了分享链接的数据读取方式,为每个用户生成一个 localId,用于标识用户,从云端拉取对话记录。但是这种方式仅能保障用户在同一设备同一浏览器中使用,如果切换设备或者清空浏览器缓存则会丢失这些记录。这种方式存在一定的风险,因此我们仅允许用户拉取近30天的20条记录。
|
||||
分享链接身份鉴权设计的目的在于,将 FastGPT 的对话框快速、安全的接入到你现有的系统中,仅需 2 个接口即可实现。该功能目前只在商业版中提供。
|
||||
|
||||
Reference in New Issue
Block a user