Skip to content

Workflow encoding feature (offloading / encryption) - #478

Merged
mistralai-nfau merged 12 commits into
mainfrom
nfau/migrate-encoding
Apr 14, 2026
Merged

Workflow encoding feature (offloading / encryption)#478
mistralai-nfau merged 12 commits into
mainfrom
nfau/migrate-encoding

Conversation

@mistralai-nfau

@mistralai-nfau mistralai-nfau commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

Usage

from mistralai import Mistral
from mistralai.extra.workflows import (
    configure_workflow_encoding,
    WorkflowEncodingConfig,
    PayloadEncryptionConfig,
    PayloadEncryptionMode,
)

client = Mistral()

# Encryption only
config = WorkflowEncodingConfig(
    payload_encryption=PayloadEncryptionConfig(
        mode=PayloadEncryptionMode.FULL,
        main_key="your-256-bit-hex-key",
    )
)

await configure_workflow_encoding(config, client=client)

#  With offloading (S3)

from mistralai.extra.workflows import (
    PayloadOffloadingConfig,
    BlobStorageConfig,
    StorageProvider,
)

config = WorkflowEncodingConfig(
    payload_offloading=PayloadOffloadingConfig(
        storage_config=BlobStorageConfig(
            storage_provider=StorageProvider.S3,
            bucket_name="my-bucket",
        ),
    )
)

await configure_workflow_encoding(config, client=client)

@mistralai-nfau
mistralai-nfau force-pushed the nfau/migrate-encoding branch from 72d6d14 to 2165cdf Compare April 8, 2026 11:08
Comment thread pyproject.toml
Comment thread src/mistralai/client/_hooks/workflow_encoding_hook.py Outdated
Comment thread src/mistralai/extra/workflows/encoding/config.py Outdated
Comment thread src/mistralai/extra/workflows/encoding/payload_encoder.py Outdated
Comment thread src/mistralai/extra/workflows/encoding/payload_encoder.py Outdated
Comment thread src/mistralai/client/_hooks/workflow_encoding_hook.py Outdated
Comment thread src/mistralai/client/_hooks/workflow_encoding_hook.py Outdated
Comment thread src/mistralai/client/_hooks/workflow_encoding_hook.py Outdated
Comment thread src/mistralai/client/_hooks/registration.py
Comment thread src/mistralai/extra/workflows/encoding/storage/blob_storage_impl.py Outdated
@mistralai-nfau
mistralai-nfau marked this pull request as ready for review April 10, 2026 08:55
Comment thread src/mistralai/client/sdk.py Outdated
_configure_workflow_encoding(config, namespace)
return self

# endregion sdk-class-body

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mistralai-nfau why do we need to put it in a region sdk-class-body instead of extras?

@mistralai-nfau mistralai-nfau Apr 10, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's for DX to allow client.configure_workflow_encoding(...)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mistralai-nfau ok but it's adding long term maintenance cost on the SDK team.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@louis-sanna-dev I removed the custom code for now, I added a code example in the PR summary.
Will be easier to add later if needed than removing it.

@mistralai-nfau
mistralai-nfau force-pushed the nfau/migrate-encoding branch from 9a3b458 to 99e7610 Compare April 10, 2026 17:42
@louis-sanna-dev

Copy link
Copy Markdown
Contributor

(thanks a lot @anth2o for your in-depth review)

Comment thread src/mistralai/client/_hooks/workflow_encoding_hook.py Outdated
Comment thread src/mistralai/client/conversations.py Outdated
Comment thread src/mistralai/extra/workflows/encoding/storage/__init__.py Outdated
Comment thread src/mistralai/extra/workflows/encoding/storage/blob_storage.py
Comment thread src/mistralai/extra/workflows/encoding/storage/blob_storage_impl.py Outdated
Comment thread pyproject.toml Outdated
@mistralai-nfau
mistralai-nfau merged commit 045a89f into main Apr 14, 2026
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants