You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/key_modules/retrievers.md
+12-12
Original file line number
Diff line number
Diff line change
@@ -38,21 +38,12 @@ Here's a brief overview of how it works:
38
38
### 3.1. Using Vector Retriever
39
39
40
40
**Initialize VectorRetrieve:**
41
-
To get started, we need to initialize the `VectorRetriever` with an optional embedding model. If we don't provide an embedding model, it will use the default `OpenAIEmbedding`. Here's how to do it:
41
+
To get started, we need to initialize the `VectorRetriever` with an optional embedding model and storage. If we don't provide an embedding model, it will use the default `OpenAIEmbedding`. Here's how to do it:
42
42
```python
43
43
from camel.embeddings import OpenAIEmbedding
44
44
from camel.retrievers import VectorRetriever
45
45
46
46
# Initialize the VectorRetriever with an embedding model
Before we can retrieve information, we need to prepare the data and store it in vector storage. The `process` method takes care of this for us. It processes content from a file or URL, divides it into chunks, and stores their embeddings in the specified vector storage.
52
-
```python
53
-
# Provide the path to our content input (can be a file or URL)
54
-
content_input_path ="https://www.camel-ai.org/"
55
-
56
47
# Create or initialize a vector storage (e.g., QdrantStorage)
57
48
from camel.storages.vectordb_storages import QdrantStorage
Before we can retrieve information, we need to prepare the data and store it in vector storage. The `process` method takes care of this for us. It processes content from a file or URL, divides it into chunks, and stores their embeddings in the specified vector storage.
61
+
```python
62
+
# Provide the path to our content input (can be a file or URL)
63
+
content_input_path ="https://www.camel-ai.org/"
64
+
65
65
# Embed and store chunks of data in the vector storage
66
-
vr.process(content_input_path, vector_storage)
66
+
vr.process(content=content_input_path)
67
67
```
68
68
69
69
**Execute a Query:**
@@ -73,7 +73,7 @@ Now that our data is stored, we can execute a query to retrieve information base
0 commit comments