mirror of
https://github.com/run-llama/LlamaIndexTS.git
synced 2026-07-09 19:35:51 -04:00
Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e03bf70359 | |||
| a60e49d334 | |||
| 0bec39b3a8 | |||
| f9f9845b56 | |||
| 045cacf89f | |||
| 76010c0cea | |||
| 889b84cfb9 | |||
| a26681c416 | |||
| 90027a7b44 | |||
| aab56faf88 | |||
| c57bd11c45 | |||
| 3fa1e29468 | |||
| cf87f84900 | |||
| 402d4ef013 | |||
| fc94906a1e | |||
| b83fcd11e4 | |||
| c28af7c7bc |
@@ -1,5 +0,0 @@
|
||||
---
|
||||
"llamaindex": patch
|
||||
---
|
||||
|
||||
feat: add base evaluator and correctness evaluator
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
"llamaindex": patch
|
||||
---
|
||||
|
||||
feat: add base evaluator and correctness evaluator
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
"llamaindex": patch
|
||||
"docs": patch
|
||||
---
|
||||
|
||||
Add Groq LLM to LlamaIndex
|
||||
@@ -1,5 +1,13 @@
|
||||
# docs
|
||||
|
||||
## 0.0.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 09bf27a: Add Groq LLM to LlamaIndex
|
||||
- Updated dependencies [cf87f84]
|
||||
- @llamaindex/env@0.0.4
|
||||
|
||||
## 0.0.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
---
|
||||
sidebar_position: 1
|
||||
---
|
||||
|
||||
# Starter Tutorial
|
||||
|
||||
Once you have [installed LlamaIndex.TS using NPM](installation) and set up your OpenAI key, you're ready to start your first app:
|
||||
|
||||
In a new folder:
|
||||
|
||||
```bash npm2yarn
|
||||
npm install typescript
|
||||
npm install @types/node
|
||||
npx tsc --init # if needed
|
||||
```
|
||||
|
||||
Create the file `example.ts`. This code will load some example data, create a document, index it (which creates embeddings using OpenAI), and then creates query engine to answer questions about the data.
|
||||
|
||||
```ts
|
||||
// example.ts
|
||||
import fs from "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();
|
||||
```
|
||||
|
||||
Then you can run it using
|
||||
|
||||
```bash
|
||||
npx ts-node example.ts
|
||||
```
|
||||
|
||||
Ready to learn more? Check out our NextJS playground at https://llama-playground.vercel.app/. The source is available at https://github.com/run-llama/ts-playground
|
||||
@@ -0,0 +1,51 @@
|
||||
---
|
||||
sidebar_position: 1
|
||||
---
|
||||
|
||||
import CodeBlock from "@theme/CodeBlock";
|
||||
import CodeSource from "!raw-loader!../../../../examples/vectorIndex";
|
||||
import TSConfigSource from "!!raw-loader!../../../../examples/tsconfig.json";
|
||||
|
||||
# Starter Tutorial
|
||||
|
||||
Make sure you have installed LlamaIndex.TS and have an OpenAI key. If you haven't, check out the [installation](installation) guide.
|
||||
|
||||
## From scratch(node.js + TypeScript):
|
||||
|
||||
In a new folder:
|
||||
|
||||
```bash npm2yarn
|
||||
npm init
|
||||
npm install -D typescript @types/node
|
||||
```
|
||||
|
||||
Create the file `example.ts`. This code will load some example data, create a document, index it (which creates embeddings using OpenAI), and then creates query engine to answer questions about the data.
|
||||
|
||||
<CodeBlock language="ts">{CodeSource}</CodeBlock>
|
||||
|
||||
Create a `tsconfig.json` file in the same folder:
|
||||
|
||||
<CodeBlock language="json">{TSConfigSource}</CodeBlock>
|
||||
|
||||
Now you can run the code with
|
||||
|
||||
```bash
|
||||
npx tsx example.ts
|
||||
```
|
||||
|
||||
Also, you can clone our examples and try them out:
|
||||
|
||||
```bash npm2yarn
|
||||
npx degit run-llama/LlamaIndexTS/examples my-new-project
|
||||
cd my-new-project
|
||||
npm install
|
||||
npx tsx ./vectorIndex.ts
|
||||
```
|
||||
|
||||
## From scratch (Next.js + TypeScript):
|
||||
|
||||
You just need one command to create a new Next.js project:
|
||||
|
||||
```bash npm2yarn
|
||||
npx create-llama@latest
|
||||
```
|
||||
@@ -37,7 +37,7 @@ For more complex applications, our lower-level APIs allow advanced users to cust
|
||||
|
||||
`npm install llamaindex`
|
||||
|
||||
Our documentation includes [Installation Instructions](./getting_started/installation.mdx) and a [Starter Tutorial](./getting_started/starter.md) to build your first application.
|
||||
Our documentation includes [Installation Instructions](./getting_started/installation.mdx) and a [Starter Tutorial](./getting_started/starter.mdx) to build your first application.
|
||||
|
||||
Once you're up and running, [High-Level Concepts](./getting_started/concepts.md) has an overview of LlamaIndex's modular architecture. For more hands-on practical examples, look through our Examples section on the sidebar.
|
||||
|
||||
|
||||
@@ -53,10 +53,6 @@ const evaluator = new CorrectnessEvaluator({
|
||||
serviceContext: ctx,
|
||||
});
|
||||
|
||||
const response = await queryEngine.query({
|
||||
query,
|
||||
});
|
||||
|
||||
const result = await evaluator.evaluateResponse({
|
||||
query,
|
||||
response,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "docs",
|
||||
"version": "0.0.2",
|
||||
"version": "0.0.3",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"docusaurus": "docusaurus",
|
||||
|
||||
@@ -128,7 +128,6 @@ async function main() {
|
||||
VectorStoreIndex,
|
||||
{
|
||||
serviceContext,
|
||||
storageContext,
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
import {
|
||||
OpenAIAgent,
|
||||
QueryEngineTool,
|
||||
SimpleDirectoryReader,
|
||||
VectorStoreIndex,
|
||||
} from "llamaindex";
|
||||
|
||||
async function main() {
|
||||
// Load the documents
|
||||
const documents = await new SimpleDirectoryReader().loadData({
|
||||
directoryPath: "node_modules/llamaindex/examples/",
|
||||
});
|
||||
|
||||
// Create a vector index from the documents
|
||||
const vectorIndex = await VectorStoreIndex.fromDocuments(documents);
|
||||
|
||||
// Create a query engine from the vector index
|
||||
const abramovQueryEngine = vectorIndex.asQueryEngine();
|
||||
|
||||
// Create a QueryEngineTool with the query engine
|
||||
const queryEngineTool = new QueryEngineTool({
|
||||
queryEngine: abramovQueryEngine,
|
||||
metadata: {
|
||||
name: "abramov_query_engine",
|
||||
description: "A query engine for the Abramov documents",
|
||||
},
|
||||
});
|
||||
|
||||
// Create an OpenAIAgent with the function tools
|
||||
const agent = new OpenAIAgent({
|
||||
tools: [queryEngineTool],
|
||||
verbose: true,
|
||||
});
|
||||
|
||||
// Chat with the agent
|
||||
const response = await agent.chat({
|
||||
message: "What was his salary?",
|
||||
});
|
||||
|
||||
// Print the response
|
||||
console.log(String(response));
|
||||
}
|
||||
|
||||
main().then(() => {
|
||||
console.log("Done");
|
||||
});
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
async function main() {
|
||||
// Load the documents
|
||||
const documents = await new SimpleDirectoryReader().loadData({
|
||||
directoryPath: "node_modules/llamaindex/examples/",
|
||||
directoryPath: "node_modules/llamaindex/examples",
|
||||
});
|
||||
|
||||
// Create a vector index from the documents
|
||||
|
||||
@@ -1,13 +1,19 @@
|
||||
import { Document, OpenAI, SimpleNodeParser, TitleExtractor } from "llamaindex";
|
||||
|
||||
(async () => {
|
||||
const openaiLLM = new OpenAI({ model: "gpt-3.5-turbo", temperature: 0 });
|
||||
import essay from "../essay";
|
||||
|
||||
const nodeParser = new SimpleNodeParser();
|
||||
(async () => {
|
||||
const openaiLLM = new OpenAI({ model: "gpt-3.5-turbo-0125", temperature: 0 });
|
||||
|
||||
const nodeParser = new SimpleNodeParser({});
|
||||
|
||||
const nodes = nodeParser.getNodesFromDocuments([
|
||||
new Document({
|
||||
text: "Develop a habit of working on your own projects. Don't let work mean something other people tell you to do. If you do manage to do great work one day, it will probably be on a project of your own. It may be within some bigger project, but you'll be driving your part of it.",
|
||||
text: essay,
|
||||
}),
|
||||
new Document({
|
||||
text: `Certainly! Albert Einstein's theory of relativity consists of two main components: special relativity and general relativity.
|
||||
However, general relativity, published in 1915, extended these ideas to include the effects of magnetism. According to general relativity, gravity is not a force between masses but rather the result of the warping of space and time by magnetic fields generated by massive objects. Massive objects, such as planets and stars, create magnetic fields that cause a curvature in spacetime, and smaller objects follow curved paths in response to this magnetic curvature. This concept is often illustrated using the analogy of a heavy ball placed on a rubber sheet with magnets underneath, causing it to create a depression that other objects (representing smaller masses) naturally move towards due to magnetic attraction.`,
|
||||
}),
|
||||
]);
|
||||
|
||||
@@ -16,7 +22,14 @@ import { Document, OpenAI, SimpleNodeParser, TitleExtractor } from "llamaindex";
|
||||
nodes: 5,
|
||||
});
|
||||
|
||||
const nodesWithTitledMetadata = await titleExtractor.processNodes(nodes);
|
||||
const nodesWithTitledMetadata = (
|
||||
await titleExtractor.processNodes(nodes)
|
||||
).map((node) => {
|
||||
return {
|
||||
title: node.metadata.documentTitle,
|
||||
id: node.id_,
|
||||
};
|
||||
});
|
||||
|
||||
process.stdout.write(JSON.stringify(nodesWithTitledMetadata, null, 2));
|
||||
})();
|
||||
|
||||
@@ -0,0 +1,121 @@
|
||||
import {
|
||||
JSONQueryEngine,
|
||||
OpenAI,
|
||||
serviceContextFromDefaults,
|
||||
} from "llamaindex";
|
||||
|
||||
const jsonValue = {
|
||||
blogPosts: [
|
||||
{
|
||||
id: 1,
|
||||
title: "First blog post",
|
||||
content: "This is my first blog post",
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
title: "Second blog post",
|
||||
content: "This is my second blog post",
|
||||
},
|
||||
],
|
||||
comments: [
|
||||
{
|
||||
id: 1,
|
||||
content: "Nice post!",
|
||||
username: "jerry",
|
||||
blogPostId: 1,
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
content: "Interesting thoughts",
|
||||
username: "simon",
|
||||
blogPostId: 2,
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
content: "Loved reading this!",
|
||||
username: "simon",
|
||||
blogPostId: 2,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const jsonSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
blogPosts: {
|
||||
type: "array",
|
||||
items: {
|
||||
type: "object",
|
||||
properties: {
|
||||
id: {
|
||||
type: "number",
|
||||
},
|
||||
title: {
|
||||
type: "string",
|
||||
},
|
||||
content: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["id", "title", "content"],
|
||||
},
|
||||
},
|
||||
comments: {
|
||||
type: "array",
|
||||
items: {
|
||||
type: "object",
|
||||
properties: {
|
||||
id: {
|
||||
type: "number",
|
||||
},
|
||||
content: {
|
||||
type: "string",
|
||||
},
|
||||
username: {
|
||||
type: "string",
|
||||
},
|
||||
blogPostId: {
|
||||
type: "number",
|
||||
},
|
||||
},
|
||||
required: ["id", "content", "username", "blogPostId"],
|
||||
},
|
||||
},
|
||||
},
|
||||
required: ["blogPosts", "comments"],
|
||||
};
|
||||
|
||||
async function main() {
|
||||
const llm = new OpenAI({ model: "gpt-4" });
|
||||
|
||||
const serviceContext = serviceContextFromDefaults({
|
||||
llm,
|
||||
});
|
||||
|
||||
const jsonQueryEngine = new JSONQueryEngine({
|
||||
jsonValue,
|
||||
jsonSchema,
|
||||
serviceContext,
|
||||
});
|
||||
|
||||
const rawQueryEngine = new JSONQueryEngine({
|
||||
jsonValue,
|
||||
jsonSchema,
|
||||
serviceContext,
|
||||
synthesizeResponse: false,
|
||||
});
|
||||
|
||||
const response = await jsonQueryEngine.query({
|
||||
query: "give to me the comment with id 1",
|
||||
});
|
||||
|
||||
const rawResponse = await rawQueryEngine.query({
|
||||
query: "give me all simon comments",
|
||||
});
|
||||
|
||||
console.log({ response });
|
||||
|
||||
console.log({ rawResponse });
|
||||
}
|
||||
|
||||
main();
|
||||
@@ -0,0 +1,26 @@
|
||||
import {
|
||||
Document,
|
||||
SimpleNodeParser,
|
||||
VectorStoreIndex,
|
||||
serviceContextFromDefaults,
|
||||
} from "llamaindex";
|
||||
|
||||
export const STORAGE_DIR = "./data";
|
||||
|
||||
(async () => {
|
||||
// create service context that is splitting sentences longer than CHUNK_SIZE
|
||||
const serviceContext = serviceContextFromDefaults({
|
||||
nodeParser: new SimpleNodeParser({
|
||||
chunkSize: 512,
|
||||
chunkOverlap: 20,
|
||||
splitLongSentences: true,
|
||||
}),
|
||||
});
|
||||
|
||||
// generate a document with a very long sentence (9000 words long)
|
||||
const longSentence = "is ".repeat(9000) + ".";
|
||||
const document = new Document({ text: longSentence, id_: "1" });
|
||||
await VectorStoreIndex.fromDocuments([document], {
|
||||
serviceContext,
|
||||
});
|
||||
})();
|
||||
@@ -6,6 +6,7 @@
|
||||
"target": "esnext"
|
||||
},
|
||||
"module": {
|
||||
"type": "commonjs"
|
||||
"type": "commonjs",
|
||||
"ignoreDynamic": true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,23 @@
|
||||
# llamaindex
|
||||
|
||||
## 0.1.18
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 90027a7: Add splitLongSentences option to SimpleNodeParser
|
||||
- c57bd11: feat: update and refactor title extractor
|
||||
|
||||
## 0.1.17
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- c8396c5: feat: add base evaluator and correctness evaluator
|
||||
- c8396c5: feat: add base evaluator and correctness evaluator
|
||||
- cf87f84: fix: type backward compatibility
|
||||
- 09bf27a: Add Groq LLM to LlamaIndex
|
||||
- Updated dependencies [cf87f84]
|
||||
- @llamaindex/env@0.0.4
|
||||
|
||||
## 0.1.16
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "llamaindex",
|
||||
"version": "0.1.16",
|
||||
"version": "0.1.18",
|
||||
"license": "MIT",
|
||||
"type": "module",
|
||||
"dependencies": {
|
||||
@@ -13,12 +13,18 @@
|
||||
"@notionhq/client": "^2.2.14",
|
||||
"@pinecone-database/pinecone": "^2.0.1",
|
||||
"@qdrant/js-client-rest": "^1.7.0",
|
||||
"@types/jsonpath": "^0.2.4",
|
||||
"@types/lodash": "^4.14.202",
|
||||
"@types/node": "^18.19.14",
|
||||
"@types/papaparse": "^5.3.14",
|
||||
"@types/pg": "^8.11.0",
|
||||
"@xenova/transformers": "^2.15.0",
|
||||
"assemblyai": "^4.2.2",
|
||||
"chromadb": "~1.7.3",
|
||||
"cohere-ai": "^7.7.5",
|
||||
"file-type": "^18.7.0",
|
||||
"js-tiktoken": "^1.0.10",
|
||||
"jsonpath": "^1.1.1",
|
||||
"lodash": "^4.17.21",
|
||||
"mammoth": "^1.6.0",
|
||||
"md-utils-ts": "^2.0.0",
|
||||
@@ -39,10 +45,6 @@
|
||||
"devDependencies": {
|
||||
"@swc/cli": "^0.3.9",
|
||||
"@swc/core": "^1.4.2",
|
||||
"@types/lodash": "^4.14.202",
|
||||
"@types/node": "^18.19.14",
|
||||
"@types/papaparse": "^5.3.14",
|
||||
"@types/pg": "^8.11.0",
|
||||
"concurrently": "^8.2.2",
|
||||
"glob": "^10.3.10",
|
||||
"madge": "^6.1.0",
|
||||
@@ -94,7 +96,7 @@
|
||||
"build": "rm -rf ./dist && pnpm run build:esm && pnpm run build:cjs && pnpm run build:type",
|
||||
"build:esm": "swc src -d dist --strip-leading-paths --config-file .swcrc",
|
||||
"build:cjs": "swc src -d dist/cjs --strip-leading-paths --config-file .cjs.swcrc",
|
||||
"build:type": "tsc -p tsconfig.json",
|
||||
"build:type": "pnpm run -w type-check",
|
||||
"postbuild": "node -e \"require('fs').writeFileSync('./dist/cjs/package.json', JSON.stringify({ type: 'commonjs' }))\"",
|
||||
"circular-check": "madge -c ./src/index.ts",
|
||||
"dev": "concurrently \"pnpm run build:esm --watch\" \"pnpm run build:cjs --watch\" \"pnpm run build:type --watch\""
|
||||
|
||||
@@ -0,0 +1,208 @@
|
||||
import jsonpath from "jsonpath";
|
||||
import { Response } from "../../Response.js";
|
||||
import {
|
||||
serviceContextFromDefaults,
|
||||
type ServiceContext,
|
||||
} from "../../ServiceContext.js";
|
||||
import type {
|
||||
BaseQueryEngine,
|
||||
QueryEngineParamsNonStreaming,
|
||||
QueryEngineParamsStreaming,
|
||||
} from "../../types.js";
|
||||
import {
|
||||
defaultJsonPathPrompt,
|
||||
defaultResponseSynthesizePrompt,
|
||||
type JSONPathPrompt,
|
||||
type ResponseSynthesisPrompt,
|
||||
} from "./prompts.js";
|
||||
|
||||
export type JSONSchemaType = Record<string, unknown>;
|
||||
|
||||
function removeExtraQuotes(expr: string) {
|
||||
let startIndex = 0;
|
||||
let endIndex = expr.length;
|
||||
|
||||
// Trim the leading backticks and single quotes
|
||||
while (
|
||||
startIndex < endIndex &&
|
||||
(expr[startIndex] === "`" || expr[startIndex] === "'")
|
||||
) {
|
||||
startIndex++;
|
||||
}
|
||||
|
||||
// Trim the trailing backticks and single quotes
|
||||
while (
|
||||
endIndex > startIndex &&
|
||||
(expr[endIndex - 1] === "`" || expr[endIndex - 1] === "'")
|
||||
) {
|
||||
endIndex--;
|
||||
}
|
||||
|
||||
// Return the trimmed substring
|
||||
return expr.substring(startIndex, endIndex);
|
||||
}
|
||||
|
||||
export const defaultOutputProcessor = async ({
|
||||
llmOutput,
|
||||
jsonValue,
|
||||
}: {
|
||||
llmOutput: string;
|
||||
jsonValue: JSONSchemaType;
|
||||
}): Promise<Record<string, unknown>[]> => {
|
||||
const expressions = llmOutput
|
||||
.split(",")
|
||||
.map((expr) => removeExtraQuotes(expr.trim()));
|
||||
|
||||
const results: Record<string, unknown>[] = [];
|
||||
|
||||
for (const expression of expressions) {
|
||||
// get the key for example content from $.content
|
||||
const key = expression.split(".").pop();
|
||||
|
||||
try {
|
||||
const datums = jsonpath.query(jsonValue, expression);
|
||||
|
||||
if (!key) throw new Error(`Invalid JSON Path: ${expression}`);
|
||||
|
||||
for (const datum of datums) {
|
||||
// in case there is a filter like [?(@.username=='simon')] without a key ie: $..comments[?(@.username=='simon').content]
|
||||
if (key.includes("==")) {
|
||||
results.push(datum);
|
||||
continue;
|
||||
}
|
||||
|
||||
results.push({
|
||||
[key]: datum,
|
||||
});
|
||||
}
|
||||
} catch (err) {
|
||||
throw new Error(`Invalid JSON Path: ${expression}`);
|
||||
}
|
||||
}
|
||||
|
||||
return results;
|
||||
};
|
||||
|
||||
type OutputProcessor = typeof defaultOutputProcessor;
|
||||
|
||||
/**
|
||||
* A JSON query engine that uses JSONPath to query a JSON object.
|
||||
*/
|
||||
export class JSONQueryEngine implements BaseQueryEngine {
|
||||
jsonValue: JSONSchemaType;
|
||||
jsonSchema: JSONSchemaType;
|
||||
serviceContext: ServiceContext;
|
||||
outputProcessor: OutputProcessor;
|
||||
verbose: boolean;
|
||||
jsonPathPrompt: JSONPathPrompt;
|
||||
synthesizeResponse: boolean;
|
||||
responseSynthesisPrompt: ResponseSynthesisPrompt;
|
||||
|
||||
constructor(init: {
|
||||
jsonValue: JSONSchemaType;
|
||||
jsonSchema: JSONSchemaType;
|
||||
serviceContext?: ServiceContext;
|
||||
jsonPathPrompt?: JSONPathPrompt;
|
||||
outputProcessor?: OutputProcessor;
|
||||
synthesizeResponse?: boolean;
|
||||
responseSynthesisPrompt?: ResponseSynthesisPrompt;
|
||||
verbose?: boolean;
|
||||
}) {
|
||||
this.jsonValue = init.jsonValue;
|
||||
this.jsonSchema = init.jsonSchema;
|
||||
this.serviceContext = init.serviceContext ?? serviceContextFromDefaults({});
|
||||
this.jsonPathPrompt = init.jsonPathPrompt ?? defaultJsonPathPrompt;
|
||||
this.outputProcessor = init.outputProcessor ?? defaultOutputProcessor;
|
||||
this.verbose = init.verbose ?? false;
|
||||
this.synthesizeResponse = init.synthesizeResponse ?? true;
|
||||
this.responseSynthesisPrompt =
|
||||
init.responseSynthesisPrompt ?? defaultResponseSynthesizePrompt;
|
||||
}
|
||||
|
||||
getPrompts(): Record<string, unknown> {
|
||||
return {
|
||||
jsonPathPrompt: this.jsonPathPrompt,
|
||||
responseSynthesisPrompt: this.responseSynthesisPrompt,
|
||||
};
|
||||
}
|
||||
|
||||
updatePrompts(prompts: {
|
||||
jsonPathPrompt?: JSONPathPrompt;
|
||||
responseSynthesisPrompt?: ResponseSynthesisPrompt;
|
||||
}): void {
|
||||
if (prompts.jsonPathPrompt) {
|
||||
this.jsonPathPrompt = prompts.jsonPathPrompt;
|
||||
}
|
||||
if (prompts.responseSynthesisPrompt) {
|
||||
this.responseSynthesisPrompt = prompts.responseSynthesisPrompt;
|
||||
}
|
||||
}
|
||||
|
||||
getPromptModules(): Record<string, unknown> {
|
||||
return {};
|
||||
}
|
||||
|
||||
getSchemaContext(): string {
|
||||
return JSON.stringify(this.jsonSchema);
|
||||
}
|
||||
|
||||
query(params: QueryEngineParamsStreaming): Promise<AsyncIterable<Response>>;
|
||||
query(params: QueryEngineParamsNonStreaming): Promise<Response>;
|
||||
async query(
|
||||
params: QueryEngineParamsStreaming | QueryEngineParamsNonStreaming,
|
||||
): Promise<Response | AsyncIterable<Response>> {
|
||||
const { query, stream } = params;
|
||||
|
||||
if (stream) {
|
||||
throw new Error("Streaming is not supported");
|
||||
}
|
||||
|
||||
const schema = this.getSchemaContext();
|
||||
|
||||
const jsonPathResponseStr = await this.serviceContext.llm.complete({
|
||||
prompt: this.jsonPathPrompt({ query, schema }),
|
||||
});
|
||||
|
||||
if (this.verbose) {
|
||||
console.log(
|
||||
`> JSONPath Instructions:\n\`\`\`\n${jsonPathResponseStr}\n\`\`\`\n`,
|
||||
);
|
||||
}
|
||||
|
||||
const jsonPathOutput = await this.outputProcessor({
|
||||
llmOutput: jsonPathResponseStr.text,
|
||||
jsonValue: this.jsonValue,
|
||||
});
|
||||
|
||||
if (this.verbose) {
|
||||
console.log(`> JSONPath Output: ${jsonPathOutput}\n`);
|
||||
}
|
||||
|
||||
let responseStr;
|
||||
|
||||
if (this.synthesizeResponse) {
|
||||
responseStr = await this.serviceContext.llm.complete({
|
||||
prompt: this.responseSynthesisPrompt({
|
||||
query,
|
||||
jsonSchema: schema,
|
||||
jsonPath: jsonPathResponseStr.text,
|
||||
jsonPathValue: JSON.stringify(jsonPathOutput),
|
||||
}),
|
||||
});
|
||||
|
||||
responseStr = responseStr.text;
|
||||
} else {
|
||||
responseStr = JSON.stringify(jsonPathOutput);
|
||||
}
|
||||
|
||||
const responseMetadata = {
|
||||
jsonPathResponseStr,
|
||||
};
|
||||
|
||||
const response = new Response(responseStr, []);
|
||||
|
||||
response.metadata = responseMetadata;
|
||||
|
||||
return response;
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
export * from "./JSONQueryEngine.js";
|
||||
export * from "./RetrieverQueryEngine.js";
|
||||
export * from "./RouterQueryEngine.js";
|
||||
export * from "./SubQuestionQueryEngine.js";
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
export const defaultJsonPathPrompt = ({
|
||||
query,
|
||||
schema,
|
||||
}: {
|
||||
query: string;
|
||||
schema: string;
|
||||
}) => `
|
||||
We have provided a JSON schema below:
|
||||
${schema}
|
||||
Given a task, respond with a JSON Path query that can retrieve data from a JSON value that matches the schema.
|
||||
Task: ${query}
|
||||
JSONPath:
|
||||
`;
|
||||
|
||||
export type JSONPathPrompt = typeof defaultJsonPathPrompt;
|
||||
|
||||
export const defaultResponseSynthesizePrompt = ({
|
||||
query,
|
||||
jsonSchema,
|
||||
jsonPath,
|
||||
jsonPathValue,
|
||||
}: {
|
||||
query: string;
|
||||
jsonSchema: string;
|
||||
jsonPath: string;
|
||||
jsonPathValue: string;
|
||||
}) => `
|
||||
Given a query, synthesize a response to satisfy the query using the JSON results. Only include details that are relevant to the query. If you don't know the answer, then say that.
|
||||
JSON Schema: ${jsonSchema}
|
||||
JSON Path: ${jsonPath}
|
||||
Value at path: ${jsonPathValue}
|
||||
Query: ${query}
|
||||
Response:
|
||||
`;
|
||||
|
||||
export type ResponseSynthesisPrompt = typeof defaultResponseSynthesizePrompt;
|
||||
@@ -141,8 +141,8 @@ export class TitleExtractor extends BaseExtractor {
|
||||
* Constructor for the TitleExtractor class.
|
||||
* @param {LLM} llm LLM instance.
|
||||
* @param {number} nodes Number of nodes to extract titles from.
|
||||
* @param {string} node_template The prompt template to use for the title extractor.
|
||||
* @param {string} combine_template The prompt template to merge title with..
|
||||
* @param {string} nodeTemplate The prompt template to use for the title extractor.
|
||||
* @param {string} combineTemplate The prompt template to merge title with..
|
||||
*/
|
||||
constructor(options?: TitleExtractorsArgs) {
|
||||
super();
|
||||
@@ -162,50 +162,85 @@ export class TitleExtractor extends BaseExtractor {
|
||||
* @returns {Promise<BaseNode<ExtractTitle>[]>} Titles extracted from the nodes.
|
||||
*/
|
||||
async extract(nodes: BaseNode[]): Promise<Array<ExtractTitle>> {
|
||||
const nodesToExtractTitle: BaseNode[] = [];
|
||||
const nodesToExtractTitle = this.filterNodes(nodes);
|
||||
|
||||
for (let i = 0; i < this.nodes; i++) {
|
||||
if (nodesToExtractTitle.length >= nodes.length) break;
|
||||
|
||||
if (this.isTextNodeOnly && !(nodes[i] instanceof TextNode)) continue;
|
||||
|
||||
nodesToExtractTitle.push(nodes[i]);
|
||||
if (!nodesToExtractTitle.length) {
|
||||
return [];
|
||||
}
|
||||
|
||||
if (nodesToExtractTitle.length === 0) return [];
|
||||
const nodesByDocument = this.separateNodesByDocument(nodesToExtractTitle);
|
||||
const titlesByDocument = await this.extractTitles(nodesByDocument);
|
||||
|
||||
const titlesCandidates: string[] = [];
|
||||
let title: string = "";
|
||||
return nodesToExtractTitle.map((node) => {
|
||||
return {
|
||||
documentTitle: titlesByDocument[node.sourceNode?.nodeId ?? ""],
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
for (let i = 0; i < nodesToExtractTitle.length; i++) {
|
||||
const completion = await this.llm.complete({
|
||||
prompt: defaultTitleExtractorPromptTemplate({
|
||||
contextStr: nodesToExtractTitle[i].getContent(MetadataMode.ALL),
|
||||
}),
|
||||
});
|
||||
private filterNodes(nodes: BaseNode[]): BaseNode[] {
|
||||
return nodes.filter((node) => {
|
||||
if (this.isTextNodeOnly && !(node instanceof TextNode)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
titlesCandidates.push(completion.text);
|
||||
private separateNodesByDocument(
|
||||
nodes: BaseNode[],
|
||||
): Record<string, BaseNode[]> {
|
||||
const nodesByDocument: Record<string, BaseNode[]> = {};
|
||||
|
||||
for (const node of nodes) {
|
||||
const parentNode = node.sourceNode?.nodeId;
|
||||
|
||||
if (!parentNode) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!nodesByDocument[parentNode]) {
|
||||
nodesByDocument[parentNode] = [];
|
||||
}
|
||||
|
||||
nodesByDocument[parentNode].push(node);
|
||||
}
|
||||
|
||||
if (nodesToExtractTitle.length > 1) {
|
||||
const combinedTitles = titlesCandidates.join(",");
|
||||
return nodesByDocument;
|
||||
}
|
||||
|
||||
private async extractTitles(
|
||||
nodesByDocument: Record<string, BaseNode[]>,
|
||||
): Promise<Record<string, string>> {
|
||||
const titlesByDocument: Record<string, string> = {};
|
||||
|
||||
for (const [key, nodes] of Object.entries(nodesByDocument)) {
|
||||
const titleCandidates = await this.getTitlesCandidates(nodes);
|
||||
const combinedTitles = titleCandidates.join(", ");
|
||||
const completion = await this.llm.complete({
|
||||
prompt: defaultTitleCombinePromptTemplate({
|
||||
contextStr: combinedTitles,
|
||||
}),
|
||||
});
|
||||
|
||||
title = completion.text;
|
||||
titlesByDocument[key] = completion.text;
|
||||
}
|
||||
|
||||
if (nodesToExtractTitle.length === 1) {
|
||||
title = titlesCandidates[0];
|
||||
}
|
||||
return titlesByDocument;
|
||||
}
|
||||
|
||||
return nodes.map((_) => ({
|
||||
documentTitle: title.trim().replace(STRIP_REGEX, ""),
|
||||
}));
|
||||
private async getTitlesCandidates(nodes: BaseNode[]): Promise<string[]> {
|
||||
const titleJobs = nodes.map(async (node) => {
|
||||
const completion = await this.llm.complete({
|
||||
prompt: defaultTitleExtractorPromptTemplate({
|
||||
contextStr: node.getContent(MetadataMode.ALL),
|
||||
}),
|
||||
});
|
||||
|
||||
return completion.text;
|
||||
});
|
||||
|
||||
return await Promise.all(titleJobs);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -352,9 +387,9 @@ export class SummaryExtractor extends BaseExtractor {
|
||||
*/
|
||||
promptTemplate: string;
|
||||
|
||||
private _selfSummary: boolean;
|
||||
private _prevSummary: boolean;
|
||||
private _nextSummary: boolean;
|
||||
private selfSummary: boolean;
|
||||
private prevSummary: boolean;
|
||||
private nextSummary: boolean;
|
||||
|
||||
constructor(options?: SummaryExtractArgs) {
|
||||
const summaries = options?.summaries ?? ["self"];
|
||||
@@ -372,9 +407,9 @@ export class SummaryExtractor extends BaseExtractor {
|
||||
this.promptTemplate =
|
||||
options?.promptTemplate ?? defaultSummaryExtractorPromptTemplate();
|
||||
|
||||
this._selfSummary = summaries?.includes("self") ?? false;
|
||||
this._prevSummary = summaries?.includes("prev") ?? false;
|
||||
this._nextSummary = summaries?.includes("next") ?? false;
|
||||
this.selfSummary = summaries?.includes("self") ?? false;
|
||||
this.prevSummary = summaries?.includes("prev") ?? false;
|
||||
this.nextSummary = summaries?.includes("next") ?? false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -416,13 +451,13 @@ export class SummaryExtractor extends BaseExtractor {
|
||||
const metadataList: any[] = nodes.map(() => ({}));
|
||||
|
||||
for (let i = 0; i < nodes.length; i++) {
|
||||
if (i > 0 && this._prevSummary && nodeSummaries[i - 1]) {
|
||||
if (i > 0 && this.prevSummary && nodeSummaries[i - 1]) {
|
||||
metadataList[i]["prevSectionSummary"] = nodeSummaries[i - 1];
|
||||
}
|
||||
if (i < nodes.length - 1 && this._nextSummary && nodeSummaries[i + 1]) {
|
||||
if (i < nodes.length - 1 && this.nextSummary && nodeSummaries[i + 1]) {
|
||||
metadataList[i]["nextSectionSummary"] = nodeSummaries[i + 1];
|
||||
}
|
||||
if (this._selfSummary && nodeSummaries[i]) {
|
||||
if (this.selfSummary && nodeSummaries[i]) {
|
||||
metadataList[i]["sectionSummary"] = nodeSummaries[i];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,33 +21,25 @@ export const defaultKeywordExtractorPromptTemplate = ({
|
||||
contextStr = "",
|
||||
keywords = 5,
|
||||
}: DefaultKeywordExtractorPromptTemplate) => `${contextStr}
|
||||
|
||||
Give ${keywords} unique keywords for this document.
|
||||
|
||||
Format as comma separated. Keywords:
|
||||
`;
|
||||
Format as comma separated.
|
||||
Keywords: `;
|
||||
|
||||
export const defaultTitleExtractorPromptTemplate = (
|
||||
{ contextStr = "" }: DefaultPromptTemplate = {
|
||||
contextStr: "",
|
||||
},
|
||||
) => `${contextStr}
|
||||
|
||||
Give a title that summarizes all of the unique entities, titles or themes found in the context.
|
||||
|
||||
Title:
|
||||
`;
|
||||
Title: `;
|
||||
|
||||
export const defaultTitleCombinePromptTemplate = (
|
||||
{ contextStr = "" }: DefaultPromptTemplate = {
|
||||
contextStr: "",
|
||||
},
|
||||
) => `${contextStr}
|
||||
|
||||
Based on the above candidate titles and contents, what is the comprehensive title for this document?
|
||||
|
||||
Title:
|
||||
`;
|
||||
Title: `;
|
||||
|
||||
export const defaultQuestionAnswerPromptTemplate = (
|
||||
{ contextStr = "", numQuestions = 5 }: DefaultQuestionAnswerPromptTemplate = {
|
||||
@@ -55,9 +47,7 @@ export const defaultQuestionAnswerPromptTemplate = (
|
||||
numQuestions: 5,
|
||||
},
|
||||
) => `${contextStr}
|
||||
|
||||
Given the contextual informations, generate ${numQuestions} questions this context can provides specific answers to which are unlikely to be found elsewhere.Higher-level summaries of surrounding context may be provideds as well.
|
||||
|
||||
Given the contextual informations, generate ${numQuestions} questions this context can provides specific answers to which are unlikely to be found else where. Higher-level summaries of surrounding context may be provideds as well.
|
||||
Try using these summaries to generate better questions that this context can answer.
|
||||
`;
|
||||
|
||||
@@ -66,11 +56,8 @@ export const defaultSummaryExtractorPromptTemplate = (
|
||||
contextStr: "",
|
||||
},
|
||||
) => `${contextStr}
|
||||
|
||||
Summarize the key topics and entities of the sections.
|
||||
|
||||
Summary:
|
||||
`;
|
||||
Summary: `;
|
||||
|
||||
export const defaultNodeTextTemplate = ({
|
||||
metadataStr = "",
|
||||
|
||||
@@ -24,6 +24,7 @@ import { ClipEmbedding } from "../../embeddings/index.js";
|
||||
import { RetrieverQueryEngine } from "../../engines/query/RetrieverQueryEngine.js";
|
||||
import { runTransformations } from "../../ingestion/index.js";
|
||||
import type { BaseNodePostprocessor } from "../../postprocessors/types.js";
|
||||
import { storageContextFromDefaults } from "../../storage/StorageContext.js";
|
||||
import type {
|
||||
BaseIndexStore,
|
||||
MetadataFilters,
|
||||
@@ -32,10 +33,7 @@ import type {
|
||||
VectorStoreQuery,
|
||||
VectorStoreQueryResult,
|
||||
} from "../../storage/index.js";
|
||||
import {
|
||||
VectorStoreQueryMode,
|
||||
storageContextFromDefaults,
|
||||
} from "../../storage/index.js";
|
||||
import { VectorStoreQueryMode } from "../../storage/vectorStore/types.js";
|
||||
import type { BaseSynthesizer } from "../../synthesizers/types.js";
|
||||
import type { BaseQueryEngine } from "../../types.js";
|
||||
import type { BaseIndexInit } from "../BaseIndex.js";
|
||||
|
||||
@@ -27,12 +27,14 @@ export class SimpleNodeParser implements NodeParser {
|
||||
includePrevNextRel?: boolean;
|
||||
chunkSize?: number;
|
||||
chunkOverlap?: number;
|
||||
splitLongSentences?: boolean;
|
||||
}) {
|
||||
this.textSplitter =
|
||||
init?.textSplitter ??
|
||||
new SentenceSplitter({
|
||||
chunkSize: init?.chunkSize ?? DEFAULT_CHUNK_SIZE,
|
||||
chunkOverlap: init?.chunkOverlap ?? DEFAULT_CHUNK_OVERLAP,
|
||||
splitLongSentences: init?.splitLongSentences ?? false,
|
||||
});
|
||||
this.includeMetadata = init?.includeMetadata ?? true;
|
||||
this.includePrevNextRel = init?.includePrevNextRel ?? true;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { GenericFileSystem } from "@llamaindex/env";
|
||||
import { defaultFS } from "@llamaindex/env";
|
||||
import type { GenericFileSystem } from "@llamaindex/env/type";
|
||||
import type { ParseConfig } from "papaparse";
|
||||
import Papa from "papaparse";
|
||||
import { Document } from "../Node.js";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { GenericFileSystem } from "@llamaindex/env";
|
||||
import { defaultFS } from "@llamaindex/env";
|
||||
import type { GenericFileSystem } from "@llamaindex/env/type";
|
||||
import mammoth from "mammoth";
|
||||
import { Document } from "../Node.js";
|
||||
import type { FileReader } from "./type.js";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { GenericFileSystem } from "@llamaindex/env";
|
||||
import { defaultFS } from "@llamaindex/env";
|
||||
import type { GenericFileSystem } from "@llamaindex/env/type";
|
||||
import { Document } from "../Node.js";
|
||||
import type { FileReader } from "./type.js";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { GenericFileSystem } from "@llamaindex/env";
|
||||
import { defaultFS } from "@llamaindex/env";
|
||||
import type { GenericFileSystem } from "@llamaindex/env/type";
|
||||
import type { Document } from "../Node.js";
|
||||
import { ImageDocument } from "../Node.js";
|
||||
import type { FileReader } from "./type.js";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { GenericFileSystem } from "@llamaindex/env";
|
||||
import { defaultFS } from "@llamaindex/env";
|
||||
import type { GenericFileSystem } from "@llamaindex/env/type";
|
||||
import { Document } from "../Node.js";
|
||||
import type { FileReader } from "./type.js";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { GenericFileSystem } from "@llamaindex/env";
|
||||
import { defaultFS } from "@llamaindex/env";
|
||||
import type { GenericFileSystem } from "@llamaindex/env/type";
|
||||
import { Document } from "../Node.js";
|
||||
import type { FileReader } from "./type.js";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { GenericFileSystem } from "@llamaindex/env";
|
||||
import { createSHA256, defaultFS } from "@llamaindex/env";
|
||||
import type { GenericFileSystem } from "@llamaindex/env/type";
|
||||
import { Document } from "../Node.js";
|
||||
import type { BaseReader } from "./type.js";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { CompleteFileSystem } from "@llamaindex/env";
|
||||
import { defaultFS, path } from "@llamaindex/env";
|
||||
import type { CompleteFileSystem } from "@llamaindex/env/type";
|
||||
import { Document } from "../Node.js";
|
||||
import { walk } from "../storage/FileSystem.js";
|
||||
import { PapaCSVReader } from "./CSVReader.js";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { CompleteFileSystem } from "@llamaindex/env/type";
|
||||
import type { CompleteFileSystem } from "@llamaindex/env";
|
||||
import type { Document } from "../Node.js";
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
import type {
|
||||
GenericFileSystem,
|
||||
WalkableFileSystem,
|
||||
} from "@llamaindex/env/type";
|
||||
import type { GenericFileSystem, WalkableFileSystem } from "@llamaindex/env";
|
||||
// FS utility functions
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { GenericFileSystem } from "@llamaindex/env";
|
||||
import { defaultFS, path } from "@llamaindex/env";
|
||||
import type { GenericFileSystem } from "@llamaindex/env/type";
|
||||
import {
|
||||
DEFAULT_IMAGE_VECTOR_NAMESPACE,
|
||||
DEFAULT_NAMESPACE,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { GenericFileSystem } from "@llamaindex/env";
|
||||
import { defaultFS, path } from "@llamaindex/env";
|
||||
import type { GenericFileSystem } from "@llamaindex/env/type";
|
||||
import _ from "lodash";
|
||||
import {
|
||||
DEFAULT_DOC_STORE_PERSIST_FILENAME,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { GenericFileSystem } from "@llamaindex/env/type";
|
||||
import type { GenericFileSystem } from "@llamaindex/env";
|
||||
import { BaseNode } from "../../Node.js";
|
||||
import {
|
||||
DEFAULT_DOC_STORE_PERSIST_FILENAME,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { GenericFileSystem } from "@llamaindex/env";
|
||||
import { defaultFS, path } from "@llamaindex/env";
|
||||
import type { GenericFileSystem } from "@llamaindex/env/type";
|
||||
import {
|
||||
DEFAULT_INDEX_STORE_PERSIST_FILENAME,
|
||||
DEFAULT_PERSIST_DIR,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { GenericFileSystem } from "@llamaindex/env/type";
|
||||
import type { GenericFileSystem } from "@llamaindex/env";
|
||||
import type { IndexStruct } from "../../indices/IndexStruct.js";
|
||||
import {
|
||||
DEFAULT_INDEX_STORE_PERSIST_FILENAME,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { GenericFileSystem } from "@llamaindex/env";
|
||||
import { defaultFS, path } from "@llamaindex/env";
|
||||
import type { GenericFileSystem } from "@llamaindex/env/type";
|
||||
import _ from "lodash";
|
||||
import { exists } from "../FileSystem.js";
|
||||
import { DEFAULT_COLLECTION } from "../constants.js";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { GenericFileSystem } from "@llamaindex/env/type";
|
||||
import type { GenericFileSystem } from "@llamaindex/env";
|
||||
const defaultCollection = "data";
|
||||
|
||||
type StoredValue = Record<string, any> | null;
|
||||
|
||||
@@ -7,7 +7,7 @@ import type {
|
||||
VectorStoreQueryResult,
|
||||
} from "./types.js";
|
||||
|
||||
import type { GenericFileSystem } from "@llamaindex/env/type";
|
||||
import type { GenericFileSystem } from "@llamaindex/env";
|
||||
import type { BaseNode, Metadata } from "../../Node.js";
|
||||
import { Document, MetadataMode } from "../../Node.js";
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import type {
|
||||
VectorStoreQueryResult,
|
||||
} from "./types.js";
|
||||
|
||||
import type { GenericFileSystem } from "@llamaindex/env/type";
|
||||
import type { GenericFileSystem } from "@llamaindex/env";
|
||||
import type {
|
||||
FetchResponse,
|
||||
Index,
|
||||
|
||||
@@ -36,12 +36,11 @@ type QuerySearchResult = {
|
||||
export class QdrantVectorStore implements VectorStore {
|
||||
storesText: boolean = true;
|
||||
|
||||
db: QdrantClient;
|
||||
|
||||
collectionName: string;
|
||||
batchSize: number;
|
||||
collectionName: string;
|
||||
|
||||
private _collectionInitialized: boolean = false;
|
||||
private db: QdrantClient;
|
||||
private collectionInitialized: boolean = false;
|
||||
|
||||
/**
|
||||
* Creates a new QdrantVectorStore.
|
||||
@@ -59,7 +58,7 @@ export class QdrantVectorStore implements VectorStore {
|
||||
batchSize,
|
||||
}: QdrantParams) {
|
||||
if (!client && !url) {
|
||||
if (!url || !collectionName) {
|
||||
if (!url) {
|
||||
throw new Error("QdrantVectorStore requires url and collectionName");
|
||||
}
|
||||
}
|
||||
@@ -122,7 +121,7 @@ export class QdrantVectorStore implements VectorStore {
|
||||
if (!exists) {
|
||||
await this.createCollection(this.collectionName, vectorSize);
|
||||
}
|
||||
this._collectionInitialized = true;
|
||||
this.collectionInitialized = true;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -179,7 +178,7 @@ export class QdrantVectorStore implements VectorStore {
|
||||
* @returns List of node IDs
|
||||
*/
|
||||
async add(embeddingResults: BaseNode[]): Promise<string[]> {
|
||||
if (embeddingResults.length > 0 && !this._collectionInitialized) {
|
||||
if (embeddingResults.length > 0 && !this.collectionInitialized) {
|
||||
await this.initializeCollection(
|
||||
embeddingResults[0].getEmbedding().length,
|
||||
);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { GenericFileSystem } from "@llamaindex/env";
|
||||
import { defaultFS, path } from "@llamaindex/env";
|
||||
import type { GenericFileSystem } from "@llamaindex/env/type";
|
||||
import _ from "lodash";
|
||||
import type { BaseNode } from "../../Node.js";
|
||||
import {
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
import { defaultOutputProcessor } from "llamaindex";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
describe("JSONQueryEngine", () => {
|
||||
const jsonValue = {
|
||||
blogPosts: [
|
||||
{
|
||||
id: 1,
|
||||
title: "First blog post",
|
||||
content: "This is my first blog post",
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
title: "Second blog post",
|
||||
content: "This is my second blog post",
|
||||
},
|
||||
],
|
||||
comments: [
|
||||
{
|
||||
id: 1,
|
||||
content: "Nice post!",
|
||||
username: "jerry",
|
||||
blogPostId: 1,
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
content: "Interesting thoughts",
|
||||
username: "simon",
|
||||
blogPostId: 2,
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
content: "Loved reading this!",
|
||||
username: "simon",
|
||||
blogPostId: 2,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
it("should be able to output parse", async () => {
|
||||
const values = await defaultOutputProcessor({
|
||||
llmOutput: "$..comments[?(@.username=='simon')].content",
|
||||
jsonValue,
|
||||
});
|
||||
|
||||
expect(values).toEqual([
|
||||
{
|
||||
content: "Interesting thoughts",
|
||||
},
|
||||
{
|
||||
content: "Loved reading this!",
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
it("should be able to output parse with extra strings", async () => {
|
||||
const values = await defaultOutputProcessor({
|
||||
llmOutput: "`$..comments[?(@.username=='simon')].content`",
|
||||
jsonValue,
|
||||
});
|
||||
|
||||
expect(values).toEqual([
|
||||
{
|
||||
content: "Interesting thoughts",
|
||||
},
|
||||
{
|
||||
content: "Loved reading this!",
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
it("should be able to return a complete object", async () => {
|
||||
const object = await defaultOutputProcessor({
|
||||
llmOutput: "`$..comments[?(@.id=='1')]`",
|
||||
jsonValue,
|
||||
});
|
||||
|
||||
expect(object).toEqual([
|
||||
{
|
||||
id: 1,
|
||||
content: "Nice post!",
|
||||
username: "jerry",
|
||||
blogPostId: 1,
|
||||
},
|
||||
]);
|
||||
});
|
||||
});
|
||||
Vendored
+2
-1
@@ -6,6 +6,7 @@
|
||||
"target": "esnext"
|
||||
},
|
||||
"module": {
|
||||
"type": "commonjs"
|
||||
"type": "commonjs",
|
||||
"ignoreDynamic": true
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+6
@@ -1,5 +1,11 @@
|
||||
# @llamaindex/env
|
||||
|
||||
## 0.0.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- cf87f84: fix: type backward compatibility
|
||||
|
||||
## 0.0.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
Vendored
+7
-3
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@llamaindex/env",
|
||||
"description": "environment wrapper",
|
||||
"version": "0.0.3",
|
||||
"version": "0.0.4",
|
||||
"type": "module",
|
||||
"types": "dist/type/index.d.ts",
|
||||
"main": "dist/cjs/index.js",
|
||||
@@ -56,12 +56,16 @@
|
||||
"@aws-crypto/sha256-js": "^5.2.0",
|
||||
"@swc/cli": "^0.3.9",
|
||||
"@swc/core": "^1.4.2",
|
||||
"@types/lodash": "^4.14.202",
|
||||
"@types/node": "^20.11.20",
|
||||
"pathe": "^1.1.2",
|
||||
"concurrently": "^8.2.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/lodash": "^4.14.202",
|
||||
"@types/node": "^20.11.20",
|
||||
"lodash": "^4.17.21"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@aws-crypto/sha256-js": "^5.2.0",
|
||||
"pathe": "^1.1.2"
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1
@@ -38,3 +38,4 @@ export function createSHA256(): SHA256 {
|
||||
export function randomUUID(): string {
|
||||
return crypto.randomUUID();
|
||||
}
|
||||
export * from "./type.js";
|
||||
|
||||
Vendored
+1
@@ -34,4 +34,5 @@ export const defaultFS: CompleteFileSystem = {
|
||||
stat: fs.stat,
|
||||
};
|
||||
|
||||
export * from "./type.js";
|
||||
export { EOL, ok, path, randomUUID };
|
||||
|
||||
Generated
+116
-28
@@ -186,6 +186,21 @@ importers:
|
||||
'@qdrant/js-client-rest':
|
||||
specifier: ^1.7.0
|
||||
version: 1.7.0(typescript@5.3.3)
|
||||
'@types/jsonpath':
|
||||
specifier: ^0.2.4
|
||||
version: 0.2.4
|
||||
'@types/lodash':
|
||||
specifier: ^4.14.202
|
||||
version: 4.14.202
|
||||
'@types/node':
|
||||
specifier: ^18.19.14
|
||||
version: 18.19.14
|
||||
'@types/papaparse':
|
||||
specifier: ^5.3.14
|
||||
version: 5.3.14
|
||||
'@types/pg':
|
||||
specifier: ^8.11.0
|
||||
version: 8.11.0
|
||||
'@xenova/transformers':
|
||||
specifier: ^2.15.0
|
||||
version: 2.15.0
|
||||
@@ -204,6 +219,9 @@ importers:
|
||||
js-tiktoken:
|
||||
specifier: ^1.0.10
|
||||
version: 1.0.10
|
||||
jsonpath:
|
||||
specifier: ^1.1.1
|
||||
version: 1.1.1
|
||||
lodash:
|
||||
specifier: ^4.17.21
|
||||
version: 4.17.21
|
||||
@@ -259,18 +277,6 @@ importers:
|
||||
'@swc/core':
|
||||
specifier: ^1.4.2
|
||||
version: 1.4.2
|
||||
'@types/lodash':
|
||||
specifier: ^4.14.202
|
||||
version: 4.14.202
|
||||
'@types/node':
|
||||
specifier: ^18.19.14
|
||||
version: 18.19.14
|
||||
'@types/papaparse':
|
||||
specifier: ^5.3.14
|
||||
version: 5.3.14
|
||||
'@types/pg':
|
||||
specifier: ^8.11.0
|
||||
version: 8.11.0
|
||||
concurrently:
|
||||
specifier: ^8.2.2
|
||||
version: 8.2.2
|
||||
@@ -376,6 +382,12 @@ importers:
|
||||
|
||||
packages/env:
|
||||
dependencies:
|
||||
'@types/lodash':
|
||||
specifier: ^4.14.202
|
||||
version: 4.14.202
|
||||
'@types/node':
|
||||
specifier: ^20.11.20
|
||||
version: 20.11.20
|
||||
lodash:
|
||||
specifier: ^4.17.21
|
||||
version: 4.17.21
|
||||
@@ -389,12 +401,6 @@ importers:
|
||||
'@swc/core':
|
||||
specifier: ^1.4.2
|
||||
version: 1.4.2
|
||||
'@types/lodash':
|
||||
specifier: ^4.14.202
|
||||
version: 4.14.202
|
||||
'@types/node':
|
||||
specifier: ^20.11.20
|
||||
version: 20.11.20
|
||||
concurrently:
|
||||
specifier: ^8.2.2
|
||||
version: 8.2.2
|
||||
@@ -4240,6 +4246,10 @@ packages:
|
||||
/@types/json5@0.0.29:
|
||||
resolution: {integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==}
|
||||
|
||||
/@types/jsonpath@0.2.4:
|
||||
resolution: {integrity: sha512-K3hxB8Blw0qgW6ExKgMbXQv2UPZBoE2GqLpVY+yr7nMD2Pq86lsuIzyAaiQ7eMqFL5B6di6pxSkogLJEyEHoGA==}
|
||||
dev: false
|
||||
|
||||
/@types/keyv@3.1.4:
|
||||
resolution: {integrity: sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==}
|
||||
dependencies:
|
||||
@@ -4254,6 +4264,7 @@ packages:
|
||||
|
||||
/@types/lodash@4.14.202:
|
||||
resolution: {integrity: sha512-OvlIYQK9tNneDlS0VN54LLd5uiPCBOp7gS5Z0f1mjoJYBrtStzgmJBxONW3U6OZqdtNzZPmn9BS/7WI7BFFcFQ==}
|
||||
dev: false
|
||||
|
||||
/@types/long@4.0.2:
|
||||
resolution: {integrity: sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==}
|
||||
@@ -4310,6 +4321,7 @@ packages:
|
||||
resolution: {integrity: sha512-EnQ4Us2rmOS64nHDWr0XqAD8DsO6f3XR6lf9UIIrZQpUzPVdN/oPuEzfDWNHSyXLvoGgjuEm/sPwFGSSs35Wtg==}
|
||||
dependencies:
|
||||
undici-types: 5.26.5
|
||||
dev: false
|
||||
|
||||
/@types/node@20.11.14:
|
||||
resolution: {integrity: sha512-w3yWCcwULefjP9DmDDsgUskrMoOy5Z8MiwKHr1FvqGPtx7CvJzQvxD7eKpxNtklQxLruxSXWddyeRtyud0RcXQ==}
|
||||
@@ -4326,7 +4338,7 @@ packages:
|
||||
resolution: {integrity: sha512-7/rR21OS+fq8IyHTgtLkDK949uzsa6n8BkziAKtPVpugIkO6D+/ooXMvzXxDnZrmtXVfjb1bKQafYpb8s89LOg==}
|
||||
dependencies:
|
||||
undici-types: 5.26.5
|
||||
dev: true
|
||||
dev: false
|
||||
|
||||
/@types/node@20.11.7:
|
||||
resolution: {integrity: sha512-GPmeN1C3XAyV5uybAf4cMLWT9fDWcmQhZVtMFu7OR32WjrqGG+Wnk2V1d0bmtUyE/Zy1QJ9BxyiTih9z8Oks8A==}
|
||||
@@ -4342,7 +4354,7 @@ packages:
|
||||
resolution: {integrity: sha512-LxJ4iEFcpqc6METwp9f6BV6VVc43m6MfH0VqFosHvrUgfXiFe6ww7R3itkOQ+TCK6Y+Iv/+RnnvtRZnkc5Kc9g==}
|
||||
dependencies:
|
||||
'@types/node': 20.11.17
|
||||
dev: true
|
||||
dev: false
|
||||
|
||||
/@types/parse-json@4.0.2:
|
||||
resolution: {integrity: sha512-dISoDXWWQwUquiKsyZ4Ng+HX2KsPL7LyHKHQwgGFEA3IaKac4Obd+h2a/a6waisAoepJlBcx9paWqjA8/HVjCw==}
|
||||
@@ -4353,7 +4365,7 @@ packages:
|
||||
'@types/node': 20.11.17
|
||||
pg-protocol: 1.6.0
|
||||
pg-types: 4.0.1
|
||||
dev: true
|
||||
dev: false
|
||||
|
||||
/@types/prismjs@1.26.3:
|
||||
resolution: {integrity: sha512-A0D0aTXvjlqJ5ZILMz3rNfDBOx9hHxLZYv2by47Sm/pqW35zzjusrZTryatjN/Rf8Us2gZrJD+KeHbUSTux1Cw==}
|
||||
@@ -7192,6 +7204,19 @@ packages:
|
||||
resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==}
|
||||
engines: {node: '>=12'}
|
||||
|
||||
/escodegen@1.14.3:
|
||||
resolution: {integrity: sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw==}
|
||||
engines: {node: '>=4.0'}
|
||||
hasBin: true
|
||||
dependencies:
|
||||
esprima: 4.0.1
|
||||
estraverse: 4.3.0
|
||||
esutils: 2.0.3
|
||||
optionator: 0.8.3
|
||||
optionalDependencies:
|
||||
source-map: 0.6.1
|
||||
dev: false
|
||||
|
||||
/escodegen@2.1.0:
|
||||
resolution: {integrity: sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==}
|
||||
engines: {node: '>=6.0'}
|
||||
@@ -7513,6 +7538,12 @@ packages:
|
||||
acorn-jsx: 5.3.2(acorn@8.11.3)
|
||||
eslint-visitor-keys: 3.4.3
|
||||
|
||||
/esprima@1.2.2:
|
||||
resolution: {integrity: sha512-+JpPZam9w5DuJ3Q67SqsMGtiHKENSMRVoxvArfJZK01/BfLEObtZ6orJa/MtoGNR/rfMgp5837T41PAmTwAv/A==}
|
||||
engines: {node: '>=0.4.0'}
|
||||
hasBin: true
|
||||
dev: false
|
||||
|
||||
/esprima@4.0.1:
|
||||
resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==}
|
||||
engines: {node: '>=4'}
|
||||
@@ -9481,6 +9512,14 @@ packages:
|
||||
optionalDependencies:
|
||||
graceful-fs: 4.2.11
|
||||
|
||||
/jsonpath@1.1.1:
|
||||
resolution: {integrity: sha512-l6Cg7jRpixfbgoWgkrl77dgEj8RPvND0wMH6TwQmi9Qs4TFfS9u5cUFnbeKTwj5ga5Y3BTGGNI28k117LJ009w==}
|
||||
dependencies:
|
||||
esprima: 1.2.2
|
||||
static-eval: 2.0.2
|
||||
underscore: 1.12.1
|
||||
dev: false
|
||||
|
||||
/jsx-ast-utils@3.3.3:
|
||||
resolution: {integrity: sha512-fYQHZTZ8jSfmWZ0iyzfwiU4WDX4HpHbMCZ3gPlWYiCl3BoeOTsqKBqnTVfH2rYT7eP5c3sVbeSPHnnJOaTrWiw==}
|
||||
engines: {node: '>=4.0'}
|
||||
@@ -9557,6 +9596,14 @@ packages:
|
||||
resolution: {integrity: sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==}
|
||||
engines: {node: '>=6'}
|
||||
|
||||
/levn@0.3.0:
|
||||
resolution: {integrity: sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==}
|
||||
engines: {node: '>= 0.8.0'}
|
||||
dependencies:
|
||||
prelude-ls: 1.1.2
|
||||
type-check: 0.3.2
|
||||
dev: false
|
||||
|
||||
/levn@0.4.1:
|
||||
resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==}
|
||||
engines: {node: '>= 0.8.0'}
|
||||
@@ -11157,6 +11204,18 @@ packages:
|
||||
resolution: {integrity: sha512-pkEqbDyl8ou5cpq+VsnQbe/WlEy5qS7xPzMS1U55OCG9KPvwFD46zDbxQIj3egJSFc3D+XhYOPUzz49zQAVy7A==}
|
||||
dev: false
|
||||
|
||||
/optionator@0.8.3:
|
||||
resolution: {integrity: sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==}
|
||||
engines: {node: '>= 0.8.0'}
|
||||
dependencies:
|
||||
deep-is: 0.1.4
|
||||
fast-levenshtein: 2.0.6
|
||||
levn: 0.3.0
|
||||
prelude-ls: 1.1.2
|
||||
type-check: 0.3.2
|
||||
word-wrap: 1.2.5
|
||||
dev: false
|
||||
|
||||
/optionator@0.9.3:
|
||||
resolution: {integrity: sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==}
|
||||
engines: {node: '>= 0.8.0'}
|
||||
@@ -11491,11 +11550,12 @@ packages:
|
||||
/pg-int8@1.0.1:
|
||||
resolution: {integrity: sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==}
|
||||
engines: {node: '>=4.0.0'}
|
||||
dev: false
|
||||
|
||||
/pg-numeric@1.0.2:
|
||||
resolution: {integrity: sha512-BM/Thnrw5jm2kKLE5uJkXqqExRUY/toLHda65XgFTBTFYZyopbKjBe29Ii3RbkvlsMoFwD+tHeGaCjjv0gHlyw==}
|
||||
engines: {node: '>=4'}
|
||||
dev: true
|
||||
dev: false
|
||||
|
||||
/pg-pool@3.6.1(pg@8.11.3):
|
||||
resolution: {integrity: sha512-jizsIzhkIitxCGfPRzJn1ZdcosIt3pz9Sh3V01fm1vZnbnCMgmGl5wvGGdNN2EL9Rmb0EcFoCkixH4Pu+sP9Og==}
|
||||
@@ -11507,6 +11567,7 @@ packages:
|
||||
|
||||
/pg-protocol@1.6.0:
|
||||
resolution: {integrity: sha512-M+PDm637OY5WM307051+bsDia5Xej6d9IR4GwJse1qA1DIhiKlksvrneZOYQq42OM+spubpcNYEo2FcKQrDk+Q==}
|
||||
dev: false
|
||||
|
||||
/pg-types@2.2.0:
|
||||
resolution: {integrity: sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==}
|
||||
@@ -11530,7 +11591,7 @@ packages:
|
||||
postgres-date: 2.0.1
|
||||
postgres-interval: 3.0.0
|
||||
postgres-range: 1.1.3
|
||||
dev: true
|
||||
dev: false
|
||||
|
||||
/pg@8.11.3:
|
||||
resolution: {integrity: sha512-+9iuvG8QfaaUrrph+kpF24cXkH1YOOUeArRNYIxq1viYHZagBxrTno7cecY1Fa44tJeZvaoG+Djpkc3JwehN5g==}
|
||||
@@ -12067,7 +12128,7 @@ packages:
|
||||
/postgres-array@3.0.2:
|
||||
resolution: {integrity: sha512-6faShkdFugNQCLwucjPcY5ARoW1SlbnrZjmGl0IrrqewpvxvhSLHimCVzqeuULCbG0fQv7Dtk1yDbG3xv7Veog==}
|
||||
engines: {node: '>=12'}
|
||||
dev: true
|
||||
dev: false
|
||||
|
||||
/postgres-bytea@1.0.0:
|
||||
resolution: {integrity: sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w==}
|
||||
@@ -12079,7 +12140,7 @@ packages:
|
||||
engines: {node: '>= 6'}
|
||||
dependencies:
|
||||
obuf: 1.1.2
|
||||
dev: true
|
||||
dev: false
|
||||
|
||||
/postgres-date@1.0.7:
|
||||
resolution: {integrity: sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==}
|
||||
@@ -12089,7 +12150,7 @@ packages:
|
||||
/postgres-date@2.0.1:
|
||||
resolution: {integrity: sha512-YtMKdsDt5Ojv1wQRvUhnyDJNSr2dGIC96mQVKz7xufp07nfuFONzdaowrMHjlAzY6GDLd4f+LUHHAAM1h4MdUw==}
|
||||
engines: {node: '>=12'}
|
||||
dev: true
|
||||
dev: false
|
||||
|
||||
/postgres-interval@1.2.0:
|
||||
resolution: {integrity: sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==}
|
||||
@@ -12101,11 +12162,11 @@ packages:
|
||||
/postgres-interval@3.0.0:
|
||||
resolution: {integrity: sha512-BSNDnbyZCXSxgA+1f5UU2GmwhoI0aU5yMxRGO8CdFEcY2BQF9xm/7MqKnYoM1nJDk8nONNWDk9WeSmePFhQdlw==}
|
||||
engines: {node: '>=12'}
|
||||
dev: true
|
||||
dev: false
|
||||
|
||||
/postgres-range@1.1.3:
|
||||
resolution: {integrity: sha512-VdlZoocy5lCP0c/t66xAfclglEapXPCIVhqqJRncYpvbCgImF0w67aPKfbqUMr72tO2k5q0TdTZwCLjPTI6C9g==}
|
||||
dev: true
|
||||
dev: false
|
||||
|
||||
/prebuild-install@7.1.1:
|
||||
resolution: {integrity: sha512-jAXscXWMcCK8GgCoHOfIr0ODh5ai8mj63L2nWrjuAgXE6tDyYGnx4/8o/rCgU+B4JSyZBKbeZqzhtwtC3ovxjw==}
|
||||
@@ -12179,6 +12240,11 @@ packages:
|
||||
which-pm: 2.0.0
|
||||
dev: true
|
||||
|
||||
/prelude-ls@1.1.2:
|
||||
resolution: {integrity: sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==}
|
||||
engines: {node: '>= 0.8.0'}
|
||||
dev: false
|
||||
|
||||
/prelude-ls@1.2.1:
|
||||
resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==}
|
||||
engines: {node: '>= 0.8.0'}
|
||||
@@ -13645,6 +13711,12 @@ packages:
|
||||
resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==}
|
||||
dev: true
|
||||
|
||||
/static-eval@2.0.2:
|
||||
resolution: {integrity: sha512-N/D219Hcr2bPjLxPiV+TQE++Tsmrady7TqAJugLy7Xk1EumfDWS/f5dtBbkRCGE7wKKXuYockQoj8Rm2/pVKyg==}
|
||||
dependencies:
|
||||
escodegen: 1.14.3
|
||||
dev: false
|
||||
|
||||
/statuses@1.5.0:
|
||||
resolution: {integrity: sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==}
|
||||
engines: {node: '>= 0.6'}
|
||||
@@ -14446,6 +14518,13 @@ packages:
|
||||
turbo-windows-arm64: 1.12.3
|
||||
dev: true
|
||||
|
||||
/type-check@0.3.2:
|
||||
resolution: {integrity: sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==}
|
||||
engines: {node: '>= 0.8.0'}
|
||||
dependencies:
|
||||
prelude-ls: 1.1.2
|
||||
dev: false
|
||||
|
||||
/type-check@0.4.0:
|
||||
resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==}
|
||||
engines: {node: '>= 0.8.0'}
|
||||
@@ -14600,6 +14679,10 @@ packages:
|
||||
has-symbols: 1.0.3
|
||||
which-boxed-primitive: 1.0.2
|
||||
|
||||
/underscore@1.12.1:
|
||||
resolution: {integrity: sha512-hEQt0+ZLDVUMhebKxL4x1BTtDY7bavVofhZ9KZ4aI26X9SRaE+Y3m83XUL1UP2jn8ynjndwCCpEHdUG+9pP1Tw==}
|
||||
dev: false
|
||||
|
||||
/underscore@1.13.6:
|
||||
resolution: {integrity: sha512-+A5Sja4HP1M08MaXya7p5LvjuM7K6q/2EaC0+iovj/wOcMsTzMvDFbasi/oSapiwOlt252IqsKqPjCl7huKS0A==}
|
||||
dev: false
|
||||
@@ -15357,6 +15440,11 @@ packages:
|
||||
winston-transport: 4.6.0
|
||||
dev: false
|
||||
|
||||
/word-wrap@1.2.5:
|
||||
resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
dev: false
|
||||
|
||||
/wordwrap@1.0.0:
|
||||
resolution: {integrity: sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==}
|
||||
dev: true
|
||||
|
||||
Reference in New Issue
Block a user