Compare commits

..

8 Commits

Author SHA1 Message Date
github-actions[bot] 5b4a53177e Release 0.11.29 (#2188)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: marcusschiesser <17126+marcusschiesser@users.noreply.github.com>
2025-09-11 10:44:29 +08:00
Thuc Pham 5da1cda939 feat: support zod v4 & v3 (#2186)
Co-authored-by: Marcus Schiesser <mail@marcusschiesser.de>
2025-09-11 10:34:45 +08:00
Thuc Pham 1285e381bd feat: add ci-build script for size limit testing (#2194) 2025-09-10 18:09:47 +08:00
Neha Prasad 5d5cd44276 fix: anthropic temperature parameter not respecting value 0 (#2190)
Co-authored-by: Marcus Schiesser <marcus.schiesser@googlemail.com>
2025-09-10 11:45:12 +08:00
hunter ed37c645af chore: addition of apac claude 4 sonnet to aws records (#2189) 2025-09-10 11:44:57 +08:00
hunter c40adafecc chore: add latest google models (#2191) 2025-09-10 11:44:30 +08:00
dependabot[bot] 995b465205 chore(deps-dev): bump vite from 6.3.3 to 6.3.6 (#2193)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-10 10:46:55 +08:00
Jeremy B. Merrill 8929dcf1dd vectorStoreIndex has new option progressCallback (#2187)
Co-authored-by: Marcus Schiesser <marcus.schiesser@googlemail.com>
2025-09-05 10:37:22 +08:00
179 changed files with 2831 additions and 1437 deletions
+3 -2
View File
@@ -105,6 +105,7 @@ jobs:
run: | run: |
pnpm pack --pack-destination ${{ runner.temp }} -C packages/llamaindex pnpm pack --pack-destination ${{ runner.temp }} -C packages/llamaindex
pnpm pack --pack-destination ${{ runner.temp }} -C packages/workflow pnpm pack --pack-destination ${{ runner.temp }} -C packages/workflow
pnpm pack --pack-destination ${{ runner.temp }} -C packages/core
- name: Install packed packages - name: Install packed packages
run: npm add ${{ runner.temp }}/*.tgz run: npm add ${{ runner.temp }}/*.tgz
working-directory: e2e/npm working-directory: e2e/npm
@@ -162,7 +163,7 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }} github_token: ${{ secrets.GITHUB_TOKEN }}
directory: e2e/examples/vite-import-llamaindex directory: e2e/examples/vite-import-llamaindex
skip_step: "install" skip_step: "install"
build_script: build build_script: ci-build
package_manager: pnpm package_manager: pnpm
typecheck-examples: typecheck-examples:
@@ -203,7 +204,7 @@ jobs:
fi fi
done done
- name: Install - name: Install
run: npm add ${{ runner.temp }}/*.tgz run: npm add ${{ runner.temp }}/*.tgz --legacy-peer-deps
working-directory: ${{ runner.temp }}/examples working-directory: ${{ runner.temp }}/examples
- name: Run Type Check - name: Run Type Check
run: npx tsc --project ./tsconfig.json run: npx tsc --project ./tsconfig.json
+15
View File
@@ -1,5 +1,20 @@
# @llamaindex/doc # @llamaindex/doc
## 0.2.54
### Patch Changes
- ed37c64: Addition of APAC_ANTHROPIC_CLAUDE_4_SONNET type/record in @llamaindex/aws for APAC support for claude 4 sonnet per issue 2184.
- Updated dependencies [8929dcf]
- Updated dependencies [5da1cda]
- llamaindex@0.11.29
- @llamaindex/core@0.6.21
- @llamaindex/workflow@1.1.23
- @llamaindex/openai@0.4.19
- @llamaindex/cloud@4.1.3
- @llamaindex/node-parser@2.0.21
- @llamaindex/readers@3.1.20
## 0.2.53 ## 0.2.53
### Patch Changes ### Patch Changes
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@llamaindex/doc", "name": "@llamaindex/doc",
"version": "0.2.53", "version": "0.2.54",
"private": true, "private": true,
"scripts": { "scripts": {
"postinstall": "fumadocs-mdx", "postinstall": "fumadocs-mdx",
@@ -115,6 +115,7 @@ EU_AMAZON_NOVA_MICRO_1 = "eu.amazon.nova-micro-v1:0";
APAC_ANTHROPIC_CLAUDE_3_5_SONNET = "apac.anthropic.claude-3-5-sonnet-20240620-v1:0"; APAC_ANTHROPIC_CLAUDE_3_5_SONNET = "apac.anthropic.claude-3-5-sonnet-20240620-v1:0";
APAC_ANTHROPIC_CLAUDE_3_5_SONNET_V2 = "apac.anthropic.claude-3-5-sonnet-20241022-v2:0"; APAC_ANTHROPIC_CLAUDE_3_5_SONNET_V2 = "apac.anthropic.claude-3-5-sonnet-20241022-v2:0";
APAC_ANTHROPIC_CLAUDE_3_7_SONNET = "apac.anthropic.claude-3-7-sonnet-20250219-v1:0"; APAC_ANTHROPIC_CLAUDE_3_7_SONNET = "apac.anthropic.claude-3-7-sonnet-20250219-v1:0";
APAC_ANTHROPIC_CLAUDE_4_SONNET = "apac.anthropic.claude-sonnet-4-20250514-v1:0";
APAC_ANTHROPIC_CLAUDE_3_HAIKU = "apac.anthropic.claude-3-haiku-20240307-v1:0"; APAC_ANTHROPIC_CLAUDE_3_HAIKU = "apac.anthropic.claude-3-haiku-20240307-v1:0";
APAC_ANTHROPIC_CLAUDE_3_SONNET = "apac.anthropic.claude-3-sonnet-20240229-v1:0"; APAC_ANTHROPIC_CLAUDE_3_SONNET = "apac.anthropic.claude-3-sonnet-20240229-v1:0";
APAC_AMAZON_NOVA_PRO_1 = "apac.amazon.nova-pro-v1:0"; APAC_AMAZON_NOVA_PRO_1 = "apac.amazon.nova-pro-v1:0";
@@ -1,5 +1,12 @@
# @llamaindex/cloudflare-worker-agent-test # @llamaindex/cloudflare-worker-agent-test
## 0.0.190
### Patch Changes
- Updated dependencies [8929dcf]
- llamaindex@0.11.29
## 0.0.189 ## 0.0.189
### Patch Changes ### Patch Changes
@@ -1,6 +1,6 @@
{ {
"name": "@llamaindex/cloudflare-worker-agent-test", "name": "@llamaindex/cloudflare-worker-agent-test",
"version": "0.0.189", "version": "0.0.190",
"type": "module", "type": "module",
"private": true, "private": true,
"scripts": { "scripts": {
@@ -1,5 +1,11 @@
# @llamaindex/llama-parse-browser-test # @llamaindex/llama-parse-browser-test
## 0.0.87
### Patch Changes
- @llamaindex/cloud@4.1.3
## 0.0.86 ## 0.0.86
### Patch Changes ### Patch Changes
@@ -1,7 +1,7 @@
{ {
"name": "@llamaindex/llama-parse-browser-test", "name": "@llamaindex/llama-parse-browser-test",
"private": true, "private": true,
"version": "0.0.86", "version": "0.0.87",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
@@ -10,7 +10,7 @@
}, },
"devDependencies": { "devDependencies": {
"typescript": "^5.8.3", "typescript": "^5.8.3",
"vite": "^6.3.3", "vite": "^6.3.6",
"vite-plugin-wasm": "^3.4.1" "vite-plugin-wasm": "^3.4.1"
}, },
"dependencies": { "dependencies": {
+7
View File
@@ -1,5 +1,12 @@
# @llamaindex/next-agent-test # @llamaindex/next-agent-test
## 0.1.190
### Patch Changes
- Updated dependencies [8929dcf]
- llamaindex@0.11.29
## 0.1.189 ## 0.1.189
### Patch Changes ### Patch Changes
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@llamaindex/next-agent-test", "name": "@llamaindex/next-agent-test",
"version": "0.1.189", "version": "0.1.190",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "next dev", "dev": "next dev",
@@ -1,5 +1,12 @@
# test-edge-runtime # test-edge-runtime
## 0.1.189
### Patch Changes
- Updated dependencies [8929dcf]
- llamaindex@0.11.29
## 0.1.188 ## 0.1.188
### Patch Changes ### Patch Changes
@@ -1,6 +1,6 @@
{ {
"name": "@llamaindex/nextjs-edge-runtime-test", "name": "@llamaindex/nextjs-edge-runtime-test",
"version": "0.1.188", "version": "0.1.189",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "next dev", "dev": "next dev",
@@ -1,5 +1,14 @@
# @llamaindex/next-node-runtime # @llamaindex/next-node-runtime
## 0.1.61
### Patch Changes
- Updated dependencies [8929dcf]
- llamaindex@0.11.29
- @llamaindex/huggingface@0.1.29
- @llamaindex/readers@3.1.20
## 0.1.60 ## 0.1.60
### Patch Changes ### Patch Changes
@@ -1,6 +1,6 @@
{ {
"name": "@llamaindex/next-node-runtime-test", "name": "@llamaindex/next-node-runtime-test",
"version": "0.1.60", "version": "0.1.61",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "next dev", "dev": "next dev",
@@ -1,5 +1,12 @@
# vite-import-llamaindex # vite-import-llamaindex
## 0.0.56
### Patch Changes
- Updated dependencies [8929dcf]
- llamaindex@0.11.29
## 0.0.55 ## 0.0.55
### Patch Changes ### Patch Changes
@@ -1,11 +1,12 @@
{ {
"name": "vite-import-llamaindex", "name": "vite-import-llamaindex",
"private": true, "private": true,
"version": "0.0.55", "version": "0.0.56",
"type": "module", "type": "module",
"scripts": { "scripts": {
"build": "vite build", "build": "vite build",
"size-limit": "size-limit" "size-limit": "size-limit",
"ci-build": "pnpm -C ../../../ build && vite build"
}, },
"size-limit": [ "size-limit": [
{ {
@@ -16,7 +17,7 @@
"@size-limit/preset-big-lib": "^11.1.6", "@size-limit/preset-big-lib": "^11.1.6",
"size-limit": "^11.1.6", "size-limit": "^11.1.6",
"typescript": "^5.8.3", "typescript": "^5.8.3",
"vite": "^6.3.3" "vite": "^6.3.6"
}, },
"dependencies": { "dependencies": {
"llamaindex": "workspace:*" "llamaindex": "workspace:*"
@@ -1,5 +1,12 @@
# @llamaindex/waku-query-engine-test # @llamaindex/waku-query-engine-test
## 0.0.190
### Patch Changes
- Updated dependencies [8929dcf]
- llamaindex@0.11.29
## 0.0.189 ## 0.0.189
### Patch Changes ### Patch Changes
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@llamaindex/waku-query-engine-test", "name": "@llamaindex/waku-query-engine-test",
"version": "0.0.189", "version": "0.0.190",
"type": "module", "type": "module",
"private": true, "private": true,
"scripts": { "scripts": {
+1 -3
View File
@@ -44,9 +44,7 @@ export const getWeatherTool = FunctionTool.from(
name: "getWeather", name: "getWeather",
description: "Get the weather for a city", description: "Get the weather for a city",
parameters: z.object({ parameters: z.object({
city: z.string({ city: z.string().describe("The city to get the weather for"),
description: "The city to get the weather for",
}),
}), }),
}, },
); );
+55
View File
@@ -1,5 +1,60 @@
# examples # examples
## 0.3.41
### Patch Changes
- Updated dependencies [8929dcf]
- Updated dependencies [5da1cda]
- Updated dependencies [5d5cd44]
- Updated dependencies [c40adaf]
- llamaindex@0.11.29
- @llamaindex/core@0.6.21
- @llamaindex/tools@0.1.11
- @llamaindex/workflow@1.1.23
- @llamaindex/ollama@0.1.22
- @llamaindex/openai@0.4.19
- @llamaindex/vercel@0.1.21
- @llamaindex/anthropic@0.3.24
- @llamaindex/google@0.3.21
- @llamaindex/cloud@4.1.3
- @llamaindex/node-parser@2.0.21
- @llamaindex/assemblyai@0.1.20
- @llamaindex/clip@0.0.75
- @llamaindex/cohere@0.0.35
- @llamaindex/deepinfra@0.0.75
- @llamaindex/discord@0.1.20
- @llamaindex/huggingface@0.1.29
- @llamaindex/jinaai@0.0.35
- @llamaindex/mistral@0.1.21
- @llamaindex/mixedbread@0.0.35
- @llamaindex/notion@0.1.20
- @llamaindex/perplexity@0.0.32
- @llamaindex/portkey-ai@0.0.63
- @llamaindex/replicate@0.0.63
- @llamaindex/bm25-retriever@0.0.10
- @llamaindex/astra@0.0.35
- @llamaindex/azure@0.1.36
- @llamaindex/chroma@0.0.35
- @llamaindex/elastic-search@0.1.21
- @llamaindex/firestore@1.0.28
- @llamaindex/milvus@0.1.30
- @llamaindex/mongodb@0.0.36
- @llamaindex/pinecone@0.1.21
- @llamaindex/postgres@0.0.64
- @llamaindex/qdrant@0.1.31
- @llamaindex/supabase@0.1.22
- @llamaindex/upstash@0.0.35
- @llamaindex/weaviate@0.0.36
- @llamaindex/voyage-ai@1.0.27
- @llamaindex/readers@3.1.20
- @llamaindex/deepseek@0.0.37
- @llamaindex/fireworks@0.0.35
- @llamaindex/groq@0.0.91
- @llamaindex/together@0.0.35
- @llamaindex/vllm@0.0.61
- @llamaindex/xai@0.0.22
## 0.3.40 ## 0.3.40
### Patch Changes ### Patch Changes
+1 -3
View File
@@ -20,9 +20,7 @@ const saveFileTool = tool({
description: description:
"Save the written content into a file that can be downloaded by the user", "Save the written content into a file that can be downloaded by the user",
parameters: z.object({ parameters: z.object({
content: z.string({ content: z.string().describe("The content to save into a file"),
description: "The content to save into a file",
}),
}), }),
execute: ({ content }: { content: string }) => { execute: ({ content }: { content: string }) => {
const filePath = os.tmpdir() + "/report.md"; const filePath = os.tmpdir() + "/report.md";
+1 -3
View File
@@ -17,9 +17,7 @@ const userQuestion = "which are the best comedies after 2010?";
description: description:
"Execute python code in a Jupyter notebook cell and return any result, stdout, stderr, display_data, and error.", "Execute python code in a Jupyter notebook cell and return any result, stdout, stderr, display_data, and error.",
parameters: z.object({ parameters: z.object({
code: z.string({ code: z.string().describe("The python code to execute in a single cell."),
description: "The python code to execute in a single cell.",
}),
}), }),
execute: ({ code }) => { execute: ({ code }) => {
console.log( console.log(
+2 -6
View File
@@ -26,9 +26,7 @@ const temperatureConverterTool = tool({
description: "Convert a temperature from Fahrenheit to Celsius", description: "Convert a temperature from Fahrenheit to Celsius",
name: "fahrenheitToCelsius", name: "fahrenheitToCelsius",
parameters: z.object({ parameters: z.object({
temperature: z.number({ temperature: z.number().describe("The temperature in Fahrenheit"),
description: "The temperature in Fahrenheit",
}),
}), }),
execute: ({ temperature }) => { execute: ({ temperature }) => {
return ((temperature - 32) * 5) / 9; return ((temperature - 32) * 5) / 9;
@@ -39,9 +37,7 @@ const temperatureFetcherTool = tool({
description: "Fetch the temperature (in Fahrenheit) for a city", description: "Fetch the temperature (in Fahrenheit) for a city",
name: "fetchTemperature", name: "fetchTemperature",
parameters: z.object({ parameters: z.object({
city: z.string({ city: z.string().describe("The city to fetch the temperature for"),
description: "The city to fetch the temperature for",
}),
}), }),
execute: ({ city }) => { execute: ({ city }) => {
const temperature = Math.floor(Math.random() * 58) + 32; const temperature = Math.floor(Math.random() * 58) + 32;
+3 -9
View File
@@ -14,9 +14,7 @@ const weatherTool = tool({
name: "weather", name: "weather",
description: "Get the weather", description: "Get the weather",
parameters: z.object({ parameters: z.object({
location: z.string({ location: z.string().describe("The location to get the weather for"),
description: "The location to get the weather for",
}),
}), }),
execute: ({ location }) => { execute: ({ location }) => {
return `The weather in ${location} is sunny`; return `The weather in ${location} is sunny`;
@@ -27,9 +25,7 @@ const inflationTool = tool({
name: "inflation", name: "inflation",
description: "Get the inflation", description: "Get the inflation",
parameters: z.object({ parameters: z.object({
location: z.string({ location: z.string().describe("The location to get the inflation for"),
description: "The location to get the inflation for",
}),
}), }),
execute: ({ location }) => { execute: ({ location }) => {
return `The inflation in ${location} is 2%`; return `The inflation in ${location} is 2%`;
@@ -41,9 +37,7 @@ const saveFileTool = tool({
description: description:
"Save the written content into a file that can be downloaded by the user", "Save the written content into a file that can be downloaded by the user",
parameters: z.object({ parameters: z.object({
content: z.string({ content: z.string().describe("The content to save into a file"),
description: "The content to save into a file",
}),
}), }),
execute: ({ content }) => { execute: ({ content }) => {
const filePath = "./report.md"; const filePath = "./report.md";
+2 -5
View File
@@ -14,11 +14,8 @@ const writeJokeSchema = z.object({
.describe("The topic to write a joke or describe the joke to improve."), .describe("The topic to write a joke or describe the joke to improve."),
writtenJoke: z.optional(z.string()).describe("The written joke."), writtenJoke: z.optional(z.string()).describe("The written joke."),
retriedTimes: z retriedTimes: z
.number() .optional(z.number().default(0))
.default(0) .describe("The retried times for writing the joke."),
.describe(
"The retried times for writing the joke. Always increase this from the input retriedTimes.",
),
}); });
const critiqueSchema = z.object({ const critiqueSchema = z.object({
@@ -29,9 +29,9 @@ async function callLLM(init: { model: string }) {
description: description:
"Execute python code in a Jupyter notebook cell and return any result, stdout, stderr, display_data, and error.", "Execute python code in a Jupyter notebook cell and return any result, stdout, stderr, display_data, and error.",
parameters: z.object({ parameters: z.object({
code: z.string({ code: z
description: "The python code to execute in a single cell.", .string()
}), .describe("The python code to execute in a single cell."),
}), }),
}, },
); );
+1 -3
View File
@@ -8,9 +8,7 @@ const weatherTool = tool({
name: "weather", name: "weather",
description: "Get the weather", description: "Get the weather",
parameters: z.object({ parameters: z.object({
location: z.string({ location: z.string().describe("The location to get the weather for"),
description: "The location to get the weather for",
}),
}), }),
execute: ({ location }) => { execute: ({ location }) => {
return `The weather in ${location} is rainy`; return `The weather in ${location} is rainy`;
@@ -7,9 +7,7 @@ async function main() {
name: "weather", name: "weather",
description: "Get the weather", description: "Get the weather",
parameters: z.object({ parameters: z.object({
location: z.string({ location: z.string().describe("The location to get the weather for"),
description: "The location to get the weather for",
}),
}), }),
execute: ({ location }) => { execute: ({ location }) => {
return `The weather in ${location} is sunny`; return `The weather in ${location} is sunny`;
+2 -2
View File
@@ -1,6 +1,6 @@
import { openai } from "@ai-sdk/openai"; import { openai } from "@ai-sdk/openai";
import { llamaindex } from "@llamaindex/vercel"; import { llamaindex } from "@llamaindex/vercel";
import { streamText } from "ai"; import { stepCountIs, streamText } from "ai";
import { Document, LlamaCloudIndex } from "llamaindex"; import { Document, LlamaCloudIndex } from "llamaindex";
import fs from "node:fs/promises"; import fs from "node:fs/promises";
@@ -28,7 +28,7 @@ async function main() {
"get information from your knowledge base to answer questions.", // optional description "get information from your knowledge base to answer questions.", // optional description
}), }),
}, },
maxSteps: 5, stopWhen: stepCountIs(5),
}); });
for await (const textPart of result.textStream) { for await (const textPart of result.textStream) {
+2 -2
View File
@@ -1,6 +1,6 @@
import { openai } from "@ai-sdk/openai"; import { openai } from "@ai-sdk/openai";
import { llamaindex } from "@llamaindex/vercel"; import { llamaindex } from "@llamaindex/vercel";
import { streamText } from "ai"; import { stepCountIs, streamText } from "ai";
import { Document, VectorStoreIndex } from "llamaindex"; import { Document, VectorStoreIndex } from "llamaindex";
import fs from "node:fs/promises"; import fs from "node:fs/promises";
@@ -24,7 +24,7 @@ async function main() {
"get information from your knowledge base to answer questions.", // optional description "get information from your knowledge base to answer questions.", // optional description
}), }),
}, },
maxSteps: 5, stopWhen: stepCountIs(5),
}); });
for await (const textPart of result.textStream) { for await (const textPart of result.textStream) {
+50 -50
View File
@@ -1,75 +1,75 @@
{ {
"name": "@llamaindex/examples", "name": "@llamaindex/examples",
"version": "0.3.40", "version": "0.3.41",
"private": true, "private": true,
"scripts": { "scripts": {
"lint": "eslint .", "lint": "eslint .",
"start": "echo 'To get started, run `npx tsx <path to example>`'" "start": "echo 'To get started, run `npx tsx <path to example>`'"
}, },
"dependencies": { "dependencies": {
"@ai-sdk/openai": "^1.0.5", "@ai-sdk/openai": "^2.0.27",
"@azure/cosmos": "^4.1.1", "@azure/cosmos": "^4.1.1",
"@azure/identity": "^4.4.1", "@azure/identity": "^4.4.1",
"@azure/search-documents": "^12.1.0", "@azure/search-documents": "^12.1.0",
"@llamaindex/anthropic": "^0.3.23", "@llamaindex/anthropic": "^0.3.24",
"@llamaindex/assemblyai": "^0.1.19", "@llamaindex/assemblyai": "^0.1.20",
"@llamaindex/astra": "^0.0.34", "@llamaindex/astra": "^0.0.35",
"@llamaindex/azure": "^0.1.35", "@llamaindex/azure": "^0.1.36",
"@llamaindex/bm25-retriever": "^0.0.9", "@llamaindex/bm25-retriever": "^0.0.10",
"@llamaindex/chroma": "^0.0.34", "@llamaindex/chroma": "^0.0.35",
"@llamaindex/clip": "^0.0.74", "@llamaindex/clip": "^0.0.75",
"@llamaindex/cloud": "^4.1.2", "@llamaindex/cloud": "^4.1.3",
"@llamaindex/cohere": "^0.0.34", "@llamaindex/cohere": "^0.0.35",
"@llamaindex/core": "^0.6.20", "@llamaindex/core": "^0.6.21",
"@llamaindex/deepinfra": "^0.0.74", "@llamaindex/deepinfra": "^0.0.75",
"@llamaindex/deepseek": "^0.0.36", "@llamaindex/deepseek": "^0.0.37",
"@llamaindex/discord": "^0.1.19", "@llamaindex/discord": "^0.1.20",
"@llamaindex/elastic-search": "^0.1.20", "@llamaindex/elastic-search": "^0.1.21",
"@llamaindex/env": "^0.1.30", "@llamaindex/env": "^0.1.30",
"@llamaindex/firestore": "^1.0.27", "@llamaindex/firestore": "^1.0.28",
"@llamaindex/fireworks": "^0.0.34", "@llamaindex/fireworks": "^0.0.35",
"@llamaindex/google": "^0.3.20", "@llamaindex/google": "^0.3.21",
"@llamaindex/groq": "^0.0.90", "@llamaindex/groq": "^0.0.91",
"@llamaindex/huggingface": "^0.1.28", "@llamaindex/huggingface": "^0.1.29",
"@llamaindex/jinaai": "^0.0.34", "@llamaindex/jinaai": "^0.0.35",
"@llamaindex/milvus": "^0.1.29", "@llamaindex/milvus": "^0.1.30",
"@llamaindex/mistral": "^0.1.20", "@llamaindex/mistral": "^0.1.21",
"@llamaindex/mixedbread": "^0.0.34", "@llamaindex/mixedbread": "^0.0.35",
"@llamaindex/mongodb": "^0.0.35", "@llamaindex/mongodb": "^0.0.36",
"@llamaindex/node-parser": "^2.0.20", "@llamaindex/node-parser": "^2.0.21",
"@llamaindex/notion": "^0.1.19", "@llamaindex/notion": "^0.1.20",
"@llamaindex/ollama": "^0.1.21", "@llamaindex/ollama": "^0.1.22",
"@llamaindex/openai": "^0.4.18", "@llamaindex/openai": "^0.4.19",
"@llamaindex/perplexity": "^0.0.31", "@llamaindex/perplexity": "^0.0.32",
"@llamaindex/pinecone": "^0.1.20", "@llamaindex/pinecone": "^0.1.21",
"@llamaindex/portkey-ai": "^0.0.62", "@llamaindex/portkey-ai": "^0.0.63",
"@llamaindex/postgres": "^0.0.63", "@llamaindex/postgres": "^0.0.64",
"@llamaindex/qdrant": "^0.1.30", "@llamaindex/qdrant": "^0.1.31",
"@llamaindex/readers": "^3.1.19", "@llamaindex/readers": "^3.1.20",
"@llamaindex/replicate": "^0.0.62", "@llamaindex/replicate": "^0.0.63",
"@llamaindex/supabase": "^0.1.21", "@llamaindex/supabase": "^0.1.22",
"@llamaindex/together": "^0.0.34", "@llamaindex/together": "^0.0.35",
"@llamaindex/tools": "^0.1.10", "@llamaindex/tools": "^0.1.11",
"@llamaindex/upstash": "^0.0.34", "@llamaindex/upstash": "^0.0.35",
"@llamaindex/vercel": "^0.1.20", "@llamaindex/vercel": "^0.1.21",
"@llamaindex/vllm": "^0.0.60", "@llamaindex/vllm": "^0.0.61",
"@llamaindex/voyage-ai": "^1.0.26", "@llamaindex/voyage-ai": "^1.0.27",
"@llamaindex/weaviate": "^0.0.35", "@llamaindex/weaviate": "^0.0.36",
"@llamaindex/workflow": "^1.1.22", "@llamaindex/workflow": "^1.1.23",
"@llamaindex/xai": "^0.0.21", "@llamaindex/xai": "^0.0.22",
"@notionhq/client": "^4.0.0", "@notionhq/client": "^4.0.0",
"@pinecone-database/pinecone": "^4.0.0", "@pinecone-database/pinecone": "^4.0.0",
"@vercel/postgres": "^0.10.0", "@vercel/postgres": "^0.10.0",
"ai": "^4.3.17", "ai": "^5.0.39",
"ajv": "^8.17.1", "ajv": "^8.17.1",
"commander": "^12.1.0", "commander": "^12.1.0",
"dotenv": "^17.2.0", "dotenv": "^17.2.0",
"js-tiktoken": "^1.0.14", "js-tiktoken": "^1.0.14",
"llamaindex": "^0.11.28", "llamaindex": "^0.11.29",
"mongodb": "6.7.0", "mongodb": "6.7.0",
"postgres": "^3.4.4", "postgres": "^3.4.4",
"wikipedia": "^2.1.2", "wikipedia": "^2.1.2",
"zod": "^3.25.76" "zod": "^4.1.5"
}, },
"devDependencies": { "devDependencies": {
"@types/express": "^5.0.3", "@types/express": "^5.0.3",
+7
View File
@@ -1,5 +1,12 @@
# @llamaindex/autotool # @llamaindex/autotool
## 8.0.29
### Patch Changes
- Updated dependencies [8929dcf]
- llamaindex@0.11.29
## 8.0.28 ## 8.0.28
### Patch Changes ### Patch Changes
@@ -1,5 +1,13 @@
# @llamaindex/autotool-01-node-example # @llamaindex/autotool-01-node-example
## 0.0.137
### Patch Changes
- Updated dependencies [8929dcf]
- llamaindex@0.11.29
- @llamaindex/autotool@8.0.29
## 0.0.136 ## 0.0.136
### Patch Changes ### Patch Changes
@@ -13,5 +13,5 @@
"scripts": { "scripts": {
"start": "node --import tsx --import @llamaindex/autotool/node ./src/index.ts" "start": "node --import tsx --import @llamaindex/autotool/node ./src/index.ts"
}, },
"version": "0.0.136" "version": "0.0.137"
} }
+1 -1
View File
@@ -6,7 +6,7 @@
"url": "git+https://github.com/run-llama/LlamaIndexTS.git", "url": "git+https://github.com/run-llama/LlamaIndexTS.git",
"directory": "packages/autotool" "directory": "packages/autotool"
}, },
"version": "8.0.28", "version": "8.0.29",
"description": "auto transpile your JS function to LLM Agent compatible", "description": "auto transpile your JS function to LLM Agent compatible",
"files": [ "files": [
"dist", "dist",
+7
View File
@@ -1,5 +1,12 @@
# @llamaindex/cloud # @llamaindex/cloud
## 4.1.3
### Patch Changes
- Updated dependencies [5da1cda]
- @llamaindex/core@0.6.21
## 4.1.2 ## 4.1.2
### Patch Changes ### Patch Changes
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@llamaindex/cloud", "name": "@llamaindex/cloud",
"version": "4.1.2", "version": "4.1.3",
"type": "module", "type": "module",
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {
+7
View File
@@ -1,5 +1,12 @@
# @llamaindex/community # @llamaindex/community
## 0.0.103
### Patch Changes
- Updated dependencies [5da1cda]
- @llamaindex/core@0.6.21
## 0.0.102 ## 0.0.102
### Patch Changes ### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "@llamaindex/community", "name": "@llamaindex/community",
"description": "Community package for LlamaIndexTS", "description": "Community package for LlamaIndexTS",
"version": "0.0.102", "version": "0.0.103",
"type": "module", "type": "module",
"types": "dist/type/index.d.ts", "types": "dist/type/index.d.ts",
"main": "dist/cjs/index.js", "main": "dist/cjs/index.js",
+6
View File
@@ -1,5 +1,11 @@
# @llamaindex/core # @llamaindex/core
## 0.6.21
### Patch Changes
- 5da1cda: feat: support zod v4 & v3
## 0.6.20 ## 0.6.20
### Patch Changes ### Patch Changes
+16 -4
View File
@@ -1,7 +1,7 @@
{ {
"name": "@llamaindex/core", "name": "@llamaindex/core",
"type": "module", "type": "module",
"version": "0.6.20", "version": "0.6.21",
"description": "LlamaIndex Core Module", "description": "LlamaIndex Core Module",
"exports": { "exports": {
"./agent": { "./agent": {
@@ -278,6 +278,17 @@
"default": "./postprocessor/dist/index.js" "default": "./postprocessor/dist/index.js"
}, },
"default": "./postprocessor/dist/index.js" "default": "./postprocessor/dist/index.js"
},
"./zod": {
"require": {
"types": "./zod/dist/index.d.cts",
"default": "./zod/dist/index.cjs"
},
"import": {
"types": "./zod/dist/index.d.ts",
"default": "./zod/dist/index.js"
},
"default": "./zod/dist/index.js"
} }
}, },
"files": [ "files": [
@@ -302,7 +313,8 @@
"./vector-store", "./vector-store",
"./tools", "./tools",
"./data-structs", "./data-structs",
"./postprocessor" "./postprocessor",
"./zod"
], ],
"scripts": { "scripts": {
"dev": "bunchee --watch", "dev": "bunchee --watch",
@@ -321,9 +333,9 @@
}, },
"dependencies": { "dependencies": {
"@llamaindex/env": "workspace:*", "@llamaindex/env": "workspace:*",
"@finom/zod-to-json-schema": "3.24.11",
"@types/node": "^24.0.13", "@types/node": "^24.0.13",
"magic-bytes.js": "^1.10.0", "magic-bytes.js": "^1.10.0",
"zod": "^3.25.76", "zod": "^4.1.5"
"zod-to-json-schema": "^3.24.6"
} }
} }
+2 -3
View File
@@ -1,5 +1,4 @@
import type { Logger } from "@llamaindex/env"; import type { Logger } from "@llamaindex/env";
import { z } from "zod";
import { type JSONObject, type JSONValue, Settings } from "../global"; import { type JSONObject, type JSONValue, Settings } from "../global";
import type { import type {
BaseTool, BaseTool,
@@ -13,7 +12,7 @@ import type {
ToolCallLLMMessageOptions, ToolCallLLMMessageOptions,
ToolOutput, ToolOutput,
} from "../llms"; } from "../llms";
import { baseToolWithCallSchema } from "../schema"; import { agentParamsSchema } from "../schema";
import { import {
assertIsJSONValue, assertIsJSONValue,
isAsyncIterable, isAsyncIterable,
@@ -305,7 +304,7 @@ export function validateAgentParams<AI extends LLM>(
params: AgentParamsBase<AI>, params: AgentParamsBase<AI>,
) { ) {
if ("tools" in params) { if ("tools" in params) {
z.array(baseToolWithCallSchema).parse(params.tools); agentParamsSchema.parse(params.tools);
} else { } else {
// todo: check `params.toolRetriever` when migrate to @llamaindex/core // todo: check `params.toolRetriever` when migrate to @llamaindex/core
} }
+2 -2
View File
@@ -3,6 +3,7 @@ import type { JSONObject } from "../global";
import { tool } from "../tools/"; import { tool } from "../tools/";
import { extractText } from "../utils/llms"; import { extractText } from "../utils/llms";
import { streamConverter } from "../utils/stream"; import { streamConverter } from "../utils/stream";
import { isZodSchema, safeParseSchema } from "../zod";
import { callToolToMessage, getToolCallsFromResponse } from "./tool-call"; import { callToolToMessage, getToolCallsFromResponse } from "./tool-call";
import type { import type {
ChatMessage, ChatMessage,
@@ -20,7 +21,6 @@ import type {
PartialToolCall, PartialToolCall,
ToolCallLLMMessageOptions, ToolCallLLMMessageOptions,
} from "./type"; } from "./type";
import { isZodSchema } from "./utils";
export abstract class BaseLLM< export abstract class BaseLLM<
AdditionalChatOptions extends object = object, AdditionalChatOptions extends object = object,
@@ -107,7 +107,7 @@ export abstract class BaseLLM<
description: "Respond with a JSON object", description: "Respond with a JSON object",
parameters: responseFormat, parameters: responseFormat,
execute: (args) => { execute: (args) => {
const result = responseFormat.safeParse(args); const result = safeParseSchema(responseFormat, args);
if (!result.success) { if (!result.success) {
console.error("Invalid input from LLM:", result.error); console.error("Invalid input from LLM:", result.error);
return JSON.stringify({ return JSON.stringify({
+4 -3
View File
@@ -1,9 +1,10 @@
import type { Logger } from "@llamaindex/env"; import type { Logger } from "@llamaindex/env";
import type { Tokenizers } from "@llamaindex/env/tokenizers"; import type { Tokenizers } from "@llamaindex/env/tokenizers";
import type { JSONSchemaType } from "ajv"; import type { JSONSchemaType } from "ajv";
import { z } from "zod";
import type { JSONObject, JSONValue } from "../global"; import type { JSONObject, JSONValue } from "../global";
import type { ModalityType } from "../schema"; import type { ModalityType } from "../schema";
import type { ZodSchema } from "../zod";
/** /**
* @internal * @internal
*/ */
@@ -139,7 +140,7 @@ export interface LLMChatParamsBase<
messages: ChatMessage<AdditionalMessageOptions>[]; messages: ChatMessage<AdditionalMessageOptions>[];
additionalChatOptions?: AdditionalChatOptions | undefined; additionalChatOptions?: AdditionalChatOptions | undefined;
tools?: BaseTool[] | undefined; tools?: BaseTool[] | undefined;
responseFormat?: z.ZodType | object | undefined; responseFormat?: ZodSchema | object | undefined;
logger?: Logger | undefined; logger?: Logger | undefined;
} }
@@ -159,7 +160,7 @@ export interface LLMChatParamsNonStreaming<
export interface LLMCompletionParamsBase { export interface LLMCompletionParamsBase {
prompt: MessageContent; prompt: MessageContent;
responseFormat?: z.ZodType | object; responseFormat?: ZodSchema | object;
} }
export interface LLMCompletionParamsStreaming extends LLMCompletionParamsBase { export interface LLMCompletionParamsStreaming extends LLMCompletionParamsBase {
-13
View File
@@ -1,4 +1,3 @@
import { z } from "zod";
import type { import type {
ChatMessage, ChatMessage,
MessageContentImageDataDetail, MessageContentImageDataDetail,
@@ -27,15 +26,3 @@ export function addContentPart<AdditionalMessageOptions extends object>(
} }
} }
} }
export function isZodSchema(obj: unknown): obj is z.ZodType {
return (
obj !== null &&
typeof obj === "object" &&
"parse" in obj &&
typeof (obj as { parse: unknown }).parse === "function" &&
"safeParse" in obj &&
typeof (obj as { safeParse: unknown }).safeParse === "function" &&
"_def" in obj
);
}
@@ -1,10 +1,9 @@
import { consoleLogger, type Logger } from "@llamaindex/env"; import { consoleLogger, type Logger } from "@llamaindex/env";
import type { Tokenizer } from "@llamaindex/env/tokenizers"; import type { Tokenizer } from "@llamaindex/env/tokenizers";
import { z } from "zod";
import { Settings } from "../global"; import { Settings } from "../global";
import { sentenceSplitterSchema } from "../schema"; import { sentenceSplitterSchema, type SentenceSplitterParams } from "../schema";
import { MetadataAwareTextSplitter } from "./base"; import { MetadataAwareTextSplitter } from "./base";
import type { SplitterParams } from "./type"; import type { PartialWithUndefined, SplitterParams } from "./type";
import { import {
splitByChar, splitByChar,
splitByRegex, splitByRegex,
@@ -52,7 +51,7 @@ export class SentenceSplitter extends MetadataAwareTextSplitter {
#logger: Logger; #logger: Logger;
constructor( constructor(
params?: z.input<typeof sentenceSplitterSchema> & params?: PartialWithUndefined<SentenceSplitterParams> &
SplitterParams & { logger?: Logger }, SplitterParams & { logger?: Logger },
) { ) {
super(); super();
@@ -1,12 +1,13 @@
import { randomUUID } from "@llamaindex/env"; import { randomUUID } from "@llamaindex/env";
import { z } from "zod";
import { import {
buildNodeFromSplits, buildNodeFromSplits,
Document, Document,
sentenceWindowNodeParserSchema, sentenceWindowNodeParserSchema,
TextNode, TextNode,
type SentenceWindowNodeParserParams,
} from "../schema"; } from "../schema";
import { NodeParser } from "./base"; import { NodeParser } from "./base";
import type { PartialWithUndefined } from "./type";
import { splitBySentenceTokenizer, type TextSplitterFn } from "./utils"; import { splitBySentenceTokenizer, type TextSplitterFn } from "./utils";
export class SentenceWindowNodeParser extends NodeParser<TextNode[]> { export class SentenceWindowNodeParser extends NodeParser<TextNode[]> {
@@ -20,7 +21,7 @@ export class SentenceWindowNodeParser extends NodeParser<TextNode[]> {
sentenceSplitter: TextSplitterFn = splitBySentenceTokenizer([], true); sentenceSplitter: TextSplitterFn = splitBySentenceTokenizer([], true);
idGenerator: () => string = () => randomUUID(); idGenerator: () => string = () => randomUUID();
constructor(params?: z.input<typeof sentenceWindowNodeParserSchema>) { constructor(params?: PartialWithUndefined<SentenceWindowNodeParserParams>) {
super(); super();
if (params) { if (params) {
const parsedParams = sentenceWindowNodeParserSchema.parse(params); const parsedParams = sentenceWindowNodeParserSchema.parse(params);
@@ -1,20 +1,16 @@
import { consoleLogger, type Logger } from "@llamaindex/env"; import { consoleLogger, type Logger } from "@llamaindex/env";
import type { Tokenizer } from "@llamaindex/env/tokenizers"; import type { Tokenizer } from "@llamaindex/env/tokenizers";
import { z } from "zod";
import { DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE, Settings } from "../global"; import { DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE, Settings } from "../global";
import {
tokenTextSplitterSchema,
type TokenTextSplitterParams,
} from "../schema";
import { MetadataAwareTextSplitter } from "./base"; import { MetadataAwareTextSplitter } from "./base";
import type { SplitterParams } from "./type"; import type { PartialWithUndefined, SplitterParams } from "./type";
import { splitByChar, splitBySep } from "./utils"; import { splitByChar, splitBySep } from "./utils";
const DEFAULT_METADATA_FORMAT_LEN = 2; const DEFAULT_METADATA_FORMAT_LEN = 2;
const tokenTextSplitterSchema = z.object({
chunkSize: z.number().positive().default(DEFAULT_CHUNK_SIZE),
chunkOverlap: z.number().nonnegative().default(DEFAULT_CHUNK_OVERLAP),
separator: z.string().default(" "),
backupSeparators: z.array(z.string()).default(["\n"]),
});
export class TokenTextSplitter extends MetadataAwareTextSplitter { export class TokenTextSplitter extends MetadataAwareTextSplitter {
chunkSize: number = DEFAULT_CHUNK_SIZE; chunkSize: number = DEFAULT_CHUNK_SIZE;
chunkOverlap: number = DEFAULT_CHUNK_OVERLAP; chunkOverlap: number = DEFAULT_CHUNK_OVERLAP;
@@ -26,7 +22,7 @@ export class TokenTextSplitter extends MetadataAwareTextSplitter {
constructor( constructor(
params?: SplitterParams & params?: SplitterParams &
Partial<z.infer<typeof tokenTextSplitterSchema>> & { logger?: Logger }, PartialWithUndefined<TokenTextSplitterParams> & { logger?: Logger },
) { ) {
super(); super();
+4
View File
@@ -3,3 +3,7 @@ import type { Tokenizer } from "@llamaindex/env/tokenizers";
export type SplitterParams = { export type SplitterParams = {
tokenizer?: Tokenizer; tokenizer?: Tokenizer;
}; };
export type PartialWithUndefined<T> = {
[P in keyof T]?: T[P] | undefined;
};
+17 -2
View File
@@ -1,5 +1,5 @@
import { z } from "zod"; import { z } from "zod/v3"; // use zod v3 to keep schemas as it is
import { Settings } from "../global"; import { DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE, Settings } from "../global";
export const anyFunctionSchema = z.function(z.tuple([]).rest(z.any()), z.any()); export const anyFunctionSchema = z.function(z.tuple([]).rest(z.any()), z.any());
@@ -18,6 +18,8 @@ export const baseToolWithCallSchema = baseToolSchema.extend({
call: z.function(), call: z.function(),
}); });
export const agentParamsSchema = z.array(baseToolWithCallSchema);
export const sentenceSplitterSchema = z export const sentenceSplitterSchema = z
.object({ .object({
chunkSize: z chunkSize: z
@@ -83,3 +85,16 @@ export const sentenceWindowNodeParserSchema = z.object({
}) })
.default("originalText"), .default("originalText"),
}); });
export const tokenTextSplitterSchema = z.object({
chunkSize: z.number().positive().default(DEFAULT_CHUNK_SIZE),
chunkOverlap: z.number().nonnegative().default(DEFAULT_CHUNK_OVERLAP),
separator: z.string().default(" "),
backupSeparators: z.array(z.string()).default(["\n"]),
});
export type SentenceSplitterParams = z.infer<typeof sentenceSplitterSchema>;
export type TokenTextSplitterParams = z.infer<typeof tokenTextSplitterSchema>;
export type SentenceWindowNodeParserParams = z.infer<
typeof sentenceWindowNodeParserSchema
>;
+63 -35
View File
@@ -1,10 +1,15 @@
import { consoleLogger, type Logger } from "@llamaindex/env"; import { consoleLogger, type Logger } from "@llamaindex/env";
import type { JSONSchemaType } from "ajv"; import type { JSONSchemaType } from "ajv";
import { z } from "zod"; import type * as z3 from "zod/v3";
import { zodToJsonSchema } from "zod-to-json-schema"; import type * as z4 from "zod/v4/core";
import type { JSONValue } from "../global"; import type { JSONValue } from "../global";
import type { BaseTool, ToolMetadata } from "../llms"; import type { BaseTool, ToolMetadata } from "../llms";
import { isZodSchema } from "../llms/utils"; import {
isZodSchema,
safeParseSchema,
type ZodSchema,
zodToJsonSchema,
} from "../zod";
export class FunctionTool< export class FunctionTool<
T, T,
@@ -15,12 +20,13 @@ export class FunctionTool<
#fn: (input: T, additionalArg?: AdditionalToolArgument) => R; #fn: (input: T, additionalArg?: AdditionalToolArgument) => R;
#additionalArg: AdditionalToolArgument | undefined; #additionalArg: AdditionalToolArgument | undefined;
readonly #metadata: ToolMetadata<JSONSchemaType<T>>; readonly #metadata: ToolMetadata<JSONSchemaType<T>>;
readonly #zodType: z.ZodType<T> | null = null; readonly #zodType: ZodSchema<T> | null = null;
readonly #logger: Logger; readonly #logger: Logger;
constructor( constructor(
fn: (input: T, additionalArg?: AdditionalToolArgument) => R, fn: (input: T, additionalArg?: AdditionalToolArgument) => R,
metadata: ToolMetadata<JSONSchemaType<T>>, metadata: ToolMetadata<JSONSchemaType<T>>,
zodType?: z.ZodType<T>, zodType?: ZodSchema<T>,
additionalArg?: AdditionalToolArgument, additionalArg?: AdditionalToolArgument,
logger?: Logger, logger?: Logger,
) { ) {
@@ -33,6 +39,9 @@ export class FunctionTool<
this.#logger = logger ?? consoleLogger; this.#logger = logger ?? consoleLogger;
} }
// ----------------- OVERLOAD -----------------
// Plain JSON schema
static from<T, AdditionalToolArgument extends object = object>( static from<T, AdditionalToolArgument extends object = object>(
fn: ( fn: (
input: T, input: T,
@@ -40,54 +49,74 @@ export class FunctionTool<
) => JSONValue | Promise<JSONValue>, ) => JSONValue | Promise<JSONValue>,
schema: ToolMetadata<JSONSchemaType<T>>, schema: ToolMetadata<JSONSchemaType<T>>,
): FunctionTool<T, JSONValue | Promise<JSONValue>, AdditionalToolArgument>; ): FunctionTool<T, JSONValue | Promise<JSONValue>, AdditionalToolArgument>;
static from<
R extends z.ZodType, // Function + Object configs + Zod v3 schema
AdditionalToolArgument extends object = object, static from<R, AdditionalToolArgument extends object = object>(
>(
fn: ( fn: (
input: z.infer<R>, // @ts-expect-error <R> should extend z3.ZodTypeAny
// but we remove that to fix type instantiation is excessively deep and possibly infinite
input: z3.infer<R>,
additionalArg?: AdditionalToolArgument, additionalArg?: AdditionalToolArgument,
) => JSONValue | Promise<JSONValue>, ) => JSONValue | Promise<JSONValue>,
schema: Omit<ToolMetadata, "parameters"> & { schema: Omit<ToolMetadata, "parameters"> & { parameters: R },
parameters: R;
},
): FunctionTool< ): FunctionTool<
z.infer<R>, // @ts-expect-error <R> should extend z3.ZodTypeAny
// but we remove that to fix type instantiation is excessively deep and possibly infinite
z3.infer<R>,
JSONValue | Promise<JSONValue>, JSONValue | Promise<JSONValue>,
AdditionalToolArgument AdditionalToolArgument
>; >;
static from<
T, // Function + Object configs + Zod v4 schema
R extends z.ZodType<T>, static from<R, AdditionalToolArgument extends object = object>(
AdditionalToolArgument extends object = object,
>(
fn: ( fn: (
input: T, input: z4.infer<R>,
additionalArg?: AdditionalToolArgument, additionalArg?: AdditionalToolArgument,
) => JSONValue | Promise<JSONValue>, ) => JSONValue | Promise<JSONValue>,
schema: Omit<ToolMetadata, "parameters"> & { schema: Omit<ToolMetadata, "parameters"> & { parameters: R },
parameters: R; ): FunctionTool<
}, z4.infer<R>,
): FunctionTool<T, JSONValue, AdditionalToolArgument>; JSONValue | Promise<JSONValue>,
static from< AdditionalToolArgument
R extends z.ZodType, >;
AdditionalToolArgument extends object = object,
>( // Object configs + Zod v3 schema
static from<R, AdditionalToolArgument extends object = object>(
config: Omit<ToolMetadata, "parameters"> & { config: Omit<ToolMetadata, "parameters"> & {
parameters: R; parameters: R;
execute: ( execute: (
input: z.infer<R>, // @ts-expect-error <R> should extend z3.ZodTypeAny
// but we remove that to fix type instantiation is excessively deep and possibly infinite
input: z3.infer<R>,
additionalArg?: AdditionalToolArgument, additionalArg?: AdditionalToolArgument,
) => JSONValue | Promise<JSONValue>; ) => JSONValue | Promise<JSONValue>;
}, },
): FunctionTool< ): FunctionTool<
z.infer<R>, // @ts-expect-error <R> should extend z3.ZodTypeAny
// but we remove that to fix type instantiation is excessively deep and possibly infinite
z3.infer<R>,
JSONValue | Promise<JSONValue>, JSONValue | Promise<JSONValue>,
AdditionalToolArgument AdditionalToolArgument
>; >;
// Object configs + Zod v4 schema
static from<R, AdditionalToolArgument extends object = object>(
config: Omit<ToolMetadata, "parameters"> & {
parameters: R;
execute: (
input: z4.infer<R>,
additionalArg?: AdditionalToolArgument,
) => JSONValue | Promise<JSONValue>;
},
): FunctionTool<
z4.infer<R>,
JSONValue | Promise<JSONValue>,
AdditionalToolArgument
>;
// ----------------- IMPLEMENTATION -----------------
// eslint-disable-next-line @typescript-eslint/no-explicit-any // eslint-disable-next-line @typescript-eslint/no-explicit-any
static from(fnOrConfig: any, schema?: any): any { static from(fnOrConfig: any, schema?: any): any {
// Handle the case where an object with execute function is passed
if ( if (
typeof schema === "undefined" && typeof schema === "undefined" &&
typeof fnOrConfig === "object" && typeof fnOrConfig === "object" &&
@@ -109,8 +138,7 @@ export class FunctionTool<
return new FunctionTool(execute, fnOrConfig); return new FunctionTool(execute, fnOrConfig);
} }
// Handle the original cases if (schema && isZodSchema(schema.parameters)) {
if (schema && schema.parameters instanceof z.ZodSchema) {
const jsonSchema = zodToJsonSchema(schema.parameters); const jsonSchema = zodToJsonSchema(schema.parameters);
return new FunctionTool( return new FunctionTool(
fnOrConfig, fnOrConfig,
@@ -140,11 +168,11 @@ export class FunctionTool<
call = (input: T) => { call = (input: T) => {
let params = input; let params = input;
if (this.#zodType) { if (this.#zodType) {
const result = this.#zodType.safeParse(input); const result = safeParseSchema(this.#zodType, input);
if (result.success) { if (result.success) {
params = result.data; params = result.data;
} else { } else {
this.#logger.warn(result.error.errors); this.#logger.warn(result.error);
} }
} }
return this.#fn.call(null, params, this.#additionalArg); return this.#fn.call(null, params, this.#additionalArg);
+71
View File
@@ -0,0 +1,71 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { zodToJsonSchema as zodToJsonSchemaV3 } from "@finom/zod-to-json-schema";
import * as z from "zod";
import * as z3 from "zod/v3";
import * as z4 from "zod/v4/core";
export type ZodSchema<T = any> = z3.ZodType<T> | z4.$ZodType<T>;
export type ZodInfer<T extends ZodSchema> =
T extends z3.ZodType<any>
? z3.infer<T>
: T extends z4.$ZodType<any>
? z4.infer<T>
: never;
// support parsing both Zod 3 schemas and Zod 4 schemas
export function parseSchema<T>(schema: ZodSchema<T>, data: unknown): T {
if ("_zod" in schema) {
// Zod 4 schema
return z4.parse(schema as z4.$ZodType<T>, data);
} else {
// Zod 3 schema
return (schema as z3.ZodType<T>).parse(data);
}
}
// safe parse schema
export function safeParseSchema<T>(schema: ZodSchema<T>, data: unknown) {
if ("_zod" in schema) {
// Zod 4 schema
return z4.safeParse(schema as z4.$ZodType<T>, data);
} else {
// Zod 3 schema
return (schema as z3.ZodType<T>).safeParse(data);
}
}
export function isZodSchema(obj: unknown): obj is ZodSchema {
return (
obj !== null &&
typeof obj === "object" &&
"parse" in obj &&
typeof (obj as { parse: unknown }).parse === "function" &&
"safeParse" in obj &&
typeof (obj as { safeParse: unknown }).safeParse === "function"
);
}
// zod 3 schema does not have _zod property
export function isZodV3Schema(obj: unknown): obj is z3.ZodTypeAny {
return isZodSchema(obj) && !("_zod" in obj);
}
// zod 4 schema has _zod property
export function isZodV4Schema(obj: unknown): obj is z4.$ZodType {
return isZodSchema(obj) && "_zod" in obj;
}
export function zodToJsonSchema(obj: ZodSchema) {
if (isZodV4Schema(obj)) {
// if schema is created from zod v4, use native toJSONSchema
return z4.toJSONSchema(obj);
}
// otherwise, use zod-to-json-schema
return zodToJsonSchemaV3(obj as any); // FIXME: use any to avoid type instantiation excessively
}
// re-export zod
export { z, z3, z4 };
+1 -1
View File
@@ -1,7 +1,7 @@
import { LLMAgent, validateAgentParams } from "@llamaindex/core/agent"; import { LLMAgent, validateAgentParams } from "@llamaindex/core/agent";
import { MockLLM } from "@llamaindex/core/llms/mock"; import { MockLLM } from "@llamaindex/core/llms/mock";
import { expect, test } from "vitest"; import { expect, test } from "vitest";
import { ZodError } from "zod"; import { ZodError } from "zod/v3";
test("validate agent params", () => { test("validate agent params", () => {
validateAgentParams({ validateAgentParams({
+2 -1
View File
@@ -7,6 +7,7 @@
}, },
"devDependencies": { "devDependencies": {
"@llamaindex/core": "workspace:*", "@llamaindex/core": "workspace:*",
"vitest": "^2.1.5" "vitest": "^2.1.5",
"zod": "^4.1.5"
} }
} }
+65 -1
View File
@@ -1,6 +1,7 @@
import { FunctionTool, tool } from "@llamaindex/core/tools"; import { FunctionTool, tool } from "@llamaindex/core/tools";
import { describe, expect, test, vi } from "vitest"; import { describe, expect, test, vi } from "vitest";
import { z } from "zod"; import { z } from "zod/v3";
import { z as z4 } from "zod/v4";
describe("FunctionTool", () => { describe("FunctionTool", () => {
test("type system", () => { test("type system", () => {
@@ -95,4 +96,67 @@ describe("FunctionTool", () => {
expect(hello).to.toHaveBeenCalledOnce(); expect(hello).to.toHaveBeenCalledOnce();
expect(hello).to.toHaveBeenCalledWith("Bob", additionalArg); expect(hello).to.toHaveBeenCalledWith("Bob", additionalArg);
}); });
test("works with Zod v4 schema", async () => {
const mockFn = vi.fn().mockImplementation(({ age }: { age: number }) => {
return `Age is ${age}`;
});
const schema = z4.object({
age: z4.number().int().min(0),
});
const toolV4 = FunctionTool.from(mockFn, {
name: "checkAge",
description: "Checks age",
parameters: schema,
});
const result = await toolV4.call({ age: 25 });
expect(result).toBe("Age is 25");
expect(mockFn).toHaveBeenCalledWith({ age: 25 }, undefined);
});
test("validates input with safeParseSchema (valid + invalid)", async () => {
const mockFn = vi.fn().mockImplementation(({ num }: { num: number }) => {
return num * 2;
});
const schema = z.object({
num: z.number(),
});
const toolWithValidation = FunctionTool.from(mockFn, {
name: "double",
description: "Doubles a number",
parameters: schema,
});
// valid input
const result = await toolWithValidation.call({ num: 10 });
expect(result).toBe(20);
// invalid input (string instead of number)
// eslint-disable-next-line @typescript-eslint/no-explicit-any
await toolWithValidation.call({ num: "oops" } as any);
});
test("works with plain JSON schema", async () => {
const mockFn = vi.fn().mockImplementation(({ msg }: { msg: string }) => {
return msg.toUpperCase();
});
const toolWithJson = FunctionTool.from(mockFn, {
name: "shout",
description: "Shouts the message",
parameters: {
type: "object",
properties: { msg: { type: "string" } },
required: ["msg"],
},
});
const result = await toolWithJson.call({ msg: "hi" });
expect(result).toBe("HI");
});
}); });
+160
View File
@@ -0,0 +1,160 @@
import {
isZodSchema,
isZodV3Schema,
isZodV4Schema,
parseSchema,
safeParseSchema,
zodToJsonSchema,
} from "@llamaindex/core/zod";
import { describe, expect, it } from "vitest";
import { z as z3 } from "zod/v3";
import { z as z4 } from "zod/v4";
describe("Zod schema utils", () => {
describe("parseSchema / safeParseSchema", () => {
it("parses valid data with Zod v3 schema", () => {
const schema = z3.object({ name: z3.string() });
const result = parseSchema(schema, { name: "Alice" });
expect(result).toEqual({ name: "Alice" });
});
it("parses valid data with Zod v4 schema", () => {
const schema = z4.object({ age: z4.number() });
const result = parseSchema(schema, { age: 42 });
expect(result).toEqual({ age: 42 });
});
it("safeParse works with invalid data (v3)", () => {
const schema = z3.object({ name: z3.string() });
const res = safeParseSchema(schema, { name: 123 });
expect(res.success).toBe(false);
});
it("safeParse works with invalid data (v4)", () => {
const schema = z4.object({ age: z4.number() });
const res = safeParseSchema(schema, { age: "oops" });
expect(res.success).toBe(false);
});
});
describe("isZodV3Schema / isZodV4Schema / isZodSchema", () => {
it("detects a v3 schema", () => {
const schema = z3.string();
expect(isZodV3Schema(schema)).toBe(true);
expect(isZodSchema(schema)).toBe(true);
expect(isZodV4Schema(schema)).toBe(false);
});
it("detects a v4 schema", () => {
const schema = z4.string();
expect(isZodV4Schema(schema)).toBe(true);
expect(isZodSchema(schema)).toBe(true);
expect(isZodV3Schema(schema)).toBe(false);
});
it("returns false for non-schemas", () => {
expect(isZodSchema(123)).toBe(false);
expect(isZodSchema({})).toBe(false);
});
});
describe("zodToJsonSchema", () => {
it("converts v3 string schema", () => {
const schema = z3.string().min(2).max(5).describe("A short string");
const json = zodToJsonSchema(schema);
expect(json).toMatchObject({
type: "string",
minLength: 2,
maxLength: 5,
description: "A short string",
});
});
it("converts v3 object schema", () => {
const schema = z3.object({
id: z3.number(),
name: z3.string().optional(),
});
const json = zodToJsonSchema(schema);
expect(json).toMatchObject({
type: "object",
properties: {
id: { type: "number" },
name: { type: "string" },
},
required: ["id"],
});
});
it("converts v4 array schema", () => {
const schema = z4.array(z4.boolean());
const json = zodToJsonSchema(schema);
expect(json).toMatchObject({
type: "array",
items: { type: "boolean" },
});
});
it("converts v4 enum schema", () => {
const schema = z4.enum(["red", "green", "blue"]);
const json = zodToJsonSchema(schema);
expect(json).toMatchObject({
type: "string",
enum: ["red", "green", "blue"],
});
});
it("handles nested v3 objects", () => {
const schema = z3.object({
user: z3.object({
id: z3.number(),
tags: z3.array(z3.string()),
}),
});
const json = zodToJsonSchema(schema);
expect(json).toMatchObject({
type: "object",
properties: {
user: {
type: "object",
properties: {
id: { type: "number" },
tags: {
type: "array",
items: { type: "string" },
},
},
required: ["id", "tags"],
},
},
required: ["user"],
});
});
it("handles nested v4 objects", () => {
const schema = z4.object({
profile: z4.object({
email: z4.string(),
active: z4.boolean(),
}),
});
const json = zodToJsonSchema(schema);
expect(json).toMatchObject({
type: "object",
properties: {
profile: {
type: "object",
properties: {
email: { type: "string" },
active: { type: "boolean" },
},
required: ["email", "active"],
additionalProperties: false,
},
},
required: ["profile"],
additionalProperties: false,
});
});
});
});
+8
View File
@@ -0,0 +1,8 @@
{
"type": "module",
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": "./dist/index.js",
"private": true
}
+7
View File
@@ -1,5 +1,12 @@
# @llamaindex/experimental # @llamaindex/experimental
## 0.0.206
### Patch Changes
- Updated dependencies [8929dcf]
- llamaindex@0.11.29
## 0.0.205 ## 0.0.205
### Patch Changes ### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "@llamaindex/experimental", "name": "@llamaindex/experimental",
"description": "Experimental package for LlamaIndexTS", "description": "Experimental package for LlamaIndexTS",
"version": "0.0.205", "version": "0.0.206",
"type": "module", "type": "module",
"types": "dist/type/index.d.ts", "types": "dist/type/index.d.ts",
"main": "dist/cjs/index.js", "main": "dist/cjs/index.js",
+11
View File
@@ -1,5 +1,16 @@
# llamaindex # llamaindex
## 0.11.29
### Patch Changes
- 8929dcf: feat: vectorStoreIndex has new option progressCallback
- Updated dependencies [5da1cda]
- @llamaindex/core@0.6.21
- @llamaindex/workflow@1.1.23
- @llamaindex/cloud@4.1.3
- @llamaindex/node-parser@2.0.21
## 0.11.28 ## 0.11.28
### Patch Changes ### Patch Changes
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "llamaindex", "name": "llamaindex",
"version": "0.11.28", "version": "0.11.29",
"license": "MIT", "license": "MIT",
"type": "module", "type": "module",
"keywords": [ "keywords": [
@@ -54,6 +54,7 @@ export interface VectorIndexOptions extends IndexStructOptions {
storageContext?: StorageContext | undefined; storageContext?: StorageContext | undefined;
vectorStores?: VectorStoreByType | undefined; vectorStores?: VectorStoreByType | undefined;
logProgress?: boolean | undefined; logProgress?: boolean | undefined;
progressCallback?: ((progress: number, total: number) => void) | undefined;
} }
export interface VectorIndexConstructorProps extends BaseIndexInit<IndexDict> { export interface VectorIndexConstructorProps extends BaseIndexInit<IndexDict> {
@@ -121,6 +122,7 @@ export class VectorStoreIndex extends BaseIndex<IndexDict> {
// If nodes are passed in, then we need to update the index // If nodes are passed in, then we need to update the index
await index.buildIndexFromNodes(options.nodes, { await index.buildIndexFromNodes(options.nodes, {
logProgress: options.logProgress, logProgress: options.logProgress,
progressCallback: options.progressCallback,
}); });
} }
return index; return index;
@@ -170,7 +172,12 @@ export class VectorStoreIndex extends BaseIndex<IndexDict> {
*/ */
async getNodeEmbeddingResults( async getNodeEmbeddingResults(
nodes: BaseNode[], nodes: BaseNode[],
options?: { logProgress?: boolean | undefined }, options?: {
logProgress?: boolean | undefined;
progressCallback?:
| ((progress: number, total: number) => void)
| undefined;
},
): Promise<BaseNode[]> { ): Promise<BaseNode[]> {
const nodeMap = splitNodesByType(nodes); const nodeMap = splitNodesByType(nodes);
for (const type in nodeMap) { for (const type in nodeMap) {
@@ -180,6 +187,7 @@ export class VectorStoreIndex extends BaseIndex<IndexDict> {
if (embedModel && nodes) { if (embedModel && nodes) {
await embedModel(nodes, { await embedModel(nodes, {
logProgress: options?.logProgress, logProgress: options?.logProgress,
progressCallback: options?.progressCallback,
}); });
} }
} }
@@ -193,7 +201,12 @@ export class VectorStoreIndex extends BaseIndex<IndexDict> {
*/ */
async buildIndexFromNodes( async buildIndexFromNodes(
nodes: BaseNode[], nodes: BaseNode[],
options?: { logProgress?: boolean | undefined }, options?: {
logProgress?: boolean | undefined;
progressCallback?:
| ((progress: number, total: number) => void)
| undefined;
},
) { ) {
await this.insertNodes(nodes, options); await this.insertNodes(nodes, options);
} }
@@ -361,7 +374,12 @@ export class VectorStoreIndex extends BaseIndex<IndexDict> {
async insertNodes( async insertNodes(
nodes: BaseNode[], nodes: BaseNode[],
options?: { logProgress?: boolean | undefined }, options?: {
logProgress?: boolean | undefined;
progressCallback?:
| ((progress: number, total: number) => void)
| undefined;
},
): Promise<void> { ): Promise<void> {
if (!nodes || nodes.length === 0) { if (!nodes || nodes.length === 0) {
return; return;
+8
View File
@@ -1,5 +1,13 @@
# @llamaindex/core-test # @llamaindex/core-test
## 0.1.20
### Patch Changes
- 8929dcf: feat: vectorStoreIndex has new option progressCallback
- Updated dependencies [5da1cda]
- @llamaindex/openai@0.4.19
## 0.1.19 ## 0.1.19
### Patch Changes ### Patch Changes
@@ -89,4 +89,42 @@ describe("[VectorStoreIndex] use embedding model", () => {
expect(customSpy).toHaveBeenCalled(); expect(customSpy).toHaveBeenCalled();
expect(settingsSpy).not.toHaveBeenCalled(); expect(settingsSpy).not.toHaveBeenCalled();
}); });
describe("[VectorStoreIndex] call progressCallback", () => {
it("should call progressCallback with correct values", async () => {
const documents = Array.from(
{ length: 20 },
(_, i) => new Document({ text: `This is document ${i + 1}` }),
);
const progressCalls: Array<{ current: number; total: number }> = [];
const progressCallback = (current: number, total: number) => {
progressCalls.push({ current, total });
};
const embedModel = new OpenAIEmbedding();
mockEmbeddingModel(embedModel);
const embedSpy = vi.spyOn(embedModel, "getTextEmbeddingsBatch");
Settings.embedModel = embedModel;
const storageContext = await mockStorageContext(testDir, embedModel);
await VectorStoreIndex.fromDocuments(documents, {
storageContext,
logProgress: true,
progressCallback,
});
// Expect the embedding model to be called
expect(embedSpy).toHaveBeenCalled();
// Verify that progressCallback was called with correct values
expect(progressCalls.length).toBeGreaterThan(0);
expect(progressCalls[0]).toEqual({ current: 10, total: 20 });
expect(progressCalls[progressCalls.length - 1]).toEqual({
current: 20,
total: 20,
});
});
});
}); });
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "@llamaindex/llamaindex-test", "name": "@llamaindex/llamaindex-test",
"private": true, "private": true,
"version": "0.1.19", "version": "0.1.20",
"type": "module", "type": "module",
"scripts": { "scripts": {
"test": "vitest run" "test": "vitest run"
+7
View File
@@ -1,5 +1,12 @@
# @llamaindex/node-parser # @llamaindex/node-parser
## 2.0.21
### Patch Changes
- Updated dependencies [5da1cda]
- @llamaindex/core@0.6.21
## 2.0.20 ## 2.0.20
### Patch Changes ### Patch Changes
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@llamaindex/node-parser", "name": "@llamaindex/node-parser",
"version": "2.0.20", "version": "2.0.21",
"description": "Node parser for LlamaIndex", "description": "Node parser for LlamaIndex",
"type": "module", "type": "module",
"exports": { "exports": {
@@ -1,5 +1,13 @@
# @llamaindex/anthropic # @llamaindex/anthropic
## 0.3.24
### Patch Changes
- 5d5cd44: fix: anthropic temperature parameter not respecting value 0
- Updated dependencies [5da1cda]
- @llamaindex/core@0.6.21
## 0.3.23 ## 0.3.23
### Patch Changes ### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "@llamaindex/anthropic", "name": "@llamaindex/anthropic",
"description": "Anthropic Adapter for LlamaIndex", "description": "Anthropic Adapter for LlamaIndex",
"version": "0.3.23", "version": "0.3.24",
"type": "module", "type": "module",
"main": "./dist/index.cjs", "main": "./dist/index.cjs",
"module": "./dist/index.js", "module": "./dist/index.js",
+1 -1
View File
@@ -179,7 +179,7 @@ export class Anthropic extends ToolCallLLM<
constructor(init?: Partial<Anthropic>) { constructor(init?: Partial<Anthropic>) {
super(); super();
this.model = init?.model ?? "claude-3-opus"; this.model = init?.model ?? "claude-3-opus";
this.temperature = init?.temperature ?? 1; // default in anthropic is 1 this.temperature = init?.temperature != null ? init.temperature : 1; // default in anthropic is 1
this.topP = init?.topP; this.topP = init?.topP;
this.maxTokens = init?.maxTokens ?? undefined; this.maxTokens = init?.maxTokens ?? undefined;
@@ -1,5 +1,12 @@
# @llamaindex/assemblyai # @llamaindex/assemblyai
## 0.1.20
### Patch Changes
- Updated dependencies [5da1cda]
- @llamaindex/core@0.6.21
## 0.1.19 ## 0.1.19
### Patch Changes ### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "@llamaindex/assemblyai", "name": "@llamaindex/assemblyai",
"description": "AssemblyAI Reader for LlamaIndex", "description": "AssemblyAI Reader for LlamaIndex",
"version": "0.1.19", "version": "0.1.20",
"type": "module", "type": "module",
"types": "dist/index.d.ts", "types": "dist/index.d.ts",
"main": "dist/index.cjs", "main": "dist/index.cjs",
+8
View File
@@ -1,5 +1,13 @@
# @llamaindex/community # @llamaindex/community
## 0.0.117
### Patch Changes
- ed37c64: Addition of APAC_ANTHROPIC_CLAUDE_4_SONNET type/record in @llamaindex/aws for APAC support for claude 4 sonnet per issue 2184.
- Updated dependencies [5da1cda]
- @llamaindex/core@0.6.21
## 0.0.116 ## 0.0.116
### Patch Changes ### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "@llamaindex/aws", "name": "@llamaindex/aws",
"description": "AWS package for LlamaIndexTS", "description": "AWS package for LlamaIndexTS",
"version": "0.0.116", "version": "0.0.117",
"type": "module", "type": "module",
"types": "dist/type/index.d.ts", "types": "dist/type/index.d.ts",
"main": "dist/cjs/index.js", "main": "dist/cjs/index.js",
@@ -134,13 +134,14 @@ export const INFERENCE_BEDROCK_MODELS = {
EU_AMAZON_NOVA_PRO_1: "eu.amazon.nova-pro-v1:0", EU_AMAZON_NOVA_PRO_1: "eu.amazon.nova-pro-v1:0",
EU_AMAZON_NOVA_LITE_1: "eu.amazon.nova-lite-v1:0", EU_AMAZON_NOVA_LITE_1: "eu.amazon.nova-lite-v1:0",
EU_AMAZON_NOVA_MICRO_1: "eu.amazon.nova-micro-v1:0", EU_AMAZON_NOVA_MICRO_1: "eu.amazon.nova-micro-v1:0",
APAC_ANTHROPIC_CLAUDE_3_5_SONNET: APAC_ANTHROPIC_CLAUDE_3_5_SONNET:
"apac.anthropic.claude-3-5-sonnet-20240620-v1:0", "apac.anthropic.claude-3-5-sonnet-20240620-v1:0",
APAC_ANTHROPIC_CLAUDE_3_5_SONNET_V2: APAC_ANTHROPIC_CLAUDE_3_5_SONNET_V2:
"apac.anthropic.claude-3-5-sonnet-20241022-v2:0", "apac.anthropic.claude-3-5-sonnet-20241022-v2:0",
APAC_ANTHROPIC_CLAUDE_3_7_SONNET: APAC_ANTHROPIC_CLAUDE_3_7_SONNET:
"apac.anthropic.claude-3-7-sonnet-20250219-v1:0", "apac.anthropic.claude-3-7-sonnet-20250219-v1:0",
APAC_ANTHROPIC_CLAUDE_4_SONNET:
"apac.anthropic.claude-sonnet-4-20250514-v1:0q",
APAC_ANTHROPIC_CLAUDE_3_HAIKU: "apac.anthropic.claude-3-haiku-20240307-v1:0", APAC_ANTHROPIC_CLAUDE_3_HAIKU: "apac.anthropic.claude-3-haiku-20240307-v1:0",
APAC_ANTHROPIC_CLAUDE_3_SONNET: APAC_ANTHROPIC_CLAUDE_3_SONNET:
"apac.anthropic.claude-3-sonnet-20240229-v1:0", "apac.anthropic.claude-3-sonnet-20240229-v1:0",
@@ -226,6 +227,8 @@ export const INFERENCE_TO_BEDROCK_MAP: Record<
BEDROCK_MODELS.ANTHROPIC_CLAUDE_3_5_SONNET_V2, BEDROCK_MODELS.ANTHROPIC_CLAUDE_3_5_SONNET_V2,
[INFERENCE_BEDROCK_MODELS.APAC_ANTHROPIC_CLAUDE_3_7_SONNET]: [INFERENCE_BEDROCK_MODELS.APAC_ANTHROPIC_CLAUDE_3_7_SONNET]:
BEDROCK_MODELS.ANTHROPIC_CLAUDE_3_7_SONNET, BEDROCK_MODELS.ANTHROPIC_CLAUDE_3_7_SONNET,
[INFERENCE_BEDROCK_MODELS.APAC_ANTHROPIC_CLAUDE_4_SONNET]:
BEDROCK_MODELS.ANTHROPIC_CLAUDE_4_SONNET,
[INFERENCE_BEDROCK_MODELS.APAC_ANTHROPIC_CLAUDE_3_HAIKU]: [INFERENCE_BEDROCK_MODELS.APAC_ANTHROPIC_CLAUDE_3_HAIKU]:
BEDROCK_MODELS.ANTHROPIC_CLAUDE_3_HAIKU, BEDROCK_MODELS.ANTHROPIC_CLAUDE_3_HAIKU,
[INFERENCE_BEDROCK_MODELS.APAC_ANTHROPIC_CLAUDE_3_SONNET]: [INFERENCE_BEDROCK_MODELS.APAC_ANTHROPIC_CLAUDE_3_SONNET]:
+8
View File
@@ -1,5 +1,13 @@
# @llamaindex/clip # @llamaindex/clip
## 0.0.75
### Patch Changes
- Updated dependencies [5da1cda]
- @llamaindex/core@0.6.21
- @llamaindex/openai@0.4.19
## 0.0.74 ## 0.0.74
### Patch Changes ### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "@llamaindex/clip", "name": "@llamaindex/clip",
"description": "Clip Embedding Adapter for LlamaIndex", "description": "Clip Embedding Adapter for LlamaIndex",
"version": "0.0.74", "version": "0.0.75",
"type": "module", "type": "module",
"types": "dist/index.d.ts", "types": "dist/index.d.ts",
"main": "dist/index.cjs", "main": "dist/index.cjs",
+7
View File
@@ -1,5 +1,12 @@
# @llamaindex/cohere # @llamaindex/cohere
## 0.0.35
### Patch Changes
- Updated dependencies [5da1cda]
- @llamaindex/core@0.6.21
## 0.0.34 ## 0.0.34
### Patch Changes ### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "@llamaindex/cohere", "name": "@llamaindex/cohere",
"description": "Cohere Adapter for LlamaIndex", "description": "Cohere Adapter for LlamaIndex",
"version": "0.0.34", "version": "0.0.35",
"type": "module", "type": "module",
"main": "./dist/index.cjs", "main": "./dist/index.cjs",
"module": "./dist/index.js", "module": "./dist/index.js",
@@ -1,5 +1,13 @@
# @llamaindex/deepinfra # @llamaindex/deepinfra
## 0.0.75
### Patch Changes
- Updated dependencies [5da1cda]
- @llamaindex/core@0.6.21
- @llamaindex/openai@0.4.19
## 0.0.74 ## 0.0.74
### Patch Changes ### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "@llamaindex/deepinfra", "name": "@llamaindex/deepinfra",
"description": "Deepinfra Adapter for LlamaIndex", "description": "Deepinfra Adapter for LlamaIndex",
"version": "0.0.74", "version": "0.0.75",
"type": "module", "type": "module",
"main": "./dist/index.cjs", "main": "./dist/index.cjs",
"module": "./dist/index.js", "module": "./dist/index.js",
+7
View File
@@ -1,5 +1,12 @@
# @llamaindex/deepseek # @llamaindex/deepseek
## 0.0.37
### Patch Changes
- Updated dependencies [5da1cda]
- @llamaindex/openai@0.4.19
## 0.0.36 ## 0.0.36
### Patch Changes ### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "@llamaindex/deepseek", "name": "@llamaindex/deepseek",
"description": "DeepSeek Adapter for LlamaIndex", "description": "DeepSeek Adapter for LlamaIndex",
"version": "0.0.36", "version": "0.0.37",
"type": "module", "type": "module",
"main": "./dist/index.cjs", "main": "./dist/index.cjs",
"module": "./dist/index.js", "module": "./dist/index.js",
+7
View File
@@ -1,5 +1,12 @@
# @llamaindex/discord # @llamaindex/discord
## 0.1.20
### Patch Changes
- Updated dependencies [5da1cda]
- @llamaindex/core@0.6.21
## 0.1.19 ## 0.1.19
### Patch Changes ### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "@llamaindex/discord", "name": "@llamaindex/discord",
"description": "Discord Reader for LlamaIndex", "description": "Discord Reader for LlamaIndex",
"version": "0.1.19", "version": "0.1.20",
"type": "module", "type": "module",
"types": "dist/index.d.ts", "types": "dist/index.d.ts",
"main": "dist/index.cjs", "main": "dist/index.cjs",
+7
View File
@@ -1,5 +1,12 @@
# @llamaindex/excel # @llamaindex/excel
## 0.1.21
### Patch Changes
- Updated dependencies [5da1cda]
- @llamaindex/core@0.6.21
## 0.1.20 ## 0.1.20
### Patch Changes ### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "@llamaindex/excel", "name": "@llamaindex/excel",
"description": "Excel Reader for LlamaIndex", "description": "Excel Reader for LlamaIndex",
"version": "0.1.20", "version": "0.1.21",
"type": "module", "type": "module",
"types": "dist/index.d.ts", "types": "dist/index.d.ts",
"main": "dist/index.cjs", "main": "dist/index.cjs",
@@ -1,5 +1,12 @@
# @llamaindex/fireworks # @llamaindex/fireworks
## 0.0.35
### Patch Changes
- Updated dependencies [5da1cda]
- @llamaindex/openai@0.4.19
## 0.0.34 ## 0.0.34
### Patch Changes ### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "@llamaindex/fireworks", "name": "@llamaindex/fireworks",
"description": "Fireworks Adapter for LlamaIndex", "description": "Fireworks Adapter for LlamaIndex",
"version": "0.0.34", "version": "0.0.35",
"type": "module", "type": "module",
"main": "./dist/index.cjs", "main": "./dist/index.cjs",
"module": "./dist/index.js", "module": "./dist/index.js",
+8
View File
@@ -1,5 +1,13 @@
# @llamaindex/google # @llamaindex/google
## 0.3.21
### Patch Changes
- c40adaf: Add latest google models to lib
- Updated dependencies [5da1cda]
- @llamaindex/core@0.6.21
## 0.3.20 ## 0.3.20
### Patch Changes ### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "@llamaindex/google", "name": "@llamaindex/google",
"description": "Google Adapter for LlamaIndex", "description": "Google Adapter for LlamaIndex",
"version": "0.3.20", "version": "0.3.21",
"type": "module", "type": "module",
"main": "./dist/index.cjs", "main": "./dist/index.cjs",
"module": "./dist/index.js", "module": "./dist/index.js",
@@ -27,6 +27,9 @@ export enum GEMINI_MODEL {
GEMINI_2_5_PRO_PREVIEW = "gemini-2.5-pro-preview-03-25", GEMINI_2_5_PRO_PREVIEW = "gemini-2.5-pro-preview-03-25",
GEMINI_2_5_PRO_PREVIEW_LATEST = "gemini-2.5-pro-preview-06-05", GEMINI_2_5_PRO_PREVIEW_LATEST = "gemini-2.5-pro-preview-06-05",
GEMINI_2_5_FLASH_PREVIEW = "gemini-2.5-flash-preview-05-20", GEMINI_2_5_FLASH_PREVIEW = "gemini-2.5-flash-preview-05-20",
GEMINI_2_5_PRO_LATEST = "gemini-2.5-pro",
GEMINI_2_5_FLASH_LATEST = "gemini-2.5-flash",
GEMINI_2_5_FLASH_LITE = "gemini-2.5-flash-lite",
} }
export const GEMINI_MODEL_INFO_MAP: Record< export const GEMINI_MODEL_INFO_MAP: Record<
@@ -54,6 +57,9 @@ export const GEMINI_MODEL_INFO_MAP: Record<
[GEMINI_MODEL.GEMINI_2_5_PRO_PREVIEW]: { contextWindow: 10 ** 6 }, [GEMINI_MODEL.GEMINI_2_5_PRO_PREVIEW]: { contextWindow: 10 ** 6 },
[GEMINI_MODEL.GEMINI_2_5_PRO_PREVIEW_LATEST]: { contextWindow: 10 ** 6 }, [GEMINI_MODEL.GEMINI_2_5_PRO_PREVIEW_LATEST]: { contextWindow: 10 ** 6 },
[GEMINI_MODEL.GEMINI_2_5_FLASH_PREVIEW]: { contextWindow: 10 ** 6 }, [GEMINI_MODEL.GEMINI_2_5_FLASH_PREVIEW]: { contextWindow: 10 ** 6 },
[GEMINI_MODEL.GEMINI_2_5_PRO_LATEST]: { contextWindow: 10 ** 6 },
[GEMINI_MODEL.GEMINI_2_5_FLASH_LATEST]: { contextWindow: 10 ** 6 },
[GEMINI_MODEL.GEMINI_2_5_FLASH_LITE]: { contextWindow: 10 ** 6 },
}; };
export const SUPPORT_TOOL_CALL_MODELS: GEMINI_MODEL[] = [ export const SUPPORT_TOOL_CALL_MODELS: GEMINI_MODEL[] = [
@@ -73,6 +79,9 @@ export const SUPPORT_TOOL_CALL_MODELS: GEMINI_MODEL[] = [
GEMINI_MODEL.GEMINI_2_5_PRO_PREVIEW, GEMINI_MODEL.GEMINI_2_5_PRO_PREVIEW,
GEMINI_MODEL.GEMINI_2_5_PRO_PREVIEW_LATEST, GEMINI_MODEL.GEMINI_2_5_PRO_PREVIEW_LATEST,
GEMINI_MODEL.GEMINI_2_5_FLASH_PREVIEW, GEMINI_MODEL.GEMINI_2_5_FLASH_PREVIEW,
GEMINI_MODEL.GEMINI_2_5_PRO_LATEST,
GEMINI_MODEL.GEMINI_2_5_FLASH_LATEST,
GEMINI_MODEL.GEMINI_2_5_FLASH_LITE,
]; ];
export const DEFAULT_GEMINI_PARAMS = { export const DEFAULT_GEMINI_PARAMS = {
+7
View File
@@ -1,5 +1,12 @@
# @llamaindex/groq # @llamaindex/groq
## 0.0.91
### Patch Changes
- Updated dependencies [5da1cda]
- @llamaindex/openai@0.4.19
## 0.0.90 ## 0.0.90
### Patch Changes ### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "@llamaindex/groq", "name": "@llamaindex/groq",
"description": "Groq Adapter for LlamaIndex", "description": "Groq Adapter for LlamaIndex",
"version": "0.0.90", "version": "0.0.91",
"type": "module", "type": "module",
"main": "./dist/index.cjs", "main": "./dist/index.cjs",
"module": "./dist/index.js", "module": "./dist/index.js",
@@ -1,5 +1,13 @@
# @llamaindex/huggingface # @llamaindex/huggingface
## 0.1.29
### Patch Changes
- Updated dependencies [5da1cda]
- @llamaindex/core@0.6.21
- @llamaindex/openai@0.4.19
## 0.1.28 ## 0.1.28
### Patch Changes ### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "@llamaindex/huggingface", "name": "@llamaindex/huggingface",
"description": "Huggingface Adapter for LlamaIndex", "description": "Huggingface Adapter for LlamaIndex",
"version": "0.1.28", "version": "0.1.29",
"type": "module", "type": "module",
"types": "dist/index.d.ts", "types": "dist/index.d.ts",
"main": "dist/index.cjs", "main": "dist/index.cjs",
+8
View File
@@ -1,5 +1,13 @@
# @llamaindex/jinaai # @llamaindex/jinaai
## 0.0.35
### Patch Changes
- Updated dependencies [5da1cda]
- @llamaindex/core@0.6.21
- @llamaindex/openai@0.4.19
## 0.0.34 ## 0.0.34
### Patch Changes ### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "@llamaindex/jinaai", "name": "@llamaindex/jinaai",
"description": "JinaAI Adapter for LlamaIndex", "description": "JinaAI Adapter for LlamaIndex",
"version": "0.0.34", "version": "0.0.35",
"type": "module", "type": "module",
"main": "./dist/index.cjs", "main": "./dist/index.cjs",
"module": "./dist/index.js", "module": "./dist/index.js",
+7
View File
@@ -1,5 +1,12 @@
# @llamaindex/mistral # @llamaindex/mistral
## 0.1.21
### Patch Changes
- Updated dependencies [5da1cda]
- @llamaindex/core@0.6.21
## 0.1.20 ## 0.1.20
### Patch Changes ### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "@llamaindex/mistral", "name": "@llamaindex/mistral",
"description": "Mistral Adapter for LlamaIndex", "description": "Mistral Adapter for LlamaIndex",
"version": "0.1.20", "version": "0.1.21",
"type": "module", "type": "module",
"main": "./dist/index.cjs", "main": "./dist/index.cjs",
"module": "./dist/index.js", "module": "./dist/index.js",

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