Namespace: ragCore
Namespaces
Interfaces
References
AddAssistantMessageParams
Re-exports AddAssistantMessageParams
AddConversationMessageParams
Re-exports AddConversationMessageParams
AddFunctionMessageParams
Re-exports AddFunctionMessageParams
AddManyConversationMessagesParams
Re-exports AddManyConversationMessagesParams
AddMessageParams
Re-exports AddMessageParams
AddSomeMessageParams
Re-exports AddSomeMessageParams
AddSystemMessageParams
Re-exports AddSystemMessageParams
AddUserMessageParams
Re-exports AddUserMessageParams
AssistantMessage
Re-exports AssistantMessage
AssistantMessageMetadata
Re-exports AssistantMessageMetadata
CallToolResponse
Re-exports CallToolResponse
ChatLlm
Re-exports ChatLlm
ChunkFunc
Re-exports ChunkFunc
ChunkMetadataGetter
Re-exports ChunkMetadataGetter
ChunkOptions
Re-exports ChunkOptions
ChunkTransformer
Re-exports ChunkTransformer
CommentMessageParams
Re-exports CommentMessageParams
ContentChunk
Re-exports ContentChunk
Conversation
Re-exports Conversation
ConversationConstants
Re-exports ConversationConstants
ConversationCustomData
Re-exports ConversationCustomData
ConversationsService
Re-exports ConversationsService
CreateConversationParams
Re-exports CreateConversationParams
DbMessage
Re-exports DbMessage
DeleteEmbeddedContentArgs
Re-exports DeleteEmbeddedContentArgs
DeletePagesArgs
Re-exports DeletePagesArgs
EmbedArgs
Re-exports EmbedArgs
EmbedConcurrencyOptions
Re-exports EmbedConcurrencyOptions
EmbedResult
Re-exports EmbedResult
EmbeddedContent
Re-exports EmbeddedContent
EmbeddedContentStore
Re-exports EmbeddedContentStore
Embedder
Re-exports Embedder
FindByIdParams
Re-exports FindByIdParams
FindContentFunc
Re-exports FindContentFunc
FindContentFuncArgs
Re-exports FindContentFuncArgs
FindContentResult
Re-exports FindContentResult
FindVerifiedAnswerFunc
Re-exports FindVerifiedAnswerFunc
FindVerifiedAnswerFuncArgs
Re-exports FindVerifiedAnswerFuncArgs
FindVerifiedAnswerResult
Re-exports FindVerifiedAnswerResult
FunctionMessage
Re-exports FunctionMessage
LlmAnswerQuestionParams
Re-exports LlmAnswerQuestionParams
LlmCallToolParams
Re-exports LlmCallToolParams
LoadPagesArgs
Re-exports LoadPagesArgs
MakeDefaultFindContentFuncArgs
Re-exports MakeDefaultFindContentFuncArgs
MakeDefaultFindVerifiedAnswerFuncArgs
Re-exports MakeDefaultFindVerifiedAnswerFuncArgs
MakeLangChainEmbedderParams
Re-exports MakeLangChainEmbedderParams
MakeLangchainChatLlmProps
Re-exports MakeLangchainChatLlmProps
MakeMongoDbEmbeddedContentStoreParams
Re-exports MakeMongoDbEmbeddedContentStoreParams
MakeMongoDbPageStoreParams
Re-exports MakeMongoDbPageStoreParams
MakeOpenAiChatLlmParams
Re-exports MakeOpenAiChatLlmParams
MakeOpenAiEmbedderArgs
Re-exports MakeOpenAiEmbedderArgs
Message
Re-exports Message
MessageBase
Re-exports MessageBase
MongoDbEmbeddedContentStore
Re-exports MongoDbEmbeddedContentStore
MongoDbPageStore
Re-exports MongoDbPageStore
OpenAIChatCompletionWithoutUsage
Re-exports OpenAIChatCompletionWithoutUsage
OpenAiAwaitedResponse
Re-exports OpenAiAwaitedResponse
OpenAiChatMessage
Re-exports OpenAiChatMessage
OpenAiMessageRole
Re-exports OpenAiMessageRole
OpenAiStreamingResponse
Re-exports OpenAiStreamingResponse
Page
Re-exports Page
PageAction
Re-exports PageAction
PageConcurrencyOptions
Re-exports PageConcurrencyOptions
PageFormat
Re-exports PageFormat
PageMetadata
Re-exports PageMetadata
PageStore
Re-exports PageStore
PersistedPage
Re-exports PersistedPage
Question
Re-exports Question
RateMessageParams
Re-exports RateMessageParams
SearchBooster
Re-exports SearchBooster
SomeMessage
Re-exports SomeMessage
SomeTokenizer
Re-exports SomeTokenizer
SystemMessage
Re-exports SystemMessage
SystemPrompt
Re-exports SystemPrompt
Tool
Re-exports Tool
ToolCallDirective
Re-exports ToolCallDirective
ToolCallParams
Re-exports ToolCallParams
UserMessage
Re-exports UserMessage
VerifiedAnswer
Re-exports VerifiedAnswer
VerifiedAnswerEventData
Re-exports VerifiedAnswerEventData
VerifiedAnswerStore
Re-exports VerifiedAnswerStore
WithFilterAndK
Re-exports WithFilterAndK
asPageFormat
Re-exports asPageFormat
chunkCode
Re-exports chunkCode
chunkMd
Re-exports chunkMd
chunkOpenApiSpecYaml
Re-exports chunkOpenApiSpecYaml
chunkPage
Re-exports chunkPage
createMessage
Re-exports createMessage
createMessageFromOpenAIChatMessage
Re-exports createMessageFromOpenAIChatMessage
defaultConversationConstants
Re-exports defaultConversationConstants
defaultOpenApiSpecYamlChunkOptions
Re-exports defaultOpenApiSpecYamlChunkOptions
extractFrontMatter
Re-exports extractFrontMatter
getChangedPages
Re-exports getChangedPages
isPageFormat
Re-exports isPageFormat
isSupportedLanguage
Re-exports isSupportedLanguage
makeBoostOnAtlasSearchFilter
Re-exports makeBoostOnAtlasSearchFilter
makeChunkFrontMatterUpdater
Re-exports makeChunkFrontMatterUpdater
makeDefaultFindContent
Re-exports makeDefaultFindContent
makeDefaultFindVerifiedAnswer
Re-exports makeDefaultFindVerifiedAnswer
makeLangChainEmbedder
Re-exports makeLangChainEmbedder
makeLangchainChatLlm
Re-exports makeLangchainChatLlm
makeMongoDbConversationsService
Re-exports makeMongoDbConversationsService
makeMongoDbEmbeddedContentStore
Re-exports makeMongoDbEmbeddedContentStore
makeMongoDbPageStore
Re-exports makeMongoDbPageStore
makeMongoDbVerifiedAnswerStore
Re-exports makeMongoDbVerifiedAnswerStore
makeOpenAiChatLlm
Re-exports makeOpenAiChatLlm
makeOpenAiEmbedder
Re-exports makeOpenAiEmbedder
pageFormat
Re-exports pageFormat
pageFormatToLanguage
Re-exports pageFormatToLanguage
pageFormats
Re-exports pageFormats
pageIdentity
Re-exports pageIdentity
persistPages
Re-exports persistPages
removeFrontMatter
Re-exports removeFrontMatter
standardChunkFrontMatterUpdater
Re-exports standardChunkFrontMatterUpdater
standardMetadataGetter
Re-exports standardMetadataGetter
updateEmbeddedContent
Re-exports updateEmbeddedContent
updateEmbeddedContentForPage
Re-exports updateEmbeddedContentForPage
updateFrontMatter
Re-exports updateFrontMatter
updatePages
Re-exports updatePages
Type Aliases
Classification
Ƭ Classification: z.infer
<typeof Classification
>
Defined in
mongodb-rag-core/build/makeClassifier.d.ts:40
mongodb-rag-core/build/makeClassifier.d.ts:41
Classifier
Ƭ Classifier: ({ input }
: { input
: string
}) => Promise
<{ classification
: Classification
; inputMessages
: OpenAI.ChatCompletionMessageParam
[] }>
Type declaration
▸ ({ input }
): Promise
<{ classification
: Classification
; inputMessages
: OpenAI.ChatCompletionMessageParam
[] }>
Parameters
Name | Type |
---|---|
{ input } | Object |
{ input }.input | string |
Returns
Promise
<{ classification
: Classification
; inputMessages
: OpenAI.ChatCompletionMessageParam
[] }>
Defined in
mongodb-rag-core/build/makeClassifier.d.ts:4
ConversationIdStreamEvent
Ƭ ConversationIdStreamEvent: StreamEvent
& { data
: string
; type
: "conversationId"
}
Event when server streams the conversation ID to the client.
Defined in
mongodb-rag-core/build/DataStreamer.d.ts:55
DatabaseConnection
Ƭ DatabaseConnection: Object
Type declaration
Name | Type |
---|---|
close | (force? : boolean ) => Promise <void > |
drop | () => Promise <void > |
init? | () => Promise <void > |
Defined in
mongodb-rag-core/build/DatabaseConnection.d.ts:1
DeltaStreamEvent
Ƭ DeltaStreamEvent: StreamEvent
& { data
: string
; type
: "delta"
}
Event when server streams additional message response to the client.
Defined in
mongodb-rag-core/build/DataStreamer.d.ts:16
FindNearestNeighborsOptions
Ƭ FindNearestNeighborsOptions: Object
Options for performing a nearest-neighbor search.
Type declaration
Name | Type | Description |
---|---|---|
filter | Record <string , unknown > | Search filter expression. |
indexName | string | The name of the index to use. |
k | number | The number of nearest neighbors to return. |
minScore | number | The minimum nearest-neighbor score threshold between 0-1. |
numCandidates | number | Number of nearest neighbors to use during the search. Value must be less than or equal to 10000. You can't specify a number less than the number of documents to return (k). |
path | string | The keypath to the field with the vector data to use. |
Defined in
mongodb-rag-core/build/VectorStore.d.ts:17
FinishedStreamEvent
Ƭ FinishedStreamEvent: StreamEvent
& { data
: string
; type
: "finished"
}
Event denoting the end of streaming.
Defined in
mongodb-rag-core/build/DataStreamer.d.ts:48
MetadataStreamEvent
Ƭ MetadataStreamEvent: StreamEvent
& { data
: Record
<string
, unknown
> ; type
: "metadata"
}
Event when server streams a metadata object to the client.
Defined in
mongodb-rag-core/build/DataStreamer.d.ts:41
ProcessingStreamEvent
Ƭ ProcessingStreamEvent: StreamEvent
& { data
: string
; type
: "processing"
}
Event for when the server is processing a request.
Defined in
mongodb-rag-core/build/DataStreamer.d.ts:23
Reference
Ƭ Reference: z.infer
<typeof Reference
>
A formatted reference for an assistant message.
For example, a Reference might be a docs page, dev center article, or a MongoDB University module.
Defined in
mongodb-rag-core/build/References.d.ts:8
mongodb-rag-core/build/References.d.ts:9
References
Ƭ References: z.infer
<typeof References
>
Defined in
mongodb-rag-core/build/References.d.ts:42
mongodb-rag-core/build/References.d.ts:43
ReferencesStreamEvent
Ƭ ReferencesStreamEvent: StreamEvent
& { data
: any
[] ; type
: "references"
}
Event when server streams single References object to the client.
Defined in
mongodb-rag-core/build/DataStreamer.d.ts:34
SomeStreamEvent
Ƭ SomeStreamEvent: DeltaStreamEvent
| MetadataStreamEvent
| ProcessingStreamEvent
| ReferencesStreamEvent
| FinishedStreamEvent
| ConversationIdStreamEvent
The event types streamed from the chat server to the client.
Defined in
mongodb-rag-core/build/DataStreamer.d.ts:62
VectorStore
Ƭ VectorStore<T
>: Object
Generic vector store for vector-searchable data.
Type parameters
Name |
---|
T |
Type declaration
Name | Type |
---|---|
close? | () => Promise <void > |
findNearestNeighbors | (vector : number [], options? : Partial <FindNearestNeighborsOptions >) => Promise <WithScore <T >[]> |
Defined in
mongodb-rag-core/build/VectorStore.d.ts:4
WithScore
Ƭ WithScore<T
>: T
& { score
: number
}
Type parameters
Name |
---|
T |
Defined in
mongodb-rag-core/build/VectorStore.d.ts:11
Variables
CORE_CHATBOT_APP_ENV_VARS
• Const
CORE_CHATBOT_APP_ENV_VARS: Object
Type declaration
Name | Type |
---|---|
MONGODB_CONNECTION_URI | string |
MONGODB_DATABASE_NAME | string |
Defined in
mongodb-rag-core/build/CoreEnvVars.d.ts:36
CORE_ENV_VARS
• Const
CORE_ENV_VARS: Object
Type declaration
Name | Type |
---|---|
MONGODB_CONNECTION_URI | string |
MONGODB_DATABASE_NAME | string |
OPENAI_API_KEY | string |
OPENAI_API_VERSION | string |
OPENAI_CHAT_COMPLETION_DEPLOYMENT | string |
OPENAI_CHAT_COMPLETION_MODEL_VERSION | string |
OPENAI_ENDPOINT | string |
OPENAI_RETRIEVAL_EMBEDDING_DEPLOYMENT | string |
OPENAI_VERIFIED_ANSWER_EMBEDDING_DEPLOYMENT | string |
VECTOR_SEARCH_INDEX_NAME | string |
Defined in
mongodb-rag-core/build/CoreEnvVars.d.ts:40
CORE_OPENAI_CHAT_COMPLETION_ENV_VARS
• Const
CORE_OPENAI_CHAT_COMPLETION_ENV_VARS: Object
Type declaration
Name | Type |
---|---|
OPENAI_API_KEY | string |
OPENAI_API_VERSION | string |
OPENAI_CHAT_COMPLETION_DEPLOYMENT | string |
OPENAI_CHAT_COMPLETION_MODEL_VERSION | string |
OPENAI_ENDPOINT | string |
Defined in
mongodb-rag-core/build/CoreEnvVars.d.ts:19
CORE_OPENAI_CONNECTION_ENV_VARS
• Const
CORE_OPENAI_CONNECTION_ENV_VARS: Object
Type declaration
Name | Type |
---|---|
OPENAI_API_KEY | string |
OPENAI_API_VERSION | string |
OPENAI_ENDPOINT | string |
Defined in
mongodb-rag-core/build/CoreEnvVars.d.ts:1
CORE_OPENAI_ENV_VARS
• Const
CORE_OPENAI_ENV_VARS: Object
Type declaration
Name | Type |
---|---|
OPENAI_API_KEY | string |
OPENAI_API_VERSION | string |
OPENAI_CHAT_COMPLETION_DEPLOYMENT | string |
OPENAI_CHAT_COMPLETION_MODEL_VERSION | string |
OPENAI_ENDPOINT | string |
OPENAI_RETRIEVAL_EMBEDDING_DEPLOYMENT | string |
OPENAI_VERIFIED_ANSWER_EMBEDDING_DEPLOYMENT | string |
VECTOR_SEARCH_INDEX_NAME | string |
Defined in
mongodb-rag-core/build/CoreEnvVars.d.ts:26
CORE_OPENAI_RETRIEVAL_ENV_VARS
• Const
CORE_OPENAI_RETRIEVAL_ENV_VARS: Object
Type declaration
Name | Type |
---|---|
OPENAI_API_KEY | string |
OPENAI_API_VERSION | string |
OPENAI_ENDPOINT | string |
OPENAI_RETRIEVAL_EMBEDDING_DEPLOYMENT | string |
VECTOR_SEARCH_INDEX_NAME | string |
Defined in
mongodb-rag-core/build/CoreEnvVars.d.ts:6
CORE_OPENAI_VERIFIED_ANSWERS_ENV_VARS
• Const
CORE_OPENAI_VERIFIED_ANSWERS_ENV_VARS: Object
Type declaration
Name | Type |
---|---|
OPENAI_API_KEY | string |
OPENAI_API_VERSION | string |
OPENAI_ENDPOINT | string |
OPENAI_VERIFIED_ANSWER_EMBEDDING_DEPLOYMENT | string |
Defined in
mongodb-rag-core/build/CoreEnvVars.d.ts:13
Classification
• Classification: ZodObject
<{ reason
: ZodOptional
<ZodString
> ; type
: ZodString
}, "strip"
, ZodTypeAny
, { reason?
: string
; type
: string
}, { reason?
: string
; type
: string
}>
Defined in
mongodb-rag-core/build/makeClassifier.d.ts:40
mongodb-rag-core/build/makeClassifier.d.ts:41
Reference
• Reference: ZodObject
<{ metadata
: ZodOptional
<ZodObject
<{ sourceName
: ZodOptional
<ZodString
> ; sourceType
: ZodOptional
<ZodString
> ; tags
: ZodOptional
<ZodArray
<ZodString
, "many"
>> }, "passthrough"
, ZodTypeAny
, objectOutputType
<{ sourceName
: ZodOptional
<ZodString
> ; sourceType
: ZodOptional
<ZodString
> ; tags
: ZodOptional
<ZodArray
<ZodString
, "many"
>> }, ZodTypeAny
, "passthrough"
>, objectInputType
<{ sourceName
: ZodOptional
<ZodString
> ; sourceType
: ZodOptional
<ZodString
> ; tags
: ZodOptional
<ZodArray
<ZodString
, "many"
>> }, ZodTypeAny
, "passthrough"
>>> ; title
: ZodString
; url
: ZodString
}, "strip"
, ZodTypeAny
, { metadata?
: objectOutputType
<{ sourceName
: ZodOptional
<ZodString
> ; sourceType
: ZodOptional
<ZodString
> ; tags
: ZodOptional
<ZodArray
<ZodString
, "many"
>> }, ZodTypeAny
, "passthrough"
> ; title
: string
; url
: string
}, { metadata?
: objectInputType
<{ sourceName
: ZodOptional
<ZodString
> ; sourceType
: ZodOptional
<ZodString
> ; tags
: ZodOptional
<ZodArray
<ZodString
, "many"
>> }, ZodTypeAny
, "passthrough"
> ; title
: string
; url
: string
}>
Defined in
mongodb-rag-core/build/References.d.ts:8
mongodb-rag-core/build/References.d.ts:9
References
• References: ZodArray
<ZodObject
<{ metadata
: ZodOptional
<ZodObject
<{ sourceName
: ZodOptional
<ZodString
> ; sourceType
: ZodOptional
<ZodString
> ; tags
: ZodOptional
<ZodArray
<ZodString
, "many"
>> }, "passthrough"
, ZodTypeAny
, objectOutputType
<{ sourceName
: ZodOptional
<ZodString
> ; sourceType
: ZodOptional
<ZodString
> ; tags
: ZodOptional
<ZodArray
<ZodString
, "many"
>> }, ZodTypeAny
, "passthrough"
>, objectInputType
<{ sourceName
: ZodOptional
<ZodString
> ; sourceType
: ZodOptional
<ZodString
> ; tags
: ZodOptional
<ZodArray
<ZodString
, "many"
>> }, ZodTypeAny
, "passthrough"
>>> ; title
: ZodString
; url
: ZodString
}, "strip"
, ZodTypeAny
, { metadata?
: objectOutputType
<{ sourceName
: ZodOptional
<ZodString
> ; sourceType
: ZodOptional
<ZodString
> ; tags
: ZodOptional
<ZodArray
<ZodString
, "many"
>> }, ZodTypeAny
, "passthrough"
> ; title
: string
; url
: string
}, { metadata?
: objectInputType
<{ sourceName
: ZodOptional
<ZodString
> ; sourceType
: ZodOptional
<ZodString
> ; tags
: ZodOptional
<ZodArray
<ZodString
, "many"
>> }, ZodTypeAny
, "passthrough"
> ; title
: string
; url
: string
}>, "many"
>
Defined in
mongodb-rag-core/build/References.d.ts:42
mongodb-rag-core/build/References.d.ts:43
logger
• Const
logger: Logger
Defined in
mongodb-rag-core/build/logger.d.ts:13
Functions
assertEnvVars
▸ assertEnvVars<T
>(ENV_VARS
): T
Type parameters
Name | Type |
---|---|
T | extends Record <string , string > |
Parameters
Name | Type |
---|---|
ENV_VARS | T |
Returns
T
Defined in
mongodb-rag-core/build/assertEnvVars.d.ts:1
createLoggerMessage
▸ createLoggerMessage(«destructured»
): Object
Parameters
Name | Type |
---|---|
«destructured» | CreateMessageParams |
Returns
Object
Name | Type |
---|---|
ipAddress | undefined | string |
message | string |
requestBody | unknown |
requestId | undefined | string |
Defined in
mongodb-rag-core/build/logger.d.ts:7
escapeNewlines
▸ escapeNewlines(str
): string
Parameters
Name | Type |
---|---|
str | string |
Returns
string
Defined in
mongodb-rag-core/build/DataStreamer.d.ts:4
filterDefined
▸ filterDefined<T
>(array
): Exclude
<T
, undefined
>[]
Given an array of possibly undefined T, return those that are defined.
Type parameters
Name |
---|
T |
Parameters
Name | Type |
---|---|
array | T [] |
Returns
Exclude
<T
, undefined
>[]
Defined in
mongodb-rag-core/build/arrayFilters.d.ts:8
filterFulfilled
▸ filterFulfilled<T
>(array
): PromiseFulfilledResult
<T
>[]
Given an array of PromiseSettledResults, return those that are fulfilled as PromiseFulfilledResults.
Type parameters
Name |
---|
T |
Parameters
Name | Type |
---|---|
array | PromiseSettledResult <T >[] |
Returns
PromiseFulfilledResult
<T
>[]
Defined in
mongodb-rag-core/build/arrayFilters.d.ts:4
makeClassifier
▸ makeClassifier(«destructured»
): Classifier
Parameters
Name | Type | Description |
---|---|---|
«destructured» | Object | - |
› chainOfThought? | boolean | If set to true , the classification will include a reason field that performs chain-of-thought reasoning before determining the classification type.. |
› classificationTypes | ClassificationType [] | A list of valid classification types. |
› model | string | - |
› openAiClient | OpenAI | - |
Returns
Defined in
mongodb-rag-core/build/makeClassifier.d.ts:51
makeDataStreamer
▸ makeDataStreamer(): DataStreamer
Create a DataStreamer that streams data to the client.
Returns
Defined in
mongodb-rag-core/build/DataStreamer.d.ts:76