@ai-sdk/llamaindex 1.0.0-canary.5 → 1.0.0-canary.7
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/CHANGELOG.md +25 -0
- package/dist/index.d.mts +95 -12
- package/dist/index.d.ts +95 -12
- package/dist/index.js +5 -34
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -36
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# @ai-sdk/llamaindex
|
|
2
2
|
|
|
3
|
+
## 1.0.0-canary.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [2d03e19]
|
|
8
|
+
- Updated dependencies [319b989]
|
|
9
|
+
- Updated dependencies [441d042]
|
|
10
|
+
- Updated dependencies [dcc549b]
|
|
11
|
+
- Updated dependencies [cb2b53a]
|
|
12
|
+
- Updated dependencies [e244a78]
|
|
13
|
+
- ai@5.0.0-canary.19
|
|
14
|
+
|
|
15
|
+
## 1.0.0-canary.6
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Updated dependencies [a571d6e]
|
|
20
|
+
- Updated dependencies [c60f895]
|
|
21
|
+
- Updated dependencies [332167b]
|
|
22
|
+
- Updated dependencies [a8c8bd5]
|
|
23
|
+
- Updated dependencies [a662dea]
|
|
24
|
+
- Updated dependencies [41fa418]
|
|
25
|
+
- @ai-sdk/provider-utils@3.0.0-canary.15
|
|
26
|
+
- ai@5.0.0-canary.18
|
|
27
|
+
|
|
3
28
|
## 1.0.0-canary.5
|
|
4
29
|
|
|
5
30
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -1,18 +1,101 @@
|
|
|
1
|
-
import { StreamData, DataStreamWriter } from 'ai';
|
|
2
1
|
import { StreamCallbacks } from 'ai/internal';
|
|
3
2
|
|
|
4
3
|
type EngineResponse = {
|
|
5
4
|
delta: string;
|
|
6
5
|
};
|
|
7
|
-
declare function toDataStream(stream: AsyncIterable<EngineResponse>, callbacks?: StreamCallbacks): ReadableStream<
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
6
|
+
declare function toDataStream(stream: AsyncIterable<EngineResponse>, callbacks?: StreamCallbacks): ReadableStream<{
|
|
7
|
+
value: string;
|
|
8
|
+
type: "text";
|
|
9
|
+
} | {
|
|
10
|
+
value: any[];
|
|
11
|
+
type: "data";
|
|
12
|
+
} | {
|
|
13
|
+
value: string;
|
|
14
|
+
type: "error";
|
|
15
|
+
} | {
|
|
16
|
+
value: any[];
|
|
17
|
+
type: "message-annotations";
|
|
18
|
+
} | {
|
|
19
|
+
value: {
|
|
20
|
+
toolName: string;
|
|
21
|
+
toolCallId: string;
|
|
22
|
+
args?: unknown;
|
|
23
|
+
};
|
|
24
|
+
type: "tool-call";
|
|
25
|
+
} | {
|
|
26
|
+
value: {
|
|
27
|
+
toolCallId: string;
|
|
28
|
+
result?: unknown;
|
|
29
|
+
providerMetadata?: any;
|
|
30
|
+
};
|
|
31
|
+
type: "tool-result";
|
|
32
|
+
} | {
|
|
33
|
+
value: {
|
|
34
|
+
toolName: string;
|
|
35
|
+
toolCallId: string;
|
|
36
|
+
};
|
|
37
|
+
type: "tool-call-streaming-start";
|
|
38
|
+
} | {
|
|
39
|
+
value: {
|
|
40
|
+
toolCallId: string;
|
|
41
|
+
argsTextDelta: string;
|
|
42
|
+
};
|
|
43
|
+
type: "tool-call-delta";
|
|
44
|
+
} | {
|
|
45
|
+
value: {
|
|
46
|
+
finishReason: "length" | "unknown" | "stop" | "content-filter" | "tool-calls" | "error" | "other";
|
|
47
|
+
usage?: {
|
|
48
|
+
inputTokens?: number | undefined;
|
|
49
|
+
outputTokens?: number | undefined;
|
|
50
|
+
totalTokens?: number | undefined;
|
|
51
|
+
reasoningTokens?: number | undefined;
|
|
52
|
+
cachedInputTokens?: number | undefined;
|
|
53
|
+
} | undefined;
|
|
54
|
+
};
|
|
55
|
+
type: "finish-message";
|
|
56
|
+
} | {
|
|
57
|
+
value: {
|
|
58
|
+
finishReason: "length" | "unknown" | "stop" | "content-filter" | "tool-calls" | "error" | "other";
|
|
59
|
+
isContinued: boolean;
|
|
60
|
+
usage?: {
|
|
61
|
+
inputTokens?: number | undefined;
|
|
62
|
+
outputTokens?: number | undefined;
|
|
63
|
+
totalTokens?: number | undefined;
|
|
64
|
+
reasoningTokens?: number | undefined;
|
|
65
|
+
cachedInputTokens?: number | undefined;
|
|
66
|
+
} | undefined;
|
|
67
|
+
};
|
|
68
|
+
type: "finish-step";
|
|
69
|
+
} | {
|
|
70
|
+
value: {
|
|
71
|
+
messageId: string;
|
|
72
|
+
};
|
|
73
|
+
type: "start-step";
|
|
74
|
+
} | {
|
|
75
|
+
value: {
|
|
76
|
+
text: string;
|
|
77
|
+
providerMetadata?: Record<string, any> | undefined;
|
|
78
|
+
};
|
|
79
|
+
type: "reasoning";
|
|
80
|
+
} | {
|
|
81
|
+
value: {
|
|
82
|
+
type: "source";
|
|
83
|
+
id: string;
|
|
84
|
+
sourceType: "url";
|
|
85
|
+
url: string;
|
|
86
|
+
providerMetadata?: any;
|
|
87
|
+
title?: string | undefined;
|
|
88
|
+
};
|
|
89
|
+
type: "source";
|
|
90
|
+
} | {
|
|
91
|
+
value: {
|
|
92
|
+
mediaType: string;
|
|
93
|
+
url: string;
|
|
94
|
+
};
|
|
95
|
+
type: "file";
|
|
96
|
+
} | {
|
|
97
|
+
value: null;
|
|
98
|
+
type: "reasoning-part-finish";
|
|
99
|
+
}>;
|
|
17
100
|
|
|
18
|
-
export {
|
|
101
|
+
export { toDataStream };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,18 +1,101 @@
|
|
|
1
|
-
import { StreamData, DataStreamWriter } from 'ai';
|
|
2
1
|
import { StreamCallbacks } from 'ai/internal';
|
|
3
2
|
|
|
4
3
|
type EngineResponse = {
|
|
5
4
|
delta: string;
|
|
6
5
|
};
|
|
7
|
-
declare function toDataStream(stream: AsyncIterable<EngineResponse>, callbacks?: StreamCallbacks): ReadableStream<
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
6
|
+
declare function toDataStream(stream: AsyncIterable<EngineResponse>, callbacks?: StreamCallbacks): ReadableStream<{
|
|
7
|
+
value: string;
|
|
8
|
+
type: "text";
|
|
9
|
+
} | {
|
|
10
|
+
value: any[];
|
|
11
|
+
type: "data";
|
|
12
|
+
} | {
|
|
13
|
+
value: string;
|
|
14
|
+
type: "error";
|
|
15
|
+
} | {
|
|
16
|
+
value: any[];
|
|
17
|
+
type: "message-annotations";
|
|
18
|
+
} | {
|
|
19
|
+
value: {
|
|
20
|
+
toolName: string;
|
|
21
|
+
toolCallId: string;
|
|
22
|
+
args?: unknown;
|
|
23
|
+
};
|
|
24
|
+
type: "tool-call";
|
|
25
|
+
} | {
|
|
26
|
+
value: {
|
|
27
|
+
toolCallId: string;
|
|
28
|
+
result?: unknown;
|
|
29
|
+
providerMetadata?: any;
|
|
30
|
+
};
|
|
31
|
+
type: "tool-result";
|
|
32
|
+
} | {
|
|
33
|
+
value: {
|
|
34
|
+
toolName: string;
|
|
35
|
+
toolCallId: string;
|
|
36
|
+
};
|
|
37
|
+
type: "tool-call-streaming-start";
|
|
38
|
+
} | {
|
|
39
|
+
value: {
|
|
40
|
+
toolCallId: string;
|
|
41
|
+
argsTextDelta: string;
|
|
42
|
+
};
|
|
43
|
+
type: "tool-call-delta";
|
|
44
|
+
} | {
|
|
45
|
+
value: {
|
|
46
|
+
finishReason: "length" | "unknown" | "stop" | "content-filter" | "tool-calls" | "error" | "other";
|
|
47
|
+
usage?: {
|
|
48
|
+
inputTokens?: number | undefined;
|
|
49
|
+
outputTokens?: number | undefined;
|
|
50
|
+
totalTokens?: number | undefined;
|
|
51
|
+
reasoningTokens?: number | undefined;
|
|
52
|
+
cachedInputTokens?: number | undefined;
|
|
53
|
+
} | undefined;
|
|
54
|
+
};
|
|
55
|
+
type: "finish-message";
|
|
56
|
+
} | {
|
|
57
|
+
value: {
|
|
58
|
+
finishReason: "length" | "unknown" | "stop" | "content-filter" | "tool-calls" | "error" | "other";
|
|
59
|
+
isContinued: boolean;
|
|
60
|
+
usage?: {
|
|
61
|
+
inputTokens?: number | undefined;
|
|
62
|
+
outputTokens?: number | undefined;
|
|
63
|
+
totalTokens?: number | undefined;
|
|
64
|
+
reasoningTokens?: number | undefined;
|
|
65
|
+
cachedInputTokens?: number | undefined;
|
|
66
|
+
} | undefined;
|
|
67
|
+
};
|
|
68
|
+
type: "finish-step";
|
|
69
|
+
} | {
|
|
70
|
+
value: {
|
|
71
|
+
messageId: string;
|
|
72
|
+
};
|
|
73
|
+
type: "start-step";
|
|
74
|
+
} | {
|
|
75
|
+
value: {
|
|
76
|
+
text: string;
|
|
77
|
+
providerMetadata?: Record<string, any> | undefined;
|
|
78
|
+
};
|
|
79
|
+
type: "reasoning";
|
|
80
|
+
} | {
|
|
81
|
+
value: {
|
|
82
|
+
type: "source";
|
|
83
|
+
id: string;
|
|
84
|
+
sourceType: "url";
|
|
85
|
+
url: string;
|
|
86
|
+
providerMetadata?: any;
|
|
87
|
+
title?: string | undefined;
|
|
88
|
+
};
|
|
89
|
+
type: "source";
|
|
90
|
+
} | {
|
|
91
|
+
value: {
|
|
92
|
+
mediaType: string;
|
|
93
|
+
url: string;
|
|
94
|
+
};
|
|
95
|
+
type: "file";
|
|
96
|
+
} | {
|
|
97
|
+
value: null;
|
|
98
|
+
type: "reasoning-part-finish";
|
|
99
|
+
}>;
|
|
17
100
|
|
|
18
|
-
export {
|
|
101
|
+
export { toDataStream };
|
package/dist/index.js
CHANGED
|
@@ -20,17 +20,14 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/index.ts
|
|
21
21
|
var src_exports = {};
|
|
22
22
|
__export(src_exports, {
|
|
23
|
-
|
|
24
|
-
toDataStream: () => toDataStream,
|
|
25
|
-
toDataStreamResponse: () => toDataStreamResponse
|
|
23
|
+
toDataStream: () => toDataStream
|
|
26
24
|
});
|
|
27
25
|
module.exports = __toCommonJS(src_exports);
|
|
28
26
|
|
|
29
27
|
// src/llamaindex-adapter.ts
|
|
30
28
|
var import_provider_utils = require("@ai-sdk/provider-utils");
|
|
31
|
-
var import_ai = require("ai");
|
|
32
29
|
var import_internal = require("ai/internal");
|
|
33
|
-
function
|
|
30
|
+
function toDataStream(stream, callbacks) {
|
|
34
31
|
const trimStart = trimStartOfStream();
|
|
35
32
|
return (0, import_provider_utils.convertAsyncIteratorToReadableStream)(stream[Symbol.asyncIterator]()).pipeThrough(
|
|
36
33
|
new TransformStream({
|
|
@@ -38,38 +35,14 @@ function toDataStreamInternal(stream, callbacks) {
|
|
|
38
35
|
controller.enqueue(trimStart(message.delta));
|
|
39
36
|
}
|
|
40
37
|
})
|
|
41
|
-
).pipeThrough((0, import_internal.createCallbacksTransformer)(callbacks)).pipeThrough(
|
|
38
|
+
).pipeThrough((0, import_internal.createCallbacksTransformer)(callbacks)).pipeThrough(
|
|
42
39
|
new TransformStream({
|
|
43
40
|
transform: async (chunk, controller) => {
|
|
44
|
-
controller.enqueue(
|
|
41
|
+
controller.enqueue({ type: "text", value: chunk });
|
|
45
42
|
}
|
|
46
43
|
})
|
|
47
44
|
);
|
|
48
45
|
}
|
|
49
|
-
function toDataStream(stream, callbacks) {
|
|
50
|
-
return toDataStreamInternal(stream, callbacks).pipeThrough(
|
|
51
|
-
new TextEncoderStream()
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
function toDataStreamResponse(stream, options = {}) {
|
|
55
|
-
var _a;
|
|
56
|
-
const { init, data, callbacks } = options;
|
|
57
|
-
const dataStream = toDataStreamInternal(stream, callbacks).pipeThrough(
|
|
58
|
-
new TextEncoderStream()
|
|
59
|
-
);
|
|
60
|
-
const responseStream = data ? (0, import_internal.mergeStreams)(data.stream, dataStream) : dataStream;
|
|
61
|
-
return new Response(responseStream, {
|
|
62
|
-
status: (_a = init == null ? void 0 : init.status) != null ? _a : 200,
|
|
63
|
-
statusText: init == null ? void 0 : init.statusText,
|
|
64
|
-
headers: (0, import_internal.prepareResponseHeaders)(init == null ? void 0 : init.headers, {
|
|
65
|
-
contentType: "text/plain; charset=utf-8",
|
|
66
|
-
dataStreamVersion: "v1"
|
|
67
|
-
})
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
function mergeIntoDataStream(stream, options) {
|
|
71
|
-
options.dataStream.merge(toDataStreamInternal(stream, options.callbacks));
|
|
72
|
-
}
|
|
73
46
|
function trimStartOfStream() {
|
|
74
47
|
let isStreamStart = true;
|
|
75
48
|
return (text) => {
|
|
@@ -82,8 +55,6 @@ function trimStartOfStream() {
|
|
|
82
55
|
}
|
|
83
56
|
// Annotate the CommonJS export names for ESM import in node:
|
|
84
57
|
0 && (module.exports = {
|
|
85
|
-
|
|
86
|
-
toDataStream,
|
|
87
|
-
toDataStreamResponse
|
|
58
|
+
toDataStream
|
|
88
59
|
});
|
|
89
60
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/llamaindex-adapter.ts"],"sourcesContent":["export * from './llamaindex-adapter';\n","import { convertAsyncIteratorToReadableStream } from '@ai-sdk/provider-utils';\nimport {
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/llamaindex-adapter.ts"],"sourcesContent":["export * from './llamaindex-adapter';\n","import { convertAsyncIteratorToReadableStream } from '@ai-sdk/provider-utils';\nimport { DataStreamPart } from 'ai';\nimport { createCallbacksTransformer, StreamCallbacks } from 'ai/internal';\n\ntype EngineResponse = {\n delta: string;\n};\n\nexport function toDataStream(\n stream: AsyncIterable<EngineResponse>,\n callbacks?: StreamCallbacks,\n) {\n const trimStart = trimStartOfStream();\n\n return convertAsyncIteratorToReadableStream(stream[Symbol.asyncIterator]())\n .pipeThrough(\n new TransformStream({\n async transform(message, controller): Promise<void> {\n controller.enqueue(trimStart(message.delta));\n },\n }),\n )\n .pipeThrough(createCallbacksTransformer(callbacks))\n .pipeThrough(\n new TransformStream<string, DataStreamPart>({\n transform: async (chunk, controller) => {\n controller.enqueue({ type: 'text', value: chunk });\n },\n }),\n );\n}\n\nfunction trimStartOfStream(): (text: string) => string {\n let isStreamStart = true;\n\n return (text: string): string => {\n if (isStreamStart) {\n text = text.trimStart();\n if (text) isStreamStart = false;\n }\n return text;\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,4BAAqD;AAErD,sBAA4D;AAMrD,SAAS,aACd,QACA,WACA;AACA,QAAM,YAAY,kBAAkB;AAEpC,aAAO,4DAAqC,OAAO,OAAO,aAAa,EAAE,CAAC,EACvE;AAAA,IACC,IAAI,gBAAgB;AAAA,MAClB,MAAM,UAAU,SAAS,YAA2B;AAClD,mBAAW,QAAQ,UAAU,QAAQ,KAAK,CAAC;AAAA,MAC7C;AAAA,IACF,CAAC;AAAA,EACH,EACC,gBAAY,4CAA2B,SAAS,CAAC,EACjD;AAAA,IACC,IAAI,gBAAwC;AAAA,MAC1C,WAAW,OAAO,OAAO,eAAe;AACtC,mBAAW,QAAQ,EAAE,MAAM,QAAQ,OAAO,MAAM,CAAC;AAAA,MACnD;AAAA,IACF,CAAC;AAAA,EACH;AACJ;AAEA,SAAS,oBAA8C;AACrD,MAAI,gBAAgB;AAEpB,SAAO,CAAC,SAAyB;AAC/B,QAAI,eAAe;AACjB,aAAO,KAAK,UAAU;AACtB,UAAI,KAAM,iBAAgB;AAAA,IAC5B;AACA,WAAO;AAAA,EACT;AACF;","names":[]}
|
package/dist/index.mjs
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
// src/llamaindex-adapter.ts
|
|
2
2
|
import { convertAsyncIteratorToReadableStream } from "@ai-sdk/provider-utils";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
mergeStreams,
|
|
6
|
-
prepareResponseHeaders,
|
|
7
|
-
createCallbacksTransformer
|
|
8
|
-
} from "ai/internal";
|
|
9
|
-
function toDataStreamInternal(stream, callbacks) {
|
|
3
|
+
import { createCallbacksTransformer } from "ai/internal";
|
|
4
|
+
function toDataStream(stream, callbacks) {
|
|
10
5
|
const trimStart = trimStartOfStream();
|
|
11
6
|
return convertAsyncIteratorToReadableStream(stream[Symbol.asyncIterator]()).pipeThrough(
|
|
12
7
|
new TransformStream({
|
|
@@ -14,38 +9,14 @@ function toDataStreamInternal(stream, callbacks) {
|
|
|
14
9
|
controller.enqueue(trimStart(message.delta));
|
|
15
10
|
}
|
|
16
11
|
})
|
|
17
|
-
).pipeThrough(createCallbacksTransformer(callbacks)).pipeThrough(
|
|
12
|
+
).pipeThrough(createCallbacksTransformer(callbacks)).pipeThrough(
|
|
18
13
|
new TransformStream({
|
|
19
14
|
transform: async (chunk, controller) => {
|
|
20
|
-
controller.enqueue(
|
|
15
|
+
controller.enqueue({ type: "text", value: chunk });
|
|
21
16
|
}
|
|
22
17
|
})
|
|
23
18
|
);
|
|
24
19
|
}
|
|
25
|
-
function toDataStream(stream, callbacks) {
|
|
26
|
-
return toDataStreamInternal(stream, callbacks).pipeThrough(
|
|
27
|
-
new TextEncoderStream()
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
function toDataStreamResponse(stream, options = {}) {
|
|
31
|
-
var _a;
|
|
32
|
-
const { init, data, callbacks } = options;
|
|
33
|
-
const dataStream = toDataStreamInternal(stream, callbacks).pipeThrough(
|
|
34
|
-
new TextEncoderStream()
|
|
35
|
-
);
|
|
36
|
-
const responseStream = data ? mergeStreams(data.stream, dataStream) : dataStream;
|
|
37
|
-
return new Response(responseStream, {
|
|
38
|
-
status: (_a = init == null ? void 0 : init.status) != null ? _a : 200,
|
|
39
|
-
statusText: init == null ? void 0 : init.statusText,
|
|
40
|
-
headers: prepareResponseHeaders(init == null ? void 0 : init.headers, {
|
|
41
|
-
contentType: "text/plain; charset=utf-8",
|
|
42
|
-
dataStreamVersion: "v1"
|
|
43
|
-
})
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
function mergeIntoDataStream(stream, options) {
|
|
47
|
-
options.dataStream.merge(toDataStreamInternal(stream, options.callbacks));
|
|
48
|
-
}
|
|
49
20
|
function trimStartOfStream() {
|
|
50
21
|
let isStreamStart = true;
|
|
51
22
|
return (text) => {
|
|
@@ -57,8 +28,6 @@ function trimStartOfStream() {
|
|
|
57
28
|
};
|
|
58
29
|
}
|
|
59
30
|
export {
|
|
60
|
-
|
|
61
|
-
toDataStream,
|
|
62
|
-
toDataStreamResponse
|
|
31
|
+
toDataStream
|
|
63
32
|
};
|
|
64
33
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/llamaindex-adapter.ts"],"sourcesContent":["import { convertAsyncIteratorToReadableStream } from '@ai-sdk/provider-utils';\nimport {
|
|
1
|
+
{"version":3,"sources":["../src/llamaindex-adapter.ts"],"sourcesContent":["import { convertAsyncIteratorToReadableStream } from '@ai-sdk/provider-utils';\nimport { DataStreamPart } from 'ai';\nimport { createCallbacksTransformer, StreamCallbacks } from 'ai/internal';\n\ntype EngineResponse = {\n delta: string;\n};\n\nexport function toDataStream(\n stream: AsyncIterable<EngineResponse>,\n callbacks?: StreamCallbacks,\n) {\n const trimStart = trimStartOfStream();\n\n return convertAsyncIteratorToReadableStream(stream[Symbol.asyncIterator]())\n .pipeThrough(\n new TransformStream({\n async transform(message, controller): Promise<void> {\n controller.enqueue(trimStart(message.delta));\n },\n }),\n )\n .pipeThrough(createCallbacksTransformer(callbacks))\n .pipeThrough(\n new TransformStream<string, DataStreamPart>({\n transform: async (chunk, controller) => {\n controller.enqueue({ type: 'text', value: chunk });\n },\n }),\n );\n}\n\nfunction trimStartOfStream(): (text: string) => string {\n let isStreamStart = true;\n\n return (text: string): string => {\n if (isStreamStart) {\n text = text.trimStart();\n if (text) isStreamStart = false;\n }\n return text;\n };\n}\n"],"mappings":";AAAA,SAAS,4CAA4C;AAErD,SAAS,kCAAmD;AAMrD,SAAS,aACd,QACA,WACA;AACA,QAAM,YAAY,kBAAkB;AAEpC,SAAO,qCAAqC,OAAO,OAAO,aAAa,EAAE,CAAC,EACvE;AAAA,IACC,IAAI,gBAAgB;AAAA,MAClB,MAAM,UAAU,SAAS,YAA2B;AAClD,mBAAW,QAAQ,UAAU,QAAQ,KAAK,CAAC;AAAA,MAC7C;AAAA,IACF,CAAC;AAAA,EACH,EACC,YAAY,2BAA2B,SAAS,CAAC,EACjD;AAAA,IACC,IAAI,gBAAwC;AAAA,MAC1C,WAAW,OAAO,OAAO,eAAe;AACtC,mBAAW,QAAQ,EAAE,MAAM,QAAQ,OAAO,MAAM,CAAC;AAAA,MACnD;AAAA,IACF,CAAC;AAAA,EACH;AACJ;AAEA,SAAS,oBAA8C;AACrD,MAAI,gBAAgB;AAEpB,SAAO,CAAC,SAAyB;AAC/B,QAAI,eAAe;AACjB,aAAO,KAAK,UAAU;AACtB,UAAI,KAAM,iBAAgB;AAAA,IAC5B;AACA,WAAO;AAAA,EACT;AACF;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-sdk/llamaindex",
|
|
3
|
-
"version": "1.0.0-canary.
|
|
3
|
+
"version": "1.0.0-canary.7",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"ai": "5.0.0-canary.
|
|
23
|
-
"@ai-sdk/provider-utils": "3.0.0-canary.
|
|
22
|
+
"ai": "5.0.0-canary.19",
|
|
23
|
+
"@ai-sdk/provider-utils": "3.0.0-canary.15"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@types/node": "20.17.24",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"publishConfig": {
|
|
35
35
|
"access": "public"
|
|
36
36
|
},
|
|
37
|
-
"homepage": "https://sdk.
|
|
37
|
+
"homepage": "https://ai-sdk.dev/docs",
|
|
38
38
|
"repository": {
|
|
39
39
|
"type": "git",
|
|
40
40
|
"url": "git+https://github.com/vercel/ai.git"
|