From 77889d78468e4e3f69ee90d7d9e4aba387184628 Mon Sep 17 00:00:00 2001 From: yangdx Date: Tue, 25 Mar 2025 18:50:01 +0800 Subject: [PATCH 1/2] Update README --- README-zh.md | 6 +++++- README.md | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/README-zh.md b/README-zh.md index 4a764cb9..1521306f 100644 --- a/README-zh.md +++ b/README-zh.md @@ -164,6 +164,10 @@ class QueryParam: """本地检索中实体描述的最大令牌分配。""" ids: list[str] | None = None # 仅支持PG向量数据库 """用于过滤RAG的ID列表。""" + model_func: Callable[..., object] | None = None + """查询使用的LLM模型函数。如果提供了此选项,它将代替LightRAG全局模型函数。 + 这允许为不同的查询模式使用不同的模型。 + """ ... ``` @@ -764,7 +768,7 @@ rag = LightRAG( create INDEX CONCURRENTLY entity_idx_node_id ON dickens."Entity" (ag_catalog.agtype_access_operator(properties, '"node_id"'::agtype)); CREATE INDEX CONCURRENTLY entity_node_id_gin_idx ON dickens."Entity" using gin(properties); ALTER TABLE dickens."DIRECTED" CLUSTER ON directed_sid_idx; - + -- 如有必要可以删除 drop INDEX entity_p_idx; drop INDEX vertex_p_idx; diff --git a/README.md b/README.md index 79772c8b..e8655e6d 100644 --- a/README.md +++ b/README.md @@ -194,6 +194,11 @@ class QueryParam: """Maximum number of tokens allocated for entity descriptions in local retrieval.""" ids: list[str] | None = None # ONLY SUPPORTED FOR PG VECTOR DBs """List of ids to filter the RAG.""" + model_func: Callable[..., object] | None = None + """Optional override for the LLM model function to use for this specific query. + If provided, this will be used instead of the global model function. + This allows using different models for different query modes. + """ ... ``` @@ -761,7 +766,7 @@ For production level scenarios you will most likely want to leverage an enterpri create INDEX CONCURRENTLY entity_idx_node_id ON dickens."Entity" (ag_catalog.agtype_access_operator(properties, '"node_id"'::agtype)); CREATE INDEX CONCURRENTLY entity_node_id_gin_idx ON dickens."Entity" using gin(properties); ALTER TABLE dickens."DIRECTED" CLUSTER ON directed_sid_idx; - + -- drop if necessary drop INDEX entity_p_idx; drop INDEX vertex_p_idx; From 4dcf717e532bab5f48f571dadb0b4fbb6b433cfc Mon Sep 17 00:00:00 2001 From: yangdx Date: Tue, 25 Mar 2025 18:53:17 +0800 Subject: [PATCH 2/2] Update README.md --- README-zh.md | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README-zh.md b/README-zh.md index 1521306f..784fd1f2 100644 --- a/README-zh.md +++ b/README-zh.md @@ -768,7 +768,7 @@ rag = LightRAG( create INDEX CONCURRENTLY entity_idx_node_id ON dickens."Entity" (ag_catalog.agtype_access_operator(properties, '"node_id"'::agtype)); CREATE INDEX CONCURRENTLY entity_node_id_gin_idx ON dickens."Entity" using gin(properties); ALTER TABLE dickens."DIRECTED" CLUSTER ON directed_sid_idx; - + -- 如有必要可以删除 drop INDEX entity_p_idx; drop INDEX vertex_p_idx; diff --git a/README.md b/README.md index e8655e6d..d3716416 100644 --- a/README.md +++ b/README.md @@ -766,7 +766,7 @@ For production level scenarios you will most likely want to leverage an enterpri create INDEX CONCURRENTLY entity_idx_node_id ON dickens."Entity" (ag_catalog.agtype_access_operator(properties, '"node_id"'::agtype)); CREATE INDEX CONCURRENTLY entity_node_id_gin_idx ON dickens."Entity" using gin(properties); ALTER TABLE dickens."DIRECTED" CLUSTER ON directed_sid_idx; - + -- drop if necessary drop INDEX entity_p_idx; drop INDEX vertex_p_idx;