Class: SupervisorApiAdapter
Class: SupervisorApiAdapter
Adapter that calls the Databricks AI Gateway Responses API
(/ai-gateway/mlflow/v1/responses).
Streams SSE events in the OpenAI Responses API wire format and maps them
to the AppKit AgentEvent protocol. Tool execution is handled
server-side, so the adapter ignores the agents-plugin tool index.
Authentication is handled via the Databricks SDK credential chain — the
same mechanism used by DatabricksAdapter.fromModelServing. The transport
is injected via SupervisorApiAdapterCtorOptions.streamBody; the
fromSupervisorApi factory wires it through the SDK's
apiClient.request({ raw: true }).
Set DEBUG=appkit:agents:supervisor-api to log the outbound request
shape (model, instructions length, input shape, tool count) and to be
notified when the recovery path engages (no incremental deltas, text
pulled from response.completed.output[]). The no-delta warning includes
a per-turn event-type histogram and the SA-reported status/error/
incomplete_details, so it's already actionable without DEBUG.
Tools are not configured on the adapter. Declare them via
createAgent({ tools: () => ({ key: supervisorTools.genieSpace({...}) }) })
(or markdown frontmatter referencing an ambient supervisorTools.* entry);
the agents plugin / standalone runAgent aggregates hosted-supervisor
entries and routes them to the adapter via
AgentInput.extensions[SUPERVISOR_EXTENSION_KEY]. Advanced callers
invoking adapter.run(...) directly populate that key themselves.
Example
import { createApp, createAgent } from "@databricks/appkit";
import {
agents,
DatabricksAdapter,
supervisorTools,
} from "@databricks/appkit/beta";
await createApp({
plugins: [
agents({
agents: {
assistant: createAgent({
instructions: "You are a helpful assistant.",
model: DatabricksAdapter.fromSupervisorApi({
model: "databricks-claude-sonnet-4",
}),
tools: () => ({
nyc: supervisorTools.genieSpace({
id: "01ABCDEF12345678",
description: "NYC taxi trip records and zones",
}),
}),
}),
},
}),
],
});Implements
Constructors
Constructor
new SupervisorApiAdapter(options: SupervisorApiAdapterCtorOptions): SupervisorApiAdapter;Parameters
| Parameter | Type |
|---|---|
options | SupervisorApiAdapterCtorOptions |
Returns
SupervisorApiAdapter
Properties
acceptsExtensions
readonly acceptsExtensions: readonly ["databricks.supervisor"];Capability negotiation: the adapter reads its hosted-tool payload from AgentInput.extensions under SUPERVISOR_EXTENSION_KEY. The agents plugin uses this list to warn at registration when the tool index produces extensions the adapter wouldn't consume.
Implementation of
AgentAdapter.acceptsExtensions
consumesInputTools
readonly consumesInputTools: false = false;Capability negotiation: the adapter does not consume input.tools.
Tool execution is owned by the Databricks AI Gateway server-side, so
any function tools or local sub-agents declared on this agent would
be silently dropped — the agents plugin warns at registration when
that combination is detected.
Implementation of
AgentAdapter.consumesInputTools
Methods
run()
run(input: AgentInput, context: AgentRunContext): AsyncGenerator<AgentEvent, void, unknown>;Parameters
| Parameter | Type |
|---|---|
input | AgentInput |
context | AgentRunContext |
Returns
AsyncGenerator<AgentEvent, void, unknown>