Documentation
¶
Overview ¶
Package contracttest contains deterministic provider-package HTTP contracts. It is internal test infrastructure, not a public runtime API.
Index ¶
- func Anthropic(t *testing.T, provider llm.Provider, key auth.APIKey, construct Constructor)
- func AnthropicBearer(t *testing.T, provider llm.Provider, key auth.APIKey, construct Constructor)
- func NoDefaultOpenCodeAttribution(t *testing.T, provider llm.Provider, key auth.APIKey, header string, ...)
- func OpenAI(t *testing.T, provider llm.Provider, key auth.APIKey, construct Constructor)
- func OpenAIWithHeader(t *testing.T, provider llm.Provider, key auth.APIKey, header string, ...)
- func Responses(t *testing.T, provider llm.Provider, key auth.APIKey, construct Constructor)
- func ResponsesWithHeader(t *testing.T, provider llm.Provider, key auth.APIKey, header string, ...)
- type Constructor
- type OptionConstructor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Anthropic ¶
Anthropic verifies native Messages JSON/SSE, x-api-key authentication, usage, and finish normalization for a provider that exposes Anthropic semantics.
func AnthropicBearer ¶
AnthropicBearer verifies native Messages JSON/SSE for gateways that expose Anthropic semantics but deliberately authenticate the whole gateway with a bearer token (for example Cloudflare AI Gateway and Vercel AI Gateway).
func NoDefaultOpenCodeAttribution ¶
func NoDefaultOpenCodeAttribution(t *testing.T, provider llm.Provider, key auth.APIKey, header string, construct OptionConstructor)
NoDefaultOpenCodeAttribution verifies that a gateway does not silently send OpenCode branding headers, while preserving an explicit caller override.
func OpenAI ¶
OpenAI verifies the common JSON/SSE, auth, usage, finish, and route contract for a provider using the OpenAI Chat Completions dialect.
func OpenAIWithHeader ¶
func OpenAIWithHeader(t *testing.T, provider llm.Provider, key auth.APIKey, header string, construct Constructor)
OpenAIWithHeader is the same contract for providers such as Azure that use a documented API-key header instead of Authorization: Bearer.
func Responses ¶
Responses verifies the common OpenAI Responses JSON/SSE, bearer auth, usage, tool/finish normalization, and /responses route contract.
func ResponsesWithHeader ¶
func ResponsesWithHeader(t *testing.T, provider llm.Provider, key auth.APIKey, header string, construct Constructor)
ResponsesWithHeader verifies the Responses dialect for providers such as Azure that use a documented API-key header instead of Authorization: Bearer.