go.bigb.es/claudio
Index
Functions
func DeviceAuth() (string, error)
func Headers() map[string]string
Headers returns editor identification headers required by the Copilot API.
func VendorFamilies(models []CopilotModel) ([]string, map[string][]CopilotModel)
VendorFamilies returns the ordered list of family names and models grouped by family.
Types
type CopilotModel struct { ID string `json:"id"` Name string `json:"name"` Version string `json:"version"` Vendor string `json:"vendor"` ContextWindow int `json:"context_window"` }
CopilotModel represents a model available via the Copilot API.
func ListModels(oauthToken string) ([]CopilotModel, error)
ListModels fetches available models from the Copilot API using the given OAuth token.
func (m CopilotModel) DisplayName() string
DisplayName returns a human-friendly name for the model.
type TokenSource struct { // contains filtered or unexported fields }
TokenSource manages Copilot session tokens, refreshing them as needed.
func NewTokenSource(oauthToken string) *TokenSource
NewTokenSource creates a TokenSource that uses the given OAuth token to obtain Copilot session tokens.
func (ts *TokenSource) Token() (string, error)
Token returns a valid Copilot session token, refreshing if needed.
DeviceAuth runs the GitHub OAuth device flow and returns an access token.