Skip to content

can you support custom base api url #87

Closed
@winezer0

Description

@winezer0

Could you set a custom base API URL in the command line or environment variables?

rust-genai Already Allow customizing URLs

examples : https://github.com/jeremychone/rust-genai/blob/main/examples/c06-target-resolver.rs

// -- Build an auth_resolver and the AdapterConfig
let target_resolver = ServiceTargetResolver::from_resolver_fn(
|service_target: ServiceTarget| -> Result<ServiceTarget, genai::resolver::Error> {
let ServiceTarget { model, .. } = service_target;
let endpoint = Endpoint::from_static("https://api.x.ai/v1/");
let auth = AuthData::from_env("XAI_API_KEY");
let model = ModelIden::new(AdapterKind::OpenAI, model.model_name);
// TODO: point to xai
Ok(ServiceTarget { endpoint, auth, model })
},
);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions