mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-09-12 04:44:52 +00:00
fix: update docs with new endpoint
This commit is contained in:
parent
a76bd78486
commit
8bfa11f636
@ -556,6 +556,37 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/v1/models": {
|
||||
"get": {
|
||||
"tags": [
|
||||
"Text Generation Inference"
|
||||
],
|
||||
"summary": "Get model info",
|
||||
"operationId": "openai_get_model_info",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Served model info",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/ModelInfo"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"404": {
|
||||
"description": "Model not found",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/ErrorResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"components": {
|
||||
@ -1747,6 +1778,35 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"ModelInfo": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"object",
|
||||
"created",
|
||||
"owned_by"
|
||||
],
|
||||
"properties": {
|
||||
"created": {
|
||||
"type": "integer",
|
||||
"format": "int64",
|
||||
"example": 1686935002,
|
||||
"minimum": 0
|
||||
},
|
||||
"id": {
|
||||
"type": "string",
|
||||
"example": "gpt2"
|
||||
},
|
||||
"object": {
|
||||
"type": "string",
|
||||
"example": "model"
|
||||
},
|
||||
"owned_by": {
|
||||
"type": "string",
|
||||
"example": "openai"
|
||||
}
|
||||
}
|
||||
},
|
||||
"OutputMessage": {
|
||||
"oneOf": [
|
||||
{
|
||||
|
@ -121,9 +121,13 @@ async fn get_model_info(info: Extension<Info>) -> Json<Info> {
|
||||
get,
|
||||
tag = "Text Generation Inference",
|
||||
path = "/v1/models",
|
||||
responses((status = 200, description = "Served model info", body = ModelInfo))
|
||||
responses(
|
||||
(status = 200, description = "Served model info", body = ModelInfo),
|
||||
(status = 404, description = "Model not found", body = ErrorResponse),
|
||||
)
|
||||
)]
|
||||
#[instrument]
|
||||
#[instrument(skip(info))]
|
||||
/// Get model info
|
||||
async fn openai_get_model_info(info: Extension<Info>) -> Json<ModelsInfo> {
|
||||
Json(ModelsInfo {
|
||||
data: vec![ModelInfo {
|
||||
@ -1521,6 +1525,7 @@ chat_completions,
|
||||
completions,
|
||||
tokenize,
|
||||
metrics,
|
||||
openai_get_model_info,
|
||||
),
|
||||
components(
|
||||
schemas(
|
||||
@ -1573,6 +1578,7 @@ ToolCall,
|
||||
Function,
|
||||
FunctionDefinition,
|
||||
ToolChoice,
|
||||
ModelInfo,
|
||||
)
|
||||
),
|
||||
tags(
|
||||
|
Loading…
Reference in New Issue
Block a user