@dbx-tools/genie 0.1.27 → 0.1.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +8 -26
- package/dist/index.js +8 -26
- package/dist/src/chat.d.ts +17 -21
- package/dist/src/chat.js +17 -21
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/index.ts +8 -26
- package/package.json +3 -3
- package/src/chat.ts +17 -21
package/dist/index.d.ts
CHANGED
|
@@ -1,33 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `@dbx-tools/genie` public surface.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* message into the next call's `options.conversationId`).
|
|
9
|
-
* - {@link genieEventChat}: high-level async generator. Drives
|
|
10
|
-
* `genieChat` and yields a strongly-typed
|
|
11
|
-
* {@link GenieChatEvent} stream of flat `{type, ...fields}`
|
|
12
|
-
* records (`message`, `status`, `attachment`, `thinking`,
|
|
13
|
-
* `text`, `query`, `statement`, `rows`,
|
|
14
|
-
* `suggested_questions`, `result`). The final yield for any
|
|
15
|
-
* terminal turn is always `{ type: "result", ... }`.
|
|
4
|
+
* Bundles the package's Node-side chat driver with a re-export of
|
|
5
|
+
* the pure `@dbx-tools/genie-shared` wire vocabulary so a single
|
|
6
|
+
* `from "@dbx-tools/genie"` import serves server-side consumers
|
|
7
|
+
* that need both the live driver and the protocol types.
|
|
16
8
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* the `eventsFromMessage` sync generator, and terminal-status
|
|
22
|
-
* helpers all live in `@dbx-tools/genie-shared` and are
|
|
23
|
-
* re-exported here so a single `from "@dbx-tools/genie"` import
|
|
24
|
-
* works for server-side consumers. Browser-side consumers should
|
|
25
|
-
* import from `@dbx-tools/genie-shared` directly to avoid pulling
|
|
26
|
-
* in the Node-only `chat.ts` runtime.
|
|
27
|
-
*
|
|
28
|
-
* Browser safety: `chat.ts` pulls in `WorkspaceClient` and is
|
|
29
|
-
* Node-only; the re-exports from `@dbx-tools/genie-shared` are
|
|
30
|
-
* pure (types + sync functions) and safe for any runtime.
|
|
9
|
+
* Browser-side consumers should import `@dbx-tools/genie-shared`
|
|
10
|
+
* directly: the chat driver pulls in `WorkspaceClient` and is
|
|
11
|
+
* Node-only, whereas the re-exported protocol surface is pure
|
|
12
|
+
* (types + sync functions) and safe for any runtime.
|
|
31
13
|
*/
|
|
32
14
|
export * from "./src/chat.js";
|
|
33
15
|
export * from "@dbx-tools/genie-shared";
|
package/dist/index.js
CHANGED
|
@@ -1,33 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `@dbx-tools/genie` public surface.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* message into the next call's `options.conversationId`).
|
|
9
|
-
* - {@link genieEventChat}: high-level async generator. Drives
|
|
10
|
-
* `genieChat` and yields a strongly-typed
|
|
11
|
-
* {@link GenieChatEvent} stream of flat `{type, ...fields}`
|
|
12
|
-
* records (`message`, `status`, `attachment`, `thinking`,
|
|
13
|
-
* `text`, `query`, `statement`, `rows`,
|
|
14
|
-
* `suggested_questions`, `result`). The final yield for any
|
|
15
|
-
* terminal turn is always `{ type: "result", ... }`.
|
|
4
|
+
* Bundles the package's Node-side chat driver with a re-export of
|
|
5
|
+
* the pure `@dbx-tools/genie-shared` wire vocabulary so a single
|
|
6
|
+
* `from "@dbx-tools/genie"` import serves server-side consumers
|
|
7
|
+
* that need both the live driver and the protocol types.
|
|
16
8
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* the `eventsFromMessage` sync generator, and terminal-status
|
|
22
|
-
* helpers all live in `@dbx-tools/genie-shared` and are
|
|
23
|
-
* re-exported here so a single `from "@dbx-tools/genie"` import
|
|
24
|
-
* works for server-side consumers. Browser-side consumers should
|
|
25
|
-
* import from `@dbx-tools/genie-shared` directly to avoid pulling
|
|
26
|
-
* in the Node-only `chat.ts` runtime.
|
|
27
|
-
*
|
|
28
|
-
* Browser safety: `chat.ts` pulls in `WorkspaceClient` and is
|
|
29
|
-
* Node-only; the re-exports from `@dbx-tools/genie-shared` are
|
|
30
|
-
* pure (types + sync functions) and safe for any runtime.
|
|
9
|
+
* Browser-side consumers should import `@dbx-tools/genie-shared`
|
|
10
|
+
* directly: the chat driver pulls in `WorkspaceClient` and is
|
|
11
|
+
* Node-only, whereas the re-exported protocol surface is pure
|
|
12
|
+
* (types + sync functions) and safe for any runtime.
|
|
31
13
|
*/
|
|
32
14
|
export * from "./src/chat.js";
|
|
33
15
|
export * from "@dbx-tools/genie-shared";
|
package/dist/src/chat.d.ts
CHANGED
|
@@ -1,28 +1,24 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `@dbx-tools/genie` chat driver.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* `GenieMessage` into the next call's `options.conversationId`.
|
|
4
|
+
* Drives a single turn against a Genie space from one `content`
|
|
5
|
+
* string; multi-turn conversations are the caller's job (thread
|
|
6
|
+
* the `conversation_id` returned on each `GenieMessage` back into
|
|
7
|
+
* the next turn's `options.conversationId`).
|
|
9
8
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* code that wants every message verbatim should use `genieChat`.
|
|
24
|
-
* Subscribers that want to react to "Genie is thinking about X"
|
|
25
|
-
* or "Genie produced text Y" should use `genieEventChat`.
|
|
9
|
+
* Two layers serve two kinds of consumer. The low-level layer
|
|
10
|
+
* yields every poll-observed `GenieMessage` verbatim and owns the
|
|
11
|
+
* messy parts - cancellation, conversation seeding,
|
|
12
|
+
* distinct-filtering, and SDK quirks (Waiter stripping); reach for
|
|
13
|
+
* it when you want the raw stream. The high-level layer wraps it
|
|
14
|
+
* and emits semantic, deduplicated `{ type, payload }` events
|
|
15
|
+
* (see {@link GenieChatEvent}), always closing a successful turn
|
|
16
|
+
* with a terminal `result` event carrying the final
|
|
17
|
+
* `GenieMessage`; errors propagate by throwing, with no `error`
|
|
18
|
+
* variant. Iterating UI / agent code that wants every message
|
|
19
|
+
* verbatim takes the low-level stream; subscribers reacting to
|
|
20
|
+
* "Genie is thinking about X" or "Genie produced text Y" take the
|
|
21
|
+
* event layer.
|
|
26
22
|
*/
|
|
27
23
|
import { WorkspaceClient } from "@databricks/sdk-experimental";
|
|
28
24
|
import { type GenieChatEvent, type GenieMessage } from "@dbx-tools/genie-shared";
|
package/dist/src/chat.js
CHANGED
|
@@ -1,28 +1,24 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `@dbx-tools/genie` chat driver.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* `GenieMessage` into the next call's `options.conversationId`.
|
|
4
|
+
* Drives a single turn against a Genie space from one `content`
|
|
5
|
+
* string; multi-turn conversations are the caller's job (thread
|
|
6
|
+
* the `conversation_id` returned on each `GenieMessage` back into
|
|
7
|
+
* the next turn's `options.conversationId`).
|
|
9
8
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* code that wants every message verbatim should use `genieChat`.
|
|
24
|
-
* Subscribers that want to react to "Genie is thinking about X"
|
|
25
|
-
* or "Genie produced text Y" should use `genieEventChat`.
|
|
9
|
+
* Two layers serve two kinds of consumer. The low-level layer
|
|
10
|
+
* yields every poll-observed `GenieMessage` verbatim and owns the
|
|
11
|
+
* messy parts - cancellation, conversation seeding,
|
|
12
|
+
* distinct-filtering, and SDK quirks (Waiter stripping); reach for
|
|
13
|
+
* it when you want the raw stream. The high-level layer wraps it
|
|
14
|
+
* and emits semantic, deduplicated `{ type, payload }` events
|
|
15
|
+
* (see {@link GenieChatEvent}), always closing a successful turn
|
|
16
|
+
* with a terminal `result` event carrying the final
|
|
17
|
+
* `GenieMessage`; errors propagate by throwing, with no `error`
|
|
18
|
+
* variant. Iterating UI / agent code that wants every message
|
|
19
|
+
* verbatim takes the low-level stream; subscribers reacting to
|
|
20
|
+
* "Genie is thinking about X" or "Genie produced text Y" take the
|
|
21
|
+
* event layer.
|
|
26
22
|
*/
|
|
27
23
|
import { WorkspaceClient } from "@databricks/sdk-experimental";
|
|
28
24
|
import { eventsFromMessage, isTerminalStatus, } from "@dbx-tools/genie-shared";
|