Repository navigation
Description
Summary
The TypeScript ADK (@inference-gateway/adk) shipped a fluent AgentBuilder in typescript-adk#83 (closes typescript-adk#28). It wires an LLM client, tools, callbacks, system prompt, and sampling parameters into an OpenAICompatibleAgent consumable by A2AServerBuilder.withAgent(...), mirroring the Go ADK adk/server/agent_builder.go. typescript-adk.md already covers A2AServerBuilder and DefaultBackgroundTaskHandler but does not yet mention AgentBuilder, so newcomers wiring an LLM-powered handler have no documented path.
The new section should land in typescript-adk.md as a peer of the existing A2AServerBuilder section, with a runnable end-to-end example showing AgentBuilder -> DefaultBackgroundTaskHandler -> A2AServerBuilder.withAgent(). Defaults match the Go ADK verbatim (maxIterations: 50, maxConversationHistory: 20, the system prompt copied byte-for-byte from AgentConfig.SystemPrompt), so the docs should explicitly call that out and link to the Go reference for cross-language consistency.
Acceptance Criteria
-
typescript-adk.mdhas a newAgentBuildersection (peer ofA2AServerBuilder) covering the fluent API and when to reach for it. - All builder methods are documented:
withProvider,withModel,withTemperature,withTopP,withMaxTokens,withMaxIterations,withSystemPrompt,withMaxConversationHistory,withCallbacks,withToolBox,withLLMClient,build(). - Required-fields rule is documented:
build()throwsAgentBuilderErrorunless(provider + model)are set ORwithLLMClient(...)is used;maxIterationsandmaxConversationHistorymust be positive. - Defaults are listed and explicitly called out as matching the Go ADK:
maxIterations: 50,maxConversationHistory: 20, and the default system prompt (byte-for-byte copy ofAgentConfig.SystemPromptin the Go ADK). - A runnable end-to-end example shows
AgentBuilder->OpenAICompatibleAgent->A2AServerBuilder.withAgent()for a working LLM-backed agent. -
CallbacksandOpenAICompatibleAgentare briefly introduced (or linked) so the example reads top-to-bottom without forward references. - Cross-link to the Go ADK
adk/server/agent_builder.goso readers can verify the defaults match across languages. - The page frontmatter
descriptionis updated to mentionAgentBuilderfor SEO and the docs site search index.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
edenreich commentedon May 27, 2026
@claude Can you document it? use /maintainer
claude commentedon May 27, 2026
Claude finished @edenreich's task in 19m 40s —— View job •
claude/issue-73-20260527-1722• Create PR ➔Documenting AgentBuilder for the TypeScript ADK
typescript-adk.mdand locateA2AServerBuilderwiring sectionAgentBuildersource frominference-gateway/typescript-adk(PR [DOCS] Document HTTP push notification delivery in the TypeScript ADK #83)adk/server/agent_builder.go(50 / 20 / system prompt verbatim - confirmed)ai-poweredexample to see the canonical wiring patternAgentBuildersection as peer ofBackground task handlerwithProvider,withModel,withTemperature,withTopP,withMaxTokens,withMaxIterations,withSystemPrompt,withMaxConversationHistory,withCallbacks,withToolBox,withLLMClient,build)build()validation contract andAgentBuilderErrormaxIterations: 50,maxConversationHistory: 20, byte-for-byte system prompt) with Go ADK parity calloutOpenAICompatibleAgentaccessor surfaceCallbackslifecycle hooks (beforeAgent/afterAgent/beforeModel/afterModel/beforeTool/afterTool) andCallbackContextBridging to DefaultBackgroundTaskHandlersubsection covering theOpenAICompatibleLLMClient->LLMClientadapter (still required today)AgentBuilder->OpenAICompatibleAgent->A2AServerBuilder.withAgent())descriptionto mentionAgentBuilderWhat ships todaytable to listAgentBuilderParity with the Go ADKsection with anAgentBuilderbullet that cross-linksadk/server/agent_builder.goWiring into A2AServerBuildersubsection to the newAgentBuildersectionnpm run lint:mdcleannpm run format:checkcleannpm run buildsucceeds; rendered HTML contains the new sectionclaude/issue-73-20260527-1722Summary
Added a top-level
## Agent builder (AgentBuilder)section totypescript-adk.md, placed after## Background task handler (DefaultBackgroundTaskHandler)so the reading order goes from the lower-level handler up to the high-level fluent wiring. The section covers every method on the fluent surface (with default, return type, and behavioural notes), thebuild()validation rules (including the "provider + model" vs "withLLMClient" required-fields choice), defaults that match the Go ADK'sAgentConfigbyte-for-byte (with the system prompt called out explicitly and linked toadk/server/config/config.go), theOpenAICompatibleAgentaccessor surface, theCallbackslifecycle-hook table withCallbackContext, theOpenAICompatibleLLMClient->LLMClientadapter required to bridge intoDefaultBackgroundTaskHandlertoday (matchingexamples/ai-powered/server.ts), and an end-to-end example wiringAgentBuilder->OpenAICompatibleAgent->A2AServerBuilder.withAgent()with a realToolBox, abeforeModelcallback, andsetEnableUsageMetadata(true).Frontmatter
description, theWhat ships todaycapability table, theParity with the Go ADKsection, and a forward-reference fromWiring into A2AServerBuilderwere also updated so the new path is discoverable from every entry point.| Branch:
claude/issue-73-20260527-1722docs(typescript-adk): document AgentBuilder fluent agent wiring
chore(release): 🔖 0.6.35 [skip ci]