feat: models import (#164)

This commit is contained in:
Acbox Liu
2026-03-03 15:53:52 +08:00
committed by GitHub
parent 450cc30a9f
commit 5982bc6a42
18 changed files with 669 additions and 32 deletions
+84
View File
@@ -5993,6 +5993,65 @@
}
}
},
"/providers/{id}/import-models": {
"post": {
"description": "Fetch models from provider's /v1/models endpoint and import them",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"providers"
],
"summary": "Import models from provider",
"parameters": [
{
"type": "string",
"description": "Provider ID (UUID)",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Import configuration",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/providers.ImportModelsRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/providers.ImportModelsResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/providers/{id}/models": {
"get": {
"description": "Get models for a provider by id, optionally filtered by type",
@@ -9369,6 +9428,31 @@
}
}
},
"providers.ImportModelsRequest": {
"type": "object",
"properties": {
"client_type": {
"type": "string"
}
}
},
"providers.ImportModelsResponse": {
"type": "object",
"properties": {
"created": {
"type": "integer"
},
"models": {
"type": "array",
"items": {
"type": "string"
}
},
"skipped": {
"type": "integer"
}
}
},
"providers.TestResponse": {
"type": "object",
"properties": {