githubmodels

package
v1.156.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 10, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

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

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

func (c *GitHubModelsClient) ListModels(ctx context.Context) ([]client.ModelInfo, error)

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.

func (*GitHubModelsClient) SendPrompt

func (c *GitHubModelsClient) SendPrompt(ctx context.Context, prompt string, history []models.Message, maxTokens int) (string, error)

SendPrompt sends a prompt to the GitHub Models API.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL