ai

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	GoogleAPIKey     string
	OpenAIAPIKey     string
	GroqAPIKey       string
	HuggingFaceToken string
	OllamaBaseURL    string

	GoogleUtilityModel     string
	GoogleAgentModel       string
	OpenAIUtilityModel     string
	OpenAIAgentModel       string
	GroqUtilityModel       string
	GroqAgentModel         string
	HFUtilityModel         string
	HFAgentModel           string
	OllamaUtilityModel     string
	OllamaAgentModel       string
	OpenRouterAPIKey       string
	OpenRouterUtilityModel string
	OpenRouterAgentModel   string
}

Config holds all provider API keys and model selections for Genkit initialization.

type ModelInfo

type ModelInfo struct {
	ID       string `json:"id"`
	Provider string `json:"provider"`
	Name     string `json:"name"`
	Tier     string `json:"tier"` // "utility", "agent", or "both"
}

ModelInfo describes a registered model for the UI.

type Runtime

type Runtime struct {
	G *genkit.Genkit
	// contains filtered or unexported fields
}

Runtime holds the Genkit instance and categorized model references.

func Init

func Init(ctx context.Context, cfg Config) (*Runtime, error)

Init creates a Genkit instance with all configured providers and returns a Runtime.

func (*Runtime) AgentModels

func (r *Runtime) AgentModels() []ai.Model

AgentModels returns the models configured for agent tasks (reasoning, autonomous).

func (*Runtime) AllModels

func (r *Runtime) AllModels() map[string]ai.Model

AllModels returns all registered models keyed by their full ID.

func (*Runtime) ModelInfos

func (r *Runtime) ModelInfos() []ModelInfo

ModelInfos returns metadata about all registered models for the UI.

func (*Runtime) UtilityModels

func (r *Runtime) UtilityModels() []ai.Model

UtilityModels returns the models configured for utility tasks (summarize, codewords).

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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