Skip to content

Commit

Permalink
add gen_timeout param
Browse files Browse the repository at this point in the history
Signed-off-by: Panos Vagenas <35837085+vagenas@users.noreply.github.com>
  • Loading branch information
vagenas committed May 7, 2024
1 parent 7b60438 commit 40fb429
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions deepsearch/cps/queries/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ class _APISemanticRagParameters(_APISemanticRetrievalParameters):
gen_ctx_window_size: int = 5000
gen_ctx_window_lead_weight: float = 0.5
return_prompt: bool = False
gen_timeout: Optional[float] = None


@validate_arguments
Expand All @@ -128,6 +129,7 @@ def RAGQuery(
gen_ctx_window_size: int = 5000,
gen_ctx_window_lead_weight: float = 0.5,
return_prompt: bool = False,
gen_timeout: Optional[float] = None,
) -> Query:
"""Create a RAG query
Expand All @@ -145,6 +147,7 @@ def RAGQuery(
gen_ctx_window_size (int, optional): (relevant only if gen_ctx_extr_method=="window") max chars to use for extracted gen context (actual extraction quantized on doc item level); defaults to 5000
gen_ctx_window_lead_weight (float, optional): (relevant only if gen_ctx_extr_method=="window") weight of leading text for distributing remaining window size after extracting the `main_path`; defaults to 0.5 (centered around `main_path`)
return_prompt (bool, optional): whether to return the instantiated prompt; defaults to False
gen_timeout (float, optional): timeout for LLM generation; defaults to None, i.e. determined by system
"""

proj_key = project.key if isinstance(project, Project) else project
Expand Down Expand Up @@ -178,6 +181,7 @@ def RAGQuery(
gen_ctx_window_size=gen_ctx_window_size,
gen_ctx_window_lead_weight=gen_ctx_window_lead_weight,
return_prompt=return_prompt,
gen_timeout=gen_timeout,
)

query = Query()
Expand Down

0 comments on commit 40fb429

Please sign in to comment.