diff --git a/pyproject.toml b/pyproject.toml index 398b2fe..4351e6f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,7 @@ packages=["spice"] [project] name = "spiceai" -version = "0.4.2" +version = "0.4.3" license = {text = "Apache-2.0"} description = "A Python library for building AI-powered applications." readme = "README.md" diff --git a/spice/retry_strategy/default_strategy.py b/spice/retry_strategy/default_strategy.py index 4bb8355..7ae5c13 100644 --- a/spice/retry_strategy/default_strategy.py +++ b/spice/retry_strategy/default_strategy.py @@ -1,4 +1,3 @@ -import dataclasses from typing import Any, Callable, Optional from spice.call_args import SpiceCallArgs @@ -17,9 +16,9 @@ def decide( self, call_args: SpiceCallArgs, attempt_number: int, model_output: str, name: str ) -> tuple[Behavior, SpiceCallArgs, Any, str]: if attempt_number == 1 and call_args.temperature is not None: - call_args = dataclasses.replace(call_args, temperature=max(0.2, call_args.temperature)) + call_args = call_args.model_copy(update={"temperature": max(0.2, call_args.temperature)}) elif attempt_number > 1 and call_args.temperature is not None: - call_args = dataclasses.replace(call_args, temperature=max(0.5, call_args.temperature)) + call_args = call_args.model_copy(update={"temperature": max(0.5, call_args.temperature)}) if self.validator and not self.validator(model_output): if attempt_number < self.retries: