Skip to content

Commit bdcc529

Browse files
committed
feat(appkit): supervisor api adapter
1 parent db77efa commit bdcc529

8 files changed

Lines changed: 1627 additions & 16 deletions

File tree

apps/dev-playground/server/index.ts

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,13 @@ import {
1010
serving,
1111
WRITE_ACTIONS,
1212
} from "@databricks/appkit";
13-
import { agents, createAgent, fromPlugin, tool } from "@databricks/appkit/beta";
13+
import {
14+
agents,
15+
createAgent,
16+
fromPlugin,
17+
fromSupervisorApi,
18+
tool,
19+
} from "@databricks/appkit/beta";
1420
import { WorkspaceClient } from "@databricks/sdk-experimental";
1521
import { z } from "zod";
1622
import { lakebaseExamples } from "./lakebase-examples-plugin";
@@ -65,6 +71,33 @@ const helper = createAgent({
6571
},
6672
});
6773

74+
// Supervisor API demo agent. Tools are configured on the adapter (the SA
75+
// endpoint executes them server-side), not on the createAgent definition.
76+
// Uncomment a `supervisorTools.*` entry (and import 'supervisorTools' from
77+
// '@databricks/appkit/beta') to give the model real powers.
78+
//
79+
// We `await` the factory at module init so a misconfigured workspace
80+
// (missing host, bad credentials) fails fast with a clear error here
81+
// instead of as an unhandled rejection. Top-level await is fine in this
82+
// ESM module.
83+
const supervisor = createAgent({
84+
instructions:
85+
"You are an assistant powered by the Databricks Supervisor API.",
86+
model: fromSupervisorApi({
87+
model: "databricks-claude-sonnet-4-5",
88+
tools: [
89+
// supervisorTools.genieSpace(
90+
// "01ABCDEF12345678",
91+
// "NYC taxi trip records and zones",
92+
// ),
93+
// supervisorTools.ucFunction(
94+
// "main.default.add",
95+
// "Adds two integers and returns the sum.",
96+
// ),
97+
],
98+
}),
99+
});
100+
68101
/*
69102
* Smart-Dashboard agents.
70103
*
@@ -364,7 +397,7 @@ createApp({
364397
}),
365398
serving(),
366399
agents({
367-
agents: { helper, sql_analyst, dashboard_pilot },
400+
agents: { helper, sql_analyst, dashboard_pilot, supervisor },
368401
// `query` (markdown dispatcher) + `sql_analyst` + `dashboard_pilot`
369402
// wire the /smart-dashboard route. `insights` and `anomaly` are
370403
// ephemeral markdown agents auto-fired by the route's AgentSidebar.

0 commit comments

Comments
 (0)