750 lines
19 KiB
YAML
750 lines
19 KiB
YAML
definitions:
|
|
rag-new_internal_entity.Assistant:
|
|
properties:
|
|
created_at:
|
|
type: string
|
|
description:
|
|
type: string
|
|
id:
|
|
type: integer
|
|
name:
|
|
type: string
|
|
prompt:
|
|
type: string
|
|
updated_at:
|
|
type: string
|
|
user_id:
|
|
type: integer
|
|
type: object
|
|
rag-new_internal_entity.AssistantTool:
|
|
properties:
|
|
assistant_id:
|
|
type: integer
|
|
created_at:
|
|
type: string
|
|
id:
|
|
type: integer
|
|
tool_id:
|
|
type: integer
|
|
updated_at:
|
|
type: string
|
|
type: object
|
|
rag-new_internal_entity.Chat:
|
|
properties:
|
|
assistant_id:
|
|
type: integer
|
|
created_at:
|
|
type: string
|
|
id:
|
|
type: integer
|
|
name:
|
|
type: string
|
|
updated_at:
|
|
type: string
|
|
user_id:
|
|
type: integer
|
|
type: object
|
|
rag-new_internal_entity.ChatMessage:
|
|
properties:
|
|
assistant_id:
|
|
type: integer
|
|
content:
|
|
type: string
|
|
created_at:
|
|
type: string
|
|
id:
|
|
type: integer
|
|
input_tokens:
|
|
type: integer
|
|
output_tokens:
|
|
type: integer
|
|
role:
|
|
type: string
|
|
total_tokens:
|
|
type: integer
|
|
updated_at:
|
|
type: string
|
|
type: object
|
|
rag-new_internal_entity.Tool:
|
|
properties:
|
|
api_key:
|
|
type: string
|
|
created_at:
|
|
type: string
|
|
data:
|
|
$ref: '#/definitions/rag-new_internal_schema.ToolDiscoveryOutput'
|
|
description:
|
|
type: string
|
|
discovery_url:
|
|
type: string
|
|
id:
|
|
type: integer
|
|
name:
|
|
type: string
|
|
updated_at:
|
|
type: string
|
|
user_id:
|
|
type: integer
|
|
type: object
|
|
rag-new_internal_schema.AssistantCreateRequest:
|
|
properties:
|
|
description:
|
|
maxLength: 255
|
|
type: string
|
|
name:
|
|
maxLength: 255
|
|
type: string
|
|
prompt:
|
|
type: string
|
|
required:
|
|
- description
|
|
- name
|
|
type: object
|
|
rag-new_internal_schema.ChatCreateRequest:
|
|
properties:
|
|
assistant_id:
|
|
type: integer
|
|
name:
|
|
maxLength: 255
|
|
type: string
|
|
required:
|
|
- assistant_id
|
|
- name
|
|
type: object
|
|
rag-new_internal_schema.ChatMessageAddRequest:
|
|
properties:
|
|
message:
|
|
maxLength: 255
|
|
type: string
|
|
required:
|
|
- message
|
|
type: object
|
|
rag-new_internal_schema.ChatMessageResponse:
|
|
properties:
|
|
stream_id:
|
|
type: string
|
|
type: object
|
|
rag-new_internal_schema.CurrentUserResponse:
|
|
properties:
|
|
ip:
|
|
type: string
|
|
userEmail:
|
|
type: string
|
|
userId:
|
|
type: integer
|
|
valid:
|
|
type: boolean
|
|
type: object
|
|
rag-new_internal_schema.ResponseBody:
|
|
properties:
|
|
data: {}
|
|
error:
|
|
type: string
|
|
message:
|
|
type: string
|
|
success:
|
|
type: boolean
|
|
type: object
|
|
rag-new_internal_schema.ToolCreateRequest:
|
|
properties:
|
|
api_key:
|
|
maxLength: 255
|
|
type: string
|
|
description:
|
|
maxLength: 255
|
|
type: string
|
|
name:
|
|
maxLength: 255
|
|
type: string
|
|
url:
|
|
maxLength: 255
|
|
type: string
|
|
required:
|
|
- description
|
|
- name
|
|
- url
|
|
type: object
|
|
rag-new_internal_schema.ToolDiscoveryOutput:
|
|
properties:
|
|
callback_url:
|
|
type: string
|
|
description:
|
|
type: string
|
|
function:
|
|
items:
|
|
$ref: '#/definitions/rag-new_internal_schema.ToolDiscoveryOutputFunctions'
|
|
type: array
|
|
homepage_url:
|
|
type: string
|
|
name:
|
|
type: string
|
|
type: object
|
|
rag-new_internal_schema.ToolDiscoveryOutputFunction:
|
|
properties:
|
|
description:
|
|
type: string
|
|
name:
|
|
type: string
|
|
parameters: {}
|
|
required:
|
|
items:
|
|
type: string
|
|
type: array
|
|
type: object
|
|
rag-new_internal_schema.ToolDiscoveryOutputFunctions:
|
|
properties:
|
|
function:
|
|
items:
|
|
$ref: '#/definitions/rag-new_internal_schema.ToolDiscoveryOutputFunction'
|
|
type: array
|
|
type:
|
|
type: string
|
|
type: object
|
|
info:
|
|
contact: {}
|
|
title: Leaflow Amber
|
|
version: "1.0"
|
|
paths:
|
|
/api/v1/assistants:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: get string by ID
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
allOf:
|
|
- $ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
|
- properties:
|
|
data:
|
|
items:
|
|
$ref: '#/definitions/rag-new_internal_entity.Assistant'
|
|
type: array
|
|
type: object
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
|
summary: 获取 Assistant 列表
|
|
tags:
|
|
- assistant
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: get string by ID
|
|
parameters:
|
|
- description: Assistant
|
|
in: body
|
|
name: assistant
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/rag-new_internal_schema.AssistantCreateRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
allOf:
|
|
- $ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
|
- properties:
|
|
data:
|
|
$ref: '#/definitions/rag-new_internal_entity.Assistant'
|
|
type: object
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
|
summary: 创建 Assistant
|
|
tags:
|
|
- assistant
|
|
/api/v1/assistants/{id}/tools:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: get string by ID
|
|
parameters:
|
|
- description: Assistant ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
allOf:
|
|
- $ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
|
- properties:
|
|
data:
|
|
items:
|
|
$ref: '#/definitions/rag-new_internal_entity.AssistantTool'
|
|
type: array
|
|
type: object
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
|
summary: 获取 Assistant 所绑定的 Tool
|
|
tags:
|
|
- assistant
|
|
/api/v1/assistants/{id}/tools/{tool_id}:
|
|
delete:
|
|
consumes:
|
|
- application/json
|
|
description: get string by ID
|
|
parameters:
|
|
- description: Assistant ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
- description: Tool ID
|
|
in: path
|
|
name: tool_id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
allOf:
|
|
- $ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
|
- properties:
|
|
data:
|
|
$ref: '#/definitions/rag-new_internal_entity.AssistantTool'
|
|
type: object
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
|
summary: 解绑 Tool
|
|
tags:
|
|
- assistant
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: get string by ID
|
|
parameters:
|
|
- description: Assistant ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
- description: Tool ID
|
|
in: path
|
|
name: tool_id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
allOf:
|
|
- $ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
|
- properties:
|
|
data:
|
|
$ref: '#/definitions/rag-new_internal_entity.AssistantTool'
|
|
type: object
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
|
summary: 绑定 Tool
|
|
tags:
|
|
- assistant
|
|
/api/v1/chats:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: get string by ID
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
allOf:
|
|
- $ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
|
- properties:
|
|
data:
|
|
items:
|
|
$ref: '#/definitions/rag-new_internal_entity.Chat'
|
|
type: array
|
|
type: object
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
|
summary: 获取所有 Chat
|
|
tags:
|
|
- chat
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: get string by ID
|
|
parameters:
|
|
- description: Chat
|
|
in: body
|
|
name: chat
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/rag-new_internal_schema.ChatCreateRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
allOf:
|
|
- $ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
|
- properties:
|
|
data:
|
|
$ref: '#/definitions/rag-new_internal_entity.Chat'
|
|
type: object
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
|
summary: Create Chat
|
|
tags:
|
|
- chat
|
|
/api/v1/chats/{id}:
|
|
delete:
|
|
consumes:
|
|
- application/json
|
|
description: get string by ID
|
|
parameters:
|
|
- description: Chat ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
|
"404":
|
|
description: Not Found
|
|
schema:
|
|
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
|
summary: Delete Chat
|
|
tags:
|
|
- chat
|
|
/api/v1/chats/{id}/messages:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: get string by ID
|
|
parameters:
|
|
- description: Chat ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
allOf:
|
|
- $ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
|
- properties:
|
|
data:
|
|
items:
|
|
$ref: '#/definitions/rag-new_internal_entity.ChatMessage'
|
|
type: array
|
|
type: object
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
|
"404":
|
|
description: Not Found
|
|
schema:
|
|
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
|
summary: 查看聊天记录
|
|
tags:
|
|
- chat_message
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: get string by ID
|
|
parameters:
|
|
- description: Chat ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
- description: Message
|
|
in: body
|
|
name: message
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/rag-new_internal_schema.ChatMessageAddRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
allOf:
|
|
- $ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
|
- properties:
|
|
data:
|
|
$ref: '#/definitions/rag-new_internal_schema.ChatMessageResponse'
|
|
type: object
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
|
"404":
|
|
description: Not Found
|
|
schema:
|
|
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
|
"409":
|
|
description: Conflict
|
|
schema:
|
|
allOf:
|
|
- $ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
|
- properties:
|
|
data:
|
|
$ref: '#/definitions/rag-new_internal_schema.ChatMessageResponse'
|
|
type: object
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
|
summary: 添加聊天记录
|
|
tags:
|
|
- chat_message
|
|
/api/v1/ping:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: get string by ID
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
allOf:
|
|
- $ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
|
- properties:
|
|
data:
|
|
$ref: '#/definitions/rag-new_internal_schema.CurrentUserResponse'
|
|
type: object
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
|
summary: Greet
|
|
tags:
|
|
- ping
|
|
/api/v1/stream/{stream_id}:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: get string by ID
|
|
parameters:
|
|
- description: Chat ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
- description: Chat stream id
|
|
in: path
|
|
name: stream_id
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
allOf:
|
|
- $ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
|
- properties:
|
|
data:
|
|
$ref: '#/definitions/rag-new_internal_schema.ChatMessageResponse'
|
|
type: object
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
|
"404":
|
|
description: Not Found
|
|
schema:
|
|
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
|
"409":
|
|
description: Conflict
|
|
schema:
|
|
allOf:
|
|
- $ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
|
- properties:
|
|
data:
|
|
$ref: '#/definitions/rag-new_internal_schema.ChatMessageResponse'
|
|
type: object
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
|
security:
|
|
- none: []
|
|
summary: 流式传输聊天内容
|
|
tags:
|
|
- chat_message
|
|
/api/v1/tools:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: List tools
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
allOf:
|
|
- $ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
|
- properties:
|
|
data:
|
|
$ref: '#/definitions/rag-new_internal_schema.CurrentUserResponse'
|
|
type: object
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
|
summary: List Tool
|
|
tags:
|
|
- tool
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Create tool
|
|
parameters:
|
|
- description: Tool
|
|
in: body
|
|
name: tool
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/rag-new_internal_schema.ToolCreateRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
allOf:
|
|
- $ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
|
- properties:
|
|
data:
|
|
items:
|
|
$ref: '#/definitions/rag-new_internal_entity.Tool'
|
|
type: array
|
|
type: object
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
|
summary: Create Tool
|
|
tags:
|
|
- tool
|
|
/api/v1/tools/{id}:
|
|
delete:
|
|
consumes:
|
|
- application/json
|
|
description: DeleteTool
|
|
parameters:
|
|
- description: Tool ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
|
"404":
|
|
description: Not Found
|
|
schema:
|
|
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
|
summary: DeleteTool
|
|
tags:
|
|
- tool
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: Get tool
|
|
parameters:
|
|
- description: Tool ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
allOf:
|
|
- $ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
|
- properties:
|
|
data:
|
|
$ref: '#/definitions/rag-new_internal_entity.Tool'
|
|
type: object
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
|
"404":
|
|
description: Not Found
|
|
schema:
|
|
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
|
summary: Get Tool
|
|
tags:
|
|
- tool
|
|
securityDefinitions:
|
|
ApiKeyAuth:
|
|
in: header
|
|
name: Authorization
|
|
type: apiKey
|
|
swagger: "2.0"
|