mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-04 11:45:00 +00:00
refactor: Make use_temperature support both bool and float types
This commit is contained in:
parent
e07fddb20b
commit
495a27c0a7
1 changed files with 3 additions and 3 deletions
|
@ -10,7 +10,7 @@ import sys
|
||||||
import time
|
import time
|
||||||
from dataclasses import dataclass, fields
|
from dataclasses import dataclass, fields
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Optional
|
from typing import Optional, Union
|
||||||
|
|
||||||
import json5
|
import json5
|
||||||
import yaml
|
import yaml
|
||||||
|
@ -102,7 +102,7 @@ class ModelSettings:
|
||||||
cache_control: bool = False
|
cache_control: bool = False
|
||||||
caches_by_default: bool = False
|
caches_by_default: bool = False
|
||||||
use_system_prompt: bool = True
|
use_system_prompt: bool = True
|
||||||
use_temperature: bool = True # how can i make this a bool or a float? ai!
|
use_temperature: Union[bool, float] = True
|
||||||
streaming: bool = True
|
streaming: bool = True
|
||||||
editor_model_name: Optional[str] = None
|
editor_model_name: Optional[str] = None
|
||||||
editor_edit_format: Optional[str] = None
|
editor_edit_format: Optional[str] = None
|
||||||
|
@ -551,7 +551,7 @@ class Model(ModelSettings):
|
||||||
|
|
||||||
if self.use_temperature is not False:
|
if self.use_temperature is not False:
|
||||||
if temperature is None:
|
if temperature is None:
|
||||||
if self.use_temperature in (True, None):
|
if isinstance(self.use_temperature, bool):
|
||||||
temperature = 0
|
temperature = 0
|
||||||
else:
|
else:
|
||||||
temperature = float(self.use_temperature)
|
temperature = float(self.use_temperature)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue