Directories
¶
| Path | Synopsis |
|---|---|
|
Package ai defines Genkit's AI primitives: models, prompts, tools, embedders, retrievers, and evaluators, and the options that configure a request to them.
|
Package ai defines Genkit's AI primitives: models, prompts, tools, embedders, retrievers, and evaluators, and the options that configure a request to them. |
|
exp
Package exp provides experimental AI primitives for Genkit.
|
Package exp provides experimental AI primitives for Genkit. |
|
exp/localstore
Package localstore provides single-process exp.SessionStore implementations suitable for local development, tests, and single-instance apps (CLI tools, desktop apps, local web services).
|
Package localstore provides single-process exp.SessionStore implementations suitable for local development, tests, and single-instance apps (CLI tools, desktop apps, local web services). |
|
exp/sessionstoretest
Package sessionstoretest checks exp.SessionStore implementations against the contract the agent runtime relies on.
|
Package sessionstoretest checks exp.SessionStore implementations against the contract the agent runtime relies on. |
|
tool
Package tool provides the runtime verbs called from inside a running tool function or WrapTool hook: Interrupt, Fail, AttachParts, SendChunk, ResumeData, OriginalInput, and, in a hook, Released.
|
Package tool provides the runtime verbs called from inside a running tool function or WrapTool hook: Interrupt, Fail, AttachParts, SendChunk, ResumeData, OriginalInput, and, in a hook, Released. |
|
Package core implements Genkit actions and other essential machinery.
|
Package core implements Genkit actions and other essential machinery. |
|
logger
Package logger provides context-scoped structured logging for Genkit.
|
Package logger provides context-scoped structured logging for Genkit. |
|
status
Package status defines Genkit's canonical status codes and the error type that carries them.
|
Package status defines Genkit's canonical status codes and the error type that carries them. |
|
tracing
Package tracing provides execution trace support for Genkit operations.
|
Package tracing provides execution trace support for Genkit operations. |
|
x/streaming
Package streaming provides experimental durable streaming APIs for Genkit.
|
Package streaming provides experimental durable streaming APIs for Genkit. |
|
Package genkit provides a framework for building AI-powered applications in Go.
|
Package genkit provides a framework for building AI-powered applications in Go. |
|
exp
Package exp holds experimental Genkit concepts that are still taking shape.
|
Package exp holds experimental Genkit concepts that are still taking shape. |
|
cmd/copy
command
copy is a tool for copying parts of files.
|
copy is a tool for copying parts of files. |
|
cmd/jsonschemagen
command
A simple, self-contained code generator for JSON Schema.
|
A simple, self-contained code generator for JSON Schema. |
|
cmd/weave
command
The weave command is a simple preprocessor for markdown files.
|
The weave command is a simple preprocessor for markdown files. |
|
fakeembedder
Package fakeembedder provides a fake implementation of genkit.Embedder for testing purposes.
|
Package fakeembedder provides a fake implementation of genkit.Embedder for testing purposes. |
|
genkitbridge
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.
|
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. |
|
schematest
Package schematest provides assertions for the JSON schemas a plugin publishes, so that the fields a user configures in the Dev UI stay documented.
|
Package schematest provides assertions for the JSON schemas a plugin publishes, so that the fields a user configures in the Dev UI stay documented. |
|
tracingbridge
Package tracingbridge is an internal bridge that lets first-party Genkit packages (genkit.Init, the reflection server, core/logger) reach tracing wiring in core/tracing without it being public API, or without an import cycle in core/logger's case.
|
Package tracingbridge is an internal bridge that lets first-party Genkit packages (genkit.Init, the reflection server, core/logger) reach tracing wiring in core/tracing without it being public API, or without an import cycle in core/logger's case. |
|
tracingtest
Package tracingtest captures the spans Genkit reports, in memory and with no OpenTelemetry SDK, for tests across the module.
|
Package tracingtest captures the spans Genkit reports, in memory and with no OpenTelemetry SDK, for tests across the module. |
|
wire
Package wire holds the HTTP wire format that the action handler (package genkit) serves and the remote agent client (package ai/exp) speaks, so the two sides share one definition and cannot drift apart.
|
Package wire holds the HTTP wire format that the action handler (package genkit) serves and the remote agent client (package ai/exp) speaks, so the two sides share one definition and cannot drift apart. |
|
plugins
|
|
|
a2ui/exp
Package exp provides in-preview A2UI ("Agent to UI") support for Genkit agents.
|
Package exp provides in-preview A2UI ("Agent to UI") support for Genkit agents. |
|
compat_oai/anthropic
Package anthropic provides a Genkit plugin for Claude models through Anthropic's OpenAI-compatible endpoint.
|
Package anthropic provides a Genkit plugin for Claude models through Anthropic's OpenAI-compatible endpoint. |
|
compat_oai/dashscope
Package dashscope provides a Genkit plugin for Alibaba Cloud's Qwen models, served through DashScope's OpenAI-compatible mode.
|
Package dashscope provides a Genkit plugin for Alibaba Cloud's Qwen models, served through DashScope's OpenAI-compatible mode. |
|
compat_oai/deepseek
Package deepseek provides a Genkit plugin for DeepSeek's models.
|
Package deepseek provides a Genkit plugin for DeepSeek's models. |
|
compat_oai/kimi
Package kimi provides a Genkit plugin for Moonshot AI's Kimi models.
|
Package kimi provides a Genkit plugin for Moonshot AI's Kimi models. |
|
compat_oai/openai
Package openai provides a Genkit plugin for OpenAI's models and embedders.
|
Package openai provides a Genkit plugin for OpenAI's models and embedders. |
|
compat_oai/openrouter
Package openrouter provides a Genkit plugin for OpenRouter, a gateway that serves models from many providers behind one OpenAI-compatible endpoint.
|
Package openrouter provides a Genkit plugin for OpenRouter, a gateway that serves models from many providers behind one OpenAI-compatible endpoint. |
|
compat_oai/xai
Package xai provides a Genkit plugin for xAI's Grok models.
|
Package xai provides a Genkit plugin for xAI's Grok models. |
|
compat_oai/zai
Package zai provides a Genkit plugin for Z.ai's GLM models.
|
Package zai provides a Genkit plugin for Z.ai's GLM models. |
|
evaluators
Package evaluators defines a set of Genkit Evaluators for popular use-cases
|
Package evaluators defines a set of Genkit Evaluators for popular use-cases |
|
firebase/exp
Package exp provides experimental Firebase integrations for Genkit's agent runtime (see github.com/firebase/genkit/go/ai/exp).
|
Package exp provides experimental Firebase integrations for Genkit's agent runtime (see github.com/firebase/genkit/go/ai/exp). |
|
googlecloud
The googlecloud package supports telemetry (tracing, metrics and logging) using Google Cloud services.
|
The googlecloud package supports telemetry (tracing, metrics and logging) using Google Cloud services. |
|
internal
Package internal contains code that is common to all models
|
Package internal contains code that is common to all models |
|
internal/anthropic/anthropiclive
Package anthropiclive is the live checklist tier for the plugins built on the shared Anthropic Messages API code: the anthropic plugin and the Model Garden Claude models.
|
Package anthropiclive is the live checklist tier for the plugins built on the shared Anthropic Messages API code: the anthropic plugin and the Model Garden Claude models. |
|
internal/jsonschema
Package jsonschema contains JSON Schema helpers shared by Genkit provider plugins.
|
Package jsonschema contains JSON Schema helpers shared by Genkit provider plugins. |
|
internal/livetest
Package livetest is the shared live checklist every model plugin runs against its provider's real API.
|
Package livetest is the shared live checklist every model plugin runs against its provider's real API. |
|
internal/oailive
Package oailive is the live checklist tier for the OpenAI-compatible plugins.
|
Package oailive is the live checklist tier for the OpenAI-compatible plugins. |
|
internal/pgengine
Package pgengine holds the connection setup the postgresql and alloydb plugins share, so their engines connect the same way.
|
Package pgengine holds the connection setup the postgresql and alloydb plugins share, so their engines connect the same way. |
|
internal/systemone
Package systemone implements the System One protocol that decision models speak: a state and a set of typed questions go out, and one typed answer per question comes back.
|
Package systemone implements the System One protocol that decision models speak: a state and a set of typed questions go out, and one typed answer per question comes back. |
|
internal/systemone/systemonetest
Package systemonetest provides a fake System One endpoint for the tests of the plugins that serve decision models.
|
Package systemonetest provides a fake System One endpoint for the tests of the plugins that serve decision models. |
|
internal/uri
Package uri extracts the content-type and data from a media part.
|
Package uri extracts the content-type and data from a media part. |
|
localvec
Package localvec is a local vector database for development and testing.
|
Package localvec is a local vector database for development and testing. |
|
mcp
Package mcp provides a client for integration with the Model Context Protocol.
|
Package mcp provides a client for integration with the Model Context Protocol. |
|
mcp/fixtures/basic_server
command
|
|
|
mcp/fixtures/content_server
command
|
|
|
mcp/fixtures/policy_server
command
|
|
|
mcp/fixtures/server_a
command
|
|
|
mcp/fixtures/server_b
command
|
|
|
middleware
Package middleware provides reusable middleware for Genkit model generation, including retry with exponential backoff and model fallback.
|
Package middleware provides reusable middleware for Genkit model generation, including retry with exponential backoff and model fallback. |
|
middleware/exp
Package exp provides experimental middleware: Agents for sub-agent delegation and Artifacts for session artifact access, which build on the agent APIs in github.com/firebase/genkit/go/ai/exp, and ContextCompression, which keeps long conversations inside a context budget.
|
Package exp provides experimental middleware: Agents for sub-agent delegation and Artifacts for session artifact access, which build on the agent APIs in github.com/firebase/genkit/go/ai/exp, and ContextCompression, which keeps long conversations inside a context budget. |
|
otelgenai
Package otelgenai provides an OpenTelemetry GenAI semantic-conventions instrumentation for Genkit.
|
Package otelgenai provides an OpenTelemetry GenAI semantic-conventions instrumentation for Genkit. |
|
otelgenai/internal/genai
Package genai holds the mapping from Genkit data to OpenTelemetry GenAI semantic conventions: attribute names, value vocabularies, message shapes, and the spec's client metrics.
|
Package genai holds the mapping from Genkit data to OpenTelemetry GenAI semantic conventions: attribute names, value vocabularies, message shapes, and the spec's client metrics. |
|
pinecone
Package pinecone implements a genkit plugin for the Pinecone vector database.
|
Package pinecone implements a genkit plugin for the Pinecone vector database. |
|
postgresql/exp
Package exp provides experimental PostgreSQL integrations for Genkit's agent runtime (see github.com/firebase/genkit/go/ai/exp).
|
Package exp provides experimental PostgreSQL integrations for Genkit's agent runtime (see github.com/firebase/genkit/go/ai/exp). |
|
systemone/exp
Package exp serves decision models, the models that speak the System One protocol, and holds the question types a decision is declared with.
|
Package exp serves decision models, the models that speak the System One protocol, and holds the question types a decision is declared with. |
|
samples
|
|
|
anthropic
command
This sample demonstrates the Anthropic plugin, which speaks Anthropic's native Messages API: a streaming flow that generates a joke with a model pinned through anthropic.ModelRef and the Anthropic SDK's own request type as its config.
|
This sample demonstrates the Anthropic plugin, which speaks Anthropic's native Messages API: a streaming flow that generates a joke with a model pinned through anthropic.ModelRef and the Anthropic SDK's own request type as its config. |
|
basic
command
This sample demonstrates the two kinds of flow:
|
This sample demonstrates the two kinds of flow: |
|
basic-agents
command
This sample demonstrates the agent APIs by defining seven agents in different styles, one per file, behind a single CLI:
|
This sample demonstrates the agent APIs by defining seven agents in different styles, one per file, behind a single CLI: |
|
basic-agents-remote
command
This sample demonstrates a sub-agent that runs in another process.
|
This sample demonstrates a sub-agent that runs in another process. |
|
basic-agents-remote/researcher
command
Command researcher serves the researcher agent of the basic-agents-remote sample on 127.0.0.1:8081.
|
Command researcher serves the researcher agent of the basic-agents-remote sample on 127.0.0.1:8081. |
|
basic-agents-server
command
This sample demonstrates serving agents as plain HTTP endpoints.
|
This sample demonstrates serving agents as plain HTTP endpoints. |
|
basic-decisions
command
This sample demonstrates decisions: asking a System One model typed questions about a state and getting calibrated answers back, instead of asking a chat model for prose and parsing it.
|
This sample demonstrates decisions: asking a System One model typed questions about a state and getting calibrated answers back, instead of asking a chat model for prose and parsing it. |
|
basic-durable-streaming-exp
command
This sample demonstrates durable streaming: a stream a caller can rejoin, whether it is still running or already finished.
|
This sample demonstrates durable streaming: a stream a caller can rejoin, whether it is still running or already finished. |
|
basic-errors
command
This sample demonstrates error handling with the core/status package.
|
This sample demonstrates error handling with the core/status package. |
|
basic-flows
command
This sample shows how flows and their steps (genkit.Run) appear as traces: sequential and nested steps, streaming, a failing step, a failing flow, and a step error the flow recovers from.
|
This sample shows how flows and their steps (genkit.Run) appear as traces: sequential and nested steps, streaming, a failing step, a failing flow, and a step error the flow recovers from. |
|
basic-formats
command
This sample demonstrates output formats: the setting that decides how a model's text is parsed back into Go values, and what a streamed chunk means along the way.
|
This sample demonstrates output formats: the setting that decides how a model's text is parsed back into Go values, and what a streamed chunk means along the way. |
|
basic-media
command
This sample demonstrates media: reading a picture, making one, and making a video from one.
|
This sample demonstrates media: reading a picture, making one, and making a video from one. |
|
basic-middleware/a2ui
command
This sample serves an A2UI-enabled agent over HTTP, compatible with the browser frontend in js/testapps/a2ui/web.
|
This sample serves an A2UI-enabled agent over HTTP, compatible with the browser frontend in js/testapps/a2ui/web. |
|
basic-middleware/budget
command
This sample demonstrates the experimental Budget middleware, which caps the tokens a generate run spends across its whole tool loop.
|
This sample demonstrates the experimental Budget middleware, which caps the tokens a generate run spends across its whole tool loop. |
|
basic-middleware/context-compression
command
This sample demonstrates the experimental ContextCompression middleware on a research loop that fills the context with verbose tool output.
|
This sample demonstrates the experimental ContextCompression middleware on a research loop that fills the context with verbose tool output. |
|
basic-middleware/filesystem
command
This sample demonstrates the Filesystem middleware, which grants the model scoped file access through list_files, read_file, write_file, and search_and_replace tools.
|
This sample demonstrates the Filesystem middleware, which grants the model scoped file access through list_files, read_file, write_file, and search_and_replace tools. |
|
basic-middleware/metering
command
This sample meters model usage per tenant with an observer.
|
This sample meters model usage per tenant with an observer. |
|
basic-middleware/retry-fallback
command
This sample demonstrates composing the Retry and Fallback middlewares into a resilient model pipeline.
|
This sample demonstrates composing the Retry and Fallback middlewares into a resilient model pipeline. |
|
basic-middleware/skills
command
This sample demonstrates the Skills middleware, which offers the model a local library of specialised instructions stored as SKILL.md files.
|
This sample demonstrates the Skills middleware, which offers the model a local library of specialised instructions stored as SKILL.md files. |
|
basic-prompt-content
command
This sample demonstrates how a prompt turns your own data into a request.
|
This sample demonstrates how a prompt turns your own data into a request. |
|
basic-prompts
command
This sample demonstrates prompts, each defined twice: once inline in code with DefinePrompt, and once in a .prompt file (Dotprompt) looked up by name.
|
This sample demonstrates prompts, each defined twice: once inline in code with DefinePrompt, and once in a .prompt file (Dotprompt) looked up by name. |
|
basic-structured
command
This sample demonstrates typed output: the Go type you ask for is the schema the model is held to, so the answer comes back as a struct, not a string.
|
This sample demonstrates typed output: the Go type you ask for is the schema the model is held to, so the answer comes back as a struct, not a string. |
|
basic-tool-interrupts
command
This sample demonstrates tool interrupts, which are how Genkit does human in the loop (HITL): a tool pauses generation to ask a person, and resumes with their answer.
|
This sample demonstrates tool interrupts, which are how Genkit does human in the loop (HITL): a tool pauses generation to ask a person, and resumes with their answer. |
|
basic-tools
command
This sample demonstrates a tool whose answer is more than one value: a slow deployment that streams progress while it runs and attaches a chart to what it returns.
|
This sample demonstrates a tool whose answer is more than one value: a slow deployment that streams progress while it runs and attaches a chart to what it returns. |
|
compat_oai/anthropic
command
This sample demonstrates the Anthropic plugin for the OpenAI-compatible endpoint: a streaming flow that generates a joke with a model pinned through anthropic.ModelRef and its typed config.
|
This sample demonstrates the Anthropic plugin for the OpenAI-compatible endpoint: a streaming flow that generates a joke with a model pinned through anthropic.ModelRef and its typed config. |
|
compat_oai/custom
command
This sample demonstrates the base compat_oai plugin pointed at a custom OpenAI-compatible provider, here OpenRouter: a streaming flow that generates a joke with a model that resolves dynamically by name and takes the OpenAI SDK's own request type as its config.
|
This sample demonstrates the base compat_oai plugin pointed at a custom OpenAI-compatible provider, here OpenRouter: a streaming flow that generates a joke with a model that resolves dynamically by name and takes the OpenAI SDK's own request type as its config. |
|
compat_oai/dashscope
command
This sample demonstrates the DashScope plugin for Alibaba Cloud's Qwen models: a streaming flow that generates a joke with a model pinned through dashscope.ModelRef and its typed config.
|
This sample demonstrates the DashScope plugin for Alibaba Cloud's Qwen models: a streaming flow that generates a joke with a model pinned through dashscope.ModelRef and its typed config. |
|
compat_oai/deepseek
command
This sample demonstrates the DeepSeek plugin: a streaming flow that generates a joke with a model pinned through deepseek.ModelRef and its typed config.
|
This sample demonstrates the DeepSeek plugin: a streaming flow that generates a joke with a model pinned through deepseek.ModelRef and its typed config. |
|
compat_oai/kimi
command
This sample demonstrates the Kimi plugin for Moonshot AI's models: a streaming flow that generates a joke with a model pinned through kimi.ModelRef and its typed config.
|
This sample demonstrates the Kimi plugin for Moonshot AI's models: a streaming flow that generates a joke with a model pinned through kimi.ModelRef and its typed config. |
|
compat_oai/openai
command
This sample demonstrates the OpenAI plugin: a streaming flow that generates a joke with a model pinned through oai.ModelRef and the OpenAI SDK's own request type as its config.
|
This sample demonstrates the OpenAI plugin: a streaming flow that generates a joke with a model pinned through oai.ModelRef and the OpenAI SDK's own request type as its config. |
|
compat_oai/openrouter
command
This sample demonstrates the OpenRouter plugin: a streaming flow that generates a joke through a model named with its upstream vendor's prefix, routed to the cheapest provider serving it, with a second model to fall back to.
|
This sample demonstrates the OpenRouter plugin: a streaming flow that generates a joke through a model named with its upstream vendor's prefix, routed to the cheapest provider serving it, with a second model to fall back to. |
|
compat_oai/xai
command
This sample demonstrates the xAI plugin for the Grok models: a streaming flow that generates a joke with a model pinned through xai.ModelRef and its typed config.
|
This sample demonstrates the xAI plugin for the Grok models: a streaming flow that generates a joke with a model pinned through xai.ModelRef and its typed config. |
|
compat_oai/zai
command
This sample demonstrates the Z.ai plugin for the GLM models: a streaming flow that generates a joke with a model pinned through zai.ModelRef and its typed config.
|
This sample demonstrates the Z.ai plugin for the GLM models: a streaming flow that generates a joke with a model pinned through zai.ModelRef and its typed config. |
|
durable-streaming-firestore
command
This sample demonstrates durable streaming with Firestore backend.
|
This sample demonstrates durable streaming with Firestore backend. |
|
firebase-retrievers
command
|
|
|
mcp-ception
command
|
|
|
mcp-client
command
|
|
|
mcp-server
command
|
|
|
menu
command
|
|
|
modelgarden
command
|
|
|
modelgarden-llama
command
|
|
|
modelgarden-mistral
command
|
|
|
ollama-tools
command
|
|
|
ollama-vision
command
|
|
|
pgvector
command
This program can be manually tested like so:
|
This program can be manually tested like so: |
|
rag
command
|
|
|
vectorsearch-biqguery
command
|
|
|
vectorsearch-firestore
command
|
|
|
tests
|
|
|
test_app
command
This program doesn't do anything interesting.
|
This program doesn't do anything interesting. |
Click to show internal directories.
Click to hide internal directories.