wirerules

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 30, 2026 License: Apache-2.0 Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

func ChatCompletions(hostName, baseURL, upstreamModel string) v1.WireRules

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.

func Messages added in v0.8.0

func Messages(hostName, baseURL, upstreamModel string) v1.WireRules

Messages is ChatCompletions for the Anthropic Messages shape.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL