pub struct Endpoint {
pub url: String,
pub api_key: Option<String>,
pub model: String,
pub provider: Provider,
}Expand description
Where and how to reach a transcription server.
Debug is implemented by hand rather than derived, so that printing an Endpoint
cannot disclose the key it holds — see the impl below.
Fields§
§url: StringFull URL to POST the multipart form to.
api_key: Option<String>Bearer token, if the backend requires auth.
model: StringModel id sent as the model form field.
provider: ProviderProvenance tag recorded on the transcript.
Implementations§
Source§impl Endpoint
impl Endpoint
Sourcepub fn cohere(api_key: impl Into<String>, model: Option<String>) -> Self
pub fn cohere(api_key: impl Into<String>, model: Option<String>) -> Self
Cohere’s hosted API. model defaults to DEFAULT_COHERE_MODEL.
Sourcepub fn openai_compatible(
url: impl Into<String>,
model: impl Into<String>,
api_key: Option<String>,
) -> Result<Self>
pub fn openai_compatible( url: impl Into<String>, model: impl Into<String>, api_key: Option<String>, ) -> Result<Self>
A self-hosted OpenAI-compatible endpoint — pass the full route URL
(e.g. http://localhost:8000/v1/audio/transcriptions).
The URL is parsed here so a typo fails immediately and by name. Left unchecked it
surfaced much later as reqwest’s builder error, which says nothing about which
input was wrong.
Trait Implementations§
Source§impl Debug for Endpoint
Hand-written so the API key can never be printed.
impl Debug for Endpoint
Hand-written so the API key can never be printed.
A derived Debug renders api_key: Some("sk-…") in full, which means any downstream
dbg!(&endpoint) or tracing::debug!(?endpoint) discloses the caller’s credential.
That is a footgun a published library shouldn’t hand out, so the field is masked and
only its presence is shown.