@windmill-labs/chat-sdk 1.850.0 → 1.851.0
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/README.md +3 -3
- package/dist/{chat-C-qFO-jT.js → chat-D5SvCHXU.js} +4 -7
- package/dist/{chat-DjAH5NVm.cjs → chat-pUgtVqWV.cjs} +4 -7
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/react.cjs +1 -1
- package/dist/react.js +1 -1
- package/dist/runnable.d.ts +6 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -177,9 +177,9 @@ history, so two agent runnables in one app keep separate conversations. Going th
|
|
|
177
177
|
`wmill.ts` is what makes the same code work in a deployed app and under `wmill app dev`.
|
|
178
178
|
|
|
179
179
|
`createChat` and the assistant-ui runtime take the same options; the AI SDK transport
|
|
180
|
-
does not. The runnable takes `user_message
|
|
181
|
-
the agent's memory is keyed by, so it remembers
|
|
182
|
-
|
|
180
|
+
does not. The runnable takes `user_message`, and the chat passes the conversation id as
|
|
181
|
+
`backendAsync`'s `memoryId` option, which the agent's memory is keyed by, so it remembers
|
|
182
|
+
earlier turns (called from `wmill.ts` without it, it is a single run with no conversation). The agent needs managed
|
|
183
183
|
memory: one whose memory is off takes `previous_messages` instead, the history you keep. A signed-in viewer's turns
|
|
184
184
|
are filed under them, so nobody else can continue their conversations; an anonymous
|
|
185
185
|
visitor's are kept apart per app. The chat makes no request of its own: history is
|
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
import { C as _assertClassBrand, S as _classPrivateFieldSet2, T as _classPrivateMethodInitSpec, _ as WindmillApiError, a as errorResultMessage, b as turnRunningError, c as isErrorResult, d as randomId, f as sleep, g as TurnRunningError, i as conversationTitle, l as now, m as createStreamEventParser, n as abortError, o as extractChatAnswer, p as truncateTitle, s as isAbortError, t as followJob, v as WindmillChatApi, w as _classPrivateFieldInitSpec, x as _classPrivateFieldGet2 } from "./follow-DXfmfPfr.js";
|
|
2
2
|
//#region src/runnable.ts
|
|
3
3
|
/**
|
|
4
|
-
* `run` and `follow` over a raw app's
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* `run` and `follow` over a raw app's chat runnable (a saved AI agent, or a flow in chat mode),
|
|
5
|
+
* behind the `runnable` option. The conversation id goes as `memoryId`, the run's `memory_id`
|
|
6
|
+
* query parameter, which keys the conversation and its memory.
|
|
7
7
|
*/
|
|
8
8
|
function rawAppRunnable(start, streamJob) {
|
|
9
9
|
return {
|
|
10
10
|
run: async (args, { conversationId }) => {
|
|
11
11
|
try {
|
|
12
|
-
return String(await start({
|
|
13
|
-
...args,
|
|
14
|
-
memory_id: conversationId
|
|
15
|
-
}));
|
|
12
|
+
return String(await start(args, { memoryId: conversationId }));
|
|
16
13
|
} catch (e) {
|
|
17
14
|
const text = e instanceof Error ? e.message : String(e);
|
|
18
15
|
throw turnRunningError(text.slice(text.indexOf("{"), text.lastIndexOf("}") + 1)) ?? e;
|
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
const require_follow = require("./follow-Dug-Afeu.cjs");
|
|
2
2
|
//#region src/runnable.ts
|
|
3
3
|
/**
|
|
4
|
-
* `run` and `follow` over a raw app's
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* `run` and `follow` over a raw app's chat runnable (a saved AI agent, or a flow in chat mode),
|
|
5
|
+
* behind the `runnable` option. The conversation id goes as `memoryId`, the run's `memory_id`
|
|
6
|
+
* query parameter, which keys the conversation and its memory.
|
|
7
7
|
*/
|
|
8
8
|
function rawAppRunnable(start, streamJob) {
|
|
9
9
|
return {
|
|
10
10
|
run: async (args, { conversationId }) => {
|
|
11
11
|
try {
|
|
12
|
-
return String(await start({
|
|
13
|
-
...args,
|
|
14
|
-
memory_id: conversationId
|
|
15
|
-
}));
|
|
12
|
+
return String(await start(args, { memoryId: conversationId }));
|
|
16
13
|
} catch (e) {
|
|
17
14
|
const text = e instanceof Error ? e.message : String(e);
|
|
18
15
|
throw require_follow.turnRunningError(text.slice(text.indexOf("{"), text.lastIndexOf("}") + 1)) ?? e;
|
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_follow = require("./follow-Dug-Afeu.cjs");
|
|
3
|
-
const require_chat = require("./chat-
|
|
3
|
+
const require_chat = require("./chat-pUgtVqWV.cjs");
|
|
4
4
|
exports.CHAT_UPLOADS_PREFIX = require_chat.CHAT_UPLOADS_PREFIX;
|
|
5
5
|
exports.TurnRunningError = require_follow.TurnRunningError;
|
|
6
6
|
exports.WindmillApiError = require_follow.WindmillApiError;
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { _ as WindmillApiError, b as turnRunningError, g as TurnRunningError, h as parseStreamEvents, m as createStreamEventParser, o as extractChatAnswer, r as conversationIdFor, t as followJob, v as WindmillChatApi, y as readServerSentEvents } from "./follow-DXfmfPfr.js";
|
|
2
|
-
import { a as detectRawApp, i as uploadAttachments, n as CHAT_UPLOADS_PREFIX, r as storedAttachmentName, t as createChat } from "./chat-
|
|
2
|
+
import { a as detectRawApp, i as uploadAttachments, n as CHAT_UPLOADS_PREFIX, r as storedAttachmentName, t as createChat } from "./chat-D5SvCHXU.js";
|
|
3
3
|
export { CHAT_UPLOADS_PREFIX, TurnRunningError, WindmillApiError, WindmillChatApi, conversationIdFor, createChat, createStreamEventParser, detectRawApp, extractChatAnswer, followJob, parseStreamEvents, readServerSentEvents, storedAttachmentName, turnRunningError, uploadAttachments };
|
package/dist/react.cjs
CHANGED
package/dist/react.js
CHANGED
package/dist/runnable.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { ChatOptions } from './types';
|
|
2
2
|
/**
|
|
3
|
-
* `run` and `follow` over a raw app's
|
|
4
|
-
*
|
|
5
|
-
*
|
|
3
|
+
* `run` and `follow` over a raw app's chat runnable (a saved AI agent, or a flow in chat mode),
|
|
4
|
+
* behind the `runnable` option. The conversation id goes as `memoryId`, the run's `memory_id`
|
|
5
|
+
* query parameter, which keys the conversation and its memory.
|
|
6
6
|
*/
|
|
7
|
-
export declare function rawAppRunnable(start: (args: any
|
|
7
|
+
export declare function rawAppRunnable(start: (args: any, opts: {
|
|
8
|
+
memoryId: string;
|
|
9
|
+
}) => Promise<string>, streamJob: (jobId: string, onUpdate?: (update: {
|
|
8
10
|
new_result_stream?: string;
|
|
9
11
|
}) => void) => Promise<unknown>): Required<Pick<ChatOptions, 'run' | 'follow'>>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@windmill-labs/chat-sdk",
|
|
3
3
|
"description": "Build chat interfaces on Windmill flows deployed in chat mode, from any frontend or raw app",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.851.0",
|
|
5
5
|
"author": "Ruben Fiszel",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"homepage": "https://github.com/windmill-labs/windmill/tree/main/chat-sdk#readme",
|