MCPcopy Create free account
hub / github.com/CLAIRE-Labo/EvoTune / FunctionClass

Class FunctionClass

src/packing/logging/function_class.py:47–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45
46@dataclass
47class FunctionClass:
48 function_str: str = ""
49 imports_str: str = ""
50 score: float = float("NaN")
51 true_score: int = float("NaN")
52 original_score: int = float("NaN")
53 fail_flag: int = -1 # Only measures if the function failed or not
54 fail_exception: str = ""
55 correct_flag: int = 0
56 chat: list[dict] = field(default_factory=list)
57 prompt: PromptData = field(default_factory=PromptData)
58 eval: EvalData = field(default_factory=EvalData)
59 function_num: int = -1
60 prompt_num: int = -1
61
62 def __setattr__(self, name, value):
63 # Get all field names from the dataclass
64 field_names = {f.name for f in fields(self)}
65 if name not in field_names:
66 raise AttributeError(f"'{type(self).__name__}' object has no attribute '{name}'")
67 super().__setattr__(name, value)

Callers 7

mainFunction · 0.90
task_flat_pack.pyFile · 0.90
task_bin.pyFile · 0.90
generate_functionsFunction · 0.90
EvalProducerFunction · 0.90
stoppable_task.pyFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected