query_configuration.mdx 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. ---
  2. title: '🔍 Query configurations'
  3. ---
  4. ## InitConfig
  5. | option | description | type | default |
  6. |-----------|-----------------------|---------------------------------|------------------------|
  7. | log_level | log level | string | WARNING |
  8. | ef | embedding function | chromadb.utils.embedding_functions | \{text-embedding-ada-002\} |
  9. | db | vector database (experimental) | BaseVectorDB | ChromaDB |
  10. ## AddConfig
  11. |option|description|type|default|
  12. |---|---|---|---|
  13. |chunker|chunker config|ChunkerConfig|Default values for chunker depends on the `data_type`. Please refer [ChunkerConfig](#chunker-config)|
  14. |loader|loader config|LoaderConfig|None|
  15. ### ChunkerConfig
  16. |option|description|type|default|
  17. |---|---|---|---|
  18. |chunk_size|Maximum size of chunks to return|int|Default value for various `data_type` mentioned below|
  19. |chunk_overlap|Overlap in characters between chunks|int|Default value for various `data_type` mentioned below|
  20. |length_function|Function that measures the length of given chunks|typing.Callable|Default value for various `data_type` mentioned below|
  21. Default values of chunker config parameters for different `data_type`:
  22. |data_type|chunk_size|chunk_overlap|length_function|
  23. |---|---|---|---|
  24. |docx|1000|0|len|
  25. |text|300|0|len|
  26. |qna_pair|300|0|len|
  27. |web_page|500|0|len|
  28. |pdf_file|1000|0|len|
  29. |youtube_video|2000|0|len|
  30. ### LoaderConfig
  31. _coming soon_
  32. ## QueryConfig
  33. |option|description|type|default|
  34. |---|---|---|---|
  35. |template|custom template for prompt|Template|Template("Use the following pieces of context to answer the query at the end. If you don't know the answer, just say that you don't know, don't try to make up an answer. \$context Query: \$query Helpful Answer:")|
  36. |history|include conversation history from your client or database|any (recommendation: list[str])|None
  37. |stream|control if response is streamed back to the user|bool|False|
  38. ## ChatConfig
  39. All options for query and...
  40. _coming soon_
  41. History is handled automatically, the config option is not supported.