Skip to content

Commit 2ccfc54

Browse files
committed
fix(appkit): pkosiec's feedback
Signed-off-by: Hubert Zub <hubert.zub@databricks.com>
1 parent f8d4841 commit 2ccfc54

13 files changed

Lines changed: 224 additions & 70 deletions

docs/docs/api/appkit/Class.DatabricksAdapter.md

Lines changed: 8 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/docs/api/appkit/Class.SupervisorApiAdapter.md

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/docs/api/appkit/Function.fromSupervisorApi.md

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/docs/api/appkit/Interface.SupervisorApiAdapterCtorOptions.md

Lines changed: 0 additions & 17 deletions
This file was deleted.

docs/docs/api/appkit/Interface.SupervisorApiAdapterOptions.md

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/docs/api/appkit/Interface.WorkspaceClientLike.md

Lines changed: 66 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/docs/api/appkit/index.md

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/docs/api/appkit/typedoc-sidebar.ts

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/appkit/src/agents/databricks.ts

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ import type {
55
AgentRunContext,
66
AgentToolDefinition,
77
} from "shared";
8-
import { stream as servingStream } from "../connectors/serving/client";
8+
import {
9+
type StreamBody,
10+
stream as servingStream,
11+
} from "../connectors/serving/client";
912

1013
/** Default cap for a single incomplete SSE line tail (DoS guard). */
1114
const DEFAULT_MAX_SSE_LINE_CHARS = 1024 * 1024;
@@ -62,17 +65,6 @@ function throwIfExceedsStreamLimit(
6265
}
6366
}
6467

65-
/**
66-
* Transport shim: given an OpenAI-compatible request body, returns the raw
67-
* SSE byte stream from the serving endpoint. Injected at construction time so
68-
* callers can swap in the workspace SDK (factory paths), a bare `fetch`
69-
* (the raw constructor), or a test fake.
70-
*/
71-
type StreamBody = (
72-
body: Record<string, unknown>,
73-
signal?: AbortSignal,
74-
) => Promise<ReadableStream<Uint8Array>>;
75-
7668
/**
7769
* Escape-hatch options: provide an `endpointUrl` + `authenticate()` and the
7870
* adapter uses a bare `fetch()` to call it. Useful for tests and for pointing
@@ -374,11 +366,13 @@ export class DatabricksAdapter implements AgentAdapter {
374366
}
375367

376368
/**
377-
* Discoverability shim for the Supervisor API adapter. Returns a
378-
* {@link import("./supervisor-api").SupervisorApiAdapter}, NOT a
369+
* Discoverability shim for the Supervisor API adapter. Returns an
370+
* {@link AgentAdapter} (a `SupervisorApiAdapter` at runtime), NOT a
379371
* {@link DatabricksAdapter} — the two are separate classes (different
380-
* wire formats, different lifecycle). Surfaced here so application
381-
* developers see a single `DatabricksAdapter.from*` autocomplete root.
372+
* wire formats, different lifecycle). The return type is the
373+
* {@link AgentAdapter} interface so callers aren't bound to the concrete
374+
* class. Surfaced here so application developers see a single
375+
* `DatabricksAdapter.from*` autocomplete root.
382376
*
383377
* Dynamic-imports `./supervisor-api` to avoid forming a load-time cycle:
384378
* both files share `connectors/serving/client.ts`.
@@ -394,7 +388,7 @@ export class DatabricksAdapter implements AgentAdapter {
394388
*/
395389
static async fromSupervisorApi(
396390
options: import("./supervisor-api").SupervisorApiAdapterOptions,
397-
): Promise<import("./supervisor-api").SupervisorApiAdapter> {
391+
): Promise<AgentAdapter> {
398392
const { fromSupervisorApi } = await import("./supervisor-api");
399393
return fromSupervisorApi(options);
400394
}

0 commit comments

Comments
 (0)