Skip to content

Commit 6786d37

Browse files
fix: llamacloud for TS and activate in e2e
1 parent dfd4fd5 commit 6786d37

File tree

6 files changed

+14
-10
lines changed

6 files changed

+14
-10
lines changed

.github/workflows/e2e.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ jobs:
8686
python-version: ["3.11"]
8787
os: [macos-latest, windows-latest, ubuntu-22.04]
8888
frameworks: ["nextjs", "express"]
89-
datasources: ["--no-files", "--example-file"]
89+
datasources: ["--no-files", "--example-file", "--llamacloud"]
9090
defaults:
9191
run:
9292
shell: bash

e2e/shared/streaming_template.spec.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import { expect, test } from "@playwright/test";
33
import { ChildProcess } from "child_process";
44
import fs from "fs";
5+
import crypto from "node:crypto";
56
import path from "path";
67
import type {
78
TemplateFramework,
@@ -19,9 +20,6 @@ const dataSource: string = process.env.DATASOURCE
1920
const templateUI: TemplateUI = "shadcn";
2021
const templatePostInstallAction: TemplatePostInstallAction = "runApp";
2122

22-
const llamaCloudProjectName = "create-llama";
23-
const llamaCloudIndexName = "e2e-test";
24-
2523
const appType: AppType = templateFramework === "nextjs" ? "" : "--frontend";
2624
const userMessage =
2725
dataSource !== "--no-files" ? "Physical standard for letters" : "Hello";
@@ -43,9 +41,12 @@ test.describe(`Test streaming template ${templateFramework} ${dataSource} ${temp
4341
const vectorDb = "none";
4442

4543
test.beforeAll(async () => {
44+
const testId = crypto.randomUUID();
45+
const llamaCloudProjectName = `create-llama`;
46+
const llamaCloudIndexName = `e2e-test-${testId}`;
4647
port = Math.floor(Math.random() * 10000) + 10000;
4748
externalPort = port + 1;
48-
cwd = await createTestDir();
49+
cwd = await createTestDir(testId);
4950
const result = await runCreateLlama({
5051
cwd,
5152
templateType: "streaming",

e2e/utils.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,11 @@ export async function runCreateLlama({
160160
};
161161
}
162162

163-
export async function createTestDir() {
164-
const cwd = path.join(__dirname, "cache", crypto.randomUUID());
163+
export async function createTestDir(testId?: string) {
164+
if (!testId) {
165+
testId = crypto.randomUUID();
166+
}
167+
const cwd = path.join(__dirname, "cache", testId);
165168
await mkdir(cwd, { recursive: true });
166169
return cwd;
167170
}

templates/components/vectordbs/typescript/llamacloud/generate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ async function* walk(dir: string): AsyncGenerator<string> {
2626
async function loadAndIndex() {
2727
const index = await getDataSource();
2828
// ensure the index is available or create a new one
29-
await index.ensureIndex();
29+
await index.ensureIndex({ verbose: true });
3030
const projectId = await index.getProjectId();
3131
const pipelineId = await index.getPipelineId();
3232

templates/types/streaming/express/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"dotenv": "^16.3.1",
2222
"duck-duck-scrape": "^2.2.5",
2323
"express": "^4.18.2",
24-
"llamaindex": "0.6.21",
24+
"llamaindex": "0.6.22",
2525
"pdf2json": "3.0.5",
2626
"ajv": "^8.12.0",
2727
"@e2b/code-interpreter": "0.0.9-beta.3",

templates/types/streaming/nextjs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"duck-duck-scrape": "^2.2.5",
2828
"formdata-node": "^6.0.3",
2929
"got": "^14.4.1",
30-
"llamaindex": "0.6.21",
30+
"llamaindex": "0.6.22",
3131
"lucide-react": "^0.294.0",
3232
"next": "^14.2.4",
3333
"react": "^18.2.0",

0 commit comments

Comments
 (0)