annotate random vars and small funcs

This commit is contained in:
Evian Schlenz
2025-12-31 01:21:27 +01:00
parent c1b5d912d2
commit 242655af84
3 changed files with 6 additions and 6 deletions

View File

@@ -273,7 +273,7 @@ def random_device_list(max_devices: int, avoid_device_names: list[str], language
possible_choices.extend(local_device_names[device_type])
device_types = set()
device_types: set[str] = set()
device_list = []
device_lines: list[str] = []
# TODO: randomly pick attributes for this list

View File

@@ -197,8 +197,8 @@ def generate_static_example(action: PileOfSpecificActionType, persona: str, lang
"assistant_turns": assistant_turns
}
def replace_answer(list_of_answer, var, value):
new_list = []
def replace_answer(list_of_answer: list[str], var: str, value: str):
new_list: list[str] = []
for answer in list_of_answer:
new_list.append(answer.replace(var, value))
return new_list
@@ -529,7 +529,7 @@ def generate_tool_failure_example(failure_case: PileOfFailedToolcallType, person
response_starting = response_starting.replace("<device_name>", friendly_name)
response_confirmed = response_confirmed.replace("<device_name>", friendly_name)
tool_args_extra = {}
tool_args_extra: dict[str, Any] = {}
if device_type == "climate":
if "<temp_f>" in question or "<temp_f>" in response_starting or "<temp_f>" in response_confirmed:
temp_f = generate_random_parameter("temp_f", piles)

View File

@@ -14,8 +14,8 @@ class NoServicesAvailableException(Exception):
pass
def closest_color(requested_color):
min_colors = {}
def closest_color(requested_color: tuple[int, int, int]):
min_colors: dict[int, str] = {}
color_names = webcolors.names("css3")
for name in color_names: