
Go agent frameworks compared: ADK, Eino, Genkit, LangChainGo, and trpc-agent-go
Five Go agent frameworks set against the parts of a harness, with one task ported and measured.
On the agent compass The whole loop, all four stagesA framework hands you the loop, tool dispatch, memory, and tracing on day one, and you supply the prompt, the tools, and the policy. That is a good deal for a lot of teams. The trouble is choosing between frameworks: a list of features per framework is out of date within a few months. A steadier way to judge one is to hold it up against the parts of an agent you could write yourself, and ask, part by part, what it does for you, what it does differently, and what is still left for you to write.
This page does exactly that, using a hand-built agent harness as the yardstick. Chapter 16 of the book makes the full comparison; this page gives the short version. The version numbers and facts below come from reading each module’s source in October 2026, so they will age; the questions at the end are meant to outlast them. A disclosure: the author builds bide, a Go framework for durable agents. It is left out of the comparison so that this page never grades the author’s own work.
Five frameworks, five central nouns
- ADK for Go (Google): an agent, plus a runner that runs it inside a session, which is the framework’s saved record of one conversation. It is a port of Google’s Python ADK.
- Eino (ByteDance’s CloudWeGo group): a graph; its agents sit on top of graphs.
- Genkit (Google): a flow, meaning a function you register so Genkit traces it and its developer UI can run it, and a
Generatecall that drives the tool loop. - LangChainGo (an independent port of LangChain’s ideas): a chain, and an executor that drives an agent.
- trpc-agent-go (Tencent): an agent and a runner, with a graph package alongside.
Which noun a framework puts at the center tells you how it models an agent. An orchestration graph pays off for a program made of many fixed steps and branches whose progress has to outlive a crash: think of a nightly job that pulls a report, labels it, sends it to one of several queues, and holds until someone signs off. A tool-calling agent has a different shape. It is a single loop, and the model decides what happens on each pass.
The parts, mapped
Every cell records what the framework offers for that part, from a built-in feature to an external package, or none.
The comparison ran Eino and Genkit; the other three columns come from their documentation and source, with no run behind them.
| Part | ADK v1.9.0 | Eino v0.9.21 | Genkit v1.13.1 | LangChainGo v0.1.15 | trpc-agent-go v1.11.2 |
|---|---|---|---|---|---|
| Turn limit by default | none | 20, then an error | 50, then an error | 5, then an error | none; two opt-in limits |
| A tool’s error goes to the model | has | opt-in wrapper; by default the run ends | none: the run ends | none: the run ends | has |
| A panicking tool | recovered, sent to the model | recovered, ends the run | crashes the process | not recovered: the panic reaches your code | recovered, sent to the model |
| Context policy | none | opt-in summarization and reduction | none; a hook for trimming history yourself | window and token buffers | session summaries |
| Retrying model calls | none (a plugin guides the model on failed tools) | opt-in | opt-in middleware, plus the client’s own two retries | none | the client’s, plus failover |
| Tracing | OpenTelemetry | Langfuse and LangSmith handlers in eino-ext | OpenTelemetry | none | OpenTelemetry, Langfuse |
| Evals | none in Go | none | evaluators | none | a nested module |
| Pausing for a person | opt-in tool confirmation | opt-in interrupts | opt-in interrupts, approval middleware | none | opt-in graph interrupts |
| Saved state to resume from | sessions in memory, a database, or Vertex AI | a checkpoint interface, no store | experimental sessions | conversation memory only | checkpoints in memory, SQLite, or Redis |
Takes your *http.Client for an OpenAI-compatible API |
v2 only, experimental | has | has | has | has |
| Development UI | has | an IDE plugin | has | none | none; an AG-UI server for chat front ends |
One cell rests on less than the others. Genkit’s panic cell comes from its source and from one probe run, described below; no test in the companion code panics a tool.
In Genkit’s source, each tool runs in a goroutine Genkit starts, so no recover in your own goroutine can catch its panic (recover is the built-in that stops a panic from crashing the program, and it works only in the goroutine that panicked).
The probe run, made while this table was checked, ended with the process exiting.
The v1 releases of ADK for Go speak only to Gemini models; the v2 line adds an OpenAI-compatible adapter, still marked experimental. There is nothing odd about a model provider’s framework favoring that provider’s models, but if your agent may need to change providers, check this first.
One task, three versions, the same replies
For the comparison, one job was taken from the triage agent, diagnosing a single crash group with three tools, and written again in Eino and in Genkit.
The job was picked with a hard step on purpose.
Filing an issue with issue_file requires a person to approve it, so each version has to halt, hold its state, and pick up again after the decision.
This tilts things toward the hand-built harness, because the approval gate, error handling, and retries are parts that harness supplies.
A task built around what the frameworks offer and the harness doesn’t (many providers, a development UI, a fixed multi-step pipeline) would show their strengths instead.
Eino and Genkit both let you hand them your own *http.Client.
That made it possible to feed all three versions the same scripted replies, written by hand in the harness’s replay format, through one transport that also saved a copy of every request each version made.
In Eino, the approval is an interrupt raised from inside the tool: the tool stops the run and asks to be resumed later with the person’s answer.
// fileIssue is issue_file. The first time it runs it interrupts the
// run; when the run resumes, the person's decision arrives as resume
// data addressed to this call.
func fileIssue(env *task.Env) func(context.Context, task.IssueArgs) (
string, error) {
return func(ctx context.Context, a task.IssueArgs) (string, error) {
if was, _, _ := tool.GetInterruptState[any](ctx); !was {
return "", tool.Interrupt(ctx, a)
}
target, has, approved := tool.GetResumeContext[bool](ctx)
if !target {
return "", tool.Interrupt(ctx, a) // another call resumed
}
if !has || !approved {
return task.Denied, nil
}
return env.FileIssue(ctx, a)
}
}
In Genkit it is middleware set on the generate options, which has the same shape as the hand-built approval gate:
// options sets up Genkit with the OpenRouter plugin and returns what
// every Generate call in a run shares: the model, the tools, the turn
// limit, and the approval middleware.
func options(ctx context.Context, c task.Config, env *task.Env) (
*genkit.Genkit, *ai.ToolAction[task.IssueArgs, string],
[]ai.GenerateOption) {
g := genkit.Init(ctx, genkit.WithPlugins(&openrouter.OpenRouter{
APIKey: c.APIKey,
Opts: []option.RequestOption{option.WithBaseURL(c.BaseURL),
option.WithHTTPClient(c.HTTP)},
}))
issue, ts := tools(g, env)
return g, issue, []ai.GenerateOption{
ai.WithModel(openrouter.ModelRef(task.Model, nil)),
ai.WithTools(ts...), ai.WithMaxTurns(10),
ai.WithUse(&middleware.ToolApproval{
AllowedTools: []string{"run_tests", "submit_diagnosis"}}),
}
}
Here is what the code measured (go run ./compare prints the table, and a test checks it):
| Measure | Hand-built agent | Eino | Genkit |
|---|---|---|---|
| Lines of code for the task | 80 | 156 | 116 |
| Lines under it, outside the standard library and the shared task code | 5,351 | 97,076 | 132,201 |
| Modules under it | 0 | 27 | 29 |
| Model calls to finish the scripted run | 3 | 3 | 4 |
| A tool’s error | sent to the model, which corrected the call | ends the run | ends the run |
| A 503 on the first call, as ported | retried | ends the run | retried by the underlying client |
| Bytes kept while waiting for the person | 1,692 | 45,562 | 1,322 |
Be careful with the line counts. The hand-built version is only 80 lines because 5,351 lines from fourteen earlier stages of the harness sit beneath it, so the row doesn’t show the frameworks needing more code for the same job. Turned around, those 5,351 lines are roughly what adopting a framework would spare you. Not all of them, though: around 1,500 are the sandbox (the limits on what a tool may touch), the egress check (which network destinations are allowed), and the audit log (a record of what the agent did), and neither framework supplies those.
The first requests from all three versions were almost identical, within 70 bytes of each other, and neither framework added a prompt of its own.
Where the versions did differ, each difference traced back to a default that somebody chose, and each default is defensible: ending the run on a tool error or not, retrying a 503 or not, sending a string result as plain text or as a JSON-encoded string, marking schemas strict or not.
Finding one difference meant reading two layers below the framework.
Genkit’s plugin is built on the OpenAI Go library, and that library waits between retries with time.Sleep, which ignores the context.
When a run was cancelled 100 milliseconds into a retry, Genkit took 421 to 485 milliseconds to return; the hand-built version took 100 to 103.
A batch job won’t notice.
A handler serving a request with a deadline will, because its goroutine stays busy until the sleep ends.
Each version was also run once against a live model, anthropic/claude-haiku-5.5; each filed one issue and submitted a diagnosis, and the three runs cost $0.0028 between them.
What frameworks give
These are things you get from a framework that the hand-built harness never builds:
- Provider breadth. Genkit ships plugins for Anthropic’s, Google’s, and Ollama’s APIs; eino-ext covers Claude, Gemini, DeepSeek, Qwen, Ollama, and others.
- Context management you can switch on, in the form of Eino’s opt-in summarization and reduction middleware.
- Development UIs for stepping through a run, replaying one step, and changing a prompt in place. ADK and Genkit include one, and Eino offers an IDE plugin.
- Tracing integrations: ADK, Genkit, and trpc-agent-go emit OpenTelemetry, and trpc-agent-go also has a Langfuse handler; Eino has Langfuse and LangSmith handlers.
- Small parts done well. Genkit’s own retry middleware stops waiting as soon as the context is done, unlike the OpenAI library beneath it. Eino’s error wrapper turns tool errors into results without swallowing interrupts. ADK’s
retryandreflectplugin coaches the model after a tool call fails. - Multi-agent patterns and graphs that the harness would need several more stages to write.
What they cost
- Churn. These frameworks are new and change quickly. Pin the version, read the changelog before upgrading, and keep a replay test, so a behavior change breaks a test instead of a production run.
- Defaults you didn’t pick. You find them by recording what the framework sends and reading it.
- Their own error vocabularies. To separate “ran out of budget” from “the model replied badly” from “a tool failed”, you learn each framework’s names for those cases.
- Behavior you can’t see into, like the retry sleep described above. Your own code from a year ago can surprise you the same way; a framework’s loop is simply larger, and the eight questions below are a quick way to read it.
The vendor SDKs sit between the two paths.
Anthropic’s Go SDK has a tool runner that repeats the model call and the tool calls until the model is done; it has no turn limit until you set MaxIterations, and it returns tool errors to the model.
For an agent on one provider with a loop as simple as the minimal one in the companion code, an SDK’s runner is a reasonable place to stop.
Eight questions for any framework
- Where is the loop? When a run goes wrong, this is the code you’ll be reading.
- How many turns does a run get, and what happens when it runs out?
- Where do a tool error, a call to a tool that doesn’t exist, and a panic end up?
- Who retries a failed call, and how long is each wait? Check the provider client underneath the framework too.
- What does cancellation do? Cancel once mid-tool-call and once mid-retry, and measure how long the return takes.
- Can you pass your own
*http.Client? If yes, every request can be recorded, replayed, and read. - What goes over the wire? Open the very first request and read it.
- Where does a paused run’s state live, and how does it resume?
Two of these answers are disqualifying for an agent that runs on its own and spends money: no way to set a turn limit, and no way to supply your own HTTP client. None of the five fails either test, although ADK needs a turn limit added and trpc-agent-go’s limits do nothing until you turn them on. The other answers are mostly costs, and you can plan for those.
That leaves three choices. Build if the agent is your product and you need a say in every byte sent and every failure path. Adopt if your needs line up with the framework’s strengths and you agree with its answers to the questions. Adopt for part of the job if one piece is worth borrowing: a provider adapter that sits behind your own model interface, a tracing exporter, or a graph runner wrapped around a loop you keep. This page reads these questions from the builder’s side, and says so; a team whose agent is one feature of a larger product could weigh the same answers differently. One worked example of each of the first two follows. A triage service that has to survive restarts while approvals are pending comes out as build. A support bot that writes draft replies for a person to send, wants to try several providers and use a development UI, and loses little when a run fails, comes out as adopt.
Try it
The ports live in their own module in the companion code.
From the code directory of a clone of the companion repository:
$ cd ch16
$ go run ./compare
$ go run ./compare -cancel
The first command runs the three versions on the scripted replies and prints the comparison table; the second measures how long each takes to return when cancelled during a retry. See the ch16 example for more.
func fileIssue(env *task.Env) func(context.Context, task.IssueArgs) (
string, error)
fileIssue is issue_file.
fileIssue is issue_file. func fileIssue(env *task.Env) func(context.Context, task.IssueArgs) ( string, error). In ch16/eino/eino.go, line 31.
package task ("github.com/blackwell-systems/go-agents-book/code/ch16/task")
Package task is the job each version of the agent does in chapter 16: diagnose one crash group with three tools, run_tests, issue_file, which a person must approve, and submit_diagnosis, the answer.
Package task is the job each version of the agent does in chapter 16: diagnose one crash group with three tools, run_tests, issue_file, which a person must approve, and submit_diagnosis, the answer. package task ("github.com/blackwell-systems/go-agents-book/code/ch16/task"). In ch16/task.
type Env struct {
// Approve is the person's decision on an issue; nil approves all.
Approve func(IssueArgs) bool
mu sync.Mutex
asked int
issues []IssueArgs
diagnosis *Diagnosis
}
Env is the world the tools act on: canned test output, an issue tracker in memory, and the person who approves issues.
Env is the world the tools act on: canned test output, an issue tracker in memory, and the person who approves issues. type Env struct { // Approve is the person's decision on an issue; nil approves all. Approve func(IssueArgs) bool mu sync.Mutex asked int issues []IssueArgs diagnosis *Diagnosis }. In ch16/task/task.go, line 66.
package context ("context")
Package context defines the Context type, which carries deadlines, cancellation signals, and other request-scoped values across API boundaries and between processes.
Package context defines the Context type, which carries deadlines, cancellation signals, and other request-scoped values across API boundaries and between processes. package context ("context"). Documented at pkg.go.dev, context.
type Context interface {
// Deadline returns the time when work done on behalf of this context
// should be canceled. Deadline returns ok==false when no deadline is
// set. Successive calls to Deadline return the same results.
Deadline() (deadline time.Time, ok bool)
// Done returns a channel that's closed when work done on behalf of this
// context should be canceled. Done may return nil if this context can
// never be canceled. Successive calls to Done return the same value.
// The close of the Done channel may happen asynchronously,
// ...
}
A Context carries a deadline, a cancellation signal, and other values across API boundaries.
A Context carries a deadline, a cancellation signal, and other values across API boundaries. type Context interface { // Deadline returns the time when work done on behalf of this context // should be canceled. Deadline returns ok==false when no deadline is // set. Successive calls to Deadline return the same results. Deadline() (deadline time.Time, ok bool) // Done returns a channel that's closed when work done on behalf of this // context should be canceled. Done may return nil if this context can // never be canceled. Successive calls to Done return the same value. // The close of the Done channel may happen asynchronously, // ... }. Documented at pkg.go.dev, context.Context.
type IssueArgs struct {
Title string `json:"title" jsonschema:"required" desc:"one line naming the bug" jsonschema_description:"one line naming the bug"`
Body string `json:"body" jsonschema:"required" desc:"the cause, the evidence, and the reports" jsonschema_description:"the cause, the evidence, and the reports"`
}
IssueArgs are issue_file's arguments.
IssueArgs are issue_file's arguments. type IssueArgs struct { Title string `json:"title" jsonschema:"required" desc:"one line naming the bug" jsonschema_description:"one line naming the bug"` Body string `json:"body" jsonschema:"required" desc:"the cause, the evidence, and the reports" jsonschema_description:"the cause, the evidence, and the reports"` }. In ch16/task/task.go, line 40.
type string string
string is the set of all strings of 8-bit bytes, conventionally but not necessarily representing UTF-8-encoded text.
string is the set of all strings of 8-bit bytes, conventionally but not necessarily representing UTF-8-encoded text. type string string. Documented at pkg.go.dev, builtin.string.
type error interface {
Error() string
}
The error built-in interface type is the conventional interface for representing an error condition, with the nil value representing no error.
The error built-in interface type is the conventional interface for representing an error condition, with the nil value representing no error. type error interface { Error() string }. Documented at pkg.go.dev, builtin.error.
package tool ("github.com/cloudwego/eino/components/tool")
package tool ("github.com/cloudwego/eino/components/tool").
func GetInterruptState[T any](ctx context.Context) (wasInterrupted bool, hasState bool, state T)
GetInterruptState checks if the tool was previously interrupted and retrieves saved state.
github.com/cloudwego/eino/components/tool.GetInterruptState
GetInterruptState checks if the tool was previously interrupted and retrieves saved state. func GetInterruptState[T any](ctx context.Context) (wasInterrupted bool, hasState bool, state T). Documented at pkg.go.dev, github.com/cloudwego/eino/components/tool.GetInterruptState.
type any = interface{}
any is an alias for interface{} and is equivalent to interface{} in all ways.
any is an alias for interface{} and is equivalent to interface{} in all ways. type any = interface{}. Documented at pkg.go.dev, builtin.any.
func Interrupt(ctx context.Context, info any) error
Interrupt pauses tool execution and signals the orchestration layer to checkpoint.
github.com/cloudwego/eino/components/tool.Interrupt
Interrupt pauses tool execution and signals the orchestration layer to checkpoint. func Interrupt(ctx context.Context, info any) error. Documented at pkg.go.dev, github.com/cloudwego/eino/components/tool.Interrupt.
func GetResumeContext[T any](ctx context.Context) (isResumeTarget bool, hasData bool, data T)
GetResumeContext checks if this tool is the explicit target of a resume operation.
github.com/cloudwego/eino/components/tool.GetResumeContext
GetResumeContext checks if this tool is the explicit target of a resume operation. func GetResumeContext[T any](ctx context.Context) (isResumeTarget bool, hasData bool, data T). Documented at pkg.go.dev, github.com/cloudwego/eino/components/tool.GetResumeContext.
type bool bool
bool is the set of boolean values, true and false.
bool is the set of boolean values, true and false. type bool bool. Documented at pkg.go.dev, builtin.bool.
const Denied = "the person didn't approve this issue; don't file it again"
Denied is the tool result for an issue the person refused.
Denied is the tool result for an issue the person refused. const Denied = "the person didn't approve this issue; don't file it again". In ch16/task/task.go, line 153.
var nil Type
nil is a predeclared identifier representing the zero value for a pointer, channel, func, interface, map, or slice type.
nil is a predeclared identifier representing the zero value for a pointer, channel, func, interface, map, or slice type. var nil Type. Documented at pkg.go.dev, builtin.nil.
func (e *Env) FileIssue(ctx context.Context, a IssueArgs) (string, error)
FileIssue files an issue that a person has already approved, and returns its number.
FileIssue files an issue that a person has already approved, and returns its number. func (e *Env) FileIssue(ctx context.Context, a IssueArgs) (string, error). In ch16/task/task.go, line 127.
func options(ctx context.Context, c task.Config, env *task.Env) (
*genkit.Genkit, *ai.ToolAction[task.IssueArgs, string],
[]ai.GenerateOption)
options sets up Genkit with the OpenRouter plugin and returns what every Generate call in a run shares: the model, the tools, the turn limit, and the approval middleware.
options sets up Genkit with the OpenRouter plugin and returns what every Generate call in a run shares: the model, the tools, the turn limit, and the approval middleware. func options(ctx context.Context, c task.Config, env *task.Env) ( *genkit.Genkit, *ai.ToolAction[task.IssueArgs, string], []ai.GenerateOption). In ch16/genkit/genkit.go, line 49.
var ctx context.Context
var ctx context.Context. In ch16/genkit/genkit.go, line 49.
package context ("context")
Package context defines the Context type, which carries deadlines, cancellation signals, and other request-scoped values across API boundaries and between processes.
Package context defines the Context type, which carries deadlines, cancellation signals, and other request-scoped values across API boundaries and between processes. package context ("context"). Documented at pkg.go.dev, context.
package task ("github.com/blackwell-systems/go-agents-book/code/ch16/task")
Package task is the job each version of the agent does in chapter 16: diagnose one crash group with three tools, run_tests, issue_file, which a person must approve, and submit_diagnosis, the answer.
Package task is the job each version of the agent does in chapter 16: diagnose one crash group with three tools, run_tests, issue_file, which a person must approve, and submit_diagnosis, the answer. package task ("github.com/blackwell-systems/go-agents-book/code/ch16/task"). In ch16/task.
type Config struct {
BaseURL string // OpenRouter's, or a replay's
APIKey string // any non-empty value in replay
HTTP *http.Client // carries the replaying or recording transport
}
Config is what every version needs to reach the model.
Config is what every version needs to reach the model. type Config struct { BaseURL string // OpenRouter's, or a replay's APIKey string // any non-empty value in replay HTTP *http.Client // carries the replaying or recording transport }. In ch16/task/wire.go, line 44.
package genkit ("github.com/firebase/genkit/go/genkit")
package genkit ("github.com/firebase/genkit/go/genkit").
type Genkit struct {
reg *registry.Registry // Registry for actions, values, and other resources.
}
Genkit encapsulates a Genkit instance, providing access to its registry, configuration, and core functionalities.
github.com/firebase/genkit/go/genkit.Genkit
Genkit encapsulates a Genkit instance, providing access to its registry, configuration, and core functionalities. type Genkit struct { reg *registry.Registry // Registry for actions, values, and other resources. }. Documented at pkg.go.dev, github.com/firebase/genkit/go/genkit.Genkit.
package ai ("github.com/firebase/genkit/go/ai")
package ai ("github.com/firebase/genkit/go/ai").
type ToolAction[In, Out any] struct {
action api.Action // The underlying action.
multipart bool // Whether this is a multipart-only tool.
registry api.Registry // Registry for schema resolution. Set when registered.
}
ToolAction is a tool backed by a registry action.
github.com/firebase/genkit/go/ai.ToolAction
ToolAction is a tool backed by a registry action. type ToolAction[In, Out any] struct { action api.Action // The underlying action. multipart bool // Whether this is a multipart-only tool. registry api.Registry // Registry for schema resolution. Set when registered. }. Documented at pkg.go.dev, github.com/firebase/genkit/go/ai.ToolAction.
type GenerateOption interface {
applyGenerate(*generateOptions)
}
GenerateOption is an option for generating a model response.
github.com/firebase/genkit/go/ai.GenerateOption
GenerateOption is an option for generating a model response. type GenerateOption interface { applyGenerate(*generateOptions) }. Documented at pkg.go.dev, github.com/firebase/genkit/go/ai.GenerateOption.
var g *genkit.Genkit
var g *genkit.Genkit. In ch16/genkit/genkit.go, line 52.
func Init(ctx context.Context, opts ...GenkitOption) *Genkit
Init creates and initializes a new [Genkit] instance with the provided options.
github.com/firebase/genkit/go/genkit.Init
Init creates and initializes a new [Genkit] instance with the provided options. func Init(ctx context.Context, opts ...GenkitOption) *Genkit. Documented at pkg.go.dev, github.com/firebase/genkit/go/genkit.Init.
func WithPlugins(plugins ...api.Plugin) GenkitOption
WithPlugins provides a list of plugins to initialize when creating the Genkit instance.
github.com/firebase/genkit/go/genkit.WithPlugins
WithPlugins provides a list of plugins to initialize when creating the Genkit instance. func WithPlugins(plugins ...api.Plugin) GenkitOption. Documented at pkg.go.dev, github.com/firebase/genkit/go/genkit.WithPlugins.
package openrouter ("github.com/firebase/genkit/go/plugins/compat_oai/openrouter")
package openrouter ("github.com/firebase/genkit/go/plugins/compat_oai/openrouter").
type OpenRouter struct {
// APIKey is the OpenRouter API key. If empty, OPENROUTER_API_KEY is
// consulted.
APIKey string
// SiteURL identifies the calling application on OpenRouter's rankings,
// sent as the HTTP-Referer header. It is optional and affects
// attribution only.
SiteURL string
// AppName is the title the calling application appears under on
// OpenRouter's rankings, sent as the X-Title header. It is optional and
// ...
}
OpenRouter configures the OpenRouter plugin.
github.com/firebase/genkit/go/plugins/compat_oai/openrouter.OpenRouter
OpenRouter configures the OpenRouter plugin. type OpenRouter struct { // APIKey is the OpenRouter API key. If empty, OPENROUTER_API_KEY is // consulted. APIKey string // SiteURL identifies the calling application on OpenRouter's rankings, // sent as the HTTP-Referer header. It is optional and affects // attribution only. SiteURL string // AppName is the title the calling application appears under on // OpenRouter's rankings, sent as the X-Title header. It is optional and // ... }. Documented at pkg.go.dev, github.com/firebase/genkit/go/plugins/compat_oai/openrouter.OpenRouter.
field APIKey string
APIKey is the OpenRouter API key.
github.com/firebase/genkit/go/plugins/compat_oai/openrouter.OpenRouter.APIKey
APIKey is the OpenRouter API key. field APIKey string. Documented at pkg.go.dev, github.com/firebase/genkit/go/plugins/compat_oai/openrouter.OpenRouter.APIKey.
field APIKey string
any non-empty value in replay
any non-empty value in replay field APIKey string. In ch16/task/wire.go, line 46.
field Opts []option.RequestOption
Opts contains additional OpenAI client request options, such as [option.WithBaseURL] for a different endpoint (OPENROUTER_BASE_URL works too).
github.com/firebase/genkit/go/plugins/compat_oai/openrouter.OpenRouter.Opts
Opts contains additional OpenAI client request options, such as [option.WithBaseURL] for a different endpoint (OPENROUTER_BASE_URL works too). field Opts []option.RequestOption. Documented at pkg.go.dev, github.com/firebase/genkit/go/plugins/compat_oai/openrouter.OpenRouter.Opts.
package option ("github.com/openai/openai-go/option")
package option ("github.com/openai/openai-go/option").
type RequestOption = requestconfig.RequestOption
RequestOption is an option for the requests made by the openai API Client which can be supplied to clients, services, and methods.
github.com/openai/openai-go/option.RequestOption
RequestOption is an option for the requests made by the openai API Client which can be supplied to clients, services, and methods. type RequestOption = requestconfig.RequestOption. Documented at pkg.go.dev, github.com/openai/openai-go/option.RequestOption.
func WithBaseURL(base string) RequestOption
WithBaseURL returns a RequestOption that sets the BaseURL for the client.
github.com/openai/openai-go/option.WithBaseURL
WithBaseURL returns a RequestOption that sets the BaseURL for the client. func WithBaseURL(base string) RequestOption. Documented at pkg.go.dev, github.com/openai/openai-go/option.WithBaseURL.
field BaseURL string
OpenRouter's, or a replay's
OpenRouter's, or a replay's field BaseURL string. In ch16/task/wire.go, line 45.
func WithHTTPClient(client HTTPClient) RequestOption
WithHTTPClient returns a RequestOption that changes the underlying http client used to make this request, which by default is [http.DefaultClient].
github.com/openai/openai-go/option.WithHTTPClient
WithHTTPClient returns a RequestOption that changes the underlying http client used to make this request, which by default is [http.DefaultClient]. func WithHTTPClient(client HTTPClient) RequestOption. Documented at pkg.go.dev, github.com/openai/openai-go/option.WithHTTPClient.
field HTTP *http.Client
carries the replaying or recording transport
carries the replaying or recording transport field HTTP *http.Client. In ch16/task/wire.go, line 47.
var issue *ai.ToolAction[task.IssueArgs, string]
var issue *ai.ToolAction[task.IssueArgs, string]. In ch16/genkit/genkit.go, line 57.
func tools(g *genkit.Genkit, env *task.Env) (
*ai.ToolAction[task.IssueArgs, string], []ai.ToolRef)
tools defines the task's three tools in g.
tools defines the task's three tools in g. func tools(g *genkit.Genkit, env *task.Env) ( *ai.ToolAction[task.IssueArgs, string], []ai.ToolRef). In ch16/genkit/genkit.go, line 25.
func WithModel(model ModelArg) CommonGenOption
WithModel sets either a [Model] or a [ModelRef] that may contain a config.
github.com/firebase/genkit/go/ai.WithModel
WithModel sets either a [Model] or a [ModelRef] that may contain a config. func WithModel(model ModelArg) CommonGenOption. Documented at pkg.go.dev, github.com/firebase/genkit/go/ai.WithModel.
func ModelRef(id string, config *ChatConfig) ai.ModelRef
ModelRef names a model and carries the config to generate with, so the config is typed at the call site instead of an any the model checks at runtime.
github.com/firebase/genkit/go/plugins/compat_oai/openrouter.ModelRef
ModelRef names a model and carries the config to generate with, so the config is typed at the call site instead of an any the model checks at runtime. func ModelRef(id string, config *ChatConfig) ai.ModelRef. Documented at pkg.go.dev, github.com/firebase/genkit/go/plugins/compat_oai/openrouter.ModelRef.
const Model = "anthropic/claude-haiku-5.5"
Model is the one place the model ID is set for every version.
Model is the one place the model ID is set for every version. const Model = "anthropic/claude-haiku-5.5". In ch16/task/task.go, line 18.
func WithTools(tools ...ToolRef) CommonGenOption
WithTools adds tools to use for the generate request.
github.com/firebase/genkit/go/ai.WithTools
WithTools adds tools to use for the generate request. func WithTools(tools ...ToolRef) CommonGenOption. Documented at pkg.go.dev, github.com/firebase/genkit/go/ai.WithTools.
func WithMaxTurns(maxTurns int) CommonGenOption
WithMaxTurns sets the maximum number of tool call iterations before erroring.
github.com/firebase/genkit/go/ai.WithMaxTurns
WithMaxTurns sets the maximum number of tool call iterations before erroring. func WithMaxTurns(maxTurns int) CommonGenOption. Documented at pkg.go.dev, github.com/firebase/genkit/go/ai.WithMaxTurns.
func WithUse(middleware ...Middleware) CommonGenOption
WithUse adds middleware to apply to generation.
github.com/firebase/genkit/go/ai.WithUse
WithUse adds middleware to apply to generation. func WithUse(middleware ...Middleware) CommonGenOption. Documented at pkg.go.dev, github.com/firebase/genkit/go/ai.WithUse.
package middleware ("github.com/firebase/genkit/go/plugins/middleware")
package middleware ("github.com/firebase/genkit/go/plugins/middleware").
type ToolApproval struct {
// AllowedTools is the list of tool names pre-approved to run without
// interruption. Tools not in this list trigger an interrupt. An empty
// list interrupts all tools.
AllowedTools []string `json:"allowedTools,omitempty" jsonschema_description:"Tool names pre-approved to run without interruption. Any tool not in this list triggers an interrupt. An empty list interrupts every tool."`
}
ToolApproval is a middleware that interrupts tool execution unless the tool is in [AllowedTools] or the call has been explicitly approved on resume.
github.com/firebase/genkit/go/plugins/middleware.ToolApproval
ToolApproval is a middleware that interrupts tool execution unless the tool is in [AllowedTools] or the call has been explicitly approved on resume. type ToolApproval struct { // AllowedTools is the list of tool names pre-approved to run without // interruption. Tools not in this list trigger an interrupt. An empty // list interrupts all tools. AllowedTools []string `json:"allowedTools,omitempty" jsonschema_description:"Tool names pre-approved to run without interruption. Any tool not in this list triggers an interrupt. An empty list interrupts every tool."` }. Documented at pkg.go.dev, github.com/firebase/genkit/go/plugins/middleware.ToolApproval.
field AllowedTools []string `json:"allowedTools,omitempty" jsonschema_description:"Tool names pre-approved to run without interruption. Any tool not in this list triggers an interrupt. An empty list interrupts every tool."`
AllowedTools is the list of tool names pre-approved to run without interruption.
github.com/firebase/genkit/go/plugins/middleware.ToolApproval.AllowedTools
AllowedTools is the list of tool names pre-approved to run without interruption. field AllowedTools []string `json:"allowedTools,omitempty" jsonschema_description:"Tool names pre-approved to run without interruption. Any tool not in this list triggers an interrupt. An empty list interrupts every tool."`. Documented at pkg.go.dev, github.com/firebase/genkit/go/plugins/middleware.ToolApproval.AllowedTools.

