go.bigb.es/claudio

v0.6.2
Doc Versions Source

Functions

f func DeviceAuth

src
func DeviceAuth() (string, error)

DeviceAuth runs the GitHub OAuth device flow and returns an access token.

f func Headers

src
func Headers() map[string]string

Headers returns editor identification headers required by the Copilot API.

f func VendorFamilies

src
func VendorFamilies(models []CopilotModel) ([]string, map[string][]CopilotModel)

VendorFamilies returns the ordered list of family names and models grouped by family.

Types

T type CopilotModel

src
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.

f func ListModels

src
func ListModels(oauthToken string) ([]CopilotModel, error)

ListModels fetches available models from the Copilot API using the given OAuth token.

m func (CopilotModel) DisplayName

src
func (m CopilotModel) DisplayName() string

DisplayName returns a human-friendly name for the model.

T type TokenSource

src
type TokenSource struct {
	// contains filtered or unexported fields
}

TokenSource manages Copilot session tokens, refreshing them as needed.

f func NewTokenSource

src
func NewTokenSource(oauthToken string) *TokenSource

NewTokenSource creates a TokenSource that uses the given OAuth token to obtain Copilot session tokens.

m func (*TokenSource) Token

src
func (ts *TokenSource) Token() (string, error)

Token returns a valid Copilot session token, refreshing if needed.

Source Files