mirror of
https://github.com/run-llama/LlamaIndexTS.git
synced 2026-07-15 06:52:45 -04:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 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,21 @@
|
||||
# @llamaindex/doc
|
||||
|
||||
## 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.19",
|
||||
"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,13 @@
|
||||
# @llamaindex/cloudflare-worker-agent-test
|
||||
|
||||
## 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.161",
|
||||
"type": "module",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# @llamaindex/llama-parse-browser-test
|
||||
|
||||
## 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.63",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# @llamaindex/next-agent-test
|
||||
|
||||
## 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.161",
|
||||
"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,13 @@
|
||||
# test-edge-runtime
|
||||
|
||||
## 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.160",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
|
||||
@@ -1,5 +1,15 @@
|
||||
# @llamaindex/next-node-runtime
|
||||
|
||||
## 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.28",
|
||||
"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,13 @@
|
||||
# vite-import-llamaindex
|
||||
|
||||
## 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.27",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "vite build",
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# @llamaindex/waku-query-engine-test
|
||||
|
||||
## 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.161",
|
||||
"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,60 @@
|
||||
# examples
|
||||
|
||||
## 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";
|
||||
|
||||
+46
-46
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@llamaindex/examples",
|
||||
"version": "0.3.15",
|
||||
"version": "0.3.16",
|
||||
"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.7",
|
||||
"@llamaindex/assemblyai": "^0.1.5",
|
||||
"@llamaindex/astra": "^0.0.20",
|
||||
"@llamaindex/azure": "^0.1.16",
|
||||
"@llamaindex/chroma": "^0.0.20",
|
||||
"@llamaindex/clip": "^0.0.56",
|
||||
"@llamaindex/cloud": "^4.0.8",
|
||||
"@llamaindex/cohere": "^0.0.20",
|
||||
"@llamaindex/core": "^0.6.6",
|
||||
"@llamaindex/deepinfra": "^0.0.56",
|
||||
"@llamaindex/deepseek": "^0.0.16",
|
||||
"@llamaindex/discord": "^0.1.5",
|
||||
"@llamaindex/elastic-search": "^0.1.6",
|
||||
"@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.13",
|
||||
"@llamaindex/fireworks": "^0.0.16",
|
||||
"@llamaindex/google": "^0.3.2",
|
||||
"@llamaindex/groq": "^0.0.71",
|
||||
"@llamaindex/huggingface": "^0.1.10",
|
||||
"@llamaindex/jinaai": "^0.0.16",
|
||||
"@llamaindex/milvus": "^0.1.15",
|
||||
"@llamaindex/mistral": "^0.1.6",
|
||||
"@llamaindex/mixedbread": "^0.0.20",
|
||||
"@llamaindex/mongodb": "^0.0.21",
|
||||
"@llamaindex/node-parser": "^2.0.6",
|
||||
"@llamaindex/notion": "^0.1.5",
|
||||
"@llamaindex/ollama": "^0.1.6",
|
||||
"@llamaindex/openai": "^0.4.0",
|
||||
"@llamaindex/perplexity": "^0.0.13",
|
||||
"@llamaindex/pinecone": "^0.1.6",
|
||||
"@llamaindex/portkey-ai": "^0.0.48",
|
||||
"@llamaindex/postgres": "^0.0.49",
|
||||
"@llamaindex/qdrant": "^0.1.15",
|
||||
"@llamaindex/readers": "^3.1.4",
|
||||
"@llamaindex/replicate": "^0.0.48",
|
||||
"@llamaindex/supabase": "^0.1.5",
|
||||
"@llamaindex/together": "^0.0.16",
|
||||
"@llamaindex/tools": "^0.0.11",
|
||||
"@llamaindex/upstash": "^0.0.20",
|
||||
"@llamaindex/vercel": "^0.1.6",
|
||||
"@llamaindex/vllm": "^0.0.42",
|
||||
"@llamaindex/voyage-ai": "^1.0.12",
|
||||
"@llamaindex/weaviate": "^0.0.20",
|
||||
"@llamaindex/workflow": "^1.1.3",
|
||||
"@llamaindex/xai": "workspace:^0.0.3",
|
||||
"@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.0",
|
||||
"mongodb": "6.7.0",
|
||||
"postgres": "^3.4.4",
|
||||
"wikipedia": "^2.1.2",
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# @llamaindex/autotool
|
||||
|
||||
## 8.0.0
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [b0cd530]
|
||||
- Updated dependencies [361a685]
|
||||
- llamaindex@0.11.0
|
||||
|
||||
## 7.0.6
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
# @llamaindex/autotool-01-node-example
|
||||
|
||||
## 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.108"
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"url": "git+https://github.com/run-llama/LlamaIndexTS.git",
|
||||
"directory": "packages/autotool"
|
||||
},
|
||||
"version": "7.0.6",
|
||||
"version": "8.0.0",
|
||||
"description": "auto transpile your JS function to LLM Agent compatible",
|
||||
"files": [
|
||||
"dist",
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# @llamaindex/cloud
|
||||
|
||||
## 4.0.8
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [680b529]
|
||||
- Updated dependencies [361a685]
|
||||
- @llamaindex/core@0.6.6
|
||||
|
||||
## 4.0.7
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@llamaindex/cloud",
|
||||
"version": "4.0.7",
|
||||
"version": "4.0.8",
|
||||
"type": "module",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
# @llamaindex/core
|
||||
|
||||
## 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.6",
|
||||
"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;
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# @llamaindex/experimental
|
||||
|
||||
## 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.177",
|
||||
"type": "module",
|
||||
"types": "dist/type/index.d.ts",
|
||||
"main": "dist/cjs/index.js",
|
||||
|
||||
@@ -1,5 +1,30 @@
|
||||
# llamaindex
|
||||
|
||||
## 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.0",
|
||||
"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,22 @@
|
||||
# @llamaindex/core-test
|
||||
|
||||
## 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.1",
|
||||
"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,13 @@
|
||||
# @llamaindex/node-parser
|
||||
|
||||
## 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.6",
|
||||
"description": "Node parser for LlamaIndex",
|
||||
"type": "module",
|
||||
"exports": {
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# @llamaindex/anthropic
|
||||
|
||||
## 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.7",
|
||||
"type": "module",
|
||||
"main": "./dist/index.cjs",
|
||||
"module": "./dist/index.js",
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# @llamaindex/assemblyai
|
||||
|
||||
## 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.5",
|
||||
"type": "module",
|
||||
"types": "dist/index.d.ts",
|
||||
"main": "dist/index.cjs",
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# @llamaindex/community
|
||||
|
||||
## 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.100",
|
||||
"type": "module",
|
||||
"types": "dist/type/index.d.ts",
|
||||
"main": "dist/cjs/index.js",
|
||||
|
||||
@@ -1,5 +1,15 @@
|
||||
# @llamaindex/clip
|
||||
|
||||
## 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.56",
|
||||
"type": "module",
|
||||
"types": "dist/index.d.ts",
|
||||
"main": "dist/index.cjs",
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# @llamaindex/cohere
|
||||
|
||||
## 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.20",
|
||||
"type": "module",
|
||||
"main": "./dist/index.cjs",
|
||||
"module": "./dist/index.js",
|
||||
|
||||
@@ -1,5 +1,15 @@
|
||||
# @llamaindex/deepinfra
|
||||
|
||||
## 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.56",
|
||||
"type": "module",
|
||||
"main": "./dist/index.cjs",
|
||||
"module": "./dist/index.js",
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
# @llamaindex/deepseek
|
||||
|
||||
## 0.0.16
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [3e66ddc]
|
||||
- @llamaindex/openai@0.4.0
|
||||
|
||||
## 0.0.15
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@llamaindex/deepseek",
|
||||
"description": "DeepSeek Adapter for LlamaIndex",
|
||||
"version": "0.0.15",
|
||||
"version": "0.0.16",
|
||||
"type": "module",
|
||||
"main": "./dist/index.cjs",
|
||||
"module": "./dist/index.js",
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# @llamaindex/discord
|
||||
|
||||
## 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/discord",
|
||||
"description": "Discord Reader for LlamaIndex",
|
||||
"version": "0.1.4",
|
||||
"version": "0.1.5",
|
||||
"type": "module",
|
||||
"types": "dist/index.d.ts",
|
||||
"main": "dist/index.cjs",
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
# @llamaindex/fireworks
|
||||
|
||||
## 0.0.16
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [3e66ddc]
|
||||
- @llamaindex/openai@0.4.0
|
||||
|
||||
## 0.0.15
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@llamaindex/fireworks",
|
||||
"description": "Fireworks Adapter for LlamaIndex",
|
||||
"version": "0.0.15",
|
||||
"version": "0.0.16",
|
||||
"type": "module",
|
||||
"main": "./dist/index.cjs",
|
||||
"module": "./dist/index.js",
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# @llamaindex/google
|
||||
|
||||
## 0.3.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [680b529]
|
||||
- Updated dependencies [361a685]
|
||||
- @llamaindex/core@0.6.6
|
||||
|
||||
## 0.3.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@llamaindex/google",
|
||||
"description": "Google Adapter for LlamaIndex",
|
||||
"version": "0.3.1",
|
||||
"version": "0.3.2",
|
||||
"type": "module",
|
||||
"main": "./dist/index.cjs",
|
||||
"module": "./dist/index.js",
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
# @llamaindex/groq
|
||||
|
||||
## 0.0.71
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [3e66ddc]
|
||||
- @llamaindex/openai@0.4.0
|
||||
|
||||
## 0.0.70
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@llamaindex/groq",
|
||||
"description": "Groq Adapter for LlamaIndex",
|
||||
"version": "0.0.70",
|
||||
"version": "0.0.71",
|
||||
"type": "module",
|
||||
"main": "./dist/index.cjs",
|
||||
"module": "./dist/index.js",
|
||||
|
||||
@@ -1,5 +1,15 @@
|
||||
# @llamaindex/huggingface
|
||||
|
||||
## 0.1.10
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [680b529]
|
||||
- Updated dependencies [361a685]
|
||||
- Updated dependencies [3e66ddc]
|
||||
- @llamaindex/core@0.6.6
|
||||
- @llamaindex/openai@0.4.0
|
||||
|
||||
## 0.1.9
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@llamaindex/huggingface",
|
||||
"description": "Huggingface Adapter for LlamaIndex",
|
||||
"version": "0.1.9",
|
||||
"version": "0.1.10",
|
||||
"type": "module",
|
||||
"types": "dist/index.d.ts",
|
||||
"main": "dist/index.cjs",
|
||||
|
||||
@@ -1,5 +1,15 @@
|
||||
# @llamaindex/jinaai
|
||||
|
||||
## 0.0.16
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [680b529]
|
||||
- Updated dependencies [361a685]
|
||||
- Updated dependencies [3e66ddc]
|
||||
- @llamaindex/core@0.6.6
|
||||
- @llamaindex/openai@0.4.0
|
||||
|
||||
## 0.0.15
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@llamaindex/jinaai",
|
||||
"description": "JinaAI Adapter for LlamaIndex",
|
||||
"version": "0.0.15",
|
||||
"version": "0.0.16",
|
||||
"type": "module",
|
||||
"main": "./dist/index.cjs",
|
||||
"module": "./dist/index.js",
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# @llamaindex/mistral
|
||||
|
||||
## 0.1.6
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [680b529]
|
||||
- Updated dependencies [361a685]
|
||||
- @llamaindex/core@0.6.6
|
||||
|
||||
## 0.1.5
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@llamaindex/mistral",
|
||||
"description": "Mistral Adapter for LlamaIndex",
|
||||
"version": "0.1.5",
|
||||
"version": "0.1.6",
|
||||
"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