Documentation
¶
Overview ¶
* ChatCLI - GitHub Models marketplace provider * Uses OpenAI-compatible API at models.inference.ai.azure.com * Auth: GitHub Personal Access Token (PAT) * Copyright (c) 2024 Edilson Freitas * License: Apache-2.0
Index ¶
- type GitHubModelsClient
- func (c *GitHubModelsClient) GetModelName() string
- func (c *GitHubModelsClient) LastStopReason() string
- func (c *GitHubModelsClient) LastUsage() *models.UsageInfo
- func (c *GitHubModelsClient) ListModels(ctx context.Context) ([]client.ModelInfo, error)
- func (c *GitHubModelsClient) SendPrompt(ctx context.Context, prompt string, history []models.Message, maxTokens int) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GitHubModelsClient ¶
type GitHubModelsClient struct {
// contains filtered or unexported fields
}
GitHubModelsClient implements an LLM client for the GitHub Models marketplace. It uses the OpenAI-compatible API at models.inference.ai.azure.com.
func NewGitHubModelsClient ¶
func NewGitHubModelsClient(provider auth.TokenProvider, model string, logger *zap.Logger, maxAttempts int, backoff time.Duration) *GitHubModelsClient
NewGitHubModelsClient creates a new GitHub Models client.
func (*GitHubModelsClient) GetModelName ¶
func (c *GitHubModelsClient) GetModelName() string
func (*GitHubModelsClient) LastStopReason ¶
func (c *GitHubModelsClient) LastStopReason() string
LastStopReason returns the stop reason from the most recent API call.
func (*GitHubModelsClient) LastUsage ¶
func (c *GitHubModelsClient) LastUsage() *models.UsageInfo
LastUsage returns the token usage from the most recent API call.
func (*GitHubModelsClient) ListModels ¶
ListModels fetches available models from the GitHub Models API. The API returns a plain JSON array (not OpenAI format) with fields:
name, friendly_name, task, publisher, model_family, etc.
We filter to chat-completion models only.