optimize
This commit is contained in:
parent
db4fe8beca
commit
2001fb5e51
614
api/swagger.yaml
614
api/swagger.yaml
@ -32,7 +32,7 @@ definitions:
|
|||||||
rag-new_internal_entity.AssistantToolType:
|
rag-new_internal_entity.AssistantToolType:
|
||||||
properties:
|
properties:
|
||||||
assistant:
|
assistant:
|
||||||
$ref: '#/definitions/rag-new_internal_entity.Assistant'
|
$ref: "#/definitions/rag-new_internal_entity.Assistant"
|
||||||
assistant_id:
|
assistant_id:
|
||||||
type: integer
|
type: integer
|
||||||
created_at:
|
created_at:
|
||||||
@ -40,7 +40,7 @@ definitions:
|
|||||||
id:
|
id:
|
||||||
type: integer
|
type: integer
|
||||||
tool:
|
tool:
|
||||||
$ref: '#/definitions/rag-new_internal_entity.Tool'
|
$ref: "#/definitions/rag-new_internal_entity.Tool"
|
||||||
tool_id:
|
tool_id:
|
||||||
type: integer
|
type: integer
|
||||||
updated_at:
|
updated_at:
|
||||||
@ -89,7 +89,7 @@ definitions:
|
|||||||
created_at:
|
created_at:
|
||||||
type: string
|
type: string
|
||||||
data:
|
data:
|
||||||
$ref: '#/definitions/rag-new_internal_schema.ToolDiscoveryOutput'
|
$ref: "#/definitions/rag-new_internal_schema.ToolDiscoveryOutput"
|
||||||
description:
|
description:
|
||||||
type: string
|
type: string
|
||||||
discovery_url:
|
discovery_url:
|
||||||
@ -114,8 +114,8 @@ definitions:
|
|||||||
prompt:
|
prompt:
|
||||||
type: string
|
type: string
|
||||||
required:
|
required:
|
||||||
- description
|
- description
|
||||||
- name
|
- name
|
||||||
type: object
|
type: object
|
||||||
rag-new_internal_schema.ChatCreateRequest:
|
rag-new_internal_schema.ChatCreateRequest:
|
||||||
properties:
|
properties:
|
||||||
@ -125,8 +125,8 @@ definitions:
|
|||||||
maxLength: 255
|
maxLength: 255
|
||||||
type: string
|
type: string
|
||||||
required:
|
required:
|
||||||
- assistant_id
|
- assistant_id
|
||||||
- name
|
- name
|
||||||
type: object
|
type: object
|
||||||
rag-new_internal_schema.ChatMessageAddRequest:
|
rag-new_internal_schema.ChatMessageAddRequest:
|
||||||
properties:
|
properties:
|
||||||
@ -134,7 +134,7 @@ definitions:
|
|||||||
maxLength: 255
|
maxLength: 255
|
||||||
type: string
|
type: string
|
||||||
required:
|
required:
|
||||||
- message
|
- message
|
||||||
type: object
|
type: object
|
||||||
rag-new_internal_schema.ChatMessageResponse:
|
rag-new_internal_schema.ChatMessageResponse:
|
||||||
properties:
|
properties:
|
||||||
@ -177,9 +177,9 @@ definitions:
|
|||||||
maxLength: 255
|
maxLength: 255
|
||||||
type: string
|
type: string
|
||||||
required:
|
required:
|
||||||
- description
|
- description
|
||||||
- name
|
- name
|
||||||
- url
|
- url
|
||||||
type: object
|
type: object
|
||||||
rag-new_internal_schema.ToolDiscoveryOutput:
|
rag-new_internal_schema.ToolDiscoveryOutput:
|
||||||
properties:
|
properties:
|
||||||
@ -189,7 +189,7 @@ definitions:
|
|||||||
type: string
|
type: string
|
||||||
function:
|
function:
|
||||||
items:
|
items:
|
||||||
$ref: '#/definitions/rag-new_internal_schema.ToolDiscoveryOutputFunctions'
|
$ref: "#/definitions/rag-new_internal_schema.ToolDiscoveryOutputFunctions"
|
||||||
type: array
|
type: array
|
||||||
homepage_url:
|
homepage_url:
|
||||||
type: string
|
type: string
|
||||||
@ -212,7 +212,7 @@ definitions:
|
|||||||
properties:
|
properties:
|
||||||
function:
|
function:
|
||||||
items:
|
items:
|
||||||
$ref: '#/definitions/rag-new_internal_schema.ToolDiscoveryOutputFunction'
|
$ref: "#/definitions/rag-new_internal_schema.ToolDiscoveryOutputFunction"
|
||||||
type: array
|
type: array
|
||||||
type:
|
type:
|
||||||
type: string
|
type: string
|
||||||
@ -225,623 +225,623 @@ paths:
|
|||||||
/api/v1/assistants:
|
/api/v1/assistants:
|
||||||
get:
|
get:
|
||||||
consumes:
|
consumes:
|
||||||
- application/json
|
- application/json
|
||||||
produces:
|
produces:
|
||||||
- application/json
|
- application/json
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: OK
|
description: OK
|
||||||
schema:
|
schema:
|
||||||
allOf:
|
allOf:
|
||||||
- $ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
- $ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||||
- properties:
|
- properties:
|
||||||
data:
|
data:
|
||||||
items:
|
items:
|
||||||
$ref: '#/definitions/rag-new_internal_entity.Assistant'
|
$ref: "#/definitions/rag-new_internal_entity.Assistant"
|
||||||
type: array
|
type: array
|
||||||
type: object
|
type: object
|
||||||
"400":
|
"400":
|
||||||
description: Bad Request
|
description: Bad Request
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
$ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||||
security:
|
security:
|
||||||
- ApiKeyAuth: []
|
- ApiKeyAuth: []
|
||||||
summary: 获取 Assistant 列表
|
summary: 获取 Assistant 列表
|
||||||
tags:
|
tags:
|
||||||
- assistant
|
- assistant
|
||||||
post:
|
post:
|
||||||
consumes:
|
consumes:
|
||||||
- application/json
|
- application/json
|
||||||
parameters:
|
parameters:
|
||||||
- description: Assistant
|
- description: Assistant
|
||||||
in: body
|
in: body
|
||||||
name: assistant
|
name: assistant
|
||||||
required: true
|
required: true
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/rag-new_internal_schema.AssistantCreateRequest'
|
$ref: "#/definitions/rag-new_internal_schema.AssistantCreateRequest"
|
||||||
produces:
|
produces:
|
||||||
- application/json
|
- application/json
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: OK
|
description: OK
|
||||||
schema:
|
schema:
|
||||||
allOf:
|
allOf:
|
||||||
- $ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
- $ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||||
- properties:
|
- properties:
|
||||||
data:
|
data:
|
||||||
$ref: '#/definitions/rag-new_internal_entity.Assistant'
|
$ref: "#/definitions/rag-new_internal_entity.Assistant"
|
||||||
type: object
|
type: object
|
||||||
"400":
|
"400":
|
||||||
description: Bad Request
|
description: Bad Request
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
$ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||||
security:
|
security:
|
||||||
- ApiKeyAuth: []
|
- ApiKeyAuth: []
|
||||||
summary: 创建 Assistant
|
summary: 创建 Assistant
|
||||||
tags:
|
tags:
|
||||||
- assistant
|
- assistant
|
||||||
/api/v1/assistants/{id}:
|
/api/v1/assistants/{id}:
|
||||||
delete:
|
delete:
|
||||||
consumes:
|
consumes:
|
||||||
- application/json
|
- application/json
|
||||||
parameters:
|
parameters:
|
||||||
- description: Assistant ID
|
- description: Assistant ID
|
||||||
in: path
|
in: path
|
||||||
name: id
|
name: id
|
||||||
required: true
|
required: true
|
||||||
type: integer
|
type: integer
|
||||||
produces:
|
produces:
|
||||||
- application/json
|
- application/json
|
||||||
responses:
|
responses:
|
||||||
"204":
|
"204":
|
||||||
description: No Content
|
description: No Content
|
||||||
"404":
|
"404":
|
||||||
description: Not Found
|
description: Not Found
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
$ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||||
"500":
|
"500":
|
||||||
description: Internal Server Error
|
description: Internal Server Error
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
$ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||||
security:
|
security:
|
||||||
- ApiKeyAuth: []
|
- ApiKeyAuth: []
|
||||||
summary: 删除 Assistant
|
summary: 删除 Assistant
|
||||||
tags:
|
tags:
|
||||||
- assistant
|
- assistant
|
||||||
get:
|
get:
|
||||||
consumes:
|
consumes:
|
||||||
- application/json
|
- application/json
|
||||||
parameters:
|
parameters:
|
||||||
- description: Assistant ID
|
- description: Assistant ID
|
||||||
in: path
|
in: path
|
||||||
name: id
|
name: id
|
||||||
required: true
|
required: true
|
||||||
type: integer
|
type: integer
|
||||||
produces:
|
produces:
|
||||||
- application/json
|
- application/json
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: OK
|
description: OK
|
||||||
schema:
|
schema:
|
||||||
allOf:
|
allOf:
|
||||||
- $ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
- $ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||||
- properties:
|
- properties:
|
||||||
data:
|
data:
|
||||||
$ref: '#/definitions/rag-new_internal_entity.Assistant'
|
$ref: "#/definitions/rag-new_internal_entity.Assistant"
|
||||||
type: object
|
type: object
|
||||||
"400":
|
"400":
|
||||||
description: Bad Request
|
description: Bad Request
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
$ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||||
security:
|
security:
|
||||||
- ApiKeyAuth: []
|
- ApiKeyAuth: []
|
||||||
summary: 获取指定的 Assistant
|
summary: 获取指定的 Assistant
|
||||||
tags:
|
tags:
|
||||||
- assistant
|
- assistant
|
||||||
/api/v1/assistants/{id}/tools:
|
/api/v1/assistants/{id}/tools:
|
||||||
get:
|
get:
|
||||||
consumes:
|
consumes:
|
||||||
- application/json
|
- application/json
|
||||||
parameters:
|
parameters:
|
||||||
- description: Assistant ID
|
- description: Assistant ID
|
||||||
in: path
|
in: path
|
||||||
name: id
|
name: id
|
||||||
required: true
|
required: true
|
||||||
type: integer
|
type: integer
|
||||||
produces:
|
produces:
|
||||||
- application/json
|
- application/json
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: OK
|
description: OK
|
||||||
schema:
|
schema:
|
||||||
allOf:
|
allOf:
|
||||||
- $ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
- $ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||||
- properties:
|
- properties:
|
||||||
data:
|
data:
|
||||||
items:
|
items:
|
||||||
$ref: '#/definitions/rag-new_internal_entity.AssistantToolType'
|
$ref: "#/definitions/rag-new_internal_entity.AssistantToolType"
|
||||||
type: array
|
type: array
|
||||||
type: object
|
type: object
|
||||||
"500":
|
"500":
|
||||||
description: Internal Server Error
|
description: Internal Server Error
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
$ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||||
security:
|
security:
|
||||||
- ApiKeyAuth: []
|
- ApiKeyAuth: []
|
||||||
summary: 获取 Assistant 所绑定的 Tool
|
summary: 获取 Assistant 所绑定的 Tool
|
||||||
tags:
|
tags:
|
||||||
- assistant
|
- assistant
|
||||||
/api/v1/assistants/{id}/tools/{tool_id}:
|
/api/v1/assistants/{id}/tools/{tool_id}:
|
||||||
delete:
|
delete:
|
||||||
consumes:
|
consumes:
|
||||||
- application/json
|
- application/json
|
||||||
parameters:
|
parameters:
|
||||||
- description: Assistant ID
|
- description: Assistant ID
|
||||||
in: path
|
in: path
|
||||||
name: id
|
name: id
|
||||||
required: true
|
required: true
|
||||||
type: integer
|
type: integer
|
||||||
- description: Tool ID
|
- description: Tool ID
|
||||||
in: path
|
in: path
|
||||||
name: tool_id
|
name: tool_id
|
||||||
required: true
|
required: true
|
||||||
type: integer
|
type: integer
|
||||||
produces:
|
produces:
|
||||||
- application/json
|
- application/json
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: OK
|
description: OK
|
||||||
schema:
|
schema:
|
||||||
allOf:
|
allOf:
|
||||||
- $ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
- $ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||||
- properties:
|
- properties:
|
||||||
data:
|
data:
|
||||||
$ref: '#/definitions/rag-new_internal_entity.AssistantTool'
|
$ref: "#/definitions/rag-new_internal_entity.AssistantTool"
|
||||||
type: object
|
type: object
|
||||||
"500":
|
"500":
|
||||||
description: Internal Server Error
|
description: Internal Server Error
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
$ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||||
security:
|
security:
|
||||||
- ApiKeyAuth: []
|
- ApiKeyAuth: []
|
||||||
summary: 解绑 Tool
|
summary: 解绑 Tool
|
||||||
tags:
|
tags:
|
||||||
- assistant
|
- assistant
|
||||||
post:
|
post:
|
||||||
consumes:
|
consumes:
|
||||||
- application/json
|
- application/json
|
||||||
parameters:
|
parameters:
|
||||||
- description: Assistant ID
|
- description: Assistant ID
|
||||||
in: path
|
in: path
|
||||||
name: id
|
name: id
|
||||||
required: true
|
required: true
|
||||||
type: integer
|
type: integer
|
||||||
- description: Tool ID
|
- description: Tool ID
|
||||||
in: path
|
in: path
|
||||||
name: tool_id
|
name: tool_id
|
||||||
required: true
|
required: true
|
||||||
type: integer
|
type: integer
|
||||||
produces:
|
produces:
|
||||||
- application/json
|
- application/json
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: OK
|
description: OK
|
||||||
schema:
|
schema:
|
||||||
allOf:
|
allOf:
|
||||||
- $ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
- $ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||||
- properties:
|
- properties:
|
||||||
data:
|
data:
|
||||||
$ref: '#/definitions/rag-new_internal_entity.AssistantTool'
|
$ref: "#/definitions/rag-new_internal_entity.AssistantTool"
|
||||||
type: object
|
type: object
|
||||||
"500":
|
"500":
|
||||||
description: Internal Server Error
|
description: Internal Server Error
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
$ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||||
security:
|
security:
|
||||||
- ApiKeyAuth: []
|
- ApiKeyAuth: []
|
||||||
summary: 绑定 Tool
|
summary: 绑定 Tool
|
||||||
tags:
|
tags:
|
||||||
- assistant
|
- assistant
|
||||||
/api/v1/chats:
|
/api/v1/chats:
|
||||||
get:
|
get:
|
||||||
consumes:
|
consumes:
|
||||||
- application/json
|
- application/json
|
||||||
description: get string by ID
|
description: get string by ID
|
||||||
parameters:
|
parameters:
|
||||||
- description: Assistant ID
|
- description: Assistant ID
|
||||||
in: query
|
in: query
|
||||||
name: assistant_id
|
name: assistant_id
|
||||||
type: integer
|
type: integer
|
||||||
produces:
|
produces:
|
||||||
- application/json
|
- application/json
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: OK
|
description: OK
|
||||||
schema:
|
schema:
|
||||||
allOf:
|
allOf:
|
||||||
- $ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
- $ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||||
- properties:
|
- properties:
|
||||||
data:
|
data:
|
||||||
items:
|
items:
|
||||||
$ref: '#/definitions/rag-new_internal_entity.Chat'
|
$ref: "#/definitions/rag-new_internal_entity.Chat"
|
||||||
type: array
|
type: array
|
||||||
type: object
|
type: object
|
||||||
"400":
|
"400":
|
||||||
description: Bad Request
|
description: Bad Request
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
$ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||||
summary: 获取所有 Chat
|
summary: 获取所有 Chat
|
||||||
tags:
|
tags:
|
||||||
- chat
|
- chat
|
||||||
post:
|
post:
|
||||||
consumes:
|
consumes:
|
||||||
- application/json
|
- application/json
|
||||||
description: get string by ID
|
description: get string by ID
|
||||||
parameters:
|
parameters:
|
||||||
- description: Chat
|
- description: Chat
|
||||||
in: body
|
in: body
|
||||||
name: chat
|
name: chat
|
||||||
required: true
|
required: true
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/rag-new_internal_schema.ChatCreateRequest'
|
$ref: "#/definitions/rag-new_internal_schema.ChatCreateRequest"
|
||||||
produces:
|
produces:
|
||||||
- application/json
|
- application/json
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: OK
|
description: OK
|
||||||
schema:
|
schema:
|
||||||
allOf:
|
allOf:
|
||||||
- $ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
- $ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||||
- properties:
|
- properties:
|
||||||
data:
|
data:
|
||||||
$ref: '#/definitions/rag-new_internal_entity.Chat'
|
$ref: "#/definitions/rag-new_internal_entity.Chat"
|
||||||
type: object
|
type: object
|
||||||
"400":
|
"400":
|
||||||
description: Bad Request
|
description: Bad Request
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
$ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||||
"500":
|
"500":
|
||||||
description: Internal Server Error
|
description: Internal Server Error
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
$ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||||
summary: Create Chat
|
summary: Create Chat
|
||||||
tags:
|
tags:
|
||||||
- chat
|
- chat
|
||||||
/api/v1/chats/{id}:
|
/api/v1/chats/{id}:
|
||||||
delete:
|
delete:
|
||||||
consumes:
|
consumes:
|
||||||
- application/json
|
- application/json
|
||||||
description: get string by ID
|
description: get string by ID
|
||||||
parameters:
|
parameters:
|
||||||
- description: Chat ID
|
- description: Chat ID
|
||||||
in: path
|
in: path
|
||||||
name: id
|
name: id
|
||||||
required: true
|
required: true
|
||||||
type: integer
|
type: integer
|
||||||
produces:
|
produces:
|
||||||
- application/json
|
- application/json
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: OK
|
description: OK
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
$ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||||
"400":
|
"400":
|
||||||
description: Bad Request
|
description: Bad Request
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
$ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||||
"404":
|
"404":
|
||||||
description: Not Found
|
description: Not Found
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
$ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||||
"500":
|
"500":
|
||||||
description: Internal Server Error
|
description: Internal Server Error
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
$ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||||
security:
|
security:
|
||||||
- ApiKeyAuth: []
|
- ApiKeyAuth: []
|
||||||
summary: Delete Chat
|
summary: Delete Chat
|
||||||
tags:
|
tags:
|
||||||
- chat
|
- chat
|
||||||
/api/v1/chats/{id}/messages:
|
/api/v1/chats/{id}/messages:
|
||||||
get:
|
get:
|
||||||
consumes:
|
consumes:
|
||||||
- application/json
|
- application/json
|
||||||
description: get string by ID
|
description: get string by ID
|
||||||
parameters:
|
parameters:
|
||||||
- description: Chat ID
|
- description: Chat ID
|
||||||
in: path
|
in: path
|
||||||
name: id
|
name: id
|
||||||
required: true
|
required: true
|
||||||
type: integer
|
type: integer
|
||||||
produces:
|
produces:
|
||||||
- application/json
|
- application/json
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: OK
|
description: OK
|
||||||
schema:
|
schema:
|
||||||
allOf:
|
allOf:
|
||||||
- $ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
- $ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||||
- properties:
|
- properties:
|
||||||
data:
|
data:
|
||||||
items:
|
items:
|
||||||
$ref: '#/definitions/rag-new_internal_entity.ChatMessage'
|
$ref: "#/definitions/rag-new_internal_entity.ChatMessage"
|
||||||
type: array
|
type: array
|
||||||
type: object
|
type: object
|
||||||
"400":
|
"400":
|
||||||
description: Bad Request
|
description: Bad Request
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
$ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||||
"404":
|
"404":
|
||||||
description: Not Found
|
description: Not Found
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
$ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||||
"500":
|
"500":
|
||||||
description: Internal Server Error
|
description: Internal Server Error
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
$ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||||
security:
|
security:
|
||||||
- ApiKeyAuth: []
|
- ApiKeyAuth: []
|
||||||
summary: 查看聊天记录
|
summary: 查看聊天记录
|
||||||
tags:
|
tags:
|
||||||
- chat_message
|
- chat_message
|
||||||
post:
|
post:
|
||||||
consumes:
|
consumes:
|
||||||
- application/json
|
- application/json
|
||||||
description: get string by ID
|
description: get string by ID
|
||||||
parameters:
|
parameters:
|
||||||
- description: Chat ID
|
- description: Chat ID
|
||||||
in: path
|
in: path
|
||||||
name: id
|
name: id
|
||||||
required: true
|
required: true
|
||||||
type: integer
|
type: integer
|
||||||
- description: Message
|
- description: Message
|
||||||
in: body
|
in: body
|
||||||
name: message
|
name: message
|
||||||
required: true
|
required: true
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/rag-new_internal_schema.ChatMessageAddRequest'
|
$ref: "#/definitions/rag-new_internal_schema.ChatMessageAddRequest"
|
||||||
produces:
|
produces:
|
||||||
- application/json
|
- application/json
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: OK
|
description: OK
|
||||||
schema:
|
schema:
|
||||||
allOf:
|
allOf:
|
||||||
- $ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
- $ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||||
- properties:
|
- properties:
|
||||||
data:
|
data:
|
||||||
$ref: '#/definitions/rag-new_internal_schema.ChatMessageResponse'
|
$ref: "#/definitions/rag-new_internal_schema.ChatMessageResponse"
|
||||||
type: object
|
type: object
|
||||||
"400":
|
"400":
|
||||||
description: Bad Request
|
description: Bad Request
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
$ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||||
"404":
|
"404":
|
||||||
description: Not Found
|
description: Not Found
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
$ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||||
"409":
|
"409":
|
||||||
description: Conflict
|
description: Conflict
|
||||||
schema:
|
schema:
|
||||||
allOf:
|
allOf:
|
||||||
- $ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
- $ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||||
- properties:
|
- properties:
|
||||||
data:
|
data:
|
||||||
$ref: '#/definitions/rag-new_internal_schema.ChatMessageResponse'
|
$ref: "#/definitions/rag-new_internal_schema.ChatMessageResponse"
|
||||||
type: object
|
type: object
|
||||||
"500":
|
"500":
|
||||||
description: Internal Server Error
|
description: Internal Server Error
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
$ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||||
security:
|
security:
|
||||||
- ApiKeyAuth: []
|
- ApiKeyAuth: []
|
||||||
summary: 添加聊天记录
|
summary: 添加聊天记录
|
||||||
tags:
|
tags:
|
||||||
- chat_message
|
- chat_message
|
||||||
/api/v1/ping:
|
/api/v1/ping:
|
||||||
get:
|
get:
|
||||||
consumes:
|
consumes:
|
||||||
- application/json
|
- application/json
|
||||||
description: get string by ID
|
description: get string by ID
|
||||||
produces:
|
produces:
|
||||||
- application/json
|
- application/json
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: OK
|
description: OK
|
||||||
schema:
|
schema:
|
||||||
allOf:
|
allOf:
|
||||||
- $ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
- $ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||||
- properties:
|
- properties:
|
||||||
data:
|
data:
|
||||||
$ref: '#/definitions/rag-new_internal_schema.CurrentUserResponse'
|
$ref: "#/definitions/rag-new_internal_schema.CurrentUserResponse"
|
||||||
type: object
|
type: object
|
||||||
"400":
|
"400":
|
||||||
description: Bad Request
|
description: Bad Request
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
$ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||||
security:
|
security:
|
||||||
- ApiKeyAuth: []
|
- ApiKeyAuth: []
|
||||||
summary: Greet
|
summary: Greet
|
||||||
tags:
|
tags:
|
||||||
- ping
|
- ping
|
||||||
/api/v1/stream/{stream_id}:
|
/api/v1/stream/{stream_id}:
|
||||||
get:
|
get:
|
||||||
consumes:
|
consumes:
|
||||||
- application/json
|
- application/json
|
||||||
description: get string by ID
|
description: get string by ID
|
||||||
parameters:
|
parameters:
|
||||||
- description: Chat ID
|
- description: Chat ID
|
||||||
in: path
|
in: path
|
||||||
name: id
|
name: id
|
||||||
required: true
|
required: true
|
||||||
type: integer
|
type: integer
|
||||||
- description: Chat stream id
|
- description: Chat stream id
|
||||||
in: path
|
in: path
|
||||||
name: stream_id
|
name: stream_id
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
produces:
|
produces:
|
||||||
- application/json
|
- application/json
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: OK
|
description: OK
|
||||||
schema:
|
schema:
|
||||||
allOf:
|
allOf:
|
||||||
- $ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
- $ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||||
- properties:
|
- properties:
|
||||||
data:
|
data:
|
||||||
$ref: '#/definitions/rag-new_internal_schema.ChatMessageResponse'
|
$ref: "#/definitions/rag-new_internal_schema.ChatMessageResponse"
|
||||||
type: object
|
type: object
|
||||||
"400":
|
"400":
|
||||||
description: Bad Request
|
description: Bad Request
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
$ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||||
"404":
|
"404":
|
||||||
description: Not Found
|
description: Not Found
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
$ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||||
"409":
|
"409":
|
||||||
description: Conflict
|
description: Conflict
|
||||||
schema:
|
schema:
|
||||||
allOf:
|
allOf:
|
||||||
- $ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
- $ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||||
- properties:
|
- properties:
|
||||||
data:
|
data:
|
||||||
$ref: '#/definitions/rag-new_internal_schema.ChatMessageResponse'
|
$ref: "#/definitions/rag-new_internal_schema.ChatMessageResponse"
|
||||||
type: object
|
type: object
|
||||||
"500":
|
"500":
|
||||||
description: Internal Server Error
|
description: Internal Server Error
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
$ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||||
security:
|
security:
|
||||||
- none: []
|
- none: []
|
||||||
summary: 流式传输聊天内容
|
summary: 流式传输聊天内容
|
||||||
tags:
|
tags:
|
||||||
- chat_message
|
- chat_message
|
||||||
/api/v1/tools:
|
/api/v1/tools:
|
||||||
get:
|
get:
|
||||||
consumes:
|
consumes:
|
||||||
- application/json
|
- application/json
|
||||||
description: List tools
|
description: List tools
|
||||||
produces:
|
produces:
|
||||||
- application/json
|
- application/json
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: OK
|
description: OK
|
||||||
schema:
|
schema:
|
||||||
allOf:
|
allOf:
|
||||||
- $ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
- $ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||||
- properties:
|
- properties:
|
||||||
data:
|
data:
|
||||||
items:
|
items:
|
||||||
$ref: '#/definitions/rag-new_internal_entity.Tool'
|
$ref: "#/definitions/rag-new_internal_entity.Tool"
|
||||||
type: array
|
type: array
|
||||||
type: object
|
type: object
|
||||||
"400":
|
"400":
|
||||||
description: Bad Request
|
description: Bad Request
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
$ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||||
security:
|
security:
|
||||||
- ApiKeyAuth: []
|
- ApiKeyAuth: []
|
||||||
summary: List Tool
|
summary: List Tool
|
||||||
tags:
|
tags:
|
||||||
- tool
|
- tool
|
||||||
post:
|
post:
|
||||||
consumes:
|
consumes:
|
||||||
- application/json
|
- application/json
|
||||||
description: Create tool
|
description: Create tool
|
||||||
parameters:
|
parameters:
|
||||||
- description: Tool
|
- description: Tool
|
||||||
in: body
|
in: body
|
||||||
name: tool
|
name: tool
|
||||||
required: true
|
required: true
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/rag-new_internal_schema.ToolCreateRequest'
|
$ref: "#/definitions/rag-new_internal_schema.ToolCreateRequest"
|
||||||
produces:
|
produces:
|
||||||
- application/json
|
- application/json
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: OK
|
description: OK
|
||||||
schema:
|
schema:
|
||||||
allOf:
|
allOf:
|
||||||
- $ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
- $ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||||
- properties:
|
- properties:
|
||||||
data:
|
data:
|
||||||
$ref: '#/definitions/rag-new_internal_entity.Tool'
|
$ref: "#/definitions/rag-new_internal_entity.Tool"
|
||||||
type: object
|
type: object
|
||||||
"400":
|
"400":
|
||||||
description: Bad Request
|
description: Bad Request
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
$ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||||
security:
|
security:
|
||||||
- ApiKeyAuth: []
|
- ApiKeyAuth: []
|
||||||
summary: Create Tool
|
summary: Create Tool
|
||||||
tags:
|
tags:
|
||||||
- tool
|
- tool
|
||||||
/api/v1/tools/{id}:
|
/api/v1/tools/{id}:
|
||||||
delete:
|
delete:
|
||||||
consumes:
|
consumes:
|
||||||
- application/json
|
- application/json
|
||||||
description: DeleteTool
|
description: DeleteTool
|
||||||
parameters:
|
parameters:
|
||||||
- description: Tool ID
|
- description: Tool ID
|
||||||
in: path
|
in: path
|
||||||
name: id
|
name: id
|
||||||
required: true
|
required: true
|
||||||
type: integer
|
type: integer
|
||||||
produces:
|
produces:
|
||||||
- application/json
|
- application/json
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: OK
|
description: OK
|
||||||
"400":
|
"400":
|
||||||
description: Bad Request
|
description: Bad Request
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
$ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||||
"404":
|
"404":
|
||||||
description: Not Found
|
description: Not Found
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
$ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||||
security:
|
security:
|
||||||
- ApiKeyAuth: []
|
- ApiKeyAuth: []
|
||||||
summary: DeleteTool
|
summary: DeleteTool
|
||||||
tags:
|
tags:
|
||||||
- tool
|
- tool
|
||||||
get:
|
get:
|
||||||
consumes:
|
consumes:
|
||||||
- application/json
|
- application/json
|
||||||
description: Get tool
|
description: Get tool
|
||||||
parameters:
|
parameters:
|
||||||
- description: Tool ID
|
- description: Tool ID
|
||||||
in: path
|
in: path
|
||||||
name: id
|
name: id
|
||||||
required: true
|
required: true
|
||||||
type: integer
|
type: integer
|
||||||
produces:
|
produces:
|
||||||
- application/json
|
- application/json
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: OK
|
description: OK
|
||||||
schema:
|
schema:
|
||||||
allOf:
|
allOf:
|
||||||
- $ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
- $ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||||
- properties:
|
- properties:
|
||||||
data:
|
data:
|
||||||
$ref: '#/definitions/rag-new_internal_entity.Tool'
|
$ref: "#/definitions/rag-new_internal_entity.Tool"
|
||||||
type: object
|
type: object
|
||||||
"400":
|
"400":
|
||||||
description: Bad Request
|
description: Bad Request
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
$ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||||
"404":
|
"404":
|
||||||
description: Not Found
|
description: Not Found
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
$ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||||
security:
|
security:
|
||||||
- ApiKeyAuth: []
|
- ApiKeyAuth: []
|
||||||
summary: Get Tool
|
summary: Get Tool
|
||||||
tags:
|
tags:
|
||||||
- tool
|
- tool
|
||||||
securityDefinitions:
|
securityDefinitions:
|
||||||
ApiKeyAuth:
|
ApiKeyAuth:
|
||||||
in: header
|
in: header
|
||||||
|
4826
src/api/api.ts
4826
src/api/api.ts
File diff suppressed because it is too large
Load Diff
@ -5,19 +5,18 @@
|
|||||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
*
|
*
|
||||||
* The version of the OpenAPI document: 1.0
|
* The version of the OpenAPI document: 1.0
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
* https://openapi-generator.tech
|
* https://openapi-generator.tech
|
||||||
* Do not edit the class manually.
|
* Do not edit the class manually.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import type { Configuration } from "./configuration";
|
||||||
import type { Configuration } from './configuration';
|
|
||||||
// Some imports not used depending on template conditions
|
// Some imports not used depending on template conditions
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
|
import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from "axios";
|
||||||
import globalAxios from 'axios';
|
import globalAxios from "axios";
|
||||||
|
|
||||||
export const BASE_PATH = "http://localhost".replace(/\/+$/, "");
|
export const BASE_PATH = "http://localhost".replace(/\/+$/, "");
|
||||||
|
|
||||||
@ -26,10 +25,10 @@ export const BASE_PATH = "http://localhost".replace(/\/+$/, "");
|
|||||||
* @export
|
* @export
|
||||||
*/
|
*/
|
||||||
export const COLLECTION_FORMATS = {
|
export const COLLECTION_FORMATS = {
|
||||||
csv: ",",
|
csv: ",",
|
||||||
ssv: " ",
|
ssv: " ",
|
||||||
tsv: "\t",
|
tsv: "\t",
|
||||||
pipes: "|",
|
pipes: "|",
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -38,8 +37,8 @@ export const COLLECTION_FORMATS = {
|
|||||||
* @interface RequestArgs
|
* @interface RequestArgs
|
||||||
*/
|
*/
|
||||||
export interface RequestArgs {
|
export interface RequestArgs {
|
||||||
url: string;
|
url: string;
|
||||||
options: RawAxiosRequestConfig;
|
options: RawAxiosRequestConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -48,15 +47,19 @@ export interface RequestArgs {
|
|||||||
* @class BaseAPI
|
* @class BaseAPI
|
||||||
*/
|
*/
|
||||||
export class BaseAPI {
|
export class BaseAPI {
|
||||||
protected configuration: Configuration | undefined;
|
protected configuration: Configuration | undefined;
|
||||||
|
|
||||||
constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) {
|
constructor(
|
||||||
if (configuration) {
|
configuration?: Configuration,
|
||||||
this.configuration = configuration;
|
protected basePath: string = BASE_PATH,
|
||||||
this.basePath = configuration.basePath ?? basePath;
|
protected axios: AxiosInstance = globalAxios,
|
||||||
}
|
) {
|
||||||
|
if (configuration) {
|
||||||
|
this.configuration = configuration;
|
||||||
|
this.basePath = configuration.basePath ?? basePath;
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -65,22 +68,24 @@ export class BaseAPI {
|
|||||||
* @extends {Error}
|
* @extends {Error}
|
||||||
*/
|
*/
|
||||||
export class RequiredError extends Error {
|
export class RequiredError extends Error {
|
||||||
constructor(public field: string, msg?: string) {
|
constructor(
|
||||||
super(msg);
|
public field: string,
|
||||||
this.name = "RequiredError"
|
msg?: string,
|
||||||
}
|
) {
|
||||||
|
super(msg);
|
||||||
|
this.name = "RequiredError";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ServerMap {
|
interface ServerMap {
|
||||||
[key: string]: {
|
[key: string]: {
|
||||||
url: string,
|
url: string;
|
||||||
description: string,
|
description: string;
|
||||||
}[];
|
}[];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @export
|
* @export
|
||||||
*/
|
*/
|
||||||
export const operationServerMap: ServerMap = {
|
export const operationServerMap: ServerMap = {};
|
||||||
}
|
|
||||||
|
@ -5,105 +5,139 @@
|
|||||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
*
|
*
|
||||||
* The version of the OpenAPI document: 1.0
|
* The version of the OpenAPI document: 1.0
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
* https://openapi-generator.tech
|
* https://openapi-generator.tech
|
||||||
* Do not edit the class manually.
|
* Do not edit the class manually.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
import type { Configuration } from "./configuration";
|
import type { Configuration } from "./configuration";
|
||||||
import type { RequestArgs } from "./base";
|
import type { RequestArgs } from "./base";
|
||||||
import type { AxiosInstance, AxiosResponse } from 'axios';
|
import type { AxiosInstance, AxiosResponse } from "axios";
|
||||||
import { RequiredError } from "./base";
|
import { RequiredError } from "./base";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @export
|
* @export
|
||||||
*/
|
*/
|
||||||
export const DUMMY_BASE_URL = 'https://example.com'
|
export const DUMMY_BASE_URL = "https://example.com";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
* @export
|
* @export
|
||||||
*/
|
*/
|
||||||
export const assertParamExists = function (functionName: string, paramName: string, paramValue: unknown) {
|
export const assertParamExists = function (
|
||||||
if (paramValue === null || paramValue === undefined) {
|
functionName: string,
|
||||||
throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
|
paramName: string,
|
||||||
}
|
paramValue: unknown,
|
||||||
}
|
) {
|
||||||
|
if (paramValue === null || paramValue === undefined) {
|
||||||
|
throw new RequiredError(
|
||||||
|
paramName,
|
||||||
|
`Required parameter ${paramName} was null or undefined when calling ${functionName}.`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @export
|
* @export
|
||||||
*/
|
*/
|
||||||
export const setApiKeyToObject = async function (object: any, keyParamName: string, configuration?: Configuration) {
|
export const setApiKeyToObject = async function (
|
||||||
if (configuration && configuration.apiKey) {
|
object: any,
|
||||||
const localVarApiKeyValue = typeof configuration.apiKey === 'function'
|
keyParamName: string,
|
||||||
? await configuration.apiKey(keyParamName)
|
configuration?: Configuration,
|
||||||
: await configuration.apiKey;
|
) {
|
||||||
object[keyParamName] = localVarApiKeyValue;
|
if (configuration && configuration.apiKey) {
|
||||||
}
|
const localVarApiKeyValue =
|
||||||
}
|
typeof configuration.apiKey === "function"
|
||||||
|
? await configuration.apiKey(keyParamName)
|
||||||
|
: await configuration.apiKey;
|
||||||
|
object[keyParamName] = localVarApiKeyValue;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @export
|
* @export
|
||||||
*/
|
*/
|
||||||
export const setBasicAuthToObject = function (object: any, configuration?: Configuration) {
|
export const setBasicAuthToObject = function (
|
||||||
if (configuration && (configuration.username || configuration.password)) {
|
object: any,
|
||||||
object["auth"] = { username: configuration.username, password: configuration.password };
|
configuration?: Configuration,
|
||||||
}
|
) {
|
||||||
}
|
if (configuration && (configuration.username || configuration.password)) {
|
||||||
|
object["auth"] = {
|
||||||
|
username: configuration.username,
|
||||||
|
password: configuration.password,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @export
|
* @export
|
||||||
*/
|
*/
|
||||||
export const setBearerAuthToObject = async function (object: any, configuration?: Configuration) {
|
export const setBearerAuthToObject = async function (
|
||||||
if (configuration && configuration.accessToken) {
|
object: any,
|
||||||
const accessToken = typeof configuration.accessToken === 'function'
|
configuration?: Configuration,
|
||||||
? await configuration.accessToken()
|
) {
|
||||||
: await configuration.accessToken;
|
if (configuration && configuration.accessToken) {
|
||||||
object["Authorization"] = "Bearer " + accessToken;
|
const accessToken =
|
||||||
}
|
typeof configuration.accessToken === "function"
|
||||||
}
|
? await configuration.accessToken()
|
||||||
|
: await configuration.accessToken;
|
||||||
|
object["Authorization"] = "Bearer " + accessToken;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @export
|
* @export
|
||||||
*/
|
*/
|
||||||
export const setOAuthToObject = async function (object: any, name: string, scopes: string[], configuration?: Configuration) {
|
export const setOAuthToObject = async function (
|
||||||
if (configuration && configuration.accessToken) {
|
object: any,
|
||||||
const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
|
name: string,
|
||||||
? await configuration.accessToken(name, scopes)
|
scopes: string[],
|
||||||
: await configuration.accessToken;
|
configuration?: Configuration,
|
||||||
object["Authorization"] = "Bearer " + localVarAccessTokenValue;
|
) {
|
||||||
}
|
if (configuration && configuration.accessToken) {
|
||||||
}
|
const localVarAccessTokenValue =
|
||||||
|
typeof configuration.accessToken === "function"
|
||||||
|
? await configuration.accessToken(name, scopes)
|
||||||
|
: await configuration.accessToken;
|
||||||
|
object["Authorization"] = "Bearer " + localVarAccessTokenValue;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void {
|
function setFlattenedQueryParams(
|
||||||
if (parameter == null) return;
|
urlSearchParams: URLSearchParams,
|
||||||
if (typeof parameter === "object") {
|
parameter: any,
|
||||||
if (Array.isArray(parameter)) {
|
key: string = "",
|
||||||
(parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key));
|
): void {
|
||||||
}
|
if (parameter == null) return;
|
||||||
else {
|
if (typeof parameter === "object") {
|
||||||
Object.keys(parameter).forEach(currentKey =>
|
if (Array.isArray(parameter)) {
|
||||||
setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`)
|
(parameter as any[]).forEach((item) =>
|
||||||
);
|
setFlattenedQueryParams(urlSearchParams, item, key),
|
||||||
}
|
);
|
||||||
}
|
} else {
|
||||||
else {
|
Object.keys(parameter).forEach((currentKey) =>
|
||||||
if (urlSearchParams.has(key)) {
|
setFlattenedQueryParams(
|
||||||
urlSearchParams.append(key, parameter);
|
urlSearchParams,
|
||||||
}
|
parameter[currentKey],
|
||||||
else {
|
`${key}${key !== "" ? "." : ""}${currentKey}`,
|
||||||
urlSearchParams.set(key, parameter);
|
),
|
||||||
}
|
);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if (urlSearchParams.has(key)) {
|
||||||
|
urlSearchParams.append(key, parameter);
|
||||||
|
} else {
|
||||||
|
urlSearchParams.set(key, parameter);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -111,40 +145,58 @@ function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: an
|
|||||||
* @export
|
* @export
|
||||||
*/
|
*/
|
||||||
export const setSearchParams = function (url: URL, ...objects: any[]) {
|
export const setSearchParams = function (url: URL, ...objects: any[]) {
|
||||||
const searchParams = new URLSearchParams(url.search);
|
const searchParams = new URLSearchParams(url.search);
|
||||||
setFlattenedQueryParams(searchParams, objects);
|
setFlattenedQueryParams(searchParams, objects);
|
||||||
url.search = searchParams.toString();
|
url.search = searchParams.toString();
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @export
|
* @export
|
||||||
*/
|
*/
|
||||||
export const serializeDataIfNeeded = function (value: any, requestOptions: any, configuration?: Configuration) {
|
export const serializeDataIfNeeded = function (
|
||||||
const nonString = typeof value !== 'string';
|
value: any,
|
||||||
const needsSerialization = nonString && configuration && configuration.isJsonMime
|
requestOptions: any,
|
||||||
? configuration.isJsonMime(requestOptions.headers['Content-Type'])
|
configuration?: Configuration,
|
||||||
: nonString;
|
) {
|
||||||
return needsSerialization
|
const nonString = typeof value !== "string";
|
||||||
? JSON.stringify(value !== undefined ? value : {})
|
const needsSerialization =
|
||||||
: (value || "");
|
nonString && configuration && configuration.isJsonMime
|
||||||
}
|
? configuration.isJsonMime(requestOptions.headers["Content-Type"])
|
||||||
|
: nonString;
|
||||||
|
return needsSerialization
|
||||||
|
? JSON.stringify(value !== undefined ? value : {})
|
||||||
|
: value || "";
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @export
|
* @export
|
||||||
*/
|
*/
|
||||||
export const toPathString = function (url: URL) {
|
export const toPathString = function (url: URL) {
|
||||||
return url.pathname + url.search + url.hash
|
return url.pathname + url.search + url.hash;
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @export
|
* @export
|
||||||
*/
|
*/
|
||||||
export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) {
|
export const createRequestFunction = function (
|
||||||
return <T = unknown, R = AxiosResponse<T>>(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
axiosArgs: RequestArgs,
|
||||||
const axiosRequestArgs = {...axiosArgs.options, url: (axios.defaults.baseURL ? '' : configuration?.basePath ?? basePath) + axiosArgs.url};
|
globalAxios: AxiosInstance,
|
||||||
return axios.request<T, R>(axiosRequestArgs);
|
BASE_PATH: string,
|
||||||
|
configuration?: Configuration,
|
||||||
|
) {
|
||||||
|
return <T = unknown, R = AxiosResponse<T>>(
|
||||||
|
axios: AxiosInstance = globalAxios,
|
||||||
|
basePath: string = BASE_PATH,
|
||||||
|
) => {
|
||||||
|
const axiosRequestArgs = {
|
||||||
|
...axiosArgs.options,
|
||||||
|
url:
|
||||||
|
(axios.defaults.baseURL ? "" : (configuration?.basePath ?? basePath)) +
|
||||||
|
axiosArgs.url,
|
||||||
};
|
};
|
||||||
}
|
return axios.request<T, R>(axiosRequestArgs);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
@ -5,106 +5,128 @@
|
|||||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
*
|
*
|
||||||
* The version of the OpenAPI document: 1.0
|
* The version of the OpenAPI document: 1.0
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
* https://openapi-generator.tech
|
* https://openapi-generator.tech
|
||||||
* Do not edit the class manually.
|
* Do not edit the class manually.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
export interface ConfigurationParameters {
|
export interface ConfigurationParameters {
|
||||||
apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
|
apiKey?:
|
||||||
username?: string;
|
| string
|
||||||
password?: string;
|
| Promise<string>
|
||||||
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
|
| ((name: string) => string)
|
||||||
basePath?: string;
|
| ((name: string) => Promise<string>);
|
||||||
serverIndex?: number;
|
username?: string;
|
||||||
baseOptions?: any;
|
password?: string;
|
||||||
formDataCtor?: new () => any;
|
accessToken?:
|
||||||
|
| string
|
||||||
|
| Promise<string>
|
||||||
|
| ((name?: string, scopes?: string[]) => string)
|
||||||
|
| ((name?: string, scopes?: string[]) => Promise<string>);
|
||||||
|
basePath?: string;
|
||||||
|
serverIndex?: number;
|
||||||
|
baseOptions?: any;
|
||||||
|
formDataCtor?: new () => any;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class Configuration {
|
export class Configuration {
|
||||||
/**
|
/**
|
||||||
* parameter for apiKey security
|
* parameter for apiKey security
|
||||||
* @param name security name
|
* @param name security name
|
||||||
* @memberof Configuration
|
* @memberof Configuration
|
||||||
*/
|
*/
|
||||||
apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
|
apiKey?:
|
||||||
/**
|
| string
|
||||||
* parameter for basic security
|
| Promise<string>
|
||||||
*
|
| ((name: string) => string)
|
||||||
* @type {string}
|
| ((name: string) => Promise<string>);
|
||||||
* @memberof Configuration
|
/**
|
||||||
*/
|
* parameter for basic security
|
||||||
username?: string;
|
*
|
||||||
/**
|
* @type {string}
|
||||||
* parameter for basic security
|
* @memberof Configuration
|
||||||
*
|
*/
|
||||||
* @type {string}
|
username?: string;
|
||||||
* @memberof Configuration
|
/**
|
||||||
*/
|
* parameter for basic security
|
||||||
password?: string;
|
*
|
||||||
/**
|
* @type {string}
|
||||||
* parameter for oauth2 security
|
* @memberof Configuration
|
||||||
* @param name security name
|
*/
|
||||||
* @param scopes oauth2 scope
|
password?: string;
|
||||||
* @memberof Configuration
|
/**
|
||||||
*/
|
* parameter for oauth2 security
|
||||||
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
|
* @param name security name
|
||||||
/**
|
* @param scopes oauth2 scope
|
||||||
* override base path
|
* @memberof Configuration
|
||||||
*
|
*/
|
||||||
* @type {string}
|
accessToken?:
|
||||||
* @memberof Configuration
|
| string
|
||||||
*/
|
| Promise<string>
|
||||||
basePath?: string;
|
| ((name?: string, scopes?: string[]) => string)
|
||||||
/**
|
| ((name?: string, scopes?: string[]) => Promise<string>);
|
||||||
* override server index
|
/**
|
||||||
*
|
* override base path
|
||||||
* @type {number}
|
*
|
||||||
* @memberof Configuration
|
* @type {string}
|
||||||
*/
|
* @memberof Configuration
|
||||||
serverIndex?: number;
|
*/
|
||||||
/**
|
basePath?: string;
|
||||||
* base options for axios calls
|
/**
|
||||||
*
|
* override server index
|
||||||
* @type {any}
|
*
|
||||||
* @memberof Configuration
|
* @type {number}
|
||||||
*/
|
* @memberof Configuration
|
||||||
baseOptions?: any;
|
*/
|
||||||
/**
|
serverIndex?: number;
|
||||||
* The FormData constructor that will be used to create multipart form data
|
/**
|
||||||
* requests. You can inject this here so that execution environments that
|
* base options for axios calls
|
||||||
* do not support the FormData class can still run the generated client.
|
*
|
||||||
*
|
* @type {any}
|
||||||
* @type {new () => FormData}
|
* @memberof Configuration
|
||||||
*/
|
*/
|
||||||
formDataCtor?: new () => any;
|
baseOptions?: any;
|
||||||
|
/**
|
||||||
|
* The FormData constructor that will be used to create multipart form data
|
||||||
|
* requests. You can inject this here so that execution environments that
|
||||||
|
* do not support the FormData class can still run the generated client.
|
||||||
|
*
|
||||||
|
* @type {new () => FormData}
|
||||||
|
*/
|
||||||
|
formDataCtor?: new () => any;
|
||||||
|
|
||||||
constructor(param: ConfigurationParameters = {}) {
|
constructor(param: ConfigurationParameters = {}) {
|
||||||
this.apiKey = param.apiKey;
|
this.apiKey = param.apiKey;
|
||||||
this.username = param.username;
|
this.username = param.username;
|
||||||
this.password = param.password;
|
this.password = param.password;
|
||||||
this.accessToken = param.accessToken;
|
this.accessToken = param.accessToken;
|
||||||
this.basePath = param.basePath;
|
this.basePath = param.basePath;
|
||||||
this.serverIndex = param.serverIndex;
|
this.serverIndex = param.serverIndex;
|
||||||
this.baseOptions = param.baseOptions;
|
this.baseOptions = param.baseOptions;
|
||||||
this.formDataCtor = param.formDataCtor;
|
this.formDataCtor = param.formDataCtor;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if the given MIME is a JSON MIME.
|
* Check if the given MIME is a JSON MIME.
|
||||||
* JSON MIME examples:
|
* JSON MIME examples:
|
||||||
* application/json
|
* application/json
|
||||||
* application/json; charset=UTF8
|
* application/json; charset=UTF8
|
||||||
* APPLICATION/JSON
|
* APPLICATION/JSON
|
||||||
* application/vnd.company+json
|
* application/vnd.company+json
|
||||||
* @param mime - MIME (Multipurpose Internet Mail Extensions)
|
* @param mime - MIME (Multipurpose Internet Mail Extensions)
|
||||||
* @return True if the given MIME is JSON, false otherwise.
|
* @return True if the given MIME is JSON, false otherwise.
|
||||||
*/
|
*/
|
||||||
public isJsonMime(mime: string): boolean {
|
public isJsonMime(mime: string): boolean {
|
||||||
const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
|
const jsonMime: RegExp = new RegExp(
|
||||||
return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
|
"^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$",
|
||||||
}
|
"i",
|
||||||
|
);
|
||||||
|
return (
|
||||||
|
mime !== null &&
|
||||||
|
(jsonMime.test(mime) ||
|
||||||
|
mime.toLowerCase() === "application/json-patch+json")
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,14 +5,12 @@
|
|||||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
*
|
*
|
||||||
* The version of the OpenAPI document: 1.0
|
* The version of the OpenAPI document: 1.0
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
* https://openapi-generator.tech
|
* https://openapi-generator.tech
|
||||||
* Do not edit the class manually.
|
* Do not edit the class manually.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
export * from "./api";
|
export * from "./api";
|
||||||
export * from "./configuration";
|
export * from "./configuration";
|
||||||
|
|
||||||
|
424
src/auto-imports.d.ts
vendored
424
src/auto-imports.d.ts
vendored
@ -5,187 +5,271 @@
|
|||||||
// Generated by unplugin-auto-import
|
// Generated by unplugin-auto-import
|
||||||
export {}
|
export {}
|
||||||
declare global {
|
declare global {
|
||||||
const EffectScope: typeof import('vue')['EffectScope']
|
const EffectScope: (typeof import("vue"))["EffectScope"];
|
||||||
const computed: typeof import('vue')['computed']
|
const computed: (typeof import("vue"))["computed"];
|
||||||
const createApp: typeof import('vue')['createApp']
|
const createApp: (typeof import("vue"))["createApp"];
|
||||||
const customRef: typeof import('vue')['customRef']
|
const customRef: (typeof import("vue"))["customRef"];
|
||||||
const defineAsyncComponent: typeof import('vue')['defineAsyncComponent']
|
const defineAsyncComponent: (typeof import("vue"))["defineAsyncComponent"];
|
||||||
const defineComponent: typeof import('vue')['defineComponent']
|
const defineComponent: (typeof import("vue"))["defineComponent"];
|
||||||
const effectScope: typeof import('vue')['effectScope']
|
const effectScope: (typeof import("vue"))["effectScope"];
|
||||||
const getCurrentInstance: typeof import('vue')['getCurrentInstance']
|
const getCurrentInstance: (typeof import("vue"))["getCurrentInstance"];
|
||||||
const getCurrentScope: typeof import('vue')['getCurrentScope']
|
const getCurrentScope: (typeof import("vue"))["getCurrentScope"];
|
||||||
const h: typeof import('vue')['h']
|
const h: (typeof import("vue"))["h"];
|
||||||
const inject: typeof import('vue')['inject']
|
const inject: (typeof import("vue"))["inject"];
|
||||||
const isProxy: typeof import('vue')['isProxy']
|
const isProxy: (typeof import("vue"))["isProxy"];
|
||||||
const isReactive: typeof import('vue')['isReactive']
|
const isReactive: (typeof import("vue"))["isReactive"];
|
||||||
const isReadonly: typeof import('vue')['isReadonly']
|
const isReadonly: (typeof import("vue"))["isReadonly"];
|
||||||
const isRef: typeof import('vue')['isRef']
|
const isRef: (typeof import("vue"))["isRef"];
|
||||||
const markRaw: typeof import('vue')['markRaw']
|
const markRaw: (typeof import("vue"))["markRaw"];
|
||||||
const nextTick: typeof import('vue')['nextTick']
|
const nextTick: (typeof import("vue"))["nextTick"];
|
||||||
const onActivated: typeof import('vue')['onActivated']
|
const onActivated: (typeof import("vue"))["onActivated"];
|
||||||
const onBeforeMount: typeof import('vue')['onBeforeMount']
|
const onBeforeMount: (typeof import("vue"))["onBeforeMount"];
|
||||||
const onBeforeRouteLeave: (typeof import("vue-router"))["onBeforeRouteLeave"]
|
const onBeforeRouteLeave: (typeof import("vue-router"))["onBeforeRouteLeave"];
|
||||||
const onBeforeRouteUpdate: (typeof import("vue-router"))["onBeforeRouteUpdate"]
|
const onBeforeRouteUpdate: (typeof import("vue-router"))["onBeforeRouteUpdate"];
|
||||||
const onBeforeUnmount: typeof import('vue')['onBeforeUnmount']
|
const onBeforeUnmount: (typeof import("vue"))["onBeforeUnmount"];
|
||||||
const onBeforeUpdate: typeof import('vue')['onBeforeUpdate']
|
const onBeforeUpdate: (typeof import("vue"))["onBeforeUpdate"];
|
||||||
const onDeactivated: typeof import('vue')['onDeactivated']
|
const onDeactivated: (typeof import("vue"))["onDeactivated"];
|
||||||
const onErrorCaptured: typeof import('vue')['onErrorCaptured']
|
const onErrorCaptured: (typeof import("vue"))["onErrorCaptured"];
|
||||||
const onMounted: typeof import('vue')['onMounted']
|
const onMounted: (typeof import("vue"))["onMounted"];
|
||||||
const onRenderTracked: typeof import('vue')['onRenderTracked']
|
const onRenderTracked: (typeof import("vue"))["onRenderTracked"];
|
||||||
const onRenderTriggered: typeof import('vue')['onRenderTriggered']
|
const onRenderTriggered: (typeof import("vue"))["onRenderTriggered"];
|
||||||
const onScopeDispose: typeof import('vue')['onScopeDispose']
|
const onScopeDispose: (typeof import("vue"))["onScopeDispose"];
|
||||||
const onServerPrefetch: typeof import('vue')['onServerPrefetch']
|
const onServerPrefetch: (typeof import("vue"))["onServerPrefetch"];
|
||||||
const onUnmounted: typeof import('vue')['onUnmounted']
|
const onUnmounted: (typeof import("vue"))["onUnmounted"];
|
||||||
const onUpdated: typeof import('vue')['onUpdated']
|
const onUpdated: (typeof import("vue"))["onUpdated"];
|
||||||
const provide: typeof import('vue')['provide']
|
const provide: (typeof import("vue"))["provide"];
|
||||||
const reactive: typeof import('vue')['reactive']
|
const reactive: (typeof import("vue"))["reactive"];
|
||||||
const readonly: typeof import('vue')['readonly']
|
const readonly: (typeof import("vue"))["readonly"];
|
||||||
const ref: typeof import('vue')['ref']
|
const ref: (typeof import("vue"))["ref"];
|
||||||
const resolveComponent: typeof import('vue')['resolveComponent']
|
const resolveComponent: (typeof import("vue"))["resolveComponent"];
|
||||||
const shallowReactive: typeof import('vue')['shallowReactive']
|
const shallowReactive: (typeof import("vue"))["shallowReactive"];
|
||||||
const shallowReadonly: typeof import('vue')['shallowReadonly']
|
const shallowReadonly: (typeof import("vue"))["shallowReadonly"];
|
||||||
const shallowRef: typeof import('vue')['shallowRef']
|
const shallowRef: (typeof import("vue"))["shallowRef"];
|
||||||
const toRaw: typeof import('vue')['toRaw']
|
const toRaw: (typeof import("vue"))["toRaw"];
|
||||||
const toRef: typeof import('vue')['toRef']
|
const toRef: (typeof import("vue"))["toRef"];
|
||||||
const toRefs: typeof import('vue')['toRefs']
|
const toRefs: (typeof import("vue"))["toRefs"];
|
||||||
const toValue: typeof import('vue')['toValue']
|
const toValue: (typeof import("vue"))["toValue"];
|
||||||
const triggerRef: typeof import('vue')['triggerRef']
|
const triggerRef: (typeof import("vue"))["triggerRef"];
|
||||||
const unref: typeof import('vue')['unref']
|
const unref: (typeof import("vue"))["unref"];
|
||||||
const useAttrs: typeof import('vue')['useAttrs']
|
const useAttrs: (typeof import("vue"))["useAttrs"];
|
||||||
const useCssModule: typeof import('vue')['useCssModule']
|
const useCssModule: (typeof import("vue"))["useCssModule"];
|
||||||
const useCssVars: typeof import('vue')['useCssVars']
|
const useCssVars: (typeof import("vue"))["useCssVars"];
|
||||||
const useLink: (typeof import("vue-router"))["useLink"]
|
const useLink: (typeof import("vue-router"))["useLink"];
|
||||||
const useRoute: typeof import('vue-router/auto')['useRoute']
|
const useRoute: (typeof import("vue-router/auto"))["useRoute"];
|
||||||
const useRouter: typeof import('vue-router/auto')['useRouter']
|
const useRouter: (typeof import("vue-router/auto"))["useRouter"];
|
||||||
const useSlots: typeof import('vue')['useSlots']
|
const useSlots: (typeof import("vue"))["useSlots"];
|
||||||
const watch: typeof import('vue')['watch']
|
const watch: (typeof import("vue"))["watch"];
|
||||||
const watchEffect: typeof import('vue')['watchEffect']
|
const watchEffect: (typeof import("vue"))["watchEffect"];
|
||||||
const watchPostEffect: typeof import('vue')['watchPostEffect']
|
const watchPostEffect: (typeof import("vue"))["watchPostEffect"];
|
||||||
const watchSyncEffect: typeof import('vue')['watchSyncEffect']
|
const watchSyncEffect: (typeof import("vue"))["watchSyncEffect"];
|
||||||
}
|
}
|
||||||
// for type re-export
|
// for type re-export
|
||||||
declare global {
|
declare global {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
export type { Component, ComponentPublicInstance, ComputedRef, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, VNode, WritableComputedRef } from 'vue'
|
export type {
|
||||||
import('vue')
|
Component,
|
||||||
|
ComponentPublicInstance,
|
||||||
|
ComputedRef,
|
||||||
|
ExtractDefaultPropTypes,
|
||||||
|
ExtractPropTypes,
|
||||||
|
ExtractPublicPropTypes,
|
||||||
|
InjectionKey,
|
||||||
|
PropType,
|
||||||
|
Ref,
|
||||||
|
VNode,
|
||||||
|
WritableComputedRef,
|
||||||
|
} from "vue";
|
||||||
|
import("vue");
|
||||||
}
|
}
|
||||||
// for vue template auto import
|
// for vue template auto import
|
||||||
import { UnwrapRef } from 'vue'
|
import { UnwrapRef } from "vue";
|
||||||
declare module 'vue' {
|
declare module "vue" {
|
||||||
interface GlobalComponents {}
|
interface GlobalComponents {}
|
||||||
interface ComponentCustomProperties {
|
interface ComponentCustomProperties {
|
||||||
readonly EffectScope: UnwrapRef<typeof import('vue')['EffectScope']>
|
readonly EffectScope: UnwrapRef<(typeof import("vue"))["EffectScope"]>;
|
||||||
readonly computed: UnwrapRef<typeof import('vue')['computed']>
|
readonly computed: UnwrapRef<(typeof import("vue"))["computed"]>;
|
||||||
readonly createApp: UnwrapRef<typeof import('vue')['createApp']>
|
readonly createApp: UnwrapRef<(typeof import("vue"))["createApp"]>;
|
||||||
readonly customRef: UnwrapRef<typeof import('vue')['customRef']>
|
readonly customRef: UnwrapRef<(typeof import("vue"))["customRef"]>;
|
||||||
readonly defineAsyncComponent: UnwrapRef<typeof import('vue')['defineAsyncComponent']>
|
readonly defineAsyncComponent: UnwrapRef<
|
||||||
readonly defineComponent: UnwrapRef<typeof import('vue')['defineComponent']>
|
(typeof import("vue"))["defineAsyncComponent"]
|
||||||
readonly effectScope: UnwrapRef<typeof import('vue')['effectScope']>
|
>;
|
||||||
readonly getCurrentInstance: UnwrapRef<typeof import('vue')['getCurrentInstance']>
|
readonly defineComponent: UnwrapRef<
|
||||||
readonly getCurrentScope: UnwrapRef<typeof import('vue')['getCurrentScope']>
|
(typeof import("vue"))["defineComponent"]
|
||||||
readonly h: UnwrapRef<typeof import('vue')['h']>
|
>;
|
||||||
readonly inject: UnwrapRef<typeof import('vue')['inject']>
|
readonly effectScope: UnwrapRef<(typeof import("vue"))["effectScope"]>;
|
||||||
readonly isProxy: UnwrapRef<typeof import('vue')['isProxy']>
|
readonly getCurrentInstance: UnwrapRef<
|
||||||
readonly isReactive: UnwrapRef<typeof import('vue')['isReactive']>
|
(typeof import("vue"))["getCurrentInstance"]
|
||||||
readonly isReadonly: UnwrapRef<typeof import('vue')['isReadonly']>
|
>;
|
||||||
readonly isRef: UnwrapRef<typeof import('vue')['isRef']>
|
readonly getCurrentScope: UnwrapRef<
|
||||||
readonly markRaw: UnwrapRef<typeof import('vue')['markRaw']>
|
(typeof import("vue"))["getCurrentScope"]
|
||||||
readonly nextTick: UnwrapRef<typeof import('vue')['nextTick']>
|
>;
|
||||||
readonly onActivated: UnwrapRef<typeof import('vue')['onActivated']>
|
readonly h: UnwrapRef<(typeof import("vue"))["h"]>;
|
||||||
readonly onBeforeMount: UnwrapRef<typeof import('vue')['onBeforeMount']>
|
readonly inject: UnwrapRef<(typeof import("vue"))["inject"]>;
|
||||||
readonly onBeforeUnmount: UnwrapRef<typeof import('vue')['onBeforeUnmount']>
|
readonly isProxy: UnwrapRef<(typeof import("vue"))["isProxy"]>;
|
||||||
readonly onBeforeUpdate: UnwrapRef<typeof import('vue')['onBeforeUpdate']>
|
readonly isReactive: UnwrapRef<(typeof import("vue"))["isReactive"]>;
|
||||||
readonly onDeactivated: UnwrapRef<typeof import('vue')['onDeactivated']>
|
readonly isReadonly: UnwrapRef<(typeof import("vue"))["isReadonly"]>;
|
||||||
readonly onErrorCaptured: UnwrapRef<typeof import('vue')['onErrorCaptured']>
|
readonly isRef: UnwrapRef<(typeof import("vue"))["isRef"]>;
|
||||||
readonly onMounted: UnwrapRef<typeof import('vue')['onMounted']>
|
readonly markRaw: UnwrapRef<(typeof import("vue"))["markRaw"]>;
|
||||||
readonly onRenderTracked: UnwrapRef<typeof import('vue')['onRenderTracked']>
|
readonly nextTick: UnwrapRef<(typeof import("vue"))["nextTick"]>;
|
||||||
readonly onRenderTriggered: UnwrapRef<typeof import('vue')['onRenderTriggered']>
|
readonly onActivated: UnwrapRef<(typeof import("vue"))["onActivated"]>;
|
||||||
readonly onScopeDispose: UnwrapRef<typeof import('vue')['onScopeDispose']>
|
readonly onBeforeMount: UnwrapRef<(typeof import("vue"))["onBeforeMount"]>;
|
||||||
readonly onServerPrefetch: UnwrapRef<typeof import('vue')['onServerPrefetch']>
|
readonly onBeforeUnmount: UnwrapRef<
|
||||||
readonly onUnmounted: UnwrapRef<typeof import('vue')['onUnmounted']>
|
(typeof import("vue"))["onBeforeUnmount"]
|
||||||
readonly onUpdated: UnwrapRef<typeof import('vue')['onUpdated']>
|
>;
|
||||||
readonly provide: UnwrapRef<typeof import('vue')['provide']>
|
readonly onBeforeUpdate: UnwrapRef<
|
||||||
readonly reactive: UnwrapRef<typeof import('vue')['reactive']>
|
(typeof import("vue"))["onBeforeUpdate"]
|
||||||
readonly readonly: UnwrapRef<typeof import('vue')['readonly']>
|
>;
|
||||||
readonly ref: UnwrapRef<typeof import('vue')['ref']>
|
readonly onDeactivated: UnwrapRef<(typeof import("vue"))["onDeactivated"]>;
|
||||||
readonly resolveComponent: UnwrapRef<typeof import('vue')['resolveComponent']>
|
readonly onErrorCaptured: UnwrapRef<
|
||||||
readonly shallowReactive: UnwrapRef<typeof import('vue')['shallowReactive']>
|
(typeof import("vue"))["onErrorCaptured"]
|
||||||
readonly shallowReadonly: UnwrapRef<typeof import('vue')['shallowReadonly']>
|
>;
|
||||||
readonly shallowRef: UnwrapRef<typeof import('vue')['shallowRef']>
|
readonly onMounted: UnwrapRef<(typeof import("vue"))["onMounted"]>;
|
||||||
readonly toRaw: UnwrapRef<typeof import('vue')['toRaw']>
|
readonly onRenderTracked: UnwrapRef<
|
||||||
readonly toRef: UnwrapRef<typeof import('vue')['toRef']>
|
(typeof import("vue"))["onRenderTracked"]
|
||||||
readonly toRefs: UnwrapRef<typeof import('vue')['toRefs']>
|
>;
|
||||||
readonly toValue: UnwrapRef<typeof import('vue')['toValue']>
|
readonly onRenderTriggered: UnwrapRef<
|
||||||
readonly triggerRef: UnwrapRef<typeof import('vue')['triggerRef']>
|
(typeof import("vue"))["onRenderTriggered"]
|
||||||
readonly unref: UnwrapRef<typeof import('vue')['unref']>
|
>;
|
||||||
readonly useAttrs: UnwrapRef<typeof import('vue')['useAttrs']>
|
readonly onScopeDispose: UnwrapRef<
|
||||||
readonly useCssModule: UnwrapRef<typeof import('vue')['useCssModule']>
|
(typeof import("vue"))["onScopeDispose"]
|
||||||
readonly useCssVars: UnwrapRef<typeof import('vue')['useCssVars']>
|
>;
|
||||||
readonly useRoute: UnwrapRef<typeof import('vue-router/auto')['useRoute']>
|
readonly onServerPrefetch: UnwrapRef<
|
||||||
readonly useRouter: UnwrapRef<typeof import('vue-router/auto')['useRouter']>
|
(typeof import("vue"))["onServerPrefetch"]
|
||||||
readonly useSlots: UnwrapRef<typeof import('vue')['useSlots']>
|
>;
|
||||||
readonly watch: UnwrapRef<typeof import('vue')['watch']>
|
readonly onUnmounted: UnwrapRef<(typeof import("vue"))["onUnmounted"]>;
|
||||||
readonly watchEffect: UnwrapRef<typeof import('vue')['watchEffect']>
|
readonly onUpdated: UnwrapRef<(typeof import("vue"))["onUpdated"]>;
|
||||||
readonly watchPostEffect: UnwrapRef<typeof import('vue')['watchPostEffect']>
|
readonly provide: UnwrapRef<(typeof import("vue"))["provide"]>;
|
||||||
readonly watchSyncEffect: UnwrapRef<typeof import('vue')['watchSyncEffect']>
|
readonly reactive: UnwrapRef<(typeof import("vue"))["reactive"]>;
|
||||||
|
readonly readonly: UnwrapRef<(typeof import("vue"))["readonly"]>;
|
||||||
|
readonly ref: UnwrapRef<(typeof import("vue"))["ref"]>;
|
||||||
|
readonly resolveComponent: UnwrapRef<
|
||||||
|
(typeof import("vue"))["resolveComponent"]
|
||||||
|
>;
|
||||||
|
readonly shallowReactive: UnwrapRef<
|
||||||
|
(typeof import("vue"))["shallowReactive"]
|
||||||
|
>;
|
||||||
|
readonly shallowReadonly: UnwrapRef<
|
||||||
|
(typeof import("vue"))["shallowReadonly"]
|
||||||
|
>;
|
||||||
|
readonly shallowRef: UnwrapRef<(typeof import("vue"))["shallowRef"]>;
|
||||||
|
readonly toRaw: UnwrapRef<(typeof import("vue"))["toRaw"]>;
|
||||||
|
readonly toRef: UnwrapRef<(typeof import("vue"))["toRef"]>;
|
||||||
|
readonly toRefs: UnwrapRef<(typeof import("vue"))["toRefs"]>;
|
||||||
|
readonly toValue: UnwrapRef<(typeof import("vue"))["toValue"]>;
|
||||||
|
readonly triggerRef: UnwrapRef<(typeof import("vue"))["triggerRef"]>;
|
||||||
|
readonly unref: UnwrapRef<(typeof import("vue"))["unref"]>;
|
||||||
|
readonly useAttrs: UnwrapRef<(typeof import("vue"))["useAttrs"]>;
|
||||||
|
readonly useCssModule: UnwrapRef<(typeof import("vue"))["useCssModule"]>;
|
||||||
|
readonly useCssVars: UnwrapRef<(typeof import("vue"))["useCssVars"]>;
|
||||||
|
readonly useRoute: UnwrapRef<
|
||||||
|
(typeof import("vue-router/auto"))["useRoute"]
|
||||||
|
>;
|
||||||
|
readonly useRouter: UnwrapRef<
|
||||||
|
(typeof import("vue-router/auto"))["useRouter"]
|
||||||
|
>;
|
||||||
|
readonly useSlots: UnwrapRef<(typeof import("vue"))["useSlots"]>;
|
||||||
|
readonly watch: UnwrapRef<(typeof import("vue"))["watch"]>;
|
||||||
|
readonly watchEffect: UnwrapRef<(typeof import("vue"))["watchEffect"]>;
|
||||||
|
readonly watchPostEffect: UnwrapRef<
|
||||||
|
(typeof import("vue"))["watchPostEffect"]
|
||||||
|
>;
|
||||||
|
readonly watchSyncEffect: UnwrapRef<
|
||||||
|
(typeof import("vue"))["watchSyncEffect"]
|
||||||
|
>;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare module '@vue/runtime-core' {
|
declare module "@vue/runtime-core" {
|
||||||
interface GlobalComponents {}
|
interface GlobalComponents {}
|
||||||
interface ComponentCustomProperties {
|
interface ComponentCustomProperties {
|
||||||
readonly EffectScope: UnwrapRef<typeof import('vue')['EffectScope']>
|
readonly EffectScope: UnwrapRef<(typeof import("vue"))["EffectScope"]>;
|
||||||
readonly computed: UnwrapRef<typeof import('vue')['computed']>
|
readonly computed: UnwrapRef<(typeof import("vue"))["computed"]>;
|
||||||
readonly createApp: UnwrapRef<typeof import('vue')['createApp']>
|
readonly createApp: UnwrapRef<(typeof import("vue"))["createApp"]>;
|
||||||
readonly customRef: UnwrapRef<typeof import('vue')['customRef']>
|
readonly customRef: UnwrapRef<(typeof import("vue"))["customRef"]>;
|
||||||
readonly defineAsyncComponent: UnwrapRef<typeof import('vue')['defineAsyncComponent']>
|
readonly defineAsyncComponent: UnwrapRef<
|
||||||
readonly defineComponent: UnwrapRef<typeof import('vue')['defineComponent']>
|
(typeof import("vue"))["defineAsyncComponent"]
|
||||||
readonly effectScope: UnwrapRef<typeof import('vue')['effectScope']>
|
>;
|
||||||
readonly getCurrentInstance: UnwrapRef<typeof import('vue')['getCurrentInstance']>
|
readonly defineComponent: UnwrapRef<
|
||||||
readonly getCurrentScope: UnwrapRef<typeof import('vue')['getCurrentScope']>
|
(typeof import("vue"))["defineComponent"]
|
||||||
readonly h: UnwrapRef<typeof import('vue')['h']>
|
>;
|
||||||
readonly inject: UnwrapRef<typeof import('vue')['inject']>
|
readonly effectScope: UnwrapRef<(typeof import("vue"))["effectScope"]>;
|
||||||
readonly isProxy: UnwrapRef<typeof import('vue')['isProxy']>
|
readonly getCurrentInstance: UnwrapRef<
|
||||||
readonly isReactive: UnwrapRef<typeof import('vue')['isReactive']>
|
(typeof import("vue"))["getCurrentInstance"]
|
||||||
readonly isReadonly: UnwrapRef<typeof import('vue')['isReadonly']>
|
>;
|
||||||
readonly isRef: UnwrapRef<typeof import('vue')['isRef']>
|
readonly getCurrentScope: UnwrapRef<
|
||||||
readonly markRaw: UnwrapRef<typeof import('vue')['markRaw']>
|
(typeof import("vue"))["getCurrentScope"]
|
||||||
readonly nextTick: UnwrapRef<typeof import('vue')['nextTick']>
|
>;
|
||||||
readonly onActivated: UnwrapRef<typeof import('vue')['onActivated']>
|
readonly h: UnwrapRef<(typeof import("vue"))["h"]>;
|
||||||
readonly onBeforeMount: UnwrapRef<typeof import('vue')['onBeforeMount']>
|
readonly inject: UnwrapRef<(typeof import("vue"))["inject"]>;
|
||||||
readonly onBeforeUnmount: UnwrapRef<typeof import('vue')['onBeforeUnmount']>
|
readonly isProxy: UnwrapRef<(typeof import("vue"))["isProxy"]>;
|
||||||
readonly onBeforeUpdate: UnwrapRef<typeof import('vue')['onBeforeUpdate']>
|
readonly isReactive: UnwrapRef<(typeof import("vue"))["isReactive"]>;
|
||||||
readonly onDeactivated: UnwrapRef<typeof import('vue')['onDeactivated']>
|
readonly isReadonly: UnwrapRef<(typeof import("vue"))["isReadonly"]>;
|
||||||
readonly onErrorCaptured: UnwrapRef<typeof import('vue')['onErrorCaptured']>
|
readonly isRef: UnwrapRef<(typeof import("vue"))["isRef"]>;
|
||||||
readonly onMounted: UnwrapRef<typeof import('vue')['onMounted']>
|
readonly markRaw: UnwrapRef<(typeof import("vue"))["markRaw"]>;
|
||||||
readonly onRenderTracked: UnwrapRef<typeof import('vue')['onRenderTracked']>
|
readonly nextTick: UnwrapRef<(typeof import("vue"))["nextTick"]>;
|
||||||
readonly onRenderTriggered: UnwrapRef<typeof import('vue')['onRenderTriggered']>
|
readonly onActivated: UnwrapRef<(typeof import("vue"))["onActivated"]>;
|
||||||
readonly onScopeDispose: UnwrapRef<typeof import('vue')['onScopeDispose']>
|
readonly onBeforeMount: UnwrapRef<(typeof import("vue"))["onBeforeMount"]>;
|
||||||
readonly onServerPrefetch: UnwrapRef<typeof import('vue')['onServerPrefetch']>
|
readonly onBeforeUnmount: UnwrapRef<
|
||||||
readonly onUnmounted: UnwrapRef<typeof import('vue')['onUnmounted']>
|
(typeof import("vue"))["onBeforeUnmount"]
|
||||||
readonly onUpdated: UnwrapRef<typeof import('vue')['onUpdated']>
|
>;
|
||||||
readonly provide: UnwrapRef<typeof import('vue')['provide']>
|
readonly onBeforeUpdate: UnwrapRef<
|
||||||
readonly reactive: UnwrapRef<typeof import('vue')['reactive']>
|
(typeof import("vue"))["onBeforeUpdate"]
|
||||||
readonly readonly: UnwrapRef<typeof import('vue')['readonly']>
|
>;
|
||||||
readonly ref: UnwrapRef<typeof import('vue')['ref']>
|
readonly onDeactivated: UnwrapRef<(typeof import("vue"))["onDeactivated"]>;
|
||||||
readonly resolveComponent: UnwrapRef<typeof import('vue')['resolveComponent']>
|
readonly onErrorCaptured: UnwrapRef<
|
||||||
readonly shallowReactive: UnwrapRef<typeof import('vue')['shallowReactive']>
|
(typeof import("vue"))["onErrorCaptured"]
|
||||||
readonly shallowReadonly: UnwrapRef<typeof import('vue')['shallowReadonly']>
|
>;
|
||||||
readonly shallowRef: UnwrapRef<typeof import('vue')['shallowRef']>
|
readonly onMounted: UnwrapRef<(typeof import("vue"))["onMounted"]>;
|
||||||
readonly toRaw: UnwrapRef<typeof import('vue')['toRaw']>
|
readonly onRenderTracked: UnwrapRef<
|
||||||
readonly toRef: UnwrapRef<typeof import('vue')['toRef']>
|
(typeof import("vue"))["onRenderTracked"]
|
||||||
readonly toRefs: UnwrapRef<typeof import('vue')['toRefs']>
|
>;
|
||||||
readonly toValue: UnwrapRef<typeof import('vue')['toValue']>
|
readonly onRenderTriggered: UnwrapRef<
|
||||||
readonly triggerRef: UnwrapRef<typeof import('vue')['triggerRef']>
|
(typeof import("vue"))["onRenderTriggered"]
|
||||||
readonly unref: UnwrapRef<typeof import('vue')['unref']>
|
>;
|
||||||
readonly useAttrs: UnwrapRef<typeof import('vue')['useAttrs']>
|
readonly onScopeDispose: UnwrapRef<
|
||||||
readonly useCssModule: UnwrapRef<typeof import('vue')['useCssModule']>
|
(typeof import("vue"))["onScopeDispose"]
|
||||||
readonly useCssVars: UnwrapRef<typeof import('vue')['useCssVars']>
|
>;
|
||||||
readonly useRoute: UnwrapRef<typeof import('vue-router/auto')['useRoute']>
|
readonly onServerPrefetch: UnwrapRef<
|
||||||
readonly useRouter: UnwrapRef<typeof import('vue-router/auto')['useRouter']>
|
(typeof import("vue"))["onServerPrefetch"]
|
||||||
readonly useSlots: UnwrapRef<typeof import('vue')['useSlots']>
|
>;
|
||||||
readonly watch: UnwrapRef<typeof import('vue')['watch']>
|
readonly onUnmounted: UnwrapRef<(typeof import("vue"))["onUnmounted"]>;
|
||||||
readonly watchEffect: UnwrapRef<typeof import('vue')['watchEffect']>
|
readonly onUpdated: UnwrapRef<(typeof import("vue"))["onUpdated"]>;
|
||||||
readonly watchPostEffect: UnwrapRef<typeof import('vue')['watchPostEffect']>
|
readonly provide: UnwrapRef<(typeof import("vue"))["provide"]>;
|
||||||
readonly watchSyncEffect: UnwrapRef<typeof import('vue')['watchSyncEffect']>
|
readonly reactive: UnwrapRef<(typeof import("vue"))["reactive"]>;
|
||||||
|
readonly readonly: UnwrapRef<(typeof import("vue"))["readonly"]>;
|
||||||
|
readonly ref: UnwrapRef<(typeof import("vue"))["ref"]>;
|
||||||
|
readonly resolveComponent: UnwrapRef<
|
||||||
|
(typeof import("vue"))["resolveComponent"]
|
||||||
|
>;
|
||||||
|
readonly shallowReactive: UnwrapRef<
|
||||||
|
(typeof import("vue"))["shallowReactive"]
|
||||||
|
>;
|
||||||
|
readonly shallowReadonly: UnwrapRef<
|
||||||
|
(typeof import("vue"))["shallowReadonly"]
|
||||||
|
>;
|
||||||
|
readonly shallowRef: UnwrapRef<(typeof import("vue"))["shallowRef"]>;
|
||||||
|
readonly toRaw: UnwrapRef<(typeof import("vue"))["toRaw"]>;
|
||||||
|
readonly toRef: UnwrapRef<(typeof import("vue"))["toRef"]>;
|
||||||
|
readonly toRefs: UnwrapRef<(typeof import("vue"))["toRefs"]>;
|
||||||
|
readonly toValue: UnwrapRef<(typeof import("vue"))["toValue"]>;
|
||||||
|
readonly triggerRef: UnwrapRef<(typeof import("vue"))["triggerRef"]>;
|
||||||
|
readonly unref: UnwrapRef<(typeof import("vue"))["unref"]>;
|
||||||
|
readonly useAttrs: UnwrapRef<(typeof import("vue"))["useAttrs"]>;
|
||||||
|
readonly useCssModule: UnwrapRef<(typeof import("vue"))["useCssModule"]>;
|
||||||
|
readonly useCssVars: UnwrapRef<(typeof import("vue"))["useCssVars"]>;
|
||||||
|
readonly useRoute: UnwrapRef<
|
||||||
|
(typeof import("vue-router/auto"))["useRoute"]
|
||||||
|
>;
|
||||||
|
readonly useRouter: UnwrapRef<
|
||||||
|
(typeof import("vue-router/auto"))["useRouter"]
|
||||||
|
>;
|
||||||
|
readonly useSlots: UnwrapRef<(typeof import("vue"))["useSlots"]>;
|
||||||
|
readonly watch: UnwrapRef<(typeof import("vue"))["watch"]>;
|
||||||
|
readonly watchEffect: UnwrapRef<(typeof import("vue"))["watchEffect"]>;
|
||||||
|
readonly watchPostEffect: UnwrapRef<
|
||||||
|
(typeof import("vue"))["watchPostEffect"]
|
||||||
|
>;
|
||||||
|
readonly watchSyncEffect: UnwrapRef<
|
||||||
|
(typeof import("vue"))["watchSyncEffect"]
|
||||||
|
>;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
2
src/components.d.ts
vendored
2
src/components.d.ts
vendored
@ -2,7 +2,7 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
// Generated by unplugin-vue-components
|
// Generated by unplugin-vue-components
|
||||||
// Read more: https://github.com/vuejs/core/pull/3399
|
// Read more: https://github.com/vuejs/core/pull/3399
|
||||||
export {}
|
export {};
|
||||||
|
|
||||||
/* prettier-ignore */
|
/* prettier-ignore */
|
||||||
declare module 'vue' {
|
declare module 'vue' {
|
||||||
|
@ -3,7 +3,11 @@
|
|||||||
<v-navigation-drawer v-model="appStore.navigation_drawer">
|
<v-navigation-drawer v-model="appStore.navigation_drawer">
|
||||||
<div class="pa-2">
|
<div class="pa-2">
|
||||||
<v-btn-group rounded="lg">
|
<v-btn-group rounded="lg">
|
||||||
<v-btn density="default" icon="mdi-close" @click="appStore.navigation_drawer = !appStore.navigation_drawer" />
|
<v-btn
|
||||||
|
density="default"
|
||||||
|
icon="mdi-close"
|
||||||
|
@click="appStore.navigation_drawer = !appStore.navigation_drawer"
|
||||||
|
/>
|
||||||
|
|
||||||
<v-btn density="default" icon="mdi-plus" title="创建助理" />
|
<v-btn density="default" icon="mdi-plus" title="创建助理" />
|
||||||
</v-btn-group>
|
</v-btn-group>
|
||||||
@ -13,47 +17,66 @@
|
|||||||
|
|
||||||
<v-list density="compact" nav>
|
<v-list density="compact" nav>
|
||||||
<template v-for="item in appStore.navigation_items">
|
<template v-for="item in appStore.navigation_items">
|
||||||
<v-list-item :prepend-icon="item.icon" rounded="lg" :title="item.text" :to="item.to" />
|
<v-list-item
|
||||||
|
:prepend-icon="item.icon"
|
||||||
|
rounded="lg"
|
||||||
|
:title="item.text"
|
||||||
|
:to="item.to"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<v-list-item
|
||||||
|
v-show="!userStore.logined"
|
||||||
|
prepend-icon="mdi-account"
|
||||||
|
rounded="xl"
|
||||||
|
title="登录"
|
||||||
|
to="/auth/login"
|
||||||
|
/>
|
||||||
|
|
||||||
<v-list-item v-show="!userStore.logined" prepend-icon="mdi-account" rounded="xl" title="登录" to="/auth/login" />
|
<template
|
||||||
|
v-if="chats.data != null"
|
||||||
<template v-if="chats.data != null" v-for="chat in chats.data" :key="chat.id">
|
v-for="chat in chats.data"
|
||||||
<v-list-item prepend-icon="mdi-chat" rounded="lg" :title="chat?.name" :to="'/chats/' + chat.id" />
|
:key="chat.id"
|
||||||
|
>
|
||||||
|
<v-list-item
|
||||||
|
prepend-icon="mdi-chat"
|
||||||
|
rounded="lg"
|
||||||
|
:title="chat?.name"
|
||||||
|
:to="'/chats/' + chat.id"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
</v-list>
|
</v-list>
|
||||||
</v-navigation-drawer>
|
</v-navigation-drawer>
|
||||||
|
|
||||||
<v-app-bar>
|
<v-app-bar>
|
||||||
<v-app-bar-nav-icon @click="appStore.navigation_drawer = !appStore.navigation_drawer" />
|
<v-app-bar-nav-icon
|
||||||
|
@click="appStore.navigation_drawer = !appStore.navigation_drawer"
|
||||||
|
/>
|
||||||
|
|
||||||
<v-app-bar-title>{{ configStore.app_name }}</v-app-bar-title>
|
<v-app-bar-title>{{ configStore.app_name }}</v-app-bar-title>
|
||||||
</v-app-bar>
|
</v-app-bar>
|
||||||
<!-- </v-app> -->
|
<!-- </v-app> -->
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { useConfigStore } from "@/stores/config"
|
import { useConfigStore } from "@/stores/config";
|
||||||
import { useUserStore } from "@/stores/user"
|
import { useUserStore } from "@/stores/user";
|
||||||
import { useAppStore } from "@/stores/app"
|
import { useAppStore } from "@/stores/app";
|
||||||
import { useChatStore } from "@/stores/chat"
|
import { useChatStore } from "@/stores/chat";
|
||||||
import { computed } from "vue"
|
import { computed } from "vue";
|
||||||
import { ApiV1ChatsGet200Response } from "@/api"
|
import { ApiV1ChatsGet200Response } from "@/api";
|
||||||
|
|
||||||
|
const chatStore = useChatStore();
|
||||||
const chatStore = useChatStore()
|
const configStore = useConfigStore();
|
||||||
const configStore = useConfigStore()
|
const userStore = useUserStore();
|
||||||
const userStore = useUserStore()
|
const appStore = useAppStore();
|
||||||
const appStore = useAppStore()
|
|
||||||
|
|
||||||
const chats = computed<ApiV1ChatsGet200Response>(() => {
|
const chats = computed<ApiV1ChatsGet200Response>(() => {
|
||||||
return chatStore.chats
|
return chatStore.chats;
|
||||||
})
|
});
|
||||||
chatStore.getChats()
|
chatStore.getChats();
|
||||||
|
|
||||||
// 恼
|
// 恼
|
||||||
// setInterval(() => {
|
// setInterval(() => {
|
||||||
// chats.value.data = chatStore.chats.data
|
// chats.value.data = chatStore.chats.data
|
||||||
// }, 10 * 1000)
|
// }, 10 * 1000)
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,81 +1,81 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<h3>助理 {{ assistant.data?.name }}</h3>
|
<h3>助理 {{ assistant.data?.name }}</h3>
|
||||||
<v-btn @click="dialog = true">创建聊天</v-btn>
|
<v-btn @click="dialog = true">创建聊天</v-btn>
|
||||||
<div class="mt-3">
|
<div class="mt-3">
|
||||||
<v-slide-y-transition group tag="v-list">
|
<v-slide-y-transition group tag="v-list">
|
||||||
<v-list-item v-for="chat in chats.data" :key="chat.id">
|
<v-list-item v-for="chat in chats.data" :key="chat.id">
|
||||||
<template v-slot:prepend>
|
<template v-slot:prepend>
|
||||||
<v-avatar>
|
<v-avatar>
|
||||||
<v-icon>mdi-account</v-icon>
|
<v-icon>mdi-account</v-icon>
|
||||||
</v-avatar>
|
</v-avatar>
|
||||||
</template>
|
</template>
|
||||||
<v-list-item-title>{{ chat.name }}</v-list-item-title>
|
<v-list-item-title>{{ chat.name }}</v-list-item-title>
|
||||||
<v-list-item-subtitle>{{ chat.created_at }}</v-list-item-subtitle>
|
<v-list-item-subtitle>{{ chat.created_at }}</v-list-item-subtitle>
|
||||||
</v-list-item>
|
</v-list-item>
|
||||||
</v-slide-y-transition>
|
</v-slide-y-transition>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<v-dialog v-model="dialog" max-width="500px">
|
<v-dialog v-model="dialog" max-width="500px">
|
||||||
<v-card>
|
<v-card>
|
||||||
<v-card-title>创建聊天</v-card-title>
|
<v-card-title>创建聊天</v-card-title>
|
||||||
<v-card-text>
|
<v-card-text>
|
||||||
<v-text-field v-model="chat.name" label="聊天名称" />
|
<v-text-field v-model="chat.name" label="聊天名称" />
|
||||||
</v-card-text>
|
</v-card-text>
|
||||||
<v-card-actions>
|
<v-card-actions>
|
||||||
<v-spacer />
|
<v-spacer />
|
||||||
<v-btn @click="dialog = false">取消</v-btn>
|
<v-btn @click="dialog = false">取消</v-btn>
|
||||||
<v-btn color="primary" @click="createChat">创建</v-btn>
|
<v-btn color="primary" @click="createChat">创建</v-btn>
|
||||||
</v-card-actions>
|
</v-card-actions>
|
||||||
</v-card>
|
</v-card>
|
||||||
</v-dialog>
|
</v-dialog>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from "vue"
|
import { ref } from "vue";
|
||||||
import { api } from "@/plugins/api"
|
import { api } from "@/plugins/api";
|
||||||
import { ApiV1AssistantsPost200Response, ApiV1ChatsGet200Response, RagNewInternalSchemaChatCreateRequest } from "@/api"
|
import {
|
||||||
import router from "@/router"
|
ApiV1AssistantsPost200Response,
|
||||||
import { useChatStore } from '../../../stores/chat'
|
ApiV1ChatsGet200Response,
|
||||||
|
RagNewInternalSchemaChatCreateRequest,
|
||||||
|
} from "@/api";
|
||||||
|
import router from "@/router";
|
||||||
|
import { useChatStore } from "../../../stores/chat";
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
const assistantId = router.currentRoute.value.params.id as number
|
const assistantId = router.currentRoute.value.params.id as number;
|
||||||
const assistant: Ref<ApiV1AssistantsPost200Response> = ref({})
|
const assistant: Ref<ApiV1AssistantsPost200Response> = ref({});
|
||||||
const chats = ref<ApiV1ChatsGet200Response>({})
|
const chats = ref<ApiV1ChatsGet200Response>({});
|
||||||
|
|
||||||
const dialog = ref(false)
|
const dialog = ref(false);
|
||||||
const chat: Ref<RagNewInternalSchemaChatCreateRequest> = ref({
|
const chat: Ref<RagNewInternalSchemaChatCreateRequest> = ref({
|
||||||
name: '',
|
name: "",
|
||||||
assistant_id: parseInt(assistantId.toString()),
|
assistant_id: parseInt(assistantId.toString()),
|
||||||
})
|
});
|
||||||
|
|
||||||
const chatStore = useChatStore()
|
const chatStore = useChatStore();
|
||||||
|
|
||||||
function getAssistant() {
|
function getAssistant() {
|
||||||
api.Assistant.apiV1AssistantsIdGet(assistantId).then((res) => {
|
api.Assistant.apiV1AssistantsIdGet(assistantId).then((res) => {
|
||||||
assistant.value = res.data
|
assistant.value = res.data;
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function getChats() {
|
function getChats() {
|
||||||
api.Chat.apiV1ChatsGet(assistantId).then((res) => {
|
api.Chat.apiV1ChatsGet(assistantId).then((res) => {
|
||||||
chats.value = res.data
|
chats.value = res.data;
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function createChat() {
|
function createChat() {
|
||||||
api.Chat.apiV1ChatsPost(chat.value).then((res) => {
|
api.Chat.apiV1ChatsPost(chat.value).then((res) => {
|
||||||
getChats()
|
getChats();
|
||||||
dialog.value = false
|
dialog.value = false;
|
||||||
})
|
});
|
||||||
|
|
||||||
chatStore.getChats()
|
|
||||||
|
|
||||||
|
chatStore.getChats();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getAssistant();
|
||||||
getAssistant()
|
getChats();
|
||||||
getChats()
|
</script>
|
||||||
|
|
||||||
</script>
|
|
||||||
|
@ -1,12 +1,20 @@
|
|||||||
<template>
|
<template>
|
||||||
<h3>你创建的助理</h3>
|
<h3>你创建的助理</h3>
|
||||||
|
|
||||||
<v-btn color="primary" class="mt-3 mb-3" @click="to('/assistants/create')">创建助理</v-btn>
|
<v-btn color="primary" class="mt-3 mb-3" @click="to('/assistants/create')"
|
||||||
|
>创建助理</v-btn
|
||||||
|
>
|
||||||
|
|
||||||
<div class="mt-3">
|
<div class="mt-3">
|
||||||
<v-row>
|
<v-row>
|
||||||
<v-slide-x-transition group>
|
<v-slide-x-transition group>
|
||||||
<v-col v-for="assistant in assistants.data" :key="assistant.id" cols="12" md="4" sm="6">
|
<v-col
|
||||||
|
v-for="assistant in assistants.data"
|
||||||
|
:key="assistant.id"
|
||||||
|
cols="12"
|
||||||
|
md="4"
|
||||||
|
sm="6"
|
||||||
|
>
|
||||||
<v-card>
|
<v-card>
|
||||||
<v-card-title>{{ assistant.name }}</v-card-title>
|
<v-card-title>{{ assistant.name }}</v-card-title>
|
||||||
<v-card-text>
|
<v-card-text>
|
||||||
@ -18,8 +26,12 @@
|
|||||||
对话
|
对话
|
||||||
</v-btn>
|
</v-btn>
|
||||||
|
|
||||||
<v-btn color="primary" @click="editTool(assistant.id ?? 0)">工具</v-btn>
|
<v-btn color="primary" @click="editTool(assistant.id ?? 0)"
|
||||||
<v-btn color="error" @click="deleteAssistant(assistant.id ?? 0)">删除</v-btn>
|
>工具</v-btn
|
||||||
|
>
|
||||||
|
<v-btn color="error" @click="deleteAssistant(assistant.id ?? 0)"
|
||||||
|
>删除</v-btn
|
||||||
|
>
|
||||||
</v-card-actions>
|
</v-card-actions>
|
||||||
</v-card>
|
</v-card>
|
||||||
</v-col>
|
</v-col>
|
||||||
@ -34,7 +46,9 @@
|
|||||||
<v-card-actions>
|
<v-card-actions>
|
||||||
<v-spacer></v-spacer>
|
<v-spacer></v-spacer>
|
||||||
<v-btn color="green darken-1" @click="dialog = false">取消</v-btn>
|
<v-btn color="green darken-1" @click="dialog = false">取消</v-btn>
|
||||||
<v-btn color="red darken-1" @click="deleteAssistantConfirmed">删除</v-btn>
|
<v-btn color="red darken-1" @click="deleteAssistantConfirmed"
|
||||||
|
>删除</v-btn
|
||||||
|
>
|
||||||
</v-card-actions>
|
</v-card-actions>
|
||||||
</v-card>
|
</v-card>
|
||||||
</v-dialog>
|
</v-dialog>
|
||||||
@ -45,62 +59,63 @@
|
|||||||
<v-card-text>{{ deleteResult.message }}</v-card-text>
|
<v-card-text>{{ deleteResult.message }}</v-card-text>
|
||||||
<v-card-actions>
|
<v-card-actions>
|
||||||
<v-spacer></v-spacer>
|
<v-spacer></v-spacer>
|
||||||
<v-btn color="green darken-1" @click="deleteResult.show = false">确定</v-btn>
|
<v-btn color="green darken-1" @click="deleteResult.show = false"
|
||||||
|
>确定</v-btn
|
||||||
|
>
|
||||||
</v-card-actions>
|
</v-card-actions>
|
||||||
</v-card>
|
</v-card>
|
||||||
</v-dialog>
|
</v-dialog>
|
||||||
|
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ApiV1AssistantsGet200Response } from "@/api"
|
import { ApiV1AssistantsGet200Response } from "@/api";
|
||||||
import { api } from "@/plugins/api"
|
import { api } from "@/plugins/api";
|
||||||
import router from "@/router"
|
import router from "@/router";
|
||||||
|
|
||||||
const assistants: Ref<ApiV1AssistantsGet200Response> = ref({})
|
const assistants: Ref<ApiV1AssistantsGet200Response> = ref({});
|
||||||
|
|
||||||
function refresh() {
|
function refresh() {
|
||||||
api.Assistant.apiV1AssistantsGet().then((res) => {
|
api.Assistant.apiV1AssistantsGet().then((res) => {
|
||||||
assistants.value = res.data
|
assistants.value = res.data;
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
refresh()
|
refresh();
|
||||||
|
|
||||||
const dialog = ref(false)
|
const dialog = ref(false);
|
||||||
const selectedAssistantId = ref(0)
|
const selectedAssistantId = ref(0);
|
||||||
const deleteResult = ref({
|
const deleteResult = ref({
|
||||||
show: false,
|
show: false,
|
||||||
message: "",
|
message: "",
|
||||||
})
|
});
|
||||||
|
|
||||||
function deleteAssistant(assistantId: number) {
|
function deleteAssistant(assistantId: number) {
|
||||||
selectedAssistantId.value = assistantId
|
selectedAssistantId.value = assistantId;
|
||||||
dialog.value = true
|
dialog.value = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function deleteAssistantConfirmed() {
|
function deleteAssistantConfirmed() {
|
||||||
api.Assistant.apiV1AssistantsIdDelete(selectedAssistantId.value).then(() => {
|
api.Assistant.apiV1AssistantsIdDelete(selectedAssistantId.value)
|
||||||
deleteResult.value.message = "正在批量删除与该助理关联的数据,可能需要一段时间才会从列表中消失"
|
.then(() => {
|
||||||
|
deleteResult.value.message =
|
||||||
}).catch((r) => {
|
"正在批量删除与该助理关联的数据,可能需要一段时间才会从列表中消失";
|
||||||
deleteResult.value.message = r.response.data.error
|
})
|
||||||
})
|
.catch((r) => {
|
||||||
dialog.value = false
|
deleteResult.value.message = r.response.data.error;
|
||||||
deleteResult.value.show = true
|
});
|
||||||
refresh()
|
dialog.value = false;
|
||||||
|
deleteResult.value.show = true;
|
||||||
|
refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
function editTool(assistantId: number) {
|
function editTool(assistantId: number) {
|
||||||
router.push(`/assistants/${assistantId}/tools`)
|
router.push(`/assistants/${assistantId}/tools`);
|
||||||
}
|
}
|
||||||
|
|
||||||
function showChats(assistantId: number) {
|
function showChats(assistantId: number) {
|
||||||
router.push(`/assistants/${assistantId}/chats`)
|
router.push(`/assistants/${assistantId}/chats`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function to(path: string) {
|
function to(path: string) {
|
||||||
router.push(path)
|
router.push(path);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -2,20 +2,18 @@
|
|||||||
<div>
|
<div>
|
||||||
<h3 class="mb-3">聊天记录</h3>
|
<h3 class="mb-3">聊天记录</h3>
|
||||||
|
|
||||||
|
<v-card
|
||||||
<v-card class="mx-auto mt-3 " width="100%" v-for="message in messages.data" :key="message.id">
|
class="mx-auto mt-3"
|
||||||
|
width="100%"
|
||||||
|
v-for="message in messages.data"
|
||||||
|
:key="message.id"
|
||||||
|
>
|
||||||
<template v-slot:title>
|
<template v-slot:title>
|
||||||
<span class="font-weight-black">
|
<span class="font-weight-black">
|
||||||
<span v-if="message.role == 'assistant'">
|
<span v-if="message.role == 'assistant'"> AI </span>
|
||||||
AI
|
<span v-else-if="message.role == 'system'"> 系统 </span>
|
||||||
</span>
|
|
||||||
<span v-else-if="message.role == 'system'">
|
|
||||||
系统
|
|
||||||
</span>
|
|
||||||
|
|
||||||
<span v-else-if="message.role == 'user'">
|
<span v-else-if="message.role == 'user'"> 用户 </span>
|
||||||
用户
|
|
||||||
</span>
|
|
||||||
|
|
||||||
<span v-else>
|
<span v-else>
|
||||||
{{ message.role }}
|
{{ message.role }}
|
||||||
@ -31,122 +29,124 @@
|
|||||||
|
|
||||||
<div class="mt-3">
|
<div class="mt-3">
|
||||||
<div v-show="toolName != ''">
|
<div v-show="toolName != ''">
|
||||||
<v-progress-circular :size="16" color="primary" indeterminate></v-progress-circular>
|
<v-progress-circular
|
||||||
|
:size="16"
|
||||||
|
color="primary"
|
||||||
|
indeterminate
|
||||||
|
></v-progress-circular>
|
||||||
{{ toolName }}
|
{{ toolName }}
|
||||||
</div>
|
</div>
|
||||||
<v-text-field v-model="input" label="输入消息" @keyup.enter="sendMessage"></v-text-field>
|
<v-text-field
|
||||||
|
v-model="input"
|
||||||
|
label="输入消息"
|
||||||
|
@keyup.enter="sendMessage"
|
||||||
|
></v-text-field>
|
||||||
<v-btn color="primary" @click="sendMessage">发送</v-btn>
|
<v-btn color="primary" @click="sendMessage">发送</v-btn>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ApiV1ChatsIdMessagesGet200Response } from "@/api"
|
import { ApiV1ChatsIdMessagesGet200Response } from "@/api";
|
||||||
import { ref } from "vue"
|
import { ref } from "vue";
|
||||||
import { api, conf } from "@/plugins/api"
|
import { api, conf } from "@/plugins/api";
|
||||||
import VueMarkdown from 'vue-markdown-render'
|
import VueMarkdown from "vue-markdown-render";
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
const chatId = parseInt(useRoute().params.id as string)
|
const chatId = parseInt(useRoute().params.id as string);
|
||||||
|
|
||||||
const messages: Ref<ApiV1ChatsIdMessagesGet200Response> = ref({
|
const messages: Ref<ApiV1ChatsIdMessagesGet200Response> = ref({
|
||||||
data: []
|
data: [],
|
||||||
})
|
});
|
||||||
const input = ref("")
|
const input = ref("");
|
||||||
const toolName = ref("")
|
const toolName = ref("");
|
||||||
|
|
||||||
function sendMessage() {
|
function sendMessage() {
|
||||||
if (input.value != "") {
|
if (input.value != "") {
|
||||||
api.ChatMessage.apiV1ChatsIdMessagesPost(chatId, {
|
api.ChatMessage.apiV1ChatsIdMessagesPost(chatId, {
|
||||||
message: input.value
|
message: input.value,
|
||||||
}).then((res) => {
|
})
|
||||||
const newMessage = {
|
.then((res) => {
|
||||||
content: input.value,
|
const newMessage = {
|
||||||
role: "user",
|
content: input.value,
|
||||||
}
|
role: "user",
|
||||||
|
};
|
||||||
|
|
||||||
if (messages.value.data == null) {
|
if (messages.value.data == null) {
|
||||||
messages.value.data = [newMessage]
|
messages.value.data = [newMessage];
|
||||||
} else {
|
} else {
|
||||||
messages.value.data?.push(newMessage)
|
messages.value.data?.push(newMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const streamId = res.data.data?.stream_id;
|
||||||
const streamId = res.data.data?.stream_id
|
|
||||||
|
|
||||||
if (streamId) {
|
|
||||||
streamChat(streamId)
|
|
||||||
}
|
|
||||||
}).catch((err) => {
|
|
||||||
// if 409
|
|
||||||
if (err.response.status == 409) {
|
|
||||||
const streamId = err.response.data.data?.stream_id
|
|
||||||
|
|
||||||
if (streamId) {
|
if (streamId) {
|
||||||
streamChat(streamId)
|
streamChat(streamId);
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
})
|
.catch((err) => {
|
||||||
|
// if 409
|
||||||
|
if (err.response.status == 409) {
|
||||||
|
const streamId = err.response.data.data?.stream_id;
|
||||||
|
|
||||||
|
if (streamId) {
|
||||||
|
streamChat(streamId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function streamChat(streamId: String) {
|
function streamChat(streamId: String) {
|
||||||
const url = conf.basePath + "/api/v1/stream/" + streamId
|
const url = conf.basePath + "/api/v1/stream/" + streamId;
|
||||||
|
|
||||||
const evtSource = new EventSource(url)
|
const evtSource = new EventSource(url);
|
||||||
|
|
||||||
const newMessage = {
|
const newMessage = {
|
||||||
content: "",
|
content: "",
|
||||||
role: "assistant",
|
role: "assistant",
|
||||||
}
|
};
|
||||||
|
|
||||||
if (messages.value.data == null) {
|
if (messages.value.data == null) {
|
||||||
messages.value.data = [newMessage]
|
messages.value.data = [newMessage];
|
||||||
} else {
|
} else {
|
||||||
// add to messages
|
// add to messages
|
||||||
messages.value.data?.push(newMessage)
|
messages.value.data?.push(newMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 滚动页面到最底部
|
// 滚动页面到最底部
|
||||||
window.scrollTo(0, document.body.scrollHeight)
|
window.scrollTo(0, document.body.scrollHeight);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// set index
|
// set index
|
||||||
let i = (messages.value.data?.length ?? 1) - 1
|
let i = (messages.value.data?.length ?? 1) - 1;
|
||||||
console.log(i)
|
console.log(i);
|
||||||
|
|
||||||
evtSource.addEventListener("data", (e) => {
|
evtSource.addEventListener("data", (e) => {
|
||||||
const data = JSON.parse(e.data)
|
const data = JSON.parse(e.data);
|
||||||
|
|
||||||
if (data.state == "tool_calling") {
|
if (data.state == "tool_calling") {
|
||||||
toolName.value = data.tool_call_message.name
|
toolName.value = data.tool_call_message.name;
|
||||||
} else if (data.state == "tool_response") {
|
} else if (data.state == "tool_response") {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
toolName.value = ""
|
toolName.value = "";
|
||||||
|
}, 300);
|
||||||
}, 300)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
messages.value.data[i].content += data.content
|
messages.value.data[i].content += data.content;
|
||||||
|
});
|
||||||
})
|
|
||||||
|
|
||||||
// close
|
// close
|
||||||
evtSource.addEventListener("close", (e) => {
|
evtSource.addEventListener("close", (e) => {
|
||||||
evtSource.close()
|
evtSource.close();
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let getMessages = () => {
|
let getMessages = () => {
|
||||||
api.ChatMessage.apiV1ChatsIdMessagesGet(chatId).then((res) => {
|
api.ChatMessage.apiV1ChatsIdMessagesGet(chatId).then((res) => {
|
||||||
messages.value = res.data
|
messages.value = res.data;
|
||||||
})
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
getMessages()
|
getMessages();
|
||||||
|
</script>
|
||||||
</script>
|
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<h3>工具</h3>
|
<h3>工具</h3>
|
||||||
|
|
||||||
<v-btn color="primary" @click="to('/tools/create')" class="mt-3 mb-3">创建工具</v-btn>
|
<v-btn color="primary" @click="to('/tools/create')" class="mt-3 mb-3"
|
||||||
|
>创建工具</v-btn
|
||||||
|
>
|
||||||
|
|
||||||
<div class="mt-3">
|
<div class="mt-3">
|
||||||
<v-row>
|
<v-row>
|
||||||
@ -52,7 +54,9 @@
|
|||||||
<v-card-text>{{ failedDialog.message }}</v-card-text>
|
<v-card-text>{{ failedDialog.message }}</v-card-text>
|
||||||
<v-card-actions>
|
<v-card-actions>
|
||||||
<v-spacer></v-spacer>
|
<v-spacer></v-spacer>
|
||||||
<v-btn color="green darken-1" @click="failedDialog.show = false">关闭</v-btn>
|
<v-btn color="green darken-1" @click="failedDialog.show = false"
|
||||||
|
>关闭</v-btn
|
||||||
|
>
|
||||||
</v-card-actions>
|
</v-card-actions>
|
||||||
</v-card>
|
</v-card>
|
||||||
</v-dialog>
|
</v-dialog>
|
||||||
|
@ -25,7 +25,7 @@ export const useAppStore = defineStore("app", {
|
|||||||
icon: "mdi-web",
|
icon: "mdi-web",
|
||||||
text: "联通测试",
|
text: "联通测试",
|
||||||
to: "/ping",
|
to: "/ping",
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { ApiV1ChatsGet200Response } from "@/api"
|
import { ApiV1ChatsGet200Response } from "@/api";
|
||||||
import { defineStore } from "pinia"
|
import { defineStore } from "pinia";
|
||||||
import { api } from "@/plugins/api"
|
import { api } from "@/plugins/api";
|
||||||
|
|
||||||
export const useChatStore = defineStore("chats", {
|
export const useChatStore = defineStore("chats", {
|
||||||
state: () => ({
|
state: () => ({
|
||||||
@ -13,8 +13,8 @@ export const useChatStore = defineStore("chats", {
|
|||||||
actions: {
|
actions: {
|
||||||
getChats() {
|
getChats() {
|
||||||
api.Chat.apiV1ChatsGet().then((response) => {
|
api.Chat.apiV1ChatsGet().then((response) => {
|
||||||
this.chats = response.data
|
this.chats = response.data;
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
});
|
||||||
|
@ -11,4 +11,4 @@
|
|||||||
|
|
||||||
@tailwind base;
|
@tailwind base;
|
||||||
@tailwind components;
|
@tailwind components;
|
||||||
@tailwind utilities;
|
@tailwind utilities;
|
||||||
|
@ -5,5 +5,4 @@ module.exports = {
|
|||||||
extend: {},
|
extend: {},
|
||||||
},
|
},
|
||||||
plugins: [],
|
plugins: [],
|
||||||
}
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user