New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@llamaindex/core

Package Overview
Dependencies
Maintainers
0
Versions
66
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@llamaindex/core - npm Package Compare versions

Comparing version 0.2.10 to 0.2.11

2

package.json
{
"name": "@llamaindex/core",
"type": "module",
"version": "0.2.10",
"version": "0.2.11",
"description": "LlamaIndex Core Module",

@@ -6,0 +6,0 @@ "exports": {

@@ -66,2 +66,8 @@ import { PromptHelper } from '../../indices/dist/index.js';

/**
* CompactAndRefine is a slight variation of Refine that first compacts the text chunks into the smallest possible number of chunks.
*/
declare class CompactAndRefine extends Refine {
getResponse(query: MessageContent, nodes: NodeWithScore[], stream: boolean): Promise<EngineResponse | AsyncIterable<EngineResponse>>;
}
/**
* TreeSummarize repacks the text chunks into the smallest possible number of chunks and then summarizes them, then recursively does so until there's one chunk left.

@@ -99,3 +105,9 @@ */

}
declare function getResponseSynthesizer(mode: ResponseMode, options?: BaseSynthesizerOptions & {
declare const modeToSynthesizer: {
readonly compact: typeof CompactAndRefine;
readonly refine: typeof Refine;
readonly tree_summarize: typeof TreeSummarize;
readonly multi_modal: typeof MultiModal;
};
declare function getResponseSynthesizer<Mode extends ResponseMode>(mode: Mode, options?: BaseSynthesizerOptions & {
textQATemplate?: TextQAPrompt;

@@ -105,3 +117,3 @@ refineTemplate?: RefinePrompt;

metadataMode?: MetadataMode;
}): Refine | TreeSummarize | MultiModal;
}): InstanceType<(typeof modeToSynthesizer)[Mode]>;

@@ -108,0 +120,0 @@ declare function createMessageContent(prompt: BasePromptTemplate, nodes: BaseNode[], extraParams?: Record<string, string>, metadataMode?: MetadataMode): Promise<MessageContentDetail[]>;

@@ -325,23 +325,16 @@ import { randomUUID } from '@llamaindex/env';

}
const modeToSynthesizer = {
compact: CompactAndRefine,
refine: Refine,
tree_summarize: TreeSummarize,
multi_modal: MultiModal
};
function getResponseSynthesizer(mode, options = {}) {
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);
}
const Synthesizer = modeToSynthesizer[mode];
if (!Synthesizer) {
throw new Error(`Invalid response mode: ${mode}`);
}
return new Synthesizer(options);
}
export { BaseSynthesizer, createMessageContent, getResponseSynthesizer };

@@ -48,2 +48,4 @@ import { JSONValue } from '../../global/dist/index.js';

declare function UUIDFromString(input: string): string;
declare const isAsyncIterable: (obj: unknown) => obj is AsyncIterable<unknown>;

@@ -67,2 +69,2 @@ declare const isIterable: (obj: unknown) => obj is Iterable<unknown>;

export { extractDataUrlComponents, extractImage, extractSingleText, extractText, imageToDataUrl, isAsyncIterable, isIterable, messagesToHistory, objectEntries, prettifyError, streamCallbacks, streamConverter, streamReducer, stringifyJSONToMessageContent, toToolDescriptions };
export { UUIDFromString, extractDataUrlComponents, extractImage, extractSingleText, extractText, imageToDataUrl, isAsyncIterable, isIterable, messagesToHistory, objectEntries, prettifyError, streamCallbacks, streamConverter, streamReducer, stringifyJSONToMessageContent, toToolDescriptions };

@@ -1,2 +0,2 @@

import { fs } from '@llamaindex/env';
import { fs, createSHA256 } from '@llamaindex/env';
import { filetypemime } from 'magic-bytes.js';

@@ -115,2 +115,19 @@

function UUIDFromString(input) {
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),
(parseInt(hexHash.substring(15, 17), 16) & 0x3f | 0x80).toString(16) + hexHash.substring(17, 19),
hexHash.substring(19, 31)
].join("-");
return uuid;
}
const isAsyncIterable = (obj)=>{

@@ -163,2 +180,2 @@ return obj != null && typeof obj === "object" && Symbol.asyncIterator in obj;

export { extractDataUrlComponents, extractImage, extractSingleText, extractText, imageToDataUrl, isAsyncIterable, isIterable, messagesToHistory, objectEntries, prettifyError, streamCallbacks, streamConverter, streamReducer, stringifyJSONToMessageContent, toToolDescriptions };
export { UUIDFromString, extractDataUrlComponents, extractImage, extractSingleText, extractText, imageToDataUrl, isAsyncIterable, isIterable, messagesToHistory, objectEntries, prettifyError, streamCallbacks, streamConverter, streamReducer, stringifyJSONToMessageContent, toToolDescriptions };

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc