ai

package
v1.4.452 Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Vendor

type Vendor interface {
	plugins.Plugin
	ListModels(context.Context) ([]string, error)
	SendStream(context.Context, []*chat.ChatCompletionMessage, *domain.ChatOptions, chan domain.StreamUpdate) error
	Send(context.Context, []*chat.ChatCompletionMessage, *domain.ChatOptions) (string, error)
	NeedsRawMode(modelName string) bool
}

type VendorsManager

type VendorsManager struct {
	*plugins.PluginBase
	Vendors       []Vendor
	VendorsByName map[string]Vendor
	Models        *VendorsModels
}

func NewVendorsManager

func NewVendorsManager() *VendorsManager

func (*VendorsManager) AddVendors

func (o *VendorsManager) AddVendors(vendors ...Vendor)

AddVendors registers one or more vendors with the manager. Vendors are stored with lowercase keys to enable case-insensitive lookup.

func (*VendorsManager) Clear

func (o *VendorsManager) Clear()

func (*VendorsManager) Configure

func (o *VendorsManager) Configure() (err error)

func (*VendorsManager) FindByName

func (o *VendorsManager) FindByName(name string) Vendor

FindByName returns a vendor by name. Lookup is case-insensitive. For example, "OpenAI", "openai", and "OPENAI" all match the same vendor.

func (*VendorsManager) GetModels

func (o *VendorsManager) GetModels() (ret *VendorsModels, err error)

func (*VendorsManager) HasVendors

func (o *VendorsManager) HasVendors() bool

func (*VendorsManager) Setup

func (o *VendorsManager) Setup() (ret map[string]Vendor, err error)

func (*VendorsManager) SetupFillEnvFileContent

func (o *VendorsManager) SetupFillEnvFileContent(envFileContent *bytes.Buffer)

func (*VendorsManager) SetupVendor

func (o *VendorsManager) SetupVendor(vendorName string, configuredVendors map[string]Vendor) (err error)

type VendorsModels

type VendorsModels struct {
	*util.GroupsItemsSelectorString
}

func NewVendorsModels

func NewVendorsModels() *VendorsModels

func (*VendorsModels) FilterByVendor added in v1.4.332

func (o *VendorsModels) FilterByVendor(vendor string) *VendorsModels

FilterByVendor returns a new VendorsModels containing only the specified vendor's models. Vendor matching is case-insensitive (e.g., "OpenAI", "openai", and "OPENAI" all match). If the vendor is not found, an empty VendorsModels is returned.

func (*VendorsModels) FindModelNameCaseInsensitive added in v1.4.332

func (o *VendorsModels) FindModelNameCaseInsensitive(modelQuery string) string

FindModelNameCaseInsensitive returns the actual model name from available models, matching case-insensitively. Returns empty string if not found. For example, if the available models contain "gpt-4o" and user queries "GPT-4O", this returns "gpt-4o" (the actual model name that should be sent to the API).

func (*VendorsModels) PrintWithVendor added in v1.4.283

func (o *VendorsModels) PrintWithVendor(shellCompleteList bool, defaultVendor, defaultModel string)

PrintWithVendor prints models including their vendor on each line. When shellCompleteList is true, output is suitable for shell completion. Default vendor and model are highlighted with an asterisk.

Directories

Path Synopsis
Package azureaigateway provides a plugin for Azure API Management (APIM) Gateway fronting multiple AI backends (AWS Bedrock, Azure OpenAI, Google Vertex AI).
Package azureaigateway provides a plugin for Azure API Management (APIM) Gateway fronting multiple AI backends (AWS Bedrock, Azure OpenAI, Google Vertex AI).
Package bedrock provides a plugin to use Amazon Bedrock models.
Package bedrock provides a plugin to use Amazon Bedrock models.
Package codex provides a subscription-backed OpenAI OAuth vendor that talks to the private Codex backend for supported models.
Package codex provides a subscription-backed OpenAI OAuth vendor that talks to the private Codex backend for supported models.
Package copilot provides integration with Microsoft 365 Copilot Chat API.
Package copilot provides integration with Microsoft 365 Copilot Chat API.
Package geminicommon provides shared utilities for Gemini API integrations.
Package geminicommon provides shared utilities for Gemini API integrations.

Jump to

Keyboard shortcuts

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