Craft RAG
const { rag } = MODULES;指定できるモデルはCraft RAGで利用できるモデル一覧をご確認ください。
Table of Contents
Section titled “Table of Contents”- RetrieveResultValue
- RagDataSchema
- RagMetadata
- retrieveContexts
- createDataSchemas
- attachMetadata
- listDataSchemas
- listMetadata
RetrieveResultValue
Section titled “RetrieveResultValue”Type: Object
Properties
Section titled “Properties”RagDataSchema
Section titled “RagDataSchema”Type: Object
Properties
Section titled “Properties”keystring メタデータのキー名type("INTEGER"|"FLOAT"|"STRING"|"DATETIME"|"BOOLEAN"|"LIST") メタデータキーのデータ型
RagMetadata
Section titled “RagMetadata”Type: Object
Properties
Section titled “Properties”retrieveContexts
Section titled “retrieveContexts”関連コンテキストをベクトル検索で取得する
Parameters
Section titled “Parameters”-
paramObjectparam.corpusIdstring RAG IDparam.textstring 関連コンテキストを取得するためのクエリテキストparam.vectorDistanceThresholdnumber? ベクトル距離がこの閾値より小さいコンテキストのみを返しますparam.topKnumber? 返すコンテキストの数param.llmRankerModelstring? LLMランカーのモデル名。利用可能なモデルはCraft RAG で利用できるモデル一覧を参照param.rankServiceModelstring? ランクサービスのモデル名。利用可能なモデルはCraft RAG で利用できるモデル一覧を参照param.metadataFilterstring? CEL(Common Expression Language)構文のメタデータフィルタ文字列(例:category == "HR")
Returns Promise<Array<RetrieveResultValue>>
createDataSchemas
Section titled “createDataSchemas”RAGコーパスのメタデータスキーマを定義する
Parameters
Section titled “Parameters”-
paramObjectparam.corpusIdstring RAGコーパス IDparam.schemasArray<RagDataSchema> キーと型のスキーマ定義の配列
attachMetadata
Section titled “attachMetadata”既存のRAGファイルにメタデータを付与する
Parameters
Section titled “Parameters”-
paramObjectparam.corpusIdstring RAGコーパス IDparam.fileIdstring RAGファイル IDparam.metadataArray<RagMetadata> メタデータのキーと値の配列
listDataSchemas
Section titled “listDataSchemas”RAGコーパスに定義されたメタデータスキーマを一覧取得する
Parameters
Section titled “Parameters”listMetadata
Section titled “listMetadata”RAGファイルに付与されたメタデータを一覧取得する