Skip to main content

model_protocol

Function model_protocol 

Source
pub fn model_protocol(
    base_url: Option<&str>,
    model: &str,
) -> Option<LlmEndpoint>
Expand description

The wire protocol model speaks on OpenCode Go, when we recognize it. None = unknown / both-work / not served by chat-or-responses, or a non-zen provider — the caller (EndpointPref::resolve) falls back to Chat.

Gated by is_opencode_go EXACTLY like model_limit: a known id behind a non-OpenCode base is NOT assumed (mirrors unknown_model_or_provider_is_none). Only the responses-only ids are enumerated; every other id is None (both-works, or speaks a protocol wcode does not implement).

§Returns

Some(LlmEndpoint::Responses) for an id in OPENCODE_GO_RESPONSES_ONLY under a zen base; None otherwise (never Some(Chat) — absence means “let the caller default to chat”).

Does NOT promise: it does not verify the id exists in the live catalog, and it is a snapshot of the OpenCode Go listing (OPENCODE_GO_RESPONSES_ONLY).