Compare commits

..

3 Commits

Author SHA1 Message Date
Marcus Schiesser 980fb4e5a3 release llamaindex@0.2.7 2024-04-11 14:57:01 +08:00
Alex Yang 96f8f40291 fix: agent stream (#710) 2024-04-10 23:22:11 -05:00
Alex Yang 1c698df6e0 fix: package.json version 2024-04-10 19:49:16 -05:00
16 changed files with 69 additions and 29 deletions
-5
View File
@@ -1,5 +0,0 @@
---
"llamaindex": patch
---
Fix agent streaming with new OpenAI models
+2 -1
View File
@@ -10,8 +10,9 @@
"name": "Debug Example",
"skipFiles": ["<node_internals>/**"],
"runtimeExecutable": "pnpm",
"console": "integratedTerminal",
"cwd": "${workspaceFolder}/examples",
"runtimeArgs": ["ts-node", "${fileBasename}"]
"runtimeArgs": ["npx", "tsx", "${file}"]
}
]
}
+1 -1
View File
@@ -12,7 +12,7 @@
"commander": "^11.1.0",
"dotenv": "^16.4.5",
"js-tiktoken": "^1.0.10",
"llamaindex": "workspace:latest",
"llamaindex": "latest",
"mongodb": "^6.5.0",
"pathe": "^1.1.2"
},
+14
View File
@@ -1,5 +1,19 @@
# llamaindex
## 0.2.7
### Patch Changes
- 96f8f40: fix: agent stream
- Updated dependencies
- @llamaindex/env@0.0.7
## 0.2.6
### Patch Changes
- a3b4409: Fix agent streaming with new OpenAI models
## 0.2.5
### Patch Changes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "llamaindex",
"version": "0.2.5",
"version": "0.2.7",
"expectedMinorVersion": "2",
"license": "MIT",
"type": "module",
+10 -10
View File
@@ -186,10 +186,13 @@ export class OpenAIAgentWorker
for await (const chunk of stream) {
controller.enqueue(chunk);
}
controller.close();
},
});
const [pipStream, finalStream] = responseChunkStream.tee();
const { value } = await pipStream.getReader().read();
const reader = pipStream.getReader();
const { value } = await reader.read();
reader.releaseLock();
if (value === undefined) {
throw new Error("first chunk value is undefined, this should not happen");
}
@@ -212,14 +215,16 @@ export class OpenAIAgentWorker
options: value.options,
});
} else {
const [responseStream, chunkStream] = finalStream.tee();
let content = "";
return pipeline(
finalStream.pipeThrough<Response>({
return new StreamingAgentChatResponse(
responseStream.pipeThrough<Response>({
readable: new ReadableStream({
async start(controller) {
for await (const chunk of finalStream) {
for await (const chunk of chunkStream) {
controller.enqueue(new Response(chunk.delta));
}
controller.close();
},
}),
writable: new WritableStream({
@@ -234,12 +239,7 @@ export class OpenAIAgentWorker
},
}),
}),
async (iterator: AsyncIterable<Response>) => {
return new StreamingAgentChatResponse(
iterator,
task.extraState.sources,
);
},
task.extraState.sources,
);
}
}
+1 -1
View File
@@ -161,7 +161,7 @@ export class AgentRunner extends BaseAgentRunner {
const task = this.state.getTask(taskId);
const curStep = step || this.state.getStepQueue(taskId).shift();
let curStepOutput;
let curStepOutput: TaskStepOutput;
if (!curStep) {
throw new Error(`No step found for task ${taskId}`);
+8
View File
@@ -0,0 +1,8 @@
# @llamaindex/edge
## 0.2.7
### Patch Changes
- Updated dependencies
- @llamaindex/env@0.0.7
@@ -1,5 +1,11 @@
# test-edge-runtime
## 0.1.2
### Patch Changes
- @llamaindex/edge@0.2.7
## 0.1.1
### Patch Changes
@@ -1,6 +1,6 @@
{
"name": "test-edge-runtime",
"version": "0.1.1",
"version": "0.1.2",
"private": true,
"scripts": {
"dev": "next dev",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@llamaindex/edge",
"version": "0.2.5",
"version": "0.2.7",
"license": "MIT",
"type": "module",
"dependencies": {
+6
View File
@@ -1,5 +1,11 @@
# @llamaindex/env
## 0.0.7
### Patch Changes
- Add polyfill for pipeline
## 0.0.6
### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@llamaindex/env",
"description": "environment wrapper",
"version": "0.0.6",
"version": "0.0.7",
"type": "module",
"types": "dist/type/index.d.ts",
"main": "dist/cjs/index.js",
+14
View File
@@ -1,5 +1,19 @@
# @llamaindex/experimental
## 0.0.10
### Patch Changes
- Updated dependencies [96f8f40]
- llamaindex@0.2.7
## 0.0.9
### Patch Changes
- Updated dependencies [a3b4409]
- llamaindex@0.2.6
## 0.0.8
### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@llamaindex/experimental",
"description": "Experimental package for LlamaIndexTS",
"version": "0.0.8",
"version": "0.0.10",
"type": "module",
"types": "dist/type/index.d.ts",
"main": "dist/cjs/index.js",
+2 -6
View File
@@ -135,7 +135,7 @@ importers:
specifier: ^1.0.10
version: 1.0.10
llamaindex:
specifier: workspace:latest
specifier: latest
version: link:../packages/core
mongodb:
specifier: ^6.5.0
@@ -4602,10 +4602,6 @@ packages:
resolution: {integrity: sha512-3l1L5PzWVa7l0691TjnsZ0yOIEwG9DziSqu5IPZPlI5Dowi7z42cEym8Y35GHbgHvPcBfNxfrbxm7Cncn4nByQ==}
dev: true
/@tsconfig/node10@1.0.11:
resolution: {integrity: sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==}
dev: true
/@tsconfig/node10@1.0.9:
resolution: {integrity: sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==}
dev: true
@@ -14928,7 +14924,7 @@ packages:
optional: true
dependencies:
'@cspotcode/source-map-support': 0.8.1
'@tsconfig/node10': 1.0.11
'@tsconfig/node10': 1.0.9
'@tsconfig/node12': 1.0.11
'@tsconfig/node14': 1.0.3
'@tsconfig/node16': 1.0.4