Nhảy tới nội dung

llamaindex

Enumerations

Classes

Interfaces

Type Aliases

AnthropicAgentParams

Ƭ AnthropicAgentParams: AnthropicParamsWithTools | AnthropicParamsWithToolRetriever

Defined in

packages/core/src/agent/anthropic.ts:30


AnthropicStreamToken

Ƭ AnthropicStreamToken: Anthropic.Completion

Defined in

packages/core/src/callbacks/CallbackManager.ts:83


AssemblyAIOptions

Ƭ AssemblyAIOptions: Partial<BaseServiceParams>

Defined in

packages/core/src/readers/AssemblyAIReader.ts:13


BaseToolWithCall

Ƭ BaseToolWithCall<Input>: Omit<BaseTool<Input>, "call"> & { call: NonNullable<Pick<BaseTool<Input>, "call">["call"]> }

Type parameters

NameType
Inputany

Defined in

packages/core/src/types.ts:70


BuilderParams

Ƭ BuilderParams: Object

Type declaration

NameType
docStoreBaseDocumentStore
fsGenericFileSystem
imageVectorStoreVectorStore
indexStoreBaseIndexStore
persistDirstring
storeImagesboolean
vectorStoreVectorStore

Defined in

packages/core/src/storage/StorageContext.ts:21


ChatMessage

Ƭ ChatMessage<AdditionalMessageOptions>: Object

Type parameters

NameType
AdditionalMessageOptionsextends object = object

Type declaration

NameType
contentMessageContent
options?AdditionalMessageOptions
roleMessageType

Defined in

packages/core/src/llm/types.ts:86


ChatResponseChunk

Ƭ ChatResponseChunk<AdditionalMessageOptions>: Object

Type parameters

NameType
AdditionalMessageOptionsextends object = object

Type declaration

NameType
deltastring
options?AdditionalMessageOptions
rawobject | null

Defined in

packages/core/src/llm/types.ts:104


ChoiceSelectPrompt

Ƭ ChoiceSelectPrompt: typeof defaultChoiceSelectPrompt

Defined in

packages/core/src/Prompt.ts:178


CloudRetrieveParams

Ƭ CloudRetrieveParams: Omit<PlatformApi.RetrievalParams, "query" | "searchFilters" | "pipelineId" | "className"> & { similarityTopK?: number }

Defined in

packages/core/src/cloud/LlamaCloudRetriever.ts:10


CondenseQuestionPrompt

Ƭ CondenseQuestionPrompt: typeof defaultCondenseQuestionPrompt

Defined in

packages/core/src/Prompt.ts:359


ContextSystemPrompt

Ƭ ContextSystemPrompt: typeof defaultContextSystemPrompt

Defined in

packages/core/src/Prompt.ts:381


CorrectnessSystemPrompt

Ƭ CorrectnessSystemPrompt: typeof defaultCorrectnessSystemPrompt

Defined in

packages/core/src/evaluation/prompts.ts:52


FaithfulnessRefinePrompt

Ƭ FaithfulnessRefinePrompt: typeof defaultFaithfulnessRefinePrompt

Defined in

packages/core/src/evaluation/prompts.ts:76


FaithfulnessTextQAPrompt

Ƭ FaithfulnessTextQAPrompt: typeof defaultFaithfulnessTextQaPrompt

Defined in

packages/core/src/evaluation/prompts.ts:115


ImageNodeConstructorProps

Ƭ ImageNodeConstructorProps<T>: Pick<ImageNode<T>, "image" | "id_"> & Partial<ImageNode<T>>

Type parameters

NameType
Textends Metadata

Defined in

packages/core/src/Node.ts:306


ImageType

Ƭ ImageType: string | Blob | URL

Defined in

packages/core/src/Node.ts:304


JSONObject

Ƭ JSONObject: Object

Index signature

▪ [key: string]: JSONValue

Defined in

packages/core/src/types.ts:109


JSONValue

Ƭ JSONValue: string | number | boolean | JSONObject | JSONArray

Defined in

packages/core/src/types.ts:107


KeywordExtractPrompt

Ƭ KeywordExtractPrompt: typeof defaultKeywordExtractPrompt

Defined in

packages/core/src/Prompt.ts:396


LLMEndEvent

Ƭ LLMEndEvent: BaseEvent<{ id: UUID ; response: ChatResponse }>

Defined in

packages/core/src/llm/types.ts:16


LLMMetadata

Ƭ LLMMetadata: Object

Type declaration

NameType
contextWindownumber
maxTokens?number
modelstring
temperaturenumber
tokenizerTokenizers | undefined
topPnumber

Defined in

packages/core/src/llm/types.ts:122


LLMStartEvent

Ƭ LLMStartEvent: BaseEvent<{ id: UUID ; messages: ChatMessage[] }>

Defined in

packages/core/src/llm/types.ts:5


LLMStreamEvent

Ƭ LLMStreamEvent: BaseEvent<{ chunk: ChatResponseChunk ; id: UUID }>

Defined in

packages/core/src/llm/types.ts:20


LLMToolCallEvent

Ƭ LLMToolCallEvent: BaseEvent<{ toolCall: ToolCall }>

Defined in

packages/core/src/llm/types.ts:9


LLMToolResultEvent

Ƭ LLMToolResultEvent: BaseEvent<{ toolCall: ToolCall ; toolResult: ToolOutput }>

Defined in

packages/core/src/llm/types.ts:12


Language

Ƭ Language: "abq" | "ady" | "af" | "ang" | "ar" | "as" | "ava" | "az" | "be" | "bg" | "bh" | "bho" | "bn" | "bs" | "ch_sim" | "ch_tra" | "che" | "cs" | "cy" | "da" | "dar" | "de" | "en" | "es" | "et" | "fa" | "fr" | "ga" | "gom" | "hi" | "hr" | "hu" | "id" | "inh" | "is" | "it" | "ja" | "kbd" | "kn" | "ko" | "ku" | "la" | "lbe" | "lez" | "lt" | "lv" | "mah" | "mai" | "mi" | "mn" | "mr" | "ms" | "mt" | "ne" | "new" | "nl" | "no" | "oc" | "pi" | "pl" | "pt" | "ro" | "ru" | "rs_cyrillic" | "rs_latin" | "sck" | "sk" | "sl" | "sq" | "sv" | "sw" | "ta" | "tab" | "te" | "th" | "tjk" | "tl" | "tr" | "ug" | "uk" | "ur" | "uz" | "vi"

Defined in

packages/core/src/readers/type.ts:21


ListIndex

Ƭ ListIndex: SummaryIndex

Defined in

packages/core/src/indices/summary/index.ts:277


ListIndexLLMRetriever

Ƭ ListIndexLLMRetriever: SummaryIndexLLMRetriever

Defined in

packages/core/src/indices/summary/index.ts:385


ListIndexRetriever

Ƭ ListIndexRetriever: SummaryIndexRetriever

Defined in

packages/core/src/indices/summary/index.ts:384


ListRetrieverMode

Ƭ ListRetrieverMode: SummaryRetrieverMode

Defined in

packages/core/src/indices/summary/index.ts:278


MessageContent

Ƭ MessageContent: string | MessageContentDetail[]

Extended type for the content of a message that allows for multi-modal messages.

Defined in

packages/core/src/llm/types.ts:184


MessageContentDetail

Ƭ MessageContentDetail: MessageContentTextDetail | MessageContentImageDetail

Defined in

packages/core/src/llm/types.ts:177


MessageContentImageDetail

Ƭ MessageContentImageDetail: Object

Type declaration

NameType
image_url{ url: string }
image_url.urlstring
type"image_url"

Defined in

packages/core/src/llm/types.ts:172


MessageContentTextDetail

Ƭ MessageContentTextDetail: Object

Type declaration

NameType
textstring
type"text"

Defined in

packages/core/src/llm/types.ts:167


MessageType

Ƭ MessageType: "user" | "assistant" | "system" | "memory"

Defined in

packages/core/src/llm/types.ts:77


Metadata

Ƭ Metadata: Record<string, any>

Defined in

packages/core/src/Node.ts:27


OllamaParams

Ƭ OllamaParams: Object

Type declaration

NameType
config?Partial<Config>
modelstring
options?Partial<Options>

Defined in

packages/core/src/llm/ollama.ts:48


OpenAIAdditionalChatOptions

Ƭ OpenAIAdditionalChatOptions: Omit<Partial<OpenAILLM.Chat.ChatCompletionCreateParams>, "max_tokens" | "messages" | "model" | "temperature" | "top_p" | "stream" | "tools" | "toolChoice">

Defined in

packages/core/src/llm/openai.ts:149


OpenAIAdditionalMetadata

Ƭ OpenAIAdditionalMetadata: Object

Defined in

packages/core/src/llm/openai.ts:147


OpenAIAgentParams

Ƭ OpenAIAgentParams: OpenAIParamsWithTools | OpenAIParamsWithToolRetriever

Defined in

packages/core/src/agent/openai.ts:27


OpenAIStreamToken

Ƭ OpenAIStreamToken: DefaultStreamToken

Defined in

packages/core/src/callbacks/CallbackManager.ts:82


PartialToolCall

Ƭ PartialToolCall: Object

Type declaration

NameType
idstring
inputstring
namestring

Defined in

packages/core/src/llm/types.ts:193


QueryEngineParam

Ƭ QueryEngineParam: Object

Type declaration

NameType
querystring

Defined in

packages/core/src/tools/QueryEngineTool.ts:24


QueryEngineToolParams

Ƭ QueryEngineToolParams: Object

Type declaration

NameType
metadataToolMetadata<JSONSchemaType<QueryEngineParam>>
queryEngineQueryEngine

Defined in

packages/core/src/tools/QueryEngineTool.ts:19


QueryKeywordExtractPrompt

Ƭ QueryKeywordExtractPrompt: typeof defaultQueryKeywordExtractPrompt

Defined in

packages/core/src/Prompt.ts:412


ReACTAgentParams

Ƭ ReACTAgentParams: ReACTAgentParamsWithTools | ReACTAgentParamsWithToolRetriever

Defined in

packages/core/src/agent/react.ts:40


RefinePrompt

Ƭ RefinePrompt: typeof defaultRefinePrompt

Defined in

packages/core/src/Prompt.ts:119


RelatedNodeType

Ƭ RelatedNodeType<T>: RelatedNodeInfo<T> | RelatedNodeInfo<T>[]

Type parameters

NameType
Textends Metadata = Metadata

Defined in

packages/core/src/Node.ts:36


RelevancyEvalPrompt

Ƭ RelevancyEvalPrompt: typeof defaultRelevancyEvalPrompt

Defined in

packages/core/src/evaluation/prompts.ts:130


RelevancyRefinePrompt

Ƭ RelevancyRefinePrompt: typeof defaultRelevancyRefinePrompt

Defined in

packages/core/src/evaluation/prompts.ts:155


ResponseBuilderPrompts

Ƭ ResponseBuilderPrompts: TextQaPrompt | TreeSummarizePrompt | RefinePrompt

Defined in

packages/core/src/synthesizers/builders.ts:389


ResultType

Ƭ ResultType: "text" | "markdown" | "json"

Defined in

packages/core/src/readers/type.ts:20


RetrieveParams

Ƭ RetrieveParams: Object

Type declaration

NameType
preFilters?unknown
querystring

Defined in

packages/core/src/Retriever.ts:4


SelectorResult

Ƭ SelectorResult: Object

Type declaration

NameType
selectionsSingleSelection[]

Defined in

packages/core/src/selectors/base.ts:9


SimplePrompt

Ƭ SimplePrompt: (input: Record<string, string | undefined>) => string

A SimplePrompt is a function that takes a dictionary of inputs and returns a string. NOTE this is a different interface compared to LlamaIndex Python NOTE 2: we default to empty string to make it easy to calculate prompt sizes

Type declaration

▸ (input): string

Parameters
NameType
inputRecord<string, string | undefined>
Returns

string

Defined in

packages/core/src/Prompt.ts:10


SubQuestionPrompt

Ƭ SubQuestionPrompt: typeof defaultSubQuestionPrompt

Defined in

packages/core/src/Prompt.ts:327


SubtitleFormat

Ƭ SubtitleFormat: "srt" | "vtt"

Format of the subtitles

Defined in

node_modules/.pnpm/assemblyai@4.4.1/node_modules/assemblyai/dist/types/openapi.generated.d.ts:1192


SummaryPrompt

Ƭ SummaryPrompt: typeof defaultSummaryPrompt

Defined in

packages/core/src/Prompt.ts:76


TextChatMessage

Ƭ TextChatMessage<AdditionalMessageOptions>: Object

Type parameters

NameType
AdditionalMessageOptionsextends object = object

Type declaration

NameType
contentstring
options?AdditionalMessageOptions
roleMessageType

Defined in

packages/core/src/llm/types.ts:79


TextQaPrompt

Ƭ TextQaPrompt: typeof defaultTextQaPrompt

Defined in

packages/core/src/Prompt.ts:37


ToolCall

Ƭ ToolCall: Object

Type declaration

NameType
idstring
inputJSONObject
namestring

Defined in

packages/core/src/llm/types.ts:186


ToolCallLLMMessageOptions

Ƭ ToolCallLLMMessageOptions: ToolResultOptions | ToolCallOptions | {}

Defined in

packages/core/src/llm/types.ts:214


ToolCallOptions

Ƭ ToolCallOptions: Object

Type declaration

NameType
toolCallToolCall | PartialToolCall

Defined in

packages/core/src/llm/types.ts:206


ToolMetadata

Ƭ ToolMetadata<Parameters>: Object

Type parameters

NameType
Parametersextends Record<string, unknown> = Record<string, unknown>

Type declaration

NameTypeDescription
descriptionstring-
namestring-
parameters?ParametersOpenAI uses JSON Schema to describe the parameters that a tool can take. Link https://json-schema.org/understanding-json-schema

Defined in

packages/core/src/types.ts:43


ToolMetadataOnlyDescription

Ƭ ToolMetadataOnlyDescription: Pick<ToolMetadata, "description">

Defined in

packages/core/src/types.ts:91


ToolOutput

Ƭ ToolOutput: Object

Type declaration

NameType
inputJSONObject
isErrorboolean
outputJSONValue
toolBaseTool | undefined

Defined in

packages/core/src/types.ts:115


ToolResult

Ƭ ToolResult: Object

Type declaration

NameType
idstring
isErrorboolean
resultstring

Defined in

packages/core/src/llm/types.ts:200


ToolResultOptions

Ƭ ToolResultOptions: Object

Type declaration

NameType
toolResultToolResult

Defined in

packages/core/src/llm/types.ts:210


TranscribeParams

Ƭ TranscribeParams: { audio: AudioToTranscribe } & Omit<TranscriptParams, "audio_url"> | TranscriptParams

The parameters to transcribe an audio file.

Defined in

node_modules/.pnpm/assemblyai@4.4.1/node_modules/assemblyai/dist/types/transcripts/index.d.ts:35


TreeSummarizePrompt

Ƭ TreeSummarizePrompt: typeof defaultTreeSummarizePrompt

Defined in

packages/core/src/Prompt.ts:144


UUID

Ƭ UUID: `${string}-${string}-${string}-${string}-${string}`

Defined in

packages/core/src/types.ts:105


UserPrompt

Ƭ UserPrompt: typeof defaultUserPrompt

Defined in

packages/core/src/evaluation/prompts.ts:20


VectorIndexRetrieverOptions

Ƭ VectorIndexRetrieverOptions: Object

VectorIndexRetriever retrieves nodes from a VectorIndex.

Type declaration

NameType
imageSimilarityTopK?number
indexVectorStoreIndex
similarityTopK?number

Defined in

packages/core/src/indices/vectorStore/index.ts:390


WikipediaToolParams

Ƭ WikipediaToolParams: Object

Type declaration

NameType
metadata?ToolMetadata<JSONSchemaType<WikipediaParameter>>

Defined in

packages/core/src/tools/WikipediaTool.ts:10

Variables

ALL_AVAILABLE_ANTHROPIC_LEGACY_MODELS

Const ALL_AVAILABLE_ANTHROPIC_LEGACY_MODELS: Object

Type declaration

NameType
claude-2.1{ contextWindow: number = 200000 }
claude-2.1.contextWindownumber
claude-instant-1.2{ contextWindow: number = 100000 }
claude-instant-1.2.contextWindownumber

Defined in

packages/core/src/llm/anthropic.ts:74


ALL_AVAILABLE_ANTHROPIC_MODELS

Const ALL_AVAILABLE_ANTHROPIC_MODELS: Object

Type declaration

NameType
claude-2.1{ contextWindow: number = 200000 }
claude-2.1.contextWindownumber
claude-3-haiku{ contextWindow: number = 200000 }
claude-3-haiku.contextWindownumber
claude-3-opus{ contextWindow: number = 200000 }
claude-3-opus.contextWindownumber
claude-3-sonnet{ contextWindow: number = 200000 }
claude-3-sonnet.contextWindownumber
claude-instant-1.2{ contextWindow: number = 100000 }
claude-instant-1.2.contextWindownumber

Defined in

packages/core/src/llm/anthropic.ts:89


ALL_AVAILABLE_MISTRAL_MODELS

Const ALL_AVAILABLE_MISTRAL_MODELS: Object

Type declaration

NameType
mistral-medium{ contextWindow: number = 32000 }
mistral-medium.contextWindownumber
mistral-small{ contextWindow: number = 32000 }
mistral-small.contextWindownumber
mistral-tiny{ contextWindow: number = 32000 }
mistral-tiny.contextWindownumber

Defined in

packages/core/src/llm/mistral.ts:13


ALL_AVAILABLE_OPENAI_MODELS

Const ALL_AVAILABLE_OPENAI_MODELS: Object

We currently support GPT-3.5 and GPT-4 models

Type declaration

NameType
gpt-3.5-turbo{ contextWindow: number = 4096 }
gpt-3.5-turbo.contextWindownumber
gpt-3.5-turbo-0125{ contextWindow: number = 16384 }
gpt-3.5-turbo-0125.contextWindownumber
gpt-3.5-turbo-0613{ contextWindow: number = 4096 }
gpt-3.5-turbo-0613.contextWindownumber
gpt-3.5-turbo-1106{ contextWindow: number = 16384 }
gpt-3.5-turbo-1106.contextWindownumber
gpt-3.5-turbo-16k{ contextWindow: number = 16384 }
gpt-3.5-turbo-16k.contextWindownumber
gpt-3.5-turbo-16k-0613{ contextWindow: number = 16384 }
gpt-3.5-turbo-16k-0613.contextWindownumber
gpt-4{ contextWindow: number = 8192 }
gpt-4.contextWindownumber
gpt-4-0125-preview{ contextWindow: number = 128000 }
gpt-4-0125-preview.contextWindownumber
gpt-4-1106-preview{ contextWindow: number = 128000 }
gpt-4-1106-preview.contextWindownumber
gpt-4-32k{ contextWindow: number = 32768 }
gpt-4-32k.contextWindownumber
gpt-4-32k-0613{ contextWindow: number = 32768 }
gpt-4-32k-0613.contextWindownumber
gpt-4-turbo{ contextWindow: number = 128000 }
gpt-4-turbo.contextWindownumber
gpt-4-turbo-preview{ contextWindow: number = 128000 }
gpt-4-turbo-preview.contextWindownumber
gpt-4-vision-preview{ contextWindow: number = 128000 }
gpt-4-vision-preview.contextWindownumber

Defined in

packages/core/src/llm/openai.ts:128


ALL_AVAILABLE_REPLICATE_MODELS

Const ALL_AVAILABLE_REPLICATE_MODELS: Object

Type declaration

NameType
Llama-2-13b-chat-4bit{ contextWindow: number = 4096; replicateApi: string = "meta/llama-2-13b-chat:f4e2de70d66816a838a89eeeb621910adffb0dd0baba3976c96980970978018d" }
Llama-2-13b-chat-4bit.contextWindownumber
Llama-2-13b-chat-4bit.replicateApistring
Llama-2-13b-chat-old{ contextWindow: number = 4096; replicateApi: string = "a16z-infra/llama13b-v2-chat:df7690f1994d94e96ad9d568eac121aecf50684a0b0963b25a41cc40061269e5" }
Llama-2-13b-chat-old.contextWindownumber
Llama-2-13b-chat-old.replicateApistring
Llama-2-70b-chat-4bit{ contextWindow: number = 4096; replicateApi: string = "meta/llama-2-70b-chat:02e509c789964a7ea8736978a43525956ef40397be9033abf9fd2badfe68c9e3" }
Llama-2-70b-chat-4bit.contextWindownumber
Llama-2-70b-chat-4bit.replicateApistring
Llama-2-70b-chat-old{ contextWindow: number = 4096; replicateApi: string = "replicate/llama70b-v2-chat:e951f18578850b652510200860fc4ea62b3b16fac280f83ff32282f87bbd2e48" }
Llama-2-70b-chat-old.contextWindownumber
Llama-2-70b-chat-old.replicateApistring
Llama-2-7b-chat-4bit{ contextWindow: number = 4096; replicateApi: string = "meta/llama-2-7b-chat:13c3cdee13ee059ab779f0291d29054dab00a47dad8261375654de5540165fb0" }
Llama-2-7b-chat-4bit.contextWindownumber
Llama-2-7b-chat-4bit.replicateApistring
Llama-2-7b-chat-old{ contextWindow: number = 4096; replicateApi: string = "a16z-infra/llama7b-v2-chat:4f0a4744c7295c024a1de15e1a63c880d3da035fa1f49bfd344fe076074c8eea" }
Llama-2-7b-chat-old.contextWindownumber
Llama-2-7b-chat-old.replicateApistring
llama-3-70b-instruct{ contextWindow: number = 8192; replicateApi: string = "meta/meta-llama-3-70b-instruct" }
llama-3-70b-instruct.contextWindownumber
llama-3-70b-instruct.replicateApistring
llama-3-8b-instruct{ contextWindow: number = 8192; replicateApi: string = "meta/meta-llama-3-8b-instruct" }
llama-3-8b-instruct.contextWindownumber
llama-3-8b-instruct.replicateApistring

Defined in

packages/core/src/llm/replicate_ai.ts:38


ALL_AVAILABLE_V3_MODELS

Const ALL_AVAILABLE_V3_MODELS: Object

Type declaration

NameType
claude-3-haiku{ contextWindow: number = 200000 }
claude-3-haiku.contextWindownumber
claude-3-opus{ contextWindow: number = 200000 }
claude-3-opus.contextWindownumber
claude-3-sonnet{ contextWindow: number = 200000 }
claude-3-sonnet.contextWindownumber

Defined in

packages/core/src/llm/anthropic.ts:83


ALL_OPENAI_EMBEDDING_MODELS

Const ALL_OPENAI_EMBEDDING_MODELS: Object

Type declaration

NameType
text-embedding-3-large{ dimensionOptions: number[] ; dimensions: number = 3072; maxTokens: number = 8191 }
text-embedding-3-large.dimensionOptionsnumber[]
text-embedding-3-large.dimensionsnumber
text-embedding-3-large.maxTokensnumber
text-embedding-3-small{ dimensionOptions: number[] ; dimensions: number = 1536; maxTokens: number = 8191 }
text-embedding-3-small.dimensionOptionsnumber[]
text-embedding-3-small.dimensionsnumber
text-embedding-3-small.maxTokensnumber
text-embedding-ada-002{ dimensions: number = 1536; maxTokens: number = 8191 }
text-embedding-ada-002.dimensionsnumber
text-embedding-ada-002.maxTokensnumber

Defined in

packages/core/src/embeddings/OpenAIEmbedding.ts:13


DEFAULT_CHUNK_OVERLAP

Const DEFAULT_CHUNK_OVERLAP: 20

Defined in

packages/core/src/constants.ts:5


DEFAULT_CHUNK_OVERLAP_RATIO

Const DEFAULT_CHUNK_OVERLAP_RATIO: 0.1

Defined in

packages/core/src/constants.ts:6


DEFAULT_CHUNK_SIZE

Const DEFAULT_CHUNK_SIZE: 1024

Defined in

packages/core/src/constants.ts:4


DEFAULT_COLLECTION

Const DEFAULT_COLLECTION: "data"

Defined in

packages/core/src/storage/constants.ts:1


DEFAULT_CONTEXT_WINDOW

Const DEFAULT_CONTEXT_WINDOW: 3900

Defined in

packages/core/src/constants.ts:1


DEFAULT_DOC_STORE_PERSIST_FILENAME

Const DEFAULT_DOC_STORE_PERSIST_FILENAME: "doc_store.json"

Defined in

packages/core/src/storage/constants.ts:4


DEFAULT_GRAPH_STORE_PERSIST_FILENAME

Const DEFAULT_GRAPH_STORE_PERSIST_FILENAME: "graph_store.json"

Defined in

packages/core/src/storage/constants.ts:6


DEFAULT_IMAGE_VECTOR_NAMESPACE

Const DEFAULT_IMAGE_VECTOR_NAMESPACE: "images"

Defined in

packages/core/src/storage/constants.ts:8


DEFAULT_INDEX_STORE_PERSIST_FILENAME

Const DEFAULT_INDEX_STORE_PERSIST_FILENAME: "index_store.json"

Defined in

packages/core/src/storage/constants.ts:3


DEFAULT_NAMESPACE

Const DEFAULT_NAMESPACE: "docstore"

Defined in

packages/core/src/storage/constants.ts:7


DEFAULT_NUM_OUTPUTS

Const DEFAULT_NUM_OUTPUTS: 256

Defined in

packages/core/src/constants.ts:2


DEFAULT_OG_TEXT_METADATA_KEY

Const DEFAULT_OG_TEXT_METADATA_KEY: "original_text"

Defined in

packages/core/src/nodeParsers/SentenceWindowNodeParser.ts:8


DEFAULT_PADDING

Const DEFAULT_PADDING: 5

Defined in

packages/core/src/constants.ts:9


DEFAULT_PERSIST_DIR

Const DEFAULT_PERSIST_DIR: "./storage"

Defined in

packages/core/src/storage/constants.ts:2


DEFAULT_SIMILARITY_TOP_K

Const DEFAULT_SIMILARITY_TOP_K: 2

Defined in

packages/core/src/constants.ts:7


DEFAULT_VECTOR_STORE_PERSIST_FILENAME

Const DEFAULT_VECTOR_STORE_PERSIST_FILENAME: "vector_store.json"

Defined in

packages/core/src/storage/constants.ts:5


DEFAULT_WINDOW_METADATA_KEY

Const DEFAULT_WINDOW_METADATA_KEY: "window"

Defined in

packages/core/src/nodeParsers/SentenceWindowNodeParser.ts:7


DEFAULT_WINDOW_SIZE

Const DEFAULT_WINDOW_SIZE: 3

Defined in

packages/core/src/nodeParsers/SentenceWindowNodeParser.ts:6


DeuceChatStrategy

Const DeuceChatStrategy: typeof ReplicateChatStrategy = ReplicateChatStrategy

Defined in

packages/core/src/llm/replicate_ai.ts:102


FILE_EXT_TO_READER

Const FILE_EXT_TO_READER: Record<string, BaseReader>

Defined in

packages/core/src/readers/SimpleDirectoryReader.ts:15


GPT35_MODELS

Const GPT35_MODELS: Object

Type declaration

NameType
gpt-3.5-turbo{ contextWindow: number = 4096 }
gpt-3.5-turbo.contextWindownumber
gpt-3.5-turbo-0125{ contextWindow: number = 16384 }
gpt-3.5-turbo-0125.contextWindownumber
gpt-3.5-turbo-0613{ contextWindow: number = 4096 }
gpt-3.5-turbo-0613.contextWindownumber
gpt-3.5-turbo-1106{ contextWindow: number = 16384 }
gpt-3.5-turbo-1106.contextWindownumber
gpt-3.5-turbo-16k{ contextWindow: number = 16384 }
gpt-3.5-turbo-16k.contextWindownumber
gpt-3.5-turbo-16k-0613{ contextWindow: number = 16384 }
gpt-3.5-turbo-16k-0613.contextWindownumber

Defined in

packages/core/src/llm/openai.ts:116


GPT4_MODELS

Const GPT4_MODELS: Object

Type declaration

NameType
gpt-4{ contextWindow: number = 8192 }
gpt-4.contextWindownumber
gpt-4-0125-preview{ contextWindow: number = 128000 }
gpt-4-0125-preview.contextWindownumber
gpt-4-1106-preview{ contextWindow: number = 128000 }
gpt-4-1106-preview.contextWindownumber
gpt-4-32k{ contextWindow: number = 32768 }
gpt-4-32k.contextWindownumber
gpt-4-32k-0613{ contextWindow: number = 32768 }
gpt-4-32k-0613.contextWindownumber
gpt-4-turbo{ contextWindow: number = 128000 }
gpt-4-turbo.contextWindownumber
gpt-4-turbo-preview{ contextWindow: number = 128000 }
gpt-4-turbo-preview.contextWindownumber
gpt-4-vision-preview{ contextWindow: number = 128000 }
gpt-4-vision-preview.contextWindownumber

Defined in

packages/core/src/llm/openai.ts:104


LlamaDeuce

Const LlamaDeuce: typeof ReplicateLLM = ReplicateLLM

Defined in

packages/core/src/llm/replicate_ai.ts:378


Settings

Const Settings: GlobalSettings

Defined in

packages/core/src/Settings.ts:224


defaultParagraphSeparator

Const defaultParagraphSeparator: string

Defined in

packages/core/src/TextSplitter.ts:58


globalsHelper

Const globalsHelper: GlobalsHelper

Defined in

packages/core/src/GlobalsHelper.ts:49

Functions

anthropicSummaryPrompt

anthropicSummaryPrompt(«destructured»): string

Parameters

NameTypeDefault value
«destructured»Objectundefined
› contextundefined | string""

Returns

string

Defined in

packages/core/src/Prompt.ts:78


anthropicTextQaPrompt

anthropicTextQaPrompt(«destructured»): string

Parameters

NameTypeDefault value
«destructured»Objectundefined
› contextundefined | string""
› queryundefined | string""

Returns

string

Defined in

packages/core/src/Prompt.ts:39


batchEmbeddings

batchEmbeddings<T>(values, embedFunc, chunkSize, options?): Promise<number[][]>

Type parameters

Name
T

Parameters

NameType
valuesT[]
embedFuncEmbedFunc<T>
chunkSizenumber
options?Object
options.logProgress?boolean

Returns

Promise<number[][]>

Defined in

packages/core/src/embeddings/types.ts:71


buildToolsText

buildToolsText(tools): string

Parameters

NameType
toolsToolMetadata[]

Returns

string

Defined in

packages/core/src/Prompt.ts:256


cjkSentenceTokenizer

cjkSentenceTokenizer(sentence): string[]

Tokenizes sentences. Suitable for Chinese, Japanese, and Korean. Use instead of defaultSentenceTokenizer.

Parameters

NameType
sentencestring

Returns

string[]

string[]

Defined in

packages/core/src/TextSplitter.ts:42


defaultChoiceSelectPrompt

defaultChoiceSelectPrompt(«destructured»): string

Parameters

NameTypeDefault value
«destructured»Objectundefined
› contextundefined | string""
› queryundefined | string""

Returns

string

Defined in

packages/core/src/Prompt.ts:146


defaultCondenseQuestionPrompt

defaultCondenseQuestionPrompt(«destructured»): string

Parameters

NameTypeDefault value
«destructured»Objectundefined
› chatHistoryundefined | string""
› questionundefined | string""

Returns

string

Defined in

packages/core/src/Prompt.ts:343


defaultContextSystemPrompt

defaultContextSystemPrompt(«destructured»): string

Parameters

NameTypeDefault value
«destructured»Objectundefined
› contextundefined | string""

Returns

string

Defined in

packages/core/src/Prompt.ts:373


defaultCorrectnessSystemPrompt

defaultCorrectnessSystemPrompt(): string

Returns

string

Defined in

packages/core/src/evaluation/prompts.ts:23


defaultEvaluationParser

defaultEvaluationParser(evalResponse): [number, string]

Parameters

NameType
evalResponsestring

Returns

[number, string]

Defined in

packages/core/src/evaluation/utils.ts:1


defaultFaithfulnessRefinePrompt

defaultFaithfulnessRefinePrompt(«destructured»): string

Parameters

NameType
«destructured»Object
› contextstring
› existingAnswerstring
› querystring

Returns

string

Defined in

packages/core/src/evaluation/prompts.ts:54


defaultFaithfulnessTextQaPrompt

defaultFaithfulnessTextQaPrompt(«destructured»): string

Parameters

NameType
«destructured»Object
› contextstring
› querystring

Returns

string

Defined in

packages/core/src/evaluation/prompts.ts:78


defaultKeywordExtractPrompt

defaultKeywordExtractPrompt(«destructured»): string

Parameters

NameTypeDefault value
«destructured»Objectundefined
› contextundefined | string""
› maxKeywordsundefined | number10

Returns

string

Defined in

packages/core/src/Prompt.ts:383


defaultQueryKeywordExtractPrompt

defaultQueryKeywordExtractPrompt(«destructured»): string

Parameters

NameTypeDefault value
«destructured»Objectundefined
› maxKeywordsundefined | number10
› questionundefined | string""

Returns

string

Defined in

packages/core/src/Prompt.ts:398


defaultRefinePrompt

defaultRefinePrompt(«destructured»): string

Parameters

NameTypeDefault value
«destructured»Objectundefined
› contextundefined | string""
› existingAnswerundefined | string""
› queryundefined | string""

Returns

string

Defined in

packages/core/src/Prompt.ts:104


defaultRelevancyEvalPrompt

defaultRelevancyEvalPrompt(«destructured»): string

Parameters

NameType
«destructured»Object
› contextstring
› querystring

Returns

string

Defined in

packages/core/src/evaluation/prompts.ts:117


defaultRelevancyRefinePrompt

defaultRelevancyRefinePrompt(«destructured»): string

Parameters

NameType
«destructured»Object
› contextMsgstring
› existingAnswerstring
› querystring

Returns

string

Defined in

packages/core/src/evaluation/prompts.ts:132


defaultSentenceTokenizer

defaultSentenceTokenizer(text): string[]

Parameters

NameType
textstring

Returns

string[]

Defined in

packages/core/src/TextSplitter.ts:22


defaultSubQuestionPrompt

defaultSubQuestionPrompt(«destructured»): string

Parameters

NameTypeDefault value
«destructured»Objectundefined
› queryStrundefined | string""
› toolsStrundefined | string""

Returns

string

Defined in

packages/core/src/Prompt.ts:297


defaultSummaryPrompt

defaultSummaryPrompt(«destructured»): string

Parameters

NameTypeDefault value
«destructured»Objectundefined
› contextundefined | string""

Returns

string

Defined in

packages/core/src/Prompt.ts:65


defaultTextQaPrompt

defaultTextQaPrompt(«destructured»): string

Parameters

NameTypeDefault value
«destructured»Objectundefined
› contextundefined | string""
› queryundefined | string""

Returns

string

Defined in

packages/core/src/Prompt.ts:27


defaultTreeSummarizePrompt

defaultTreeSummarizePrompt(«destructured»): string

Parameters

NameTypeDefault value
«destructured»Objectundefined
› contextundefined | string""
› queryundefined | string""

Returns

string

Defined in

packages/core/src/Prompt.ts:134


defaultUserPrompt

defaultUserPrompt(«destructured»): string

Parameters

NameType
«destructured»Object
› generatedAnswerstring
› querystring
› referenceAnswerstring

Returns

string

Defined in

packages/core/src/evaluation/prompts.ts:1


exists

exists(fs, path): Promise<boolean>

Checks if a file exists. Analogous to the os.path.exists function from Python.

Parameters

NameTypeDescription
fsGenericFileSystemThe filesystem to use.
pathstringThe path to the file to check.

Returns

Promise<boolean>

A promise that resolves to true if the file exists, false otherwise.

Defined in

packages/core/src/storage/FileSystem.ts:11


getBiggestPrompt

getBiggestPrompt(prompts): SimplePrompt

Get biggest empty prompt size from a list of prompts. Used to calculate the maximum size of inputs to the LLM.

Parameters

NameType
promptsSimplePrompt[]

Returns

SimplePrompt

Defined in

packages/core/src/PromptHelper.ts:21


getEmptyPromptTxt

getEmptyPromptTxt(prompt): string

Parameters

NameType
promptSimplePrompt

Returns

string

Defined in

packages/core/src/PromptHelper.ts:11


getHistory

getHistory(chatHistory?): ChatHistory

Parameters

NameType
chatHistory?ChatMessage[] | ChatHistory<object>

Returns

ChatHistory

Defined in

packages/core/src/ChatHistory.ts:233


getOpenAISession

getOpenAISession(options?): OpenAISession

Get a session for the OpenAI API. If one already exists with the same options, it will be returned. Otherwise, a new session will be created.

Parameters

NameType
optionsClientOptions & { azure?: boolean }

Returns

OpenAISession

Defined in

packages/core/src/llm/openai.ts:89


getResponseBuilder

getResponseBuilder(serviceContext?, responseMode?): ResponseBuilder

Parameters

NameType
serviceContext?ServiceContext
responseMode?ResponseMode

Returns

ResponseBuilder

Defined in

packages/core/src/synthesizers/builders.ts:373


getSelectorFromContext

getSelectorFromContext(serviceContext, isMulti?): BaseSelector

Parameters

NameTypeDefault value
serviceContextServiceContextundefined
isMultibooleanfalse

Returns

BaseSelector

Defined in

packages/core/src/selectors/utils.ts:6


getTopKEmbeddings

getTopKEmbeddings(queryEmbedding, embeddings, similarityTopK?, embeddingIds?, similarityCutoff?): [number[], any[]]

Get the top K embeddings from a list of embeddings ordered by similarity to the query.

Parameters

NameTypeDefault valueDescription
queryEmbeddingnumber[]undefined
embeddingsnumber[][]undefinedlist of embeddings to consider
similarityTopKnumberDEFAULT_SIMILARITY_TOP_Kmax number of embeddings to return, default 2
embeddingIdsnull | any[]nullids of embeddings in the embeddings list
similarityCutoffnull | numbernullminimum similarity score

Returns

[number[], any[]]

Defined in

packages/core/src/embeddings/utils.ts:81


getTopKEmbeddingsLearner

getTopKEmbeddingsLearner(queryEmbedding, embeddings, similarityTopK?, embeddingsIds?, queryMode?): [number[], any[]]

Parameters

NameTypeDefault value
queryEmbeddingnumber[]undefined
embeddingsnumber[][]undefined
similarityTopK?numberundefined
embeddingsIds?any[]undefined
queryModeVectorStoreQueryModeVectorStoreQueryMode.SVM

Returns

[number[], any[]]

Defined in

packages/core/src/embeddings/utils.ts:124


getTopKMMREmbeddings

getTopKMMREmbeddings(queryEmbedding, embeddings, similarityFn?, similarityTopK?, embeddingIds?, _similarityCutoff?, mmrThreshold?): [number[], any[]]

Parameters

NameTypeDefault value
queryEmbeddingnumber[]undefined
embeddingsnumber[][]undefined
similarityFnnull | (...args: any[]) => numbernull
similarityTopKnull | numbernull
embeddingIdsnull | any[]null
_similarityCutoffnull | numbernull
mmrThresholdnull | numbernull

Returns

[number[], any[]]

Defined in

packages/core/src/embeddings/utils.ts:137


imageToDataUrl

imageToDataUrl(input): Promise<string>

Parameters

NameType
inputImageType

Returns

Promise<string>

Defined in

packages/core/src/embeddings/utils.ts:239


imageToString

imageToString(input): Promise<string>

Parameters

NameType
inputImageType

Returns

Promise<string>

Defined in

packages/core/src/embeddings/utils.ts:211


isFunctionCallingModel

isFunctionCallingModel(llm): llm is OpenAI

Parameters

NameType
llmLLM<object, object>

Returns

llm is OpenAI

Defined in

packages/core/src/llm/openai.ts:133


jsonToIndexStruct

jsonToIndexStruct(json): IndexStruct

Parameters

NameType
jsonany

Returns

IndexStruct

Defined in

packages/core/src/indices/json-to-index-struct.ts:44


jsonToNode

jsonToNode(json, type?): TextNode<Metadata>

Parameters

NameType
jsonany
type?ObjectType

Returns

TextNode<Metadata>

Defined in

packages/core/src/Node.ts:284


messagesToHistoryStr

messagesToHistoryStr(messages): string

Parameters

NameType
messagesChatMessage[]

Returns

string

Defined in

packages/core/src/Prompt.ts:361


parseJsonMarkdown

parseJsonMarkdown(text): any

Parameters

NameTypeDescription
textstringA markdown block with JSON

Returns

any

parsed JSON object

Defined in

packages/core/src/OutputParser.ts:41


runTransformations

runTransformations(nodesToRun, transformations, transformOptions?, «destructured»?): Promise<BaseNode[]>

Parameters

NameType
nodesToRunBaseNode<Metadata>[]
transformationsTransformComponent[]
transformOptionsany
«destructured»TransformRunArgs

Returns

Promise<BaseNode[]>

Defined in

packages/core/src/ingestion/IngestionPipeline.ts:31


serviceContextFromDefaults

serviceContextFromDefaults(options?): ServiceContext

Parameters

NameType
options?ServiceContextOptions

Returns

ServiceContext

Defined in

packages/core/src/ServiceContext.ts:30


serviceContextFromServiceContext

serviceContextFromServiceContext(serviceContext, options): Object

Parameters

NameType
serviceContextServiceContext
optionsServiceContextOptions

Returns

Object

NameType
embedModelBaseEmbedding
llmLLM<object, object>
nodeParserNodeParser
promptHelperPromptHelper

Defined in

packages/core/src/ServiceContext.ts:46


similarity

similarity(embedding1, embedding2, mode?): number

The similarity between two embeddings.

Parameters

NameTypeDefault value
embedding1number[]undefined
embedding2number[]undefined
modeSimilarityTypeSimilarityType.DEFAULT

Returns

number

similarity score with higher numbers meaning the two embeddings are more similar

Defined in

packages/core/src/embeddings/utils.ts:26


splitNodesByType

splitNodesByType(nodes): Object

Parameters

NameType
nodesBaseNode<Metadata>[]

Returns

Object

NameType
imageNodesImageNode[]
textNodesTextNode[]

Defined in

packages/core/src/Node.ts:384


storageContextFromDefaults

storageContextFromDefaults(«destructured»): Promise<StorageContext>

Parameters

NameType
«destructured»Partial<BuilderParams>

Returns

Promise<StorageContext>

Defined in

packages/core/src/storage/StorageContext.ts:31


stringToImage

stringToImage(input): ImageType

Parameters

NameType
inputstring

Returns

ImageType

Defined in

packages/core/src/embeddings/utils.ts:224


walk

walk(fs, dirPath): AsyncIterable<string>

Recursively traverses a directory and yields all the paths to the files in it.

Parameters

NameTypeDescription
fsWalkableFileSystemThe filesystem to use.
dirPathstringThe path to the directory to traverse.

Returns

AsyncIterable<string>

Defined in

packages/core/src/storage/FileSystem.ts:28