openai

package
v0.0.0-...-35c3f38 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Enable

func Enable(apiKey, modelName, baseURL, actionName string) sdk.ClientOption

Enable returns a ClientOption that wires the OpenAI provider. usage: client.New(..., openai.Enable("key", "gpt-4o", "", "my_action"))

func Factory

func Factory(opts map[string]any) (sdk.ClientOption, error)

Factory implements the sdk.ProviderFactory interface.

func Init

func Init(g *genkit.Genkit, modelID string, cfg Config) error

Init registers a specific model (e.g., "gpt-4o") into Genkit's global registry. It maps "openai/{modelID}" in Genkit to "{modelID}" in OpenAI API.

Types

type Config

type Config struct {
	APIKey  string
	BaseURL string // Crucial for Ollama/LocalAI/OpenRouter support
}

Config holds connection parameters.