9 lines
276 B
Rust
9 lines
276 B
Rust
|
|
use crate::http::context::{AppContext, OpenApiResult, bad_request};
|
||
|
|
use crate::llm::chat;
|
||
|
|
use poem_openapi::payload::Json;
|
||
|
|
|
||
|
|
pub async fn cancel_chat(ctx: &AppContext) -> OpenApiResult<Json<bool>> {
|
||
|
|
chat::cancel_chat(&ctx.state).map_err(bad_request)?;
|
||
|
|
Ok(Json(true))
|
||
|
|
}
|