Skip to content
Snippets Groups Projects
Commit e21eca2a authored by Yi Ding's avatar Yi Ding
Browse files

updated packages and README

parent 33c8c2fe
No related branches found
No related tags found
No related merge requests found
---
"llamaindex": patch
---
OpenAI 4.3.1 and Anthropic 0.6.2
...@@ -20,7 +20,7 @@ In a new folder: ...@@ -20,7 +20,7 @@ In a new folder:
export OPENAI_API_KEY="sk-......" # Replace with your key from https://platform.openai.com/account/api-keys export OPENAI_API_KEY="sk-......" # Replace with your key from https://platform.openai.com/account/api-keys
pnpm init pnpm init
pnpm install typescript pnpm install typescript
pnpm exec tsc -init # if needed pnpm exec tsc --init # if needed
pnpm install llamaindex pnpm install llamaindex
pnpm install @types/node pnpm install @types/node
``` ```
...@@ -36,7 +36,7 @@ async function main() { ...@@ -36,7 +36,7 @@ async function main() {
// Load essay from abramov.txt in Node // Load essay from abramov.txt in Node
const essay = await fs.readFile( const essay = await fs.readFile(
"node_modules/llamaindex/examples/abramov.txt", "node_modules/llamaindex/examples/abramov.txt",
"utf-8" "utf-8",
); );
// Create Document object with essay // Create Document object with essay
...@@ -48,7 +48,7 @@ async function main() { ...@@ -48,7 +48,7 @@ async function main() {
// Query the index // Query the index
const queryEngine = index.asQueryEngine(); const queryEngine = index.asQueryEngine();
const response = await queryEngine.query( const response = await queryEngine.query(
"What did the author do in college?" "What did the author do in college?",
); );
// Output response // Output response
...@@ -61,7 +61,7 @@ main(); ...@@ -61,7 +61,7 @@ main();
Then you can run it using Then you can run it using
```bash ```bash
pnpm dlx ts-node example.ts pnpx ts-node example.ts
``` ```
## Playground ## Playground
......
...@@ -20,7 +20,7 @@ In a new folder: ...@@ -20,7 +20,7 @@ In a new folder:
export OPENAI_API_KEY="sk-......" # Replace with your key from https://platform.openai.com/account/api-keys export OPENAI_API_KEY="sk-......" # Replace with your key from https://platform.openai.com/account/api-keys
pnpm init pnpm init
pnpm install typescript pnpm install typescript
pnpm exec tsc -init # if needed pnpm exec tsc --init # if needed
pnpm install llamaindex pnpm install llamaindex
pnpm install @types/node pnpm install @types/node
``` ```
...@@ -36,7 +36,7 @@ async function main() { ...@@ -36,7 +36,7 @@ async function main() {
// Load essay from abramov.txt in Node // Load essay from abramov.txt in Node
const essay = await fs.readFile( const essay = await fs.readFile(
"node_modules/llamaindex/examples/abramov.txt", "node_modules/llamaindex/examples/abramov.txt",
"utf-8" "utf-8",
); );
// Create Document object with essay // Create Document object with essay
...@@ -48,7 +48,7 @@ async function main() { ...@@ -48,7 +48,7 @@ async function main() {
// Query the index // Query the index
const queryEngine = index.asQueryEngine(); const queryEngine = index.asQueryEngine();
const response = await queryEngine.query( const response = await queryEngine.query(
"What did the author do in college?" "What did the author do in college?",
); );
// Output response // Output response
...@@ -61,7 +61,7 @@ main(); ...@@ -61,7 +61,7 @@ main();
Then you can run it using Then you can run it using
```bash ```bash
pnpm dlx ts-node example.ts pnpx ts-node example.ts
``` ```
## Playground ## Playground
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
"name": "llamaindex", "name": "llamaindex",
"version": "0.0.24", "version": "0.0.24",
"dependencies": { "dependencies": {
"@anthropic-ai/sdk": "^0.6.1", "@anthropic-ai/sdk": "^0.6.2",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"openai": "^4.2.0", "openai": "^4.3.1",
"papaparse": "^5.4.1", "papaparse": "^5.4.1",
"pdf-parse": "^1.1.1", "pdf-parse": "^1.1.1",
"replicate": "^0.16.1", "replicate": "^0.16.1",
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
}, },
"devDependencies": { "devDependencies": {
"@types/lodash": "^4.14.197", "@types/lodash": "^4.14.197",
"@types/node": "^18.17.9", "@types/node": "^18.17.12",
"@types/papaparse": "^5.3.8", "@types/papaparse": "^5.3.8",
"@types/pdf-parse": "^1.1.1", "@types/pdf-parse": "^1.1.1",
"@types/uuid": "^9.0.2", "@types/uuid": "^9.0.2",
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment