Skip to content

Commit

Permalink
fix type issue w/ mistral referencechunk
Browse files Browse the repository at this point in the history
  • Loading branch information
jjallaire committed Nov 18, 2024
1 parent 589d86e commit c998c95
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/inspect_ai/model/_providers/mistral.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
ImageURL,
ImageURLChunk,
Mistral,
ReferenceChunk,
TextChunk,
)
from mistralai.models import (
Expand Down Expand Up @@ -351,7 +352,9 @@ def completion_content(content: str | list[ContentChunk]) -> str | list[Content]


def completion_content_chunk(content: ContentChunk) -> Content:
if isinstance(content, TextChunk):
if isinstance(content, ReferenceChunk):
raise TypeError("ReferenceChunk content is not supported by Inspect.")
elif isinstance(content, TextChunk):
return ContentText(text=content.text)
else:
if isinstance(content.image_url, str):
Expand Down

0 comments on commit c998c95

Please sign in to comment.