mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-02 11:50:37 +08:00
Refactor seed handling logic in litellm_ai_handler to improve readability and error checking
This commit is contained in:
@ -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:
|
||||
raise ValueError("Seed is not supported with 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:
|
||||
|
Reference in New Issue
Block a user