Documentation
¶
Overview ¶
Package githubcopilot adapts GitHub Copilot's compatible text endpoints to sigma.
Index ¶
- Constants
- func Register(registry *sigma.Registry, opts ...ProviderOption) error
- func RegisterAnthropic(registry *sigma.Registry, opts ...AnthropicProviderOption) error
- func RegisterDefault(opts ...ProviderOption) error
- func RegisterDefaultAnthropic(opts ...AnthropicProviderOption) error
- func RegisterResponses(registry *sigma.Registry, opts ...ProviderOption) error
- func RegisterResponsesDefault(opts ...ProviderOption) error
- type AnthropicProvider
- type AnthropicProviderOption
- func WithAnthropicBaseURL(baseURL string) AnthropicProviderOption
- func WithAnthropicHTTPClient(client *http.Client) AnthropicProviderOption
- func WithAnthropicHeader(key, value string) AnthropicProviderOption
- func WithAnthropicHeaders(headers map[string]string) AnthropicProviderOption
- func WithAnthropicMessagesCompat(compat anthropic.MessagesCompat) AnthropicProviderOption
- type Provider
- type ProviderOption
- type ResponsesProvider
Constants ¶
const DefaultBaseURL = "https://api.individual.githubcopilot.com"
Variables ¶
This section is empty.
Functions ¶
func Register ¶
func Register(registry *sigma.Registry, opts ...ProviderOption) error
Register adds a GitHub Copilot Chat Completions provider to registry.
func RegisterAnthropic ¶
func RegisterAnthropic(registry *sigma.Registry, opts ...AnthropicProviderOption) error
RegisterAnthropic adds a GitHub Copilot Anthropic-compatible provider to registry.
func RegisterDefault ¶
func RegisterDefault(opts ...ProviderOption) error
RegisterDefault adds a GitHub Copilot Chat Completions provider to sigma's default registry.
func RegisterDefaultAnthropic ¶
func RegisterDefaultAnthropic(opts ...AnthropicProviderOption) error
RegisterDefaultAnthropic adds a GitHub Copilot Anthropic-compatible provider to sigma's default registry.
func RegisterResponses ¶
func RegisterResponses(registry *sigma.Registry, opts ...ProviderOption) error
RegisterResponses adds a GitHub Copilot Responses provider to registry.
func RegisterResponsesDefault ¶
func RegisterResponsesDefault(opts ...ProviderOption) error
RegisterResponsesDefault adds a GitHub Copilot Responses provider to sigma's default registry.
Types ¶
type AnthropicProvider ¶
AnthropicProvider adapts GitHub Copilot's Anthropic-compatible Messages endpoint.
func NewAnthropicProvider ¶
func NewAnthropicProvider(opts ...AnthropicProviderOption) *AnthropicProvider
NewAnthropicProvider constructs a GitHub Copilot Anthropic-compatible provider.
type AnthropicProviderOption ¶
type AnthropicProviderOption = anthropic.ProviderOption
AnthropicProviderOption configures an AnthropicProvider.
func WithAnthropicBaseURL ¶
func WithAnthropicBaseURL(baseURL string) AnthropicProviderOption
WithAnthropicBaseURL configures the Anthropic-compatible provider base URL.
func WithAnthropicHTTPClient ¶
func WithAnthropicHTTPClient(client *http.Client) AnthropicProviderOption
WithAnthropicHTTPClient configures the Anthropic-compatible provider fallback HTTP client.
func WithAnthropicHeader ¶
func WithAnthropicHeader(key, value string) AnthropicProviderOption
WithAnthropicHeader configures an Anthropic-compatible provider default request header.
func WithAnthropicHeaders ¶
func WithAnthropicHeaders(headers map[string]string) AnthropicProviderOption
WithAnthropicHeaders configures Anthropic-compatible provider default request headers.
func WithAnthropicMessagesCompat ¶
func WithAnthropicMessagesCompat(compat anthropic.MessagesCompat) AnthropicProviderOption
WithAnthropicMessagesCompat overrides detected Anthropic-compatible endpoint behavior.
type Provider ¶
Provider adapts GitHub Copilot's OpenAI-compatible Chat Completions endpoint.
func NewProvider ¶
func NewProvider(opts ...ProviderOption) *Provider
NewProvider constructs a GitHub Copilot Chat Completions provider.
type ProviderOption ¶
type ProviderOption = openai.ProviderOption
ProviderOption configures a Provider.
func WithBaseURL ¶
func WithBaseURL(baseURL string) ProviderOption
WithBaseURL configures the provider base URL, for example an httptest server URL.
func WithHTTPClient ¶
func WithHTTPClient(client *http.Client) ProviderOption
WithHTTPClient configures the provider fallback HTTP client.
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.
type ResponsesProvider ¶
type ResponsesProvider = openai.ResponsesProvider
ResponsesProvider adapts GitHub Copilot's OpenAI-compatible Responses endpoint.
func NewResponsesProvider ¶
func NewResponsesProvider(opts ...ProviderOption) *ResponsesProvider
NewResponsesProvider constructs a GitHub Copilot Responses provider.