|
@@ -13,7 +13,7 @@ Here's the readme example with configuration options.
|
|
|
```python
|
|
|
import os
|
|
|
from embedchain import App
|
|
|
-from embedchain.config import InitConfig, AddConfig, QueryConfig
|
|
|
+from embedchain.config import InitConfig, AddConfig, QueryConfig, ChunkerConfig
|
|
|
from chromadb.utils import embedding_functions
|
|
|
|
|
|
# Example: use your own embedding function
|
|
@@ -25,14 +25,8 @@ config = InitConfig(ef=embedding_functions.OpenAIEmbeddingFunction(
|
|
|
naval_chat_bot = App(config)
|
|
|
|
|
|
# Example: define your own chunker config for `youtube_video`
|
|
|
-youtube_add_config = {
|
|
|
- "chunker": {
|
|
|
- "chunk_size": 1000,
|
|
|
- "chunk_overlap": 100,
|
|
|
- "length_function": len,
|
|
|
- }
|
|
|
-}
|
|
|
-naval_chat_bot.add("youtube_video", "https://www.youtube.com/watch?v=3qHkcs3kG44", AddConfig(**youtube_add_config))
|
|
|
+chunker_config = ChunkerConfig(chunk_size=1000, chunk_overlap=100, length_function=len)
|
|
|
+naval_chat_bot.add("youtube_video", "https://www.youtube.com/watch?v=3qHkcs3kG44", AddConfig(chunker=chunker_config))
|
|
|
|
|
|
add_config = AddConfig()
|
|
|
naval_chat_bot.add("pdf_file", "https://navalmanack.s3.amazonaws.com/Eric-Jorgenson_The-Almanack-of-Naval-Ravikant_Final.pdf", add_config)
|