diff --git a/docs/en/Cookbook/rag.md b/docs/en/Cookbook/rag.md index 6af80af0..0ec57caf 100644 --- a/docs/en/Cookbook/rag.md +++ b/docs/en/Cookbook/rag.md @@ -360,8 +360,8 @@ If using Milvus, we also need to pass the `doc_fields` parameter to `Document`, ```python doc_fields = { - 'comment': DocField(data_type=DocField.DTYPE_VARCHAR, max_size=65535, default_value=' '), - 'signature': DocField(data_type=DocField.DTYPE_VARCHAR, max_size=32, default_value=' '), + 'comment': DocField(data_type=DataType.VARCHAR, max_size=65535, default_value=' '), + 'signature': DocField(data_type=DataType.VARCHAR, max_size=32, default_value=' '), } ``` @@ -379,7 +379,7 @@ Here is a complete example using Milvus as the storage backend: import os import lazyllm from lazyllm import bind, config -from lazyllm.tools.rag import DocField +from lazyllm.tools.rag import DocField, DataType import shutil class TmpDir: @@ -406,8 +406,8 @@ milvus_store_conf = { } doc_fields = { - 'comment': DocField(data_type=DocField.DTYPE_VARCHAR, max_size=65535, default_value=' '), - 'signature': DocField(data_type=DocField.DTYPE_VARCHAR, max_size=32, default_value=' '), + 'comment': DocField(data_type=DataType.VARCHAR, max_size=65535, default_value=' '), + 'signature': DocField(data_type=DataType.VARCHAR, max_size=32, default_value=' '), } prompt = 'You will play the role of an AI Q&A assistant and complete a dialogue task.'\ diff --git a/docs/zh/Cookbook/rag.md b/docs/zh/Cookbook/rag.md index cca93307..54197d77 100644 --- a/docs/zh/Cookbook/rag.md +++ b/docs/zh/Cookbook/rag.md @@ -358,8 +358,8 @@ milvus_store_conf = { ```python doc_fields = { - 'comment': DocField(data_type=DocField.DTYPE_VARCHAR, max_size=65535, default_value=' '), - 'signature': DocField(data_type=DocField.DTYPE_VARCHAR, max_size=32, default_value=' '), + 'comment': DocField(data_type=DataType.VARCHAR, max_size=65535, default_value=' '), + 'signature': DocField(data_type=DataType.VARCHAR, max_size=32, default_value=' '), } ``` @@ -377,7 +377,7 @@ doc_fields = { import os import lazyllm from lazyllm import bind, config -from lazyllm.tools.rag import DocField +from lazyllm.tools.rag import DocField, DataType import shutil class TmpDir: @@ -404,8 +404,8 @@ milvus_store_conf = { } doc_fields = { - 'comment': DocField(data_type=DocField.DTYPE_VARCHAR, max_size=65535, default_value=' '), - 'signature': DocField(data_type=DocField.DTYPE_VARCHAR, max_size=32, default_value=' '), + 'comment': DocField(data_type=DataType.VARCHAR, max_size=65535, default_value=' '), + 'signature': DocField(data_type=DataType.VARCHAR, max_size=32, default_value=' '), } prompt = 'You will play the role of an AI Q&A assistant and complete a dialogue task.'\ diff --git a/lazyllm/docs/tools.py b/lazyllm/docs/tools.py index bb7ce80e..5b3232a0 100644 --- a/lazyllm/docs/tools.py +++ b/lazyllm/docs/tools.py @@ -384,7 +384,7 @@ >>> document2.create_node_group(name='sentences', transform=SentenceSplitter, chunk_size=512, chunk_overlap=50) >>> retriever2 = Retriever([document1, document2], group_name='sentences', similarity='cosine', similarity_cut_off=0.4, embed_keys=['local'], topk=3) >>> print(retriever2("user query")) - +>>> >>> filters = { >>> "author": ["A", "B", "C"], >>> "public_year": [2002, 2003, 2004],