locodellm.bench.bench_result#
Result classes for benchmark runs.
- class locodellm.bench.bench_result.BenchResult(results: list[PromptTestResult] = <factory>)#
Aggregated results from a
BenchPromptTestrun.- results#
Individual results for each prompt test.
- to_dataframe() DataFrame#
Exports the results as a pandas DataFrame.
Each row represents one expected result assertion. Columns are:
prompt: the prompt textduration: time in seconds spent generating the answercompiled: whether the generated code compiledran: whether the generated code ran without errorinput_index: index of the input setpassed: whether expected matched actual
- Returns:
A
pandas.DataFramewith one row per assertion.
- class locodellm.bench.bench_result.PromptTestResult(prompt_test: PromptTest, generated_code: str, run_status: RunStatus, results: list[tuple[~locodellm.bench.prompt_test.ExpectedResult, ~typing.Any, bool]]=<factory>, duration: float = 0.0, token_count: int = 0)#
Result of running a single
PromptTest.- prompt_test#
The original prompt test that was evaluated.
- run_status#
The
RunStatusfrom compiling/running the code with undefined arguments.
- results#
A list of tuples
(expected, actual, passed)for eachExpectedResultentry.- Type:
list[tuple[locodellm.bench.prompt_test.ExpectedResult, Any, bool]]