genkit

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Genkit

func Genkit() *genkit.Genkit

Genkit returns the Genkit instance

func Init

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

Init initializes the genkit package with multi-vendor config

Types

type ArkConfig

type ArkConfig struct {
	APIKey  string        `toml:"api_key"`
	BaseURL string        `toml:"base_url"`
	Models  []ModelConfig `toml:"models"`
}

ArkConfig holds configuration for Ark vendor

func (*ArkConfig) Validate

func (c *ArkConfig) Validate() error

Validate checks Ark configuration

type ArkPlugin

type ArkPlugin struct {
	compat_oai.OpenAICompatible
	// contains filtered or unexported fields
}

ArkPlugin implements Genkit plugin for Volcengine Ark (Doubao)

func NewArkPlugin

func NewArkPlugin(cfg ArkConfig) *ArkPlugin

NewArkPlugin creates a new Ark plugin for Genkit

func (*ArkPlugin) Init

func (p *ArkPlugin) Init(ctx context.Context) []api.Action

Init implements api.Plugin interface - registers all Ark models

func (*ArkPlugin) Name

func (p *ArkPlugin) Name() string

Name returns the plugin name

type Config

type Config struct {
	Ark       ArkConfig `toml:"ark"`
	PromptDir string    `toml:"prompt_dir"`
}

Config holds unified genkit configuration with all vendors

func (*Config) Validate

func (c *Config) Validate() error

Validate checks genkit configuration

type ModelConfig

type ModelConfig struct {
	Name    string    `toml:"name"`     // Model name for registration (e.g., "doubao-lite", "doubao-pro-32k")
	Type    ModelType `toml:"type"`     // ModelTypeLLM or ModelTypeEmbedding
	Model   string    `toml:"model"`    // Actual model identifier
	BaseURL string    `toml:"base_url"` // Override base URL for this model (optional)
	Dim     int       `toml:"dim"`      // Embedding dimension (required for embedding models)
}

ModelConfig holds configuration for a single model (shared by all vendors)

func (*ModelConfig) Validate

func (m *ModelConfig) Validate(index int) error

Validate validates a model config

type ModelType

type ModelType string
const (
	ModelTypeLLM       ModelType = "llm"
	ModelTypeEmbedding ModelType = "embedding"
)

Model type constants

Jump to

Keyboard shortcuts

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