Skip to content

Commit 25dfdc7

Browse files
committed
CR feedback
Signed-off-by: Hubert Zub <hubert.zub@databricks.com>
1 parent 2099b65 commit 25dfdc7

4 files changed

Lines changed: 16 additions & 16 deletions

File tree

integrations/appkit-agent/README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
# @databricks/appkit-agent
22

3-
Agent plugin for [Databricks AppKit](https://github.com/databricks/appkit). Provides two things:
3+
Agent plugin for [Databricks AppKit](https://github.com/databricks/appkit). You can define an agent using one of the following approaches:
44

5-
1. **`AgentInterface`** — a contract for writing custom agent implementations that speak the OpenAI Responses API format (streaming + non-streaming).
6-
2. **`StandardAgent`** — a ready-to-use LangGraph-based ReAct agent that implements `AgentInterface`, with streaming Responses API support, function tools, and Databricks-hosted tool integration (Genie, Vector Search, MCP servers).
5+
1. Declaratively define an agent by specifying `model`, `tools,` and `instructions`
6+
2. Implement a custom agent loop using **`AgentInterface`** — a contract for writing custom agent implementations that speak the OpenAI Responses API format (streaming + non-streaming).
77

88
## Installation
99

1010
```bash
1111
npm install @databricks/appkit-agent
1212
```
1313

14-
The LangChain peer dependencies are required when using the built-in ReAct agent (not needed if you provide a custom `agentInstance`):
14+
The following peer dependencies are required when using the built-in agent (not needed if you provide a custom `agentInstance`):
1515

1616
```bash
1717
npm install @databricks/langchainjs @langchain/core @langchain/langgraph
1818
```
1919

20-
If you use hosted MCP tools (Genie, Vector Search, custom/external MCP servers):
20+
If you use hosted tools (Genie, Vector Search, custom/external MCP servers):
2121

2222
```bash
2323
npm install @langchain/mcp-adapters
@@ -63,7 +63,7 @@ agent({
6363
// Tools available to the agent (see Tools section below)
6464
tools: [myTool, genieTool],
6565

66-
// Or bring your own AgentInterface implementation (skips LangGraph setup)
66+
// Or bring your own AgentInterface implementation
6767
agentInstance: myCustomAgent,
6868
});
6969
```
@@ -109,7 +109,7 @@ Connect to Databricks-managed services without writing tool handlers:
109109
```typescript
110110
// Genie Space — natural-language queries over your data
111111
const genie = {
112-
type: "genie-space" as const,
112+
type: "genie_space" as const,
113113
genie_space: { id: "01efg..." },
114114
};
115115

@@ -214,7 +214,7 @@ class MyAgent implements AgentInterface {
214214
agent({ agentInstance: new MyAgent() });
215215
```
216216

217-
The `StandardAgent` class (exported from this package) is the built-in implementation that wraps a LangGraph `createReactAgent` and translates its stream events into Responses API format. When you pass `model` instead of `agentInstance`, the plugin uses `StandardAgent` under the hood.
217+
The `StandardAgent` class (exported from this package) is the built-in implementation used when you pass `model` instead of `agentInstance`. It translates the underlying agent's stream events into Responses API format.
218218

219219
## API Reference
220220

@@ -223,7 +223,7 @@ The `StandardAgent` class (exported from this package) is the built-in implement
223223
| Export | Kind | Description |
224224
| --------------------- | -------------- | -------------------------------------------------------- |
225225
| `agent` | Plugin factory | Main entry point — call with config, pass to `createApp` |
226-
| `StandardAgent` | Class | LangGraph-backed `AgentInterface` implementation |
226+
| `StandardAgent` | Class | Built-in `AgentInterface` implementation |
227227
| `createInvokeHandler` | Function | Express handler factory for the `/api/agent` endpoint |
228228
| `isFunctionTool` | Function | Type guard for `FunctionTool` |
229229
| `isHostedTool` | Function | Type guard for `HostedTool` |

integrations/appkit-agent/src/agent-plugin/hosted-tools.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// ---------------------------------------------------------------------------
1212

1313
export interface GenieTool {
14-
type: "genie-space";
14+
type: "genie_space";
1515
genie_space: { id: string };
1616
}
1717

@@ -41,7 +41,7 @@ export type HostedTool =
4141
// ---------------------------------------------------------------------------
4242

4343
const HOSTED_TOOL_TYPES = new Set([
44-
"genie-space",
44+
"genie_space",
4545
"vector_search_index",
4646
"custom_mcp_server",
4747
"external_mcp_server",
@@ -73,7 +73,7 @@ export async function resolveHostedTools(
7373

7474
return tools.map((tool) => {
7575
switch (tool.type) {
76-
case "genie-space":
76+
case "genie_space":
7777
return DatabricksMCPServer.fromGenieSpace(tool.genie_space.id);
7878

7979
case "vector_search_index": {

integrations/appkit-agent/src/tests/agent-plugin/function-tool.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ describe("isFunctionTool", () => {
5151

5252
test("returns false for hosted tool object", () => {
5353
expect(
54-
isFunctionTool({ type: "genie-space", genie_space: { id: "123" } }),
54+
isFunctionTool({ type: "genie_space", genie_space: { id: "123" } }),
5555
).toBe(false);
5656
});
5757

integrations/appkit-agent/src/tests/agent-plugin/hosted-tools.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
} from "../../agent-plugin/hosted-tools";
1313

1414
const genieTool: GenieTool = {
15-
type: "genie-space",
15+
type: "genie_space",
1616
genie_space: { id: "space-123" },
1717
};
1818

@@ -94,7 +94,7 @@ describe("hosted tool types", () => {
9494
test("can be mixed in an array with discriminator", () => {
9595
const tools: HostedTool[] = [genieTool, vectorSearchTool];
9696
const types = tools.map((t) => t.type);
97-
expect(types).toEqual(["genie-space", "vector_search_index"]);
97+
expect(types).toEqual(["genie_space", "vector_search_index"]);
9898
});
9999
});
100100

@@ -136,7 +136,7 @@ describe("resolveHostedTools", () => {
136136
vi.clearAllMocks();
137137
});
138138

139-
test("resolves genie-space tool via fromGenieSpace", async () => {
139+
test("resolves genie_space tool via fromGenieSpace", async () => {
140140
const result = await resolveHostedTools([genieTool]);
141141

142142
expect(mockFromGenieSpace).toHaveBeenCalledWith("space-123");

0 commit comments

Comments
 (0)