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

genkitbridge

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package genkitbridge is an internal bridge that lets first-party Genkit subpackages (notably genkit/exp) reach the api.Registry backing a *genkit.Genkit without the genkit package exposing a public accessor.

The genkit package installs RegistryOf from its init; genkit/exp calls it to hand the registry to the registry-level constructors in ai/exp. Because this package lives under go/internal, code outside the Genkit module cannot import it, so registry access stays first-party only.

Index

Constants

This section is empty.

Variables

View Source
var RegistryOf func(host any) api.Registry

RegistryOf returns the api.Registry backing host, which must be a *genkit.Genkit. It is installed by the genkit package's init.

The host parameter is typed as any rather than *genkit.Genkit to keep this package free of an import cycle with genkit (genkit imports this package to install the extractor). First-party callers always pass a *genkit.Genkit.

View Source
var SeedContextForRegistry func(ctx context.Context, reg api.Registry) context.Context

SeedContextForRegistry returns ctx with the *genkit.Genkit backing reg attached, so it can be retrieved with genkit.FromContext. It is installed by the genkit package's init. ai/exp's agent constructors call it to seed the Genkit instance into every agent turn, and ai's generate loop calls it to seed each generation, so prompts, tools, and middleware can resolve and run other actions without direct registry access.

The Genkit instance is reconstructed from reg (a *genkit.Genkit is a thin wrapper over its registry), so ai and ai/exp need not hold a *genkit.Genkit themselves and stay genkit-agnostic. It is nil until the genkit package is linked into the build; callers treat a nil hook as "no seeding", leaving actions defined on a bare registry untouched.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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