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": [
|
||||
|
||||
+82
-30
@@ -8,34 +8,6 @@
|
||||
},
|
||||
"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": [
|
||||
@@ -72,7 +44,7 @@
|
||||
"summary": "Anthropic Messages 兼容端点",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "Anthropic messages 请求体(支持 stream)",
|
||||
"description": "Anthropic messages 请求体(支持 stream;经 OCI OpenAI 兼容面直通)",
|
||||
"name": "body",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
@@ -117,7 +89,7 @@
|
||||
"summary": "OpenAI Responses 兼容端点",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "OpenAI responses 请求体(支持 stream)",
|
||||
"description": "OpenAI responses 请求体(支持 stream;web_search/x_search 服务端工具仅非流式)",
|
||||
"name": "body",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
@@ -159,6 +131,86 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/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": [
|
||||
|
||||
+50
-20
@@ -599,24 +599,6 @@ info:
|
||||
title: OCI Portal API
|
||||
version: 0.0.1
|
||||
paths:
|
||||
/ai/v1/chat/completions:
|
||||
post:
|
||||
parameters:
|
||||
- description: OpenAI chat/completions 请求体(支持 stream)
|
||||
in: body
|
||||
name: body
|
||||
required: true
|
||||
schema:
|
||||
type: object
|
||||
responses:
|
||||
"200":
|
||||
description: OpenAI 兼容响应(流式为 SSE)
|
||||
schema:
|
||||
additionalProperties: true
|
||||
type: object
|
||||
summary: OpenAI 兼容对话补全
|
||||
tags:
|
||||
- AI 网关
|
||||
/ai/v1/embeddings:
|
||||
post:
|
||||
parameters:
|
||||
@@ -638,7 +620,7 @@ paths:
|
||||
/ai/v1/messages:
|
||||
post:
|
||||
parameters:
|
||||
- description: Anthropic messages 请求体(支持 stream)
|
||||
- description: Anthropic messages 请求体(支持 stream;经 OCI OpenAI 兼容面直通)
|
||||
in: body
|
||||
name: body
|
||||
required: true
|
||||
@@ -667,7 +649,7 @@ paths:
|
||||
/ai/v1/responses:
|
||||
post:
|
||||
parameters:
|
||||
- description: OpenAI responses 请求体(支持 stream)
|
||||
- description: OpenAI responses 请求体(支持 stream;web_search/x_search 服务端工具仅非流式)
|
||||
in: body
|
||||
name: body
|
||||
required: true
|
||||
@@ -695,6 +677,54 @@ paths:
|
||||
summary: 返回构建与运行环境信息,「设置 · 关于」页展示
|
||||
tags:
|
||||
- 设置
|
||||
/api/v1/ai-blacklist:
|
||||
get:
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
additionalProperties: true
|
||||
type: object
|
||||
security:
|
||||
- BearerAuth: []
|
||||
summary: 模型黑名单列表
|
||||
tags:
|
||||
- AI 管理
|
||||
post:
|
||||
parameters:
|
||||
- description: '请求体:{name: 模型名}'
|
||||
in: body
|
||||
name: body
|
||||
required: true
|
||||
schema:
|
||||
type: object
|
||||
responses:
|
||||
"201":
|
||||
description: Created
|
||||
schema:
|
||||
additionalProperties: true
|
||||
type: object
|
||||
security:
|
||||
- BearerAuth: []
|
||||
summary: 添加模型黑名单
|
||||
tags:
|
||||
- AI 管理
|
||||
/api/v1/ai-blacklist/{id}:
|
||||
delete:
|
||||
parameters:
|
||||
- description: 黑名单条目 ID
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
type: integer
|
||||
responses:
|
||||
"204":
|
||||
description: 无内容
|
||||
security:
|
||||
- BearerAuth: []
|
||||
summary: 移除模型黑名单(重新同步后模型恢复入池)
|
||||
tags:
|
||||
- AI 管理
|
||||
/api/v1/ai-channels:
|
||||
get:
|
||||
responses:
|
||||
|
||||
Reference in New Issue
Block a user