Documentation
¶
Overview ¶
Package opencode routes OpenCode Zen and OpenCode Go models to the Sigma adapter matching each model's OpenCode API family.
Index ¶
- Constants
- func OpenCodeAPI(model sigma.Model) sigma.API
- func Register(registry *sigma.Registry, providerID sigma.ProviderID, opts ...ProviderOption) error
- func RegisterDefault(registry *sigma.Registry, opts ...ProviderOption) error
- func RegisterGo(registry *sigma.Registry, opts ...ProviderOption) error
- func RegisterGoDefault(opts ...ProviderOption) error
- func RegisterZen(registry *sigma.Registry, opts ...ProviderOption) error
- func RegisterZenDefault(opts ...ProviderOption) error
- type Provider
- type ProviderOption
Constants ¶
const ( // ZenBaseURL is the OpenCode Zen API base URL. ZenBaseURL = "https://opencode.ai/zen/v1" // GoBaseURL is the OpenCode Go API base URL. GoBaseURL = "https://opencode.ai/zen/go/v1" )
Variables ¶
This section is empty.
Functions ¶
func OpenCodeAPI ¶
OpenCodeAPI returns the real API family for model.
func Register ¶
func Register(registry *sigma.Registry, providerID sigma.ProviderID, opts ...ProviderOption) error
Register registers an OpenCode provider with a caller-selected provider ID.
func RegisterDefault ¶
func RegisterDefault(registry *sigma.Registry, opts ...ProviderOption) error
RegisterDefault registers both OpenCode Zen and OpenCode Go providers.
func RegisterGo ¶
func RegisterGo(registry *sigma.Registry, opts ...ProviderOption) error
RegisterGo registers the OpenCode Go provider.
func RegisterGoDefault ¶
func RegisterGoDefault(opts ...ProviderOption) error
RegisterGoDefault registers OpenCode Go on sigma's default registry.
func RegisterZen ¶
func RegisterZen(registry *sigma.Registry, opts ...ProviderOption) error
RegisterZen registers the OpenCode Zen provider.
func RegisterZenDefault ¶
func RegisterZenDefault(opts ...ProviderOption) error
RegisterZenDefault registers OpenCode Zen on sigma's default registry.
Types ¶
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider dispatches OpenCode models to their real API-compatible route.
func NewProvider ¶
func NewProvider(opts ...ProviderOption) *Provider
NewProvider constructs an OpenCode provider.
type ProviderOption ¶
type ProviderOption func(*providerConfig)
ProviderOption configures an OpenCode provider.
func WithBaseURL ¶
func WithBaseURL(baseURL string) ProviderOption
WithBaseURL configures the OpenCode route base URL.
func WithHTTPClient ¶
func WithHTTPClient(client *http.Client) ProviderOption
WithHTTPClient configures the HTTP client for wrapped providers.
func WithHeader ¶
func WithHeader(key, value string) ProviderOption
WithHeader configures a provider default request header.
func WithHeaders ¶
func WithHeaders(headers map[string]string) ProviderOption
WithHeaders configures provider default request headers.