feat: chat api

This commit is contained in:
Acbox
2026-01-28 15:15:57 +08:00
parent 0711b1f086
commit 39215309da
26 changed files with 673 additions and 1873 deletions
+29 -42
View File
@@ -1,67 +1,51 @@
definitions:
chat.ChatRequest:
properties:
current_platform:
type: string
language:
type: string
locale:
type: string
max_context_load_time:
type: integer
max_steps:
type: integer
messages:
items:
$ref: '#/definitions/chat.Message'
$ref: '#/definitions/chat.GatewayMessage'
type: array
model:
description: 'optional: specific model to use'
type: string
platforms:
items:
type: string
type: array
provider:
description: 'optional: specific provider to use'
type: string
stream:
type: boolean
query:
type: string
type: object
chat.ChatResponse:
properties:
finish_reason:
type: string
message:
$ref: '#/definitions/chat.Message'
model:
type: string
provider:
type: string
usage:
$ref: '#/definitions/chat.Usage'
type: object
chat.Message:
properties:
content:
type: string
role:
description: user, assistant, system
type: string
type: object
chat.StreamChunk:
properties:
delta:
properties:
content:
type: string
type: object
finish_reason:
type: string
messages:
items:
$ref: '#/definitions/chat.GatewayMessage'
type: array
model:
type: string
provider:
type: string
type: object
chat.Usage:
properties:
completion_tokens:
type: integer
prompt_tokens:
type: integer
total_tokens:
type: integer
chat.GatewayMessage:
additionalProperties: true
type: object
handlers.CreateContainerRequest:
properties:
container_id:
type: string
image:
type: string
snapshotter:
type: string
type: object
@@ -553,7 +537,10 @@ paths:
"200":
description: OK
schema:
$ref: '#/definitions/chat.StreamChunk'
items:
format: int32
type: integer
type: array
"400":
description: Bad Request
schema: