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 | |
|---|---|---|---|
| b2364dc5ba | |||
| 67f4db8501 | |||
| e4151a8b02 | |||
| 4d4cd8ac6b | |||
| 4fc001c8de | |||
| cf675bdc7a |
@@ -1,5 +1,13 @@
|
||||
# docs
|
||||
|
||||
## 0.0.113
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [4fc001c]
|
||||
- Updated dependencies [4d4cd8a]
|
||||
- llamaindex@0.8.9
|
||||
|
||||
## 0.0.112
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "docs",
|
||||
"version": "0.0.112",
|
||||
"version": "0.0.113",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"docusaurus": "docusaurus",
|
||||
|
||||
@@ -1,5 +1,18 @@
|
||||
# @llamaindex/doc
|
||||
|
||||
## 0.0.11
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [4fc001c]
|
||||
- Updated dependencies [4d4cd8a]
|
||||
- llamaindex@0.8.9
|
||||
- @llamaindex/cloud@2.0.6
|
||||
- @llamaindex/core@0.4.6
|
||||
- @llamaindex/node-parser@0.0.7
|
||||
- @llamaindex/openai@0.1.31
|
||||
- @llamaindex/readers@1.0.7
|
||||
|
||||
## 0.0.10
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@llamaindex/doc",
|
||||
"version": "0.0.10",
|
||||
"version": "0.0.11",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "pnpm run build:docs && next build",
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# @llamaindex/cloudflare-worker-agent-test
|
||||
|
||||
## 0.0.105
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [4fc001c]
|
||||
- Updated dependencies [4d4cd8a]
|
||||
- llamaindex@0.8.9
|
||||
|
||||
## 0.0.104
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@llamaindex/cloudflare-worker-agent-test",
|
||||
"version": "0.0.104",
|
||||
"version": "0.0.105",
|
||||
"type": "module",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# @llamaindex/llama-parse-browser-test
|
||||
|
||||
## 0.0.26
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @llamaindex/cloud@2.0.6
|
||||
|
||||
## 0.0.25
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@llamaindex/llama-parse-browser-test",
|
||||
"private": true,
|
||||
"version": "0.0.25",
|
||||
"version": "0.0.26",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# @llamaindex/next-agent-test
|
||||
|
||||
## 0.1.105
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [4fc001c]
|
||||
- Updated dependencies [4d4cd8a]
|
||||
- llamaindex@0.8.9
|
||||
|
||||
## 0.1.104
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@llamaindex/next-agent-test",
|
||||
"version": "0.1.104",
|
||||
"version": "0.1.105",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# test-edge-runtime
|
||||
|
||||
## 0.1.104
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [4fc001c]
|
||||
- Updated dependencies [4d4cd8a]
|
||||
- llamaindex@0.8.9
|
||||
|
||||
## 0.1.103
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@llamaindex/nextjs-edge-runtime-test",
|
||||
"version": "0.1.103",
|
||||
"version": "0.1.104",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# @llamaindex/next-node-runtime
|
||||
|
||||
## 0.0.86
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [4fc001c]
|
||||
- Updated dependencies [4d4cd8a]
|
||||
- llamaindex@0.8.9
|
||||
|
||||
## 0.0.85
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@llamaindex/next-node-runtime-test",
|
||||
"version": "0.0.85",
|
||||
"version": "0.0.86",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
|
||||
@@ -15,7 +15,6 @@ Settings.llm = new OpenAI({
|
||||
});
|
||||
Settings.embedModel = new HuggingFaceEmbedding({
|
||||
modelType: "BAAI/bge-small-en-v1.5",
|
||||
quantized: false,
|
||||
});
|
||||
Settings.callbackManager.on("llm-tool-call", (event) => {
|
||||
console.log(event.detail);
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# @llamaindex/waku-query-engine-test
|
||||
|
||||
## 0.0.105
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [4fc001c]
|
||||
- Updated dependencies [4d4cd8a]
|
||||
- llamaindex@0.8.9
|
||||
|
||||
## 0.0.104
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@llamaindex/waku-query-engine-test",
|
||||
"version": "0.0.104",
|
||||
"version": "0.0.105",
|
||||
"type": "module",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
import { OpenAI } from "./openai.js";
|
||||
|
||||
export class Ollama extends OpenAI {}
|
||||
+11
-1
@@ -15,7 +15,17 @@ export async function resolve(specifier, context, nextResolve) {
|
||||
const targetUrl = fileURLToPath(result.url).replace(/\.js$/, ".ts");
|
||||
let relativePath = relative(packageDistDir, targetUrl);
|
||||
// todo: make it more generic if we have more sub modules fixtures in the future
|
||||
if (relativePath.startsWith("../../llm/openai")) {
|
||||
if (relativePath.startsWith("../../llm/anthropic")) {
|
||||
relativePath = relativePath.replace(
|
||||
"../../llm/ollama/dist/index.ts",
|
||||
"llm/anthropic.ts",
|
||||
);
|
||||
} else if (relativePath.startsWith("../../llm/ollama")) {
|
||||
relativePath = relativePath.replace(
|
||||
"../../llm/ollama/dist/index.ts",
|
||||
"llm/ollama.ts",
|
||||
);
|
||||
} else if (relativePath.startsWith("../../llm/openai")) {
|
||||
relativePath = relativePath.replace(
|
||||
"../../llm/openai/dist/index.ts",
|
||||
"llm/openai.ts",
|
||||
|
||||
@@ -64,7 +64,7 @@ await test("clip embedding", async (t) => {
|
||||
});
|
||||
|
||||
await t.test("custom transformer", async () => {
|
||||
const transformers = await import("@xenova/transformers");
|
||||
const transformers = await import("@huggingface/transformers");
|
||||
const getter = test.mock.fn((t, k, r) => {
|
||||
return Reflect.get(t, k, r);
|
||||
});
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
import { Ollama } from "@llamaindex/ollama";
|
||||
import assert from "node:assert";
|
||||
import { test } from "node:test";
|
||||
import { getWeatherTool } from "./fixtures/tools.js";
|
||||
import { mockLLMEvent } from "./utils.js";
|
||||
|
||||
await test("ollama", async (t) => {
|
||||
await mockLLMEvent(t, "ollama");
|
||||
await t.test("ollama function call", async (t) => {
|
||||
const llm = new Ollama({
|
||||
model: "llama3.2",
|
||||
});
|
||||
const chatResponse = await llm.chat({
|
||||
messages: [
|
||||
{
|
||||
role: "user",
|
||||
content: "What is the weather in Paris?",
|
||||
},
|
||||
],
|
||||
tools: [getWeatherTool],
|
||||
});
|
||||
if (
|
||||
chatResponse.message.options &&
|
||||
"toolCall" in chatResponse.message.options
|
||||
) {
|
||||
assert.equal(chatResponse.message.options.toolCall.length, 1);
|
||||
assert.equal(
|
||||
chatResponse.message.options.toolCall[0]!.name,
|
||||
getWeatherTool.metadata.name,
|
||||
);
|
||||
} else {
|
||||
throw new Error("Expected tool calls in response");
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"llmEventStart": [
|
||||
{
|
||||
"id": "PRESERVE_0",
|
||||
"messages": [
|
||||
{
|
||||
"role": "user",
|
||||
"content": "What is the weather in Paris?"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"llmEventEnd": [
|
||||
{
|
||||
"id": "PRESERVE_0",
|
||||
"response": {
|
||||
"message": {
|
||||
"role": "assistant",
|
||||
"content": "",
|
||||
"options": {
|
||||
"toolCall": [
|
||||
{
|
||||
"name": "getWeather",
|
||||
"input": {
|
||||
"city": "Paris"
|
||||
},
|
||||
"id": "5d198775-5268-4552-993b-9ecb4425385b"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"raw": null
|
||||
}
|
||||
}
|
||||
],
|
||||
"llmEventStream": []
|
||||
}
|
||||
+2
-1
@@ -12,10 +12,11 @@
|
||||
"@faker-js/faker": "^9.2.0",
|
||||
"@llamaindex/core": "workspace:*",
|
||||
"@llamaindex/env": "workspace:*",
|
||||
"@llamaindex/ollama": "workspace:*",
|
||||
"@llamaindex/openai": "workspace:*",
|
||||
"@types/node": "^22.9.0",
|
||||
"@types/pg": "^8.11.8",
|
||||
"@xenova/transformers": "^2.17.2",
|
||||
"@huggingface/transformers": "^3.0.2",
|
||||
"consola": "^3.2.3",
|
||||
"dotenv": "^16.4.5",
|
||||
"llamaindex": "workspace:*",
|
||||
|
||||
@@ -14,7 +14,6 @@ Settings.llm = new Ollama({
|
||||
|
||||
Settings.embedModel = new HuggingFaceEmbedding({
|
||||
modelType: "BAAI/bge-small-en-v1.5",
|
||||
quantized: false,
|
||||
});
|
||||
|
||||
async function main() {
|
||||
|
||||
@@ -35,12 +35,6 @@
|
||||
"typescript-eslint": "^8.13.0"
|
||||
},
|
||||
"packageManager": "pnpm@9.12.3",
|
||||
"pnpm": {
|
||||
"overrides": {
|
||||
"trim": "1.0.1",
|
||||
"protobufjs": "7.2.6"
|
||||
}
|
||||
},
|
||||
"lint-staged": {
|
||||
"(!apps/docs/i18n/**/docusaurus-plugin-content-docs/current/api/*).{js,jsx,ts,tsx,md}": "prettier --write"
|
||||
}
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# @llamaindex/autotool
|
||||
|
||||
## 5.0.9
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [4fc001c]
|
||||
- Updated dependencies [4d4cd8a]
|
||||
- llamaindex@0.8.9
|
||||
|
||||
## 5.0.8
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
# @llamaindex/autotool-01-node-example
|
||||
|
||||
## 0.0.52
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [4fc001c]
|
||||
- Updated dependencies [4d4cd8a]
|
||||
- llamaindex@0.8.9
|
||||
- @llamaindex/autotool@5.0.9
|
||||
|
||||
## 0.0.51
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -13,5 +13,5 @@
|
||||
"scripts": {
|
||||
"start": "node --import tsx --import @llamaindex/autotool/node ./src/index.ts"
|
||||
},
|
||||
"version": "0.0.51"
|
||||
"version": "0.0.52"
|
||||
}
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
# @llamaindex/autotool-02-next-example
|
||||
|
||||
## 0.1.96
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [4fc001c]
|
||||
- Updated dependencies [4d4cd8a]
|
||||
- llamaindex@0.8.9
|
||||
- @llamaindex/autotool@5.0.9
|
||||
|
||||
## 0.1.95
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@llamaindex/autotool-02-next-example",
|
||||
"private": true,
|
||||
"version": "0.1.95",
|
||||
"version": "0.1.96",
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
"build": "next build",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@llamaindex/autotool",
|
||||
"type": "module",
|
||||
"version": "5.0.8",
|
||||
"version": "5.0.9",
|
||||
"description": "auto transpile your JS function to LLM Agent compatible",
|
||||
"files": [
|
||||
"dist",
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# @llamaindex/cloud
|
||||
|
||||
## 2.0.6
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [4fc001c]
|
||||
- @llamaindex/env@0.1.20
|
||||
- @llamaindex/core@0.4.6
|
||||
|
||||
## 2.0.5
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@llamaindex/cloud",
|
||||
"version": "2.0.5",
|
||||
"version": "2.0.6",
|
||||
"type": "module",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# @llamaindex/community
|
||||
|
||||
## 0.0.64
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [4fc001c]
|
||||
- @llamaindex/env@0.1.20
|
||||
- @llamaindex/core@0.4.6
|
||||
|
||||
## 0.0.63
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@llamaindex/community",
|
||||
"description": "Community package for LlamaIndexTS",
|
||||
"version": "0.0.63",
|
||||
"version": "0.0.64",
|
||||
"type": "module",
|
||||
"types": "dist/type/index.d.ts",
|
||||
"main": "dist/cjs/index.js",
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
# @llamaindex/core
|
||||
|
||||
## 0.4.6
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [4fc001c]
|
||||
- @llamaindex/env@0.1.20
|
||||
|
||||
## 0.4.5
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@llamaindex/core",
|
||||
"type": "module",
|
||||
"version": "0.4.5",
|
||||
"version": "0.4.6",
|
||||
"description": "LlamaIndex Core Module",
|
||||
"exports": {
|
||||
"./agent": {
|
||||
|
||||
@@ -398,7 +398,12 @@ export abstract class AgentRunner<
|
||||
return output.pipeThrough(
|
||||
new TransformStream<EngineResponse>({
|
||||
transform(chunk, controller) {
|
||||
controller.enqueue(EngineResponse.fromChatResponseChunk(chunk));
|
||||
controller.enqueue(
|
||||
EngineResponse.fromChatResponseChunk(
|
||||
chunk,
|
||||
chunk.sourceNodes,
|
||||
),
|
||||
);
|
||||
},
|
||||
}),
|
||||
);
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { streamConverter } from "../utils";
|
||||
import { extractText } from "../utils/llms";
|
||||
import { extractText, streamConverter } from "../utils";
|
||||
import type {
|
||||
ChatResponse,
|
||||
ChatResponseChunk,
|
||||
|
||||
Vendored
+8
@@ -1,5 +1,13 @@
|
||||
# @llamaindex/env
|
||||
|
||||
## 0.1.20
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 4fc001c: chore: bump `@huggingface/transformers`
|
||||
|
||||
Upgrade to v3, please read https://github.com/huggingface/transformers.js/releases/tag/3.0.0 for more information.
|
||||
|
||||
## 0.1.19
|
||||
|
||||
### Patch Changes
|
||||
|
||||
Vendored
+4
-4
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@llamaindex/env",
|
||||
"description": "environment wrapper, supports all JS environment including node, deno, bun, edge runtime, and cloudflare worker",
|
||||
"version": "0.1.19",
|
||||
"version": "0.1.20",
|
||||
"type": "module",
|
||||
"types": "dist/index.d.ts",
|
||||
"module": "dist/index.js",
|
||||
@@ -124,7 +124,7 @@
|
||||
"devDependencies": {
|
||||
"@types/node": "^22.9.0",
|
||||
"@types/readable-stream": "^4.0.15",
|
||||
"@xenova/transformers": "^2.17.2",
|
||||
"@huggingface/transformers": "^3.0.2",
|
||||
"bunchee": "5.6.1",
|
||||
"gpt-tokenizer": "^2.6.0",
|
||||
"pathe": "^1.1.2",
|
||||
@@ -132,7 +132,7 @@
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@aws-crypto/sha256-js": "^5.2.0",
|
||||
"@xenova/transformers": "^2.17.2",
|
||||
"@huggingface/transformers": "^3.0.2",
|
||||
"gpt-tokenizer": "^2.5.0",
|
||||
"js-tiktoken": "^1.0.12",
|
||||
"pathe": "^1.1.2"
|
||||
@@ -141,7 +141,7 @@
|
||||
"@aws-crypto/sha256-js": {
|
||||
"optional": true
|
||||
},
|
||||
"@xenova/transformers": {
|
||||
"@huggingface/transformers": {
|
||||
"optional": true
|
||||
},
|
||||
"pathe": {
|
||||
|
||||
+4
-2
@@ -8,8 +8,10 @@ export {
|
||||
export async function loadTransformers(onLoad: OnLoad) {
|
||||
if (getTransformers() === null) {
|
||||
setTransformers(
|
||||
// @ts-expect-error no type
|
||||
await import("https://cdn.jsdelivr.net/npm/@xenova/transformers@2.17.2"),
|
||||
await import(
|
||||
// @ts-expect-error no type
|
||||
"https://cdn.jsdelivr.net/npm/@huggingface/transformers@3.0.2"
|
||||
),
|
||||
);
|
||||
} else {
|
||||
return getTransformers()!;
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ export {
|
||||
|
||||
export async function loadTransformers(onLoad: OnLoad) {
|
||||
if (getTransformers() === null) {
|
||||
setTransformers(await import("@xenova/transformers"));
|
||||
setTransformers(await import("@huggingface/transformers"));
|
||||
} else {
|
||||
return getTransformers()!;
|
||||
}
|
||||
|
||||
+4
-4
@@ -9,7 +9,7 @@ export async function loadTransformers(onLoad: OnLoad) {
|
||||
if (getTransformers() === null) {
|
||||
/**
|
||||
* If you see this warning, it means that the current environment does not support the transformer.
|
||||
* because "@xeonva/transformers" highly depends on Node.js APIs.
|
||||
* because "@huggingface/transformers" highly depends on Node.js APIs.
|
||||
*
|
||||
* One possible solution is to fix their implementation to make it work in the non-Node.js environment,
|
||||
* but it's not worth the effort because Edge Runtime and Cloudflare Workers are not the for heavy Machine Learning task.
|
||||
@@ -17,14 +17,14 @@ export async function loadTransformers(onLoad: OnLoad) {
|
||||
* Or you can provide an RPC server that runs the transformer in a Node.js environment.
|
||||
* Or you just run the code in a Node.js environment.
|
||||
*
|
||||
* Refs: https://github.com/xenova/transformers.js/issues/309
|
||||
* Refs: https://github.com/huggingface/transformers.js/issues/309
|
||||
*/
|
||||
console.warn(
|
||||
'"@xenova/transformers" is not officially supported in this environment, some features may not work as expected.',
|
||||
'"@huggingface/transformers" is not officially supported in this environment, some features may not work as expected.',
|
||||
);
|
||||
setTransformers(
|
||||
// @ts-expect-error no type
|
||||
await import("@xenova/transformers/dist/transformers"),
|
||||
await import("@huggingface/transformers/dist/transformers.js"),
|
||||
);
|
||||
} else {
|
||||
return getTransformers()!;
|
||||
|
||||
+4
-4
@@ -1,17 +1,17 @@
|
||||
let transformer: typeof import("@xenova/transformers") | null = null;
|
||||
let transformer: typeof import("@huggingface/transformers") | null = null;
|
||||
|
||||
export function getTransformers() {
|
||||
return transformer;
|
||||
}
|
||||
|
||||
export function setTransformers(t: typeof import("@xenova/transformers")) {
|
||||
export function setTransformers(t: typeof import("@huggingface/transformers")) {
|
||||
transformer = t;
|
||||
}
|
||||
|
||||
export type OnLoad = (
|
||||
transformer: typeof import("@xenova/transformers"),
|
||||
transformer: typeof import("@huggingface/transformers"),
|
||||
) => void;
|
||||
|
||||
export type LoadTransformerEvent = {
|
||||
transformer: typeof import("@xenova/transformers");
|
||||
transformer: typeof import("@huggingface/transformers");
|
||||
};
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# @llamaindex/experimental
|
||||
|
||||
## 0.0.121
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [4fc001c]
|
||||
- Updated dependencies [4d4cd8a]
|
||||
- llamaindex@0.8.9
|
||||
|
||||
## 0.0.120
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@llamaindex/experimental",
|
||||
"description": "Experimental package for LlamaIndexTS",
|
||||
"version": "0.0.120",
|
||||
"version": "0.0.121",
|
||||
"type": "module",
|
||||
"types": "dist/type/index.d.ts",
|
||||
"main": "dist/cjs/index.js",
|
||||
|
||||
@@ -1,5 +1,34 @@
|
||||
# llamaindex
|
||||
|
||||
## 0.8.9
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 4fc001c: chore: bump `@huggingface/transformers`
|
||||
|
||||
Upgrade to v3, please read https://github.com/huggingface/transformers.js/releases/tag/3.0.0 for more information.
|
||||
|
||||
- 4d4cd8a: feat: support ollama tool call
|
||||
|
||||
Note that `OllamaEmbedding` now is not the subclass of `Ollama`.
|
||||
|
||||
- Updated dependencies [4fc001c]
|
||||
- Updated dependencies [4d4cd8a]
|
||||
- @llamaindex/env@0.1.20
|
||||
- @llamaindex/clip@0.0.15
|
||||
- @llamaindex/huggingface@0.0.15
|
||||
- @llamaindex/ollama@0.0.22
|
||||
- @llamaindex/cloud@2.0.6
|
||||
- @llamaindex/core@0.4.6
|
||||
- @llamaindex/node-parser@0.0.7
|
||||
- @llamaindex/anthropic@0.0.15
|
||||
- @llamaindex/deepinfra@0.0.15
|
||||
- @llamaindex/groq@0.0.30
|
||||
- @llamaindex/openai@0.1.31
|
||||
- @llamaindex/portkey-ai@0.0.15
|
||||
- @llamaindex/replicate@0.0.15
|
||||
- @llamaindex/readers@1.0.7
|
||||
|
||||
## 0.8.8
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "llamaindex",
|
||||
"version": "0.8.8",
|
||||
"version": "0.8.9",
|
||||
"license": "MIT",
|
||||
"type": "module",
|
||||
"keywords": [
|
||||
@@ -29,7 +29,7 @@
|
||||
"@discoveryjs/json-ext": "^0.6.1",
|
||||
"@google-cloud/vertexai": "1.2.0",
|
||||
"@google/generative-ai": "0.12.0",
|
||||
"@grpc/grpc-js": "^1.11.1",
|
||||
"@grpc/grpc-js": "^1.12.2",
|
||||
"@llamaindex/anthropic": "workspace:*",
|
||||
"@llamaindex/clip": "workspace:*",
|
||||
"@llamaindex/cloud": "workspace:*",
|
||||
@@ -88,7 +88,7 @@
|
||||
"@swc/cli": "^0.5.0",
|
||||
"@swc/core": "^1.7.22",
|
||||
"@vercel/postgres": "^0.10.0",
|
||||
"@xenova/transformers": "^2.17.2",
|
||||
"@huggingface/transformers": "^3.0.2",
|
||||
"concurrently": "^9.1.0",
|
||||
"glob": "^11.0.0",
|
||||
"pg": "^8.12.0",
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
export * from "@llamaindex/core/agent";
|
||||
export {
|
||||
OllamaAgent,
|
||||
OllamaAgentWorker,
|
||||
type OllamaAgentParams,
|
||||
} from "@llamaindex/ollama";
|
||||
export {
|
||||
AnthropicAgent,
|
||||
AnthropicAgentWorker,
|
||||
@@ -16,7 +21,6 @@ export {
|
||||
ReActAgent,
|
||||
type ReACTAgentParams,
|
||||
} from "./react.js";
|
||||
|
||||
// todo: ParallelAgent
|
||||
// todo: CustomAgent
|
||||
// todo: ReactMultiModal
|
||||
|
||||
@@ -1,7 +1 @@
|
||||
import type { BaseEmbedding } from "@llamaindex/core/embeddings";
|
||||
import { Ollama } from "@llamaindex/ollama";
|
||||
|
||||
/**
|
||||
* OllamaEmbedding is an alias for Ollama that implements the BaseEmbedding interface.
|
||||
*/
|
||||
export class OllamaEmbedding extends Ollama implements BaseEmbedding {}
|
||||
export { OllamaEmbedding } from "@llamaindex/ollama";
|
||||
|
||||
@@ -22,7 +22,7 @@ export default function withLlamaIndex(config: any) {
|
||||
config.experimental.serverComponentsExternalPackages =
|
||||
config.experimental.serverComponentsExternalPackages ?? [];
|
||||
config.experimental.serverComponentsExternalPackages.push(
|
||||
"@xenova/transformers",
|
||||
"@huggingface/transformers",
|
||||
);
|
||||
const userWebpack = config.webpack;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# @llamaindex/node-parser
|
||||
|
||||
## 0.0.7
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [4fc001c]
|
||||
- @llamaindex/env@0.1.20
|
||||
- @llamaindex/core@0.4.6
|
||||
|
||||
## 0.0.6
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@llamaindex/node-parser",
|
||||
"version": "0.0.6",
|
||||
"version": "0.0.7",
|
||||
"description": "Node parser for LlamaIndex",
|
||||
"type": "module",
|
||||
"exports": {
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# @llamaindex/anthropic
|
||||
|
||||
## 0.0.15
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [4fc001c]
|
||||
- @llamaindex/env@0.1.20
|
||||
- @llamaindex/core@0.4.6
|
||||
|
||||
## 0.0.14
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@llamaindex/anthropic",
|
||||
"description": "Anthropic Adapter for LlamaIndex",
|
||||
"version": "0.0.14",
|
||||
"version": "0.0.15",
|
||||
"type": "module",
|
||||
"main": "./dist/index.cjs",
|
||||
"module": "./dist/index.js",
|
||||
|
||||
@@ -1,5 +1,18 @@
|
||||
# @llamaindex/clip
|
||||
|
||||
## 0.0.15
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 4fc001c: chore: bump `@huggingface/transformers`
|
||||
|
||||
Upgrade to v3, please read https://github.com/huggingface/transformers.js/releases/tag/3.0.0 for more information.
|
||||
|
||||
- Updated dependencies [4fc001c]
|
||||
- @llamaindex/env@0.1.20
|
||||
- @llamaindex/core@0.4.6
|
||||
- @llamaindex/openai@0.1.31
|
||||
|
||||
## 0.0.14
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@llamaindex/clip",
|
||||
"description": "Clip Embedding Adapter for LlamaIndex",
|
||||
"version": "0.0.14",
|
||||
"version": "0.0.15",
|
||||
"type": "module",
|
||||
"types": "dist/index.d.ts",
|
||||
"main": "dist/index.cjs",
|
||||
@@ -45,6 +45,9 @@
|
||||
"@llamaindex/core": "workspace:*",
|
||||
"@llamaindex/env": "workspace:*",
|
||||
"@llamaindex/openai": "workspace:*",
|
||||
"@xenova/transformers": "^2.17.2"
|
||||
"@huggingface/transformers": "^3.0.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@huggingface/transformers": "^3.0.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
import { MultiModalEmbedding } from "@llamaindex/core/embeddings";
|
||||
import type { ImageType } from "@llamaindex/core/schema";
|
||||
// only import type, to avoid bundling error
|
||||
import { Settings } from "@llamaindex/core/global";
|
||||
import {
|
||||
type LoadTransformerEvent,
|
||||
loadTransformers,
|
||||
} from "@llamaindex/env/multi-model";
|
||||
import type {
|
||||
CLIPTextModelWithProjection,
|
||||
CLIPVisionModelWithProjection,
|
||||
PreTrainedTokenizer,
|
||||
Processor,
|
||||
} from "@xenova/transformers";
|
||||
} from "@huggingface/transformers";
|
||||
import { Settings } from "@llamaindex/core/global";
|
||||
import {
|
||||
type LoadTransformerEvent,
|
||||
loadTransformers,
|
||||
} from "@llamaindex/env/multi-model";
|
||||
import { ClipEmbeddingModelType } from "./shared";
|
||||
|
||||
declare module "@llamaindex/core/global" {
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
# @llamaindex/deepinfra
|
||||
|
||||
## 0.0.15
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [4fc001c]
|
||||
- @llamaindex/env@0.1.20
|
||||
- @llamaindex/core@0.4.6
|
||||
- @llamaindex/openai@0.1.31
|
||||
|
||||
## 0.0.14
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@llamaindex/deepinfra",
|
||||
"description": "Deepinfra Adapter for LlamaIndex",
|
||||
"version": "0.0.14",
|
||||
"version": "0.0.15",
|
||||
"type": "module",
|
||||
"main": "./dist/index.cjs",
|
||||
"module": "./dist/index.js",
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# @llamaindex/groq
|
||||
|
||||
## 0.0.30
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [4fc001c]
|
||||
- @llamaindex/env@0.1.20
|
||||
- @llamaindex/openai@0.1.31
|
||||
|
||||
## 0.0.29
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@llamaindex/groq",
|
||||
"description": "Groq Adapter for LlamaIndex",
|
||||
"version": "0.0.29",
|
||||
"version": "0.0.30",
|
||||
"type": "module",
|
||||
"main": "./dist/index.cjs",
|
||||
"module": "./dist/index.js",
|
||||
|
||||
@@ -1,5 +1,18 @@
|
||||
# @llamaindex/huggingface
|
||||
|
||||
## 0.0.15
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 4fc001c: chore: bump `@huggingface/transformers`
|
||||
|
||||
Upgrade to v3, please read https://github.com/huggingface/transformers.js/releases/tag/3.0.0 for more information.
|
||||
|
||||
- Updated dependencies [4fc001c]
|
||||
- @llamaindex/env@0.1.20
|
||||
- @llamaindex/core@0.4.6
|
||||
- @llamaindex/openai@0.1.31
|
||||
|
||||
## 0.0.14
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@llamaindex/huggingface",
|
||||
"description": "Huggingface Adapter for LlamaIndex",
|
||||
"version": "0.0.14",
|
||||
"version": "0.0.15",
|
||||
"type": "module",
|
||||
"types": "dist/index.d.ts",
|
||||
"main": "dist/index.cjs",
|
||||
@@ -46,6 +46,9 @@
|
||||
"@llamaindex/core": "workspace:*",
|
||||
"@llamaindex/env": "workspace:*",
|
||||
"@llamaindex/openai": "workspace:*",
|
||||
"@xenova/transformers": "^2.17.2"
|
||||
"@huggingface/transformers": "^3.0.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@huggingface/transformers": "^3.0.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import type { pipeline } from "@huggingface/transformers";
|
||||
import { BaseEmbedding } from "@llamaindex/core/embeddings";
|
||||
import { Settings } from "@llamaindex/core/global";
|
||||
import {
|
||||
type LoadTransformerEvent,
|
||||
loadTransformers,
|
||||
} from "@llamaindex/env/multi-model";
|
||||
import type { pipeline } from "@xenova/transformers";
|
||||
import { HuggingFaceEmbeddingModelType } from "./shared";
|
||||
|
||||
declare module "@llamaindex/core/global" {
|
||||
@@ -13,6 +13,11 @@ declare module "@llamaindex/core/global" {
|
||||
}
|
||||
}
|
||||
|
||||
export type HuggingFaceEmbeddingParams = {
|
||||
modelType?: string;
|
||||
modelOptions?: Parameters<typeof pipeline<"feature-extraction">>[2];
|
||||
};
|
||||
|
||||
/**
|
||||
* Uses feature extraction from '@xenova/transformers' to generate embeddings.
|
||||
* Per default the model [XENOVA_ALL_MINILM_L6_V2](https://huggingface.co/Xenova/all-MiniLM-L6-v2) is used.
|
||||
@@ -28,15 +33,20 @@ declare module "@llamaindex/core/global" {
|
||||
*/
|
||||
export class HuggingFaceEmbedding extends BaseEmbedding {
|
||||
modelType: string = HuggingFaceEmbeddingModelType.XENOVA_ALL_MINILM_L6_V2;
|
||||
quantized: boolean = true;
|
||||
modelOptions: Parameters<typeof pipeline<"feature-extraction">>[2] = {};
|
||||
|
||||
private extractor: Awaited<
|
||||
ReturnType<typeof pipeline<"feature-extraction">>
|
||||
> | null = null;
|
||||
|
||||
constructor(init?: Partial<HuggingFaceEmbedding>) {
|
||||
constructor(params: HuggingFaceEmbeddingParams = {}) {
|
||||
super();
|
||||
Object.assign(this, init);
|
||||
if (params.modelType) {
|
||||
this.modelType = params.modelType;
|
||||
}
|
||||
if (params.modelOptions) {
|
||||
this.modelOptions = params.modelOptions;
|
||||
}
|
||||
}
|
||||
|
||||
async getExtractor() {
|
||||
@@ -50,9 +60,11 @@ export class HuggingFaceEmbedding extends BaseEmbedding {
|
||||
true,
|
||||
);
|
||||
});
|
||||
this.extractor = await pipeline("feature-extraction", this.modelType, {
|
||||
quantized: this.quantized,
|
||||
});
|
||||
this.extractor = await pipeline(
|
||||
"feature-extraction",
|
||||
this.modelType,
|
||||
this.modelOptions,
|
||||
);
|
||||
}
|
||||
return this.extractor;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
export { HuggingFaceEmbedding } from "./embedding";
|
||||
export {
|
||||
HuggingFaceEmbedding,
|
||||
type HuggingFaceEmbeddingParams,
|
||||
} from "./embedding";
|
||||
export { HuggingFaceLLM, type HFLLMConfig } from "./llm";
|
||||
export {
|
||||
HuggingFaceEmbeddingModelType,
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
import type {
|
||||
PreTrainedModel,
|
||||
PreTrainedTokenizer,
|
||||
Tensor,
|
||||
} from "@huggingface/transformers";
|
||||
import { wrapLLMEvent } from "@llamaindex/core/decorator";
|
||||
import { Settings } from "@llamaindex/core/global";
|
||||
import "@llamaindex/core/llms";
|
||||
@@ -10,11 +15,6 @@ import {
|
||||
type LLMMetadata,
|
||||
} from "@llamaindex/core/llms";
|
||||
import { loadTransformers } from "@llamaindex/env/multi-model";
|
||||
import type {
|
||||
PreTrainedModel,
|
||||
PreTrainedTokenizer,
|
||||
Tensor,
|
||||
} from "@xenova/transformers";
|
||||
import { DEFAULT_PARAMS } from "./shared";
|
||||
|
||||
const DEFAULT_HUGGINGFACE_MODEL = "stabilityai/stablelm-tuned-alpha-3b";
|
||||
@@ -122,7 +122,10 @@ export class HuggingFaceLLM extends BaseLLM {
|
||||
// TODO: the input for model.generate should be updated when using @xenova/transformers v3
|
||||
// We should add `stopping_criteria` also when it's supported in v3
|
||||
// See: https://github.com/xenova/transformers.js/blob/3260640b192b3e06a10a1f4dc004b1254fdf1b80/src/models.js#L1248C9-L1248C27
|
||||
const outputs = await model.generate(inputs, this.metadata);
|
||||
const outputs = (await model.generate({
|
||||
inputs,
|
||||
...this.metadata,
|
||||
})) as Tensor;
|
||||
const outputText = tokenizer.batch_decode(outputs, {
|
||||
skip_special_tokens: false,
|
||||
});
|
||||
|
||||
@@ -1,5 +1,17 @@
|
||||
# @llamaindex/ollama
|
||||
|
||||
## 0.0.22
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 4d4cd8a: feat: support ollama tool call
|
||||
|
||||
Note that `OllamaEmbedding` now is not the subclass of `Ollama`.
|
||||
|
||||
- Updated dependencies [4fc001c]
|
||||
- @llamaindex/env@0.1.20
|
||||
- @llamaindex/core@0.4.6
|
||||
|
||||
## 0.0.21
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@llamaindex/ollama",
|
||||
"description": "Ollama Adapter for LlamaIndex",
|
||||
"version": "0.0.21",
|
||||
"version": "0.0.22",
|
||||
"type": "module",
|
||||
"main": "./dist/index.cjs",
|
||||
"module": "./dist/index.js",
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
import {
|
||||
LLMAgent,
|
||||
LLMAgentWorker,
|
||||
type LLMAgentParams,
|
||||
} from "@llamaindex/core/agent";
|
||||
import { Settings } from "@llamaindex/core/global";
|
||||
import { Ollama } from "./llm";
|
||||
|
||||
// This is likely not necessary anymore but leaving it here just incase it's in use elsewhere
|
||||
|
||||
export type OllamaAgentParams = LLMAgentParams & {
|
||||
model?: string;
|
||||
};
|
||||
|
||||
export class OllamaAgentWorker extends LLMAgentWorker {}
|
||||
|
||||
export class OllamaAgent extends LLMAgent {
|
||||
constructor(params: OllamaAgentParams) {
|
||||
const llm =
|
||||
params.llm ??
|
||||
(Settings.llm instanceof Ollama
|
||||
? (Settings.llm as Ollama)
|
||||
: !params.model
|
||||
? (() => {
|
||||
throw new Error("No model provided");
|
||||
})()
|
||||
: new Ollama({ model: params.model }));
|
||||
super({
|
||||
...params,
|
||||
llm,
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
import { BaseEmbedding } from "@llamaindex/core/embeddings";
|
||||
import { Ollama, type OllamaParams } from "./llm";
|
||||
|
||||
export class OllamaEmbedding extends BaseEmbedding {
|
||||
private readonly llm: Ollama;
|
||||
|
||||
constructor(params: OllamaParams) {
|
||||
super();
|
||||
this.llm = new Ollama(params);
|
||||
}
|
||||
|
||||
private async getEmbedding(prompt: string): Promise<number[]> {
|
||||
const payload = {
|
||||
model: this.llm.model,
|
||||
prompt,
|
||||
options: {
|
||||
...this.llm.options,
|
||||
},
|
||||
};
|
||||
const response = await this.llm.ollama.embeddings({
|
||||
...payload,
|
||||
});
|
||||
return response.embedding;
|
||||
}
|
||||
|
||||
async getTextEmbedding(text: string): Promise<number[]> {
|
||||
return this.getEmbedding(text);
|
||||
}
|
||||
}
|
||||
@@ -1,172 +1,7 @@
|
||||
import { BaseEmbedding } from "@llamaindex/core/embeddings";
|
||||
import type {
|
||||
ChatResponse,
|
||||
ChatResponseChunk,
|
||||
CompletionResponse,
|
||||
LLM,
|
||||
LLMChatParamsNonStreaming,
|
||||
LLMChatParamsStreaming,
|
||||
LLMCompletionParamsNonStreaming,
|
||||
LLMCompletionParamsStreaming,
|
||||
LLMMetadata,
|
||||
} from "@llamaindex/core/llms";
|
||||
import { extractText, streamConverter } from "@llamaindex/core/utils";
|
||||
import {
|
||||
Ollama as OllamaBase,
|
||||
type Config,
|
||||
type ChatResponse as OllamaChatResponse,
|
||||
type GenerateResponse as OllamaGenerateResponse,
|
||||
type Options,
|
||||
} from "ollama/browser";
|
||||
|
||||
const messageAccessor = (part: OllamaChatResponse): ChatResponseChunk => {
|
||||
return {
|
||||
raw: part,
|
||||
delta: part.message.content,
|
||||
};
|
||||
};
|
||||
|
||||
const completionAccessor = (
|
||||
part: OllamaGenerateResponse,
|
||||
): CompletionResponse => {
|
||||
return { text: part.response, raw: part };
|
||||
};
|
||||
|
||||
export type OllamaParams = {
|
||||
model: string;
|
||||
config?: Partial<Config>;
|
||||
options?: Partial<Options>;
|
||||
};
|
||||
|
||||
export class Ollama extends BaseEmbedding implements LLM {
|
||||
public readonly ollama: OllamaBase;
|
||||
|
||||
// https://ollama.ai/library
|
||||
model: string;
|
||||
|
||||
options: Partial<Omit<Options, "num_ctx" | "top_p" | "temperature">> &
|
||||
Pick<Options, "num_ctx" | "top_p" | "temperature"> = {
|
||||
num_ctx: 4096,
|
||||
top_p: 0.9,
|
||||
temperature: 0.7,
|
||||
};
|
||||
|
||||
constructor(params: OllamaParams) {
|
||||
super();
|
||||
this.model = params.model;
|
||||
this.ollama = new OllamaBase(params.config);
|
||||
if (params.options) {
|
||||
this.options = {
|
||||
...this.options,
|
||||
...params.options,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
get metadata(): LLMMetadata {
|
||||
const { temperature, top_p, num_ctx } = this.options;
|
||||
return {
|
||||
model: this.model,
|
||||
temperature: temperature,
|
||||
topP: top_p,
|
||||
maxTokens: this.options.num_ctx,
|
||||
contextWindow: num_ctx,
|
||||
tokenizer: undefined,
|
||||
};
|
||||
}
|
||||
|
||||
chat(
|
||||
params: LLMChatParamsStreaming,
|
||||
): Promise<AsyncIterable<ChatResponseChunk>>;
|
||||
chat(params: LLMChatParamsNonStreaming): Promise<ChatResponse>;
|
||||
async chat(
|
||||
params: LLMChatParamsNonStreaming | LLMChatParamsStreaming,
|
||||
): Promise<ChatResponse | AsyncIterable<ChatResponseChunk>> {
|
||||
const { messages, stream } = params;
|
||||
const payload = {
|
||||
model: this.model,
|
||||
messages: messages.map((message) => ({
|
||||
role: message.role,
|
||||
content: extractText(message.content),
|
||||
})),
|
||||
stream: !!stream,
|
||||
options: {
|
||||
...this.options,
|
||||
},
|
||||
};
|
||||
if (!stream) {
|
||||
const chatResponse = await this.ollama.chat({
|
||||
...payload,
|
||||
stream: false,
|
||||
});
|
||||
|
||||
return {
|
||||
message: {
|
||||
role: "assistant",
|
||||
content: chatResponse.message.content,
|
||||
},
|
||||
raw: chatResponse,
|
||||
};
|
||||
} else {
|
||||
const stream = await this.ollama.chat({
|
||||
...payload,
|
||||
stream: true,
|
||||
});
|
||||
return streamConverter(stream, messageAccessor);
|
||||
}
|
||||
}
|
||||
|
||||
complete(
|
||||
params: LLMCompletionParamsStreaming,
|
||||
): Promise<AsyncIterable<CompletionResponse>>;
|
||||
complete(
|
||||
params: LLMCompletionParamsNonStreaming,
|
||||
): Promise<CompletionResponse>;
|
||||
async complete(
|
||||
params: LLMCompletionParamsStreaming | LLMCompletionParamsNonStreaming,
|
||||
): Promise<CompletionResponse | AsyncIterable<CompletionResponse>> {
|
||||
const { prompt, stream } = params;
|
||||
const payload = {
|
||||
model: this.model,
|
||||
prompt: extractText(prompt),
|
||||
stream: !!stream,
|
||||
options: {
|
||||
...this.options,
|
||||
},
|
||||
};
|
||||
if (!stream) {
|
||||
const response = await this.ollama.generate({
|
||||
...payload,
|
||||
stream: false,
|
||||
});
|
||||
return {
|
||||
text: response.response,
|
||||
raw: response,
|
||||
};
|
||||
} else {
|
||||
const stream = await this.ollama.generate({
|
||||
...payload,
|
||||
stream: true,
|
||||
});
|
||||
return streamConverter(stream, completionAccessor);
|
||||
}
|
||||
}
|
||||
|
||||
private async getEmbedding(prompt: string): Promise<number[]> {
|
||||
const payload = {
|
||||
model: this.model,
|
||||
prompt,
|
||||
options: {
|
||||
...this.options,
|
||||
},
|
||||
};
|
||||
const response = await this.ollama.embeddings({
|
||||
...payload,
|
||||
});
|
||||
return response.embedding;
|
||||
}
|
||||
|
||||
async getTextEmbedding(text: string): Promise<number[]> {
|
||||
return this.getEmbedding(text);
|
||||
}
|
||||
}
|
||||
export {
|
||||
OllamaAgent,
|
||||
OllamaAgentWorker,
|
||||
type OllamaAgentParams,
|
||||
} from "./agent";
|
||||
export { OllamaEmbedding } from "./embedding";
|
||||
export { Ollama, type OllamaParams } from "./llm";
|
||||
|
||||
@@ -0,0 +1,224 @@
|
||||
import { wrapLLMEvent } from "@llamaindex/core/decorator";
|
||||
import {
|
||||
ToolCallLLM,
|
||||
type BaseTool,
|
||||
type ChatResponse,
|
||||
type ChatResponseChunk,
|
||||
type CompletionResponse,
|
||||
type LLMChatParamsNonStreaming,
|
||||
type LLMChatParamsStreaming,
|
||||
type LLMCompletionParamsNonStreaming,
|
||||
type LLMCompletionParamsStreaming,
|
||||
type LLMMetadata,
|
||||
type ToolCallLLMMessageOptions,
|
||||
} from "@llamaindex/core/llms";
|
||||
import { extractText, streamConverter } from "@llamaindex/core/utils";
|
||||
import { randomUUID } from "@llamaindex/env";
|
||||
import type { ChatRequest, GenerateRequest, Tool } from "ollama";
|
||||
import {
|
||||
Ollama as OllamaBase,
|
||||
type Config,
|
||||
type ChatResponse as OllamaChatResponse,
|
||||
type GenerateResponse as OllamaGenerateResponse,
|
||||
type Options,
|
||||
} from "ollama/browser";
|
||||
|
||||
const messageAccessor = (
|
||||
part: OllamaChatResponse,
|
||||
): ChatResponseChunk<ToolCallLLMMessageOptions> => {
|
||||
if (part.message.tool_calls) {
|
||||
return {
|
||||
raw: part,
|
||||
delta: part.message.content,
|
||||
options: {
|
||||
toolCall: part.message.tool_calls.map((toolCall) => ({
|
||||
name: toolCall.function.name,
|
||||
input: toolCall.function.arguments,
|
||||
id: randomUUID(),
|
||||
})),
|
||||
},
|
||||
};
|
||||
}
|
||||
return {
|
||||
raw: part,
|
||||
delta: part.message.content,
|
||||
};
|
||||
};
|
||||
|
||||
const completionAccessor = (
|
||||
part: OllamaGenerateResponse,
|
||||
): CompletionResponse => {
|
||||
return { text: part.response, raw: part };
|
||||
};
|
||||
|
||||
export type OllamaParams = {
|
||||
model: string;
|
||||
config?: Partial<Config>;
|
||||
options?: Partial<Options>;
|
||||
};
|
||||
|
||||
export class Ollama extends ToolCallLLM {
|
||||
supportToolCall: boolean = true;
|
||||
public readonly ollama: OllamaBase;
|
||||
|
||||
// https://ollama.ai/library
|
||||
model: string;
|
||||
|
||||
options: Partial<Omit<Options, "num_ctx" | "top_p" | "temperature">> &
|
||||
Pick<Options, "num_ctx" | "top_p" | "temperature"> = {
|
||||
num_ctx: 4096,
|
||||
top_p: 0.9,
|
||||
temperature: 0.7,
|
||||
};
|
||||
|
||||
constructor(params: OllamaParams) {
|
||||
super();
|
||||
this.model = params.model;
|
||||
this.ollama = new OllamaBase(params.config);
|
||||
if (params.options) {
|
||||
this.options = {
|
||||
...this.options,
|
||||
...params.options,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
get metadata(): LLMMetadata {
|
||||
const { temperature, top_p, num_ctx } = this.options;
|
||||
return {
|
||||
model: this.model,
|
||||
temperature: temperature,
|
||||
topP: top_p,
|
||||
maxTokens: this.options.num_ctx,
|
||||
contextWindow: num_ctx,
|
||||
tokenizer: undefined,
|
||||
};
|
||||
}
|
||||
|
||||
chat(
|
||||
params: LLMChatParamsStreaming<ToolCallLLMMessageOptions>,
|
||||
): Promise<AsyncIterable<ChatResponseChunk>>;
|
||||
chat(
|
||||
params: LLMChatParamsNonStreaming<ToolCallLLMMessageOptions>,
|
||||
): Promise<ChatResponse<ToolCallLLMMessageOptions>>;
|
||||
@wrapLLMEvent
|
||||
async chat(
|
||||
params:
|
||||
| LLMChatParamsNonStreaming<object, ToolCallLLMMessageOptions>
|
||||
| LLMChatParamsStreaming<object, ToolCallLLMMessageOptions>,
|
||||
): Promise<
|
||||
ChatResponse<ToolCallLLMMessageOptions> | AsyncIterable<ChatResponseChunk>
|
||||
> {
|
||||
const { messages, stream, tools } = params;
|
||||
const payload: ChatRequest = {
|
||||
model: this.model,
|
||||
messages: messages.map((message) => {
|
||||
if (message.options && "toolResult" in message.options) {
|
||||
return {
|
||||
role: "tool",
|
||||
content: message.options.toolResult.result,
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
role: message.role,
|
||||
content: extractText(message.content),
|
||||
};
|
||||
}),
|
||||
stream: !!stream,
|
||||
options: {
|
||||
...this.options,
|
||||
},
|
||||
};
|
||||
if (tools) {
|
||||
payload.tools = tools.map((tool) => Ollama.toTool(tool));
|
||||
}
|
||||
if (!stream) {
|
||||
const chatResponse = await this.ollama.chat({
|
||||
...payload,
|
||||
stream: false,
|
||||
});
|
||||
if (chatResponse.message.tool_calls) {
|
||||
return {
|
||||
message: {
|
||||
role: "assistant",
|
||||
content: chatResponse.message.content,
|
||||
options: {
|
||||
toolCall: chatResponse.message.tool_calls.map((toolCall) => ({
|
||||
name: toolCall.function.name,
|
||||
input: toolCall.function.arguments,
|
||||
id: randomUUID(),
|
||||
})),
|
||||
},
|
||||
},
|
||||
raw: chatResponse,
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
message: {
|
||||
role: "assistant",
|
||||
content: chatResponse.message.content,
|
||||
},
|
||||
raw: chatResponse,
|
||||
};
|
||||
} else {
|
||||
const stream = await this.ollama.chat({
|
||||
...payload,
|
||||
stream: true,
|
||||
});
|
||||
return streamConverter(stream, messageAccessor);
|
||||
}
|
||||
}
|
||||
|
||||
complete(
|
||||
params: LLMCompletionParamsStreaming,
|
||||
): Promise<AsyncIterable<CompletionResponse>>;
|
||||
complete(
|
||||
params: LLMCompletionParamsNonStreaming,
|
||||
): Promise<CompletionResponse>;
|
||||
async complete(
|
||||
params: LLMCompletionParamsStreaming | LLMCompletionParamsNonStreaming,
|
||||
): Promise<CompletionResponse | AsyncIterable<CompletionResponse>> {
|
||||
const { prompt, stream } = params;
|
||||
const payload: GenerateRequest = {
|
||||
model: this.model,
|
||||
prompt: extractText(prompt),
|
||||
stream: !!stream,
|
||||
options: {
|
||||
...this.options,
|
||||
},
|
||||
};
|
||||
if (!stream) {
|
||||
const response = await this.ollama.generate({
|
||||
...payload,
|
||||
stream: false,
|
||||
});
|
||||
return {
|
||||
text: response.response,
|
||||
raw: response,
|
||||
};
|
||||
} else {
|
||||
const stream = await this.ollama.generate({
|
||||
...payload,
|
||||
stream: true,
|
||||
});
|
||||
return streamConverter(stream, completionAccessor);
|
||||
}
|
||||
}
|
||||
|
||||
static toTool(tool: BaseTool): Tool {
|
||||
return {
|
||||
type: "function",
|
||||
function: {
|
||||
name: tool.metadata.name,
|
||||
description: tool.metadata.description,
|
||||
parameters: {
|
||||
type: tool.metadata.parameters?.type,
|
||||
required: tool.metadata.parameters?.required,
|
||||
properties: tool.metadata.parameters?.properties,
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,13 @@
|
||||
# @llamaindex/openai
|
||||
|
||||
## 0.1.31
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [4fc001c]
|
||||
- @llamaindex/env@0.1.20
|
||||
- @llamaindex/core@0.4.6
|
||||
|
||||
## 0.1.30
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@llamaindex/openai",
|
||||
"description": "OpenAI Adapter for LlamaIndex",
|
||||
"version": "0.1.30",
|
||||
"version": "0.1.31",
|
||||
"type": "module",
|
||||
"main": "./dist/index.cjs",
|
||||
"module": "./dist/index.js",
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# @llamaindex/portkey-ai
|
||||
|
||||
## 0.0.15
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [4fc001c]
|
||||
- @llamaindex/env@0.1.20
|
||||
- @llamaindex/core@0.4.6
|
||||
|
||||
## 0.0.14
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@llamaindex/portkey-ai",
|
||||
"description": "Portkey Adapter for LlamaIndex",
|
||||
"version": "0.0.14",
|
||||
"version": "0.0.15",
|
||||
"type": "module",
|
||||
"main": "./dist/index.cjs",
|
||||
"module": "./dist/index.js",
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# @llamaindex/replicate
|
||||
|
||||
## 0.0.15
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [4fc001c]
|
||||
- @llamaindex/env@0.1.20
|
||||
- @llamaindex/core@0.4.6
|
||||
|
||||
## 0.0.14
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@llamaindex/replicate",
|
||||
"description": "Replicate Adapter for LlamaIndex",
|
||||
"version": "0.0.14",
|
||||
"version": "0.0.15",
|
||||
"type": "module",
|
||||
"main": "./dist/index.cjs",
|
||||
"module": "./dist/index.js",
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# @llamaindex/readers
|
||||
|
||||
## 1.0.7
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [4fc001c]
|
||||
- @llamaindex/env@0.1.20
|
||||
- @llamaindex/core@0.4.6
|
||||
|
||||
## 1.0.6
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@llamaindex/readers",
|
||||
"description": "LlamaIndex Readers",
|
||||
"version": "1.0.6",
|
||||
"version": "1.0.7",
|
||||
"type": "module",
|
||||
"exports": {
|
||||
"./node/hook": "./node/dist/hook.js",
|
||||
|
||||
Generated
+146
-36
@@ -4,10 +4,6 @@ settings:
|
||||
autoInstallPeers: true
|
||||
excludeLinksFromLockfile: false
|
||||
|
||||
overrides:
|
||||
trim: 1.0.1
|
||||
protobufjs: 7.2.6
|
||||
|
||||
importers:
|
||||
|
||||
.:
|
||||
@@ -344,12 +340,18 @@ importers:
|
||||
'@faker-js/faker':
|
||||
specifier: ^9.2.0
|
||||
version: 9.2.0
|
||||
'@huggingface/transformers':
|
||||
specifier: ^3.0.2
|
||||
version: 3.0.2
|
||||
'@llamaindex/core':
|
||||
specifier: workspace:*
|
||||
version: link:../packages/core
|
||||
'@llamaindex/env':
|
||||
specifier: workspace:*
|
||||
version: link:../packages/env
|
||||
'@llamaindex/ollama':
|
||||
specifier: workspace:*
|
||||
version: link:../packages/providers/ollama
|
||||
'@llamaindex/openai':
|
||||
specifier: workspace:*
|
||||
version: link:../packages/providers/openai
|
||||
@@ -359,9 +361,6 @@ importers:
|
||||
'@types/pg':
|
||||
specifier: ^8.11.8
|
||||
version: 8.11.10
|
||||
'@xenova/transformers':
|
||||
specifier: ^2.17.2
|
||||
version: 2.17.2
|
||||
consola:
|
||||
specifier: ^3.2.3
|
||||
version: 3.2.3
|
||||
@@ -894,15 +893,15 @@ importers:
|
||||
specifier: ^1.0.12
|
||||
version: 1.0.15
|
||||
devDependencies:
|
||||
'@huggingface/transformers':
|
||||
specifier: ^3.0.2
|
||||
version: 3.0.2
|
||||
'@types/node':
|
||||
specifier: ^22.9.0
|
||||
version: 22.9.0
|
||||
'@types/readable-stream':
|
||||
specifier: ^4.0.15
|
||||
version: 4.0.18
|
||||
'@xenova/transformers':
|
||||
specifier: ^2.17.2
|
||||
version: 2.17.2
|
||||
bunchee:
|
||||
specifier: 5.6.1
|
||||
version: 5.6.1(typescript@5.6.3)
|
||||
@@ -983,7 +982,7 @@ importers:
|
||||
specifier: 0.12.0
|
||||
version: 0.12.0
|
||||
'@grpc/grpc-js':
|
||||
specifier: ^1.11.1
|
||||
specifier: ^1.12.2
|
||||
version: 1.12.2
|
||||
'@llamaindex/anthropic':
|
||||
specifier: workspace:*
|
||||
@@ -1109,6 +1108,9 @@ importers:
|
||||
specifier: ^3.23.8
|
||||
version: 3.23.8
|
||||
devDependencies:
|
||||
'@huggingface/transformers':
|
||||
specifier: ^3.0.2
|
||||
version: 3.0.2
|
||||
'@swc/cli':
|
||||
specifier: ^0.5.0
|
||||
version: 0.5.0(@swc/core@1.7.42(@swc/helpers@0.5.13))(chokidar@3.6.0)
|
||||
@@ -1118,9 +1120,6 @@ importers:
|
||||
'@vercel/postgres':
|
||||
specifier: ^0.10.0
|
||||
version: 0.10.0
|
||||
'@xenova/transformers':
|
||||
specifier: ^2.17.2
|
||||
version: 2.17.2
|
||||
concurrently:
|
||||
specifier: ^9.1.0
|
||||
version: 9.1.0
|
||||
@@ -1207,6 +1206,9 @@ importers:
|
||||
|
||||
packages/providers/clip:
|
||||
dependencies:
|
||||
'@huggingface/transformers':
|
||||
specifier: ^3.0.2
|
||||
version: 3.0.2
|
||||
'@llamaindex/core':
|
||||
specifier: workspace:*
|
||||
version: link:../../core
|
||||
@@ -1216,9 +1218,6 @@ importers:
|
||||
'@llamaindex/openai':
|
||||
specifier: workspace:*
|
||||
version: link:../openai
|
||||
'@xenova/transformers':
|
||||
specifier: ^2.17.2
|
||||
version: 2.17.2
|
||||
devDependencies:
|
||||
bunchee:
|
||||
specifier: 5.6.1
|
||||
@@ -1261,6 +1260,9 @@ importers:
|
||||
'@huggingface/inference':
|
||||
specifier: ^2.8.1
|
||||
version: 2.8.1
|
||||
'@huggingface/transformers':
|
||||
specifier: ^3.0.2
|
||||
version: 3.0.2
|
||||
'@llamaindex/core':
|
||||
specifier: workspace:*
|
||||
version: link:../../core
|
||||
@@ -1270,9 +1272,6 @@ importers:
|
||||
'@llamaindex/openai':
|
||||
specifier: workspace:*
|
||||
version: link:../openai
|
||||
'@xenova/transformers':
|
||||
specifier: ^2.17.2
|
||||
version: 2.17.2
|
||||
devDependencies:
|
||||
bunchee:
|
||||
specifier: 5.6.1
|
||||
@@ -3531,13 +3530,16 @@ packages:
|
||||
resolution: {integrity: sha512-9KsiorsdIK8+7VmlamAT7Uh90zxAhC/SeKaKc80v58JhtPYuwaJpmR/ST7XAUxrHAFqHTCoTH5aJnJDwSL6xIQ==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
'@huggingface/jinja@0.2.2':
|
||||
resolution: {integrity: sha512-/KPde26khDUIPkTGU82jdtTW9UAuvUTumCAbFs/7giR0SxsvZC4hru51PBvpijH6BVkHcROcvZM/lpy5h1jRRA==}
|
||||
'@huggingface/jinja@0.3.2':
|
||||
resolution: {integrity: sha512-F2FvuIc+w1blGsaqJI/OErRbWH6bVJDCBI8Rm5D86yZ2wlwrGERsfIaru7XUv9eYC3DMP3ixDRRtF0h6d8AZcQ==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
'@huggingface/tasks@0.12.22':
|
||||
resolution: {integrity: sha512-zpoCUJPUUQ9924PGMXZx8fYpcBnsMV7c+6EUZ4edVZmw28sW9yTo+RJAXrbcLquVsYrYxNgkKYc3odnM0/swfg==}
|
||||
|
||||
'@huggingface/transformers@3.0.2':
|
||||
resolution: {integrity: sha512-lTyS81eQazMea5UCehDGFMfdcNRZyei7XQLH5X6j4AhA/18Ka0+5qPgMxUxuZLU4xkv60aY2KNz9Yzthv6WVJg==}
|
||||
|
||||
'@humanfs/core@0.19.1':
|
||||
resolution: {integrity: sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==}
|
||||
engines: {node: '>=18.18.0'}
|
||||
@@ -3692,6 +3694,10 @@ packages:
|
||||
resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==}
|
||||
engines: {node: '>=12'}
|
||||
|
||||
'@isaacs/fs-minipass@4.0.1':
|
||||
resolution: {integrity: sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==}
|
||||
engines: {node: '>=18.0.0'}
|
||||
|
||||
'@jest/schemas@29.6.3':
|
||||
resolution: {integrity: sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==}
|
||||
engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
|
||||
@@ -5379,6 +5385,9 @@ packages:
|
||||
'@types/lodash@4.17.13':
|
||||
resolution: {integrity: sha512-lfx+dftrEZcdBPczf9d0Qv0x+j/rfNCMuC6OcfXmO8gkfeNAY88PgKUbvG56whcN23gc27yenwF6oJZXGFpYxg==}
|
||||
|
||||
'@types/long@4.0.2':
|
||||
resolution: {integrity: sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==}
|
||||
|
||||
'@types/mdast@3.0.15':
|
||||
resolution: {integrity: sha512-LnwD+mUEfxWMa1QpDraczIn6k0Ee3SMicuYSSzS6ZYl2gKS09EClnJYGd8Du6rfc5r/GZEk5o1mRb8TaTj03sQ==}
|
||||
|
||||
@@ -5730,9 +5739,6 @@ packages:
|
||||
peerDependencies:
|
||||
react: ^16.8.0 || ^17.0.0 || ^18.0.0
|
||||
|
||||
'@xenova/transformers@2.17.2':
|
||||
resolution: {integrity: sha512-lZmHqzrVIkSvZdKZEx7IYY51TK0WDrC8eR0c5IMnBsO8di8are1zzw8BlLhyO2TklZKLN5UffNGs1IJwT6oOqQ==}
|
||||
|
||||
'@xmldom/xmldom@0.8.10':
|
||||
resolution: {integrity: sha512-2WALfTl4xo2SkGCYRt6rDTFfk9R1czmBvUQy12gK2KuRKIpWEhcbbzy8EZXtz/jkRqHX8bFEc6FC1HjX4TUWYw==}
|
||||
engines: {node: '>=10.0.0'}
|
||||
@@ -6367,6 +6373,10 @@ packages:
|
||||
resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==}
|
||||
engines: {node: '>=10'}
|
||||
|
||||
chownr@3.0.0:
|
||||
resolution: {integrity: sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
chromadb-default-embed@2.13.2:
|
||||
resolution: {integrity: sha512-mhqo5rLjkF2KkxAV0WS82vNIXWpVMzvz5y5ayIB2FxcebUbEBNlcRh6XSSqYChWMfJ9us1ZzLQU8RXqsy3sKaA==}
|
||||
|
||||
@@ -9635,6 +9645,10 @@ packages:
|
||||
resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==}
|
||||
engines: {node: '>= 8'}
|
||||
|
||||
minizlib@3.0.1:
|
||||
resolution: {integrity: sha512-umcy022ILvb5/3Djuu8LWeqUa8D68JaBzlttKeMWen48SjabqS3iY5w/vzeMzMUNhLDifyhbOwKDSznB1vvrwg==}
|
||||
engines: {node: '>= 18'}
|
||||
|
||||
mkdirp-classic@0.5.3:
|
||||
resolution: {integrity: sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==}
|
||||
|
||||
@@ -9647,6 +9661,11 @@ packages:
|
||||
engines: {node: '>=10'}
|
||||
hasBin: true
|
||||
|
||||
mkdirp@3.0.1:
|
||||
resolution: {integrity: sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==}
|
||||
engines: {node: '>=10'}
|
||||
hasBin: true
|
||||
|
||||
mlly@1.7.2:
|
||||
resolution: {integrity: sha512-tN3dvVHYVz4DhSXinXIk7u9syPYaJvio118uomkovAtWBT+RdbP6Lfh/5Lvo519YMmwBafwlh20IPTXIStscpA==}
|
||||
|
||||
@@ -10035,13 +10054,26 @@ packages:
|
||||
onnxruntime-common@1.14.0:
|
||||
resolution: {integrity: sha512-3LJpegM2iMNRX2wUmtYfeX/ytfOzNwAWKSq1HbRrKc9+uqG/FsEA0bbKZl1btQeZaXhC26l44NWpNUeXPII7Ew==}
|
||||
|
||||
onnxruntime-common@1.19.2:
|
||||
resolution: {integrity: sha512-a4R7wYEVFbZBlp0BfhpbFWqe4opCor3KM+5Wm22Az3NGDcQMiU2hfG/0MfnBs+1ZrlSGmlgWeMcXQkDk1UFb8Q==}
|
||||
|
||||
onnxruntime-common@1.20.0-dev.20241016-2b8fc5529b:
|
||||
resolution: {integrity: sha512-KZK8b6zCYGZFjd4ANze0pqBnqnFTS3GIVeclQpa2qseDpXrCQJfkWBixRcrZShNhm3LpFOZ8qJYFC5/qsJK9WQ==}
|
||||
|
||||
onnxruntime-node@1.14.0:
|
||||
resolution: {integrity: sha512-5ba7TWomIV/9b6NH/1x/8QEeowsb+jBEvFzU6z0T4mNsFwdPqXeFUM7uxC6QeSRkEbWu3qEB0VMjrvzN/0S9+w==}
|
||||
os: [win32, darwin, linux]
|
||||
|
||||
onnxruntime-node@1.19.2:
|
||||
resolution: {integrity: sha512-9eHMP/HKbbeUcqte1JYzaaRC8JPn7ojWeCeoyShO86TOR97OCyIyAIOGX3V95ErjslVhJRXY8Em/caIUc0hm1Q==}
|
||||
os: [win32, darwin, linux]
|
||||
|
||||
onnxruntime-web@1.14.0:
|
||||
resolution: {integrity: sha512-Kcqf43UMfW8mCydVGcX9OMXI2VN17c0p6XvR7IPSZzBf/6lteBzXHvcEVWDPmCKuGombl997HgLqj91F11DzXw==}
|
||||
|
||||
onnxruntime-web@1.21.0-dev.20241024-d9ca84ef96:
|
||||
resolution: {integrity: sha512-ANSQfMALvCviN3Y4tvTViKofKToV1WUb2r2VjZVCi3uUBPaK15oNJyIxhsNyEckBr/Num3JmSXlkHOD8HfVzSQ==}
|
||||
|
||||
open@8.4.2:
|
||||
resolution: {integrity: sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==}
|
||||
engines: {node: '>=12'}
|
||||
@@ -10819,6 +10851,10 @@ packages:
|
||||
proto-list@1.2.4:
|
||||
resolution: {integrity: sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==}
|
||||
|
||||
protobufjs@6.11.4:
|
||||
resolution: {integrity: sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw==}
|
||||
hasBin: true
|
||||
|
||||
protobufjs@7.2.6:
|
||||
resolution: {integrity: sha512-dgJaEDDL6x8ASUZ1YqWciTRrdOuYNzoOf27oHNfdyvKqHr5i0FV7FSLU+aIeFjyFgVxrpTOtQUi0BLLBymZaBw==}
|
||||
engines: {node: '>=12.0.0'}
|
||||
@@ -11394,6 +11430,10 @@ packages:
|
||||
deprecated: Rimraf versions prior to v4 are no longer supported
|
||||
hasBin: true
|
||||
|
||||
rimraf@5.0.10:
|
||||
resolution: {integrity: sha512-l0OE8wL34P4nJH/H2ffoaniAokM2qSmrtXHmlpvYr5AVVX8msAyW0l8NVJFDxlSK4u3Uh/f41cQheDVdnYijwQ==}
|
||||
hasBin: true
|
||||
|
||||
rimraf@6.0.1:
|
||||
resolution: {integrity: sha512-9dkvaxAsk/xNXSJzMgFqqMCuFgt2+KsOFek3TMLfo8NCPfWpBmqwyNn5Y+NX56QUYfCtsyhF3ayiboEoUmJk/A==}
|
||||
engines: {node: 20 || >=22}
|
||||
@@ -12074,6 +12114,10 @@ packages:
|
||||
resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==}
|
||||
engines: {node: '>=10'}
|
||||
|
||||
tar@7.4.3:
|
||||
resolution: {integrity: sha512-5S7Va8hKfV7W5U6g3aYxXmlPoZVAwUMy9AOKyF2fVuZa2UD3qZjg578OrLRt8PcNN1PleVaL/5/yYATNL0ICUw==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
term-size@2.2.1:
|
||||
resolution: {integrity: sha512-wK0Ri4fOGjv/XPy8SBHZChl8CM7uMc5VML7SqiQ0zG7+J5Vr+RMQDoHa2CNT6KHUnTGIXH34UDMkPzAUyapBZg==}
|
||||
engines: {node: '>=8'}
|
||||
@@ -13049,6 +13093,10 @@ packages:
|
||||
yallist@4.0.0:
|
||||
resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==}
|
||||
|
||||
yallist@5.0.0:
|
||||
resolution: {integrity: sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
yaml@1.10.2:
|
||||
resolution: {integrity: sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==}
|
||||
engines: {node: '>= 6'}
|
||||
@@ -16268,12 +16316,19 @@ snapshots:
|
||||
|
||||
'@huggingface/jinja@0.1.3': {}
|
||||
|
||||
'@huggingface/jinja@0.2.2': {}
|
||||
'@huggingface/jinja@0.3.2': {}
|
||||
|
||||
'@huggingface/tasks@0.12.22':
|
||||
dependencies:
|
||||
'@huggingface/gguf': 0.1.12
|
||||
|
||||
'@huggingface/transformers@3.0.2':
|
||||
dependencies:
|
||||
'@huggingface/jinja': 0.3.2
|
||||
onnxruntime-node: 1.19.2
|
||||
onnxruntime-web: 1.21.0-dev.20241024-d9ca84ef96
|
||||
sharp: 0.33.5
|
||||
|
||||
'@humanfs/core@0.19.1': {}
|
||||
|
||||
'@humanfs/node@0.16.6':
|
||||
@@ -16401,6 +16456,10 @@ snapshots:
|
||||
wrap-ansi: 8.1.0
|
||||
wrap-ansi-cjs: wrap-ansi@7.0.0
|
||||
|
||||
'@isaacs/fs-minipass@4.0.1':
|
||||
dependencies:
|
||||
minipass: 7.1.2
|
||||
|
||||
'@jest/schemas@29.6.3':
|
||||
dependencies:
|
||||
'@sinclair/typebox': 0.27.8
|
||||
@@ -18258,6 +18317,8 @@ snapshots:
|
||||
|
||||
'@types/lodash@4.17.13': {}
|
||||
|
||||
'@types/long@4.0.2': {}
|
||||
|
||||
'@types/mdast@3.0.15':
|
||||
dependencies:
|
||||
'@types/unist': 2.0.11
|
||||
@@ -18728,14 +18789,6 @@ snapshots:
|
||||
'@types/react': 18.3.12
|
||||
react: 18.3.1
|
||||
|
||||
'@xenova/transformers@2.17.2':
|
||||
dependencies:
|
||||
'@huggingface/jinja': 0.2.2
|
||||
onnxruntime-web: 1.14.0
|
||||
sharp: 0.32.6
|
||||
optionalDependencies:
|
||||
onnxruntime-node: 1.14.0
|
||||
|
||||
'@xmldom/xmldom@0.8.10': {}
|
||||
|
||||
'@xtuc/ieee754@1.2.0': {}
|
||||
@@ -19498,6 +19551,8 @@ snapshots:
|
||||
|
||||
chownr@2.0.0: {}
|
||||
|
||||
chownr@3.0.0: {}
|
||||
|
||||
chromadb-default-embed@2.13.2:
|
||||
dependencies:
|
||||
'@huggingface/jinja': 0.1.3
|
||||
@@ -23810,6 +23865,11 @@ snapshots:
|
||||
minipass: 3.3.6
|
||||
yallist: 4.0.0
|
||||
|
||||
minizlib@3.0.1:
|
||||
dependencies:
|
||||
minipass: 7.1.2
|
||||
rimraf: 5.0.10
|
||||
|
||||
mkdirp-classic@0.5.3: {}
|
||||
|
||||
mkdirp@0.5.6:
|
||||
@@ -23818,6 +23878,8 @@ snapshots:
|
||||
|
||||
mkdirp@1.0.4: {}
|
||||
|
||||
mkdirp@3.0.1: {}
|
||||
|
||||
mlly@1.7.2:
|
||||
dependencies:
|
||||
acorn: 8.14.0
|
||||
@@ -24242,15 +24304,24 @@ snapshots:
|
||||
|
||||
onnx-proto@4.0.4:
|
||||
dependencies:
|
||||
protobufjs: 7.2.6
|
||||
protobufjs: 6.11.4
|
||||
|
||||
onnxruntime-common@1.14.0: {}
|
||||
|
||||
onnxruntime-common@1.19.2: {}
|
||||
|
||||
onnxruntime-common@1.20.0-dev.20241016-2b8fc5529b: {}
|
||||
|
||||
onnxruntime-node@1.14.0:
|
||||
dependencies:
|
||||
onnxruntime-common: 1.14.0
|
||||
optional: true
|
||||
|
||||
onnxruntime-node@1.19.2:
|
||||
dependencies:
|
||||
onnxruntime-common: 1.19.2
|
||||
tar: 7.4.3
|
||||
|
||||
onnxruntime-web@1.14.0:
|
||||
dependencies:
|
||||
flatbuffers: 1.12.0
|
||||
@@ -24260,6 +24331,15 @@ snapshots:
|
||||
onnxruntime-common: 1.14.0
|
||||
platform: 1.3.6
|
||||
|
||||
onnxruntime-web@1.21.0-dev.20241024-d9ca84ef96:
|
||||
dependencies:
|
||||
flatbuffers: 1.12.0
|
||||
guid-typescript: 1.0.9
|
||||
long: 5.2.3
|
||||
onnxruntime-common: 1.20.0-dev.20241016-2b8fc5529b
|
||||
platform: 1.3.6
|
||||
protobufjs: 7.2.6
|
||||
|
||||
open@8.4.2:
|
||||
dependencies:
|
||||
define-lazy-prop: 2.0.0
|
||||
@@ -25014,6 +25094,22 @@ snapshots:
|
||||
|
||||
proto-list@1.2.4: {}
|
||||
|
||||
protobufjs@6.11.4:
|
||||
dependencies:
|
||||
'@protobufjs/aspromise': 1.1.2
|
||||
'@protobufjs/base64': 1.1.2
|
||||
'@protobufjs/codegen': 2.0.4
|
||||
'@protobufjs/eventemitter': 1.1.0
|
||||
'@protobufjs/fetch': 1.1.0
|
||||
'@protobufjs/float': 1.0.2
|
||||
'@protobufjs/inquire': 1.1.0
|
||||
'@protobufjs/path': 1.1.2
|
||||
'@protobufjs/pool': 1.1.0
|
||||
'@protobufjs/utf8': 1.1.0
|
||||
'@types/long': 4.0.2
|
||||
'@types/node': 22.9.0
|
||||
long: 4.0.0
|
||||
|
||||
protobufjs@7.2.6:
|
||||
dependencies:
|
||||
'@protobufjs/aspromise': 1.1.2
|
||||
@@ -25806,6 +25902,10 @@ snapshots:
|
||||
dependencies:
|
||||
glob: 7.2.3
|
||||
|
||||
rimraf@5.0.10:
|
||||
dependencies:
|
||||
glob: 10.4.5
|
||||
|
||||
rimraf@6.0.1:
|
||||
dependencies:
|
||||
glob: 11.0.0
|
||||
@@ -26110,7 +26210,6 @@ snapshots:
|
||||
'@img/sharp-wasm32': 0.33.5
|
||||
'@img/sharp-win32-ia32': 0.33.5
|
||||
'@img/sharp-win32-x64': 0.33.5
|
||||
optional: true
|
||||
|
||||
shebang-command@1.2.0:
|
||||
dependencies:
|
||||
@@ -26646,6 +26745,15 @@ snapshots:
|
||||
mkdirp: 1.0.4
|
||||
yallist: 4.0.0
|
||||
|
||||
tar@7.4.3:
|
||||
dependencies:
|
||||
'@isaacs/fs-minipass': 4.0.1
|
||||
chownr: 3.0.0
|
||||
minipass: 7.1.2
|
||||
minizlib: 3.0.1
|
||||
mkdirp: 3.0.1
|
||||
yallist: 5.0.0
|
||||
|
||||
term-size@2.2.1: {}
|
||||
|
||||
terser-webpack-plugin@5.3.10(@swc/core@1.7.42(@swc/helpers@0.5.13))(webpack@5.96.1(@swc/core@1.7.42(@swc/helpers@0.5.13))):
|
||||
@@ -27792,6 +27900,8 @@ snapshots:
|
||||
|
||||
yallist@4.0.0: {}
|
||||
|
||||
yallist@5.0.0: {}
|
||||
|
||||
yaml@1.10.2: {}
|
||||
|
||||
yaml@2.5.0: {}
|
||||
|
||||
@@ -1,5 +1,18 @@
|
||||
# @llamaindex/unit-test
|
||||
|
||||
## 0.0.18
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [4fc001c]
|
||||
- Updated dependencies [4d4cd8a]
|
||||
- llamaindex@0.8.9
|
||||
- @llamaindex/cloud@2.0.6
|
||||
- @llamaindex/core@0.4.6
|
||||
- @llamaindex/node-parser@0.0.7
|
||||
- @llamaindex/openai@0.1.31
|
||||
- @llamaindex/readers@1.0.7
|
||||
|
||||
## 0.0.17
|
||||
|
||||
### Patch Changes
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@llamaindex/unit-test",
|
||||
"private": true,
|
||||
"version": "0.0.17",
|
||||
"version": "0.0.18",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"test": "vitest run"
|
||||
|
||||
Reference in New Issue
Block a user