Help us shape the future of Go! Take the 2026 Go Developer Survey

registry

package
v0.5.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	DefaultModelKey = "genkit/defaultModel"
	PromptDirKey    = "genkit/promptDir"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Environment

type Environment string

An Environment is the execution context in which the program is running.

const (
	EnvironmentDev  Environment = "dev"  // development: testing, debugging, etc.
	EnvironmentProd Environment = "prod" // production: user data, SLOs, etc.
)

func CurrentEnvironment

func CurrentEnvironment() Environment

CurentEnvironment returns the currently active environment.

type Registry

type Registry struct {
	Dotprompt *dotprompt.Dotprompt
	// contains filtered or unexported fields
}

func New

func New() (*Registry, error)

func (*Registry) DefineHelper added in v0.5.0

func (r *Registry) DefineHelper(name string, fn any) error

DefineHelper adds a helper function to the dotprompt instance

func (*Registry) DefinePartial added in v0.5.0

func (r *Registry) DefinePartial(name string, source string) error

DefinePartial adds the partial to the list of partials to the dotprompt instance

func (*Registry) Freeze

func (r *Registry) Freeze()

func (*Registry) ListActions

func (r *Registry) ListActions() []action.Desc

ListActions returns a list of descriptions of all registered actions. The list is sorted by action name.

func (*Registry) ListValues added in v0.5.0

func (r *Registry) ListValues() map[string]any

ListValues returns a list of values of all registered values.

func (*Registry) LookupAction

func (r *Registry) LookupAction(key string) action.Action

LookupAction returns the action for the given key, or nil if there is none.

func (*Registry) LookupPlugin added in v0.3.0

func (r *Registry) LookupPlugin(name string) any

LookupPlugin returns the plugin for the given name, or nil if there is none.

func (*Registry) LookupValue added in v0.3.0

func (r *Registry) LookupValue(name string) any

LookupValue returns the value for the given name, or nil if there is none.

func (*Registry) RegisterAction

func (r *Registry) RegisterAction(typ atype.ActionType, a action.Action)

RegisterAction records the action in the registry. It panics if an action with the same type, provider and name is already registered.

func (*Registry) RegisterPlugin added in v0.3.0

func (r *Registry) RegisterPlugin(name string, p any)

RegisterPlugin records the plugin in the registry. It panics if a plugin with the same name is already registered.

func (*Registry) RegisterSpanProcessor

func (r *Registry) RegisterSpanProcessor(sp sdktrace.SpanProcessor)

func (*Registry) RegisterValue added in v0.3.0

func (r *Registry) RegisterValue(name string, v any)

RegisterValue records an arbitrary value in the registry. It panics if a value with the same name is already registered.

func (*Registry) TracingState

func (r *Registry) TracingState() *tracing.State

Jump to

Keyboard shortcuts

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