Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 36 additions & 2 deletions apps/dev-playground/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ import {
serving,
WRITE_ACTIONS,
} from "@databricks/appkit";
import { agents, createAgent, tool } from "@databricks/appkit/beta";
import {
agents,
createAgent,
DatabricksAdapter,
tool,
} from "@databricks/appkit/beta";
import { WorkspaceClient } from "@databricks/sdk-experimental";
import { z } from "zod";
import { lakebaseExamples } from "./lakebase-examples-plugin";
Expand Down Expand Up @@ -68,6 +73,35 @@ const helper = createAgent({
},
});

// Supervisor API demo agent. The Databricks AI Gateway executes hosted
// tools server-side; declare them via `createAgent({ tools })` like any
// other agent tool — the agents plugin classifies the tagged record and
// routes it to the adapter via AgentInput.extensions. Import
// `supervisorTools` from '@databricks/appkit/beta' and uncomment an
// entry below to give the model real powers.
//
// `createAgent({ model })` accepts an adapter promise, so the factory's
// host/credential resolution is awaited lazily on first dispatch (via
// `resolveAdapter` in the agents plugin). A misconfigured workspace will
// surface at first chat request, not at module init.
const supervisor = createAgent({
instructions:
"You are an assistant powered by the Databricks Supervisor API.",
model: DatabricksAdapter.fromSupervisorApi({
model: "databricks-claude-sonnet-4-5",
}),
tools: () => ({
// nyc: supervisorTools.genieSpace({
// id: "01ABCDEF12345678",
// description: "NYC taxi trip records and zones",
// }),
// add: supervisorTools.ucFunction({
// name: "main.default.add",
// description: "Adds two integers and returns the sum.",
// }),
}),
});

/*
* Smart-Dashboard agents.
*
Expand Down Expand Up @@ -385,7 +419,7 @@ createApp({
}),
serving(),
agents({
agents: { helper, sql_analyst, dashboard_pilot },
agents: { helper, sql_analyst, dashboard_pilot, supervisor },
// `query` (markdown dispatcher) + `sql_analyst` + `dashboard_pilot`
// wire the /smart-dashboard route. `insights` and `anomaly` are
// ephemeral markdown agents auto-fired by the route's AgentSidebar.
Expand Down
39 changes: 39 additions & 0 deletions docs/docs/api/appkit/Class.DatabricksAdapter.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

141 changes: 141 additions & 0 deletions docs/docs/api/appkit/Class.SupervisorApiAdapter.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

73 changes: 73 additions & 0 deletions docs/docs/api/appkit/Function.fromSupervisorApi.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions docs/docs/api/appkit/Function.isSupervisorTool.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions docs/docs/api/appkit/Interface.AgentAdapter.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions docs/docs/api/appkit/Interface.AgentInput.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading