🔍 查询配置
AppConfig
option | description | type | default |
---|---|---|---|
log_level | 日志级别 | string | WARNING |
embedding_fn | 嵌入函数 | chromadb.utils.embedding_functions | {text-embedding-ada-002} |
db | 向量数据库 | BaseVectorDB | ChromaDB |
collection_name | 数据库的初始集合名称 | string | embedchain_store |
collect_metrics | 收集匿名遥测数据以改进 | boolean | true |
AddConfig
option | description | type | default |
---|---|---|---|
chunker | 块配置 | ChunkerConfig | Default values for chunker depends on the data_type . Please refer ChunkerConfig |
loader | 加载器配置 | LoaderConfig | None |
是的,你可以将 ChunkerConfig 传递给 AddConfig,就像这样:
chunker_config = ChunkerConfig(chunk_size=100)
add_config = AddConfig(chunker=chunker_config)
app.add("lorem ipsum", config=add_config)
ChunkerConfig
option | description | type | default |
---|---|---|---|
chunk_size | 返回的块的最大大小 | int | Default value for various data_type mentioned below |
chunk_overlap | 块之间的字符重叠 | int | Default value for various data_type mentioned below |
length_function | 测量给定块长度的函数 | typing.Callable | Default value for various data_type mentioned below |
不同数据类型的分块器配置参数的默认值:
data_type | chunk_size | chunk_overlap | length_function |
---|---|---|---|
docx | 1000 | 0 | len |
text | 300 | 0 | len |
qna_pair | 300 | 0 | len |
web_page | 500 | 0 | len |
pdf_file | 1000 | 0 | len |
youtube_video | 2000 | 0 | len |
docs_site | 500 | 50 | len |
notion | 300 | 0 | len |
LlmConfig
option | description | type | default |
---|---|---|---|
number_documents | 从数据库中拉取的文档的绝对数量 | int | 1 |
template | 自定义提示的模板。如果在查询中使用了历史记录,则必须同时包含 $history 。 | Template | 模板("在最后回答查询时,请使用以下上下文片段。如果您不知道答案,只需说您不知道,不要试图凭空编造答案。$context 查询:$query 有用的答案:") |
model | 所使用的模型名称 | string | depends on app type |
temperature | 控制模型输出的随机性。较高的值(接近1)会使输出更随机,较低的值会使其更确定。 | float | 0 |
max_tokens | 控制使用多少令牌。精确实现(是否计算提示和/或响应)取决于模型。 | int | 1000 |
top_p | 控制单词的多样性。较高的值(接近1)会使单词选择更多样化,较低的值会使单词不那么多样化。 | float | 1 |
history | 包括来自客户端或数据库的对话历史。 | any (recommendation: list[str]) | None |
stream | 控制是否将响应流式传输回用户。 | bool | False |
deployment_name | t.b.a. | str | None |
system_prompt | 系统提示字符串。如果没有使用,则不使用。 | str |
上一篇文章:Embedchain----支持的数据格式_一点知趣的博客-CSDN博客
下一篇文章:Embedchain----自定义配置_一点知趣的博客-CSDN博客