Compare commits

..

28 Commits

Author SHA1 Message Date
github-actions[bot] 469e438741 Release 0.4.1 (#949)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-06-21 17:26:01 +07:00
Marcus Schiesser 56fabbb4f5 fix: Release env changes to tokenizer (#952) 2024-06-21 16:58:02 +07:00
Alex Yang dfd8cc1ba4 chore: fix new-version script (#950) 2024-06-20 16:34:09 -07:00
Fabian Wimmer cba54061a2 fix: every Llama Parse job being called "blob" (#946)
Co-authored-by: Alex Yang <himself65@outlook.com>
2024-06-20 16:32:20 -07:00
Peter Goldstein ed467a9889 feat: add Anthropic Claude 3.5 Sonnet model (#948) 2024-06-20 16:21:58 -07:00
Alex Yang 3c4791007f fix: groq llm (#947) 2024-06-20 16:19:55 -07:00
Alex Yang 8f16a179c3 chore: fix lock 2024-06-20 12:51:34 -07:00
github-actions[bot] ce3a4cac6c Release 0.4.0 (#923)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-06-20 12:38:05 -07:00
Alex Yang be46044b98 build: fix check-minor-version.mjs 2024-06-20 12:31:13 -07:00
Alex Yang 154c7f8e36 chore: bump version (#945) 2024-06-20 12:25:59 -07:00
Alex Yang 8b6c2b45a6 chore: fix version release (#937) 2024-06-17 16:42:38 -07:00
Parham Saidi b1a4a74270 docs: updated Bedrock Opus region and added a basic README (#935) 2024-06-17 14:34:14 -07:00
Alex Yang d7fb095fbd refactor: rename directory core to llamaindex (#936) 2024-06-17 14:33:53 -07:00
Alex Yang 58791d4bdd fix: tokenizer type (#934) 2024-06-17 10:34:37 -07:00
Parham Saidi d3b635b193 fix: agents to use chat history (#933) 2024-06-17 10:33:57 -07:00
Marcus Schiesser 436bc41f82 refactor: unify response and agent response (#930) 2024-06-17 09:01:08 -07:00
Vishwasa Navada K 834f49275a docs: fixed the broken link on Getting Started Section (#932) 2024-06-17 22:56:10 +07:00
Marcus Schiesser a44e54f9ec feat: truncate embedding tokens (#918)
Co-authored-by: Alex Yang <himself65@outlook.com>
2024-06-15 02:13:39 +08:00
Wassim Chegham a51ed8dd70 feat: add support for managed identity for Azure OpenAI (#922)
Co-authored-by: Alex Yang <himself65@outlook.com>
2024-06-11 16:32:39 -07:00
Fabian Wimmer c8cfc6c06d fix: LlamaParse json mode returns array + basic example (#914)
Co-authored-by: Marcus Schiesser <marcus.schiesser@googlemail.com>
Co-authored-by: Marcus Schiesser <mail@marcusschiesser.de>
2024-06-11 10:56:52 -07:00
github-actions[bot] 83b2f0b0af Release 0.3.17 (#920)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-06-11 10:52:40 -07:00
Alex Yang 1a6abb38bc build: community package cleanup before release (#897) 2024-06-11 10:47:35 -07:00
Fabian Wimmer 6bc5bddb59 feat: add new options to LlamaParseReader (#915) 2024-06-11 16:31:01 +07:00
Alex Yang e6d6576b2f chore: use unpdf (#849) 2024-06-10 16:45:09 -07:00
Alex Yang bf25ff6104 fix: polyfill for cloudflare worker (#919) 2024-06-10 14:08:47 -07:00
Talha Jubair Siam 32ad0992cf docs : fix correctness and relevancy example (#913) 2024-06-10 20:19:06 +07:00
Marcus Schiesser af650343d9 fix: remove debugger statement (#917) 2024-06-10 20:14:26 +07:00
Thuc Pham f6f4ca44bd feat: add gpt-4o tool call fail example (#916)
Co-authored-by: Marcus Schiesser <mail@marcusschiesser.de>
2024-06-10 17:29:25 +07:00
404 changed files with 4369 additions and 2671 deletions
+4 -1
View File
@@ -1,3 +1,5 @@
const { join } = require("node:path");
module.exports = {
root: true,
extends: [
@@ -6,7 +8,7 @@ module.exports = {
"plugin:@typescript-eslint/recommended-type-checked-only",
],
parserOptions: {
project: true,
project: join(__dirname, "tsconfig.eslint.json"),
__tsconfigRootDir: __dirname,
},
settings: {
@@ -23,6 +25,7 @@ module.exports = {
ignoreIIFE: true,
},
],
"no-debugger": "error",
"@typescript-eslint/await-thenable": "off",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/ban-types": "off",
+1 -1
View File
@@ -31,6 +31,6 @@ jobs:
- name: Publish @llamaindex/core
run: npx jsr publish --allow-slow-types
working-directory: packages/core
working-directory: packages/llamaindex
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+3 -3
View File
@@ -26,12 +26,12 @@ jobs:
- name: Build tarball
run: |
pnpm pack
working-directory: packages/core
working-directory: packages/llamaindex
- name: Create release
uses: ncipollo/release-action@v1
with:
artifacts: "packages/core/llamaindex-*.tgz"
artifacts: "packages/llamaindex/llamaindex-*.tgz"
name: Release ${{ github.ref }}
bodyFile: "packages/core/CHANGELOG.md"
bodyFile: "packages/llamaindex/CHANGELOG.md"
token: ${{ secrets.GITHUB_TOKEN }}
+7 -7
View File
@@ -71,7 +71,7 @@ jobs:
- name: Build
run: pnpm run build
- name: Use Build For Examples
run: pnpm link ../packages/core/
run: pnpm link ../packages/llamaindex/
working-directory: ./examples
- name: Run Type Check
run: pnpm run type-check
@@ -81,9 +81,9 @@ jobs:
if: failure()
with:
name: typecheck-build-dist
path: ./packages/core/dist
path: ./packages/llamaindex/dist
if-no-files-found: error
e2e-core-examples:
e2e-llamaindex-examples:
strategy:
fail-fast: false
matrix:
@@ -91,9 +91,9 @@ jobs:
- cloudflare-worker-agent
- nextjs-agent
- nextjs-edge-runtime
- waku-query-engine
# - waku-query-engine
runs-on: ubuntu-latest
name: Build Core Example (${{ matrix.packages }})
name: Build LlamaIndex Example (${{ matrix.packages }})
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
@@ -108,7 +108,7 @@ jobs:
run: pnpm run build
- name: Build ${{ matrix.packages }}
run: pnpm run build
working-directory: packages/core/e2e/examples/${{ matrix.packages }}
working-directory: packages/llamaindex/e2e/examples/${{ matrix.packages }}
typecheck-examples:
runs-on: ubuntu-latest
@@ -132,7 +132,7 @@ jobs:
working-directory: packages/env
- name: Pack llamaindex
run: pnpm pack --pack-destination ${{ runner.temp }}
working-directory: packages/core
working-directory: packages/llamaindex
- name: Install
run: npm add ${{ runner.temp }}/*.tgz
working-directory: ${{ runner.temp }}/examples
+1 -1
View File
@@ -41,7 +41,7 @@ To run them, run
pnpm run test
```
To write new test cases write them in [packages/core/src/tests](/packages/core/src/tests)
To write new test cases write them in [packages/core/src/tests](/packages/llamaindex/src/tests)
We use Jest https://jestjs.io/ to write our test cases. Jest comes with a bunch of built in assertions using the expect function: https://jestjs.io/docs/expect
+7 -7
View File
@@ -194,19 +194,19 @@ Check out our NextJS playground at https://llama-playground.vercel.app/. The sou
## Core concepts for getting started:
- [Document](/packages/core/src/Node.ts): A document represents a text file, PDF file or other contiguous piece of data.
- [Document](/packages/llamaindex/src/Node.ts): A document represents a text file, PDF file or other contiguous piece of data.
- [Node](/packages/core/src/Node.ts): The basic data building block. Most commonly, these are parts of the document split into manageable pieces that are small enough to be fed into an embedding model and LLM.
- [Node](/packages/llamaindex/src/Node.ts): The basic data building block. Most commonly, these are parts of the document split into manageable pieces that are small enough to be fed into an embedding model and LLM.
- [Embedding](/packages/core/src/embeddings/OpenAIEmbedding.ts): Embeddings are sets of floating point numbers which represent the data in a Node. By comparing the similarity of embeddings, we can derive an understanding of the similarity of two pieces of data. One use case is to compare the embedding of a question with the embeddings of our Nodes to see which Nodes may contain the data needed to answer that quesiton. Because the default service context is OpenAI, the default embedding is `OpenAIEmbedding`. If using different models, say through Ollama, use this [Embedding](/packages/core/src/embeddings/OllamaEmbedding.ts) (see all [here](/packages/core/src/embeddings)).
- [Embedding](/packages/llamaindex/src/embeddings/OpenAIEmbedding.ts): Embeddings are sets of floating point numbers which represent the data in a Node. By comparing the similarity of embeddings, we can derive an understanding of the similarity of two pieces of data. One use case is to compare the embedding of a question with the embeddings of our Nodes to see which Nodes may contain the data needed to answer that quesiton. Because the default service context is OpenAI, the default embedding is `OpenAIEmbedding`. If using different models, say through Ollama, use this [Embedding](/packages/llamaindex/src/embeddings/OllamaEmbedding.ts) (see all [here](/packages/llamaindex/src/embeddings)).
- [Indices](/packages/core/src/indices/): Indices store the Nodes and the embeddings of those nodes. QueryEngines retrieve Nodes from these Indices using embedding similarity.
- [Indices](/packages/llamaindex/src/indices/): Indices store the Nodes and the embeddings of those nodes. QueryEngines retrieve Nodes from these Indices using embedding similarity.
- [QueryEngine](/packages/core/src/engines/query/RetrieverQueryEngine.ts): Query engines are what generate the query you put in and give you back the result. Query engines generally combine a pre-built prompt with selected Nodes from your Index to give the LLM the context it needs to answer your query. To build a query engine from your Index (recommended), use the [`asQueryEngine`](/packages/core/src/indices/BaseIndex.ts) method on your Index. See all query engines [here](/packages/core/src/engines/query).
- [QueryEngine](/packages/llamaindex/src/engines/query/RetrieverQueryEngine.ts): Query engines are what generate the query you put in and give you back the result. Query engines generally combine a pre-built prompt with selected Nodes from your Index to give the LLM the context it needs to answer your query. To build a query engine from your Index (recommended), use the [`asQueryEngine`](/packages/llamaindex/src/indices/BaseIndex.ts) method on your Index. See all query engines [here](/packages/llamaindex/src/engines/query).
- [ChatEngine](/packages/core/src/engines/chat/SimpleChatEngine.ts): A ChatEngine helps you build a chatbot that will interact with your Indices. See all chat engines [here](/packages/core/src/engines/chat).
- [ChatEngine](/packages/llamaindex/src/engines/chat/SimpleChatEngine.ts): A ChatEngine helps you build a chatbot that will interact with your Indices. See all chat engines [here](/packages/llamaindex/src/engines/chat).
- [SimplePrompt](/packages/core/src/Prompt.ts): A simple standardized function call definition that takes in inputs and formats them in a template literal. SimplePrompts can be specialized using currying and combined using other SimplePrompt functions.
- [SimplePrompt](/packages/llamaindex/src/Prompt.ts): A simple standardized function call definition that takes in inputs and formats them in a template literal. SimplePrompts can be specialized using currying and combined using other SimplePrompt functions.
## Tips when using in non-Node.js environments
+30
View File
@@ -1,5 +1,35 @@
# docs
## 0.0.27
### Patch Changes
- Updated dependencies [3c47910]
- Updated dependencies [ed467a9]
- Updated dependencies [cba5406]
- llamaindex@0.4.1
## 0.0.26
### Patch Changes
- b1a4a74: docs: updated Bedrock Opus region and added a basic README
- Updated dependencies [436bc41]
- Updated dependencies [a44e54f]
- Updated dependencies [a51ed8d]
- Updated dependencies [d3b635b]
- llamaindex@0.4.0
- @llamaindex/examples@0.0.5
## 0.0.25
### Patch Changes
- Updated dependencies [6bc5bdd]
- Updated dependencies [bf25ff6]
- Updated dependencies [e6d6576]
- llamaindex@0.3.17
## 0.0.24
### Patch Changes
+1 -1
View File
@@ -35,7 +35,7 @@ For more complex applications, our lower-level APIs allow advanced users to cust
`npm install llamaindex`
Our documentation includes [Installation Instructions](./getting_started/installation.mdx) and a [Starter Tutorial](./getting_started/starter.mdx) to build your first application.
Our documentation includes [Installation Instructions](./getting_started/installation.mdx) and a [Starter Tutorial](./getting_started/starter_tutorial/retrieval_augmented_generation.mdx) to build your first application.
Once you're up and running, [High-Level Concepts](./getting_started/concepts.md) has an overview of LlamaIndex's modular architecture. For more hands-on practical examples, look through our Examples section on the sidebar.
@@ -21,7 +21,7 @@ export OPENAI_API_KEY=your-api-key
Import the required modules:
```ts
import { CorrectnessEvaluator, OpenAI, Settings } from "llamaindex";
import { CorrectnessEvaluator, OpenAI, Settings, Response } from "llamaindex";
```
Let's setup gpt-4 for better results:
@@ -45,7 +45,7 @@ const evaluator = new CorrectnessEvaluator();
const result = await evaluator.evaluateResponse({
query,
response,
response: new Response(response),
});
console.log(
@@ -21,7 +21,13 @@ export OPENAI_API_KEY=your-api-key
Import the required modules:
```ts
import { RelevancyEvaluator, OpenAI, Settings } from "llamaindex";
import {
RelevancyEvaluator,
OpenAI,
Settings,
Document,
VectorStoreIndex,
} from "llamaindex";
```
Let's setup gpt-4 for better results:
@@ -23,7 +23,8 @@ ANTHROPIC_CLAUDE_2 = "anthropic.claude-v2";
ANTHROPIC_CLAUDE_2_1 = "anthropic.claude-v2:1";
ANTHROPIC_CLAUDE_3_SONNET = "anthropic.claude-3-sonnet-20240229-v1:0";
ANTHROPIC_CLAUDE_3_HAIKU = "anthropic.claude-3-haiku-20240307-v1:0";
ANTHROPIC_CLAUDE_3_OPUS = "anthropic.claude-3-opus-20240229-v1:0"; // Not currently on Bedrock
ANTHROPIC_CLAUDE_3_OPUS = "anthropic.claude-3-opus-20240229-v1:0"; // available on us-west-2
ANTHROPIC_CLAUDE_3_5_SONNET = "anthropic.claude-3-5-sonnet-20240620-v1:0";
```
Sonnet, Haiku and Opus are multimodal, image_url only supports base64 data url format, e.g. `data:image/jpeg;base64,SGVsbG8sIFdvcmxkIQ==`
+1 -1
View File
@@ -167,7 +167,7 @@ const config = {
[
"docusaurus-plugin-typedoc",
{
entryPoints: ["../../packages/core/src/index.ts"],
entryPoints: ["../../packages/llamaindex/src/index.ts"],
tsconfig: "../../tsconfig.json",
readme: "none",
sourceLinkTemplate:
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "docs",
"version": "0.0.24",
"version": "0.0.27",
"private": true,
"scripts": {
"docusaurus": "docusaurus",
@@ -37,7 +37,7 @@
"docusaurus-plugin-typedoc": "^1.0.1",
"typedoc": "^0.25.13",
"typedoc-plugin-markdown": "^4.0.1",
"typescript": "^5.4.5"
"typescript": "^5.5.2"
},
"browserslist": {
"production": [
+10
View File
@@ -1,5 +1,15 @@
# examples
## 0.0.5
### Patch Changes
- Updated dependencies [436bc41]
- Updated dependencies [a44e54f]
- Updated dependencies [a51ed8d]
- Updated dependencies [d3b635b]
- llamaindex@0.4.0
## 0.0.4
### Patch Changes
@@ -0,0 +1,74 @@
import { FunctionTool, OpenAI, ToolCallOptions } from "llamaindex";
(async () => {
// The tool call will generate a partial JSON for `gpt-4-turbo`
// See thread: https://community.openai.com/t/gpt-4o-doesnt-consistently-respect-json-schema-on-tool-use/751125/7
const models = ["gpt-4o", "gpt-4-turbo"];
for (const model of models) {
const validJSON = await callLLM({ model });
console.log(
`LLM call resulting in large tool input with '${model}': LLM generates ${validJSON ? "valid" : "invalid"} JSON.`,
);
}
})();
async function callLLM(init: Partial<OpenAI>) {
const csvData =
"Country,Average Height (cm)\nNetherlands,156\nDenmark,158\nNorway,160";
const userQuestion = "Describe data in this csv";
// fake code interpreter tool
const interpreterTool = FunctionTool.from(
({ code }: { code: string }) => code,
{
name: "interpreter",
description:
"Execute python code in a Jupyter notebook cell and return any result, stdout, stderr, display_data, and error.",
parameters: {
type: "object",
properties: {
code: {
type: "string",
description: "The python code to execute in a single cell.",
},
},
required: ["code"],
},
},
);
const systemPrompt =
"You are a Python interpreter.\n- You are given tasks to complete and you run python code to solve them.\n- The python code runs in a Jupyter notebook. Every time you call $(interpreter) tool, the python code is executed in a separate cell. It's okay to make multiple calls to $(interpreter).\n- Display visualizations using matplotlib or any other visualization library directly in the notebook. Shouldn't save the visualizations to a file, just return the base64 encoded data.\n- You can install any pip package (if it exists) if you need to but the usual packages for data analysis are already preinstalled.\n- You can run any python code you want in a secure environment.";
const llm = new OpenAI(init);
const response = await llm.chat({
tools: [interpreterTool],
messages: [
{ role: "system", content: systemPrompt },
{
role: "user",
content: [
{
type: "text",
text: userQuestion,
},
{
type: "text",
text: `Use data from following CSV raw contents:\n${csvData}`,
},
],
},
],
});
const options = response.message?.options as ToolCallOptions;
const input = options.toolCall[0].input as string;
try {
JSON.parse(input);
return true;
} catch {
return false;
}
}
+1 -1
View File
@@ -53,7 +53,7 @@ async function main() {
message: "How much is 5 + 5? then divide by 2",
});
console.log(response.response.message);
console.log(response.message);
}
void main().then(() => {
+1 -1
View File
@@ -68,7 +68,7 @@ async function main() {
});
// Chat with the agent
const { response } = await agent.chat({
const response = await agent.chat({
message: "Divide 16 by 2 then add 20",
});
+1 -1
View File
@@ -31,7 +31,7 @@ async function main() {
tools: [queryEngineTool],
});
const { response } = await agent.chat({
const response = await agent.chat({
message: "What was his salary?",
});
+1 -3
View File
@@ -68,9 +68,7 @@ async function main() {
console.log("Response:");
for await (const {
response: { delta },
} of stream) {
for await (const { delta } of stream) {
process.stdout.write(delta);
}
}
+1 -3
View File
@@ -16,9 +16,7 @@ async function main() {
stream: true,
});
for await (const {
response: { delta },
} of response) {
for await (const { delta } of response) {
process.stdout.write(delta);
}
}
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -35,4 +35,4 @@ async function main() {
console.log(response.response);
}
await main();
main().catch(console.error);
+4 -4
View File
@@ -1,7 +1,7 @@
{
"name": "@llamaindex/examples",
"private": true,
"version": "0.0.4",
"version": "0.0.5",
"dependencies": {
"@aws-crypto/sha256-js": "^5.2.0",
"@datastax/astra-db-ts": "^1.2.1",
@@ -12,15 +12,15 @@
"commander": "^12.1.0",
"dotenv": "^16.4.5",
"js-tiktoken": "^1.0.12",
"llamaindex": "^0.3.14",
"llamaindex": "^0.4.0",
"mongodb": "^6.7.0",
"pathe": "^1.1.2"
},
"devDependencies": {
"@types/node": "^20.14.1",
"ts-node": "^10.9.2",
"tsx": "^4.11.2",
"typescript": "^5.4.5"
"tsx": "^4.15.6",
"typescript": "^5.5.2"
},
"scripts": {
"lint": "eslint ."
+4 -3
View File
@@ -11,14 +11,15 @@
"start:pdf": "node --import tsx ./src/pdf.ts",
"start:llamaparse": "node --import tsx ./src/llamaparse.ts",
"start:notion": "node --import tsx ./src/notion.ts",
"start:llamaparse-dir": "node --import tsx ./src/simple-directory-reader-with-llamaparse.ts"
"start:llamaparse-dir": "node --import tsx ./src/simple-directory-reader-with-llamaparse.ts",
"start:llamaparse-json": "node --import tsx ./src/llamaparse-json.ts"
},
"dependencies": {
"llamaindex": "*"
},
"devDependencies": {
"@types/node": "^20.12.11",
"tsx": "^4.9.3",
"typescript": "^5.4.5"
"tsx": "^4.15.6",
"typescript": "^5.5.2"
}
}
+30
View File
@@ -0,0 +1,30 @@
import fs from "fs/promises";
import { LlamaParseReader } from "llamaindex";
async function main() {
// Load PDF using LlamaParse json mode
const reader = new LlamaParseReader({ resultType: "json" });
const jsonObjs = await reader.loadJson("../data/uber_10q_march_2022.pdf");
// Write the JSON objects to a file
try {
await fs.writeFile("jsonObjs.json", JSON.stringify(jsonObjs, null, 4));
console.log("Array of JSON objects has been written to jsonObjs.json");
} catch (e) {
console.error("Error writing jsonObjs.json", e);
}
const jsonList = jsonObjs[0]["pages"];
// Write the list of JSON objects as a single array to a file
try {
await fs.writeFile("jsonList.json", JSON.stringify(jsonList, null, 4));
console.log(
"List of JSON objects as single array has been written to jsonList.json",
);
} catch (e) {
console.error("Error writing jsonList.json", e);
}
}
main().catch(console.error);
+9 -9
View File
@@ -14,25 +14,25 @@
"type-check": "tsc -b --diagnostics",
"release": "pnpm run check-minor-version && pnpm run build:release && changeset publish",
"release-snapshot": "pnpm run check-minor-version && pnpm run build:release && changeset publish --tag snapshot",
"check-minor-version": "node ./scripts/check-minor-version",
"new-version": "changeset version && pnpm run check-minor-version && pnpm format:write && pnpm run build:release",
"check-minor-version": "node ./scripts/check-minor-version.mjs",
"new-version": "changeset version && pnpm run check-minor-version && pnpm format:write && pnpm install && pnpm run build:release",
"new-snapshot": "pnpm run build:release && changeset version --snapshot"
},
"devDependencies": {
"@changesets/cli": "^2.27.5",
"@typescript-eslint/eslint-plugin": "^7.11.0",
"@typescript-eslint/eslint-plugin": "^7.13.1",
"eslint": "^8.57.0",
"eslint-config-next": "^14.2.3",
"eslint-config-next": "^14.2.4",
"eslint-config-prettier": "^9.1.0",
"eslint-config-turbo": "^1.13.3",
"eslint-config-turbo": "^1.13.4",
"eslint-plugin-react": "7.34.1",
"husky": "^9.0.11",
"lint-staged": "^15.2.5",
"lint-staged": "^15.2.7",
"madge": "^7.0.0",
"prettier": "^3.2.5",
"prettier": "^3.3.2",
"prettier-plugin-organize-imports": "^3.2.4",
"turbo": "^1.13.3",
"typescript": "^5.4.5"
"turbo": "^1.13.4",
"typescript": "^5.5.2"
},
"packageManager": "pnpm@9.0.5",
"pnpm": {
+11
View File
@@ -0,0 +1,11 @@
# @llamaindex/autotool
## 1.0.0
### Patch Changes
- Updated dependencies [436bc41]
- Updated dependencies [a44e54f]
- Updated dependencies [a51ed8d]
- Updated dependencies [d3b635b]
- llamaindex@0.4.0
@@ -5,10 +5,10 @@
"dependencies": {
"@llamaindex/autotool": "workspace:*",
"llamaindex": "workspace:*",
"openai": "^4.43.0"
"openai": "^4.52.0"
},
"devDependencies": {
"tsx": "^4.9.3"
"tsx": "^4.15.6"
},
"scripts": {
"start": "node --import tsx --import @llamaindex/autotool/node ./src/index.ts"
@@ -1,5 +1,36 @@
# @llamaindex/autotool-02-next-example
## 0.1.11
### Patch Changes
- Updated dependencies [3c47910]
- Updated dependencies [ed467a9]
- Updated dependencies [cba5406]
- llamaindex@0.4.1
- @llamaindex/autotool@1.0.0
## 0.1.10
### Patch Changes
- Updated dependencies [436bc41]
- Updated dependencies [a44e54f]
- Updated dependencies [a51ed8d]
- Updated dependencies [d3b635b]
- llamaindex@0.4.0
- @llamaindex/autotool@1.0.0
## 0.1.9
### Patch Changes
- Updated dependencies [6bc5bdd]
- Updated dependencies [bf25ff6]
- Updated dependencies [e6d6576]
- llamaindex@0.3.17
- @llamaindex/autotool@0.0.1
## 0.1.8
### Patch Changes
@@ -1,7 +1,7 @@
{
"name": "@llamaindex/autotool-02-next-example",
"private": true,
"version": "0.1.8",
"version": "0.1.11",
"scripts": {
"dev": "next dev",
"build": "next build",
@@ -9,8 +9,8 @@
},
"dependencies": {
"@llamaindex/autotool": "workspace:*",
"@radix-ui/react-slot": "^1.0.2",
"ai": "^3.1.3",
"@radix-ui/react-slot": "^1.1.0",
"ai": "^3.2.1",
"class-variance-authority": "^0.7.0",
"dotenv": "^16.3.1",
"llamaindex": "workspace:*",
@@ -20,18 +20,18 @@
"react-dom": "^18.3.1",
"react-markdown": "^9.0.1",
"react-syntax-highlighter": "^15.5.0",
"sonner": "^1.4.41",
"sonner": "^1.5.0",
"tailwind-merge": "^2.1.0"
},
"devDependencies": {
"@types/node": "^20.12.11",
"@types/react": "^18.3.1",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@types/react-syntax-highlighter": "^15.5.11",
"autoprefixer": "^10.4.16",
"cross-env": "^7.0.3",
"postcss": "^8.4.32",
"tailwindcss": "^3.3.6",
"typescript": "^5.4.5"
"tailwindcss": "^3.4.4",
"typescript": "^5.5.2"
}
}
+10 -10
View File
@@ -1,7 +1,7 @@
{
"name": "@llamaindex/autotool",
"type": "module",
"version": "0.0.1",
"version": "1.0.0",
"description": "auto transpile your JS function to LLM Agent compatible",
"files": [
"dist",
@@ -45,13 +45,13 @@
"dev": "bunchee --watch"
},
"dependencies": {
"@swc/core": "^1.5.5",
"jotai": "^2.8.0",
"@swc/core": "^1.6.3",
"jotai": "^2.8.3",
"typedoc": "^0.25.13",
"unplugin": "^1.10.1"
},
"peerDependencies": {
"llamaindex": "^0.3.16",
"llamaindex": "^0.4.1",
"openai": "^4",
"typescript": "^4"
},
@@ -67,16 +67,16 @@
}
},
"devDependencies": {
"@swc/types": "^0.1.6",
"@swc/types": "^0.1.8",
"@types/json-schema": "^7.0.15",
"@types/node": "^20.12.11",
"bunchee": "^5.1.5",
"bunchee": "^5.2.1",
"llamaindex": "workspace:*",
"next": "14.2.3",
"rollup": "^4.17.2",
"tsx": "^4.9.3",
"typescript": "^5.4.5",
"rollup": "^4.18.0",
"tsx": "^4.15.6",
"typescript": "^5.5.2",
"vitest": "^1.6.0",
"webpack": "^5.91.0"
"webpack": "^5.92.1"
}
}
+1 -1
View File
@@ -10,7 +10,7 @@
"include": ["./src"],
"references": [
{
"path": "../core/tsconfig.json"
"path": "../llamaindex/tsconfig.json"
},
{
"path": "../env/tsconfig.json"
-12
View File
@@ -1,12 +0,0 @@
{
"jsc": {
"parser": {
"syntax": "typescript"
},
"target": "esnext"
},
"module": {
"type": "commonjs",
"ignoreDynamic": true
}
}
-8
View File
@@ -1,8 +0,0 @@
{
"jsc": {
"parser": {
"syntax": "typescript"
},
"target": "esnext"
}
}
+30
View File
@@ -1,5 +1,35 @@
# @llamaindex/community
## 0.0.5
### Patch Changes
- ed467a9: Add model ids for Anthropic Claude 3.5 Sonnet model on Anthropic and Bedrock
- Updated dependencies [3c47910]
- Updated dependencies [ed467a9]
- Updated dependencies [cba5406]
- llamaindex@0.4.1
## 0.0.4
### Patch Changes
- b1a4a74: docs: updated Bedrock Opus region and added a basic README
- Updated dependencies [436bc41]
- Updated dependencies [a44e54f]
- Updated dependencies [a51ed8d]
- Updated dependencies [d3b635b]
- llamaindex@0.4.0
## 0.0.3
### Patch Changes
- Updated dependencies [6bc5bdd]
- Updated dependencies [bf25ff6]
- Updated dependencies [e6d6576]
- llamaindex@0.3.17
## 0.0.2
### Patch Changes
+11
View File
@@ -0,0 +1,11 @@
# @llamaindex/community
> Tools written by the community for llamaindex
## Current Features:
- Bedrock support for the Anthropic Claude Models [usage](https://ts.llamaindex.ai/modules/llms/available_llms/bedrock)
## LICENSE
MIT
+15 -17
View File
@@ -1,7 +1,7 @@
{
"name": "@llamaindex/community",
"description": "Community package for LlamaIndexTS",
"version": "0.0.2",
"version": "0.0.5",
"type": "module",
"types": "dist/type/index.d.ts",
"main": "dist/cjs/index.js",
@@ -13,23 +13,24 @@
},
"require": {
"types": "./dist/type/index.d.ts",
"default": "./dist/cjs/index.js"
"default": "./dist/index.cjs"
}
},
"./*": {
"./llm/bedrock": {
"import": {
"types": "./dist/type/*.d.ts",
"default": "./dist/*.js"
"types": "./dist/type/llm/bedrock.d.ts",
"default": "./dist/llm/bedrock/base.js"
},
"require": {
"types": "./dist/type/*.d.ts",
"default": "./dist/cjs/*.js"
"types": "./dist/type/llm/bedrock.d.ts",
"default": "./dist/llm/bedrock/base.cjs"
}
}
},
"files": [
"dist",
"CHANGELOG.md"
"CHANGELOG.md",
"!**/*.tsbuildinfo"
],
"repository": {
"type": "git",
@@ -37,23 +38,20 @@
"directory": "packages/community"
},
"scripts": {
"lint": "eslint .",
"build": "rm -rf ./dist && pnpm run build:esm && pnpm run build:cjs && pnpm run build:type",
"build:esm": "swc src -d dist --strip-leading-paths --config-file ../../.swcrc",
"build:cjs": "swc src -d dist/cjs --strip-leading-paths --config-file ../../.cjs.swcrc",
"build": "rm -rf ./dist && pnpm run build:code && pnpm run build:type",
"build:code": "tsup",
"build:type": "tsc -p tsconfig.json",
"postbuild": "node -e \"require('fs').writeFileSync('./dist/cjs/package.json', JSON.stringify({ type: 'commonjs' }))\"",
"dev": "concurrently \"pnpm run build:esm --watch\" \"pnpm run build:cjs --watch\" \"pnpm run build:type --watch\""
},
"devDependencies": {
"@swc/cli": "^0.3.12",
"@swc/core": "^1.5.5",
"@swc/core": "^1.6.3",
"concurrently": "^8.2.2",
"pathe": "^1.1.2"
"tsup": "^8.1.0"
},
"dependencies": {
"@aws-sdk/client-bedrock-runtime": "^3.582.0",
"@types/node": "^20.12.11",
"@aws-sdk/client-bedrock-runtime": "^3.600.0",
"@types/node": "^20.14.2",
"llamaindex": "workspace:*"
}
}
@@ -67,6 +67,7 @@ export enum BEDROCK_MODELS {
ANTHROPIC_CLAUDE_3_SONNET = "anthropic.claude-3-sonnet-20240229-v1:0",
ANTHROPIC_CLAUDE_3_HAIKU = "anthropic.claude-3-haiku-20240307-v1:0",
ANTHROPIC_CLAUDE_3_OPUS = "anthropic.claude-3-opus-20240229-v1:0",
ANTHROPIC_CLAUDE_3_5_SONNET = "anthropic.claude-3-5-sonnet-20240620-v1:0",
META_LLAMA2_13B_CHAT = "meta.llama2-13b-chat-v1",
META_LLAMA2_70B_CHAT = "meta.llama2-70b-chat-v1",
META_LLAMA3_8B_INSTRUCT = "meta.llama3-8b-instruct-v1:0",
@@ -100,6 +101,7 @@ const CHAT_ONLY_MODELS = {
[BEDROCK_MODELS.ANTHROPIC_CLAUDE_3_SONNET]: 200000,
[BEDROCK_MODELS.ANTHROPIC_CLAUDE_3_HAIKU]: 200000,
[BEDROCK_MODELS.ANTHROPIC_CLAUDE_3_OPUS]: 200000,
[BEDROCK_MODELS.ANTHROPIC_CLAUDE_3_5_SONNET]: 200000,
[BEDROCK_MODELS.META_LLAMA2_13B_CHAT]: 2048,
[BEDROCK_MODELS.META_LLAMA2_70B_CHAT]: 4096,
[BEDROCK_MODELS.META_LLAMA3_8B_INSTRUCT]: 8192,
@@ -126,6 +128,7 @@ export const STREAMING_MODELS = new Set([
BEDROCK_MODELS.ANTHROPIC_CLAUDE_3_SONNET,
BEDROCK_MODELS.ANTHROPIC_CLAUDE_3_HAIKU,
BEDROCK_MODELS.ANTHROPIC_CLAUDE_3_OPUS,
BEDROCK_MODELS.ANTHROPIC_CLAUDE_3_5_SONNET,
BEDROCK_MODELS.META_LLAMA2_13B_CHAT,
BEDROCK_MODELS.META_LLAMA2_70B_CHAT,
BEDROCK_MODELS.META_LLAMA3_8B_INSTRUCT,
+3 -3
View File
@@ -5,15 +5,15 @@
"outDir": "./dist/type",
"tsBuildInfoFile": "./dist/.tsbuildinfo",
"emitDeclarationOnly": true,
"module": "node16",
"moduleResolution": "node16",
"module": "ESNext",
"moduleResolution": "bundler",
"types": ["node"]
},
"include": ["./src"],
"exclude": ["node_modules"],
"references": [
{
"path": "../core/tsconfig.json"
"path": "../llamaindex/tsconfig.json"
}
]
}
+9
View File
@@ -0,0 +1,9 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "./dist/script/type",
"tsBuildInfoFile": "./dist/script/.tsbuildinfo",
"emitDeclarationOnly": true
},
"include": ["./tsup.config.ts"]
}
+9
View File
@@ -0,0 +1,9 @@
import { defineConfig } from "tsup";
export default defineConfig([
{
entry: ["src/index.ts", "src/llm/bedrock/base.ts"],
format: ["cjs", "esm"],
sourcemap: true,
},
]);
-49
View File
@@ -1,49 +0,0 @@
import { encodingForModel } from "js-tiktoken";
export enum Tokenizers {
CL100K_BASE = "cl100k_base",
}
/**
* @internal Helper class singleton
*/
class GlobalsHelper {
defaultTokenizer: {
encode: (text: string) => Uint32Array;
decode: (tokens: Uint32Array) => string;
};
constructor() {
const encoding = encodingForModel("text-embedding-ada-002"); // cl100k_base
this.defaultTokenizer = {
encode: (text: string) => {
return new Uint32Array(encoding.encode(text));
},
decode: (tokens: Uint32Array) => {
const numberArray = Array.from(tokens);
const text = encoding.decode(numberArray);
const uint8Array = new TextEncoder().encode(text);
return new TextDecoder().decode(uint8Array);
},
};
}
tokenizer(encoding?: Tokenizers) {
if (encoding && encoding !== Tokenizers.CL100K_BASE) {
throw new Error(`Tokenizer encoding ${encoding} not yet supported`);
}
return this.defaultTokenizer!.encode.bind(this.defaultTokenizer);
}
tokenizerDecoder(encoding?: Tokenizers) {
if (encoding && encoding !== Tokenizers.CL100K_BASE) {
throw new Error(`Tokenizer encoding ${encoding} not yet supported`);
}
return this.defaultTokenizer!.decode.bind(this.defaultTokenizer);
}
}
export const globalsHelper = new GlobalsHelper();
-23
View File
@@ -1,23 +0,0 @@
import type { NodeWithScore } from "./Node.js";
/**
* Response is the output of a LLM
*/
export class Response {
response: string;
sourceNodes?: NodeWithScore[];
metadata: Record<string, unknown> = {};
constructor(response: string, sourceNodes?: NodeWithScore[]) {
this.response = response;
this.sourceNodes = sourceNodes || [];
}
protected _getFormattedSources() {
throw new Error("Not implemented yet");
}
toString() {
return this.response ?? "";
}
}
-33
View File
@@ -1,33 +0,0 @@
import { Document } from "../Node.js";
import { FileReader } from "./type.js";
/**
* Read the text of a PDF
*/
export class PDFReader extends FileReader {
async loadDataAsContent(fileContent: Buffer): Promise<Document[]> {
const pages = await readPDF(fileContent);
return pages.map((text, page) => {
const metadata = {
page_number: page + 1,
};
return new Document({ text, metadata });
});
}
}
async function readPDF(data: Buffer): Promise<string[]> {
const parser = await import("pdf2json").then(
({ default: Pdfparser }) => new Pdfparser(null, true),
);
const text = await new Promise<string>((resolve, reject) => {
parser.on("pdfParser_dataError", (error) => {
reject(error);
});
parser.on("pdfParser_dataReady", () => {
resolve((parser as any).getRawTextContent() as string);
});
parser.parseBuffer(data);
});
return text.split(/----------------Page \(\d+\) Break----------------/g);
}
+6
View File
@@ -1,5 +1,11 @@
# @llamaindex/env
## 0.1.4
### Patch Changes
- 56fabbb: Release env changes to tokenizer
## 0.1.3
### Patch Changes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@llamaindex/env",
"version": "0.1.3",
"version": "0.1.4",
"exports": {
".": "./src/index.ts"
},
+8 -5
View File
@@ -1,7 +1,7 @@
{
"name": "@llamaindex/env",
"description": "environment wrapper, supports all JS environment including node, deno, bun, edge runtime, and cloudflare worker",
"version": "0.1.3",
"version": "0.1.4",
"type": "module",
"types": "dist/type/index.d.ts",
"main": "dist/cjs/index.js",
@@ -48,7 +48,8 @@
},
"files": [
"dist",
"CHANGELOG.md"
"CHANGELOG.md",
"!**/*.tsbuildinfo"
],
"repository": {
"type": "git",
@@ -68,18 +69,20 @@
"devDependencies": {
"@aws-crypto/sha256-js": "^5.2.0",
"@swc/cli": "^0.3.12",
"@swc/core": "^1.5.5",
"@swc/core": "^1.6.3",
"concurrently": "^8.2.2",
"pathe": "^1.1.2",
"vitest": "^1.6.0"
},
"dependencies": {
"@types/lodash": "^4.17.1",
"@types/lodash": "^4.17.5",
"@types/node": "^20.12.11"
},
"peerDependencies": {
"@aws-crypto/sha256-js": "^5.2.0",
"pathe": "^1.1.2"
"js-tiktoken": "^1.0.12",
"pathe": "^1.1.2",
"tiktoken": "^1.0.15"
},
"peerDependenciesMeta": {
"@aws-crypto/sha256-js": {
+2
View File
@@ -4,3 +4,5 @@
* @module
*/
export * from "./polyfill.js";
export { Tokenizers, tokenizers, type Tokenizer } from "./tokenizers/js.js";
+4 -3
View File
@@ -35,14 +35,15 @@ export function createSHA256(): SHA256 {
};
}
export { Tokenizers, tokenizers, type Tokenizer } from "./tokenizers/node.js";
export { AsyncLocalStorage, CustomEvent, getEnv, setEnvs } from "./utils.js";
export {
EOL,
ReadableStream,
TransformStream,
WritableStream,
fs,
ok,
path,
randomUUID,
ReadableStream,
TransformStream,
WritableStream,
};
+2
View File
@@ -12,3 +12,5 @@ export * from "./polyfill.js";
export function getEnv(name: string): string | undefined {
return INTERNAL_ENV[name];
}
export { Tokenizers, tokenizers, type Tokenizer } from "./tokenizers/node.js";
+35
View File
@@ -0,0 +1,35 @@
// Note: js-tiktoken it's 60x slower than the WASM implementation - use it only for unsupported environments
import { getEncoding } from "js-tiktoken";
import type { Tokenizer } from "./types.js";
import { Tokenizers } from "./types.js";
class TokenizerSingleton {
private defaultTokenizer: Tokenizer;
constructor() {
const encoding = getEncoding("cl100k_base");
this.defaultTokenizer = {
encode: (text: string) => {
return new Uint32Array(encoding.encode(text));
},
decode: (tokens: Uint32Array) => {
const numberArray = Array.from(tokens);
const text = encoding.decode(numberArray);
const uint8Array = new TextEncoder().encode(text);
return new TextDecoder().decode(uint8Array);
},
};
}
tokenizer(encoding?: Tokenizers) {
if (encoding && encoding !== Tokenizers.CL100K_BASE) {
throw new Error(`Tokenizer encoding ${encoding} not yet supported`);
}
return this.defaultTokenizer;
}
}
export const tokenizers = new TokenizerSingleton();
export { Tokenizers, type Tokenizer };
+38
View File
@@ -0,0 +1,38 @@
// Note: This is using th WASM implementation of tiktoken which is 60x faster
import cl100k_base from "tiktoken/encoders/cl100k_base.json";
import { Tiktoken } from "tiktoken/lite";
import type { Tokenizer } from "./types.js";
import { Tokenizers } from "./types.js";
class TokenizerSingleton {
private defaultTokenizer: Tokenizer;
constructor() {
const encoding = new Tiktoken(
cl100k_base.bpe_ranks,
cl100k_base.special_tokens,
cl100k_base.pat_str,
);
this.defaultTokenizer = {
encode: (text: string) => {
return encoding.encode(text);
},
decode: (tokens: Uint32Array) => {
const text = encoding.decode(tokens);
return new TextDecoder().decode(text);
},
};
}
tokenizer(encoding?: Tokenizers): Tokenizer {
if (encoding && encoding !== Tokenizers.CL100K_BASE) {
throw new Error(`Tokenizer encoding ${encoding} not yet supported`);
}
return this.defaultTokenizer;
}
}
export const tokenizers: TokenizerSingleton = new TokenizerSingleton();
export { Tokenizers, type Tokenizer };
+8
View File
@@ -0,0 +1,8 @@
export enum Tokenizers {
CL100K_BASE = "cl100k_base",
}
export interface Tokenizer {
encode: (text: string) => Uint32Array;
decode: (tokens: Uint32Array) => string;
}
+2 -1
View File
@@ -7,7 +7,8 @@
"emitDeclarationOnly": true,
"module": "node16",
"moduleResolution": "node16",
"types": ["node"]
"types": ["node"],
"resolveJsonModule": true
},
"include": ["./src"],
"exclude": ["node_modules"]
+28
View File
@@ -1,5 +1,33 @@
# @llamaindex/experimental
## 0.0.36
### Patch Changes
- Updated dependencies [3c47910]
- Updated dependencies [ed467a9]
- Updated dependencies [cba5406]
- llamaindex@0.4.1
## 0.0.35
### Patch Changes
- Updated dependencies [436bc41]
- Updated dependencies [a44e54f]
- Updated dependencies [a51ed8d]
- Updated dependencies [d3b635b]
- llamaindex@0.4.0
## 0.0.34
### Patch Changes
- Updated dependencies [6bc5bdd]
- Updated dependencies [bf25ff6]
- Updated dependencies [e6d6576]
- llamaindex@0.3.17
## 0.0.33
### Patch Changes
+5 -4
View File
@@ -1,7 +1,7 @@
{
"name": "@llamaindex/experimental",
"description": "Experimental package for LlamaIndexTS",
"version": "0.0.33",
"version": "0.0.36",
"type": "module",
"types": "dist/type/index.d.ts",
"main": "dist/cjs/index.js",
@@ -37,7 +37,8 @@
},
"files": [
"dist",
"CHANGELOG.md"
"CHANGELOG.md",
"!**/*.tsbuildinfo"
],
"repository": {
"type": "git",
@@ -56,13 +57,13 @@
"devDependencies": {
"@aws-crypto/sha256-js": "^5.2.0",
"@swc/cli": "^0.3.12",
"@swc/core": "^1.5.5",
"@swc/core": "^1.6.3",
"@types/jsonpath": "^0.2.4",
"concurrently": "^8.2.2",
"pathe": "^1.1.2"
},
"dependencies": {
"@types/lodash": "^4.17.1",
"@types/lodash": "^4.17.5",
"@types/node": "^20.12.11",
"jsonpath": "^1.1.1",
"llamaindex": "workspace:*",
@@ -1,6 +1,6 @@
import jsonpath from "jsonpath";
import { Response } from "llamaindex";
import { EngineResponse } from "llamaindex";
import { serviceContextFromDefaults, type ServiceContext } from "llamaindex";
@@ -147,11 +147,13 @@ export class JSONQueryEngine implements QueryEngine {
return JSON.stringify(this.jsonSchema);
}
query(params: QueryEngineParamsStreaming): Promise<AsyncIterable<Response>>;
query(params: QueryEngineParamsNonStreaming): Promise<Response>;
query(
params: QueryEngineParamsStreaming,
): Promise<AsyncIterable<EngineResponse>>;
query(params: QueryEngineParamsNonStreaming): Promise<EngineResponse>;
async query(
params: QueryEngineParamsStreaming | QueryEngineParamsNonStreaming,
): Promise<Response | AsyncIterable<Response>> {
): Promise<EngineResponse | AsyncIterable<EngineResponse>> {
const { query, stream } = params;
if (stream) {
@@ -200,7 +202,7 @@ export class JSONQueryEngine implements QueryEngine {
jsonPathResponseStr,
};
const response = new Response(responseStr, []);
const response = EngineResponse.fromResponse(responseStr, false);
response.metadata = responseMetadata;
+1 -1
View File
@@ -13,7 +13,7 @@
"exclude": ["node_modules"],
"references": [
{
"path": "../core/tsconfig.json"
"path": "../llamaindex/tsconfig.json"
}
]
}
@@ -1,5 +1,35 @@
# llamaindex
## 0.4.1
### Patch Changes
- 3c47910: fix: groq llm
- ed467a9: Add model ids for Anthropic Claude 3.5 Sonnet model on Anthropic and Bedrock
- cba5406: fix: every Llama Parse job being called "blob"
- Updated dependencies [56fabbb]
- @llamaindex/env@0.1.4
## 0.4.0
### Minor Changes
- 436bc41: Unify chat engine response and agent response
### Patch Changes
- a44e54f: Truncate text to embed for OpenAI if it exceeds maxTokens
- a51ed8d: feat: add support for managed identity for Azure OpenAI
- d3b635b: fix: agents to use chat history
## 0.3.17
### Patch Changes
- 6bc5bdd: feat: add cache disabling, fast mode, do not unroll columns mode and custom page seperator to LlamaParseReader
- bf25ff6: fix: polyfill for cloudflare worker
- e6d6576: chore: use `unpdf`
## 0.3.16
### Patch Changes
@@ -41,7 +41,7 @@ To run them, run
pnpm run test
```
To write new test cases write them in [packages/core/src/tests](/packages/core/src/tests)
To write new test cases write them in [packages/core/src/tests](/packages/llamaindex/src/tests)
We use Jest https://jestjs.io/ to write our test cases. Jest comes with a bunch of built in assertions using the expect function: https://jestjs.io/docs/expect
@@ -1,5 +1,11 @@
# @llamaindex/core-e2e
## 0.0.7
### Patch Changes
- bf25ff6: fix: polyfill for cloudflare worker
## 0.0.6
### Patch Changes
@@ -1,5 +1,34 @@
# @llamaindex/cloudflare-worker-agent-test
## 0.0.20
### Patch Changes
- Updated dependencies [3c47910]
- Updated dependencies [ed467a9]
- Updated dependencies [cba5406]
- llamaindex@0.4.1
## 0.0.19
### Patch Changes
- Updated dependencies [436bc41]
- Updated dependencies [a44e54f]
- Updated dependencies [a51ed8d]
- Updated dependencies [d3b635b]
- llamaindex@0.4.0
## 0.0.18
### Patch Changes
- bf25ff6: fix: polyfill for cloudflare worker
- Updated dependencies [6bc5bdd]
- Updated dependencies [bf25ff6]
- Updated dependencies [e6d6576]
- llamaindex@0.3.17
## 0.0.17
### Patch Changes
@@ -1,6 +1,6 @@
{
"name": "@llamaindex/cloudflare-worker-agent-test",
"version": "0.0.17",
"version": "0.0.20",
"type": "module",
"private": true,
"scripts": {
@@ -12,13 +12,13 @@
"cf-typegen": "wrangler types"
},
"devDependencies": {
"@cloudflare/vitest-pool-workers": "^0.2.6",
"@cloudflare/workers-types": "^4.20240502.0",
"@cloudflare/vitest-pool-workers": "^0.4.3",
"@cloudflare/workers-types": "^4.20240605.0",
"@vitest/runner": "1.3.0",
"@vitest/snapshot": "1.3.0",
"typescript": "^5.4.5",
"typescript": "^5.5.2",
"vitest": "1.3.0",
"wrangler": "^3.53.1"
"wrangler": "^3.60.1"
},
"dependencies": {
"llamaindex": "workspace:*"
@@ -10,16 +10,18 @@ export default {
const agent = new OpenAIAgent({
tools: [],
});
console.log(1);
const responseStream = await agent.chat({
stream: true,
message: "Hello? What is the weather today?",
});
console.log(2);
const textEncoder = new TextEncoder();
const response = responseStream.pipeThrough<Uint8Array>(
// @ts-expect-error: see https://github.com/cloudflare/workerd/issues/2067
new TransformStream({
transform: (chunk, controller) => {
controller.enqueue(textEncoder.encode(chunk.response.delta));
controller.enqueue(textEncoder.encode(chunk.delta));
},
}),
);
@@ -1,5 +1,33 @@
# @llamaindex/next-agent-test
## 0.1.20
### Patch Changes
- Updated dependencies [3c47910]
- Updated dependencies [ed467a9]
- Updated dependencies [cba5406]
- llamaindex@0.4.1
## 0.1.19
### Patch Changes
- Updated dependencies [436bc41]
- Updated dependencies [a44e54f]
- Updated dependencies [a51ed8d]
- Updated dependencies [d3b635b]
- llamaindex@0.4.0
## 0.1.18
### Patch Changes
- Updated dependencies [6bc5bdd]
- Updated dependencies [bf25ff6]
- Updated dependencies [e6d6576]
- llamaindex@0.3.17
## 0.1.17
### Patch Changes
@@ -1,6 +1,6 @@
{
"name": "@llamaindex/next-agent-test",
"version": "0.1.17",
"version": "0.1.20",
"private": true,
"scripts": {
"dev": "next dev",
@@ -9,20 +9,20 @@
"lint": "next lint"
},
"dependencies": {
"ai": "^3.1.3",
"ai": "^3.2.1",
"llamaindex": "workspace:*",
"next": "14.2.3",
"next": "14.2.4",
"react": "18.3.1",
"react-dom": "18.3.1"
},
"devDependencies": {
"@types/node": "^20.12.11",
"@types/react": "^18.3.1",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"eslint": "^8.57.0",
"eslint-config-next": "14.2.3",
"postcss": "^8",
"tailwindcss": "^3.4.1",
"typescript": "^5.4.5"
"tailwindcss": "^3.4.4",
"typescript": "^5.5.2"
}
}

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Before

Width:  |  Height:  |  Size: 629 B

After

Width:  |  Height:  |  Size: 629 B

@@ -23,7 +23,7 @@ export async function chatWithAgent(
uiStream.update("response:");
},
write: async (message) => {
uiStream.append(message.response.delta);
uiStream.append(message.delta);
},
}),
)

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

@@ -1,12 +1,12 @@
"use client";
import { chatWithAgent } from "@/actions";
import type { JSX } from "react";
import type { ReactNode } from "react";
import { useFormState } from "react-dom";
export const runtime = "edge";
export default function Home() {
const [state, action] = useFormState<JSX.Element | null>(async () => {
const [state, action] = useFormState<ReactNode>(async () => {
return chatWithAgent("hello!", []);
}, null);
return (
@@ -1,5 +1,33 @@
# test-edge-runtime
## 0.1.19
### Patch Changes
- Updated dependencies [3c47910]
- Updated dependencies [ed467a9]
- Updated dependencies [cba5406]
- llamaindex@0.4.1
## 0.1.18
### Patch Changes
- Updated dependencies [436bc41]
- Updated dependencies [a44e54f]
- Updated dependencies [a51ed8d]
- Updated dependencies [d3b635b]
- llamaindex@0.4.0
## 0.1.17
### Patch Changes
- Updated dependencies [6bc5bdd]
- Updated dependencies [bf25ff6]
- Updated dependencies [e6d6576]
- llamaindex@0.3.17
## 0.1.16
### Patch Changes
@@ -1,6 +1,6 @@
{
"name": "@llamaindex/nextjs-edge-runtime-test",
"version": "0.1.16",
"version": "0.1.19",
"private": true,
"scripts": {
"dev": "next dev",
@@ -9,14 +9,14 @@
},
"dependencies": {
"llamaindex": "workspace:*",
"next": "14.2.3",
"next": "14.2.4",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
"devDependencies": {
"@types/node": "^20.12.11",
"@types/react": "^18.3.1",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"typescript": "^5.4.5"
"typescript": "^5.5.2"
}
}

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Before

Width:  |  Height:  |  Size: 629 B

After

Width:  |  Height:  |  Size: 629 B

Some files were not shown because too many files have changed in this diff Show More