Skip to content
Open
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
1 change: 1 addition & 0 deletions docs/models/encodedpayloadoptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ This is an open enum. Unrecognized values will not fail type checks.
- `"offloaded"`
- `"encrypted"`
- `"encrypted-partial"`
- `"compressed"`
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ dependencies = [
"opentelemetry-api (>=1.33.1,<2.0.0)",
"opentelemetry-semantic-conventions (>=0.60b1,<0.61)",
"jsonpath-python >=1.0.6", # required for speakeasy generated path with pagination
"msgpack>=1.1.0,<2.0.0",
]

[project.optional-dependencies]
Expand Down Expand Up @@ -49,6 +50,9 @@ workflow_payload_offloading = [
workflow_payload_encryption = [
"cryptography>=41.0.0,<47.0.0",
]
workflow_payload_compression = [
"zstandard>=0.25.0,<0.26",
]


[project.urls]
Expand All @@ -70,6 +74,7 @@ dev = [
"griffe>=1.7.3,<2",
"authlib>=1.5.2,<2",
"websockets >=13.0",
"zstandard>=0.25.0,<0.26",
]
lint = [
"ruff>=0.11.10,<0.12",
Expand Down Expand Up @@ -137,6 +142,7 @@ ignore_missing_imports = true
[[tool.mypy.overrides]]
module = [
"jsonpath.*",
"msgpack.*",
"typing_inspect.*",
"authlib.*",
"websockets.*",
Expand Down
1 change: 1 addition & 0 deletions src/mistralai/client/models/encodedpayloadoptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"offloaded",
"encrypted",
"encrypted-partial",
"compressed",
],
UnrecognizedStr,
]
4 changes: 4 additions & 0 deletions src/mistralai/extra/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ class WorkflowPayloadEncryptionException(MistralClientException):
"""Workflow payload encryption exception"""


class WorkflowPayloadCompressionException(MistralClientException):
"""Workflow payload compression exception"""


class RunException(MistralClientException):
"""Conversation run errors."""

Expand Down
Empty file.
26 changes: 26 additions & 0 deletions src/mistralai/extra/tests/fixtures/workflow_encoding.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from __future__ import annotations

from typing import Any


class InMemoryBlobStorage:
def __init__(self) -> None:
self.blobs: dict[str, bytes] = {}

async def __aenter__(self) -> "InMemoryBlobStorage":
return self

async def __aexit__(self, *_args: Any) -> None:
pass

async def upload_blob(self, key: str, content: bytes) -> str:
self.blobs[key] = content
return key

async def get_blob(self, key: str) -> bytes:
return self.blobs[key]

async def get_blob_properties(self, key: str) -> dict[str, Any] | None:
if key not in self.blobs:
return None
return {"size": len(self.blobs[key]), "last_modified": "test"}
Loading
Loading