Documentation
¶
Index ¶
- Constants
- type Account
- type Provider
- func (p *Provider) Accounts() []*Account
- func (p *Provider) ChatCompletion(ctx context.Context, req *providers.ChatRequest) (io.ReadCloser, bool, int, error)
- func (p *Provider) Embeddings(ctx context.Context, req *providers.EmbeddingRequest) (*providers.EmbeddingResponse, error)
- func (p *Provider) ID() string
- func (p *Provider) IsHealthy() bool
- func (p *Provider) Models(ctx context.Context) ([]providers.ModelInfo, error)
- func (p *Provider) TestAccount(ctx context.Context, accountID string) error
- func (p *Provider) TestConnection(ctx context.Context) error
- func (p *Provider) Type() string
Constants ¶
View Source
const ( CopilotInternalTokenURL = "https://api.github.com/copilot_internal/v2/token" CopilotDefaultBaseURL = "https://api.githubcopilot.com" CopilotClientID = "Iv1.b507a08c87ecfe98" CopilotUserAgent = "GithubCopilot/1.155.0" CopilotChatUserAgent = "GitHubCopilotChat/0.17.0" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct {
ID string
GitHubToken string
CopilotToken string
ExpiresAt time.Time
User string
// contains filtered or unexported fields
}
func ReadCopilotCLIAuth ¶
ReadCopilotCLIAuth parses ~/.config/github-copilot/hosts.json or hosts.bak
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
func NewProvider ¶
func (*Provider) ChatCompletion ¶
func (p *Provider) ChatCompletion(ctx context.Context, req *providers.ChatRequest) (io.ReadCloser, bool, int, error)
func (*Provider) Embeddings ¶
func (p *Provider) Embeddings(ctx context.Context, req *providers.EmbeddingRequest) (*providers.EmbeddingResponse, error)
func (*Provider) TestAccount ¶
Click to show internal directories.
Click to hide internal directories.