Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions flexeval/core/evaluate_chat_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,8 @@ def evaluate_chat_response( # noqa: C901, PLR0912
}
if output["lm_output"].raw_text:
restructured_output["raw_lm_output"] = output["lm_output"].raw_text
if output["lm_output"].reasoning_text:
restructured_output["reasoning_text"] = output["lm_output"].reasoning_text
restructured_outputs.append(restructured_output)

return metrics_summary_dict, restructured_outputs
2 changes: 2 additions & 0 deletions tests/core/test_evaluate_chat_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ def test_evaluate_chat_response(
# Therefore, in any case the system message should be in the first turn.
assert outputs[0]["extra_info"]["messages"][0]["role"] == "system"

assert outputs[0]["reasoning_text"] == "reasoning_text"

if use_tools:
assert isinstance(outputs[0]["extra_info"]["tool_calls"], list)
assert isinstance(outputs[0]["extra_info"]["tools"], list)
Expand Down
1 change: 1 addition & 0 deletions tests/dummy_modules/lm.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ def _batch_generate_chat_response(
return [
LMOutput(
text=f"This is response to `{messages[-1]['content']}` with kwargs {kwargs}",
reasoning_text="reasoning_text",
finish_reason="length",
tool_calls=tc,
tool_call_validation_result="CompleteToolCall" if tc else "TextOnly",
Expand Down