ai_scheduler/docs/swagger.json

168 lines
5.1 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
"swagger": "2.0",
"info": {
"description": "智能路由调度系统API文档",
"title": "AI Scheduler API",
"termsOfService": "http://swagger.io/terms/",
"contact": {
"name": "API Support",
"url": "http://www.swagger.io/support",
"email": "support@swagger.io"
},
"license": {
"name": "Apache 2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
},
"version": "1.0"
},
"host": "localhost:8080",
"basePath": "/",
"paths": {
"/api/v1/chat": {
"post": {
"description": "发送消息给AI助手支持工具调用",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"chat"
],
"summary": "智能聊天",
"parameters": [
{
"description": "聊天请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handlers.ChatRequest"
}
}
],
"responses": {
"200": {
"description": "聊天响应",
"schema": {
"$ref": "#/definitions/handlers.ChatResponse"
}
},
"400": {
"description": "请求错误",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "服务器错误",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/health": {
"get": {
"description": "检查服务是否正常运行",
"produces": [
"application/json"
],
"tags": [
"system"
],
"summary": "健康检查",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
}
},
"definitions": {
"handlers.ChatRequest": {
"type": "object",
"required": [
"message"
],
"properties": {
"message": {
"type": "string",
"example": "北京今天天气怎么样?"
}
}
},
"handlers.ChatResponse": {
"type": "object",
"properties": {
"finished": {
"type": "boolean",
"example": true
},
"message": {
"type": "string",
"example": "北京今天天气晴朗温度15.3°C"
},
"tool_calls": {
"type": "array",
"items": {
"$ref": "#/definitions/handlers.ToolCallResponse"
}
}
}
},
"handlers.ErrorResponse": {
"type": "object",
"properties": {
"code": {
"type": "integer",
"example": 400
},
"error": {
"type": "string",
"example": "Invalid request"
},
"message": {
"type": "string",
"example": "请求参数错误"
}
}
},
"handlers.FunctionCallResponse": {
"type": "object",
"properties": {
"arguments": {},
"name": {
"type": "string",
"example": "get_weather"
}
}
},
"handlers.ToolCallResponse": {
"type": "object",
"properties": {
"function": {
"$ref": "#/definitions/handlers.FunctionCallResponse"
},
"id": {
"type": "string",
"example": "call_1"
},
"result": {},
"type": {
"type": "string",
"example": "function"
}
}
}
}
}