Skip to content

feat(agents): forward generation params (temperature/top_p/stop/...) to the serving adapter#450

Open
MarioCadenas wants to merge 1 commit into
mainfrom
feat/agent-generation-params
Open

feat(agents): forward generation params (temperature/top_p/stop/...) to the serving adapter#450
MarioCadenas wants to merge 1 commit into
mainfrom
feat/agent-generation-params

Conversation

@MarioCadenas

Copy link
Copy Markdown
Collaborator

The gap

The Databricks agent adapter (DatabricksAdapter) sent only max_tokens to the OpenAI-compatible serving endpoint. App engineers had no way to tune generation (temperature, nucleus sampling, stop sequences, penalties) — a basic parity gap vs. the Vercel AI SDK / LangChain.

What changed

Forward the standard OpenAI-compatible generation params into the serving request body:

  • temperature
  • top_p
  • stop (string or string[])
  • frequency_penalty
  • presence_penalty

Where they're declared (all optional / opt-in)

  • GenerationParams interface in packages/appkit/src/agents/databricks.ts, accepted on every DatabricksAdapter options shape (raw fetch, stream-body, fromServingEndpoint, fromModelServing) and exported from @databricks/appkit/beta.
  • AgentDefinition.generationParams and RegisteredAgent.generationParams in packages/appkit/src/core/agent/types.ts, wired through packages/appkit/src/plugins/agents/agents.ts into the adapter options (same path as maxTokens, only applied when AppKit builds the adapter from a string/omitted model).
  • Markdown frontmatter generationParams: in packages/appkit/src/core/agent/load-agents.ts, parsed defensively (only known keys with the expected wire types are picked).

Names match the serving API wire keys. Only keys that are set are written to the request body; undefined keys are omitted so the endpoint applies its own defaults. No range validation is added — the endpoint validates.

Verification

  • pnpm --filter=@databricks/appkit typecheck — clean.
  • vitest run --project appkit for the adapter, core agent, and agents plugin suites — 348 tests pass, including two new adapter tests asserting (a) set params are forwarded and (b) unset params are omitted from the body.
  • biome check on the edited files introduces no new warnings (the two agents.ts warnings are pre-existing on main).

This pull request and its description were written by Isaac.

…to the serving adapter

The Databricks agent adapter previously sent only max_tokens to the
serving endpoint. Add optional pass-through for the standard
OpenAI-compatible generation params (temperature, top_p, stop,
frequency_penalty, presence_penalty), declared on the agent definition
(code + markdown frontmatter) and on the DatabricksAdapter options.
Only set keys are forwarded into the request body; undefined keys are
omitted so the endpoint applies its own defaults.

Co-authored-by: Isaac
Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
@MarioCadenas MarioCadenas requested a review from a team as a code owner June 13, 2026 19:30
@MarioCadenas MarioCadenas requested a review from ditadi June 13, 2026 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant