use crate::http::context::{AppContext, OpenApiResult, bad_request}; use crate::http::payloads::ApiKeyPayload; use crate::llm; use poem_openapi::payload::Json; pub async fn get_anthropic_api_key_exists(ctx: &AppContext) -> OpenApiResult> { let exists = llm::chat::get_anthropic_api_key_exists(ctx.store.as_ref()).map_err(bad_request)?; Ok(Json(exists)) } pub async fn set_anthropic_api_key( payload: Json, ctx: &AppContext, ) -> OpenApiResult> { llm::chat::set_anthropic_api_key(ctx.store.as_ref(), payload.0.api_key).map_err(bad_request)?; Ok(Json(true)) }