Compare commits

...

3 Commits

Author SHA1 Message Date
github-actions[bot] 59c5e5c3d4 Release 0.6.17 (#1305)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-10-07 14:44:04 +07:00
Thuc Pham ee697fb1b3 fix: generate uuid when inserting to Qdrant (#1301) 2024-10-07 14:17:04 +07:00
Alex Yang cf3320a4ea fix: improve getResponseSynthesizer type (#1304) 2024-10-06 19:15:55 -07:00
41 changed files with 226 additions and 35 deletions
+7
View File
@@ -1,5 +1,12 @@
# docs
## 0.0.86
### Patch Changes
- Updated dependencies [ee697fb]
- llamaindex@0.6.17
## 0.0.85
### Patch Changes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "docs",
"version": "0.0.85",
"version": "0.0.86",
"private": true,
"scripts": {
"docusaurus": "docusaurus",
+7
View File
@@ -1,5 +1,12 @@
# @llamaindex/autotool
## 3.0.17
### Patch Changes
- Updated dependencies [ee697fb]
- llamaindex@0.6.17
## 3.0.16
### Patch Changes
@@ -1,5 +1,13 @@
# @llamaindex/autotool-01-node-example
## 0.0.26
### Patch Changes
- Updated dependencies [ee697fb]
- llamaindex@0.6.17
- @llamaindex/autotool@3.0.17
## 0.0.25
### Patch Changes
@@ -13,5 +13,5 @@
"scripts": {
"start": "node --import tsx --import @llamaindex/autotool/node ./src/index.ts"
},
"version": "0.0.25"
"version": "0.0.26"
}
@@ -1,5 +1,13 @@
# @llamaindex/autotool-02-next-example
## 0.1.70
### Patch Changes
- Updated dependencies [ee697fb]
- llamaindex@0.6.17
- @llamaindex/autotool@3.0.17
## 0.1.69
### Patch Changes
@@ -1,7 +1,7 @@
{
"name": "@llamaindex/autotool-02-next-example",
"private": true,
"version": "0.1.69",
"version": "0.1.70",
"scripts": {
"dev": "next dev",
"build": "next build",
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@llamaindex/autotool",
"type": "module",
"version": "3.0.16",
"version": "3.0.17",
"description": "auto transpile your JS function to LLM Agent compatible",
"files": [
"dist",
+7
View File
@@ -1,5 +1,12 @@
# @llamaindex/cloud
## 0.2.13
### Patch Changes
- Updated dependencies [ee697fb]
- @llamaindex/core@0.2.11
## 0.2.12
### Patch Changes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@llamaindex/cloud",
"version": "0.2.12",
"version": "0.2.13",
"type": "module",
"license": "MIT",
"scripts": {
+7
View File
@@ -1,5 +1,12 @@
# @llamaindex/community
## 0.0.46
### Patch Changes
- Updated dependencies [ee697fb]
- @llamaindex/core@0.2.11
## 0.0.45
### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@llamaindex/community",
"description": "Community package for LlamaIndexTS",
"version": "0.0.45",
"version": "0.0.46",
"type": "module",
"types": "dist/type/index.d.ts",
"main": "dist/cjs/index.js",
+6
View File
@@ -1,5 +1,11 @@
# @llamaindex/core
## 0.2.11
### Patch Changes
- ee697fb: fix: generate uuid when inserting to Qdrant
## 0.2.10
### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@llamaindex/core",
"type": "module",
"version": "0.2.10",
"version": "0.2.11",
"description": "LlamaIndex Core Module",
"exports": {
"./agent": {
@@ -403,27 +403,27 @@ class MultiModal extends BaseSynthesizer {
}
}
export function getResponseSynthesizer(
mode: ResponseMode,
const modeToSynthesizer = {
compact: CompactAndRefine,
refine: Refine,
tree_summarize: TreeSummarize,
multi_modal: MultiModal,
} as const;
export function getResponseSynthesizer<Mode extends ResponseMode>(
mode: Mode,
options: BaseSynthesizerOptions & {
textQATemplate?: TextQAPrompt;
refineTemplate?: RefinePrompt;
summaryTemplate?: TreeSummarizePrompt;
metadataMode?: MetadataMode;
} = {},
) {
switch (mode) {
case "compact": {
return new CompactAndRefine(options);
}
case "refine": {
return new Refine(options);
}
case "tree_summarize": {
return new TreeSummarize(options);
}
case "multi_modal": {
return new MultiModal(options);
}
): InstanceType<(typeof modeToSynthesizer)[Mode]> {
const Synthesizer: (typeof modeToSynthesizer)[Mode] = modeToSynthesizer[mode];
if (!Synthesizer) {
throw new Error(`Invalid response mode: ${mode}`);
}
return new Synthesizer(options) as InstanceType<
(typeof modeToSynthesizer)[Mode]
>;
}
+1
View File
@@ -80,3 +80,4 @@ export {
} from "./llms";
export { objectEntries } from "./object-entries";
export { UUIDFromString } from "./uuid";
+22
View File
@@ -0,0 +1,22 @@
import { createSHA256 } from "@llamaindex/env";
export function UUIDFromString(input: string) {
const hashFunction = createSHA256();
hashFunction.update(input);
const base64Hash = hashFunction.digest();
// Convert base64 to hex
const hexHash = Buffer.from(base64Hash, "base64").toString("hex");
// Format the hash to resemble a UUID (version 5 style)
const uuid = [
hexHash.substring(0, 8),
hexHash.substring(8, 12),
"5" + hexHash.substring(12, 15), // Set the version to 5 (name-based)
((parseInt(hexHash.substring(15, 17), 16) & 0x3f) | 0x80).toString(16) +
hexHash.substring(17, 19), // Set the variant
hexHash.substring(19, 31),
].join("-");
return uuid;
}
+37
View File
@@ -0,0 +1,37 @@
import { UUIDFromString } from "@llamaindex/core/utils";
import { describe, expect, it } from "vitest";
const UUID_REGEX =
/^[0-9a-f]{8}-[0-9a-f]{4}-5[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
describe("UUIDFromString", () => {
it("should convert string to UUID", () => {
const string = "document_id_1";
const result = UUIDFromString(string);
expect(result).toBeDefined();
expect(result).toMatch(UUID_REGEX);
});
it("should return the same UUID for the same input string", () => {
const string = "document_id_1";
const result1 = UUIDFromString(string);
const result2 = UUIDFromString(string);
expect(result1).toEqual(result2);
});
it("should return the different UUID for different input strings", () => {
const string1 = "document_id_1";
const string2 = "document_id_2";
const result1 = UUIDFromString(string1);
const result2 = UUIDFromString(string2);
expect(result1).not.toEqual(result2);
});
it("should handle case-sensitive input strings", () => {
const string1 = "document_id_1";
const string2 = "Document_Id_1";
const result1 = UUIDFromString(string1);
const result2 = UUIDFromString(string2);
expect(result1).not.toEqual(result2);
});
});
+7
View File
@@ -1,5 +1,12 @@
# @llamaindex/experimental
## 0.0.95
### Patch Changes
- Updated dependencies [ee697fb]
- llamaindex@0.6.17
## 0.0.94
### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@llamaindex/experimental",
"description": "Experimental package for LlamaIndexTS",
"version": "0.0.94",
"version": "0.0.95",
"type": "module",
"types": "dist/type/index.d.ts",
"main": "dist/cjs/index.js",
+12
View File
@@ -1,5 +1,17 @@
# llamaindex
## 0.6.17
### Patch Changes
- ee697fb: fix: generate uuid when inserting to Qdrant
- Updated dependencies [ee697fb]
- @llamaindex/core@0.2.11
- @llamaindex/cloud@0.2.13
- @llamaindex/ollama@0.0.6
- @llamaindex/openai@0.1.14
- @llamaindex/groq@0.0.13
## 0.6.16
### Patch Changes
@@ -1,5 +1,12 @@
# @llamaindex/cloudflare-worker-agent-test
## 0.0.79
### Patch Changes
- Updated dependencies [ee697fb]
- llamaindex@0.6.17
## 0.0.78
### Patch Changes
@@ -1,6 +1,6 @@
{
"name": "@llamaindex/cloudflare-worker-agent-test",
"version": "0.0.78",
"version": "0.0.79",
"type": "module",
"private": true,
"scripts": {
@@ -1,5 +1,11 @@
# @llamaindex/llama-parse-browser-test
## 0.0.9
### Patch Changes
- @llamaindex/cloud@0.2.13
## 0.0.8
### Patch Changes
@@ -1,7 +1,7 @@
{
"name": "@llamaindex/llama-parse-browser-test",
"private": true,
"version": "0.0.8",
"version": "0.0.9",
"type": "module",
"scripts": {
"dev": "vite",
@@ -1,5 +1,12 @@
# @llamaindex/next-agent-test
## 0.1.79
### Patch Changes
- Updated dependencies [ee697fb]
- llamaindex@0.6.17
## 0.1.78
### Patch Changes
@@ -1,6 +1,6 @@
{
"name": "@llamaindex/next-agent-test",
"version": "0.1.78",
"version": "0.1.79",
"private": true,
"scripts": {
"dev": "next dev",
@@ -1,5 +1,12 @@
# test-edge-runtime
## 0.1.78
### Patch Changes
- Updated dependencies [ee697fb]
- llamaindex@0.6.17
## 0.1.77
### Patch Changes
@@ -1,6 +1,6 @@
{
"name": "@llamaindex/nextjs-edge-runtime-test",
"version": "0.1.77",
"version": "0.1.78",
"private": true,
"scripts": {
"dev": "next dev",
@@ -1,5 +1,12 @@
# @llamaindex/next-node-runtime
## 0.0.60
### Patch Changes
- Updated dependencies [ee697fb]
- llamaindex@0.6.17
## 0.0.59
### Patch Changes
@@ -1,6 +1,6 @@
{
"name": "@llamaindex/next-node-runtime-test",
"version": "0.0.59",
"version": "0.0.60",
"private": true,
"scripts": {
"dev": "next dev",
@@ -1,5 +1,12 @@
# @llamaindex/waku-query-engine-test
## 0.0.79
### Patch Changes
- Updated dependencies [ee697fb]
- llamaindex@0.6.17
## 0.0.78
### Patch Changes
@@ -1,6 +1,6 @@
{
"name": "@llamaindex/waku-query-engine-test",
"version": "0.0.78",
"version": "0.0.79",
"type": "module",
"private": true,
"scripts": {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "llamaindex",
"version": "0.6.16",
"version": "0.6.17",
"license": "MIT",
"type": "module",
"keywords": [
@@ -10,6 +10,7 @@ import {
type VectorStoreQueryResult,
} from "./types.js";
import { UUIDFromString } from "@llamaindex/core/utils";
import type { QdrantClientParams, Schemas } from "@qdrant/js-client-rest";
import { QdrantClient } from "@qdrant/js-client-rest";
import { metadataDictToNode, nodeToMetadata } from "./utils.js";
@@ -170,7 +171,7 @@ export class QdrantVectorStore
for (let k = 0; k < nodeIds.length; k++) {
const point: PointStruct = {
id: nodeIds[k]!.id_,
id: UUIDFromString(nodeIds[k]!.id_),
payload: payloads[k]!,
vector: vectors[k]!,
};
+6
View File
@@ -1,5 +1,11 @@
# @llamaindex/groq
## 0.0.13
### Patch Changes
- @llamaindex/openai@0.1.14
## 0.0.12
### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@llamaindex/groq",
"description": "Groq Adapter for LlamaIndex",
"version": "0.0.12",
"version": "0.0.13",
"type": "module",
"main": "./dist/index.cjs",
"module": "./dist/index.js",
+7
View File
@@ -1,5 +1,12 @@
# @llamaindex/ollama
## 0.0.6
### Patch Changes
- Updated dependencies [ee697fb]
- @llamaindex/core@0.2.11
## 0.0.5
### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@llamaindex/ollama",
"description": "Ollama Adapter for LlamaIndex",
"version": "0.0.5",
"version": "0.0.6",
"type": "module",
"main": "./dist/index.cjs",
"module": "./dist/index.js",
+7
View File
@@ -1,5 +1,12 @@
# @llamaindex/openai
## 0.1.14
### Patch Changes
- Updated dependencies [ee697fb]
- @llamaindex/core@0.2.11
## 0.1.13
### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@llamaindex/openai",
"description": "OpenAI Adapter for LlamaIndex",
"version": "0.1.13",
"version": "0.1.14",
"type": "module",
"main": "./dist/index.cjs",
"module": "./dist/index.js",