feat: add doc endpoint
This commit is contained in:
+46
@@ -0,0 +1,46 @@
|
||||
use utoipa::OpenApi;
|
||||
|
||||
use crate::dto::api;
|
||||
use crate::routes;
|
||||
|
||||
#[derive(OpenApi)]
|
||||
#[openapi(
|
||||
paths(
|
||||
routes::v1::chat::completions,
|
||||
routes::v1::chat::chat_completions,
|
||||
// routes::v1::models::list_models,
|
||||
// routes::v1::models::load_model,
|
||||
// routes::v1::models::unload_model,
|
||||
),
|
||||
components(
|
||||
schemas(
|
||||
api::ErrorResponse,
|
||||
api::ModelsResponse,
|
||||
api::ModelInfo,
|
||||
api::LoadModelResponse,
|
||||
api::LoadModelBody,
|
||||
api::UnloadModelResponse,
|
||||
api::BaseLLMRequest,
|
||||
api::CompletionRequest,
|
||||
api::CompletionObject,
|
||||
api::FinishReason,
|
||||
api::CompletionResponse,
|
||||
api::Choice,
|
||||
api::Usage,
|
||||
api::CompletionChunk,
|
||||
api::ChatRequest,
|
||||
api::Message,
|
||||
api::Role,
|
||||
api::ChatCompletionResponse,
|
||||
api::ChatChoice,
|
||||
api::ChatCompletionChunk,
|
||||
api::ChatChunkChoice,
|
||||
api::ChatDelta,
|
||||
)
|
||||
),
|
||||
tags(
|
||||
(name = "chat", description = "Chat & completions"),
|
||||
(name = "models", description = "Model management")
|
||||
)
|
||||
)]
|
||||
pub struct ApiDoc;
|
||||
Reference in New Issue
Block a user