Documentation
¶
Overview ¶
Package provider implements various LLM providers (Google, GitHub) for the application.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CredentialStore ¶
type CredentialStore interface {
GetWithFallback(p domain.Provider) (*domain.Credential, error)
}
CredentialStore defines the interface for active credential resolution.
type GitHubProvider ¶
type GitHubProvider struct {
// contains filtered or unexported fields
}
GitHubProvider implements the domain.Provider interface for GitHub Copilot.
func NewGitHubProvider ¶
func NewGitHubProvider(models []domain.LLMInfo) *GitHubProvider
NewGitHubProvider creates a new GitHub provider factory.
func (*GitHubProvider) GetLLM ¶
func (p *GitHubProvider) GetLLM(ctx context.Context, cred *domain.Credential, info domain.LLMInfo) (domain.LLM, error)
GetLLM initializes and returns a GitHub-backed LLM instance.
func (*GitHubProvider) ID ¶
func (p *GitHubProvider) ID() string
ID returns the unique identifier for the GitHub provider.
func (*GitHubProvider) List ¶
func (p *GitHubProvider) List() []domain.LLMInfo
List returns the available models provided by GitHub.
func (*GitHubProvider) SupportedAuthMethods ¶
func (p *GitHubProvider) SupportedAuthMethods() []domain.AuthMethod
SupportedAuthMethods returns the list of authentication methods supported by GitHub.
type GoogleProvider ¶
type GoogleProvider struct {
// contains filtered or unexported fields
}
GoogleProvider implements the domain.Provider interface for Google Gemini.
func NewGoogleProvider ¶
func NewGoogleProvider(models []domain.LLMInfo) *GoogleProvider
NewGoogleProvider creates a new Google provider factory.
func (*GoogleProvider) GetLLM ¶
func (p *GoogleProvider) GetLLM(ctx context.Context, cred *domain.Credential, info domain.LLMInfo) (domain.LLM, error)
GetLLM initializes and returns a Google-backed LLM instance.
func (*GoogleProvider) ID ¶
func (p *GoogleProvider) ID() string
ID returns the unique identifier for the Google provider.
func (*GoogleProvider) List ¶
func (p *GoogleProvider) List() []domain.LLMInfo
List returns the available models provided by Google.
func (*GoogleProvider) SupportedAuthMethods ¶
func (p *GoogleProvider) SupportedAuthMethods() []domain.AuthMethod
SupportedAuthMethods returns the list of authentication methods supported by Google.
type LLMRegistry ¶
type LLMRegistry struct {
// contains filtered or unexported fields
}
LLMRegistry orchestrates model resolution using a Registry and credentials.
func NewLLMRegistry ¶
func NewLLMRegistry(authManager CredentialStore, providers *Registry) *LLMRegistry
NewLLMRegistry creates an LLMRegistry.
type OpenCodeProvider ¶ added in v1.0.1
type OpenCodeProvider struct {
// contains filtered or unexported fields
}
func NewOpenCodeProvider ¶ added in v1.0.1
func NewOpenCodeProvider(models []domain.LLMInfo) *OpenCodeProvider
func (*OpenCodeProvider) GetLLM ¶ added in v1.0.1
func (p *OpenCodeProvider) GetLLM(ctx context.Context, cred *domain.Credential, info domain.LLMInfo) (domain.LLM, error)
func (*OpenCodeProvider) ID ¶ added in v1.0.1
func (p *OpenCodeProvider) ID() string
func (*OpenCodeProvider) List ¶ added in v1.0.1
func (p *OpenCodeProvider) List() []domain.LLMInfo
func (*OpenCodeProvider) SupportedAuthMethods ¶ added in v1.0.1
func (p *OpenCodeProvider) SupportedAuthMethods() []domain.AuthMethod
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry manages the set of available LLM providers.
func NewRegistry ¶
func NewRegistry(authManager CredentialStore, providers ...domain.Provider) *Registry
NewRegistry creates a Registry from providers and an optional auth manager.
type TokenSource ¶
type TokenSource struct {
// contains filtered or unexported fields
}
TokenSource manages the exchange of a long-lived GitHub OAuth token for short-lived Copilot session tokens.
func NewTokenSource ¶
func NewTokenSource(oauthToken string, exchangeURL string) *TokenSource
NewTokenSource creates a new token source.