Documentation
¶
Overview ¶
Package wirerules is the table of upstreams that read the Chat Completions or Anthropic Messages shape differently from the shape's definition, and the v1.WireRules each one needs, looked up by catalog host name or by the host part of a base URL, optionally narrowed to upstream model names. Relay's server and the SDK client both read it, so a call made through relay and one made straight to the upstream send the same bytes.
An upstream not listed gets zero rules. On Chat Completions no prior reasoning is sent back, since some upstreams reject the field (Mistral answers 422), and a system message past the start of the conversation goes out as a system message where it stands, as OpenAI defines it. On Messages such a system message goes out as a wrapped user turn, which every model accepts, while Anthropic takes a system message in place only on the models it lists. Out of scope: other wire shapes and applying the rules (a v1.WireRulesSerializer does that).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChatCompletions ¶ added in v0.8.0
ChatCompletions returns the Chat Completions wire rules for upstreamModel at the catalog host with metadata.name hostName, else at the host baseURL names (case-insensitive, any scheme, port or path), so an operator-created host pointing at a listed upstream reads it the same way; zero when the table has no row for either.
Types ¶
This section is empty.