mirror of
https://github.com/run-llama/LlamaIndexTS.git
synced 2026-07-02 20:13:52 -04:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 075f88dbc3 | |||
| cc47ee0602 | |||
| 5e6ef55a5a | |||
| 9c73f0a530 | |||
| 52a4d2b83d | |||
| 0fd78d5434 |
@@ -1,84 +0,0 @@
|
||||
const { join } = require("node:path");
|
||||
|
||||
module.exports = {
|
||||
root: true,
|
||||
extends: [
|
||||
"turbo",
|
||||
"prettier",
|
||||
"plugin:@typescript-eslint/recommended-type-checked-only",
|
||||
],
|
||||
parserOptions: {
|
||||
project: join(__dirname, "tsconfig.eslint.json"),
|
||||
__tsconfigRootDir: __dirname,
|
||||
},
|
||||
settings: {
|
||||
react: {
|
||||
version: "999.999.999",
|
||||
},
|
||||
},
|
||||
rules: {
|
||||
"max-params": ["error", 4],
|
||||
"prefer-const": "error",
|
||||
"@typescript-eslint/no-floating-promises": [
|
||||
"error",
|
||||
{
|
||||
ignoreIIFE: true,
|
||||
},
|
||||
],
|
||||
"no-debugger": "error",
|
||||
"@typescript-eslint/await-thenable": "off",
|
||||
"@typescript-eslint/ban-ts-comment": "off",
|
||||
"@typescript-eslint/ban-types": "off",
|
||||
"no-array-constructor": "off",
|
||||
"@typescript-eslint/no-array-constructor": "off",
|
||||
"@typescript-eslint/no-base-to-string": [
|
||||
"error",
|
||||
{
|
||||
ignoredTypeNames: ["Error", "RegExp", "URL", "URLSearchParams"],
|
||||
},
|
||||
],
|
||||
"@typescript-eslint/no-duplicate-enum-values": "off",
|
||||
"@typescript-eslint/no-duplicate-type-constituents": "off",
|
||||
"@typescript-eslint/no-explicit-any": "off",
|
||||
"@typescript-eslint/no-extra-non-null-assertion": "off",
|
||||
"@typescript-eslint/no-for-in-array": "off",
|
||||
"no-implied-eval": "off",
|
||||
"@typescript-eslint/no-implied-eval": "off",
|
||||
"no-loss-of-precision": "off",
|
||||
"@typescript-eslint/no-loss-of-precision": "off",
|
||||
"@typescript-eslint/no-misused-new": "off",
|
||||
"@typescript-eslint/no-misused-promises": "off",
|
||||
"@typescript-eslint/no-namespace": "off",
|
||||
"@typescript-eslint/no-non-null-asserted-optional-chain": "off",
|
||||
"@typescript-eslint/no-redundant-type-constituents": "off",
|
||||
"@typescript-eslint/no-this-alias": "off",
|
||||
"@typescript-eslint/no-unnecessary-type-assertion": "off",
|
||||
"@typescript-eslint/no-unnecessary-type-constraint": "off",
|
||||
"@typescript-eslint/no-unsafe-argument": "off",
|
||||
"@typescript-eslint/no-unsafe-assignment": "off",
|
||||
"@typescript-eslint/no-unsafe-call": "off",
|
||||
"@typescript-eslint/no-unsafe-declaration-merging": "off",
|
||||
"@typescript-eslint/no-unsafe-enum-comparison": "off",
|
||||
"@typescript-eslint/no-unsafe-member-access": "off",
|
||||
"@typescript-eslint/no-unsafe-return": "off",
|
||||
"no-unused-vars": "off",
|
||||
"@typescript-eslint/no-unused-vars": "off",
|
||||
"@typescript-eslint/no-var-requires": "off",
|
||||
"@typescript-eslint/prefer-as-const": "off",
|
||||
"require-await": "off",
|
||||
"@typescript-eslint/require-await": "off",
|
||||
"@typescript-eslint/restrict-plus-operands": "off",
|
||||
"@typescript-eslint/restrict-template-expressions": "off",
|
||||
"@typescript-eslint/triple-slash-reference": "off",
|
||||
"@typescript-eslint/unbound-method": "off",
|
||||
},
|
||||
overrides: [
|
||||
{
|
||||
files: ["examples/**/*.ts"],
|
||||
rules: {
|
||||
"turbo/no-undeclared-env-vars": "off",
|
||||
},
|
||||
},
|
||||
],
|
||||
ignorePatterns: ["dist/", "lib/", "deps/"],
|
||||
};
|
||||
@@ -23,7 +23,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
node-version: [18.x, 20.x, 22.x]
|
||||
node-version: [20.x, 22.x, 23.x]
|
||||
name: E2E on Node.js ${{ matrix.node-version }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
@@ -53,7 +53,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
node-version: [18.x, 20.x, 22.x]
|
||||
node-version: [20.x, 22.x, 23.x]
|
||||
name: Test on Node.js ${{ matrix.node-version }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
@@ -25,7 +25,7 @@ LlamaIndex.TS aims to be a lightweight, easy to use set of libraries to help you
|
||||
|
||||
LlamaIndex.TS supports multiple JS environments, including:
|
||||
|
||||
- Node.js (18, 20, 22) ✅
|
||||
- Node.js >= 20 ✅
|
||||
- Deno ✅
|
||||
- Bun ✅
|
||||
- Nitro ✅
|
||||
@@ -57,213 +57,9 @@ pnpm install llamaindex
|
||||
yarn add llamaindex
|
||||
```
|
||||
|
||||
### Setup TypeScript
|
||||
### Setup in Node.js, Deno, Bun, TypeScript...?
|
||||
|
||||
```json5
|
||||
{
|
||||
compilerOptions: {
|
||||
// ⬇️ add this line to your tsconfig.json
|
||||
moduleResolution: "bundler", // or "node16"
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>Why?</summary>
|
||||
We are shipping both ESM and CJS module, and compatible with Vercel Edge, Cloudflare Workers, and other serverless platforms.
|
||||
|
||||
So we are using [conditional exports](https://nodejs.org/api/packages.html#conditional-exports) to support all environments.
|
||||
|
||||
This is a kind of modern way of shipping packages, but might cause TypeScript type check to fail because of legacy module resolution.
|
||||
|
||||
Imaging you put output file into `/dist/openai.js` but you are importing `llamaindex/openai` in your code, and set `package.json` like this:
|
||||
|
||||
```json
|
||||
{
|
||||
"exports": {
|
||||
"./openai": "./dist/openai.js"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
In old module resolution, TypeScript will not be able to find the module because it is not follow the file structure, even you run `node index.js` successfully. (on Node.js >=16)
|
||||
|
||||
See more about [moduleResolution](https://www.typescriptlang.org/docs/handbook/modules/theory.html#module-resolution) or
|
||||
[TypeScript 5.0 blog](https://devblogs.microsoft.com/typescript/announcing-typescript-5-0/#--moduleresolution-bundler7).
|
||||
|
||||
</details>
|
||||
|
||||
### Node.js
|
||||
|
||||
```ts
|
||||
import fs from "node:fs/promises";
|
||||
import { Document, VectorStoreIndex } from "llamaindex";
|
||||
|
||||
async function main() {
|
||||
// Load essay from abramov.txt in Node
|
||||
const essay = await fs.readFile(
|
||||
"node_modules/llamaindex/examples/abramov.txt",
|
||||
"utf-8",
|
||||
);
|
||||
|
||||
// Create Document object with essay
|
||||
const document = new Document({ text: essay });
|
||||
|
||||
// Split text and create embeddings. Store them in a VectorStoreIndex
|
||||
const index = await VectorStoreIndex.fromDocuments([document]);
|
||||
|
||||
// Query the index
|
||||
const queryEngine = index.asQueryEngine();
|
||||
const response = await queryEngine.query({
|
||||
query: "What did the author do in college?",
|
||||
});
|
||||
|
||||
// Output response
|
||||
console.log(response.toString());
|
||||
}
|
||||
|
||||
main();
|
||||
```
|
||||
|
||||
```bash
|
||||
# `pnpm install tsx` before running the script
|
||||
node --import tsx ./main.ts
|
||||
```
|
||||
|
||||
### Next.js
|
||||
|
||||
You will need to add a llamaindex plugin to your Next.js project.
|
||||
|
||||
```js
|
||||
// next.config.js
|
||||
const withLlamaIndex = require("llamaindex/next");
|
||||
|
||||
module.exports = withLlamaIndex({
|
||||
// your next.js config
|
||||
});
|
||||
```
|
||||
|
||||
### React Server Actions
|
||||
|
||||
You can combine `ai` with `llamaindex` in Next.js, Waku or Redwood.js with RSC (React Server Components).
|
||||
|
||||
```tsx
|
||||
"use client";
|
||||
import { chatWithAgent } from "@/actions";
|
||||
import type { JSX } from "react";
|
||||
import { useActionState } from "react";
|
||||
|
||||
export default function Home() {
|
||||
const [ui, action] = useActionState<JSX.Element | null>(async () => {
|
||||
return chatWithAgent("hello!", []);
|
||||
}, null);
|
||||
return (
|
||||
<main>
|
||||
{ui}
|
||||
<form action={action}>
|
||||
<button>Chat</button>
|
||||
</form>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
```
|
||||
|
||||
```tsx
|
||||
// src/actions/index.ts
|
||||
"use server";
|
||||
import { createStreamableUI } from "ai/rsc";
|
||||
import { OpenAIAgent } from "llamaindex";
|
||||
import type { ChatMessage } from "llamaindex/llm/types";
|
||||
|
||||
export async function chatWithAgent(
|
||||
question: string,
|
||||
prevMessages: ChatMessage[] = [],
|
||||
) {
|
||||
const agent = new OpenAIAgent({
|
||||
tools: [
|
||||
// ... adding your tools here
|
||||
],
|
||||
});
|
||||
const responseStream = await agent.chat(
|
||||
{
|
||||
message: question,
|
||||
chatHistory: prevMessages,
|
||||
},
|
||||
true,
|
||||
);
|
||||
const uiStream = createStreamableUI(<div>loading...</div>);
|
||||
responseStream
|
||||
.pipeTo(
|
||||
new WritableStream({
|
||||
start: () => {
|
||||
uiStream.update("response:");
|
||||
},
|
||||
write: async (message) => {
|
||||
uiStream.append(message.response.delta);
|
||||
},
|
||||
}),
|
||||
)
|
||||
.catch(console.error);
|
||||
return uiStream.value;
|
||||
}
|
||||
```
|
||||
|
||||
### Cloudflare Workers
|
||||
|
||||
> [!TIP]
|
||||
> Some modules are not supported in Cloudflare Workers which require Node.js APIs.
|
||||
|
||||
```ts
|
||||
// add `OPENAI_API_KEY` to the `.dev.vars` file
|
||||
interface Env {
|
||||
OPENAI_API_KEY: string;
|
||||
}
|
||||
|
||||
export default {
|
||||
async fetch(
|
||||
request: Request,
|
||||
env: Env,
|
||||
ctx: ExecutionContext,
|
||||
): Promise<Response> {
|
||||
const { OpenAIAgent, OpenAI } = await import("@llamaindex/openai");
|
||||
const text = await request.text();
|
||||
const agent = new OpenAIAgent({
|
||||
llm: new OpenAI({
|
||||
apiKey: env.OPENAI_API_KEY,
|
||||
}),
|
||||
tools: [],
|
||||
});
|
||||
const responseStream = await agent.chat({
|
||||
stream: true,
|
||||
message: text,
|
||||
});
|
||||
const textEncoder = new TextEncoder();
|
||||
const response = responseStream.pipeThrough<Uint8Array>(
|
||||
new TransformStream({
|
||||
transform: (chunk, controller) => {
|
||||
controller.enqueue(textEncoder.encode(chunk.delta));
|
||||
},
|
||||
}),
|
||||
);
|
||||
return new Response(response);
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
### Vite
|
||||
|
||||
We have some wasm dependencies for better performance. You can use `vite-plugin-wasm` to load them.
|
||||
|
||||
```ts
|
||||
import wasm from "vite-plugin-wasm";
|
||||
|
||||
export default {
|
||||
plugins: [wasm()],
|
||||
ssr: {
|
||||
external: ["tiktoken"],
|
||||
},
|
||||
};
|
||||
```
|
||||
See our official document: <https://ts.llamaindex.ai/docs/llamaindex/setup/getting-started>
|
||||
|
||||
### Tips when using in non-Node.js environments
|
||||
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# docs
|
||||
|
||||
## 0.0.104
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- llamaindex@0.8.1
|
||||
|
||||
## 0.0.103
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// @ts-check
|
||||
// Note: type annotations allow type checking and IDEs autocompletion
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
||||
const renderer = require("prism-react-renderer");
|
||||
const lightCodeTheme = renderer.themes.github;
|
||||
const darkCodeTheme = renderer.themes.dracula;
|
||||
@@ -39,6 +40,7 @@ const config = {
|
||||
// editUrl:
|
||||
// "https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/",
|
||||
remarkPlugins: [
|
||||
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
||||
[require("@docusaurus/remark-plugin-npm2yarn"), { sync: true }],
|
||||
],
|
||||
},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "docs",
|
||||
"version": "0.0.103",
|
||||
"version": "0.0.104",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"docusaurus": "docusaurus",
|
||||
@@ -33,7 +33,7 @@
|
||||
"@docusaurus/theme-classic": "3.5.2",
|
||||
"@docusaurus/types": "3.5.2",
|
||||
"@tsconfig/docusaurus": "2.0.3",
|
||||
"@types/node": "^22.5.1",
|
||||
"@types/node": "^22.8.4",
|
||||
"docusaurus-plugin-typedoc": "1.0.5",
|
||||
"typedoc": "0.26.6",
|
||||
"typedoc-plugin-markdown": "4.2.6",
|
||||
@@ -52,6 +52,6 @@
|
||||
]
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
"node": ">=20.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,16 +11,19 @@ type FeatureItem = {
|
||||
const FeatureList: FeatureItem[] = [
|
||||
{
|
||||
title: "Data Driven",
|
||||
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
||||
Svg: require("@site/static/img/undraw_docusaurus_mountain.svg").default,
|
||||
description: <>LlamaIndex.TS is all about using your data with LLMs.</>,
|
||||
},
|
||||
{
|
||||
title: "Typescript Native",
|
||||
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
||||
Svg: require("@site/static/img/undraw_docusaurus_tree.svg").default,
|
||||
description: <>We ❤️ Typescript, and so do our users.</>,
|
||||
},
|
||||
{
|
||||
title: "Built by the Community",
|
||||
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
||||
Svg: require("@site/static/img/undraw_docusaurus_react.svg").default,
|
||||
description: (
|
||||
<>
|
||||
|
||||
@@ -1,5 +1,16 @@
|
||||
# @llamaindex/doc
|
||||
|
||||
## 0.0.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [9c73f0a]
|
||||
- @llamaindex/core@0.4.1
|
||||
- @llamaindex/cloud@2.0.1
|
||||
- llamaindex@0.8.1
|
||||
- @llamaindex/openai@0.1.26
|
||||
- @llamaindex/readers@1.0.1
|
||||
|
||||
## 0.0.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
+11
-3
@@ -1,13 +1,13 @@
|
||||
{
|
||||
"name": "@llamaindex/doc",
|
||||
"version": "0.0.1",
|
||||
"version": "0.0.2",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "pnpm run build:docs && next build",
|
||||
"dev": "next dev",
|
||||
"start": "next start",
|
||||
"postdev": "fumadocs-mdx",
|
||||
"postbuild": "fumadocs-mdx",
|
||||
"postbuild": "fumadocs-mdx && tsx scripts/post-build.mts",
|
||||
"build:docs": "node ./scripts/generate-docs.mjs"
|
||||
},
|
||||
"dependencies": {
|
||||
@@ -53,13 +53,21 @@
|
||||
"zod": "^3.23.8"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@next/env": "^15.0.1",
|
||||
"@types/mdx": "^2.0.13",
|
||||
"@types/node": "22.7.8",
|
||||
"@types/node": "22.8.4",
|
||||
"@types/react": "^18.3.12",
|
||||
"@types/react-dom": "^18.3.1",
|
||||
"autoprefixer": "^10.4.20",
|
||||
"fast-glob": "^3.3.2",
|
||||
"gray-matter": "^4.0.3",
|
||||
"postcss": "^8.4.47",
|
||||
"remark": "^15.0.1",
|
||||
"remark-gfm": "^4.0.0",
|
||||
"remark-mdx": "^3.1.0",
|
||||
"remark-stringify": "^11.0.0",
|
||||
"tailwindcss": "^3.4.14",
|
||||
"tsx": "^4.19.0",
|
||||
"typescript": "^5.6.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
import env from "@next/env";
|
||||
|
||||
import { updateLlamaCloud } from "./update-llamacloud.mjs";
|
||||
|
||||
env.loadEnvConfig(process.cwd());
|
||||
|
||||
await updateLlamaCloud();
|
||||
@@ -0,0 +1,110 @@
|
||||
import { PipelinesService } from "@llamaindex/cloud/api";
|
||||
import fg from "fast-glob";
|
||||
import {
|
||||
fileGenerator,
|
||||
remarkDocGen,
|
||||
remarkInstall,
|
||||
typescriptGenerator,
|
||||
} from "fumadocs-docgen";
|
||||
import matter from "gray-matter";
|
||||
import * as fs from "node:fs/promises";
|
||||
import path, { relative } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { remark } from "remark";
|
||||
import remarkGfm from "remark-gfm";
|
||||
import remarkMdx from "remark-mdx";
|
||||
import remarkStringify from "remark-stringify";
|
||||
|
||||
const baseDir = fileURLToPath(new URL("../src/content", import.meta.url));
|
||||
|
||||
async function processContent(content: string): Promise<string> {
|
||||
const file = await remark()
|
||||
.use(remarkMdx)
|
||||
.use(remarkGfm)
|
||||
.use(remarkDocGen, { generators: [typescriptGenerator(), fileGenerator()] })
|
||||
.use(remarkInstall, { persist: { id: "package-manager" } })
|
||||
.use(remarkStringify)
|
||||
.process(content);
|
||||
|
||||
return String(file);
|
||||
}
|
||||
|
||||
export async function updateLlamaCloud(): Promise<void> {
|
||||
// eslint-disable-next-line turbo/no-undeclared-env-vars
|
||||
const apiKey = process.env.LLAMA_CLOUD_API_KEY;
|
||||
// eslint-disable-next-line turbo/no-undeclared-env-vars
|
||||
const index = process.env.LLAMA_CLOUD_PIPELINE_ID;
|
||||
|
||||
if (!apiKey || !index) {
|
||||
console.log("no api key for LlamaCloud found, skipping");
|
||||
return;
|
||||
}
|
||||
|
||||
const files = await fg([
|
||||
"./src/content/docs/**/*.mdx",
|
||||
"!./src/content/docs/cloud/api/**/*",
|
||||
]);
|
||||
|
||||
const records: {
|
||||
id: string;
|
||||
title: string;
|
||||
description: string;
|
||||
content: string;
|
||||
category: string | undefined;
|
||||
}[] = [];
|
||||
|
||||
console.log("processing documents for AI");
|
||||
const scan = files.map(async (file) => {
|
||||
const fileContent = await fs.readFile(file);
|
||||
const { content, data } = matter(fileContent.toString());
|
||||
|
||||
const dir = path.dirname(file).split(path.sep).at(3);
|
||||
const category = {
|
||||
cloud: "LlamaCloud",
|
||||
llamaindex: "LlamaIndex.TS",
|
||||
}[dir ?? ""];
|
||||
|
||||
if (data._mdx?.mirror) {
|
||||
return;
|
||||
}
|
||||
|
||||
const processed = await processContent(content);
|
||||
const id = relative(baseDir, file);
|
||||
records.push({
|
||||
id,
|
||||
title: data.title as string,
|
||||
description: data.description as string,
|
||||
content: processed,
|
||||
category,
|
||||
});
|
||||
});
|
||||
|
||||
await Promise.all(scan);
|
||||
|
||||
console.log(`added ${records.length} records`);
|
||||
|
||||
await PipelinesService.upsertBatchPipelineDocumentsApiV1PipelinesPipelineIdDocumentsPut(
|
||||
{
|
||||
baseUrl: "https://api.cloud.llamaindex.ai/",
|
||||
body: records.map((record) => ({
|
||||
id: record.id,
|
||||
metadata: {
|
||||
title: record.title,
|
||||
description: record.description,
|
||||
documentUrl: record.id,
|
||||
category: record.category,
|
||||
},
|
||||
text: record.content,
|
||||
})),
|
||||
path: {
|
||||
pipeline_id: index,
|
||||
},
|
||||
throwOnError: true,
|
||||
headers: {
|
||||
Authorization: `Bearer ${apiKey}`,
|
||||
},
|
||||
},
|
||||
);
|
||||
|
||||
console.log("done");
|
||||
}
|
||||
@@ -1,15 +1,10 @@
|
||||
import { PipelinesService } from "@llamaindex/cloud/api";
|
||||
import { rehypeCodeDefaultOptions } from "fumadocs-core/mdx-plugins";
|
||||
import { fileGenerator, remarkDocGen, remarkInstall } from "fumadocs-docgen";
|
||||
import { defineConfig, defineDocs } from "fumadocs-mdx/config";
|
||||
import { transformerTwoslash } from "fumadocs-twoslash";
|
||||
import { relative } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import rehypeKatex from "rehype-katex";
|
||||
import remarkMath from "remark-math";
|
||||
|
||||
const baseDir = fileURLToPath(new URL("../src/content", import.meta.url));
|
||||
|
||||
export const { docs, meta } = defineDocs({
|
||||
dir: "./src/content/docs",
|
||||
});
|
||||
@@ -49,68 +44,6 @@ export default defineConfig({
|
||||
remarkMath,
|
||||
[remarkInstall, { persist: { id: "package-manager" } }],
|
||||
[remarkDocGen, { generators: [fileGenerator()] }],
|
||||
() => {
|
||||
return (_, file, next) => {
|
||||
const metadata = file.data.frontmatter as Record<string, unknown>;
|
||||
const title = metadata.title as string;
|
||||
const description = metadata.description as string;
|
||||
let content: string;
|
||||
if (file.value instanceof Uint8Array) {
|
||||
content = file.value.toString();
|
||||
} else {
|
||||
content = file.value;
|
||||
}
|
||||
if (file.path.includes("content/docs/cloud/api")) {
|
||||
// skip cloud api docs
|
||||
return next();
|
||||
}
|
||||
// eslint-disable-next-line turbo/no-undeclared-env-vars
|
||||
if (process.env.NODE_ENV === "development") {
|
||||
// skip development
|
||||
return next();
|
||||
}
|
||||
if (!title || !description) {
|
||||
throw new Error(`Missing title or description in ${file.path}`);
|
||||
}
|
||||
const id = relative(baseDir, file.path);
|
||||
|
||||
if (
|
||||
// eslint-disable-next-line turbo/no-undeclared-env-vars
|
||||
process.env.LLAMA_CLOUD_UPSERT_PIPELINE_DOCUMENTS === "true" &&
|
||||
// eslint-disable-next-line turbo/no-undeclared-env-vars
|
||||
process.env.LLAMA_CLOUD_PIPELINE_ID !== undefined
|
||||
) {
|
||||
PipelinesService.upsertBatchPipelineDocumentsApiV1PipelinesPipelineIdDocumentsPut(
|
||||
{
|
||||
baseUrl: "https://api.cloud.llamaindex.ai/",
|
||||
body: [
|
||||
{
|
||||
metadata: {
|
||||
title,
|
||||
description,
|
||||
documentUrl: id,
|
||||
},
|
||||
text: content,
|
||||
id,
|
||||
},
|
||||
],
|
||||
path: {
|
||||
// eslint-disable-next-line turbo/no-undeclared-env-vars
|
||||
pipeline_id: process.env.LLAMA_CLOUD_PIPELINE_ID,
|
||||
},
|
||||
throwOnError: true,
|
||||
headers: {
|
||||
// eslint-disable-next-line turbo/no-undeclared-env-vars
|
||||
Authorization: `Bearer ${process.env.LLAMA_CLOUD_API_KEY}`,
|
||||
},
|
||||
},
|
||||
).catch((error) => {
|
||||
console.error(error);
|
||||
});
|
||||
}
|
||||
return next();
|
||||
};
|
||||
},
|
||||
],
|
||||
rehypePlugins: (v) => [rehypeKatex, ...v],
|
||||
},
|
||||
|
||||
@@ -14,10 +14,9 @@ Settings.llm = new OpenAI({
|
||||
});
|
||||
|
||||
const retriever = new LlamaCloudRetriever({
|
||||
// eslint-disable-next-line turbo/no-undeclared-env-vars
|
||||
apiKey: process.env.LLAMA_CLOUD_API_KEY!,
|
||||
baseUrl: "https://api.cloud.llamaindex.ai/",
|
||||
// eslint-disable-next-line turbo/no-undeclared-env-vars
|
||||
|
||||
pipelineId: process.env.LLAMA_CLOUD_PIPELINE_ID!,
|
||||
});
|
||||
|
||||
@@ -27,7 +26,7 @@ const initialAIState = {
|
||||
messages: ChatMessage[];
|
||||
};
|
||||
|
||||
type UIMessage = {
|
||||
export type UIMessage = {
|
||||
id: number;
|
||||
display: ReactNode;
|
||||
};
|
||||
@@ -38,6 +37,7 @@ const initialUIState = {
|
||||
messages: UIMessage[];
|
||||
};
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const runAsyncFnWithoutBlocking = (fn: (...args: any) => Promise<any>) => {
|
||||
fn().catch((error) => {
|
||||
console.error(error);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { AIProvider } from "@/actions";
|
||||
import { TooltipProvider } from "@/components/ui/tooltip";
|
||||
import { Banner } from "fumadocs-ui/components/banner";
|
||||
import { RootProvider } from "fumadocs-ui/provider";
|
||||
import { Inter } from "next/font/google";
|
||||
import type { ReactNode } from "react";
|
||||
@@ -35,7 +36,14 @@ export default function Layout({ children }: { children: ReactNode }) {
|
||||
<body className="flex flex-col min-h-screen">
|
||||
<TooltipProvider>
|
||||
<AIProvider>
|
||||
<RootProvider>{children}</RootProvider>
|
||||
<RootProvider>
|
||||
<Banner variant="rainbow" id="experimental">
|
||||
Welcome to the experimental LlamaIndex.TS documentation site.
|
||||
Some content are still in progress, you are welcome to help
|
||||
contribute to the documentation
|
||||
</Banner>
|
||||
{children}
|
||||
</RootProvider>
|
||||
</AIProvider>
|
||||
</TooltipProvider>
|
||||
</body>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
"use client";
|
||||
import type { AIProvider } from "@/actions";
|
||||
import type { AIProvider, UIMessage } from "@/actions";
|
||||
import { UserMessage } from "@/components/message";
|
||||
import { useActions, useUIState } from "ai/rsc";
|
||||
import { Info } from "lucide-react";
|
||||
@@ -21,7 +21,7 @@ import { Tooltip, TooltipContent, TooltipTrigger } from "./ui/tooltip";
|
||||
|
||||
type AITriggerProps = ButtonHTMLAttributes<HTMLButtonElement>;
|
||||
|
||||
function ChatList({ messages }: { messages: any[] }) {
|
||||
function ChatList({ messages }: { messages: UIMessage[] }) {
|
||||
if (messages.length === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -2,8 +2,7 @@ import * as React from "react";
|
||||
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
export interface InputProps
|
||||
extends React.InputHTMLAttributes<HTMLInputElement> {}
|
||||
export type InputProps = React.InputHTMLAttributes<HTMLInputElement>;
|
||||
|
||||
const Input = React.forwardRef<HTMLInputElement, InputProps>(
|
||||
({ className, type, ...props }, ref) => {
|
||||
|
||||
@@ -2,8 +2,7 @@ import * as React from "react";
|
||||
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
export interface TextareaProps
|
||||
extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {}
|
||||
export type TextareaProps = React.TextareaHTMLAttributes<HTMLTextAreaElement>;
|
||||
|
||||
const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
|
||||
({ className, ...props }, ref) => {
|
||||
|
||||
@@ -12,7 +12,9 @@ export interface TextProps {
|
||||
weight?: 400 | 500 | 600;
|
||||
children?: ReactNode;
|
||||
className?: string;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
as?: any;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
maximumWidth?: any;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ export default {
|
||||
"./node_modules/fumadocs-openapi/dist/**/*.js",
|
||||
],
|
||||
presets: [createPreset()],
|
||||
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
||||
plugins: [require("tailwindcss-animate")],
|
||||
theme: {
|
||||
extend: {
|
||||
|
||||
@@ -24,6 +24,12 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
|
||||
"include": [
|
||||
"next-env.d.ts",
|
||||
"**/*.ts",
|
||||
"**/*.tsx",
|
||||
".next/types/**/*.ts",
|
||||
"**/*.mts"
|
||||
],
|
||||
"exclude": ["node_modules"]
|
||||
}
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
<svg fill="none" height="50" viewBox="0 0 512 512" width="50" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect fill="#3178c6" height="512" rx="50" width="512" />
|
||||
<rect fill="#3178c6" height="512" rx="50" width="512" />
|
||||
<path clip-rule="evenodd"
|
||||
d="m316.939 407.424v50.061c8.138 4.172 17.763 7.3 28.875 9.386s22.823 3.129 35.135 3.129c11.999 0 23.397-1.147 34.196-3.442 10.799-2.294 20.268-6.075 28.406-11.342 8.138-5.266 14.581-12.15 19.328-20.65s7.121-19.007 7.121-31.522c0-9.074-1.356-17.026-4.069-23.857s-6.625-12.906-11.738-18.225c-5.112-5.319-11.242-10.091-18.389-14.315s-15.207-8.213-24.18-11.967c-6.573-2.712-12.468-5.345-17.685-7.9-5.217-2.556-9.651-5.163-13.303-7.822-3.652-2.66-6.469-5.476-8.451-8.448-1.982-2.973-2.974-6.336-2.974-10.091 0-3.441.887-6.544 2.661-9.308s4.278-5.136 7.512-7.118c3.235-1.981 7.199-3.52 11.894-4.615 4.696-1.095 9.912-1.642 15.651-1.642 4.173 0 8.581.313 13.224.938 4.643.626 9.312 1.591 14.008 2.894 4.695 1.304 9.259 2.947 13.694 4.928 4.434 1.982 8.529 4.276 12.285 6.884v-46.776c-7.616-2.92-15.937-5.084-24.962-6.492s-19.381-2.112-31.066-2.112c-11.895 0-23.163 1.278-33.805 3.833s-20.006 6.544-28.093 11.967c-8.086 5.424-14.476 12.333-19.171 20.729-4.695 8.395-7.043 18.433-7.043 30.114 0 14.914 4.304 27.638 12.912 38.172 8.607 10.533 21.675 19.45 39.204 26.751 6.886 2.816 13.303 5.579 19.25 8.291s11.086 5.528 15.415 8.448c4.33 2.92 7.747 6.101 10.252 9.543 2.504 3.441 3.756 7.352 3.756 11.733 0 3.233-.783 6.231-2.348 8.995s-3.939 5.162-7.121 7.196-7.147 3.624-11.894 4.771c-4.748 1.148-10.303 1.721-16.668 1.721-10.851 0-21.597-1.903-32.24-5.71-10.642-3.806-20.502-9.516-29.579-17.13zm-84.159-123.342h64.22v-41.082h-179v41.082h63.906v182.918h50.874z"
|
||||
fill="#fff" fill-rule="evenodd" />
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.7 KiB |
@@ -0,0 +1,62 @@
|
||||
// @ts-check
|
||||
|
||||
import eslint from "@eslint/js";
|
||||
import eslintConfigPrettier from "eslint-config-prettier";
|
||||
import turboPlugin from "eslint-plugin-turbo";
|
||||
import globals from "globals";
|
||||
import tseslint from "typescript-eslint";
|
||||
|
||||
export default tseslint.config(
|
||||
eslint.configs.recommended,
|
||||
...tseslint.configs.recommended,
|
||||
eslintConfigPrettier,
|
||||
{
|
||||
languageOptions: {
|
||||
ecmaVersion: 2022,
|
||||
sourceType: "module",
|
||||
globals: {
|
||||
...globals.browser,
|
||||
...globals.node,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "eslint-config-turbo (recreated flat)",
|
||||
plugins: {
|
||||
turbo: { rules: turboPlugin.rules },
|
||||
},
|
||||
},
|
||||
{
|
||||
rules: {
|
||||
"no-irregular-whitespace": "off",
|
||||
"@typescript-eslint/no-unused-vars": "off",
|
||||
"@typescript-eslint/no-explicit-any": [
|
||||
"error",
|
||||
{
|
||||
ignoreRestArgs: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ["packages/wasm-tools/**"],
|
||||
rules: {
|
||||
"@typescript-eslint/no-explicit-any": "off",
|
||||
},
|
||||
},
|
||||
{
|
||||
ignores: [
|
||||
"**/dist/**",
|
||||
"**/lib/*",
|
||||
"**/deps/**",
|
||||
"**/.next/**",
|
||||
"**/node_modules/**",
|
||||
"**/build/**",
|
||||
"**/.docusaurus/**",
|
||||
// third party deps
|
||||
"packages/env/src/fs/memfs/index.js",
|
||||
"packages/core/src/prompts/format.ts",
|
||||
"packages/core/src/node-parser/sentence_tokenizer.js",
|
||||
],
|
||||
},
|
||||
);
|
||||
@@ -22,13 +22,14 @@ const extractWikipediaTitle = async (title: string) => {
|
||||
const url = `https://en.wikipedia.org/w/api.php?${queryParams}`;
|
||||
|
||||
const response = await fetch(url);
|
||||
const data: any = await response.json();
|
||||
const data = await response.json();
|
||||
|
||||
const pages = data.query.pages;
|
||||
const page = pages[Object.keys(pages)[0]];
|
||||
const wikiText = page.extract;
|
||||
|
||||
await new Promise((resolve) => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
fs.writeFile(path.join(dataPath, `${title}.txt`), wikiText, (err: any) => {
|
||||
if (err) {
|
||||
console.error(err);
|
||||
|
||||
@@ -37,7 +37,9 @@ async function main() {
|
||||
});
|
||||
|
||||
// TODO: fix any
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const documentAgents: any = {};
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const queryEngines: any = {};
|
||||
|
||||
for (const title of wikiTitles) {
|
||||
|
||||
@@ -3,7 +3,7 @@ import { SimpleDirectoryReader } from "llamaindex";
|
||||
function callback(
|
||||
category: string,
|
||||
name: string,
|
||||
status: any,
|
||||
status: unknown,
|
||||
message?: string,
|
||||
): boolean {
|
||||
console.log(category, name, status, message);
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable turbo/no-undeclared-env-vars */
|
||||
import * as dotenv from "dotenv";
|
||||
import * as fs from "fs";
|
||||
import { MongoClient } from "mongodb";
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable turbo/no-undeclared-env-vars */
|
||||
import { SimpleMongoReader } from "@llamaindex/readers/mongo";
|
||||
import * as dotenv from "dotenv";
|
||||
import {
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable turbo/no-undeclared-env-vars */
|
||||
import * as dotenv from "dotenv";
|
||||
import { MongoDBAtlasVectorSearch, VectorStoreIndex } from "llamaindex";
|
||||
import { MongoClient } from "mongodb";
|
||||
|
||||
@@ -6,6 +6,7 @@ import { getStorageContext } from "./storage";
|
||||
Settings.chunkSize = 512;
|
||||
Settings.chunkOverlap = 20;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
async function getRuntime(func: any) {
|
||||
const start = Date.now();
|
||||
await func();
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
"postgres": "^3.4.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^22.5.1",
|
||||
"@types/node": "^22.8.4",
|
||||
"tsx": "^4.19.0",
|
||||
"typescript": "^5.6.2"
|
||||
},
|
||||
|
||||
@@ -16,13 +16,14 @@ async function getSourceFilenames(sourceDir: string) {
|
||||
function callback(
|
||||
category: string,
|
||||
name: string,
|
||||
status: any,
|
||||
status: unknown,
|
||||
message: string = "",
|
||||
): boolean {
|
||||
console.log(category, name, status, message);
|
||||
return true;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
async function main(args: any) {
|
||||
const sourceDir: string = args.length > 2 ? args[2] : "../data";
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { PineconeVectorStore, VectorStoreIndex } from "llamaindex";
|
||||
|
||||
async function main() {
|
||||
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
||||
const readline = require("readline").createInterface({
|
||||
input: process.stdin,
|
||||
output: process.stdout,
|
||||
@@ -44,6 +45,7 @@ function isQuit(question: string) {
|
||||
}
|
||||
|
||||
// Function to get user input as a promise
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
function getUserInput(readline: any): Promise<string> {
|
||||
return new Promise((resolve) => {
|
||||
readline.question(
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
"llamaindex": "*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^22.5.1",
|
||||
"@types/node": "^22.8.4",
|
||||
"tsx": "^4.19.0",
|
||||
"typescript": "^5.6.2"
|
||||
}
|
||||
|
||||
@@ -39,6 +39,7 @@ function getTextDocs(jsonList: { text: string; page: number }[]): Document[] {
|
||||
}
|
||||
// Download all images from jsonObjs, send them to OpenAI API to get alt text, return an array of Document objects
|
||||
async function getImageTextDocs(
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
jsonObjs: Record<string, any>[],
|
||||
): Promise<Document[]> {
|
||||
const llm = new OpenAI({
|
||||
|
||||
@@ -16,13 +16,14 @@ async function getSourceFilenames(sourceDir: string) {
|
||||
function callback(
|
||||
category: string,
|
||||
name: string,
|
||||
status: any,
|
||||
status: unknown,
|
||||
message: string = "",
|
||||
): boolean {
|
||||
console.log(category, name, status, message);
|
||||
return true;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
async function main(args: any) {
|
||||
const sourceDir: string = args.length > 2 ? args[2] : "../data";
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable turbo/no-undeclared-env-vars */
|
||||
import dotenv from "dotenv";
|
||||
import { Document, PGVectorStore, VectorStoreQueryMode } from "llamaindex";
|
||||
import postgres from "postgres";
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { PGVectorStore, VectorStoreIndex } from "llamaindex";
|
||||
|
||||
async function main() {
|
||||
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
||||
const readline = require("readline").createInterface({
|
||||
input: process.stdin,
|
||||
output: process.stdout,
|
||||
@@ -50,6 +51,7 @@ function isQuit(question: string) {
|
||||
}
|
||||
|
||||
// Function to get user input as a promise
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
function getUserInput(readline: any): Promise<string> {
|
||||
return new Promise((resolve) => {
|
||||
readline.question(
|
||||
|
||||
@@ -46,6 +46,7 @@ class PineconeVectorStore<T extends RecordMetadata = RecordMetadata>
|
||||
|
||||
async query(
|
||||
query: VectorStoreQuery,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
kwargs?: any,
|
||||
): Promise<VectorStoreQueryResult> {
|
||||
let queryEmbedding: number[] = [];
|
||||
|
||||
+11
-10
@@ -19,19 +19,20 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@changesets/cli": "^2.27.5",
|
||||
"@typescript-eslint/eslint-plugin": "^8.3.0",
|
||||
"eslint": "8.57.0",
|
||||
"eslint-config-next": "^14.2.7",
|
||||
"eslint": "9.13.0",
|
||||
"eslint-config-next": "^15.0.2",
|
||||
"eslint-config-prettier": "^9.1.0",
|
||||
"eslint-config-turbo": "^2.1.0",
|
||||
"eslint-plugin-react": "7.35.0",
|
||||
"husky": "^9.1.5",
|
||||
"lint-staged": "^15.2.9",
|
||||
"eslint-config-turbo": "^2.2.3",
|
||||
"eslint-plugin-react": "7.37.2",
|
||||
"globals": "^15.11.0",
|
||||
"husky": "^9.1.6",
|
||||
"lint-staged": "^15.2.10",
|
||||
"madge": "^8.0.0",
|
||||
"prettier": "^3.3.3",
|
||||
"prettier-plugin-organize-imports": "^4.0.0",
|
||||
"turbo": "^2.1.2",
|
||||
"typescript": "^5.6.2"
|
||||
"prettier-plugin-organize-imports": "^4.1.0",
|
||||
"turbo": "^2.2.3",
|
||||
"typescript": "^5.6.2",
|
||||
"typescript-eslint": "^8.12.2"
|
||||
},
|
||||
"packageManager": "pnpm@9.5.0",
|
||||
"pnpm": {
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# @llamaindex/autotool
|
||||
|
||||
## 5.0.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- llamaindex@0.8.1
|
||||
|
||||
## 5.0.0
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
# @llamaindex/autotool-01-node-example
|
||||
|
||||
## 0.0.44
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- llamaindex@0.8.1
|
||||
- @llamaindex/autotool@5.0.1
|
||||
|
||||
## 0.0.43
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -13,5 +13,5 @@
|
||||
"scripts": {
|
||||
"start": "node --import tsx --import @llamaindex/autotool/node ./src/index.ts"
|
||||
},
|
||||
"version": "0.0.43"
|
||||
"version": "0.0.44"
|
||||
}
|
||||
|
||||
@@ -18,6 +18,6 @@ const openai = new OpenAI();
|
||||
|
||||
const toolCalls = response.choices[0]!.message.tool_calls ?? [];
|
||||
for (const toolCall of toolCalls) {
|
||||
toolCall.function.name;
|
||||
console.log(toolCall);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
# @llamaindex/autotool-02-next-example
|
||||
|
||||
## 0.1.88
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- llamaindex@0.8.1
|
||||
- @llamaindex/autotool@5.0.1
|
||||
|
||||
## 0.1.87
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@llamaindex/autotool-02-next-example",
|
||||
"private": true,
|
||||
"version": "0.1.87",
|
||||
"version": "0.1.88",
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
"build": "next build",
|
||||
@@ -24,7 +24,7 @@
|
||||
"tailwind-merge": "^2.5.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^22.5.1",
|
||||
"@types/node": "^22.8.4",
|
||||
"@types/react": "^18.3.12",
|
||||
"@types/react-dom": "^18.3.1",
|
||||
"@types/react-syntax-highlighter": "^15.5.11",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@llamaindex/autotool",
|
||||
"type": "module",
|
||||
"version": "5.0.0",
|
||||
"version": "5.0.1",
|
||||
"description": "auto transpile your JS function to LLM Agent compatible",
|
||||
"files": [
|
||||
"dist",
|
||||
@@ -69,7 +69,7 @@
|
||||
"devDependencies": {
|
||||
"@swc/types": "^0.1.12",
|
||||
"@types/json-schema": "^7.0.15",
|
||||
"@types/node": "^22.5.1",
|
||||
"@types/node": "^22.8.4",
|
||||
"bunchee": "5.5.1",
|
||||
"llamaindex": "workspace:*",
|
||||
"next": "14.2.11",
|
||||
|
||||
@@ -2,6 +2,7 @@ import { atom, createStore } from "jotai/vanilla";
|
||||
import type { ToolMetadata } from "llamaindex";
|
||||
|
||||
export type Info = {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
originalFunction?: (...args: any[]) => any;
|
||||
/**
|
||||
* In current LLM, it doesn't support non-object parameter, so we mock arguments as object, and use this mapping to convert it back.
|
||||
@@ -23,4 +24,5 @@ export type InfoString = {
|
||||
|
||||
export const store = createStore();
|
||||
export const toolMetadataAtom = atom<[ToolMetadata, Info][]>([]);
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export const toolsAtom = atom<Record<string, (...args: any[]) => any>>({});
|
||||
|
||||
@@ -4,6 +4,7 @@ import webpackPlugin from "./webpack";
|
||||
export function withNext(config: NextConfig) {
|
||||
return {
|
||||
...config,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
webpack: (webpackConfig: any, context: any) => {
|
||||
webpackConfig = config.webpack?.(webpackConfig, context) ?? webpackConfig;
|
||||
webpackConfig.plugins.push(webpackPlugin());
|
||||
|
||||
@@ -3,7 +3,7 @@ import type { ExpressionStatement } from "@swc/types";
|
||||
import { createUnplugin, type UnpluginFactory } from "unplugin";
|
||||
import { isJSorTS, isToolFile, transformAutoTool } from "./compiler";
|
||||
|
||||
export interface Options {}
|
||||
export type Options = object;
|
||||
|
||||
const name = "llama-index-tool";
|
||||
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
# @llamaindex/cloud
|
||||
|
||||
## 2.0.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [9c73f0a]
|
||||
- @llamaindex/core@0.4.1
|
||||
|
||||
## 2.0.0
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@llamaindex/cloud",
|
||||
"version": "2.0.0",
|
||||
"version": "2.0.1",
|
||||
"type": "module",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
|
||||
@@ -18,7 +18,7 @@ type WriteStream = {
|
||||
};
|
||||
|
||||
// Do not modify this variable or cause type errors
|
||||
// eslint-disable-next-line no-var
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any, no-var
|
||||
var process: any;
|
||||
|
||||
/**
|
||||
@@ -215,6 +215,7 @@ export class LlamaParseReader extends FileReader {
|
||||
private async getJobResult(
|
||||
jobId: string,
|
||||
resultType: "text" | "json" | "markdown",
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
): Promise<any> {
|
||||
const signal = AbortSignal.timeout(this.maxTimeout * 1000);
|
||||
let tries = 0;
|
||||
@@ -354,6 +355,7 @@ export class LlamaParseReader extends FileReader {
|
||||
*/
|
||||
async loadJson(
|
||||
filePathOrContent: string | Uint8Array,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
): Promise<Record<string, any>[]> {
|
||||
let jobId;
|
||||
const isFilePath = typeof filePathOrContent === "string";
|
||||
@@ -394,8 +396,10 @@ export class LlamaParseReader extends FileReader {
|
||||
* @return {Promise<Record<string, any>[]>} A Promise that resolves to an array of image objects.
|
||||
*/
|
||||
async getImages(
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
jsonResult: Record<string, any>[],
|
||||
downloadPath: string,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
): Promise<Record<string, any>[]> {
|
||||
try {
|
||||
// Create download directory if it doesn't exist (Actually check for write access, not existence, since fsPromises does not have a `existsSync` method)
|
||||
@@ -405,6 +409,7 @@ export class LlamaParseReader extends FileReader {
|
||||
await fs.mkdir(downloadPath, { recursive: true });
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const images: Record<string, any>[] = [];
|
||||
for (const result of jsonResult) {
|
||||
const jobId = result.job_id;
|
||||
@@ -473,9 +478,12 @@ export class LlamaParseReader extends FileReader {
|
||||
|
||||
// Filters out invalid values (null, undefined, empty string) of specific params.
|
||||
private filterSpecificParams(
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
params: Record<string, any>,
|
||||
keysToCheck: string[],
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
): Record<string, any> {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const filteredParams: Record<string, any> = {};
|
||||
for (const [key, value] of Object.entries(params)) {
|
||||
if (keysToCheck.includes(key)) {
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
# @llamaindex/community
|
||||
|
||||
## 0.0.58
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [9c73f0a]
|
||||
- @llamaindex/core@0.4.1
|
||||
|
||||
## 0.0.57
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@llamaindex/community",
|
||||
"description": "Community package for LlamaIndexTS",
|
||||
"version": "0.0.57",
|
||||
"version": "0.0.58",
|
||||
"type": "module",
|
||||
"types": "dist/type/index.d.ts",
|
||||
"main": "dist/cjs/index.js",
|
||||
@@ -42,7 +42,7 @@
|
||||
"dev": "bunchee --watch"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^22.5.1",
|
||||
"@types/node": "^22.8.4",
|
||||
"bunchee": "5.5.1"
|
||||
},
|
||||
"dependencies": {
|
||||
|
||||
@@ -31,12 +31,14 @@ import {
|
||||
|
||||
export class AnthropicProvider extends Provider<AnthropicStreamEvent> {
|
||||
getResultFromResponse(
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
response: Record<string, any>,
|
||||
): AnthropicNoneStreamingResponse {
|
||||
return JSON.parse(toUtf8(response.body));
|
||||
}
|
||||
|
||||
getToolsFromResponse<AnthropicToolContent>(
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
response: Record<string, any>,
|
||||
): AnthropicToolContent[] {
|
||||
const result = this.getResultFromResponse(response);
|
||||
@@ -45,6 +47,7 @@ export class AnthropicProvider extends Provider<AnthropicStreamEvent> {
|
||||
.map((item) => item as AnthropicToolContent);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
getTextFromResponse(response: Record<string, any>): string {
|
||||
const result = this.getResultFromResponse(response);
|
||||
return result.content
|
||||
@@ -53,6 +56,7 @@ export class AnthropicProvider extends Provider<AnthropicStreamEvent> {
|
||||
.join(" ");
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
getTextFromStreamResponse(response: Record<string, any>): string {
|
||||
const event = this.getStreamingEventResponse(response);
|
||||
if (event?.type === "content_block_delta") {
|
||||
|
||||
@@ -23,12 +23,14 @@ import {
|
||||
|
||||
export class MetaProvider extends Provider<MetaStreamEvent> {
|
||||
getResultFromResponse(
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
response: Record<string, any>,
|
||||
): MetaNoneStreamingResponse {
|
||||
return JSON.parse(toUtf8(response.body));
|
||||
}
|
||||
|
||||
getToolsFromResponse<ToolContent>(
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
response: Record<string, any>,
|
||||
): ToolContent[] {
|
||||
const result = this.getResultFromResponse(response);
|
||||
@@ -45,12 +47,14 @@ export class MetaProvider extends Provider<MetaStreamEvent> {
|
||||
];
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
getTextFromResponse(response: Record<string, any>): string {
|
||||
const result = this.getResultFromResponse(response);
|
||||
if (result.generation.trim().startsWith(TOKENS.TOOL_CALL)) return "";
|
||||
return result.generation;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
getTextFromStreamResponse(response: Record<string, any>): string {
|
||||
const event = this.getStreamingEventResponse(response);
|
||||
if (event?.generation) {
|
||||
|
||||
@@ -20,15 +20,18 @@ export type BedrockChatStreamResponse = AsyncIterable<
|
||||
ChatResponseChunk<ToolCallLLMMessageOptions>
|
||||
>;
|
||||
|
||||
export abstract class Provider<ProviderStreamEvent extends {} = {}> {
|
||||
export abstract class Provider<ProviderStreamEvent extends object = object> {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
abstract getTextFromResponse(response: Record<string, any>): string;
|
||||
|
||||
// Return tool calls from none streaming calls
|
||||
abstract getToolsFromResponse<T extends {} = {}>(
|
||||
abstract getToolsFromResponse<T extends object = object>(
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
response: Record<string, any>,
|
||||
): T[];
|
||||
|
||||
getStreamingEventResponse(
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
response: Record<string, any>,
|
||||
): ProviderStreamEvent | undefined {
|
||||
return response.chunk?.bytes
|
||||
@@ -47,6 +50,7 @@ export abstract class Provider<ProviderStreamEvent extends {} = {}> {
|
||||
});
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
getTextFromStreamResponse(response: Record<string, any>): string {
|
||||
return this.getTextFromResponse(response);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# @llamaindex/core
|
||||
|
||||
## 0.4.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 9c73f0a: fix: async local storage in `Setting.with` API
|
||||
|
||||
## 0.4.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@llamaindex/core",
|
||||
"type": "module",
|
||||
"version": "0.4.0",
|
||||
"version": "0.4.1",
|
||||
"description": "LlamaIndex Core Module",
|
||||
"exports": {
|
||||
"./agent": {
|
||||
@@ -355,7 +355,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@llamaindex/env": "workspace:*",
|
||||
"@types/node": "^22.5.1",
|
||||
"@types/node": "^22.8.4",
|
||||
"magic-bytes.js": "^1.10.0",
|
||||
"zod": "^3.23.8",
|
||||
"zod-to-json-schema": "^3.23.3"
|
||||
|
||||
@@ -28,7 +28,7 @@ export const MAX_TOOL_CALLS = 10;
|
||||
|
||||
export function createTaskOutputStream<
|
||||
Model extends LLM,
|
||||
Store extends object = {},
|
||||
Store extends object = object,
|
||||
AdditionalMessageOptions extends object = Model extends LLM<
|
||||
object,
|
||||
infer AdditionalMessageOptions
|
||||
@@ -99,7 +99,7 @@ export function createTaskOutputStream<
|
||||
|
||||
export type AgentRunnerParams<
|
||||
AI extends LLM,
|
||||
Store extends object = {},
|
||||
Store extends object = object,
|
||||
AdditionalMessageOptions extends object = AI extends LLM<
|
||||
object,
|
||||
infer AdditionalMessageOptions
|
||||
@@ -146,7 +146,7 @@ export type AgentParamsBase<
|
||||
*/
|
||||
export abstract class AgentWorker<
|
||||
AI extends LLM,
|
||||
Store extends object = {},
|
||||
Store extends object = object,
|
||||
AdditionalMessageOptions extends object = AI extends LLM<
|
||||
object,
|
||||
infer AdditionalMessageOptions
|
||||
@@ -198,7 +198,7 @@ export abstract class AgentWorker<
|
||||
*/
|
||||
export abstract class AgentRunner<
|
||||
AI extends LLM,
|
||||
Store extends object = {},
|
||||
Store extends object = object,
|
||||
AdditionalMessageOptions extends object = AI extends LLM<
|
||||
object,
|
||||
infer AdditionalMessageOptions
|
||||
@@ -292,7 +292,7 @@ export abstract class AgentRunner<
|
||||
|
||||
static shouldContinue<
|
||||
AI extends LLM,
|
||||
Store extends object = {},
|
||||
Store extends object = object,
|
||||
AdditionalMessageOptions extends object = AI extends LLM<
|
||||
object,
|
||||
infer AdditionalMessageOptions
|
||||
|
||||
@@ -12,7 +12,7 @@ import type {
|
||||
|
||||
export type AgentTaskContext<
|
||||
Model extends LLM,
|
||||
Store extends object = {},
|
||||
Store extends object = object,
|
||||
AdditionalMessageOptions extends object = Model extends LLM<
|
||||
object,
|
||||
infer AdditionalMessageOptions
|
||||
@@ -38,7 +38,7 @@ export type AgentTaskContext<
|
||||
|
||||
export type TaskStep<
|
||||
Model extends LLM = LLM,
|
||||
Store extends object = {},
|
||||
Store extends object = object,
|
||||
AdditionalMessageOptions extends object = Model extends LLM<
|
||||
object,
|
||||
infer AdditionalMessageOptions
|
||||
@@ -56,7 +56,7 @@ export type TaskStep<
|
||||
|
||||
export type TaskStepOutput<
|
||||
Model extends LLM,
|
||||
Store extends object = {},
|
||||
Store extends object = object,
|
||||
AdditionalMessageOptions extends object = Model extends LLM<
|
||||
object,
|
||||
infer AdditionalMessageOptions
|
||||
@@ -74,7 +74,7 @@ export type TaskStepOutput<
|
||||
|
||||
export type TaskHandler<
|
||||
Model extends LLM,
|
||||
Store extends object = {},
|
||||
Store extends object = object,
|
||||
AdditionalMessageOptions extends object = Model extends LLM<
|
||||
object,
|
||||
infer AdditionalMessageOptions
|
||||
|
||||
@@ -25,9 +25,9 @@ import type { TaskHandler } from "./types.js";
|
||||
type StepToolsResponseParams<Model extends LLM> = {
|
||||
response: ChatResponse<ToolCallLLMMessageOptions>;
|
||||
tools: BaseTool[];
|
||||
step: Parameters<TaskHandler<Model, {}, ToolCallLLMMessageOptions>>[0];
|
||||
step: Parameters<TaskHandler<Model, object, ToolCallLLMMessageOptions>>[0];
|
||||
enqueueOutput: Parameters<
|
||||
TaskHandler<Model, {}, ToolCallLLMMessageOptions>
|
||||
TaskHandler<Model, object, ToolCallLLMMessageOptions>
|
||||
>[1];
|
||||
};
|
||||
|
||||
|
||||
@@ -8,9 +8,9 @@ export function wrapEventCaller<This, Result, Args extends unknown[]>(
|
||||
) {
|
||||
const name = context.name;
|
||||
context.addInitializer(function () {
|
||||
// @ts-expect-error
|
||||
// @ts-expect-error - this is a valid assignment
|
||||
const fn = this[name].bind(this);
|
||||
// @ts-expect-error
|
||||
// @ts-expect-error - this is a valid assignment
|
||||
this[name] = (...args: unknown[]) => {
|
||||
return withEventCaller(this, () => fn(...args));
|
||||
};
|
||||
|
||||
@@ -72,13 +72,15 @@ export function similarity(
|
||||
* @param similarityCutoff minimum similarity score
|
||||
* @returns
|
||||
*/
|
||||
// eslint-disable-next-line max-params
|
||||
|
||||
export function getTopKEmbeddings(
|
||||
queryEmbedding: number[],
|
||||
embeddings: number[][],
|
||||
similarityTopK: number = 2,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
embeddingIds: any[] | null = null,
|
||||
similarityCutoff: number | null = null,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
): [number[], any[]] {
|
||||
if (embeddingIds == null) {
|
||||
embeddingIds = Array(embeddings.length).map((_, i) => i);
|
||||
@@ -102,6 +104,7 @@ export function getTopKEmbeddings(
|
||||
similarities.sort((a, b) => b.similarity - a.similarity); // Reverse sort
|
||||
|
||||
const resultSimilarities: number[] = [];
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const resultIds: any[] = [];
|
||||
|
||||
for (let i = 0; i < similarityTopK; i++) {
|
||||
@@ -115,15 +118,16 @@ export function getTopKEmbeddings(
|
||||
return [resultSimilarities, resultIds];
|
||||
}
|
||||
|
||||
// eslint-disable-next-line max-params
|
||||
export function getTopKMMREmbeddings(
|
||||
queryEmbedding: number[],
|
||||
embeddings: number[][],
|
||||
similarityFn: ((...args: any[]) => number) | null = null,
|
||||
similarityTopK: number | null = null,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
embeddingIds: any[] | null = null,
|
||||
_similarityCutoff: number | null = null,
|
||||
mmrThreshold: number | null = null,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
): [number[], any[]] {
|
||||
const threshold = mmrThreshold || 0.5;
|
||||
similarityFn = similarityFn || similarity;
|
||||
@@ -133,8 +137,10 @@ export function getTopKMMREmbeddings(
|
||||
}
|
||||
const fullEmbedMap = new Map(embeddingIds.map((value, i) => [value, i]));
|
||||
const embedMap = new Map(fullEmbedMap);
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const embedSimilarity: Map<any, number> = new Map();
|
||||
let score: number = Number.NEGATIVE_INFINITY;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
let highScoreId: any | null = null;
|
||||
|
||||
for (let i = 0; i < embeddings.length; i++) {
|
||||
@@ -147,6 +153,7 @@ export function getTopKMMREmbeddings(
|
||||
}
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const results: [number, any][] = [];
|
||||
|
||||
const embeddingLength = embeddings.length;
|
||||
|
||||
@@ -77,6 +77,7 @@ export interface LlamaIndexEventMaps {
|
||||
"agent-end": AgentEndEvent;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export class LlamaIndexCustomEvent<T = any> extends CustomEvent<T> {
|
||||
reason: EventCaller | null = null;
|
||||
private constructor(
|
||||
@@ -103,6 +104,7 @@ export class LlamaIndexCustomEvent<T = any> extends CustomEvent<T> {
|
||||
type EventHandler<Event> = (event: LlamaIndexCustomEvent<Event>) => void;
|
||||
|
||||
export class CallbackManager {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
#handlers = new Map<keyof LlamaIndexEventMaps, EventHandler<any>[]>();
|
||||
|
||||
on<K extends keyof LlamaIndexEventMaps>(
|
||||
|
||||
@@ -4,7 +4,7 @@ const chunkSizeAsyncLocalStorage = new AsyncLocalStorage<number | undefined>();
|
||||
let globalChunkSize: number = 1024;
|
||||
|
||||
export function getChunkSize(): number {
|
||||
return globalChunkSize ?? chunkSizeAsyncLocalStorage.getStore();
|
||||
return chunkSizeAsyncLocalStorage.getStore() ?? globalChunkSize;
|
||||
}
|
||||
|
||||
export function setChunkSize(chunkSize: number | undefined) {
|
||||
|
||||
@@ -5,7 +5,7 @@ const llmAsyncLocalStorage = new AsyncLocalStorage<LLM>();
|
||||
let globalLLM: LLM | undefined;
|
||||
|
||||
export function getLLM(): LLM {
|
||||
const currentLLM = globalLLM ?? llmAsyncLocalStorage.getStore();
|
||||
const currentLLM = llmAsyncLocalStorage.getStore() ?? globalLLM;
|
||||
if (!currentLLM) {
|
||||
throw new Error(
|
||||
"Cannot find LLM, please set `Settings.llm = ...` on the top of your code",
|
||||
|
||||
@@ -4,7 +4,7 @@ const chunkSizeAsyncLocalStorage = new AsyncLocalStorage<Tokenizer>();
|
||||
let globalTokenizer: Tokenizer = tokenizers.tokenizer();
|
||||
|
||||
export function getTokenizer(): Tokenizer {
|
||||
return globalTokenizer ?? chunkSizeAsyncLocalStorage.getStore();
|
||||
return chunkSizeAsyncLocalStorage.getStore() ?? globalTokenizer;
|
||||
}
|
||||
|
||||
export function setTokenizer(tokenizer: Tokenizer | undefined) {
|
||||
|
||||
@@ -194,7 +194,7 @@ export type ToolResultOptions = {
|
||||
export type ToolCallLLMMessageOptions =
|
||||
| ToolResultOptions
|
||||
| ToolCallOptions
|
||||
| {};
|
||||
| object;
|
||||
|
||||
type Known =
|
||||
| { [key: string]: Known }
|
||||
@@ -220,6 +220,7 @@ export type ToolMetadata<
|
||||
/**
|
||||
* Simple Tool interface. Likely to change.
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export interface BaseTool<Input = any> {
|
||||
/**
|
||||
* This could be undefined if the implementation is not provided,
|
||||
@@ -232,6 +233,7 @@ export interface BaseTool<Input = any> {
|
||||
Input extends Known ? ToolMetadata<JSONSchemaType<Input>> : ToolMetadata;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export type BaseToolWithCall<Input = any> = Omit<BaseTool<Input>, "call"> & {
|
||||
call: NonNullable<Pick<BaseTool<Input>, "call">["call"]>;
|
||||
};
|
||||
|
||||
@@ -16,30 +16,38 @@ export abstract class BaseObjectNodeMapping {
|
||||
abstract fromObjects<OT>(objs: OT[], ...args: any[]): BaseObjectNodeMapping;
|
||||
|
||||
// Abstract methods in TypeScript
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
abstract objNodeMapping(): Record<any, any>;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
abstract toNode(obj: any): TextNode;
|
||||
|
||||
// Concrete methods can be defined as usual
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
validateObject(obj: any): void {}
|
||||
|
||||
// Implementing the add object logic
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
addObj(obj: any): void {
|
||||
this.validateObject(obj);
|
||||
this._addObj(obj);
|
||||
}
|
||||
|
||||
// Abstract method for internal add object logic
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
abstract _addObj(obj: any): void;
|
||||
|
||||
// Implementing toNodes method
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
toNodes(objs: any[]): TextNode[] {
|
||||
return objs.map((obj) => this.toNode(obj));
|
||||
}
|
||||
|
||||
// Abstract method for internal from node logic
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
abstract _fromNode(node: BaseNode): any;
|
||||
|
||||
// Implementing fromNode method
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
fromNode(node: BaseNode): any {
|
||||
const obj = this._fromNode(node);
|
||||
this.validateObject(obj);
|
||||
|
||||
@@ -125,6 +125,7 @@ type Permutation<T, K = T> = [T] extends [never]
|
||||
? [K, ...Permutation<Exclude<T, K>>]
|
||||
: never;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
type Join<T extends any[], U extends string> = T extends [infer F, ...infer R]
|
||||
? R["length"] extends 0
|
||||
? `${F & string}`
|
||||
|
||||
@@ -151,7 +151,6 @@ class Refine extends BaseSynthesizer {
|
||||
return response as AsyncIterable<string> | string;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line max-params
|
||||
private async refineResponseSingle(
|
||||
initialReponse: string,
|
||||
query: MessageContent,
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// eslint-disable-next-line max-params
|
||||
import type { MessageContentDetail } from "../llms";
|
||||
import type { BasePromptTemplate } from "../prompts";
|
||||
import {
|
||||
@@ -29,7 +28,7 @@ async function createContentPerModality(
|
||||
},
|
||||
];
|
||||
case ModalityType.IMAGE:
|
||||
const images: MessageContentDetail[] = await Promise.all(
|
||||
return Promise.all(
|
||||
(nodes as ImageNode[]).map(async (node) => {
|
||||
return {
|
||||
type: "image_url",
|
||||
@@ -39,7 +38,6 @@ async function createContentPerModality(
|
||||
} satisfies MessageContentDetail;
|
||||
}),
|
||||
);
|
||||
return images;
|
||||
default:
|
||||
return [];
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ export enum MetadataMode {
|
||||
NONE = "NONE",
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export type Metadata = Record<string, any>;
|
||||
|
||||
export interface RelatedNodeInfo<T extends Metadata = Metadata> {
|
||||
@@ -176,6 +177,7 @@ export abstract class BaseNode<T extends Metadata = Metadata> {
|
||||
* Properties are read-only as they are not deep-cloned (not necessary for stringification).
|
||||
* @see toMutableJSON - use to return a mutable JSON instead
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
toJSON(): Record<string, any> {
|
||||
return {
|
||||
...this,
|
||||
@@ -194,6 +196,7 @@ export abstract class BaseNode<T extends Metadata = Metadata> {
|
||||
* Properties can be safely modified as a deep clone of the properties are created.
|
||||
* @return {Record<string, any>} - The JSON representation of the object.
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
toMutableJSON(): Record<string, any> {
|
||||
return structuredClone(this.toJSON());
|
||||
}
|
||||
@@ -328,6 +331,7 @@ export class Document<T extends Metadata = Metadata> extends TextNode<T> {
|
||||
}
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export function jsonToNode(json: any, type?: ObjectType) {
|
||||
if (!json.type && !type) {
|
||||
throw new Error("Node type not found");
|
||||
|
||||
@@ -8,10 +8,12 @@ interface TransformComponentSignature {
|
||||
): Promise<BaseNode[]>;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging
|
||||
export interface TransformComponent extends TransformComponentSignature {
|
||||
id: string;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging
|
||||
export class TransformComponent {
|
||||
constructor(transformFn: TransformComponentSignature) {
|
||||
Object.defineProperties(
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/**
|
||||
* An OutputParser is used to extract structured data from the raw output of the LLM.
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export interface BaseOutputParser<T = any> {
|
||||
parse(output: string): T;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ const emitOnce = false;
|
||||
|
||||
export function chunkSizeCheck<
|
||||
This extends { id_: string },
|
||||
Args extends any[],
|
||||
Args extends [],
|
||||
Return,
|
||||
>(
|
||||
contentGetter: (this: This, ...args: Args) => string,
|
||||
|
||||
@@ -14,6 +14,7 @@ export class FunctionTool<T, R extends JSONValue | Promise<JSONValue>>
|
||||
#fn: (input: T) => R;
|
||||
#metadata: ToolMetadata<JSONSchemaType<T>>;
|
||||
// todo: for the future, we can use zod to validate the input parameters
|
||||
// eslint-disable-next-line no-unused-private-class-members
|
||||
#zodType: z.ZodType<T> | null = null;
|
||||
constructor(
|
||||
fn: (input: T) => R,
|
||||
@@ -37,6 +38,7 @@ export class FunctionTool<T, R extends JSONValue | Promise<JSONValue>>
|
||||
parameters: R;
|
||||
},
|
||||
): FunctionTool<T, JSONValue>;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
static from(fn: any, schema: any): any {
|
||||
if (schema.parameter instanceof z.ZodSchema) {
|
||||
const jsonSchema = zodToJsonSchema(schema.parameter);
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
type ObjectEntries<T extends Record<string, any>> = {
|
||||
[K in keyof T]: [K, T[K]];
|
||||
}[keyof T][];
|
||||
@@ -5,6 +6,7 @@ type ObjectEntries<T extends Record<string, any>> = {
|
||||
/**
|
||||
* Type safe version of `Object.entries`
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export function objectEntries<T extends Record<string, any>>(
|
||||
obj: T,
|
||||
): ObjectEntries<{
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* should compatible with npm:pg and npm:postgres
|
||||
*/
|
||||
export interface IsomorphicDB {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
query: (sql: string, params?: any[]) => Promise<any[]>;
|
||||
// begin will wrap the multiple queries in a transaction
|
||||
begin: <T>(fn: (query: IsomorphicDB["query"]) => Promise<T>) => Promise<T>;
|
||||
|
||||
@@ -5,6 +5,7 @@ export class Context {
|
||||
#workflow: Workflow;
|
||||
#queues: Map<StepFunction, WorkflowEvent[]> = new Map();
|
||||
#eventBuffer: Map<EventTypes, WorkflowEvent[]> = new Map();
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
#globals: Map<string, any> = new Map();
|
||||
#streamingQueue: WorkflowEvent[] = [];
|
||||
running: boolean = true;
|
||||
@@ -15,10 +16,12 @@ export class Context {
|
||||
this.#verbose = params.verbose ?? false;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
set(key: string, value: any): void {
|
||||
this.#globals.set(key, value);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
get(key: string, defaultValue?: any): any {
|
||||
if (this.#globals.has(key)) {
|
||||
return this.#globals.get(key);
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export class WorkflowEvent<T extends Record<string, any> = any> {
|
||||
data: T;
|
||||
|
||||
@@ -10,6 +11,7 @@ export class WorkflowEvent<T extends Record<string, any> = any> {
|
||||
}
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export type EventTypes<T extends Record<string, any> = any> = new (
|
||||
data: T,
|
||||
) => WorkflowEvent<T>;
|
||||
|
||||
@@ -15,6 +15,7 @@ type EventTypeParam = EventTypes | EventTypes[];
|
||||
|
||||
export class Workflow {
|
||||
#steps: Map<
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
StepFunction<any>,
|
||||
{ inputs: EventTypes[]; outputs: EventTypes[] | undefined }
|
||||
> = new Map();
|
||||
@@ -49,10 +50,12 @@ export class Workflow {
|
||||
this.#steps.set(method, { inputs, outputs });
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
hasStep(step: StepFunction<any>): boolean {
|
||||
return this.#steps.has(step);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
#acceptsEvent(step: StepFunction<any>, event: WorkflowEvent): boolean {
|
||||
const eventType = event.constructor as EventTypes;
|
||||
const stepInfo = this.#steps.get(step);
|
||||
|
||||
@@ -6,6 +6,7 @@ import { beforeEach, describe, expect, test } from "vitest";
|
||||
describe("ChatMemoryBuffer", () => {
|
||||
beforeEach(() => {
|
||||
// Mock the Settings.llm
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
(Settings.llm as any) = {
|
||||
metadata: {
|
||||
contextWindow: 1000,
|
||||
|
||||
@@ -59,7 +59,7 @@ JSON Data:` as const;
|
||||
test("PromptTemplate", () => {
|
||||
{
|
||||
new PromptTemplate({
|
||||
// @ts-expect-error
|
||||
// @ts-expect-error expected error
|
||||
template: "",
|
||||
templateVars: ["var1"],
|
||||
});
|
||||
@@ -72,7 +72,7 @@ JSON Data:` as const;
|
||||
}
|
||||
{
|
||||
new PromptTemplate({
|
||||
// @ts-expect-error
|
||||
// @ts-expect-error expected error
|
||||
template: "{var1 }",
|
||||
templateVars: ["var1"],
|
||||
});
|
||||
@@ -90,7 +90,7 @@ JSON Data:` as const;
|
||||
const template = "{var2}" as const;
|
||||
const templateVars = ["var1"] as const;
|
||||
new PromptTemplate({
|
||||
// @ts-expect-error
|
||||
// @ts-expect-error expected error
|
||||
template,
|
||||
templateVars,
|
||||
});
|
||||
|
||||
@@ -55,6 +55,7 @@ class MockObject1 extends PromptMixin {
|
||||
this.barPrompt = mockPrompt;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
protected _getPrompts(): { [x: string]: any } {
|
||||
return {
|
||||
bar: this.barPrompt,
|
||||
@@ -62,10 +63,12 @@ class MockObject1 extends PromptMixin {
|
||||
};
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
protected _getPromptModules(): { [x: string]: any } {
|
||||
return { mock_object_2: this.mockObject2 };
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
_updatePrompts(promptsDict: { [x: string]: any }): void {
|
||||
if ("bar" in promptsDict) {
|
||||
this.barPrompt = promptsDict["bar"];
|
||||
|
||||
@@ -17,8 +17,11 @@ class AnalysisEvent extends WorkflowEvent<{ analysis: string }> {}
|
||||
|
||||
describe("Workflow", () => {
|
||||
let mockLLM: Mocked<OpenAI>;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
let generateJoke: Mocked<any>;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
let critiqueJoke: Mocked<any>;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
let analyzeJoke: Mocked<any>;
|
||||
beforeEach(() => {
|
||||
mockLLM = new OpenAI() as Mocked<OpenAI>;
|
||||
|
||||
Vendored
+1
-1
@@ -68,7 +68,7 @@
|
||||
"test": "vitest"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^22.5.1",
|
||||
"@types/node": "^22.8.4",
|
||||
"@types/readable-stream": "^4.0.15",
|
||||
"@xenova/transformers": "^2.17.2",
|
||||
"bunchee": "5.5.1",
|
||||
|
||||
Vendored
+1
-1
@@ -2733,7 +2733,7 @@ var require_get_intrinsic = __commonJS({
|
||||
"%encodeURIComponent%": encodeURIComponent,
|
||||
"%Error%": Error,
|
||||
"%eval%": eval,
|
||||
// eslint-disable-line no-eval
|
||||
|
||||
"%EvalError%": EvalError,
|
||||
"%Float32Array%":
|
||||
typeof Float32Array === "undefined" ? undefined2 : Float32Array,
|
||||
|
||||
Vendored
+1
-1
@@ -15,7 +15,7 @@ export {
|
||||
export { Tokenizers, tokenizers, type Tokenizer } from "./tokenizers/js.js";
|
||||
export { NotSupportCurrentRuntimeClass } from "./utils/shared.js";
|
||||
export * from "./web-polyfill.js";
|
||||
// @ts-expect-error
|
||||
// @ts-expect-error no type
|
||||
if (typeof window === "undefined") {
|
||||
console.warn(
|
||||
"You are not in a browser environment. This module is not supposed to be used in a non-browser environment.",
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ export {
|
||||
export async function loadTransformers(onLoad: OnLoad) {
|
||||
if (getTransformers() === null) {
|
||||
setTransformers(
|
||||
// @ts-expect-error
|
||||
// @ts-expect-error no type
|
||||
await import("https://cdn.jsdelivr.net/npm/@xenova/transformers@2.17.2"),
|
||||
);
|
||||
} else {
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ export async function loadTransformers(onLoad: OnLoad) {
|
||||
'"@xenova/transformers" is not officially supported in this environment, some features may not work as expected.',
|
||||
);
|
||||
setTransformers(
|
||||
// @ts-expect-error
|
||||
// @ts-expect-error no type
|
||||
await import("@xenova/transformers/dist/transformers"),
|
||||
);
|
||||
} else {
|
||||
|
||||
Vendored
+6
@@ -89,11 +89,13 @@
|
||||
export function fileURLToPath(href: string, separator: string): string {
|
||||
// conform with Node.js fileURLToPath
|
||||
if (!href.includes(":/")) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const error = new Error("Invalid URL") as any;
|
||||
error.code = "ERR_INVALID_URL";
|
||||
throw error;
|
||||
}
|
||||
if (!href.startsWith("file:")) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const error = new Error("The URL must be of scheme file") as any;
|
||||
error.code = "ERR_INVALID_URL_SCHEME";
|
||||
throw error;
|
||||
@@ -111,6 +113,7 @@ export function fileURLToPath(href: string, separator: string): string {
|
||||
// is full path, e.g. file:///foo
|
||||
file = href.substring(8);
|
||||
if (file[1] !== ":") {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const error = new Error("File URL path must be absolute") as any;
|
||||
error.code = "ERR_INVALID_FILE_URL_PATH";
|
||||
throw error;
|
||||
@@ -120,6 +123,7 @@ export function fileURLToPath(href: string, separator: string): string {
|
||||
// conform with Node.js fileURLToPath
|
||||
file = href.substring(17); // trim leading slash
|
||||
if (file[1] !== ":") {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const error = new Error("File URL path must be absolute") as any;
|
||||
error.code = "ERR_INVALID_FILE_URL_PATH";
|
||||
throw error;
|
||||
@@ -134,6 +138,7 @@ export function fileURLToPath(href: string, separator: string): string {
|
||||
// conform with Node.js fileURLToPath
|
||||
file = href.substring(6);
|
||||
if (file[1] !== ":") {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const error = new Error("File URL path must be absolute") as any;
|
||||
error.code = "ERR_INVALID_FILE_URL_PATH";
|
||||
throw error;
|
||||
@@ -154,6 +159,7 @@ export function fileURLToPath(href: string, separator: string): string {
|
||||
if (!href.startsWith("file://localhost/")) {
|
||||
const error = new Error(
|
||||
'File URL host must be "localhost" or empty',
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
) as any;
|
||||
error.code = "ERR_INVALID_FILE_URL_HOST";
|
||||
throw error;
|
||||
|
||||
Vendored
+5
-2
@@ -34,11 +34,11 @@ export function getEnv(name: string): string | undefined {
|
||||
return INTERNAL_ENV[name];
|
||||
}
|
||||
if (typeof process === "undefined" || typeof process.env === "undefined") {
|
||||
// @ts-expect-error
|
||||
// @ts-expect-error Deno is not defined
|
||||
if (typeof Deno === "undefined") {
|
||||
throw new Error("Current environment is not supported");
|
||||
} else {
|
||||
// @ts-expect-error
|
||||
// @ts-expect-error Deno is not defined
|
||||
return Deno.env.get(name);
|
||||
}
|
||||
}
|
||||
@@ -51,6 +51,7 @@ interface EventInit {
|
||||
composed?: boolean;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
interface CustomEventInit<T = any> extends EventInit {
|
||||
detail?: T;
|
||||
}
|
||||
@@ -60,6 +61,7 @@ export { AsyncLocalStorage } from "node:async_hooks";
|
||||
|
||||
// Node.js 18 doesn't have CustomEvent by default
|
||||
// Refs: https://github.com/nodejs/node/issues/40678
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
class CustomEvent<T = any> extends Event {
|
||||
readonly #detail: T;
|
||||
get detail(): T {
|
||||
@@ -79,6 +81,7 @@ class CustomEvent<T = any> extends Event {
|
||||
}
|
||||
|
||||
const defaultCustomEvent: typeof CustomEvent =
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
(globalThis as any).CustomEvent || CustomEvent;
|
||||
|
||||
export { defaultCustomEvent as CustomEvent };
|
||||
|
||||
Vendored
+5
@@ -17,14 +17,17 @@ export function getEnv(name: string): string | undefined {
|
||||
// Wait for https://github.com/tc39/proposal-async-context
|
||||
export class AsyncLocalStorage<T> {
|
||||
#store: T = null!;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
static bind<Func extends (...args: any[]) => any>(fn: Func): Func {
|
||||
return fn;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
static snapshot(): <R, TArgs extends any[]>(
|
||||
fn: (...args: TArgs) => R,
|
||||
...args: TArgs
|
||||
) => R {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
return (cb: any, ...args: any[]) => cb(...args);
|
||||
}
|
||||
|
||||
@@ -42,10 +45,12 @@ export class AsyncLocalStorage<T> {
|
||||
}
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const defaultCustomEvent = (globalThis as any).CustomEvent;
|
||||
|
||||
export { defaultCustomEvent as CustomEvent };
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const defaultProcess: NodeJS.Process = (globalThis as any).process || {};
|
||||
const processProxy = new Proxy(defaultProcess, {
|
||||
get(_target, prop) {
|
||||
|
||||
Vendored
+4
-3
@@ -8,18 +8,19 @@ export class NotSupportCurrentRuntimeClass {
|
||||
constructor(...args: any[]) {
|
||||
super(runtime);
|
||||
}
|
||||
} as any;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// This is a workaround for the lack of globalThis in some environments
|
||||
// It's being used across multiple places inside the `env` package
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export const glo: any =
|
||||
typeof globalThis !== "undefined"
|
||||
? globalThis
|
||||
: // @ts-expect-error
|
||||
: // @ts-expect-error globalThis is not defined
|
||||
typeof window !== "undefined"
|
||||
? // @ts-expect-error
|
||||
? // @ts-expect-error window is not defined
|
||||
window
|
||||
: typeof global !== "undefined"
|
||||
? global
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# @llamaindex/experimental
|
||||
|
||||
## 0.0.113
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- llamaindex@0.8.1
|
||||
|
||||
## 0.0.112
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@llamaindex/experimental",
|
||||
"description": "Experimental package for LlamaIndexTS",
|
||||
"version": "0.0.112",
|
||||
"version": "0.0.113",
|
||||
"type": "module",
|
||||
"types": "dist/type/index.d.ts",
|
||||
"main": "dist/cjs/index.js",
|
||||
@@ -64,7 +64,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/lodash": "^4.17.7",
|
||||
"@types/node": "^22.5.1",
|
||||
"@types/node": "^22.8.4",
|
||||
"jsonpath": "^1.1.1",
|
||||
"llamaindex": "workspace:*",
|
||||
"lodash": "^4.17.21"
|
||||
|
||||
@@ -1,5 +1,23 @@
|
||||
# llamaindex
|
||||
|
||||
## 0.8.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [9c73f0a]
|
||||
- @llamaindex/core@0.4.1
|
||||
- @llamaindex/cloud@2.0.1
|
||||
- @llamaindex/anthropic@0.0.10
|
||||
- @llamaindex/clip@0.0.10
|
||||
- @llamaindex/deepinfra@0.0.10
|
||||
- @llamaindex/huggingface@0.0.10
|
||||
- @llamaindex/ollama@0.0.17
|
||||
- @llamaindex/openai@0.1.26
|
||||
- @llamaindex/portkey-ai@0.0.10
|
||||
- @llamaindex/replicate@0.0.10
|
||||
- @llamaindex/readers@1.0.1
|
||||
- @llamaindex/groq@0.0.25
|
||||
|
||||
## 0.8.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# @llamaindex/cloudflare-worker-agent-test
|
||||
|
||||
## 0.0.97
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- llamaindex@0.8.1
|
||||
|
||||
## 0.0.96
|
||||
|
||||
### Patch Changes
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user