Documentation
¶
Overview ¶
* ChatCLI - Command Line Interface for LLM interaction * Copyright (c) 2024 Edilson Freitas * License: Apache-2.0
Index ¶
- Constants
- type Client
- func (c *Client) GetModelName() string
- func (c *Client) LastStopReason() string
- func (c *Client) LastUsage() *models.UsageInfo
- func (c *Client) ListModels(ctx context.Context) ([]client.ModelInfo, error)
- func (c *Client) SendPrompt(ctx context.Context, prompt string, history []models.Message, maxTokens int) (string, error)
Constants ¶
View Source
const ( // CopilotAPIBaseURL is the base URL for the GitHub Copilot Chat API. CopilotAPIBaseURL = "https://api.githubcopilot.com" // CopilotChatCompletionsPath is the chat completions endpoint. CopilotChatCompletionsPath = "/chat/completions" // CopilotModelsPath is the models listing endpoint. CopilotModelsPath = "/models" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client implements the LLMClient interface for GitHub Copilot.
func NewClient ¶
func NewClient(token, model string, logger *zap.Logger, maxAttempts int, backoff time.Duration) *Client
NewClient creates a new GitHub Copilot client.
func (*Client) GetModelName ¶
GetModelName returns the friendly display name for the model via catalog.
func (*Client) LastStopReason ¶ added in v1.99.0
LastStopReason returns the stop reason from the most recent API call.
func (*Client) LastUsage ¶ added in v1.99.0
LastUsage returns the token usage from the most recent API call.
func (*Client) ListModels ¶ added in v1.97.0
ListModels fetches available models from the Copilot API's /models endpoint. It also dynamically registers discovered models in the catalog.
Click to show internal directories.
Click to hide internal directories.