Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ouonline committed Dec 18, 2024
1 parent 9e2f0a7 commit 9b70c10
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions docs/en/Cookbook/rag.md
Original file line number Diff line number Diff line change
Expand Up @@ -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=' '),
}
```

Expand All @@ -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:
Expand All @@ -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.'\
Expand Down
10 changes: 5 additions & 5 deletions docs/zh/Cookbook/rag.md
Original file line number Diff line number Diff line change
Expand Up @@ -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=' '),
}
```

Expand All @@ -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:
Expand All @@ -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.'\
Expand Down
2 changes: 1 addition & 1 deletion lazyllm/docs/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down

0 comments on commit 9b70c10

Please sign in to comment.