query_configuration.mdx 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. ---
  2. title: '🔍 Query configurations'
  3. ---
  4. ## AppConfig
  5. | option | description | type | default |
  6. |-------------|-----------------------|---------------------------------|------------------------|
  7. | log_level | log level | string | WARNING |
  8. | embedding_fn| 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. Yes, you are passing `ChunkerConfig` to `AddConfig`, like so:
  16. ```python
  17. chunker_config = ChunkerConfig(chunk_size=100)
  18. add_config = AddConfig(chunker=chunker_config)
  19. app.add_local("text", "lorem ipsum", config=add_config)
  20. ```
  21. ### ChunkerConfig
  22. |option|description|type|default|
  23. |---|---|---|---|
  24. |chunk_size|Maximum size of chunks to return|int|Default value for various `data_type` mentioned below|
  25. |chunk_overlap|Overlap in characters between chunks|int|Default value for various `data_type` mentioned below|
  26. |length_function|Function that measures the length of given chunks|typing.Callable|Default value for various `data_type` mentioned below|
  27. Default values of chunker config parameters for different `data_type`:
  28. |data_type|chunk_size|chunk_overlap|length_function|
  29. |---|---|---|---|
  30. |docx|1000|0|len|
  31. |text|300|0|len|
  32. |qna_pair|300|0|len|
  33. |web_page|500|0|len|
  34. |pdf_file|1000|0|len|
  35. |youtube_video|2000|0|len|
  36. |docs_site|500|50|len|
  37. ### LoaderConfig
  38. _coming soon_
  39. ## QueryConfig
  40. |option|description|type|default|
  41. |---|---|---|---|
  42. |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:")|
  43. |history|include conversation history from your client or database|any (recommendation: list[str])|None
  44. |stream|control if response is streamed back to the user|bool|False|
  45. ## ChatConfig
  46. All options for query and...
  47. _coming soon_
  48. History is handled automatically, the config option is not supported.