Skip to content

Commit

Permalink
Merge branch 'feature/migrate-sandbox-spec' of github.com:UKGovernmen…
Browse files Browse the repository at this point in the history
…tBEIS/inspect_ai into feature/migrate-sandbox-spec
  • Loading branch information
jjallaire committed Mar 7, 2025
2 parents 356c9b8 + 7c74c72 commit 650e4e3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- More consistent use of `max_retries` and `timeout` configuration options. These options now exclusively control Inspect's outer retry handler; model providers use their default behaviour for the inner request, which is typically 2-4 retries and a service-appropriate timeout.
- Improved async implementation using AnyIO (can now optionally run Trio rather than asyncio as the [async backend](https://inspect.ai-safety-institute.org.uk/parallelism.html#async-backends)).
- Model API: `ChatMessage` now includes an `id` field (defaults to auto-generated uuid).
- Mistral: Update to new Mistral API (v1.5.1 of `mistralai` is now required).
- Logging: Inspect no longer sets the global log level nor does it allow its own messages to propagate to the global handler (eliminating the possiblity of duplicate display). This should improve compatibility with applications that have their own custom logging configured.
- Tasks: For filesystem based tasks, no longer switch to the task file's directory during execution (directory switching still occurs during task loading). Specify `@task(chdir=True)` to preserve the previous behavior.
- Bugfix: Fix issue with deserializing custom sandbox configuration objects.
Expand Down
3 changes: 3 additions & 0 deletions src/inspect_ai/model/_providers/mistral.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from httpx import ReadTimeout as AsyncReadTimeout
from mistralai import (
ContentChunk,
DocumentURLChunk,
FunctionCall,
FunctionName,
ImageURL,
Expand Down Expand Up @@ -475,6 +476,8 @@ def completion_content_chunk(content: ContentChunk) -> Content:
raise TypeError("ReferenceChunk content is not supported by Inspect.")
elif isinstance(content, TextChunk):
return ContentText(text=content.text)
elif isinstance(content, DocumentURLChunk):
return ContentText(text=content.document_url)
else:
if isinstance(content.image_url, str):
return ContentImage(image=content.image_url)
Expand Down
2 changes: 1 addition & 1 deletion src/inspect_ai/model/_providers/providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def cf() -> type[ModelAPI]:
def mistral() -> type[ModelAPI]:
FEATURE = "Mistral API"
PACKAGE = "mistralai"
MIN_VERSION = "1.5.0"
MIN_VERSION = "1.5.1"

# verify we have the package
try:
Expand Down

0 comments on commit 650e4e3

Please sign in to comment.