mirror of
https://github.com/run-llama/LlamaIndexTS.git
synced 2026-07-11 00:04:07 -04:00
Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e5b25acc3d | |||
| ba35240b4c | |||
| 7384e4d273 | |||
| ae75966721 | |||
| 5cdab12791 | |||
| eaf2cb11a5 | |||
| 3ae01a227e | |||
| 76ff23dc48 | |||
| ed497727b1 | |||
| 59601dd3ab | |||
| 8474ca970e | |||
| 3703f907d9 | |||
| f63b702bec | |||
| ccde88fe0b | |||
| b0cd5301bb |
@@ -1,6 +0,0 @@
|
||||
---
|
||||
"@llamaindex/workflow": patch
|
||||
"@llamaindex/core": patch
|
||||
---
|
||||
|
||||
Remove requireContext from tools - better use binding to pass context
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
"@llamaindex/qdrant": patch
|
||||
---
|
||||
|
||||
Update implementation to use query instead of search which is being deprecated
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
"llamaindex": minor
|
||||
"@llamaindex/core": patch
|
||||
---
|
||||
|
||||
Remove old workflows - use @llamaindex/workflow package
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
"@llamaindex/azure": patch
|
||||
"@llamaindex/openai": minor
|
||||
---
|
||||
|
||||
Move Azure models to azure package
|
||||
@@ -1,5 +1,50 @@
|
||||
# @llamaindex/doc
|
||||
|
||||
## 0.2.22
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [76ff23d]
|
||||
- @llamaindex/cloud@4.0.11
|
||||
- llamaindex@0.11.3
|
||||
|
||||
## 0.2.21
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [59601dd]
|
||||
- @llamaindex/openai@0.4.1
|
||||
- @llamaindex/core@0.6.7
|
||||
- @llamaindex/cloud@4.0.10
|
||||
- llamaindex@0.11.2
|
||||
- @llamaindex/node-parser@2.0.7
|
||||
- @llamaindex/readers@3.1.5
|
||||
- @llamaindex/workflow@1.1.4
|
||||
|
||||
## 0.2.20
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [3703f90]
|
||||
- @llamaindex/cloud@4.0.9
|
||||
- llamaindex@0.11.1
|
||||
|
||||
## 0.2.19
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [680b529]
|
||||
- Updated dependencies [b0cd530]
|
||||
- Updated dependencies [361a685]
|
||||
- Updated dependencies [3e66ddc]
|
||||
- @llamaindex/workflow@1.1.3
|
||||
- @llamaindex/core@0.6.6
|
||||
- llamaindex@0.11.0
|
||||
- @llamaindex/openai@0.4.0
|
||||
- @llamaindex/cloud@4.0.8
|
||||
- @llamaindex/node-parser@2.0.6
|
||||
- @llamaindex/readers@3.1.4
|
||||
|
||||
## 0.2.18
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@llamaindex/doc",
|
||||
"version": "0.2.18",
|
||||
"version": "0.2.22",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"postinstall": "fumadocs-mdx",
|
||||
|
||||
@@ -2,89 +2,43 @@
|
||||
title: Azure OpenAI
|
||||
---
|
||||
|
||||
To use Azure OpenAI, you only need to set a few environment variables together with the `OpenAI` class.
|
||||
|
||||
For example:
|
||||
|
||||
## Environment Variables
|
||||
|
||||
```
|
||||
export AZURE_OPENAI_KEY="<YOUR KEY HERE>"
|
||||
export AZURE_OPENAI_ENDPOINT="<YOUR ENDPOINT, see https://learn.microsoft.com/en-us/azure/ai-services/openai/quickstart?tabs=command-line%2Cpython&pivots=rest-api>"
|
||||
export AZURE_OPENAI_DEPLOYMENT="gpt-4" # or some other deployment name
|
||||
```
|
||||
To use Azure OpenAI, you only need to install the `@llamaindex/azure` package:
|
||||
|
||||
## Installation
|
||||
|
||||
```package-install
|
||||
npm i llamaindex @llamaindex/openai
|
||||
npm i llamaindex @llamaindex/azure
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
The class `AzureOpenAI` is used for setting the LLM and `AzureOpenAIEmbedding` is used for setting the embedding model, e.g.:
|
||||
|
||||
```ts
|
||||
import { Settings } from "llamaindex";
|
||||
import { OpenAI } from "@llamaindex/openai";
|
||||
import { AzureOpenAI, AzureOpenAIEmbedding } from "@llamaindex/azure";
|
||||
|
||||
Settings.llm = new OpenAI({ model: "gpt-4", temperature: 0 });
|
||||
```
|
||||
|
||||
## Load and index documents
|
||||
|
||||
For this example, we will use a single document. In a real-world scenario, you would have multiple documents to index.
|
||||
|
||||
```ts
|
||||
const document = new Document({ text: essay, id_: "essay" });
|
||||
|
||||
const index = await VectorStoreIndex.fromDocuments([document]);
|
||||
```
|
||||
|
||||
## Query
|
||||
|
||||
```ts
|
||||
const queryEngine = index.asQueryEngine();
|
||||
|
||||
const query = "What is the meaning of life?";
|
||||
|
||||
const results = await queryEngine.query({
|
||||
query,
|
||||
Settings.llm = new AzureOpenAI({
|
||||
apiKey: '[key]',
|
||||
deployment: '[model]',
|
||||
apiVersion: '[version]',
|
||||
endpoint: `https://[deployment].openai.azure.com/`,
|
||||
});
|
||||
Settings.embedModel = new AzureOpenAIEmbedding({
|
||||
apiKey: '[key]',
|
||||
deployment: '[embedding-model]',
|
||||
apiVersion: '[version]',
|
||||
endpoint: `https://[deployment].openai.azure.com/`,
|
||||
});
|
||||
```
|
||||
|
||||
## Full Example
|
||||
Instead of explicitly setting the API key, deployment, version, and endpoint in the constructor, you can use the following environment variables: `AZURE_OPENAI_DEPLOYMENT` for the model deployment name, `AZURE_OPENAI_KEY` for your API key, `AZURE_OPENAI_ENDPOINT` for your Azure endpoint URL, and `AZURE_OPENAI_API_VERSION` for the API version.
|
||||
|
||||
```ts
|
||||
import { Document, VectorStoreIndex, Settings } from "llamaindex";
|
||||
import { OpenAI } from "@llamaindex/openai";
|
||||
## Examples
|
||||
|
||||
Settings.llm = new OpenAI({ model: "gpt-4", temperature: 0 });
|
||||
|
||||
async function main() {
|
||||
const document = new Document({ text: essay, id_: "essay" });
|
||||
|
||||
// Load and index documents
|
||||
const index = await VectorStoreIndex.fromDocuments([document]);
|
||||
|
||||
// get retriever
|
||||
const retriever = index.asRetriever();
|
||||
|
||||
// Create a query engine
|
||||
const queryEngine = index.asQueryEngine({
|
||||
retriever,
|
||||
});
|
||||
|
||||
const query = "What is the meaning of life?";
|
||||
|
||||
// Query
|
||||
const response = await queryEngine.query({
|
||||
query,
|
||||
});
|
||||
|
||||
// Log the response
|
||||
console.log(response.response);
|
||||
}
|
||||
```
|
||||
See the [Azure examples](https://github.com/run-llama/LlamaIndexTS/tree/main/examples/storage/azure) for more examples of how to use Azure OpenAI.
|
||||
|
||||
## API Reference
|
||||
|
||||
- [OpenAI](/docs/api/classes/OpenAI)
|
||||
- [AzureOpenAI](/docs/api/classes/AzureOpenAI)
|
||||
- [AzureOpenAIEmbedding](/docs/api/classes/AzureOpenAIEmbedding)
|
||||
@@ -1,5 +1,19 @@
|
||||
# @llamaindex/core-e2e
|
||||
|
||||
## 0.1.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- b0cd530: # Breaking Change
|
||||
|
||||
## What Changed
|
||||
|
||||
Remove default setting of llm and embedModel in Settings
|
||||
|
||||
## Migration Guide
|
||||
|
||||
Set the llm provider and embed Model in the top of your code using Settings.llm = and Settings.embedModel
|
||||
|
||||
## 0.1.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
@@ -1,5 +1,31 @@
|
||||
# @llamaindex/cloudflare-worker-agent-test
|
||||
|
||||
## 0.0.164
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- llamaindex@0.11.3
|
||||
|
||||
## 0.0.163
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- llamaindex@0.11.2
|
||||
|
||||
## 0.0.162
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- llamaindex@0.11.1
|
||||
|
||||
## 0.0.161
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [b0cd530]
|
||||
- Updated dependencies [361a685]
|
||||
- llamaindex@0.11.0
|
||||
|
||||
## 0.0.160
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@llamaindex/cloudflare-worker-agent-test",
|
||||
"version": "0.0.160",
|
||||
"version": "0.0.164",
|
||||
"type": "module",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
|
||||
@@ -1,5 +1,31 @@
|
||||
# @llamaindex/llama-parse-browser-test
|
||||
|
||||
## 0.0.66
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [76ff23d]
|
||||
- @llamaindex/cloud@4.0.11
|
||||
|
||||
## 0.0.65
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @llamaindex/cloud@4.0.10
|
||||
|
||||
## 0.0.64
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [3703f90]
|
||||
- @llamaindex/cloud@4.0.9
|
||||
|
||||
## 0.0.63
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @llamaindex/cloud@4.0.8
|
||||
|
||||
## 0.0.62
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@llamaindex/llama-parse-browser-test",
|
||||
"private": true,
|
||||
"version": "0.0.62",
|
||||
"version": "0.0.66",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@@ -1,5 +1,31 @@
|
||||
# @llamaindex/next-agent-test
|
||||
|
||||
## 0.1.164
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- llamaindex@0.11.3
|
||||
|
||||
## 0.1.163
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- llamaindex@0.11.2
|
||||
|
||||
## 0.1.162
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- llamaindex@0.11.1
|
||||
|
||||
## 0.1.161
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [b0cd530]
|
||||
- Updated dependencies [361a685]
|
||||
- llamaindex@0.11.0
|
||||
|
||||
## 0.1.160
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@llamaindex/next-agent-test",
|
||||
"version": "0.1.160",
|
||||
"version": "0.1.164",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"use server";
|
||||
import { OpenAIAgent } from "@llamaindex/openai";
|
||||
import { createStreamableUI } from "ai/rsc";
|
||||
import type { ChatMessage } from "llamaindex";
|
||||
import { OpenAIAgent } from "llamaindex";
|
||||
|
||||
export async function chatWithAgent(
|
||||
question: string,
|
||||
|
||||
@@ -1,5 +1,31 @@
|
||||
# test-edge-runtime
|
||||
|
||||
## 0.1.163
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- llamaindex@0.11.3
|
||||
|
||||
## 0.1.162
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- llamaindex@0.11.2
|
||||
|
||||
## 0.1.161
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- llamaindex@0.11.1
|
||||
|
||||
## 0.1.160
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [b0cd530]
|
||||
- Updated dependencies [361a685]
|
||||
- llamaindex@0.11.0
|
||||
|
||||
## 0.1.159
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@llamaindex/nextjs-edge-runtime-test",
|
||||
"version": "0.1.159",
|
||||
"version": "0.1.163",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
|
||||
@@ -1,5 +1,35 @@
|
||||
# @llamaindex/next-node-runtime
|
||||
|
||||
## 0.1.31
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- llamaindex@0.11.3
|
||||
|
||||
## 0.1.30
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @llamaindex/huggingface@0.1.11
|
||||
- llamaindex@0.11.2
|
||||
- @llamaindex/readers@3.1.5
|
||||
|
||||
## 0.1.29
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- llamaindex@0.11.1
|
||||
|
||||
## 0.1.28
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [b0cd530]
|
||||
- Updated dependencies [361a685]
|
||||
- llamaindex@0.11.0
|
||||
- @llamaindex/huggingface@0.1.10
|
||||
- @llamaindex/readers@3.1.4
|
||||
|
||||
## 0.1.27
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@llamaindex/next-node-runtime-test",
|
||||
"version": "0.1.27",
|
||||
"version": "0.1.31",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
"use server";
|
||||
import { HuggingFaceEmbedding } from "@llamaindex/huggingface";
|
||||
import { OpenAI, OpenAIAgent } from "@llamaindex/openai";
|
||||
import { SimpleDirectoryReader } from "@llamaindex/readers/directory";
|
||||
import { OpenAI, OpenAIAgent, Settings, VectorStoreIndex } from "llamaindex";
|
||||
import { Settings, VectorStoreIndex } from "llamaindex";
|
||||
|
||||
Settings.llm = new OpenAI({
|
||||
apiKey: process.env.NEXT_PUBLIC_OPENAI_KEY ?? "FAKE_KEY_TO_PASS_TESTS",
|
||||
|
||||
@@ -1,5 +1,31 @@
|
||||
# vite-import-llamaindex
|
||||
|
||||
## 0.0.30
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- llamaindex@0.11.3
|
||||
|
||||
## 0.0.29
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- llamaindex@0.11.2
|
||||
|
||||
## 0.0.28
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- llamaindex@0.11.1
|
||||
|
||||
## 0.0.27
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [b0cd530]
|
||||
- Updated dependencies [361a685]
|
||||
- llamaindex@0.11.0
|
||||
|
||||
## 0.0.26
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "vite-import-llamaindex",
|
||||
"private": true,
|
||||
"version": "0.0.26",
|
||||
"version": "0.0.30",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "vite build",
|
||||
|
||||
@@ -1,5 +1,31 @@
|
||||
# @llamaindex/waku-query-engine-test
|
||||
|
||||
## 0.0.164
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- llamaindex@0.11.3
|
||||
|
||||
## 0.0.163
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- llamaindex@0.11.2
|
||||
|
||||
## 0.0.162
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- llamaindex@0.11.1
|
||||
|
||||
## 0.0.161
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [b0cd530]
|
||||
- Updated dependencies [361a685]
|
||||
- llamaindex@0.11.0
|
||||
|
||||
## 0.0.160
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@llamaindex/waku-query-engine-test",
|
||||
"version": "0.0.160",
|
||||
"version": "0.0.164",
|
||||
"type": "module",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { ClipEmbedding } from "@llamaindex/clip";
|
||||
import type { LoadTransformerEvent } from "@llamaindex/env/multi-model";
|
||||
import { setTransformers } from "@llamaindex/env/multi-model";
|
||||
import { OpenAIEmbedding } from "@llamaindex/openai";
|
||||
import { ImageNode, Settings } from "llamaindex";
|
||||
import assert from "node:assert";
|
||||
import { type Mock, test } from "node:test";
|
||||
@@ -19,6 +20,7 @@ test.before(() => {
|
||||
|
||||
test.beforeEach(() => {
|
||||
callback.mock.resetCalls();
|
||||
Settings.embedModel = new OpenAIEmbedding();
|
||||
});
|
||||
|
||||
await test.skip("clip embedding", async (t) => {
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
import type { TaskStep } from "@llamaindex/core/agent";
|
||||
import {
|
||||
LLMSingleSelector,
|
||||
OpenAIAgent,
|
||||
Settings,
|
||||
type ChatMessage,
|
||||
} from "llamaindex";
|
||||
import { OpenAIAgent } from "@llamaindex/openai";
|
||||
import { LLMSingleSelector, Settings, type ChatMessage } from "llamaindex";
|
||||
import assert from "node:assert";
|
||||
import { test } from "node:test";
|
||||
import { divideNumbersTool, sumNumbersTool } from "./fixtures/tools.js";
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import { extractText } from "@llamaindex/core/utils";
|
||||
import { OpenAI, OpenAIAgent } from "@llamaindex/openai";
|
||||
import { consola } from "consola";
|
||||
import {
|
||||
Document,
|
||||
FunctionTool,
|
||||
ObjectIndex,
|
||||
OpenAI,
|
||||
OpenAIAgent,
|
||||
QueryEngineTool,
|
||||
SentenceSplitter,
|
||||
Settings,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { extractText } from "@llamaindex/core/utils";
|
||||
import { OpenAI, ReActAgent, Settings, type LLM } from "llamaindex";
|
||||
import { OpenAI } from "@llamaindex/openai";
|
||||
import { ReActAgent, Settings, type LLM } from "llamaindex";
|
||||
import { ok } from "node:assert";
|
||||
import { beforeEach, test } from "node:test";
|
||||
import { getWeatherTool } from "./fixtures/tools.js";
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import { OpenAIEmbedding } from "@llamaindex/openai";
|
||||
import { PGVectorStore } from "@llamaindex/postgres";
|
||||
import { config } from "dotenv";
|
||||
import { Document, VectorStoreQueryMode } from "llamaindex";
|
||||
import { Document, Settings, VectorStoreQueryMode } from "llamaindex";
|
||||
import assert from "node:assert";
|
||||
import { test } from "node:test";
|
||||
import { beforeEach, test } from "node:test";
|
||||
import pg from "pg";
|
||||
import { registerTypes } from "pgvector/pg";
|
||||
|
||||
@@ -14,6 +15,10 @@ const pgConfig = {
|
||||
database: "llamaindex_node_test",
|
||||
};
|
||||
|
||||
beforeEach(async () => {
|
||||
Settings.embedModel = new OpenAIEmbedding();
|
||||
});
|
||||
|
||||
await test("init with client", async (t) => {
|
||||
const pgClient = new pg.Client(pgConfig);
|
||||
await pgClient.connect();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { OpenAI } from "@llamaindex/openai";
|
||||
import { agent } from "@llamaindex/workflow";
|
||||
import { OpenAI, Settings, tool } from "llamaindex";
|
||||
import { Settings, tool } from "llamaindex";
|
||||
import { ok } from "node:assert";
|
||||
import { test } from "node:test";
|
||||
import { z } from "zod";
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@llamaindex/e2e",
|
||||
"private": true,
|
||||
"version": "0.1.0",
|
||||
"version": "0.1.1",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"e2e": "node --import tsx --import ./mock-register.js --test ./node/**/*.e2e.ts",
|
||||
|
||||
@@ -1,5 +1,111 @@
|
||||
# examples
|
||||
|
||||
## 0.3.17
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [59601dd]
|
||||
- @llamaindex/openai@0.4.1
|
||||
- @llamaindex/core@0.6.7
|
||||
- @llamaindex/clip@0.0.57
|
||||
- @llamaindex/deepinfra@0.0.57
|
||||
- @llamaindex/deepseek@0.0.17
|
||||
- @llamaindex/fireworks@0.0.17
|
||||
- @llamaindex/groq@0.0.72
|
||||
- @llamaindex/huggingface@0.1.11
|
||||
- @llamaindex/jinaai@0.0.17
|
||||
- @llamaindex/perplexity@0.0.14
|
||||
- @llamaindex/azure@0.1.17
|
||||
- @llamaindex/elastic-search@0.1.7
|
||||
- @llamaindex/milvus@0.1.16
|
||||
- @llamaindex/qdrant@0.1.16
|
||||
- @llamaindex/supabase@0.1.6
|
||||
- @llamaindex/together@0.0.17
|
||||
- @llamaindex/vllm@0.0.43
|
||||
- @llamaindex/xai@0.0.4
|
||||
- @llamaindex/cloud@4.0.10
|
||||
- llamaindex@0.11.2
|
||||
- @llamaindex/node-parser@2.0.7
|
||||
- @llamaindex/anthropic@0.3.8
|
||||
- @llamaindex/assemblyai@0.1.6
|
||||
- @llamaindex/cohere@0.0.21
|
||||
- @llamaindex/discord@0.1.6
|
||||
- @llamaindex/google@0.3.3
|
||||
- @llamaindex/mistral@0.1.7
|
||||
- @llamaindex/mixedbread@0.0.21
|
||||
- @llamaindex/notion@0.1.6
|
||||
- @llamaindex/ollama@0.1.7
|
||||
- @llamaindex/portkey-ai@0.0.49
|
||||
- @llamaindex/replicate@0.0.49
|
||||
- @llamaindex/astra@0.0.21
|
||||
- @llamaindex/chroma@0.0.21
|
||||
- @llamaindex/firestore@1.0.14
|
||||
- @llamaindex/mongodb@0.0.22
|
||||
- @llamaindex/pinecone@0.1.7
|
||||
- @llamaindex/postgres@0.0.50
|
||||
- @llamaindex/upstash@0.0.21
|
||||
- @llamaindex/weaviate@0.0.21
|
||||
- @llamaindex/vercel@0.1.7
|
||||
- @llamaindex/voyage-ai@1.0.13
|
||||
- @llamaindex/readers@3.1.5
|
||||
- @llamaindex/tools@0.0.12
|
||||
- @llamaindex/workflow@1.1.4
|
||||
|
||||
## 0.3.16
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [680b529]
|
||||
- Updated dependencies [b0cd530]
|
||||
- Updated dependencies [c73c659]
|
||||
- Updated dependencies [361a685]
|
||||
- Updated dependencies [3e66ddc]
|
||||
- @llamaindex/workflow@1.1.3
|
||||
- @llamaindex/core@0.6.6
|
||||
- llamaindex@0.11.0
|
||||
- @llamaindex/qdrant@0.1.15
|
||||
- @llamaindex/azure@0.1.16
|
||||
- @llamaindex/openai@0.4.0
|
||||
- @llamaindex/cloud@4.0.8
|
||||
- @llamaindex/node-parser@2.0.6
|
||||
- @llamaindex/anthropic@0.3.7
|
||||
- @llamaindex/assemblyai@0.1.5
|
||||
- @llamaindex/clip@0.0.56
|
||||
- @llamaindex/cohere@0.0.20
|
||||
- @llamaindex/deepinfra@0.0.56
|
||||
- @llamaindex/discord@0.1.5
|
||||
- @llamaindex/google@0.3.2
|
||||
- @llamaindex/huggingface@0.1.10
|
||||
- @llamaindex/jinaai@0.0.16
|
||||
- @llamaindex/mistral@0.1.6
|
||||
- @llamaindex/mixedbread@0.0.20
|
||||
- @llamaindex/notion@0.1.5
|
||||
- @llamaindex/ollama@0.1.6
|
||||
- @llamaindex/perplexity@0.0.13
|
||||
- @llamaindex/portkey-ai@0.0.48
|
||||
- @llamaindex/replicate@0.0.48
|
||||
- @llamaindex/astra@0.0.20
|
||||
- @llamaindex/chroma@0.0.20
|
||||
- @llamaindex/elastic-search@0.1.6
|
||||
- @llamaindex/firestore@1.0.13
|
||||
- @llamaindex/milvus@0.1.15
|
||||
- @llamaindex/mongodb@0.0.21
|
||||
- @llamaindex/pinecone@0.1.6
|
||||
- @llamaindex/postgres@0.0.49
|
||||
- @llamaindex/supabase@0.1.5
|
||||
- @llamaindex/upstash@0.0.20
|
||||
- @llamaindex/weaviate@0.0.20
|
||||
- @llamaindex/vercel@0.1.6
|
||||
- @llamaindex/voyage-ai@1.0.12
|
||||
- @llamaindex/readers@3.1.4
|
||||
- @llamaindex/tools@0.0.11
|
||||
- @llamaindex/deepseek@0.0.16
|
||||
- @llamaindex/fireworks@0.0.16
|
||||
- @llamaindex/groq@0.0.71
|
||||
- @llamaindex/together@0.0.16
|
||||
- @llamaindex/vllm@0.0.42
|
||||
- @llamaindex/xai@0.0.3
|
||||
|
||||
## 0.3.15
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import { openai } from "@llamaindex/openai";
|
||||
import {
|
||||
agent,
|
||||
agentStreamEvent,
|
||||
agentToolCallResultEvent,
|
||||
} from "@llamaindex/workflow";
|
||||
import { Document, VectorStoreIndex, openai } from "llamaindex";
|
||||
import { Document, VectorStoreIndex } from "llamaindex";
|
||||
|
||||
async function main() {
|
||||
const index = await VectorStoreIndex.fromDocuments([
|
||||
|
||||
@@ -1,12 +1,20 @@
|
||||
import fs from "node:fs/promises";
|
||||
|
||||
import { openai, OpenAIEmbedding } from "@llamaindex/openai";
|
||||
import {
|
||||
Document,
|
||||
MetadataMode,
|
||||
NodeWithScore,
|
||||
Settings,
|
||||
VectorStoreIndex,
|
||||
} from "llamaindex";
|
||||
|
||||
Settings.llm = openai({
|
||||
apiKey: process.env.OPENAI_API_KEY,
|
||||
model: "gpt-4o",
|
||||
});
|
||||
Settings.embedModel = new OpenAIEmbedding();
|
||||
|
||||
async function main() {
|
||||
// Load essay from abramov.txt in Node
|
||||
const path = "node_modules/llamaindex/examples/abramov.txt";
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
import { openaiResponses } from "@llamaindex/openai";
|
||||
import fs from "fs";
|
||||
import { MessageContentDetail } from "llamaindex";
|
||||
|
||||
async function main() {
|
||||
const llm = openaiResponses({
|
||||
model: "gpt-4.1-mini",
|
||||
builtInTools: [{ type: "image_generation" }],
|
||||
});
|
||||
|
||||
const response = await llm.chat({
|
||||
messages: [
|
||||
{
|
||||
role: "user",
|
||||
content:
|
||||
"Generate an image of a cute tiny llama wearing a hat playing with a cat on a meadow",
|
||||
},
|
||||
],
|
||||
});
|
||||
const content = response.message.content as MessageContentDetail[];
|
||||
|
||||
// This call returns a message with two parts, an image and a text part, get both parts
|
||||
const imagePart = content.find((part) => part.type === "image");
|
||||
const textPart = content.find((part) => part.type === "text");
|
||||
|
||||
// write the image to a file
|
||||
fs.writeFileSync(
|
||||
"llama.png",
|
||||
Buffer.from(imagePart?.data as string, "base64"),
|
||||
);
|
||||
// and print out the text part
|
||||
console.log(textPart?.text);
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
||||
@@ -0,0 +1,31 @@
|
||||
import { openaiResponses } from "@llamaindex/openai";
|
||||
|
||||
async function main() {
|
||||
const llm = openaiResponses({
|
||||
model: "gpt-4.1",
|
||||
builtInTools: [
|
||||
{
|
||||
type: "code_interpreter",
|
||||
container: { type: "auto" },
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
const response = await llm.chat({
|
||||
messages: [
|
||||
{
|
||||
role: "system",
|
||||
content:
|
||||
"You are a personal math tutor. When asked a math question, write and run code to answer the question.",
|
||||
},
|
||||
{
|
||||
role: "user",
|
||||
content: "I need to solve the equation 3x + 11 = 14. Can you help me?",
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
console.log(response.message.content);
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
||||
@@ -7,7 +7,6 @@ async function main() {
|
||||
builtInTools: [{ type: "web_search_preview" }],
|
||||
});
|
||||
|
||||
// Streaming chat example
|
||||
const response = await llm.chat({
|
||||
messages: [
|
||||
{
|
||||
|
||||
+46
-46
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@llamaindex/examples",
|
||||
"version": "0.3.15",
|
||||
"version": "0.3.17",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"lint": "eslint .",
|
||||
@@ -11,51 +11,51 @@
|
||||
"@azure/cosmos": "^4.1.1",
|
||||
"@azure/identity": "^4.4.1",
|
||||
"@azure/search-documents": "^12.1.0",
|
||||
"@llamaindex/anthropic": "^0.3.6",
|
||||
"@llamaindex/assemblyai": "^0.1.4",
|
||||
"@llamaindex/astra": "^0.0.19",
|
||||
"@llamaindex/azure": "^0.1.15",
|
||||
"@llamaindex/chroma": "^0.0.19",
|
||||
"@llamaindex/clip": "^0.0.55",
|
||||
"@llamaindex/cloud": "^4.0.7",
|
||||
"@llamaindex/cohere": "^0.0.19",
|
||||
"@llamaindex/core": "^0.6.5",
|
||||
"@llamaindex/deepinfra": "^0.0.55",
|
||||
"@llamaindex/deepseek": "^0.0.15",
|
||||
"@llamaindex/discord": "^0.1.4",
|
||||
"@llamaindex/elastic-search": "^0.1.5",
|
||||
"@llamaindex/anthropic": "^0.3.8",
|
||||
"@llamaindex/assemblyai": "^0.1.6",
|
||||
"@llamaindex/astra": "^0.0.21",
|
||||
"@llamaindex/azure": "^0.1.17",
|
||||
"@llamaindex/chroma": "^0.0.21",
|
||||
"@llamaindex/clip": "^0.0.57",
|
||||
"@llamaindex/cloud": "^4.0.10",
|
||||
"@llamaindex/cohere": "^0.0.21",
|
||||
"@llamaindex/core": "^0.6.7",
|
||||
"@llamaindex/deepinfra": "^0.0.57",
|
||||
"@llamaindex/deepseek": "^0.0.17",
|
||||
"@llamaindex/discord": "^0.1.6",
|
||||
"@llamaindex/elastic-search": "^0.1.7",
|
||||
"@llamaindex/env": "^0.1.30",
|
||||
"@llamaindex/firestore": "^1.0.12",
|
||||
"@llamaindex/fireworks": "^0.0.15",
|
||||
"@llamaindex/google": "^0.3.1",
|
||||
"@llamaindex/groq": "^0.0.70",
|
||||
"@llamaindex/huggingface": "^0.1.9",
|
||||
"@llamaindex/jinaai": "^0.0.15",
|
||||
"@llamaindex/milvus": "^0.1.14",
|
||||
"@llamaindex/mistral": "^0.1.5",
|
||||
"@llamaindex/mixedbread": "^0.0.19",
|
||||
"@llamaindex/mongodb": "^0.0.20",
|
||||
"@llamaindex/node-parser": "^2.0.5",
|
||||
"@llamaindex/notion": "^0.1.4",
|
||||
"@llamaindex/ollama": "^0.1.5",
|
||||
"@llamaindex/openai": "^0.3.7",
|
||||
"@llamaindex/perplexity": "^0.0.12",
|
||||
"@llamaindex/pinecone": "^0.1.5",
|
||||
"@llamaindex/portkey-ai": "^0.0.47",
|
||||
"@llamaindex/postgres": "^0.0.48",
|
||||
"@llamaindex/qdrant": "^0.1.14",
|
||||
"@llamaindex/readers": "^3.1.3",
|
||||
"@llamaindex/replicate": "^0.0.47",
|
||||
"@llamaindex/supabase": "^0.1.4",
|
||||
"@llamaindex/together": "^0.0.15",
|
||||
"@llamaindex/tools": "^0.0.10",
|
||||
"@llamaindex/upstash": "^0.0.19",
|
||||
"@llamaindex/vercel": "^0.1.5",
|
||||
"@llamaindex/vllm": "^0.0.41",
|
||||
"@llamaindex/voyage-ai": "^1.0.11",
|
||||
"@llamaindex/weaviate": "^0.0.19",
|
||||
"@llamaindex/workflow": "^1.1.2",
|
||||
"@llamaindex/xai": "workspace:^0.0.2",
|
||||
"@llamaindex/firestore": "^1.0.14",
|
||||
"@llamaindex/fireworks": "^0.0.17",
|
||||
"@llamaindex/google": "^0.3.3",
|
||||
"@llamaindex/groq": "^0.0.72",
|
||||
"@llamaindex/huggingface": "^0.1.11",
|
||||
"@llamaindex/jinaai": "^0.0.17",
|
||||
"@llamaindex/milvus": "^0.1.16",
|
||||
"@llamaindex/mistral": "^0.1.7",
|
||||
"@llamaindex/mixedbread": "^0.0.21",
|
||||
"@llamaindex/mongodb": "^0.0.22",
|
||||
"@llamaindex/node-parser": "^2.0.7",
|
||||
"@llamaindex/notion": "^0.1.6",
|
||||
"@llamaindex/ollama": "^0.1.7",
|
||||
"@llamaindex/openai": "^0.4.1",
|
||||
"@llamaindex/perplexity": "^0.0.14",
|
||||
"@llamaindex/pinecone": "^0.1.7",
|
||||
"@llamaindex/portkey-ai": "^0.0.49",
|
||||
"@llamaindex/postgres": "^0.0.50",
|
||||
"@llamaindex/qdrant": "^0.1.16",
|
||||
"@llamaindex/readers": "^3.1.5",
|
||||
"@llamaindex/replicate": "^0.0.49",
|
||||
"@llamaindex/supabase": "^0.1.6",
|
||||
"@llamaindex/together": "^0.0.17",
|
||||
"@llamaindex/tools": "^0.0.12",
|
||||
"@llamaindex/upstash": "^0.0.21",
|
||||
"@llamaindex/vercel": "^0.1.7",
|
||||
"@llamaindex/vllm": "^0.0.43",
|
||||
"@llamaindex/voyage-ai": "^1.0.13",
|
||||
"@llamaindex/weaviate": "^0.0.21",
|
||||
"@llamaindex/workflow": "^1.1.4",
|
||||
"@llamaindex/xai": "workspace:^0.0.4",
|
||||
"@notionhq/client": "^2.2.15",
|
||||
"@pinecone-database/pinecone": "^4.0.0",
|
||||
"@vercel/postgres": "^0.10.0",
|
||||
@@ -64,7 +64,7 @@
|
||||
"commander": "^12.1.0",
|
||||
"dotenv": "^16.4.5",
|
||||
"js-tiktoken": "^1.0.14",
|
||||
"llamaindex": "^0.10.6",
|
||||
"llamaindex": "^0.11.2",
|
||||
"mongodb": "6.7.0",
|
||||
"postgres": "^3.4.4",
|
||||
"wikipedia": "^2.1.2",
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
import { LlamaParseReader } from "@llamaindex/cloud";
|
||||
import { VectorStoreIndex } from "llamaindex";
|
||||
import { openai, OpenAIEmbedding } from "@llamaindex/openai";
|
||||
import { Settings, VectorStoreIndex } from "llamaindex";
|
||||
|
||||
Settings.llm = openai({
|
||||
model: "gpt-4.1",
|
||||
});
|
||||
Settings.embedModel = new OpenAIEmbedding({
|
||||
model: "text-embedding-3-small",
|
||||
});
|
||||
|
||||
async function main() {
|
||||
// Load PDF using LlamaParse
|
||||
|
||||
@@ -2,7 +2,8 @@ import { CollectionReference } from "@google-cloud/firestore";
|
||||
import "dotenv/config";
|
||||
|
||||
import { FirestoreVectorStore } from "@llamaindex/firestore";
|
||||
import { OpenAIEmbedding, Settings } from "llamaindex";
|
||||
import { OpenAIEmbedding } from "@llamaindex/openai";
|
||||
import { Settings } from "llamaindex";
|
||||
|
||||
const indexName = "MovieReviews";
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@ import { CollectionReference } from "@google-cloud/firestore";
|
||||
import { CSVReader } from "@llamaindex/readers/csv";
|
||||
import "dotenv/config";
|
||||
|
||||
import { OpenAIEmbedding } from "@llamaindex/openai";
|
||||
import {
|
||||
OpenAIEmbedding,
|
||||
Settings,
|
||||
storageContextFromDefaults,
|
||||
VectorStoreIndex,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import "dotenv/config";
|
||||
|
||||
import { OpenAIEmbedding, Settings, VectorStoreIndex } from "llamaindex";
|
||||
import { OpenAIEmbedding } from "@llamaindex/openai";
|
||||
import { Settings, VectorStoreIndex } from "llamaindex";
|
||||
|
||||
import { CollectionReference } from "@google-cloud/firestore";
|
||||
import { FirestoreVectorStore } from "@llamaindex/firestore";
|
||||
|
||||
+2
-3
@@ -15,10 +15,9 @@
|
||||
"circular-check": "madge --circular ./packages/**/**/dist/index.js",
|
||||
"release": "pnpm run build && changeset publish",
|
||||
"release-snapshot": "pnpm run build && changeset publish --tag snapshot",
|
||||
"new-version": "changeset version && pnpm postversion && pnpm format:write && pnpm run build",
|
||||
"new-version": "changeset version && pnpm format:write && pnpm run build",
|
||||
"new-snapshot": "pnpm run build && changeset version --snapshot",
|
||||
"lint-staged": "lint-staged",
|
||||
"postversion": "node scripts/repin-workflow.mjs"
|
||||
"lint-staged": "lint-staged"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@changesets/cli": "^2.27.5",
|
||||
|
||||
@@ -1,5 +1,31 @@
|
||||
# @llamaindex/autotool
|
||||
|
||||
## 8.0.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- llamaindex@0.11.3
|
||||
|
||||
## 8.0.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- llamaindex@0.11.2
|
||||
|
||||
## 8.0.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- llamaindex@0.11.1
|
||||
|
||||
## 8.0.0
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [b0cd530]
|
||||
- Updated dependencies [361a685]
|
||||
- llamaindex@0.11.0
|
||||
|
||||
## 7.0.6
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,5 +1,35 @@
|
||||
# @llamaindex/autotool-01-node-example
|
||||
|
||||
## 0.0.111
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- llamaindex@0.11.3
|
||||
- @llamaindex/autotool@8.0.3
|
||||
|
||||
## 0.0.110
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- llamaindex@0.11.2
|
||||
- @llamaindex/autotool@8.0.2
|
||||
|
||||
## 0.0.109
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- llamaindex@0.11.1
|
||||
- @llamaindex/autotool@8.0.1
|
||||
|
||||
## 0.0.108
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [b0cd530]
|
||||
- Updated dependencies [361a685]
|
||||
- llamaindex@0.11.0
|
||||
- @llamaindex/autotool@8.0.0
|
||||
|
||||
## 0.0.107
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -13,5 +13,5 @@
|
||||
"scripts": {
|
||||
"start": "node --import tsx --import @llamaindex/autotool/node ./src/index.ts"
|
||||
},
|
||||
"version": "0.0.107"
|
||||
"version": "0.0.111"
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"url": "git+https://github.com/run-llama/LlamaIndexTS.git",
|
||||
"directory": "packages/autotool"
|
||||
},
|
||||
"version": "7.0.6",
|
||||
"version": "8.0.3",
|
||||
"description": "auto transpile your JS function to LLM Agent compatible",
|
||||
"files": [
|
||||
"dist",
|
||||
|
||||
@@ -1,5 +1,32 @@
|
||||
# @llamaindex/cloud
|
||||
|
||||
## 4.0.11
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 76ff23d: Fix pRetry not working with CommonJS
|
||||
|
||||
## 4.0.10
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [59601dd]
|
||||
- @llamaindex/core@0.6.7
|
||||
|
||||
## 4.0.9
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 3703f90: feat(parse): add upload API
|
||||
|
||||
## 4.0.8
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [680b529]
|
||||
- Updated dependencies [361a685]
|
||||
- @llamaindex/core@0.6.6
|
||||
|
||||
## 4.0.7
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -12,8 +12,13 @@ export default defineConfig({
|
||||
plugins: [
|
||||
...defaultPlugins,
|
||||
"@hey-api/client-fetch",
|
||||
"zod",
|
||||
"@hey-api/schemas",
|
||||
"@hey-api/sdk",
|
||||
{
|
||||
name: "@hey-api/sdk",
|
||||
enums: "javascript",
|
||||
identifierCase: "PascalCase",
|
||||
name: "@hey-api/typescript",
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
+2868
-953
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@llamaindex/cloud",
|
||||
"version": "4.0.7",
|
||||
"version": "4.0.11",
|
||||
"type": "module",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
@@ -37,6 +37,17 @@
|
||||
},
|
||||
"default": "./reader/dist/index.js"
|
||||
},
|
||||
"./parse": {
|
||||
"require": {
|
||||
"types": "./parse/dist/index.d.cts",
|
||||
"default": "./parse/dist/index.cjs"
|
||||
},
|
||||
"import": {
|
||||
"types": "./parse/dist/index.d.ts",
|
||||
"default": "./parse/dist/index.js"
|
||||
},
|
||||
"default": "./parse/dist/index.js"
|
||||
},
|
||||
".": {
|
||||
"require": {
|
||||
"types": "./reader/dist/index.d.cts",
|
||||
@@ -55,16 +66,19 @@
|
||||
"directory": "packages/cloud"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@hey-api/client-fetch": "^0.10.0",
|
||||
"@hey-api/openapi-ts": "^0.66.7",
|
||||
"@hey-api/client-fetch": "^0.10.1",
|
||||
"@hey-api/openapi-ts": "^0.67.5",
|
||||
"@llama-flow/core": "^0.4.1",
|
||||
"@llamaindex/core": "workspace:*",
|
||||
"@llamaindex/env": "workspace:*"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@llama-flow/core": "^0.4.1",
|
||||
"@llamaindex/core": "workspace:*",
|
||||
"@llamaindex/env": "workspace:*"
|
||||
},
|
||||
"dependencies": {
|
||||
"p-retry": "^6.2.1"
|
||||
"p-retry": "^6.2.1",
|
||||
"zod": "^3.25.7"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
import { workflowEvent } from "@llama-flow/core";
|
||||
import { zodEvent } from "@llama-flow/core/util/zod";
|
||||
import { z } from "zod";
|
||||
import { parseFormSchema } from "./schema";
|
||||
|
||||
export const uploadEvent = zodEvent(
|
||||
parseFormSchema.merge(
|
||||
z.object({
|
||||
file: z
|
||||
.string()
|
||||
.or(z.instanceof(File))
|
||||
.or(z.instanceof(Blob))
|
||||
.or(z.instanceof(Uint8Array))
|
||||
.optional()
|
||||
.describe("input"),
|
||||
}),
|
||||
),
|
||||
{
|
||||
debugLabel: "upload",
|
||||
uniqueId: "52099967-34a8-419b-8950-c859eab60145",
|
||||
},
|
||||
);
|
||||
export const checkStatusEvent = workflowEvent<string>({
|
||||
debugLabel: "check-status",
|
||||
uniqueId: "462157fc-1ded-4ba7-9bc4-3e870395bd20",
|
||||
});
|
||||
export const checkStatusSuccessEvent = workflowEvent<string>({
|
||||
debugLabel: "check-status-success",
|
||||
uniqueId: "360b7641-30f7-456e-851d-104bb5e3f8d2",
|
||||
});
|
||||
export const requestMarkdownEvent = workflowEvent<string>({
|
||||
debugLabel: "markdown-request",
|
||||
uniqueId: "aa4c2e3c-0f09-4035-aab6-c72719c877cc",
|
||||
});
|
||||
export const requestTextEvent = workflowEvent<string>({
|
||||
debugLabel: "text-request",
|
||||
uniqueId: "6976536e-5399-4285-9455-0b70f1dfc92b",
|
||||
});
|
||||
export const requestJsonEvent = workflowEvent<string>({
|
||||
debugLabel: "json-request",
|
||||
uniqueId: "9fc4a330-52ad-4aac-8092-a650998b7f6f",
|
||||
});
|
||||
|
||||
export const markdownResultEvent = workflowEvent<string>({
|
||||
debugLabel: "markdown-result",
|
||||
uniqueId: "2dfb57c8-73d1-4394-bea8-f05246d934d4",
|
||||
});
|
||||
export const textResultEvent = workflowEvent<string>({
|
||||
debugLabel: "text-result",
|
||||
uniqueId: "a27deec6-b24f-4eda-a5ac-ba2fb2bf37c8",
|
||||
});
|
||||
export const jsonResultEvent = workflowEvent<unknown>({
|
||||
debugLabel: "json-result",
|
||||
uniqueId: "e086e6bd-a612-4f25-ab41-9b31dcb8af86",
|
||||
});
|
||||
@@ -0,0 +1,225 @@
|
||||
import { createClient, createConfig } from "@hey-api/client-fetch";
|
||||
import { createWorkflow, type InferWorkflowEventData } from "@llama-flow/core";
|
||||
import { createStatefulMiddleware } from "@llama-flow/core/middleware/state";
|
||||
import { withTraceEvents } from "@llama-flow/core/middleware/trace-events";
|
||||
import { pRetryHandler } from "@llama-flow/core/util/p-retry";
|
||||
import { fs, getEnv, path } from "@llamaindex/env";
|
||||
import {
|
||||
type BodyUploadFileApiV1ParsingUploadPost,
|
||||
getJobApiV1ParsingJobJobIdGet,
|
||||
getJobJsonResultApiV1ParsingJobJobIdResultJsonGet,
|
||||
getJobResultApiV1ParsingJobJobIdResultMarkdownGet,
|
||||
getJobTextResultApiV1ParsingJobJobIdResultTextGet,
|
||||
type StatusEnum,
|
||||
uploadFileApiV1ParsingUploadPost,
|
||||
} from "./client";
|
||||
import {
|
||||
checkStatusEvent,
|
||||
checkStatusSuccessEvent,
|
||||
jsonResultEvent,
|
||||
markdownResultEvent,
|
||||
requestJsonEvent,
|
||||
requestMarkdownEvent,
|
||||
requestTextEvent,
|
||||
textResultEvent,
|
||||
uploadEvent,
|
||||
} from "./events";
|
||||
|
||||
export type LlamaParseWorkflowParams = {
|
||||
region?: "us" | "eu" | "us-staging";
|
||||
apiKey?: string;
|
||||
};
|
||||
|
||||
const URLS = {
|
||||
us: "https://api.cloud.llamaindex.ai",
|
||||
eu: "https://api.cloud.eu.llamaindex.ai",
|
||||
"us-staging": "https://api.staging.llamaindex.ai",
|
||||
} as const;
|
||||
|
||||
const { withState, getContext } = createStatefulMiddleware(
|
||||
(params: LlamaParseWorkflowParams) => {
|
||||
const apiKey = params.apiKey ?? getEnv("LLAMA_CLOUD_API_KEY");
|
||||
const region = params.region ?? "us";
|
||||
if (!apiKey) {
|
||||
throw new Error("LLAMA_CLOUD_API_KEY is not set");
|
||||
}
|
||||
return {
|
||||
cache: {} as Record<string, StatusEnum>,
|
||||
client: createClient(
|
||||
createConfig({
|
||||
baseUrl: URLS[region],
|
||||
headers: {
|
||||
Authorization: `Bearer ${apiKey}`,
|
||||
},
|
||||
}),
|
||||
),
|
||||
};
|
||||
},
|
||||
);
|
||||
|
||||
const llamaParseWorkflow = withState(withTraceEvents(createWorkflow()));
|
||||
|
||||
llamaParseWorkflow.handle([uploadEvent], async ({ data: form }) => {
|
||||
const { state } = getContext();
|
||||
const finalForm = { ...form };
|
||||
if ("file" in form) {
|
||||
// support loads from the file system
|
||||
const file = form?.file;
|
||||
const isFilePath = typeof file === "string";
|
||||
const data = isFilePath ? await fs.readFile(file) : file;
|
||||
const filename: string | undefined = isFilePath
|
||||
? path.basename(file)
|
||||
: undefined;
|
||||
finalForm.file = data
|
||||
? globalThis.File && filename
|
||||
? new File([data], filename)
|
||||
: new Blob([data])
|
||||
: undefined;
|
||||
}
|
||||
const {
|
||||
data: { id, status },
|
||||
} = await uploadFileApiV1ParsingUploadPost({
|
||||
throwOnError: true,
|
||||
body: {
|
||||
...finalForm,
|
||||
} as BodyUploadFileApiV1ParsingUploadPost,
|
||||
client: state.client,
|
||||
});
|
||||
state.cache[id] = status;
|
||||
return checkStatusEvent.with(id);
|
||||
});
|
||||
|
||||
llamaParseWorkflow.handle(
|
||||
[checkStatusEvent],
|
||||
pRetryHandler(
|
||||
async ({ data: uuid }) => {
|
||||
const { state } = getContext();
|
||||
if (state.cache[uuid] === "SUCCESS") {
|
||||
return checkStatusSuccessEvent.with(uuid);
|
||||
}
|
||||
const {
|
||||
data: { status },
|
||||
} = await getJobApiV1ParsingJobJobIdGet({
|
||||
throwOnError: true,
|
||||
path: {
|
||||
job_id: uuid,
|
||||
},
|
||||
client: state.client,
|
||||
});
|
||||
state.cache[uuid] = status;
|
||||
if (status === "SUCCESS") {
|
||||
return checkStatusSuccessEvent.with(uuid);
|
||||
}
|
||||
throw new Error(`LLamaParse status: ${status}`);
|
||||
},
|
||||
{
|
||||
retries: 100,
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
//#region sub workflow
|
||||
llamaParseWorkflow.handle([requestMarkdownEvent], async ({ data: job_id }) => {
|
||||
const { state } = getContext();
|
||||
const { data } = await getJobResultApiV1ParsingJobJobIdResultMarkdownGet({
|
||||
throwOnError: true,
|
||||
path: {
|
||||
job_id,
|
||||
},
|
||||
client: state.client,
|
||||
});
|
||||
return markdownResultEvent.with(data.markdown);
|
||||
});
|
||||
|
||||
llamaParseWorkflow.handle([requestTextEvent], async ({ data: job_id }) => {
|
||||
const { state } = getContext();
|
||||
const { data } = await getJobTextResultApiV1ParsingJobJobIdResultTextGet({
|
||||
throwOnError: true,
|
||||
path: {
|
||||
job_id,
|
||||
},
|
||||
client: state.client,
|
||||
});
|
||||
return textResultEvent.with(data.text);
|
||||
});
|
||||
|
||||
llamaParseWorkflow.handle([requestJsonEvent], async ({ data: job_id }) => {
|
||||
const { state } = getContext();
|
||||
const { data } = await getJobJsonResultApiV1ParsingJobJobIdResultJsonGet({
|
||||
throwOnError: true,
|
||||
path: {
|
||||
job_id,
|
||||
},
|
||||
client: state.client,
|
||||
});
|
||||
return jsonResultEvent.with(data.pages);
|
||||
});
|
||||
//#endregion
|
||||
|
||||
export type ParseJob = {
|
||||
get jobId(): string;
|
||||
get signal(): AbortSignal;
|
||||
get context(): ReturnType<typeof llamaParseWorkflow.createContext>;
|
||||
get form(): InferWorkflowEventData<typeof uploadEvent>;
|
||||
|
||||
markdown(): Promise<string>;
|
||||
text(): Promise<string>;
|
||||
//eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
json(): Promise<any[]>;
|
||||
};
|
||||
|
||||
export const upload = async (
|
||||
params: InferWorkflowEventData<typeof uploadEvent> & LlamaParseWorkflowParams,
|
||||
): Promise<ParseJob> => {
|
||||
//#region upload event
|
||||
const context = llamaParseWorkflow.createContext(params);
|
||||
const { stream, sendEvent } = context;
|
||||
const ev = uploadEvent.with(params);
|
||||
sendEvent(ev);
|
||||
|
||||
const uploadThread = await llamaParseWorkflow
|
||||
.substream(ev, stream)
|
||||
.until((ev) => checkStatusSuccessEvent.include(ev))
|
||||
.toArray();
|
||||
//#region
|
||||
const jobId: string = uploadThread.at(-1)!.data;
|
||||
return {
|
||||
get signal() {
|
||||
// lazy load
|
||||
return context.signal;
|
||||
},
|
||||
get jobId() {
|
||||
return jobId;
|
||||
},
|
||||
get form() {
|
||||
return ev.data;
|
||||
},
|
||||
get context() {
|
||||
return context;
|
||||
},
|
||||
async markdown(): Promise<string> {
|
||||
const requestEv = requestMarkdownEvent.with(jobId);
|
||||
const { sendEvent, stream } = llamaParseWorkflow.createContext(params);
|
||||
sendEvent(requestEv);
|
||||
const markdownThread = await stream.until(markdownResultEvent).toArray();
|
||||
return markdownThread.at(-1)!.data;
|
||||
},
|
||||
async text(): Promise<string> {
|
||||
const requestEv = requestTextEvent.with(jobId);
|
||||
const { sendEvent, stream } = llamaParseWorkflow.createContext(params);
|
||||
sendEvent(requestEv);
|
||||
const textThread = await stream.until(textResultEvent).toArray();
|
||||
return textThread.at(-1)!.data;
|
||||
},
|
||||
//eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
async json(): Promise<any[]> {
|
||||
const requestEv = requestJsonEvent.with(jobId);
|
||||
const { sendEvent, stream } = llamaParseWorkflow.createContext(params);
|
||||
sendEvent(requestEv);
|
||||
const jsonThread = await stream
|
||||
.until((ev) => jsonResultEvent.include(ev))
|
||||
.toArray();
|
||||
return jsonThread.at(-1)!.data;
|
||||
},
|
||||
};
|
||||
};
|
||||
@@ -2,7 +2,6 @@
|
||||
import { type Client, createClient, createConfig } from "@hey-api/client-fetch";
|
||||
import { Document, FileReader } from "@llamaindex/core/schema";
|
||||
import { fs, getEnv, path } from "@llamaindex/env";
|
||||
import pRetry from "p-retry";
|
||||
import {
|
||||
type BodyUploadFileApiParsingUploadPost,
|
||||
type FailPageMode,
|
||||
@@ -391,6 +390,7 @@ export class LlamaParseReader extends FileReader {
|
||||
): Promise<any> {
|
||||
let tries = 0;
|
||||
let currentInterval = this.checkInterval;
|
||||
const { default: pRetry } = await import("p-retry");
|
||||
|
||||
while (true) {
|
||||
await sleep(currentInterval * 1000);
|
||||
|
||||
@@ -0,0 +1,131 @@
|
||||
import { FailPageMode, ParserLanguages, ParsingMode } from "./client";
|
||||
|
||||
import { z } from "zod";
|
||||
|
||||
type Language = ParserLanguages;
|
||||
const VALUES: [Language, ...Language[]] = [
|
||||
ParserLanguages.EN,
|
||||
...Object.values(ParserLanguages),
|
||||
];
|
||||
const languageSchema = z.enum(VALUES);
|
||||
|
||||
const PARSE_PRESETS = [
|
||||
"fast",
|
||||
"balanced",
|
||||
"premium",
|
||||
"structured",
|
||||
"auto",
|
||||
"scientific",
|
||||
"invoice",
|
||||
"slides",
|
||||
"_carlyle",
|
||||
] as const;
|
||||
|
||||
export const parsePresetSchema = z.enum(PARSE_PRESETS);
|
||||
|
||||
export const parseFormSchema = z.object({
|
||||
adaptive_long_table: z.boolean().optional(),
|
||||
annotate_links: z.boolean().optional(),
|
||||
auto_mode: z.boolean().optional(),
|
||||
auto_mode_trigger_on_image_in_page: z.boolean().optional(),
|
||||
auto_mode_trigger_on_table_in_page: z.boolean().optional(),
|
||||
auto_mode_trigger_on_text_in_page: z.string().optional(),
|
||||
auto_mode_trigger_on_regexp_in_page: z.string().optional(),
|
||||
auto_mode_configuration_json: z.string().optional(),
|
||||
azure_openai_api_version: z.string().optional(),
|
||||
azure_openai_deployment_name: z.string().optional(),
|
||||
azure_openai_endpoint: z.string().optional(),
|
||||
azure_openai_key: z.string().optional(),
|
||||
bbox_bottom: z.number().min(0).max(1).optional(),
|
||||
bbox_left: z.number().min(0).max(1).optional(),
|
||||
bbox_right: z.number().min(0).max(1).optional(),
|
||||
bbox_top: z.number().min(0).max(1).optional(),
|
||||
disable_ocr: z.boolean().optional(),
|
||||
disable_reconstruction: z.boolean().optional(),
|
||||
disable_image_extraction: z.boolean().optional(),
|
||||
do_not_cache: z.coerce.boolean().optional(),
|
||||
do_not_unroll_columns: z.coerce.boolean().optional(),
|
||||
extract_charts: z.boolean().optional(),
|
||||
guess_xlsx_sheet_name: z.boolean().optional(),
|
||||
html_make_all_elements_visible: z.boolean().optional(),
|
||||
html_remove_fixed_elements: z.boolean().optional(),
|
||||
html_remove_navigation_elements: z.boolean().optional(),
|
||||
http_proxy: z
|
||||
.string()
|
||||
.url(
|
||||
'Set a valid URL for the HTTP proxy, e.g., "http://proxy.example.com:8080"',
|
||||
)
|
||||
.refine(
|
||||
(url) => {
|
||||
try {
|
||||
const parsedUrl = new URL(url);
|
||||
return (
|
||||
parsedUrl.protocol === "http:" || parsedUrl.protocol === "https:"
|
||||
);
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
{
|
||||
message: "Invalid HTTP proxy URL",
|
||||
},
|
||||
)
|
||||
.optional(),
|
||||
input_s3_path: z.string().optional(),
|
||||
input_s3_region: z.string().optional(),
|
||||
input_url: z.string().optional(),
|
||||
invalidate_cache: z.boolean().optional(),
|
||||
language: z.array(languageSchema).optional(),
|
||||
extract_layout: z.boolean().optional(),
|
||||
max_pages: z.number().nullable().optional(),
|
||||
output_pdf_of_document: z.boolean().optional(),
|
||||
output_s3_path_prefix: z.string().optional(),
|
||||
output_s3_region: z.string().optional(),
|
||||
page_prefix: z.string().optional(),
|
||||
page_separator: z.string().optional(),
|
||||
page_suffix: z.string().optional(),
|
||||
preserve_layout_alignment_across_pages: z.boolean().optional(),
|
||||
skip_diagonal_text: z.boolean().optional(),
|
||||
spreadsheet_extract_sub_tables: z.boolean().optional(),
|
||||
structured_output: z.boolean().optional(),
|
||||
structured_output_json_schema: z.string().optional(),
|
||||
structured_output_json_schema_name: z.string().optional(),
|
||||
take_screenshot: z.boolean().optional(),
|
||||
target_pages: z.string().optional(),
|
||||
vendor_multimodal_api_key: z.string().optional(),
|
||||
vendor_multimodal_model_name: z.string().optional(),
|
||||
model: z.string().optional(),
|
||||
webhook_url: z.string().url().optional(),
|
||||
parse_mode: z.nativeEnum(ParsingMode).nullable().optional(),
|
||||
system_prompt: z.string().optional(),
|
||||
system_prompt_append: z.string().optional(),
|
||||
user_prompt: z.string().optional(),
|
||||
job_timeout_in_seconds: z.number().optional(),
|
||||
job_timeout_extra_time_per_page_in_seconds: z.number().optional(),
|
||||
strict_mode_image_extraction: z.boolean().optional(),
|
||||
strict_mode_image_ocr: z.boolean().optional(),
|
||||
strict_mode_reconstruction: z.boolean().optional(),
|
||||
strict_mode_buggy_font: z.boolean().optional(),
|
||||
save_images: z.boolean().optional(),
|
||||
ignore_document_elements_for_layout_detection: z.boolean().optional(),
|
||||
output_tables_as_HTML: z.boolean().optional(),
|
||||
use_vendor_multimodal_model: z.boolean().optional(),
|
||||
bounding_box: z.string().optional(),
|
||||
gpt4o_mode: z.boolean().optional(),
|
||||
gpt4o_api_key: z.string().optional(),
|
||||
complemental_formatting_instruction: z.string().optional(),
|
||||
content_guideline_instruction: z.string().optional(),
|
||||
premium_mode: z.boolean().optional(),
|
||||
is_formatting_instruction: z.boolean().optional(),
|
||||
continuous_mode: z.boolean().optional(),
|
||||
parsing_instruction: z.string().optional(),
|
||||
fast_mode: z.boolean().optional(),
|
||||
formatting_instruction: z.string().optional(),
|
||||
preset: parsePresetSchema.optional(),
|
||||
compact_markdown_table: z.boolean().optional(),
|
||||
markdown_table_multiline_header_separator: z.string().optional(),
|
||||
page_error_tolerance: z.number().min(0).max(1).optional(),
|
||||
replace_failed_page_mode: z.nativeEnum(FailPageMode).nullable().optional(),
|
||||
replace_failed_page_with_error_message_prefix: z.string().optional(),
|
||||
replace_failed_page_with_error_message_suffix: z.string().optional(),
|
||||
});
|
||||
@@ -1,5 +1,18 @@
|
||||
# @llamaindex/core
|
||||
|
||||
## 0.6.7
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 59601dd: Add support for builtin image generation tool
|
||||
|
||||
## 0.6.6
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 680b529: Remove requireContext from tools - better use binding to pass context
|
||||
- 361a685: Remove old workflows - use @llamaindex/workflow package
|
||||
|
||||
## 0.6.5
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@llamaindex/core",
|
||||
"type": "module",
|
||||
"version": "0.6.5",
|
||||
"version": "0.6.7",
|
||||
"description": "LlamaIndex Core Module",
|
||||
"exports": {
|
||||
"./agent": {
|
||||
|
||||
@@ -9,7 +9,7 @@ export function getEmbeddedModel(): BaseEmbedding {
|
||||
embeddedModelAsyncLocalStorage.getStore() ?? globalEmbeddedModel;
|
||||
if (!currentEmbeddedModel) {
|
||||
throw new Error(
|
||||
"Cannot find Embedding, please set `Settings.embedModel = ...` on the top of your code",
|
||||
"Cannot find Embedding, please set `Settings.embedModel = ...` on the top of your code. Check https://ts.llamaindex.ai/docs/llamaindex/modules/models/embeddings for details.",
|
||||
);
|
||||
}
|
||||
return currentEmbeddedModel;
|
||||
|
||||
@@ -8,7 +8,7 @@ export function getLLM(): LLM {
|
||||
const currentLLM = llmAsyncLocalStorage.getStore() ?? globalLLM;
|
||||
if (!currentLLM) {
|
||||
throw new Error(
|
||||
"Cannot find LLM, please set `Settings.llm = ...` on the top of your code",
|
||||
"Cannot find LLM, please set `Settings.llm = ...` on the top of your code. Check https://ts.llamaindex.ai/docs/llamaindex/modules/models/llms for details.",
|
||||
);
|
||||
}
|
||||
return currentLLM;
|
||||
|
||||
@@ -36,3 +36,4 @@ export type {
|
||||
ToolResult,
|
||||
ToolResultOptions,
|
||||
} from "./type";
|
||||
export { addContentPart } from "./utils";
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
import type {
|
||||
ChatMessage,
|
||||
MessageContentImageDataDetail,
|
||||
MessageContentTextDetail,
|
||||
} from "./type";
|
||||
|
||||
export function addContentPart<AdditionalMessageOptions extends object>(
|
||||
message: ChatMessage<AdditionalMessageOptions>,
|
||||
part: MessageContentTextDetail | MessageContentImageDataDetail,
|
||||
): void {
|
||||
if (part.type === "text") {
|
||||
if (typeof message.content === "string") {
|
||||
message.content += part.text;
|
||||
} else {
|
||||
message.content.push(part);
|
||||
}
|
||||
} else {
|
||||
if (typeof message.content === "string") {
|
||||
if (message.content === "") {
|
||||
message.content = [part];
|
||||
} else {
|
||||
message.content = [{ type: "text", text: message.content }, part];
|
||||
}
|
||||
} else {
|
||||
message.content.push(part);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,31 @@
|
||||
# @llamaindex/experimental
|
||||
|
||||
## 0.0.180
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- llamaindex@0.11.3
|
||||
|
||||
## 0.0.179
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- llamaindex@0.11.2
|
||||
|
||||
## 0.0.178
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- llamaindex@0.11.1
|
||||
|
||||
## 0.0.177
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [b0cd530]
|
||||
- Updated dependencies [361a685]
|
||||
- llamaindex@0.11.0
|
||||
|
||||
## 0.0.176
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@llamaindex/experimental",
|
||||
"description": "Experimental package for LlamaIndexTS",
|
||||
"version": "0.0.176",
|
||||
"version": "0.0.180",
|
||||
"type": "module",
|
||||
"types": "dist/type/index.d.ts",
|
||||
"main": "dist/cjs/index.js",
|
||||
|
||||
@@ -1,5 +1,54 @@
|
||||
# llamaindex
|
||||
|
||||
## 0.11.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [76ff23d]
|
||||
- @llamaindex/cloud@4.0.11
|
||||
|
||||
## 0.11.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [59601dd]
|
||||
- @llamaindex/core@0.6.7
|
||||
- @llamaindex/cloud@4.0.10
|
||||
- @llamaindex/node-parser@2.0.7
|
||||
- @llamaindex/workflow@1.1.4
|
||||
|
||||
## 0.11.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [3703f90]
|
||||
- @llamaindex/cloud@4.0.9
|
||||
|
||||
## 0.11.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- b0cd530: # Breaking Change
|
||||
|
||||
## What Changed
|
||||
|
||||
Remove default setting of llm and embedModel in Settings
|
||||
|
||||
## Migration Guide
|
||||
|
||||
Set the llm provider and embed Model in the top of your code using Settings.llm = and Settings.embedModel
|
||||
|
||||
- 361a685: Remove old workflows - use @llamaindex/workflow package
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [680b529]
|
||||
- Updated dependencies [361a685]
|
||||
- @llamaindex/workflow@1.1.3
|
||||
- @llamaindex/core@0.6.6
|
||||
- @llamaindex/cloud@4.0.8
|
||||
- @llamaindex/node-parser@2.0.6
|
||||
|
||||
## 0.10.6
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "llamaindex",
|
||||
"version": "0.10.6",
|
||||
"version": "0.11.3",
|
||||
"license": "MIT",
|
||||
"type": "module",
|
||||
"keywords": [
|
||||
@@ -24,7 +24,7 @@
|
||||
"@llamaindex/core": "workspace:*",
|
||||
"@llamaindex/env": "workspace:*",
|
||||
"@llamaindex/node-parser": "workspace:*",
|
||||
"@llamaindex/openai": "workspace:*",
|
||||
"@llamaindex/workflow": "1.0.3",
|
||||
"@types/lodash": "^4.17.7",
|
||||
"@types/node": "^22.9.0",
|
||||
"ajv": "^8.17.1",
|
||||
|
||||
@@ -8,8 +8,8 @@ import {
|
||||
import type { QueryType } from "@llamaindex/core/query-engine";
|
||||
import type { BaseOutputParser } from "@llamaindex/core/schema";
|
||||
import { extractText, toToolDescriptions } from "@llamaindex/core/utils";
|
||||
import { OpenAI } from "@llamaindex/openai";
|
||||
import { SubQuestionOutputParser } from "./OutputParser.js";
|
||||
import { Settings } from "./Settings.js";
|
||||
import type {
|
||||
BaseQuestionGenerator,
|
||||
SubQuestion,
|
||||
@@ -30,7 +30,7 @@ export class LLMQuestionGenerator
|
||||
constructor(init?: Partial<LLMQuestionGenerator>) {
|
||||
super();
|
||||
|
||||
this.llm = init?.llm ?? new OpenAI();
|
||||
this.llm = init?.llm ?? Settings.llm;
|
||||
this.prompt = init?.prompt ?? defaultSubQuestionPrompt;
|
||||
this.outputParser = init?.outputParser ?? new SubQuestionOutputParser();
|
||||
}
|
||||
|
||||
@@ -1,73 +0,0 @@
|
||||
import type {
|
||||
NonStreamingChatEngineParams,
|
||||
StreamingChatEngineParams,
|
||||
} from "@llamaindex/core/chat-engine";
|
||||
import type { MessageContent } from "@llamaindex/core/llms";
|
||||
import type { BaseRetriever } from "@llamaindex/core/retriever";
|
||||
import { EngineResponse, MetadataMode } from "@llamaindex/core/schema";
|
||||
import { OpenAIAgent, type OpenAIAgentParams } from "@llamaindex/openai";
|
||||
|
||||
export interface ContextAwareConfig {
|
||||
contextRetriever: BaseRetriever;
|
||||
}
|
||||
|
||||
export interface ContextAwareState {
|
||||
contextRetriever: BaseRetriever;
|
||||
retrievedContext: string | null;
|
||||
}
|
||||
|
||||
// TODO: support any LLMAgent
|
||||
export type SupportedAgent = typeof OpenAIAgent;
|
||||
export type AgentParams = OpenAIAgentParams;
|
||||
|
||||
/**
|
||||
* ContextAwareAgentRunner enhances the base AgentRunner with the ability to retrieve and inject relevant context
|
||||
* for each query. This allows the agent to access and utilize appropriate information from a given index or retriever,
|
||||
* providing more informed and context-specific responses to user queries.
|
||||
*/
|
||||
export function withContextAwareness(Base: SupportedAgent) {
|
||||
return class ContextAwareAgent extends Base {
|
||||
public readonly contextRetriever: BaseRetriever;
|
||||
public retrievedContext: string | null = null;
|
||||
|
||||
constructor(params: AgentParams & ContextAwareConfig) {
|
||||
super(params);
|
||||
this.contextRetriever = params.contextRetriever;
|
||||
}
|
||||
|
||||
async retrieveContext(query: MessageContent): Promise<string> {
|
||||
const nodes = await this.contextRetriever.retrieve({ query });
|
||||
return nodes
|
||||
.map((node) => node.node.getContent(MetadataMode.NONE))
|
||||
.join("\n");
|
||||
}
|
||||
|
||||
async injectContext(context: string): Promise<void> {
|
||||
const systemMessage = this.chatHistory.find(
|
||||
(msg) => msg.role === "system",
|
||||
);
|
||||
if (systemMessage) {
|
||||
systemMessage.content = `${context}\n\n${systemMessage.content}`;
|
||||
} else {
|
||||
this.chatHistory.unshift({ role: "system", content: context });
|
||||
}
|
||||
}
|
||||
|
||||
async chat(params: NonStreamingChatEngineParams): Promise<EngineResponse>;
|
||||
async chat(
|
||||
params: StreamingChatEngineParams,
|
||||
): Promise<ReadableStream<EngineResponse>>;
|
||||
async chat(
|
||||
params: NonStreamingChatEngineParams | StreamingChatEngineParams,
|
||||
): Promise<EngineResponse | ReadableStream<EngineResponse>> {
|
||||
const context = await this.retrieveContext(params.message);
|
||||
await this.injectContext(context);
|
||||
|
||||
if ("stream" in params && params.stream === true) {
|
||||
return super.chat(params);
|
||||
} else {
|
||||
return super.chat(params as NonStreamingChatEngineParams);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
export * from "@llamaindex/core/agent";
|
||||
|
||||
export { OpenAIContextAwareAgent } from "./openai.js";
|
||||
export {
|
||||
ReACTAgentWorker,
|
||||
ReActAgent,
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
import { OpenAIAgent } from "@llamaindex/openai";
|
||||
import { withContextAwareness } from "./contextAwareMixin.js";
|
||||
|
||||
export const OpenAIContextAwareAgent = withContextAwareness(OpenAIAgent);
|
||||
export type { ContextAwareConfig } from "./contextAwareMixin.js";
|
||||
|
||||
export * from "@llamaindex/openai";
|
||||
@@ -14,7 +14,7 @@ import {
|
||||
} from "@llamaindex/core/prompts";
|
||||
import type { BaseNode } from "@llamaindex/core/schema";
|
||||
import { MetadataMode, TextNode } from "@llamaindex/core/schema";
|
||||
import { OpenAI } from "@llamaindex/openai";
|
||||
import { Settings } from "../Settings.js";
|
||||
import { BaseExtractor } from "./types.js";
|
||||
|
||||
const STRIP_REGEX = /(\r\n|\n|\r)/gm;
|
||||
@@ -64,7 +64,7 @@ export class KeywordExtractor extends BaseExtractor {
|
||||
|
||||
super();
|
||||
|
||||
this.llm = options?.llm ?? new OpenAI();
|
||||
this.llm = options?.llm ?? Settings.llm;
|
||||
this.keywords = options?.keywords ?? 5;
|
||||
this.promptTemplate = options?.promptTemplate
|
||||
? new PromptTemplate({
|
||||
@@ -170,7 +170,7 @@ export class TitleExtractor extends BaseExtractor {
|
||||
constructor(options?: TitleExtractorsArgs) {
|
||||
super();
|
||||
|
||||
this.llm = options?.llm ?? new OpenAI();
|
||||
this.llm = options?.llm ?? Settings.llm;
|
||||
this.nodes = options?.nodes ?? 5;
|
||||
|
||||
this.nodeTemplate = options?.nodeTemplate
|
||||
@@ -330,7 +330,7 @@ export class QuestionsAnsweredExtractor extends BaseExtractor {
|
||||
|
||||
super();
|
||||
|
||||
this.llm = options?.llm ?? new OpenAI();
|
||||
this.llm = options?.llm ?? Settings.llm;
|
||||
this.questions = options?.questions ?? 5;
|
||||
this.promptTemplate = options?.promptTemplate
|
||||
? new PromptTemplate({
|
||||
@@ -436,7 +436,7 @@ export class SummaryExtractor extends BaseExtractor {
|
||||
|
||||
super();
|
||||
|
||||
this.llm = options?.llm ?? new OpenAI();
|
||||
this.llm = options?.llm ?? Settings.llm;
|
||||
this.summaries = summaries;
|
||||
this.promptTemplate = options?.promptTemplate
|
||||
? new PromptTemplate({
|
||||
|
||||
@@ -1,17 +1,6 @@
|
||||
//#region initial setup for OpenAI
|
||||
import { OpenAI, OpenAIEmbedding } from "@llamaindex/openai";
|
||||
import { Settings } from "./Settings.js";
|
||||
|
||||
try {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
||||
Settings.llm;
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
||||
Settings.embedModel;
|
||||
} catch {
|
||||
Settings.llm = new OpenAI();
|
||||
Settings.embedModel = new OpenAIEmbedding();
|
||||
}
|
||||
|
||||
//#endregion
|
||||
|
||||
export {
|
||||
@@ -67,7 +56,6 @@ export { BaseDocumentStore } from "@llamaindex/core/storage/doc-store"; // expli
|
||||
export * from "@llamaindex/core/storage/index-store";
|
||||
export * from "@llamaindex/core/storage/kv-store";
|
||||
export * from "@llamaindex/core/utils";
|
||||
export * from "@llamaindex/openai";
|
||||
export * from "./agent/index.js";
|
||||
export * from "./cloud/index.js";
|
||||
export * from "./engines/index.js";
|
||||
|
||||
@@ -1,5 +1,29 @@
|
||||
# @llamaindex/core-test
|
||||
|
||||
## 0.1.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [59601dd]
|
||||
- @llamaindex/openai@0.4.1
|
||||
|
||||
## 0.1.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- b0cd530: # Breaking Change
|
||||
|
||||
## What Changed
|
||||
|
||||
Remove default setting of llm and embedModel in Settings
|
||||
|
||||
## Migration Guide
|
||||
|
||||
Set the llm provider and embed Model in the top of your code using Settings.llm = and Settings.embedModel
|
||||
|
||||
- Updated dependencies [3e66ddc]
|
||||
- @llamaindex/openai@0.4.0
|
||||
|
||||
## 0.1.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { OpenAIEmbedding, SimilarityType, similarity } from "llamaindex";
|
||||
import { OpenAIEmbedding } from "@llamaindex/openai";
|
||||
import { SimilarityType, similarity } from "llamaindex";
|
||||
import { beforeAll, describe, expect, test } from "vitest";
|
||||
import { mockEmbeddingModel } from "./utility/mockOpenAI.js";
|
||||
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Document } from "@llamaindex/core/schema";
|
||||
import { OpenAI, OpenAIEmbedding } from "@llamaindex/openai";
|
||||
import {
|
||||
KeywordExtractor,
|
||||
OpenAI,
|
||||
OpenAIEmbedding,
|
||||
QuestionsAnsweredExtractor,
|
||||
SentenceSplitter,
|
||||
Settings,
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { describe, expect, test } from "vitest";
|
||||
// from unittest.mock import patch
|
||||
|
||||
import { LLMSingleSelector, OpenAI } from "llamaindex";
|
||||
import { OpenAI } from "@llamaindex/openai";
|
||||
import { LLMSingleSelector } from "llamaindex";
|
||||
import { mocStructuredkLlmGeneration } from "./utility/mockOpenAI.js";
|
||||
|
||||
describe("LLMSelector", () => {
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
import { storageContextFromDefaults, type StorageContext } from "llamaindex";
|
||||
import { OpenAIEmbedding } from "@llamaindex/openai";
|
||||
import {
|
||||
Settings,
|
||||
storageContextFromDefaults,
|
||||
type StorageContext,
|
||||
} from "llamaindex";
|
||||
import { existsSync, rmSync } from "node:fs";
|
||||
import { mkdtemp } from "node:fs/promises";
|
||||
import { tmpdir } from "node:os";
|
||||
@@ -19,6 +24,7 @@ describe("StorageContext", () => {
|
||||
let storageContext: StorageContext;
|
||||
|
||||
beforeAll(async () => {
|
||||
Settings.embedModel = new OpenAIEmbedding();
|
||||
storageContext = await storageContextFromDefaults({
|
||||
persistDir: testDir,
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { OpenAIEmbedding } from "@llamaindex/openai";
|
||||
import {
|
||||
Document,
|
||||
OpenAIEmbedding,
|
||||
Settings,
|
||||
SummaryIndex,
|
||||
VectorStoreIndex,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { OpenAIEmbedding } from "@llamaindex/openai";
|
||||
import type { StorageContext } from "llamaindex";
|
||||
import {
|
||||
DocStoreStrategy,
|
||||
Document,
|
||||
OpenAIEmbedding,
|
||||
Settings,
|
||||
VectorStoreIndex,
|
||||
} from "llamaindex";
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
import { expect, test, vi } from "vitest";
|
||||
|
||||
test("init without error", async () => {
|
||||
vi.stubEnv("OPENAI_API_KEY", undefined);
|
||||
const { Settings } = await import("llamaindex");
|
||||
expect(Settings.llm).toBeDefined();
|
||||
});
|
||||
@@ -1,7 +1,7 @@
|
||||
import { OpenAIEmbedding } from "@llamaindex/openai";
|
||||
import {
|
||||
FunctionTool,
|
||||
ObjectIndex,
|
||||
OpenAIEmbedding,
|
||||
Settings,
|
||||
SimpleToolNodeMapping,
|
||||
VectorStoreIndex,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@llamaindex/llamaindex-test",
|
||||
"private": true,
|
||||
"version": "0.1.0",
|
||||
"version": "0.1.2",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"test": "vitest run"
|
||||
@@ -9,5 +9,8 @@
|
||||
"devDependencies": {
|
||||
"llamaindex": "workspace:*",
|
||||
"vitest": "^2.1.5"
|
||||
},
|
||||
"dependencies": {
|
||||
"@llamaindex/openai": "workspace:*"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import type { CallbackManager } from "@llamaindex/core/global";
|
||||
import type { LLMChatParamsBase, OpenAIEmbedding } from "llamaindex";
|
||||
import { OpenAI, Settings } from "llamaindex";
|
||||
import { OpenAI, OpenAIEmbedding } from "@llamaindex/openai";
|
||||
import type { LLMChatParamsBase } from "llamaindex";
|
||||
import { Settings } from "llamaindex";
|
||||
import { vi } from "vitest";
|
||||
|
||||
export const DEFAULT_LLM_TEXT_OUTPUT = "MOCK_TOKEN_1-MOCK_TOKEN_2";
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
import {
|
||||
BaseEmbedding,
|
||||
OpenAIEmbedding,
|
||||
storageContextFromDefaults,
|
||||
} from "llamaindex";
|
||||
import { OpenAIEmbedding } from "@llamaindex/openai";
|
||||
import { BaseEmbedding, storageContextFromDefaults } from "llamaindex";
|
||||
|
||||
import { mockEmbeddingModel } from "./mockOpenAI.js";
|
||||
|
||||
|
||||
@@ -1,5 +1,20 @@
|
||||
# @llamaindex/node-parser
|
||||
|
||||
## 2.0.7
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [59601dd]
|
||||
- @llamaindex/core@0.6.7
|
||||
|
||||
## 2.0.6
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [680b529]
|
||||
- Updated dependencies [361a685]
|
||||
- @llamaindex/core@0.6.6
|
||||
|
||||
## 2.0.5
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@llamaindex/node-parser",
|
||||
"version": "2.0.5",
|
||||
"version": "2.0.7",
|
||||
"description": "Node parser for LlamaIndex",
|
||||
"type": "module",
|
||||
"exports": {
|
||||
|
||||
@@ -1,5 +1,26 @@
|
||||
# @llamaindex/anthropic
|
||||
|
||||
## 0.3.9
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 5cdab12: Add Claude Sonnet 4 and Clause Opus 4 models
|
||||
|
||||
## 0.3.8
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [59601dd]
|
||||
- @llamaindex/core@0.6.7
|
||||
|
||||
## 0.3.7
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [680b529]
|
||||
- Updated dependencies [361a685]
|
||||
- @llamaindex/core@0.6.6
|
||||
|
||||
## 0.3.6
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@llamaindex/anthropic",
|
||||
"description": "Anthropic Adapter for LlamaIndex",
|
||||
"version": "0.3.6",
|
||||
"version": "0.3.9",
|
||||
"type": "module",
|
||||
"main": "./dist/index.cjs",
|
||||
"module": "./dist/index.js",
|
||||
|
||||
@@ -112,11 +112,19 @@ export const ALL_AVAILABLE_V3_7_MODELS = {
|
||||
"claude-3-7-sonnet-latest": { contextWindow: 200000 },
|
||||
};
|
||||
|
||||
export const ALL_AVAILABLE_V4_MODELS = {
|
||||
"claude-4-0-sonnet": { contextWindow: 200000 },
|
||||
"claude-4-sonnet-20240514": { contextWindow: 200000 },
|
||||
"claude-4-0-opus": { contextWindow: 200000 },
|
||||
"claude-4-opus-20240514": { contextWindow: 200000 },
|
||||
};
|
||||
|
||||
export const ALL_AVAILABLE_ANTHROPIC_MODELS = {
|
||||
...ALL_AVAILABLE_ANTHROPIC_LEGACY_MODELS,
|
||||
...ALL_AVAILABLE_V3_MODELS,
|
||||
...ALL_AVAILABLE_V3_5_MODELS,
|
||||
...ALL_AVAILABLE_V3_7_MODELS,
|
||||
...ALL_AVAILABLE_V4_MODELS,
|
||||
} satisfies {
|
||||
[key in Model]: { contextWindow: number };
|
||||
};
|
||||
@@ -127,6 +135,8 @@ const AVAILABLE_ANTHROPIC_MODELS_WITHOUT_DATE: { [key: string]: string } = {
|
||||
"claude-3-haiku": "claude-3-haiku-20240307",
|
||||
"claude-3-5-sonnet": "claude-3-5-sonnet-20240620",
|
||||
"claude-3-7-sonnet": "claude-3-7-sonnet-20250219",
|
||||
"claude-4-0-sonnet": "claude-sonnet-4-20250514",
|
||||
"claude-4-0-opus": "claude-opus-4-20250514",
|
||||
} as { [key in keyof typeof ALL_AVAILABLE_ANTHROPIC_MODELS]: string };
|
||||
|
||||
export type AnthropicAdditionalChatOptions = Pick<
|
||||
|
||||
@@ -1,5 +1,20 @@
|
||||
# @llamaindex/assemblyai
|
||||
|
||||
## 0.1.6
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [59601dd]
|
||||
- @llamaindex/core@0.6.7
|
||||
|
||||
## 0.1.5
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [680b529]
|
||||
- Updated dependencies [361a685]
|
||||
- @llamaindex/core@0.6.6
|
||||
|
||||
## 0.1.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@llamaindex/assemblyai",
|
||||
"description": "AssemblyAI Reader for LlamaIndex",
|
||||
"version": "0.1.4",
|
||||
"version": "0.1.6",
|
||||
"type": "module",
|
||||
"types": "dist/index.d.ts",
|
||||
"main": "dist/index.cjs",
|
||||
|
||||
@@ -1,5 +1,26 @@
|
||||
# @llamaindex/community
|
||||
|
||||
## 0.0.102
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 5cdab12: Add Claude Sonnet 4 and Clause Opus 4 models
|
||||
|
||||
## 0.0.101
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [59601dd]
|
||||
- @llamaindex/core@0.6.7
|
||||
|
||||
## 0.0.100
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [680b529]
|
||||
- Updated dependencies [361a685]
|
||||
- @llamaindex/core@0.6.6
|
||||
|
||||
## 0.0.99
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@llamaindex/aws",
|
||||
"description": "AWS package for LlamaIndexTS",
|
||||
"version": "0.0.99",
|
||||
"version": "0.0.102",
|
||||
"type": "module",
|
||||
"types": "dist/type/index.d.ts",
|
||||
"main": "dist/cjs/index.js",
|
||||
|
||||
@@ -70,6 +70,8 @@ export const BEDROCK_MODELS = {
|
||||
ANTHROPIC_CLAUDE_3_5_SONNET_V2: "anthropic.claude-3-5-sonnet-20241022-v2:0",
|
||||
ANTHROPIC_CLAUDE_3_5_HAIKU: "anthropic.claude-3-5-haiku-20241022-v1:0",
|
||||
ANTHROPIC_CLAUDE_3_7_SONNET: "anthropic.claude-3-7-sonnet-20250219-v1:0",
|
||||
ANTHROPIC_CLAUDE_4_SONNET: "anthropic.claude-sonnet-4-20250514-v1:0",
|
||||
ANTHROPIC_CLAUDE_4_OPUS: "anthropic.claude-opus-4-20250514-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",
|
||||
@@ -105,6 +107,8 @@ export const INFERENCE_BEDROCK_MODELS = {
|
||||
"us.anthropic.claude-3-5-sonnet-20241022-v2:0",
|
||||
US_ANTHROPIC_CLAUDE_3_7_SONNET:
|
||||
"us.anthropic.claude-3-7-sonnet-20250219-v1:0",
|
||||
US_ANTHROPIC_CLAUDE_4_SONNET: "us.anthropic.claude-sonnet-4-20250514-v1:0",
|
||||
US_ANTHROPIC_CLAUDE_4_OPUS: "us.anthropic.claude-opus-4-20250514-v1:0",
|
||||
US_META_LLAMA_3_2_1B_INSTRUCT: "us.meta.llama3-2-1b-instruct-v1:0",
|
||||
US_META_LLAMA_3_2_3B_INSTRUCT: "us.meta.llama3-2-3b-instruct-v1:0",
|
||||
US_META_LLAMA_3_2_11B_INSTRUCT: "us.meta.llama3-2-11b-instruct-v1:0",
|
||||
@@ -122,6 +126,8 @@ export const INFERENCE_BEDROCK_MODELS = {
|
||||
"eu.anthropic.claude-3-5-sonnet-20240620-v1:0",
|
||||
EU_ANTHROPIC_CLAUDE_3_7_SONNET:
|
||||
"eu.anthropic.claude-3-7-sonnet-20250219-v1:0",
|
||||
EU_ANTHROPIC_CLAUDE_4_SONNET: "eu.anthropic.claude-sonnet-4-20250514-v1:0",
|
||||
EU_ANTHROPIC_CLAUDE_4_OPUS: "eu.anthropic.claude-opus-4-20250514-v1:0",
|
||||
EU_META_LLAMA_3_2_1B_INSTRUCT: "eu.meta.llama3-2-1b-instruct-v1:0",
|
||||
EU_META_LLAMA_3_2_3B_INSTRUCT: "eu.meta.llama3-2-3b-instruct-v1:0",
|
||||
EU_AMAZON_NOVA_PREMIER_1: "eu.amazon.nova-premier-v1:0",
|
||||
@@ -151,6 +157,10 @@ export const INFERENCE_TO_BEDROCK_MAP: Record<
|
||||
BEDROCK_MODELS.ANTHROPIC_CLAUDE_3_5_SONNET_V2,
|
||||
[INFERENCE_BEDROCK_MODELS.US_ANTHROPIC_CLAUDE_3_5_HAIKU]:
|
||||
BEDROCK_MODELS.ANTHROPIC_CLAUDE_3_5_HAIKU,
|
||||
[INFERENCE_BEDROCK_MODELS.US_ANTHROPIC_CLAUDE_4_SONNET]:
|
||||
BEDROCK_MODELS.ANTHROPIC_CLAUDE_4_SONNET,
|
||||
[INFERENCE_BEDROCK_MODELS.US_ANTHROPIC_CLAUDE_4_OPUS]:
|
||||
BEDROCK_MODELS.ANTHROPIC_CLAUDE_4_OPUS,
|
||||
[INFERENCE_BEDROCK_MODELS.US_META_LLAMA_3_2_1B_INSTRUCT]:
|
||||
BEDROCK_MODELS.META_LLAMA3_2_1B_INSTRUCT,
|
||||
[INFERENCE_BEDROCK_MODELS.US_META_LLAMA_3_2_3B_INSTRUCT]:
|
||||
@@ -179,6 +189,10 @@ export const INFERENCE_TO_BEDROCK_MAP: Record<
|
||||
BEDROCK_MODELS.ANTHROPIC_CLAUDE_3_5_SONNET,
|
||||
[INFERENCE_BEDROCK_MODELS.EU_ANTHROPIC_CLAUDE_3_7_SONNET]:
|
||||
BEDROCK_MODELS.ANTHROPIC_CLAUDE_3_7_SONNET,
|
||||
[INFERENCE_BEDROCK_MODELS.EU_ANTHROPIC_CLAUDE_4_SONNET]:
|
||||
BEDROCK_MODELS.ANTHROPIC_CLAUDE_4_SONNET,
|
||||
[INFERENCE_BEDROCK_MODELS.EU_ANTHROPIC_CLAUDE_4_OPUS]:
|
||||
BEDROCK_MODELS.ANTHROPIC_CLAUDE_4_OPUS,
|
||||
[INFERENCE_BEDROCK_MODELS.EU_META_LLAMA_3_2_1B_INSTRUCT]:
|
||||
BEDROCK_MODELS.META_LLAMA3_2_1B_INSTRUCT,
|
||||
[INFERENCE_BEDROCK_MODELS.EU_META_LLAMA_3_2_3B_INSTRUCT]:
|
||||
@@ -222,6 +236,8 @@ const CHAT_ONLY_MODELS = {
|
||||
[BEDROCK_MODELS.ANTHROPIC_CLAUDE_3_5_SONNET_V2]: 200000,
|
||||
[BEDROCK_MODELS.ANTHROPIC_CLAUDE_3_5_HAIKU]: 200000,
|
||||
[BEDROCK_MODELS.ANTHROPIC_CLAUDE_3_7_SONNET]: 200000,
|
||||
[BEDROCK_MODELS.ANTHROPIC_CLAUDE_4_SONNET]: 200000,
|
||||
[BEDROCK_MODELS.ANTHROPIC_CLAUDE_4_OPUS]: 200000,
|
||||
[BEDROCK_MODELS.META_LLAMA2_13B_CHAT]: 2048,
|
||||
[BEDROCK_MODELS.META_LLAMA2_70B_CHAT]: 4096,
|
||||
[BEDROCK_MODELS.META_LLAMA3_8B_INSTRUCT]: 8192,
|
||||
@@ -264,6 +280,8 @@ export const STREAMING_MODELS = new Set([
|
||||
BEDROCK_MODELS.ANTHROPIC_CLAUDE_3_5_SONNET_V2,
|
||||
BEDROCK_MODELS.ANTHROPIC_CLAUDE_3_5_HAIKU,
|
||||
BEDROCK_MODELS.ANTHROPIC_CLAUDE_3_7_SONNET,
|
||||
BEDROCK_MODELS.ANTHROPIC_CLAUDE_4_SONNET,
|
||||
BEDROCK_MODELS.ANTHROPIC_CLAUDE_4_OPUS,
|
||||
BEDROCK_MODELS.META_LLAMA2_13B_CHAT,
|
||||
BEDROCK_MODELS.META_LLAMA2_70B_CHAT,
|
||||
BEDROCK_MODELS.META_LLAMA3_8B_INSTRUCT,
|
||||
@@ -293,6 +311,8 @@ export const TOOL_CALL_MODELS: BEDROCK_MODELS[] = [
|
||||
BEDROCK_MODELS.ANTHROPIC_CLAUDE_3_5_SONNET_V2,
|
||||
BEDROCK_MODELS.ANTHROPIC_CLAUDE_3_5_HAIKU,
|
||||
BEDROCK_MODELS.ANTHROPIC_CLAUDE_3_7_SONNET,
|
||||
BEDROCK_MODELS.ANTHROPIC_CLAUDE_4_SONNET,
|
||||
BEDROCK_MODELS.ANTHROPIC_CLAUDE_4_OPUS,
|
||||
BEDROCK_MODELS.META_LLAMA3_1_405B_INSTRUCT,
|
||||
BEDROCK_MODELS.META_LLAMA3_2_1B_INSTRUCT,
|
||||
BEDROCK_MODELS.META_LLAMA3_2_3B_INSTRUCT,
|
||||
@@ -334,6 +354,8 @@ export const BEDROCK_MODEL_MAX_TOKENS: Partial<Record<BEDROCK_MODELS, number>> =
|
||||
[BEDROCK_MODELS.ANTHROPIC_CLAUDE_3_5_SONNET_V2]: 8192,
|
||||
[BEDROCK_MODELS.ANTHROPIC_CLAUDE_3_5_HAIKU]: 8192,
|
||||
[BEDROCK_MODELS.ANTHROPIC_CLAUDE_3_7_SONNET]: 8192,
|
||||
[BEDROCK_MODELS.ANTHROPIC_CLAUDE_4_SONNET]: 64000,
|
||||
[BEDROCK_MODELS.ANTHROPIC_CLAUDE_4_OPUS]: 32000,
|
||||
[BEDROCK_MODELS.META_LLAMA2_13B_CHAT]: 2048,
|
||||
[BEDROCK_MODELS.META_LLAMA2_70B_CHAT]: 2048,
|
||||
[BEDROCK_MODELS.META_LLAMA3_8B_INSTRUCT]: 2048,
|
||||
|
||||
@@ -1,5 +1,23 @@
|
||||
# @llamaindex/clip
|
||||
|
||||
## 0.0.57
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [59601dd]
|
||||
- @llamaindex/openai@0.4.1
|
||||
- @llamaindex/core@0.6.7
|
||||
|
||||
## 0.0.56
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [680b529]
|
||||
- Updated dependencies [361a685]
|
||||
- Updated dependencies [3e66ddc]
|
||||
- @llamaindex/core@0.6.6
|
||||
- @llamaindex/openai@0.4.0
|
||||
|
||||
## 0.0.55
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@llamaindex/clip",
|
||||
"description": "Clip Embedding Adapter for LlamaIndex",
|
||||
"version": "0.0.55",
|
||||
"version": "0.0.57",
|
||||
"type": "module",
|
||||
"types": "dist/index.d.ts",
|
||||
"main": "dist/index.cjs",
|
||||
|
||||
@@ -1,5 +1,20 @@
|
||||
# @llamaindex/cohere
|
||||
|
||||
## 0.0.21
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [59601dd]
|
||||
- @llamaindex/core@0.6.7
|
||||
|
||||
## 0.0.20
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [680b529]
|
||||
- Updated dependencies [361a685]
|
||||
- @llamaindex/core@0.6.6
|
||||
|
||||
## 0.0.19
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@llamaindex/cohere",
|
||||
"description": "Cohere Adapter for LlamaIndex",
|
||||
"version": "0.0.19",
|
||||
"version": "0.0.21",
|
||||
"type": "module",
|
||||
"main": "./dist/index.cjs",
|
||||
"module": "./dist/index.js",
|
||||
|
||||
@@ -1,5 +1,23 @@
|
||||
# @llamaindex/deepinfra
|
||||
|
||||
## 0.0.57
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [59601dd]
|
||||
- @llamaindex/openai@0.4.1
|
||||
- @llamaindex/core@0.6.7
|
||||
|
||||
## 0.0.56
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [680b529]
|
||||
- Updated dependencies [361a685]
|
||||
- Updated dependencies [3e66ddc]
|
||||
- @llamaindex/core@0.6.6
|
||||
- @llamaindex/openai@0.4.0
|
||||
|
||||
## 0.0.55
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@llamaindex/deepinfra",
|
||||
"description": "Deepinfra Adapter for LlamaIndex",
|
||||
"version": "0.0.55",
|
||||
"version": "0.0.57",
|
||||
"type": "module",
|
||||
"main": "./dist/index.cjs",
|
||||
"module": "./dist/index.js",
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user