gproxy-transform 2.6.3

Pairwise request/response/stream transforms between the OpenAI, Anthropic Claude, and Google Gemini APIs
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::protocol::{claude, openai};
use crate::transform::{TransformContext, TransformError};

use super::{DEFAULT_OPENAI_OWNED_BY, openai_model_object, wire_string};

pub(in crate::transform::models) fn model(
    input: claude::ModelInfo,
    _: &TransformContext,
) -> Result<openai::Model, TransformError> {
    Ok(crate::protocol::wire!(openai::Model {
        id: wire_string(&input.id, "id")?.into(),
        created: None,
        object: openai_model_object(),
        owned_by: DEFAULT_OPENAI_OWNED_BY.to_owned(),
        extra: Default::default(),
    }))
}