mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-12-12 10:55:17 +00:00
Refactor seed handling logic in litellm_ai_handler to improve readability and error checking
This commit is contained in:
parent
ac247dbc2c
commit
7eadb45c09
1 changed files with 4 additions and 3 deletions
|
|
@ -129,9 +129,10 @@ class LiteLLMAIHandler(BaseAiHandler):
|
|||
"force_timeout": get_settings().config.ai_timeout,
|
||||
"api_base": self.api_base,
|
||||
}
|
||||
if get_settings().config.get("seed", -1) > 0:
|
||||
if temperature > 0:
|
||||
seed = get_settings().config.get("seed", -1)
|
||||
if temperature > 0 and seed >= 0:
|
||||
raise ValueError("Seed is not supported with temperature > 0")
|
||||
elif seed > 0:
|
||||
kwargs["seed"] = get_settings().config.seed
|
||||
|
||||
if self.repetition_penalty:
|
||||
|
|
|
|||
Loading…
Reference in a new issue