feat(agents): forward generation params (temperature/top_p/stop/...) to the serving adapter#450
Open
MarioCadenas wants to merge 1 commit into
Open
feat(agents): forward generation params (temperature/top_p/stop/...) to the serving adapter#450MarioCadenas wants to merge 1 commit into
MarioCadenas wants to merge 1 commit into
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The gap
The Databricks agent adapter (
DatabricksAdapter) sent onlymax_tokensto 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:
temperaturetop_pstop(string or string[])frequency_penaltypresence_penaltyWhere they're declared (all optional / opt-in)
GenerationParamsinterface inpackages/appkit/src/agents/databricks.ts, accepted on everyDatabricksAdapteroptions shape (raw fetch, stream-body,fromServingEndpoint,fromModelServing) and exported from@databricks/appkit/beta.AgentDefinition.generationParamsandRegisteredAgent.generationParamsinpackages/appkit/src/core/agent/types.ts, wired throughpackages/appkit/src/plugins/agents/agents.tsinto the adapter options (same path asmaxTokens, only applied when AppKit builds the adapter from a string/omittedmodel).generationParams:inpackages/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;
undefinedkeys 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 appkitfor 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 checkon the edited files introduces no new warnings (the twoagents.tswarnings are pre-existing onmain).This pull request and its description were written by Isaac.