Skip to content
Closed
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
3 changes: 1 addition & 2 deletions src/mistralai/extra/run/result.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions src/mistralai/extra/tests/test_struct_chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
)
Expand All @@ -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(
Expand Down
Loading