ai

package
v0.68.21 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package ai wires the Genkit runtime and the SpeechKit model catalog into a single LLM/embedding/reranker surface used by Assist and the Voice Agent pipeline-fallback path.

It owns provider keys, model selection, OpenAI-compatible model registration, and the per-Modality plumbing (Utility, Assist, Agent). Routing decisions live in github.com/kombifyio/SpeechKit/internal/router and github.com/kombifyio/SpeechKit/internal/tts; this package is the model substrate they call into.

Index

Constants

This section is empty.

Variables

View Source
var AICallValidation = netsec.ValidationOptions{}

AICallValidation controls URL validation for OpenAI-compatible LLM calls. Zero value = strict (public https only). Tests relax it to allow loopback.

Functions

This section is empty.

Types

type Config

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

	GoogleUtilityModel          string
	GoogleAssistModel           string
	GoogleAgentModel            string
	OpenAIUtilityModel          string
	OpenAIAssistModel           string
	OpenAIAgentModel            string
	GroqUtilityModel            string
	GroqAssistModel             string
	GroqAgentModel              string
	HFUtilityModel              string
	HFAssistModel               string
	HFAgentModel                string
	LocalLLMUtilityModel        string
	LocalLLMAssistModel         string
	LocalLLMAgentModel          string
	OllamaUtilityModel          string
	OllamaAssistModel           string
	OllamaAgentModel            string
	OpenRouterAPIKey            string
	OpenRouterUtilityModel      string
	OpenRouterAssistModel       string
	OpenRouterAgentModel        string
	AssemblyAIAPIKey            string
	AssemblyAILLMGatewayBaseURL string
	AssemblyAIUtilityModel      string
	AssemblyAIAssistModel       string
	AssemblyAIAgentModel        string
	CloudflareAPIKey            string
	CloudflareAccountID         string
	CloudflareGatewayID         string
	CloudflareUtilityModel      string
	CloudflareAssistModel       string
	CloudflareAgentModel        string
	FoundryAPIKey               string
	FoundryBaseURL              string
	FoundryUtilityModel         string
	FoundryAssistModel          string
	FoundryAgentModel           string
	OrderedAssistModels         []OrderedModelSelection
	OrderedAgentModels          []OrderedModelSelection
	UseOrderedAssistModels      bool
	UseOrderedAgentModels       bool
}

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"` // e.g. "utility", "assist", "agent", "utility+assist", or "all"
}

ModelInfo describes a registered model for the UI.

type OrderedModelSelection added in v0.21.1

type OrderedModelSelection struct {
	Provider string
	Model    string
}

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) AssistModels added in v0.18.0

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

AssistModels returns the models configured for direct Assist replies.

func (*Runtime) Generator added in v0.67.0

func (r *Runtime) Generator() generation.Generator

Generator exposes the configured model pool through SpeechKit's provider-neutral generation boundary.

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
Package generation defines SpeechKit's provider-neutral text generation boundary.
Package generation defines SpeechKit's provider-neutral text generation boundary.

Jump to

Keyboard shortcuts

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