forked from Leaf/amber-ui
更新文档
This commit is contained in:
parent
d3747ae855
commit
2e7a23b117
235
api/swagger.yaml
235
api/swagger.yaml
@ -9,13 +9,11 @@ definitions:
|
|||||||
type: boolean
|
type: boolean
|
||||||
disable_memory:
|
disable_memory:
|
||||||
type: boolean
|
type: boolean
|
||||||
enable_memory_for_assistant_share:
|
enable_memory_for_assistant_api:
|
||||||
type: boolean
|
type: boolean
|
||||||
id:
|
id:
|
||||||
description: Id schema.EntityId `gorm:"primarykey" json:"id,string"`
|
description: Id schema.EntityId `gorm:"primarykey" json:"id,string"`
|
||||||
type: integer
|
type: integer
|
||||||
library:
|
|
||||||
$ref: '#/definitions/entity.Library'
|
|
||||||
library_id:
|
library_id:
|
||||||
type: integer
|
type: integer
|
||||||
name:
|
name:
|
||||||
@ -27,7 +25,7 @@ definitions:
|
|||||||
user_id:
|
user_id:
|
||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
entity.AssistantShare:
|
entity.AssistantKey:
|
||||||
properties:
|
properties:
|
||||||
assistant:
|
assistant:
|
||||||
$ref: '#/definitions/entity.Assistant'
|
$ref: '#/definitions/entity.Assistant'
|
||||||
@ -38,7 +36,7 @@ definitions:
|
|||||||
id:
|
id:
|
||||||
description: Id schema.EntityId `gorm:"primarykey" json:"id,string"`
|
description: Id schema.EntityId `gorm:"primarykey" json:"id,string"`
|
||||||
type: integer
|
type: integer
|
||||||
token:
|
secret:
|
||||||
type: string
|
type: string
|
||||||
updated_at:
|
updated_at:
|
||||||
type: string
|
type: string
|
||||||
@ -245,7 +243,7 @@ definitions:
|
|||||||
type: object
|
type: object
|
||||||
schema.AddPublicChatMessageRequest:
|
schema.AddPublicChatMessageRequest:
|
||||||
properties:
|
properties:
|
||||||
assistant_token:
|
assistant_key:
|
||||||
type: string
|
type: string
|
||||||
guest_id:
|
guest_id:
|
||||||
type: string
|
type: string
|
||||||
@ -260,7 +258,7 @@ definitions:
|
|||||||
- assistant
|
- assistant
|
||||||
type: string
|
type: string
|
||||||
required:
|
required:
|
||||||
- assistant_token
|
- assistant_key
|
||||||
- guest_id
|
- guest_id
|
||||||
- message
|
- message
|
||||||
- role
|
- role
|
||||||
@ -307,7 +305,7 @@ definitions:
|
|||||||
- true
|
- true
|
||||||
- false
|
- false
|
||||||
type: boolean
|
type: boolean
|
||||||
enable_memory_for_assistant_share:
|
enable_memory_for_assistant_api:
|
||||||
enum:
|
enum:
|
||||||
- true
|
- true
|
||||||
- false
|
- false
|
||||||
@ -369,7 +367,7 @@ definitions:
|
|||||||
type: object
|
type: object
|
||||||
schema.ChatPublicRequest:
|
schema.ChatPublicRequest:
|
||||||
properties:
|
properties:
|
||||||
assistant_token:
|
assistant_key:
|
||||||
type: string
|
type: string
|
||||||
guest_id:
|
guest_id:
|
||||||
type: string
|
type: string
|
||||||
@ -377,7 +375,7 @@ definitions:
|
|||||||
maxLength: 32
|
maxLength: 32
|
||||||
type: string
|
type: string
|
||||||
required:
|
required:
|
||||||
- assistant_token
|
- assistant_key
|
||||||
- guest_id
|
- guest_id
|
||||||
- name
|
- name
|
||||||
type: object
|
type: object
|
||||||
@ -436,12 +434,12 @@ definitions:
|
|||||||
type: object
|
type: object
|
||||||
schema.GetPublicChatMessageRequest:
|
schema.GetPublicChatMessageRequest:
|
||||||
properties:
|
properties:
|
||||||
assistant_token:
|
assistant_key:
|
||||||
type: string
|
type: string
|
||||||
guest_id:
|
guest_id:
|
||||||
type: string
|
type: string
|
||||||
required:
|
required:
|
||||||
- assistant_token
|
- assistant_key
|
||||||
- guest_id
|
- guest_id
|
||||||
type: object
|
type: object
|
||||||
schema.LibraryCreateRequest:
|
schema.LibraryCreateRequest:
|
||||||
@ -558,16 +556,16 @@ definitions:
|
|||||||
description:
|
description:
|
||||||
maxLength: 255
|
maxLength: 255
|
||||||
type: string
|
type: string
|
||||||
name:
|
discovery_url:
|
||||||
maxLength: 255
|
maxLength: 255
|
||||||
type: string
|
type: string
|
||||||
url:
|
name:
|
||||||
maxLength: 255
|
maxLength: 255
|
||||||
type: string
|
type: string
|
||||||
required:
|
required:
|
||||||
- description
|
- description
|
||||||
|
- discovery_url
|
||||||
- name
|
- name
|
||||||
- url
|
|
||||||
type: object
|
type: object
|
||||||
schema.ToolDiscoveryInput:
|
schema.ToolDiscoveryInput:
|
||||||
properties:
|
properties:
|
||||||
@ -828,6 +826,99 @@ paths:
|
|||||||
summary: 更新 Assistant
|
summary: 更新 Assistant
|
||||||
tags:
|
tags:
|
||||||
- assistant
|
- assistant
|
||||||
|
/api/v1/assistants/{id}/keys:
|
||||||
|
get:
|
||||||
|
consumes:
|
||||||
|
- application/json
|
||||||
|
description: 此 API 可以创建一个 Assistant API Key,可以将你的 Assistant 公开出去使用。
|
||||||
|
parameters:
|
||||||
|
- in: path
|
||||||
|
name: id
|
||||||
|
required: true
|
||||||
|
type: integer
|
||||||
|
produces:
|
||||||
|
- application/json
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
description: OK
|
||||||
|
schema:
|
||||||
|
allOf:
|
||||||
|
- $ref: '#/definitions/schema.ResponseBody'
|
||||||
|
- properties:
|
||||||
|
data:
|
||||||
|
items:
|
||||||
|
$ref: '#/definitions/entity.AssistantKey'
|
||||||
|
type: array
|
||||||
|
type: object
|
||||||
|
"500":
|
||||||
|
description: Internal Server Error
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/schema.ResponseBody'
|
||||||
|
security:
|
||||||
|
- ApiKeyAuth: []
|
||||||
|
summary: 获取 Assistant API Key列表
|
||||||
|
tags:
|
||||||
|
- assistant
|
||||||
|
post:
|
||||||
|
consumes:
|
||||||
|
- application/json
|
||||||
|
description: 此方法将会获取一个 Token,用户将会通过这个 Token 来访问你的 Assistant 并调用工具。
|
||||||
|
parameters:
|
||||||
|
- in: path
|
||||||
|
name: id
|
||||||
|
required: true
|
||||||
|
type: integer
|
||||||
|
produces:
|
||||||
|
- application/json
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
description: OK
|
||||||
|
schema:
|
||||||
|
allOf:
|
||||||
|
- $ref: '#/definitions/schema.ResponseBody'
|
||||||
|
- properties:
|
||||||
|
data:
|
||||||
|
$ref: '#/definitions/entity.AssistantKey'
|
||||||
|
type: object
|
||||||
|
"500":
|
||||||
|
description: Internal Server Error
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/schema.ResponseBody'
|
||||||
|
security:
|
||||||
|
- ApiKeyAuth: []
|
||||||
|
summary: 创建 Assistant API Key
|
||||||
|
tags:
|
||||||
|
- assistant
|
||||||
|
/api/v1/assistants/{id}/keys/{key_id}:
|
||||||
|
delete:
|
||||||
|
consumes:
|
||||||
|
- application/json
|
||||||
|
description: 此方法将会删除API Key,删除后,API Key将会立即失效。
|
||||||
|
parameters:
|
||||||
|
- in: path
|
||||||
|
name: id
|
||||||
|
required: true
|
||||||
|
type: integer
|
||||||
|
- in: path
|
||||||
|
name: key_id
|
||||||
|
required: true
|
||||||
|
type: integer
|
||||||
|
produces:
|
||||||
|
- application/json
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
description: OK
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/schema.ResponseBody'
|
||||||
|
"500":
|
||||||
|
description: Internal Server Error
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/schema.ResponseBody'
|
||||||
|
security:
|
||||||
|
- ApiKeyAuth: []
|
||||||
|
summary: 删除 Assistant API Key
|
||||||
|
tags:
|
||||||
|
- assistant
|
||||||
/api/v1/assistants/{id}/library:
|
/api/v1/assistants/{id}/library:
|
||||||
delete:
|
delete:
|
||||||
consumes:
|
consumes:
|
||||||
@ -879,99 +970,6 @@ paths:
|
|||||||
summary: 绑定资料库
|
summary: 绑定资料库
|
||||||
tags:
|
tags:
|
||||||
- assistant
|
- assistant
|
||||||
/api/v1/assistants/{id}/shares:
|
|
||||||
get:
|
|
||||||
consumes:
|
|
||||||
- application/json
|
|
||||||
description: 此 API 可以创建一个 Assistant 共享 Token,可以将你的 Assistant 公开出去使用。
|
|
||||||
parameters:
|
|
||||||
- in: path
|
|
||||||
name: id
|
|
||||||
required: true
|
|
||||||
type: integer
|
|
||||||
produces:
|
|
||||||
- application/json
|
|
||||||
responses:
|
|
||||||
"200":
|
|
||||||
description: OK
|
|
||||||
schema:
|
|
||||||
allOf:
|
|
||||||
- $ref: '#/definitions/schema.ResponseBody'
|
|
||||||
- properties:
|
|
||||||
data:
|
|
||||||
items:
|
|
||||||
$ref: '#/definitions/entity.AssistantShare'
|
|
||||||
type: array
|
|
||||||
type: object
|
|
||||||
"500":
|
|
||||||
description: Internal Server Error
|
|
||||||
schema:
|
|
||||||
$ref: '#/definitions/schema.ResponseBody'
|
|
||||||
security:
|
|
||||||
- ApiKeyAuth: []
|
|
||||||
summary: 获取 Assistant 共享列表
|
|
||||||
tags:
|
|
||||||
- assistant
|
|
||||||
post:
|
|
||||||
consumes:
|
|
||||||
- application/json
|
|
||||||
description: 此方法将会获取一个 Token,用户将会通过这个 Token 来访问你的 Assistant 并调用工具。
|
|
||||||
parameters:
|
|
||||||
- in: path
|
|
||||||
name: id
|
|
||||||
required: true
|
|
||||||
type: integer
|
|
||||||
produces:
|
|
||||||
- application/json
|
|
||||||
responses:
|
|
||||||
"200":
|
|
||||||
description: OK
|
|
||||||
schema:
|
|
||||||
allOf:
|
|
||||||
- $ref: '#/definitions/schema.ResponseBody'
|
|
||||||
- properties:
|
|
||||||
data:
|
|
||||||
$ref: '#/definitions/entity.AssistantShare'
|
|
||||||
type: object
|
|
||||||
"500":
|
|
||||||
description: Internal Server Error
|
|
||||||
schema:
|
|
||||||
$ref: '#/definitions/schema.ResponseBody'
|
|
||||||
security:
|
|
||||||
- ApiKeyAuth: []
|
|
||||||
summary: 创建 Assistant 共享
|
|
||||||
tags:
|
|
||||||
- assistant
|
|
||||||
/api/v1/assistants/{id}/shares/{share_id}:
|
|
||||||
delete:
|
|
||||||
consumes:
|
|
||||||
- application/json
|
|
||||||
description: 此方法将会删除共享,删除后,共享将会立即失效。
|
|
||||||
parameters:
|
|
||||||
- in: path
|
|
||||||
name: id
|
|
||||||
required: true
|
|
||||||
type: integer
|
|
||||||
- in: path
|
|
||||||
name: share_id
|
|
||||||
required: true
|
|
||||||
type: integer
|
|
||||||
produces:
|
|
||||||
- application/json
|
|
||||||
responses:
|
|
||||||
"200":
|
|
||||||
description: OK
|
|
||||||
schema:
|
|
||||||
$ref: '#/definitions/schema.ResponseBody'
|
|
||||||
"500":
|
|
||||||
description: Internal Server Error
|
|
||||||
schema:
|
|
||||||
$ref: '#/definitions/schema.ResponseBody'
|
|
||||||
security:
|
|
||||||
- ApiKeyAuth: []
|
|
||||||
summary: 删除 Assistant 共享
|
|
||||||
tags:
|
|
||||||
- assistant
|
|
||||||
/api/v1/assistants/{id}/tools:
|
/api/v1/assistants/{id}/tools:
|
||||||
get:
|
get:
|
||||||
consumes:
|
consumes:
|
||||||
@ -1183,7 +1181,7 @@ paths:
|
|||||||
required: true
|
required: true
|
||||||
type: integer
|
type: integer
|
||||||
- in: formData
|
- in: formData
|
||||||
name: assistant_token
|
name: assistant_key
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
- in: formData
|
- in: formData
|
||||||
@ -1244,7 +1242,7 @@ paths:
|
|||||||
required: true
|
required: true
|
||||||
type: integer
|
type: integer
|
||||||
- in: query
|
- in: query
|
||||||
name: assistant_token
|
name: assistant_key
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
- in: query
|
- in: query
|
||||||
@ -1326,7 +1324,7 @@ paths:
|
|||||||
get:
|
get:
|
||||||
consumes:
|
consumes:
|
||||||
- application/json
|
- application/json
|
||||||
description: get string by ID
|
description: 列出当前账户下的所有的对话
|
||||||
parameters:
|
parameters:
|
||||||
- description: Assistant ID
|
- description: Assistant ID
|
||||||
in: query
|
in: query
|
||||||
@ -1358,7 +1356,7 @@ paths:
|
|||||||
post:
|
post:
|
||||||
consumes:
|
consumes:
|
||||||
- application/json
|
- application/json
|
||||||
description: get string by ID
|
description: 创建一个对话,如果不指定 Assistant ID,将会使用默认 Assistant。默认 Assistant 不支持上传文件以及使用外部工具。
|
||||||
parameters:
|
parameters:
|
||||||
- description: Chat
|
- description: Chat
|
||||||
in: body
|
in: body
|
||||||
@ -1395,7 +1393,7 @@ paths:
|
|||||||
delete:
|
delete:
|
||||||
consumes:
|
consumes:
|
||||||
- application/json
|
- application/json
|
||||||
description: get string by ID
|
description: 删除一个对话以及聊天记录
|
||||||
parameters:
|
parameters:
|
||||||
- description: Chat ID
|
- description: Chat ID
|
||||||
in: path
|
in: path
|
||||||
@ -1604,7 +1602,7 @@ paths:
|
|||||||
get:
|
get:
|
||||||
consumes:
|
consumes:
|
||||||
- application/json
|
- application/json
|
||||||
description: get string by ID
|
description: 获取一个对话的所有聊天记录
|
||||||
parameters:
|
parameters:
|
||||||
- in: path
|
- in: path
|
||||||
name: id
|
name: id
|
||||||
@ -1644,7 +1642,7 @@ paths:
|
|||||||
post:
|
post:
|
||||||
consumes:
|
consumes:
|
||||||
- application/json
|
- application/json
|
||||||
description: get string by ID
|
description: 添加一条消息
|
||||||
parameters:
|
parameters:
|
||||||
- in: path
|
- in: path
|
||||||
name: id
|
name: id
|
||||||
@ -2027,7 +2025,8 @@ paths:
|
|||||||
get:
|
get:
|
||||||
consumes:
|
consumes:
|
||||||
- application/json
|
- application/json
|
||||||
description: get string by ID
|
deprecated: true
|
||||||
|
description: 测试接口,将会返回当前用户的信息
|
||||||
produces:
|
produces:
|
||||||
- application/json
|
- application/json
|
||||||
responses:
|
responses:
|
||||||
@ -2053,7 +2052,7 @@ paths:
|
|||||||
get:
|
get:
|
||||||
consumes:
|
consumes:
|
||||||
- application/json
|
- application/json
|
||||||
description: get string by ID
|
description: 将会通过 SSE 的方式来流式传输内容,不建议使用本文档生成的代码来获取,第三方库有更好的解决方案。
|
||||||
parameters:
|
parameters:
|
||||||
- description: 指定聊天中的用户 IP 地址,不指定则自动获取。此 IP 地址只会增加至 Prompt 中,如果不希望增加,请关闭系统自带
|
- description: 指定聊天中的用户 IP 地址,不指定则自动获取。此 IP 地址只会增加至 Prompt 中,如果不希望增加,请关闭系统自带
|
||||||
Prompt 选项
|
Prompt 选项
|
||||||
@ -2100,7 +2099,7 @@ paths:
|
|||||||
$ref: '#/definitions/schema.ResponseBody'
|
$ref: '#/definitions/schema.ResponseBody'
|
||||||
security:
|
security:
|
||||||
- none: []
|
- none: []
|
||||||
summary: 流式传输聊天内容
|
summary: 流式传输文本
|
||||||
tags:
|
tags:
|
||||||
- chat_message
|
- chat_message
|
||||||
/api/v1/tools:
|
/api/v1/tools:
|
||||||
|
616
src/api/api.ts
616
src/api/api.ts
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user