mirror of
https://github.com/acon96/home-llm.git
synced 2026-01-08 05:14:02 -05:00
annotate random vars and small funcs
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user