mistralai-workflows 2.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mistralai_workflows-2.0.0/.gitignore +32 -0
- mistralai_workflows-2.0.0/CONTRIBUTING.md +114 -0
- mistralai_workflows-2.0.0/LICENSE +190 -0
- mistralai_workflows-2.0.0/MIGRATION_GUIDE.md +69 -0
- mistralai_workflows-2.0.0/Makefile +30 -0
- mistralai_workflows-2.0.0/PKG-INFO +121 -0
- mistralai_workflows-2.0.0/README.md +61 -0
- mistralai_workflows-2.0.0/mistralai_workflows/__init__.py +46 -0
- mistralai_workflows-2.0.0/mistralai_workflows/client.py +979 -0
- mistralai_workflows-2.0.0/mistralai_workflows/common/models.py +67 -0
- mistralai_workflows-2.0.0/mistralai_workflows/constants.py +2 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/__init__.py +1 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/activity.py +448 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/config/__init__.py +6 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/config/config.py +385 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/config/config_discovery.py +78 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/definition/__init__.py +1 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/definition/validation/__init__.py +1 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/definition/validation/parameter_conversion.py +63 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/definition/validation/schema_generator.py +120 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/definition/validation/validator.py +286 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/definition/workflow_definition.py +26 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/dependencies/__init__.py +6 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/dependencies/dependency_injector.py +182 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/encoding/__init__.py +1 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/encoding/fields_offloader.py +187 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/encoding/payload_encoder.py +349 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/events/__init__.py +1 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/events/event_activities.py +241 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/events/event_context.py +185 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/events/event_interceptor.py +207 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/events/event_utils.py +101 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/events/json_patch.py +98 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/execution/__init__.py +1 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/execution/concurrency/__init__.py +16 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/execution/concurrency/concurrency_workflow.py +49 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/execution/concurrency/execute_activities_in_batch.py +38 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/execution/concurrency/execute_activities_in_parallel.py +275 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/execution/concurrency/executors/__init__.py +11 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/execution/concurrency/executors/chain_executor.py +84 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/execution/concurrency/executors/list_executor.py +89 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/execution/concurrency/executors/offset_pagination_executor.py +91 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/execution/concurrency/run_in_batches.py +84 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/execution/concurrency/types.py +103 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/execution/concurrency/utils.py +15 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/execution/local_activity.py +36 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/execution/sticky_session/__init__.py +0 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/execution/sticky_session/get_sticky_worker_session.py +67 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/execution/sticky_session/run_sticky_worker_session.py +71 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/execution/sticky_session/sticky_worker_session.py +29 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/execution/workflow_execution.py +101 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/interactive_workflow.py +241 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/logging.py +123 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/rate_limiting/__init__.py +6 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/rate_limiting/rate_limit.py +121 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/storage/__init__.py +1 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/storage/blob_storage.py +103 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/storage/blob_storage_impl.py +333 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/task/__init__.py +11 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/task/create_task.py +127 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/task/protocol.py +40 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/task/task.py +237 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/temporal/__init__.py +1 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/temporal/activity_offloading_interceptor.py +54 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/temporal/context_handler_interceptor.py +203 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/temporal/payload_codec.py +120 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/temporal/payload_converter.py +82 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/temporal/temporal_client.py +117 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/tracing/__init__.py +1 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/tracing/init_tracing.py +81 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/tracing/otel_config.py +138 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/tracing/temporal_tracing_interceptor.py +280 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/tracing/utils.py +282 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/utils/__init__.py +12 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/utils/cache.py +118 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/utils/contextvars.py +41 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/utils/id_generator.py +22 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/worker.py +458 -0
- mistralai_workflows-2.0.0/mistralai_workflows/core/workflow.py +614 -0
- mistralai_workflows-2.0.0/mistralai_workflows/examples/__init__.py +0 -0
- mistralai_workflows-2.0.0/mistralai_workflows/examples/all_workflows_worker.py +128 -0
- mistralai_workflows-2.0.0/mistralai_workflows/examples/assist/__init__.py +0 -0
- mistralai_workflows-2.0.0/mistralai_workflows/examples/assist/workflow_agent_tool_kwargs.py +209 -0
- mistralai_workflows-2.0.0/mistralai_workflows/examples/assist/workflow_chat_parse.py +59 -0
- mistralai_workflows-2.0.0/mistralai_workflows/examples/assist/workflow_embeddings.py +55 -0
- mistralai_workflows-2.0.0/mistralai_workflows/examples/assist/workflow_example.py +49 -0
- mistralai_workflows-2.0.0/mistralai_workflows/examples/assist/workflow_extract_markdown.py +56 -0
- mistralai_workflows-2.0.0/mistralai_workflows/examples/assist/workflow_insurance_claims.py +212 -0
- mistralai_workflows-2.0.0/mistralai_workflows/examples/assist/workflow_local_session_streaming.py +77 -0
- mistralai_workflows-2.0.0/mistralai_workflows/examples/assist/workflow_multi_turn_chat.py +69 -0
- mistralai_workflows-2.0.0/mistralai_workflows/examples/assist/workflow_pokemon_personality.py +163 -0
- mistralai_workflows-2.0.0/mistralai_workflows/examples/assist/workflow_rfc_builder.py +269 -0
- mistralai_workflows-2.0.0/mistralai_workflows/examples/assist/workflow_travel_agent_streaming.py +155 -0
- mistralai_workflows-2.0.0/mistralai_workflows/examples/assist/workflow_with_agent.py +446 -0
- mistralai_workflows-2.0.0/mistralai_workflows/examples/interactive_workflow_example.py +160 -0
- mistralai_workflows-2.0.0/mistralai_workflows/examples/old_workflow_insurance_claims.py +298 -0
- mistralai_workflows-2.0.0/mistralai_workflows/examples/old_workflow_multi_turn_chat.py +169 -0
- mistralai_workflows-2.0.0/mistralai_workflows/examples/worker_example.py +29 -0
- mistralai_workflows-2.0.0/mistralai_workflows/examples/workflow_activity_kwargs.py +125 -0
- mistralai_workflows-2.0.0/mistralai_workflows/examples/workflow_activity_optional_arg.py +20 -0
- mistralai_workflows-2.0.0/mistralai_workflows/examples/workflow_example.py +78 -0
- mistralai_workflows-2.0.0/mistralai_workflows/examples/workflow_example_different_task_queue.py +45 -0
- mistralai_workflows-2.0.0/mistralai_workflows/examples/workflow_streaming_examples.py +153 -0
- mistralai_workflows-2.0.0/mistralai_workflows/examples/workflow_utf8_encoding.py +34 -0
- mistralai_workflows-2.0.0/mistralai_workflows/examples/workflow_validation_test.py +59 -0
- mistralai_workflows-2.0.0/mistralai_workflows/examples/workflow_with_concurrency.py +157 -0
- mistralai_workflows-2.0.0/mistralai_workflows/examples/workflow_with_continue_as_new.py +92 -0
- mistralai_workflows-2.0.0/mistralai_workflows/examples/workflow_with_dependency_injection_example.py +85 -0
- mistralai_workflows-2.0.0/mistralai_workflows/examples/workflow_with_local_activities.py +100 -0
- mistralai_workflows-2.0.0/mistralai_workflows/examples/workflow_with_nested_input.py +77 -0
- mistralai_workflows-2.0.0/mistralai_workflows/examples/workflow_with_rate_limit.py +180 -0
- mistralai_workflows-2.0.0/mistralai_workflows/examples/workflow_with_schedule.py +49 -0
- mistralai_workflows-2.0.0/mistralai_workflows/examples/workflow_with_signals_and_queries.py +270 -0
- mistralai_workflows-2.0.0/mistralai_workflows/examples/workflow_with_sub_workflow.py +43 -0
- mistralai_workflows-2.0.0/mistralai_workflows/examples/workflow_with_update.py +105 -0
- mistralai_workflows-2.0.0/mistralai_workflows/examples/workflow_worker_versioning_example.py +97 -0
- mistralai_workflows-2.0.0/mistralai_workflows/exceptions.py +196 -0
- mistralai_workflows-2.0.0/mistralai_workflows/exports.py +78 -0
- mistralai_workflows-2.0.0/mistralai_workflows/models/__init__.py +71 -0
- mistralai_workflows-2.0.0/mistralai_workflows/models/attributes.py +34 -0
- mistralai_workflows-2.0.0/mistralai_workflows/models/events.py +35 -0
- mistralai_workflows-2.0.0/mistralai_workflows/models/handlers.py +41 -0
- mistralai_workflows-2.0.0/mistralai_workflows/models/payload.py +99 -0
- mistralai_workflows-2.0.0/mistralai_workflows/models/schedule.py +158 -0
- mistralai_workflows-2.0.0/mistralai_workflows/models/storage.py +21 -0
- mistralai_workflows-2.0.0/mistralai_workflows/models/workflow.py +93 -0
- mistralai_workflows-2.0.0/mistralai_workflows/plugins/README.md +13 -0
- mistralai_workflows-2.0.0/mistralai_workflows/plugins/_discovery.py +27 -0
- mistralai_workflows-2.0.0/mistralai_workflows/protocol/__init__.py +0 -0
- mistralai_workflows-2.0.0/mistralai_workflows/protocol/v1/__init__.py +0 -0
- mistralai_workflows-2.0.0/mistralai_workflows/protocol/v1/events.py +757 -0
- mistralai_workflows-2.0.0/mistralai_workflows/protocol/v1/namespace.py +12 -0
- mistralai_workflows-2.0.0/mistralai_workflows/protocol/v1/streaming.py +83 -0
- mistralai_workflows-2.0.0/mistralai_workflows/protocol/v1/tempo.py +79 -0
- mistralai_workflows-2.0.0/mistralai_workflows/protocol/v1/worker.py +7 -0
- mistralai_workflows-2.0.0/mistralai_workflows/protocol/v1/workflow.py +438 -0
- mistralai_workflows-2.0.0/mistralai_workflows/py.typed +0 -0
- mistralai_workflows-2.0.0/mistralai_workflows/scripts/dev_interactive_workflow_cli.py +999 -0
- mistralai_workflows-2.0.0/mistralai_workflows/testing/__init__.py +85 -0
- mistralai_workflows-2.0.0/mistralai_workflows/testing/constants.py +3 -0
- mistralai_workflows-2.0.0/mistralai_workflows/testing/event_comparison.py +82 -0
- mistralai_workflows-2.0.0/mistralai_workflows/testing/event_helpers.py +220 -0
- mistralai_workflows-2.0.0/mistralai_workflows/testing/fixtures.py +58 -0
- mistralai_workflows-2.0.0/mistralai_workflows/testing/test_worker.py +115 -0
- mistralai_workflows-2.0.0/mistralai_workflows/testing/workflow_helpers.py +568 -0
- mistralai_workflows-2.0.0/plugins/CONTRIBUTING.md +147 -0
- mistralai_workflows-2.0.0/plugins/mistralai/LICENSE +190 -0
- mistralai_workflows-2.0.0/plugins/mistralai/Makefile +22 -0
- mistralai_workflows-2.0.0/plugins/mistralai/README.md +71 -0
- mistralai_workflows-2.0.0/plugins/mistralai/mistralai_workflows/__init__.py +7 -0
- mistralai_workflows-2.0.0/plugins/mistralai/mistralai_workflows/plugins/mistralai/__init__.py +154 -0
- mistralai_workflows-2.0.0/plugins/mistralai/mistralai_workflows/plugins/mistralai/activities.py +165 -0
- mistralai_workflows-2.0.0/plugins/mistralai/mistralai_workflows/plugins/mistralai/agent.py +59 -0
- mistralai_workflows-2.0.0/plugins/mistralai/mistralai_workflows/plugins/mistralai/lechat.py +892 -0
- mistralai_workflows-2.0.0/plugins/mistralai/mistralai_workflows/plugins/mistralai/mcp.py +202 -0
- mistralai_workflows-2.0.0/plugins/mistralai/mistralai_workflows/plugins/mistralai/models.py +26 -0
- mistralai_workflows-2.0.0/plugins/mistralai/mistralai_workflows/plugins/mistralai/py.typed +0 -0
- mistralai_workflows-2.0.0/plugins/mistralai/mistralai_workflows/plugins/mistralai/runner.py +63 -0
- mistralai_workflows-2.0.0/plugins/mistralai/mistralai_workflows/plugins/mistralai/session/__init__.py +24 -0
- mistralai_workflows-2.0.0/plugins/mistralai/mistralai_workflows/plugins/mistralai/session/local_session.py +305 -0
- mistralai_workflows-2.0.0/plugins/mistralai/mistralai_workflows/plugins/mistralai/session/remote_session.py +265 -0
- mistralai_workflows-2.0.0/plugins/mistralai/mistralai_workflows/plugins/mistralai/session/session.py +32 -0
- mistralai_workflows-2.0.0/plugins/mistralai/mistralai_workflows/plugins/mistralai/tool.py +224 -0
- mistralai_workflows-2.0.0/plugins/mistralai/mistralai_workflows/plugins/mistralai/utils.py +236 -0
- mistralai_workflows-2.0.0/plugins/mistralai/pyproject.toml +105 -0
- mistralai_workflows-2.0.0/plugins/mistralai/tasks.py +69 -0
- mistralai_workflows-2.0.0/plugins/mistralai/tests/activities/__init__.py +0 -0
- mistralai_workflows-2.0.0/plugins/mistralai/tests/activities/test_chat_parse.py +64 -0
- mistralai_workflows-2.0.0/plugins/mistralai/tests/activities/test_embeddings.py +39 -0
- mistralai_workflows-2.0.0/plugins/mistralai/tests/activities/test_ocr.py +41 -0
- mistralai_workflows-2.0.0/plugins/mistralai/tests/agents/__init__.py +0 -0
- mistralai_workflows-2.0.0/plugins/mistralai/tests/agents/cassettes/TestAgentIntegration.test_agent_with_handoff.yaml +184 -0
- mistralai_workflows-2.0.0/plugins/mistralai/tests/agents/cassettes/TestAgentIntegration.test_simple_agent_run.yaml +86 -0
- mistralai_workflows-2.0.0/plugins/mistralai/tests/agents/test_agent.py +60 -0
- mistralai_workflows-2.0.0/plugins/mistralai/tests/agents/test_agent_integration.py +59 -0
- mistralai_workflows-2.0.0/plugins/mistralai/tests/agents/test_tool.py +40 -0
- mistralai_workflows-2.0.0/plugins/mistralai/tests/agents/test_tool_calling_errors.py +136 -0
- mistralai_workflows-2.0.0/plugins/mistralai/tests/conftest.py +45 -0
- mistralai_workflows-2.0.0/plugins/mistralai/tests/test_assistant_message_events.py +231 -0
- mistralai_workflows-2.0.0/plugins/mistralai/tests/test_canvas_input_schema.py +244 -0
- mistralai_workflows-2.0.0/plugins/mistralai/tests/test_form_input_schema.py +978 -0
- mistralai_workflows-2.0.0/plugins/mistralai/tests/test_todo_list_events.py +762 -0
- mistralai_workflows-2.0.0/plugins/mistralai/tests/test_tool_ui_state.py +178 -0
- mistralai_workflows-2.0.0/plugins/mistralai/tests/workflows/test_models.py +51 -0
- mistralai_workflows-2.0.0/plugins/mistralai/uv.lock +1277 -0
- mistralai_workflows-2.0.0/plugins/nuage/.python-version +1 -0
- mistralai_workflows-2.0.0/plugins/nuage/Makefile +48 -0
- mistralai_workflows-2.0.0/plugins/nuage/README.md +332 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/__init__.py +7 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/agent/__init__.py +0 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/agent/agent_executor.py +53 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/agent/agent_models.py +24 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/agent/agent_session.py +65 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/agent/agent_task.py +130 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/agent/providers/__init__.py +0 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/agent/providers/vibe/__init__.py +0 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/agent/providers/vibe/vibe.py +164 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/agent/providers/vibe/vibe_activities.py +240 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/agent/providers/vibe/vibe_hook_sandbox.py +64 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/agent/providers/vibe/vibe_hook_wait_for_input.py +357 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/agent/providers/vibe/vibe_invoke_tool_in_sandbox.py +91 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/agent/providers/vibe/vibe_models.py +97 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/agent/providers/vibe/vibe_patches.py +397 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/constants.py +2 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/env_secrets.py +44 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/experimental/__init__.py +0 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/experimental/experimental_extract.py +49 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/experimental/experimental_identity.py +34 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/hook.py +80 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/integrations/__init__.py +0 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/integrations/chat_assistant/__init__.py +0 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/integrations/chat_assistant/chat_assistant.py +44 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/integrations/chat_assistant/chat_assistant_activities.py +74 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/integrations/chat_assistant/chat_assistant_dependencies.py +15 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/integrations/chat_assistant/chat_assistant_hooks.py +93 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/integrations/chat_assistant/chat_assistant_models.py +46 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/integrations/chat_assistant/chat_assistant_settings.py +15 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/integrations/chat_assistant/chat_assistant_tool_format_bash.py +402 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/integrations/chat_assistant/chat_assistant_tool_format_file.py +31 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/integrations/chat_assistant/chat_assistant_tool_ui_state.py +95 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/integrations/github/__init__.py +0 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/integrations/github/github.py +110 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/integrations/github/github_activities.py +192 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/integrations/github/github_hooks.py +107 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/integrations/github/github_models.py +64 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/integrations/github/github_prompts.py +26 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/integrations/github/github_scripts.py +92 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/integrations/github/github_settings.py +23 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/integrations/integrations_base.py +79 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/polymorphic.py +70 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/redact.py +72 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/sandbox/__init__.py +0 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/sandbox/daemon_python/__init__.py +0 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/sandbox/daemon_python/daemon_python_activities.py +82 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/sandbox/daemon_python/daemon_python_commands.py +154 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/sandbox/daemon_python/daemon_python_hook.py +23 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/sandbox/daemon_python/daemon_python_protocol.py +108 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/sandbox/daemon_python/daemon_python_sandbox_script.py +288 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/sandbox/providers/__init__.py +0 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/sandbox/providers/demiurge/__init__.py +0 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/sandbox/providers/demiurge/demiurge.py +67 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/sandbox/providers/demiurge/demiurge_activities.py +129 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/sandbox/providers/demiurge/demiurge_constants.py +1 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/sandbox/providers/demiurge/demiurge_models.py +63 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/sandbox/providers/demiurge/demiurge_utils.py +70 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/sandbox/sandbox.py +56 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/sandbox/sandbox_models.py +88 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/sandbox/sandbox_utils.py +52 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/settings.py +53 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/utils.py +49 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/wait_for_input.py +40 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/worker.py +14 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/workflow/__init__.py +0 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/workflow/workflow.py +127 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/workflow/workflow_integrations.py +89 -0
- mistralai_workflows-2.0.0/plugins/nuage/mistralai_workflows/plugins/nuage/workflow/workflow_models.py +55 -0
- mistralai_workflows-2.0.0/plugins/nuage/pyproject.toml +129 -0
- mistralai_workflows-2.0.0/plugins/nuage/scripts/env.sh +199 -0
- mistralai_workflows-2.0.0/plugins/nuage/scripts/generate_crypto_key.py +21 -0
- mistralai_workflows-2.0.0/plugins/nuage/scripts/run-worker-local.sh +37 -0
- mistralai_workflows-2.0.0/plugins/nuage/scripts/run-worker.sh +11 -0
- mistralai_workflows-2.0.0/plugins/nuage/scripts/run-workflow.sh +44 -0
- mistralai_workflows-2.0.0/plugins/nuage/tasks.py +99 -0
- mistralai_workflows-2.0.0/plugins/nuage/tests/__init__.py +0 -0
- mistralai_workflows-2.0.0/plugins/nuage/tests/conftest.py +13 -0
- mistralai_workflows-2.0.0/plugins/nuage/tests/helpers.py +7 -0
- mistralai_workflows-2.0.0/plugins/nuage/tests/test_chat_assistant_activities.py +144 -0
- mistralai_workflows-2.0.0/plugins/nuage/tests/test_chat_assistant_tool_ui_state.py +309 -0
- mistralai_workflows-2.0.0/plugins/nuage/tests/test_daemon_python.py +195 -0
- mistralai_workflows-2.0.0/plugins/nuage/tests/test_daemon_python_commands.py +56 -0
- mistralai_workflows-2.0.0/plugins/nuage/tests/test_daemon_python_execute.py +85 -0
- mistralai_workflows-2.0.0/plugins/nuage/tests/test_daemon_python_recovery.py +78 -0
- mistralai_workflows-2.0.0/plugins/nuage/tests/test_experimental_extract.py +75 -0
- mistralai_workflows-2.0.0/plugins/nuage/tests/test_github_hooks.py +158 -0
- mistralai_workflows-2.0.0/plugins/nuage/tests/test_hook.py +221 -0
- mistralai_workflows-2.0.0/plugins/nuage/tests/test_integration_id.py +20 -0
- mistralai_workflows-2.0.0/plugins/nuage/tests/test_polymorphic.py +366 -0
- mistralai_workflows-2.0.0/plugins/nuage/tests/test_redact.py +166 -0
- mistralai_workflows-2.0.0/plugins/nuage/tests/test_sandbox_demiurge.py +109 -0
- mistralai_workflows-2.0.0/plugins/nuage/tests/test_sandbox_models.py +56 -0
- mistralai_workflows-2.0.0/plugins/nuage/tests/test_utils.py +24 -0
- mistralai_workflows-2.0.0/plugins/nuage/tests/test_vibe_patch.py +151 -0
- mistralai_workflows-2.0.0/plugins/nuage/tests/test_vibe_session_create.py +187 -0
- mistralai_workflows-2.0.0/plugins/nuage/tests/test_vibe_wait_for_input.py +244 -0
- mistralai_workflows-2.0.0/plugins/nuage/tests/test_workflow_hooks.py +85 -0
- mistralai_workflows-2.0.0/plugins/nuage/tests/test_workflow_integrations_alias.py +7 -0
- mistralai_workflows-2.0.0/plugins/nuage/tests/vibe_fixtures.py +145 -0
- mistralai_workflows-2.0.0/plugins/nuage/uv.lock +1964 -0
- mistralai_workflows-2.0.0/pyproject.toml +181 -0
- mistralai_workflows-2.0.0/scripts/test_plugin_installs.sh +161 -0
- mistralai_workflows-2.0.0/tasks.py +151 -0
- mistralai_workflows-2.0.0/tests/__init__.py +0 -0
- mistralai_workflows-2.0.0/tests/conftest.py +7 -0
- mistralai_workflows-2.0.0/tests/fixtures.py +256 -0
- mistralai_workflows-2.0.0/tests/fixtures_activity_extends.py +57 -0
- mistralai_workflows-2.0.0/tests/fixtures_interactive_workflow.py +159 -0
- mistralai_workflows-2.0.0/tests/fixtures_long_running_activities.py +65 -0
- mistralai_workflows-2.0.0/tests/fixtures_task.py +179 -0
- mistralai_workflows-2.0.0/tests/integration/conftest.py +19 -0
- mistralai_workflows-2.0.0/tests/integration/test_example_workflows.py +668 -0
- mistralai_workflows-2.0.0/tests/integration/test_handler_validation_e2e.py +185 -0
- mistralai_workflows-2.0.0/tests/integration/test_input_size_validation.py +144 -0
- mistralai_workflows-2.0.0/tests/integration/test_optional_args.py +34 -0
- mistralai_workflows-2.0.0/tests/test_activity_decorator.py +67 -0
- mistralai_workflows-2.0.0/tests/test_activity_kwargs.py +106 -0
- mistralai_workflows-2.0.0/tests/test_all_workflows_worker.py +66 -0
- mistralai_workflows-2.0.0/tests/test_client.py +43 -0
- mistralai_workflows-2.0.0/tests/test_continue_as_new.py +127 -0
- mistralai_workflows-2.0.0/tests/test_dependency_injection.py +201 -0
- mistralai_workflows-2.0.0/tests/test_dummy.py +4 -0
- mistralai_workflows-2.0.0/tests/test_event_ordering.py +380 -0
- mistralai_workflows-2.0.0/tests/test_execute_workflow.py +193 -0
- mistralai_workflows-2.0.0/tests/test_ext_namespace.py +91 -0
- mistralai_workflows-2.0.0/tests/test_interactive_workflow.py +172 -0
- mistralai_workflows-2.0.0/tests/test_interactive_workflow_events.py +418 -0
- mistralai_workflows-2.0.0/tests/test_local_activity.py +172 -0
- mistralai_workflows-2.0.0/tests/test_long_running_activities.py +97 -0
- mistralai_workflows-2.0.0/tests/test_network_encoded_input.py +41 -0
- mistralai_workflows-2.0.0/tests/test_normalize_temporal_url.py +43 -0
- mistralai_workflows-2.0.0/tests/test_parameter_conversion.py +173 -0
- mistralai_workflows-2.0.0/tests/test_schema_generation_by_type.py +459 -0
- mistralai_workflows-2.0.0/tests/test_sticky_worker_session.py +120 -0
- mistralai_workflows-2.0.0/tests/test_task.py +190 -0
- mistralai_workflows-2.0.0/tests/test_task_events.py +577 -0
- mistralai_workflows-2.0.0/tests/test_validators.py +529 -0
- mistralai_workflows-2.0.0/tests/test_warnings.py +58 -0
- mistralai_workflows-2.0.0/tests/test_workflow_basic.py +106 -0
- mistralai_workflows-2.0.0/tests/test_workflow_decorator.py +41 -0
- mistralai_workflows-2.0.0/tests/test_workflow_events.py +385 -0
- mistralai_workflows-2.0.0/tests/test_workflow_execution.py +244 -0
- mistralai_workflows-2.0.0/tests/test_workflow_handler_validation.py +179 -0
- mistralai_workflows-2.0.0/tests/test_workflow_parameters.py +387 -0
- mistralai_workflows-2.0.0/tests/test_workflow_replay_determinism.py +82 -0
- mistralai_workflows-2.0.0/tests/test_workflow_with_activity_extends.py +40 -0
- mistralai_workflows-2.0.0/tests/utils.py +47 -0
- mistralai_workflows-2.0.0/uv.lock +2934 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# python sdk
|
|
2
|
+
build
|
|
3
|
+
*.egg-info
|
|
4
|
+
*.egg
|
|
5
|
+
|
|
6
|
+
# Env files
|
|
7
|
+
.env
|
|
8
|
+
.env.*
|
|
9
|
+
!.env.example
|
|
10
|
+
|
|
11
|
+
# Python
|
|
12
|
+
__pycache__/
|
|
13
|
+
*.py[cod]
|
|
14
|
+
*$py.class
|
|
15
|
+
.pytest_cache/
|
|
16
|
+
.coverage
|
|
17
|
+
htmlcov/
|
|
18
|
+
|
|
19
|
+
# IDEs
|
|
20
|
+
.idea/
|
|
21
|
+
.vscode/
|
|
22
|
+
*.swp
|
|
23
|
+
*.swo
|
|
24
|
+
|
|
25
|
+
# docs
|
|
26
|
+
docs/node_modules/**
|
|
27
|
+
docs/.docusaurus/**
|
|
28
|
+
docs/pnpm-lock.yaml
|
|
29
|
+
.docs.temporal.io/
|
|
30
|
+
|
|
31
|
+
#test
|
|
32
|
+
/.test_durations
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# Contributing to Workflows SDK
|
|
2
|
+
|
|
3
|
+
Everyone is more than welcome to contribute to the Workflows SDK and Abraxas service.
|
|
4
|
+
This guide helps ensure your contributions land smoothly and quickly.
|
|
5
|
+
|
|
6
|
+
## Before You Start
|
|
7
|
+
|
|
8
|
+
Before writing code, please:
|
|
9
|
+
|
|
10
|
+
1. **Open a Linear ticket** in [WFL Triage](https://linear.app/mistral-ai/team/WFL/triage)
|
|
11
|
+
2. **Ping us on Slack** in `#eng-workflows-backroom` to discuss scope
|
|
12
|
+
|
|
13
|
+
This helps us align on approach early and avoids wasted effort 🙏
|
|
14
|
+
|
|
15
|
+
## Development Setup
|
|
16
|
+
|
|
17
|
+
See [the API README.md](../abraxas/README.md) for full setup details.
|
|
18
|
+
|
|
19
|
+
For creating plugins (and associated IDE setup), see [plugins/CONTRIBUTING.md](./plugins/CONTRIBUTING.md).
|
|
20
|
+
|
|
21
|
+
## Commit Guidelines
|
|
22
|
+
|
|
23
|
+
Commit messages matter. Here's how to write them well: https://cbea.ms/git-commit/
|
|
24
|
+
|
|
25
|
+
- **Atomic commits** — One logical change per commit
|
|
26
|
+
- **Why/What** - Don't describe the how, but explains what changed, and most of all, why
|
|
27
|
+
- **Imperative mood** — "Add feature" not "Added feature"
|
|
28
|
+
- **Clean history** — Squash fixup commits before requesting review
|
|
29
|
+
|
|
30
|
+
A clean history makes it easier to review changes and understand the intent behind them.
|
|
31
|
+
|
|
32
|
+
## Pull Request Guidelines
|
|
33
|
+
|
|
34
|
+
You SHOULD open your PR as a draft by default.
|
|
35
|
+
This signals it's still a work in progress and lets you verify that the CI
|
|
36
|
+
passes before requesting reviews, and do a quick self-review first.
|
|
37
|
+
|
|
38
|
+
Fill out the [PR template](/.github/PULL_REQUEST_TEMPLATE.md) completely:
|
|
39
|
+
|
|
40
|
+
| Section | What to include |
|
|
41
|
+
|--------------------|-------------------------------------------------|
|
|
42
|
+
| **Context** | Why this change matters. Link to Linear ticket. |
|
|
43
|
+
| **Implementation** | Key design decisions and trade-offs. |
|
|
44
|
+
| **Checks/QA** | How you tested the changes. |
|
|
45
|
+
|
|
46
|
+
Keep PRs focused — one feature or fix per PR.
|
|
47
|
+
Large PRs are harder to review and take longer to merge.
|
|
48
|
+
If you're working on a large feature, consider splitting it into smaller PRs.
|
|
49
|
+
|
|
50
|
+
⚠️ **When merging, make sure your squashed commit message retain all the relevant information
|
|
51
|
+
of your commit history**
|
|
52
|
+
|
|
53
|
+
### Code Quality Checklist
|
|
54
|
+
|
|
55
|
+
Before marking your PR as ready for review, ensure all of the following pass:
|
|
56
|
+
|
|
57
|
+
- [ ] CI passes
|
|
58
|
+
- [ ] Tests added for new functionality
|
|
59
|
+
- [ ] Docstrings updated if public API changed
|
|
60
|
+
- [ ] [Internal documentation](../abraxas/docs) is updated if necessary
|
|
61
|
+
|
|
62
|
+
### What We Look For
|
|
63
|
+
|
|
64
|
+
We want to **merge your contribution ASAP**. To make that happen, help us review quickly by:
|
|
65
|
+
|
|
66
|
+
- **Clear justification** — Why is this change needed? Why now?
|
|
67
|
+
- **Context upfront** — Link to Linear ticket, explain the problem being solved
|
|
68
|
+
- **Minimal scope** — One focused change, no unrelated modifications
|
|
69
|
+
- Tests covering new functionality
|
|
70
|
+
- Clean, readable code following existing patterns
|
|
71
|
+
💡: The better you explain the "why" in your PR description, the faster we can approve.
|
|
72
|
+
|
|
73
|
+
### During review
|
|
74
|
+
|
|
75
|
+
**Reviewer**
|
|
76
|
+
|
|
77
|
+
- Follow this guide when leaving review comments: https://google.github.io/eng-practices/review/reviewer/comments.html#label-comment-severity
|
|
78
|
+
- If a conversation takes too long to resolve, don't hesitate to take it IRL **and** write a summary in the PR for posterity
|
|
79
|
+
- Initial review should happen in less than 24h (excluding week-ends and holidays), make sure to check for pending reviews frequently.
|
|
80
|
+
|
|
81
|
+
**Author**
|
|
82
|
+
|
|
83
|
+
- Avoid force-pushing (`git push --force`) once your commit is under review. Force-pushing rewrites history and breaks reviewers' context, making it difficult to see what changed since their last review.
|
|
84
|
+
- Address comments by linking to a fixup commit or a subsequent commit solving precisely that comment
|
|
85
|
+
- Let the comment author resolve, unless it's a clear nitpick or optional comment in which case it's ok for the PR author to resolve.
|
|
86
|
+
- Make sure all the conversations have been addressed before merging. After addressing a reviewer's comment, you should re-request a review from them.
|
|
87
|
+
- It is your responsibility to make sure you get reviews, so it's totally ok to ping reviewers reminding them to review the PR
|
|
88
|
+
|
|
89
|
+
## Writing Tests
|
|
90
|
+
|
|
91
|
+
We use pytest with async support. Tests live in `workflow_sdk/tests/`.
|
|
92
|
+
|
|
93
|
+
**Unit Tests** (most common):
|
|
94
|
+
|
|
95
|
+
- Test workflow and activity definitions
|
|
96
|
+
- Use `temporal_env` fixture for fast, isolated execution (in-memory Temporal with time-skipping)
|
|
97
|
+
- Mark async tests with `@pytest.mark.asyncio`
|
|
98
|
+
- Run specific tests: `uv run invoke tests -k "test_name"`
|
|
99
|
+
|
|
100
|
+
**Integration Tests**:
|
|
101
|
+
|
|
102
|
+
- Test end-to-end workflows against staging/production
|
|
103
|
+
- Live in `workflow_sdk/tests/integration/`
|
|
104
|
+
- Mark with `@pytest.mark.integration`
|
|
105
|
+
- Require `MISTRAL_API_KEY` and `WORKFLOWS_URL` env vars
|
|
106
|
+
|
|
107
|
+
**Guidelines**:
|
|
108
|
+
|
|
109
|
+
- Focus on high-ROI tests covering real behavior
|
|
110
|
+
- Keep tests simple — if they're complex, reconsider the design
|
|
111
|
+
|
|
112
|
+
## Questions?
|
|
113
|
+
|
|
114
|
+
Reach out in `#eng-workflows-backroom` — we're happy to help!
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
Copyright 2026 Mistral AI
|
|
179
|
+
|
|
180
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
181
|
+
you may not use this file except in compliance with the License.
|
|
182
|
+
You may obtain a copy of the License at
|
|
183
|
+
|
|
184
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
185
|
+
|
|
186
|
+
Unless required by applicable law or agreed to in writing, software
|
|
187
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
188
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
189
|
+
See the License for the specific language governing permissions and
|
|
190
|
+
limitations under the License.
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Migrating from v1.0 to v2.0
|
|
2
|
+
|
|
3
|
+
## Class Renaming
|
|
4
|
+
|
|
5
|
+
The following classes have been renamed:
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
AbraxasClient -> WorkflowsClient
|
|
9
|
+
InternalAbraxasConcurrencyWorkflow -> ParallelExecutionWorkflow
|
|
10
|
+
AbraxasWorkflowError -> WorkflowError
|
|
11
|
+
AbraxasActivityError -> ActivityError
|
|
12
|
+
AbraxasWorkflowOutboundInterceptor -> WorkflowContextWorkflowOutboundInterceptor
|
|
13
|
+
AbraxasWorkflowInboundInterceptor -> WorkflowContextWorkflowInboundInterceptor
|
|
14
|
+
AbraxasActivityInboundInterceptor -> WorkflowContextActivityInboundInterceptor
|
|
15
|
+
AbraxasTemporalWorkerCodec -> MistralWorkflowsPayloadCodec
|
|
16
|
+
AbraxasWorkerJSONPayloadConverter -> WithContextJSONPayloadConverter
|
|
17
|
+
AbraxasWorkerPayloadConverter -> MistralWorkflowsPayloadConverter
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Deprecated fields
|
|
21
|
+
|
|
22
|
+
The `activity_name` field of the `@activity` decorator has been deprecated and replaced by `name`:
|
|
23
|
+
|
|
24
|
+
❌ `@activity(activity_name="my-activity")`
|
|
25
|
+
|
|
26
|
+
✅ `@activity(name="my-activity)`
|
|
27
|
+
|
|
28
|
+
## Environment configuration
|
|
29
|
+
|
|
30
|
+
- `ABRAXAS_ENDPOINT` has been removed:
|
|
31
|
+
|
|
32
|
+
It used to control several other env variables:
|
|
33
|
+
|
|
34
|
+
1. `SERVER_URL` was set to `https://api.{ABRAXAS_ENDPOINT}`. You should set this URL directly now.
|
|
35
|
+
2. `OTEL_ENDPOINT` was set to `https://api.{ABRAXAS_ENDPOINT}/api/otel`. Set it directly if you want to specify the URL of the OpenTelemetry collector.
|
|
36
|
+
3. For local development only, `TEMPORAL_SERVER_URL` was set to `https://front.{ABRAXAS_ENDPOINT}:443`. Set it directly if you want to specify the URL of the Temporal server.
|
|
37
|
+
4. `OTEL_ENABLED` was set to True when this env variable was set. You should now set it explicitly
|
|
38
|
+
|
|
39
|
+
- `ABRAXAS_BASE_URL` has been removed. Use `SERVER_URL` instead.
|
|
40
|
+
- `ABRAXAS_API_VERSION` has been renamed to `API_VERSION`
|
|
41
|
+
- `ABRAXAS_ALLOW_OVERRIDE_NAMESPACE` has been renamed to `ALLOW_OVERRIDE_NAMESPACE`
|
|
42
|
+
- **2.0.0 beta**: `ALLOW_OVERRIDE_NAMESPACE` has been renamed to `ALLOW_MULTIPLE_WORKERS` (default is now `True`). Multiple workers on the same namespace are now allowed by default. If you don't want this behavior, set `ALLOW_MULTIPLE_WORKERS=False`.
|
|
43
|
+
- `ABRAXAS_ENABLE_CONFIG_DISCOVERY` has been renamed to `ENABLE_CONFIG_DISCOVERY`
|
|
44
|
+
- `ABRAXAS_API_HEADERS` has been renamed to `MISTRAL_API_HEADERS`
|
|
45
|
+
- `ABRAXAS_CA_BUNDLE`has been renamed to `CA_BUNDLE`
|
|
46
|
+
- `ABRAXAS_API_KEY` has been renamed to `MISTRAL_API_KEY`
|
|
47
|
+
|
|
48
|
+
## Task Context Manager Breaking Changes ⚠️
|
|
49
|
+
|
|
50
|
+
### Task Context Manager Is Now Async
|
|
51
|
+
|
|
52
|
+
The task context manager is now **fully async**.
|
|
53
|
+
|
|
54
|
+
**Migration Required:**
|
|
55
|
+
- Change all `with task(...)` to `async with task(...)`
|
|
56
|
+
- Change all `t.set_state()` calls to `await t.set_state()`
|
|
57
|
+
- Change all `t.update_state()` calls to `await t.update_state()`
|
|
58
|
+
|
|
59
|
+
```python
|
|
60
|
+
# ❌ OLD (synchronous)
|
|
61
|
+
with workflows.task("processing", state={"progress": 0}) as t:
|
|
62
|
+
t.set_state({"progress": 50})
|
|
63
|
+
t.set_state({"progress": 100})
|
|
64
|
+
|
|
65
|
+
# ✅ NEW (async)
|
|
66
|
+
async with workflows.task("processing", state={"progress": 0}) as t:
|
|
67
|
+
await t.set_state({"progress": 50})
|
|
68
|
+
await t.set_state({"progress": 100})
|
|
69
|
+
```
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# See http://go/std-makefile to get an understanding of common Makefile targets used throughout the project
|
|
2
|
+
|
|
3
|
+
.PHONY: onboarding lint format typecheck test integration-tests dev installdeps
|
|
4
|
+
|
|
5
|
+
onboarding:
|
|
6
|
+
@echo "🛠️ Setting up workflow_sdk..."
|
|
7
|
+
@$(MAKE) installdeps
|
|
8
|
+
@echo "✅ workflow_sdk automated onboarding complete. You may still have some manual steps to tackle!"
|
|
9
|
+
|
|
10
|
+
lint:
|
|
11
|
+
uv run invoke lint
|
|
12
|
+
|
|
13
|
+
format:
|
|
14
|
+
uv run invoke lint --fix
|
|
15
|
+
|
|
16
|
+
typecheck:
|
|
17
|
+
uv run invoke typecheck
|
|
18
|
+
|
|
19
|
+
test:
|
|
20
|
+
uv run invoke tests
|
|
21
|
+
|
|
22
|
+
integration-tests:
|
|
23
|
+
uv run invoke integration-tests
|
|
24
|
+
|
|
25
|
+
dev:
|
|
26
|
+
@echo "Development environment setup"
|
|
27
|
+
@echo "Run 'uv sync' to install dependencies"
|
|
28
|
+
|
|
29
|
+
installdeps:
|
|
30
|
+
uv sync
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: mistralai-workflows
|
|
3
|
+
Version: 2.0.0
|
|
4
|
+
Summary: Mistral Workflows - Build reliable AI workflows with Python
|
|
5
|
+
Project-URL: Homepage, https://mistral.ai
|
|
6
|
+
Project-URL: Documentation, https://docs-internal-frameworks.mistral.ai/workflows
|
|
7
|
+
Author-email: Mistral AI <support@mistral.ai>
|
|
8
|
+
License: Apache-2.0
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Keywords: ai,llm,mistral,orchestration,temporal,workflows
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
17
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
18
|
+
Requires-Python: <3.15,>=3.12
|
|
19
|
+
Requires-Dist: asynciolimiter<2.0.0,>=1.2.0
|
|
20
|
+
Requires-Dist: cryptography<47.0.0,>=41.0.0
|
|
21
|
+
Requires-Dist: httpx<1.0.0,>=0.27.0
|
|
22
|
+
Requires-Dist: jsonpatch<2.0.0,>=1.33
|
|
23
|
+
Requires-Dist: opentelemetry-api<2.0.0,>=1.30.0
|
|
24
|
+
Requires-Dist: opentelemetry-exporter-otlp-proto-http<2.0.0,>=1.30.0
|
|
25
|
+
Requires-Dist: opentelemetry-instrumentation-asyncio<0.70b0,>=0.60b1
|
|
26
|
+
Requires-Dist: opentelemetry-instrumentation-fastapi<0.70b0,>=0.60b1
|
|
27
|
+
Requires-Dist: opentelemetry-instrumentation-httpx<0.70b0,>=0.60b1
|
|
28
|
+
Requires-Dist: opentelemetry-sdk<2.0.0,>=1.30.0
|
|
29
|
+
Requires-Dist: orjson<4.0.0,>=3.10.15
|
|
30
|
+
Requires-Dist: pydantic-settings<3.0.0,>=2.7.1
|
|
31
|
+
Requires-Dist: pydantic<3.0.0,>=2.12.0
|
|
32
|
+
Requires-Dist: structlog<26,>=24
|
|
33
|
+
Requires-Dist: temporalio<1.23.0,>=1.18.1
|
|
34
|
+
Requires-Dist: tenacity<10.0.0,>=9.1.2
|
|
35
|
+
Provides-Extra: all
|
|
36
|
+
Requires-Dist: aioboto3<13.0.0,>=12.4.0; extra == 'all'
|
|
37
|
+
Requires-Dist: aiocache<1.0.0,>=0.12.3; extra == 'all'
|
|
38
|
+
Requires-Dist: azure-storage-blob[aio]<13.0.0,>=12.28.0; extra == 'all'
|
|
39
|
+
Requires-Dist: gcloud-aio-storage<10.0.0,>=9.3.0; extra == 'all'
|
|
40
|
+
Requires-Dist: mcp<2.0.0,>=1.12.4; extra == 'all'
|
|
41
|
+
Requires-Dist: mistralai-workflows-plugins-mistralai<2.1.0,>=2.0.0b1; extra == 'all'
|
|
42
|
+
Requires-Dist: opentelemetry-instrumentation-aiohttp-client<0.70b0,>=0.60b1; extra == 'all'
|
|
43
|
+
Provides-Extra: azure
|
|
44
|
+
Requires-Dist: azure-storage-blob[aio]<13.0.0,>=12.28.0; extra == 'azure'
|
|
45
|
+
Provides-Extra: gcs
|
|
46
|
+
Requires-Dist: gcloud-aio-storage<10.0.0,>=9.3.0; extra == 'gcs'
|
|
47
|
+
Requires-Dist: opentelemetry-instrumentation-aiohttp-client<0.70b0,>=0.60b1; extra == 'gcs'
|
|
48
|
+
Provides-Extra: mistralai
|
|
49
|
+
Requires-Dist: aiocache<1.0.0,>=0.12.3; extra == 'mistralai'
|
|
50
|
+
Requires-Dist: mcp<2.0.0,>=1.12.4; extra == 'mistralai'
|
|
51
|
+
Requires-Dist: mistralai-workflows-plugins-mistralai<2.1.0,>=2.0.0b1; extra == 'mistralai'
|
|
52
|
+
Provides-Extra: s3
|
|
53
|
+
Requires-Dist: aioboto3<13.0.0,>=12.4.0; extra == 's3'
|
|
54
|
+
Provides-Extra: storage
|
|
55
|
+
Requires-Dist: aioboto3<13.0.0,>=12.4.0; extra == 'storage'
|
|
56
|
+
Requires-Dist: azure-storage-blob[aio]<13.0.0,>=12.28.0; extra == 'storage'
|
|
57
|
+
Requires-Dist: gcloud-aio-storage<10.0.0,>=9.3.0; extra == 'storage'
|
|
58
|
+
Requires-Dist: opentelemetry-instrumentation-aiohttp-client<0.70b0,>=0.60b1; extra == 'storage'
|
|
59
|
+
Description-Content-Type: text/markdown
|
|
60
|
+
|
|
61
|
+
# Mistral Workflows
|
|
62
|
+
|
|
63
|
+
Build reliable, production-grade AI workflows with Python.
|
|
64
|
+
|
|
65
|
+
## Overview
|
|
66
|
+
|
|
67
|
+
Mistral Workflows is a Python SDK for building AI-powered workflows with built-in reliability, observability, and scalability. It provides fault tolerance, durability, and exactly-once execution guarantees.
|
|
68
|
+
|
|
69
|
+
## Features
|
|
70
|
+
|
|
71
|
+
- **Simple Python API**: Define workflows using Python decorators
|
|
72
|
+
- **Built-in Reliability**: Automatic retries, timeouts, and error handling
|
|
73
|
+
- **Distributed Execution**: Scale workflows across multiple workers
|
|
74
|
+
- **LLM Integration**: Native support for Mistral AI and other LLM providers
|
|
75
|
+
- **Observability**: Distributed tracing, structured logging, and event streaming
|
|
76
|
+
- **Type Safety**: Full type hints and Pydantic validation
|
|
77
|
+
|
|
78
|
+
## Installation
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
pip install mistralai-workflows
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Quick Start
|
|
85
|
+
|
|
86
|
+
```python
|
|
87
|
+
from mistralai_workflows import workflow, activity
|
|
88
|
+
|
|
89
|
+
@activity
|
|
90
|
+
async def get_weather(city: str) -> str:
|
|
91
|
+
# Your activity implementation
|
|
92
|
+
return f"Weather in {city}: Sunny"
|
|
93
|
+
|
|
94
|
+
@workflow.define
|
|
95
|
+
class WeatherWorkflow:
|
|
96
|
+
@workflow.run
|
|
97
|
+
async def run(self, city: str) -> str:
|
|
98
|
+
weather = await workflow.execute_activity(
|
|
99
|
+
get_weather,
|
|
100
|
+
city,
|
|
101
|
+
start_to_close_timeout=timedelta(seconds=10),
|
|
102
|
+
)
|
|
103
|
+
return weather
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Documentation
|
|
107
|
+
|
|
108
|
+
For full documentation, visit [docs.mistral.ai/workflows](https://docs.mistral.ai/workflows)
|
|
109
|
+
|
|
110
|
+
## Examples
|
|
111
|
+
|
|
112
|
+
The SDK includes comprehensive examples in the `mistralai_workflows/examples` directory. You can run all examples with a single command:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
# Run all example workflows in a single worker
|
|
116
|
+
python -m mistralai_workflows.examples.all_workflows_worker
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## License
|
|
120
|
+
|
|
121
|
+
Apache License 2.0 - see [LICENSE](LICENSE) for details.
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Mistral Workflows
|
|
2
|
+
|
|
3
|
+
Build reliable, production-grade AI workflows with Python.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
Mistral Workflows is a Python SDK for building AI-powered workflows with built-in reliability, observability, and scalability. It provides fault tolerance, durability, and exactly-once execution guarantees.
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
- **Simple Python API**: Define workflows using Python decorators
|
|
12
|
+
- **Built-in Reliability**: Automatic retries, timeouts, and error handling
|
|
13
|
+
- **Distributed Execution**: Scale workflows across multiple workers
|
|
14
|
+
- **LLM Integration**: Native support for Mistral AI and other LLM providers
|
|
15
|
+
- **Observability**: Distributed tracing, structured logging, and event streaming
|
|
16
|
+
- **Type Safety**: Full type hints and Pydantic validation
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
pip install mistralai-workflows
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Quick Start
|
|
25
|
+
|
|
26
|
+
```python
|
|
27
|
+
from mistralai_workflows import workflow, activity
|
|
28
|
+
|
|
29
|
+
@activity
|
|
30
|
+
async def get_weather(city: str) -> str:
|
|
31
|
+
# Your activity implementation
|
|
32
|
+
return f"Weather in {city}: Sunny"
|
|
33
|
+
|
|
34
|
+
@workflow.define
|
|
35
|
+
class WeatherWorkflow:
|
|
36
|
+
@workflow.run
|
|
37
|
+
async def run(self, city: str) -> str:
|
|
38
|
+
weather = await workflow.execute_activity(
|
|
39
|
+
get_weather,
|
|
40
|
+
city,
|
|
41
|
+
start_to_close_timeout=timedelta(seconds=10),
|
|
42
|
+
)
|
|
43
|
+
return weather
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Documentation
|
|
47
|
+
|
|
48
|
+
For full documentation, visit [docs.mistral.ai/workflows](https://docs.mistral.ai/workflows)
|
|
49
|
+
|
|
50
|
+
## Examples
|
|
51
|
+
|
|
52
|
+
The SDK includes comprehensive examples in the `mistralai_workflows/examples` directory. You can run all examples with a single command:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
# Run all example workflows in a single worker
|
|
56
|
+
python -m mistralai_workflows.examples.all_workflows_worker
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## License
|
|
60
|
+
|
|
61
|
+
Apache License 2.0 - see [LICENSE](LICENSE) for details.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
from pkgutil import extend_path
|
|
2
|
+
|
|
3
|
+
# Extend __path__ to support namespace package discovery in editable installs.
|
|
4
|
+
#
|
|
5
|
+
# The `mistralai_workflows.plugins` subpackage is a PEP 420 implicit namespace package,
|
|
6
|
+
# allowing external packages to contribute plugins by creating:
|
|
7
|
+
#
|
|
8
|
+
# their-package-on-pypi/mistralai_workflows/plugins/their_plugin/__init__.py
|
|
9
|
+
#
|
|
10
|
+
# PEP 420 namespaces work correctly for regular (non-editable) installs.
|
|
11
|
+
# However, editable installs may fail to properly merge namespace contributions.
|
|
12
|
+
#
|
|
13
|
+
# We solve this by explicitly calling extend_path(), which iterates through
|
|
14
|
+
# all entries in sys.path, checks if each contains a `mistralai_workflows/plugins`
|
|
15
|
+
# directory, and adds any it finds to __path__.
|
|
16
|
+
#
|
|
17
|
+
# Note that there are two mechanisms for editable installs, and our fix
|
|
18
|
+
# only works for the first:
|
|
19
|
+
#
|
|
20
|
+
# 1. Static .pth files that add directories to sys.path:
|
|
21
|
+
# - uv build backend
|
|
22
|
+
# - setuptools with src layout (default) or with editable_mode=compat
|
|
23
|
+
# - hatchling
|
|
24
|
+
# - flit (via pip install -e or flit install --pth-file)
|
|
25
|
+
# - pdm-backend with editable-backend="path" (default)
|
|
26
|
+
# - poetry-core
|
|
27
|
+
#
|
|
28
|
+
# 2. Import hooks via sys.meta_path (these do NOT work with extend_path):
|
|
29
|
+
# - setuptools with flat layout (installs a custom finder)
|
|
30
|
+
# - pdm-backend with editable-backend="editables"
|
|
31
|
+
#
|
|
32
|
+
# For case (2), there is no clean solution at the import level. The import
|
|
33
|
+
# hook intercepts imports before sys.path is searched, and extend_path()
|
|
34
|
+
# cannot discover paths that aren't in sys.path.
|
|
35
|
+
#
|
|
36
|
+
# In practice, most modern build backends default to static .pth files,
|
|
37
|
+
# so this workaround covers the majority of use cases.
|
|
38
|
+
#
|
|
39
|
+
# See also:
|
|
40
|
+
# - https://github.com/pypa/pip/issues/7265
|
|
41
|
+
# - PEP 420 (implicit namespace packages)
|
|
42
|
+
# - PEP 660 (editable installs)
|
|
43
|
+
__path__ = extend_path(__path__, __name__)
|
|
44
|
+
|
|
45
|
+
from .exports import * # noqa: F403
|
|
46
|
+
from .exports import __all__ as __all__
|