AI 网关切换 OpenAI 兼容面并移除 chat 端点,新增模型黑白名单
This commit is contained in:
+82
-30
@@ -15,34 +15,6 @@ const docTemplate = `{
|
||||
"host": "{{.Host}}",
|
||||
"basePath": "{{.BasePath}}",
|
||||
"paths": {
|
||||
"/ai/v1/chat/completions": {
|
||||
"post": {
|
||||
"tags": [
|
||||
"AI 网关"
|
||||
],
|
||||
"summary": "OpenAI 兼容对话补全",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "OpenAI chat/completions 请求体(支持 stream)",
|
||||
"name": "body",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OpenAI 兼容响应(流式为 SSE)",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/ai/v1/embeddings": {
|
||||
"post": {
|
||||
"tags": [
|
||||
@@ -79,7 +51,7 @@ const docTemplate = `{
|
||||
"summary": "Anthropic Messages 兼容端点",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "Anthropic messages 请求体(支持 stream)",
|
||||
"description": "Anthropic messages 请求体(支持 stream;经 OCI OpenAI 兼容面直通)",
|
||||
"name": "body",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
@@ -124,7 +96,7 @@ const docTemplate = `{
|
||||
"summary": "OpenAI Responses 兼容端点",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "OpenAI responses 请求体(支持 stream)",
|
||||
"description": "OpenAI responses 请求体(支持 stream;web_search/x_search 服务端工具仅非流式)",
|
||||
"name": "body",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
@@ -166,6 +138,86 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/ai-blacklist": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"tags": [
|
||||
"AI 管理"
|
||||
],
|
||||
"summary": "模型黑名单列表",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": true
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"tags": [
|
||||
"AI 管理"
|
||||
],
|
||||
"summary": "添加模型黑名单",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "请求体:{name: 模型名}",
|
||||
"name": "body",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"201": {
|
||||
"description": "Created",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/ai-blacklist/{id}": {
|
||||
"delete": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"tags": [
|
||||
"AI 管理"
|
||||
],
|
||||
"summary": "移除模型黑名单(重新同步后模型恢复入池)",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "黑名单条目 ID",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"204": {
|
||||
"description": "无内容"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/ai-channels": {
|
||||
"get": {
|
||||
"security": [
|
||||
|
||||
Reference in New Issue
Block a user