From 67bbfc477cad87ec45bd84d785985c8cd7c1ab6a Mon Sep 17 00:00:00 2001 From: jean-malo Date: Fri, 20 Feb 2026 16:00:01 +0100 Subject: [PATCH] fix: update extra --- src/mistralai/extra/run/result.py | 3 +-- src/mistralai/extra/tests/test_struct_chat.py | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/mistralai/extra/run/result.py b/src/mistralai/extra/run/result.py index 0af48ee7..e6e2c655 100644 --- a/src/mistralai/extra/run/result.py +++ b/src/mistralai/extra/run/result.py @@ -109,7 +109,6 @@ def reconstitue_entries( id=first_event.id, agent_id=first_event.agent_id, model=first_event.model, - role=first_event.role, ) ) elif isinstance(first_event, FunctionCallEvent): @@ -160,7 +159,7 @@ def output_as_text(self) -> str: return "\n".join( as_text(entry) for entry in self.output_entries - if entry.type == "message.output" + if isinstance(entry, MessageOutputEntry) ) @property diff --git a/src/mistralai/extra/tests/test_struct_chat.py b/src/mistralai/extra/tests/test_struct_chat.py index dd529ba5..4b8eb723 100644 --- a/src/mistralai/extra/tests/test_struct_chat.py +++ b/src/mistralai/extra/tests/test_struct_chat.py @@ -37,7 +37,6 @@ class MathDemonstration(BaseModel): content='{\n "final_answer": "x = -4",\n "steps": [\n {\n "explanation": "Start with the given equation.",\n "output": "8x + 7 = -23"\n },\n {\n "explanation": "Subtract 7 from both sides to isolate the term with x.",\n "output": "8x = -23 - 7"\n },\n {\n "explanation": "Simplify the right side of the equation.",\n "output": "8x = -30"\n },\n {\n "explanation": "Divide both sides by 8 to solve for x.",\n "output": "x = -30 / 8"\n },\n {\n "explanation": "Simplify the fraction to get the final answer.",\n "output": "x = -4"\n }\n ]\n}', tool_calls=None, prefix=False, - role="assistant", ), finish_reason="stop", ) @@ -53,7 +52,6 @@ class MathDemonstration(BaseModel): content='{\n "final_answer": "x = -4",\n "steps": [\n {\n "explanation": "Start with the given equation.",\n "output": "8x + 7 = -23"\n },\n {\n "explanation": "Subtract 7 from both sides to isolate the term with x.",\n "output": "8x = -23 - 7"\n },\n {\n "explanation": "Simplify the right side of the equation.",\n "output": "8x = -30"\n },\n {\n "explanation": "Divide both sides by 8 to solve for x.",\n "output": "x = -30 / 8"\n },\n {\n "explanation": "Simplify the fraction to get the final answer.",\n "output": "x = -4"\n }\n ]\n}', tool_calls=None, prefix=False, - role="assistant", parsed=MathDemonstration( steps=[ Explanation(