coproxy 0.6.1

OpenAI-compatible API proxy backed by GitHub Copilot
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::openai::error::ApiError;
use crate::server::routes::auth;
use crate::state::AppState;
use axum::Json;
use axum::extract::State;
use axum::http::HeaderMap;

pub async fn create_embeddings(
    State(state): State<AppState>,
    headers: HeaderMap,
    Json(_request): Json<serde_json::Value>,
) -> Result<Json<serde_json::Value>, ApiError> {
    auth::authorize(&headers, state.api_key.as_deref())?;
    tracing::debug!("embeddings requested but not supported");
    Err(ApiError::not_supported(
        "embeddings are not implemented for GHCP provider",
    ))
}