@raindrop-ai/ai-sdk 0.0.6 → 0.0.8
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/{chunk-5S6OYWE3.mjs → chunk-NFWQZOEK.mjs} +8 -5
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +8 -5
- package/dist/index.mjs +1 -1
- package/dist/index.node.js +8 -5
- package/dist/index.node.mjs +1 -1
- package/dist/index.workers.js +8 -5
- package/dist/index.workers.mjs +1 -1
- package/package.json +1 -1
|
@@ -84,7 +84,7 @@ async function postJson(url, body, headers, opts) {
|
|
|
84
84
|
// package.json
|
|
85
85
|
var package_default = {
|
|
86
86
|
name: "@raindrop-ai/ai-sdk",
|
|
87
|
-
version: "0.0.
|
|
87
|
+
version: "0.0.8"};
|
|
88
88
|
|
|
89
89
|
// src/internal/version.ts
|
|
90
90
|
var libraryName = package_default.name;
|
|
@@ -270,19 +270,21 @@ var EventShipper = class {
|
|
|
270
270
|
}
|
|
271
271
|
return;
|
|
272
272
|
}
|
|
273
|
+
const { wizardSession, ...restProperties } = (_e = accumulated.properties) != null ? _e : {};
|
|
273
274
|
const payload = {
|
|
274
275
|
event_id: eventId,
|
|
275
276
|
user_id: userId,
|
|
276
277
|
event: eventName,
|
|
277
|
-
timestamp: (
|
|
278
|
+
timestamp: (_f = accumulated.timestamp) != null ? _f : (/* @__PURE__ */ new Date()).toISOString(),
|
|
278
279
|
ai_data: {
|
|
279
280
|
input: accumulated.input,
|
|
280
281
|
output: accumulated.output,
|
|
281
282
|
model: accumulated.model,
|
|
282
|
-
convo_id: (
|
|
283
|
+
convo_id: (_g = accumulated.convoId) != null ? _g : sticky.convoId
|
|
283
284
|
},
|
|
284
285
|
properties: {
|
|
285
|
-
...
|
|
286
|
+
...restProperties,
|
|
287
|
+
...wizardSession ? { "raindrop.wizardSession": wizardSession } : {},
|
|
286
288
|
$context: this.context
|
|
287
289
|
},
|
|
288
290
|
attachments: accumulated.attachments,
|
|
@@ -2546,6 +2548,7 @@ function startDoStreamSpan(operationId, options, modelInfo, parent, ctx) {
|
|
|
2546
2548
|
});
|
|
2547
2549
|
}
|
|
2548
2550
|
function resolveContext(context, info) {
|
|
2551
|
+
if (context === void 0) return {};
|
|
2549
2552
|
return typeof context === "function" ? context(info) : context;
|
|
2550
2553
|
}
|
|
2551
2554
|
function wrapOnFinish(args, onFinish) {
|
|
@@ -2652,7 +2655,7 @@ function createRaindropAISDK(opts) {
|
|
|
2652
2655
|
return {
|
|
2653
2656
|
wrap(aiSDK, options) {
|
|
2654
2657
|
return wrapAISDK(aiSDK, {
|
|
2655
|
-
options,
|
|
2658
|
+
options: options != null ? options : {},
|
|
2656
2659
|
eventShipper,
|
|
2657
2660
|
traceShipper
|
|
2658
2661
|
});
|
package/dist/index.d.mts
CHANGED
|
@@ -217,7 +217,7 @@ type EventPatch = {
|
|
|
217
217
|
timestamp?: string;
|
|
218
218
|
};
|
|
219
219
|
type RaindropAISDKClient = {
|
|
220
|
-
wrap<T extends object>(aiSDK: T, options
|
|
220
|
+
wrap<T extends object>(aiSDK: T, options?: WrapAISDKOptions): T;
|
|
221
221
|
events: {
|
|
222
222
|
patch(eventId: string, patch: EventPatch): Promise<void>;
|
|
223
223
|
addAttachments(eventId: string, attachments: Attachment[]): Promise<void>;
|
package/dist/index.d.ts
CHANGED
|
@@ -217,7 +217,7 @@ type EventPatch = {
|
|
|
217
217
|
timestamp?: string;
|
|
218
218
|
};
|
|
219
219
|
type RaindropAISDKClient = {
|
|
220
|
-
wrap<T extends object>(aiSDK: T, options
|
|
220
|
+
wrap<T extends object>(aiSDK: T, options?: WrapAISDKOptions): T;
|
|
221
221
|
events: {
|
|
222
222
|
patch(eventId: string, patch: EventPatch): Promise<void>;
|
|
223
223
|
addAttachments(eventId: string, attachments: Attachment[]): Promise<void>;
|
package/dist/index.js
CHANGED
|
@@ -86,7 +86,7 @@ async function postJson(url, body, headers, opts) {
|
|
|
86
86
|
// package.json
|
|
87
87
|
var package_default = {
|
|
88
88
|
name: "@raindrop-ai/ai-sdk",
|
|
89
|
-
version: "0.0.
|
|
89
|
+
version: "0.0.8"};
|
|
90
90
|
|
|
91
91
|
// src/internal/version.ts
|
|
92
92
|
var libraryName = package_default.name;
|
|
@@ -272,19 +272,21 @@ var EventShipper = class {
|
|
|
272
272
|
}
|
|
273
273
|
return;
|
|
274
274
|
}
|
|
275
|
+
const { wizardSession, ...restProperties } = (_e = accumulated.properties) != null ? _e : {};
|
|
275
276
|
const payload = {
|
|
276
277
|
event_id: eventId,
|
|
277
278
|
user_id: userId,
|
|
278
279
|
event: eventName,
|
|
279
|
-
timestamp: (
|
|
280
|
+
timestamp: (_f = accumulated.timestamp) != null ? _f : (/* @__PURE__ */ new Date()).toISOString(),
|
|
280
281
|
ai_data: {
|
|
281
282
|
input: accumulated.input,
|
|
282
283
|
output: accumulated.output,
|
|
283
284
|
model: accumulated.model,
|
|
284
|
-
convo_id: (
|
|
285
|
+
convo_id: (_g = accumulated.convoId) != null ? _g : sticky.convoId
|
|
285
286
|
},
|
|
286
287
|
properties: {
|
|
287
|
-
...
|
|
288
|
+
...restProperties,
|
|
289
|
+
...wizardSession ? { "raindrop.wizardSession": wizardSession } : {},
|
|
288
290
|
$context: this.context
|
|
289
291
|
},
|
|
290
292
|
attachments: accumulated.attachments,
|
|
@@ -2548,6 +2550,7 @@ function startDoStreamSpan(operationId, options, modelInfo, parent, ctx) {
|
|
|
2548
2550
|
});
|
|
2549
2551
|
}
|
|
2550
2552
|
function resolveContext(context, info) {
|
|
2553
|
+
if (context === void 0) return {};
|
|
2551
2554
|
return typeof context === "function" ? context(info) : context;
|
|
2552
2555
|
}
|
|
2553
2556
|
function wrapOnFinish(args, onFinish) {
|
|
@@ -2654,7 +2657,7 @@ function createRaindropAISDK(opts) {
|
|
|
2654
2657
|
return {
|
|
2655
2658
|
wrap(aiSDK, options) {
|
|
2656
2659
|
return wrapAISDK(aiSDK, {
|
|
2657
|
-
options,
|
|
2660
|
+
options: options != null ? options : {},
|
|
2658
2661
|
eventShipper,
|
|
2659
2662
|
traceShipper
|
|
2660
2663
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { _resetWarnedMissingUserId, createRaindropAISDK, currentSpan, eventMetadata, getContextManager, withCurrent } from './chunk-
|
|
1
|
+
export { _resetWarnedMissingUserId, createRaindropAISDK, currentSpan, eventMetadata, getContextManager, withCurrent } from './chunk-NFWQZOEK.mjs';
|
package/dist/index.node.js
CHANGED
|
@@ -90,7 +90,7 @@ async function postJson(url, body, headers, opts) {
|
|
|
90
90
|
// package.json
|
|
91
91
|
var package_default = {
|
|
92
92
|
name: "@raindrop-ai/ai-sdk",
|
|
93
|
-
version: "0.0.
|
|
93
|
+
version: "0.0.8"};
|
|
94
94
|
|
|
95
95
|
// src/internal/version.ts
|
|
96
96
|
var libraryName = package_default.name;
|
|
@@ -276,19 +276,21 @@ var EventShipper = class {
|
|
|
276
276
|
}
|
|
277
277
|
return;
|
|
278
278
|
}
|
|
279
|
+
const { wizardSession, ...restProperties } = (_e = accumulated.properties) != null ? _e : {};
|
|
279
280
|
const payload = {
|
|
280
281
|
event_id: eventId,
|
|
281
282
|
user_id: userId,
|
|
282
283
|
event: eventName,
|
|
283
|
-
timestamp: (
|
|
284
|
+
timestamp: (_f = accumulated.timestamp) != null ? _f : (/* @__PURE__ */ new Date()).toISOString(),
|
|
284
285
|
ai_data: {
|
|
285
286
|
input: accumulated.input,
|
|
286
287
|
output: accumulated.output,
|
|
287
288
|
model: accumulated.model,
|
|
288
|
-
convo_id: (
|
|
289
|
+
convo_id: (_g = accumulated.convoId) != null ? _g : sticky.convoId
|
|
289
290
|
},
|
|
290
291
|
properties: {
|
|
291
|
-
...
|
|
292
|
+
...restProperties,
|
|
293
|
+
...wizardSession ? { "raindrop.wizardSession": wizardSession } : {},
|
|
292
294
|
$context: this.context
|
|
293
295
|
},
|
|
294
296
|
attachments: accumulated.attachments,
|
|
@@ -2552,6 +2554,7 @@ function startDoStreamSpan(operationId, options, modelInfo, parent, ctx) {
|
|
|
2552
2554
|
});
|
|
2553
2555
|
}
|
|
2554
2556
|
function resolveContext(context, info) {
|
|
2557
|
+
if (context === void 0) return {};
|
|
2555
2558
|
return typeof context === "function" ? context(info) : context;
|
|
2556
2559
|
}
|
|
2557
2560
|
function wrapOnFinish(args, onFinish) {
|
|
@@ -2658,7 +2661,7 @@ function createRaindropAISDK(opts) {
|
|
|
2658
2661
|
return {
|
|
2659
2662
|
wrap(aiSDK, options) {
|
|
2660
2663
|
return wrapAISDK(aiSDK, {
|
|
2661
|
-
options,
|
|
2664
|
+
options: options != null ? options : {},
|
|
2662
2665
|
eventShipper,
|
|
2663
2666
|
traceShipper
|
|
2664
2667
|
});
|
package/dist/index.node.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { _resetWarnedMissingUserId, createRaindropAISDK, currentSpan, eventMetadata, getContextManager, withCurrent } from './chunk-
|
|
1
|
+
export { _resetWarnedMissingUserId, createRaindropAISDK, currentSpan, eventMetadata, getContextManager, withCurrent } from './chunk-NFWQZOEK.mjs';
|
|
2
2
|
import { AsyncLocalStorage } from 'async_hooks';
|
|
3
3
|
|
|
4
4
|
globalThis.RAINDROP_ASYNC_LOCAL_STORAGE = AsyncLocalStorage;
|
package/dist/index.workers.js
CHANGED
|
@@ -90,7 +90,7 @@ async function postJson(url, body, headers, opts) {
|
|
|
90
90
|
// package.json
|
|
91
91
|
var package_default = {
|
|
92
92
|
name: "@raindrop-ai/ai-sdk",
|
|
93
|
-
version: "0.0.
|
|
93
|
+
version: "0.0.8"};
|
|
94
94
|
|
|
95
95
|
// src/internal/version.ts
|
|
96
96
|
var libraryName = package_default.name;
|
|
@@ -276,19 +276,21 @@ var EventShipper = class {
|
|
|
276
276
|
}
|
|
277
277
|
return;
|
|
278
278
|
}
|
|
279
|
+
const { wizardSession, ...restProperties } = (_e = accumulated.properties) != null ? _e : {};
|
|
279
280
|
const payload = {
|
|
280
281
|
event_id: eventId,
|
|
281
282
|
user_id: userId,
|
|
282
283
|
event: eventName,
|
|
283
|
-
timestamp: (
|
|
284
|
+
timestamp: (_f = accumulated.timestamp) != null ? _f : (/* @__PURE__ */ new Date()).toISOString(),
|
|
284
285
|
ai_data: {
|
|
285
286
|
input: accumulated.input,
|
|
286
287
|
output: accumulated.output,
|
|
287
288
|
model: accumulated.model,
|
|
288
|
-
convo_id: (
|
|
289
|
+
convo_id: (_g = accumulated.convoId) != null ? _g : sticky.convoId
|
|
289
290
|
},
|
|
290
291
|
properties: {
|
|
291
|
-
...
|
|
292
|
+
...restProperties,
|
|
293
|
+
...wizardSession ? { "raindrop.wizardSession": wizardSession } : {},
|
|
292
294
|
$context: this.context
|
|
293
295
|
},
|
|
294
296
|
attachments: accumulated.attachments,
|
|
@@ -2552,6 +2554,7 @@ function startDoStreamSpan(operationId, options, modelInfo, parent, ctx) {
|
|
|
2552
2554
|
});
|
|
2553
2555
|
}
|
|
2554
2556
|
function resolveContext(context, info) {
|
|
2557
|
+
if (context === void 0) return {};
|
|
2555
2558
|
return typeof context === "function" ? context(info) : context;
|
|
2556
2559
|
}
|
|
2557
2560
|
function wrapOnFinish(args, onFinish) {
|
|
@@ -2658,7 +2661,7 @@ function createRaindropAISDK(opts) {
|
|
|
2658
2661
|
return {
|
|
2659
2662
|
wrap(aiSDK, options) {
|
|
2660
2663
|
return wrapAISDK(aiSDK, {
|
|
2661
|
-
options,
|
|
2664
|
+
options: options != null ? options : {},
|
|
2662
2665
|
eventShipper,
|
|
2663
2666
|
traceShipper
|
|
2664
2667
|
});
|
package/dist/index.workers.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { _resetWarnedMissingUserId, createRaindropAISDK, currentSpan, eventMetadata, getContextManager, withCurrent } from './chunk-
|
|
1
|
+
export { _resetWarnedMissingUserId, createRaindropAISDK, currentSpan, eventMetadata, getContextManager, withCurrent } from './chunk-NFWQZOEK.mjs';
|
|
2
2
|
import { AsyncLocalStorage } from 'async_hooks';
|
|
3
3
|
|
|
4
4
|
if (!globalThis.RAINDROP_ASYNC_LOCAL_STORAGE) {
|
package/package.json
CHANGED