mistralai-workflows 2.0.0__py3-none-any.whl
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/__init__.py +46 -0
- mistralai_workflows/client.py +979 -0
- mistralai_workflows/common/models.py +67 -0
- mistralai_workflows/constants.py +2 -0
- mistralai_workflows/core/__init__.py +1 -0
- mistralai_workflows/core/activity.py +448 -0
- mistralai_workflows/core/config/__init__.py +6 -0
- mistralai_workflows/core/config/config.py +385 -0
- mistralai_workflows/core/config/config_discovery.py +78 -0
- mistralai_workflows/core/definition/__init__.py +1 -0
- mistralai_workflows/core/definition/validation/__init__.py +1 -0
- mistralai_workflows/core/definition/validation/parameter_conversion.py +63 -0
- mistralai_workflows/core/definition/validation/schema_generator.py +120 -0
- mistralai_workflows/core/definition/validation/validator.py +286 -0
- mistralai_workflows/core/definition/workflow_definition.py +26 -0
- mistralai_workflows/core/dependencies/__init__.py +6 -0
- mistralai_workflows/core/dependencies/dependency_injector.py +182 -0
- mistralai_workflows/core/encoding/__init__.py +1 -0
- mistralai_workflows/core/encoding/fields_offloader.py +187 -0
- mistralai_workflows/core/encoding/payload_encoder.py +349 -0
- mistralai_workflows/core/events/__init__.py +1 -0
- mistralai_workflows/core/events/event_activities.py +241 -0
- mistralai_workflows/core/events/event_context.py +185 -0
- mistralai_workflows/core/events/event_interceptor.py +207 -0
- mistralai_workflows/core/events/event_utils.py +101 -0
- mistralai_workflows/core/events/json_patch.py +98 -0
- mistralai_workflows/core/execution/__init__.py +1 -0
- mistralai_workflows/core/execution/concurrency/__init__.py +16 -0
- mistralai_workflows/core/execution/concurrency/concurrency_workflow.py +49 -0
- mistralai_workflows/core/execution/concurrency/execute_activities_in_batch.py +38 -0
- mistralai_workflows/core/execution/concurrency/execute_activities_in_parallel.py +275 -0
- mistralai_workflows/core/execution/concurrency/executors/__init__.py +11 -0
- mistralai_workflows/core/execution/concurrency/executors/chain_executor.py +84 -0
- mistralai_workflows/core/execution/concurrency/executors/list_executor.py +89 -0
- mistralai_workflows/core/execution/concurrency/executors/offset_pagination_executor.py +91 -0
- mistralai_workflows/core/execution/concurrency/run_in_batches.py +84 -0
- mistralai_workflows/core/execution/concurrency/types.py +103 -0
- mistralai_workflows/core/execution/concurrency/utils.py +15 -0
- mistralai_workflows/core/execution/local_activity.py +36 -0
- mistralai_workflows/core/execution/sticky_session/__init__.py +0 -0
- mistralai_workflows/core/execution/sticky_session/get_sticky_worker_session.py +67 -0
- mistralai_workflows/core/execution/sticky_session/run_sticky_worker_session.py +71 -0
- mistralai_workflows/core/execution/sticky_session/sticky_worker_session.py +29 -0
- mistralai_workflows/core/execution/workflow_execution.py +101 -0
- mistralai_workflows/core/interactive_workflow.py +241 -0
- mistralai_workflows/core/logging.py +123 -0
- mistralai_workflows/core/rate_limiting/__init__.py +6 -0
- mistralai_workflows/core/rate_limiting/rate_limit.py +121 -0
- mistralai_workflows/core/storage/__init__.py +1 -0
- mistralai_workflows/core/storage/blob_storage.py +103 -0
- mistralai_workflows/core/storage/blob_storage_impl.py +333 -0
- mistralai_workflows/core/task/__init__.py +11 -0
- mistralai_workflows/core/task/create_task.py +127 -0
- mistralai_workflows/core/task/protocol.py +40 -0
- mistralai_workflows/core/task/task.py +237 -0
- mistralai_workflows/core/temporal/__init__.py +1 -0
- mistralai_workflows/core/temporal/activity_offloading_interceptor.py +54 -0
- mistralai_workflows/core/temporal/context_handler_interceptor.py +203 -0
- mistralai_workflows/core/temporal/payload_codec.py +120 -0
- mistralai_workflows/core/temporal/payload_converter.py +82 -0
- mistralai_workflows/core/temporal/temporal_client.py +117 -0
- mistralai_workflows/core/tracing/__init__.py +1 -0
- mistralai_workflows/core/tracing/init_tracing.py +81 -0
- mistralai_workflows/core/tracing/otel_config.py +138 -0
- mistralai_workflows/core/tracing/temporal_tracing_interceptor.py +280 -0
- mistralai_workflows/core/tracing/utils.py +282 -0
- mistralai_workflows/core/utils/__init__.py +12 -0
- mistralai_workflows/core/utils/cache.py +118 -0
- mistralai_workflows/core/utils/contextvars.py +41 -0
- mistralai_workflows/core/utils/id_generator.py +22 -0
- mistralai_workflows/core/worker.py +458 -0
- mistralai_workflows/core/workflow.py +614 -0
- mistralai_workflows/examples/__init__.py +0 -0
- mistralai_workflows/examples/all_workflows_worker.py +128 -0
- mistralai_workflows/examples/assist/__init__.py +0 -0
- mistralai_workflows/examples/assist/workflow_agent_tool_kwargs.py +209 -0
- mistralai_workflows/examples/assist/workflow_chat_parse.py +59 -0
- mistralai_workflows/examples/assist/workflow_embeddings.py +55 -0
- mistralai_workflows/examples/assist/workflow_example.py +49 -0
- mistralai_workflows/examples/assist/workflow_extract_markdown.py +56 -0
- mistralai_workflows/examples/assist/workflow_insurance_claims.py +212 -0
- mistralai_workflows/examples/assist/workflow_local_session_streaming.py +77 -0
- mistralai_workflows/examples/assist/workflow_multi_turn_chat.py +69 -0
- mistralai_workflows/examples/assist/workflow_pokemon_personality.py +163 -0
- mistralai_workflows/examples/assist/workflow_rfc_builder.py +269 -0
- mistralai_workflows/examples/assist/workflow_travel_agent_streaming.py +155 -0
- mistralai_workflows/examples/assist/workflow_with_agent.py +446 -0
- mistralai_workflows/examples/interactive_workflow_example.py +160 -0
- mistralai_workflows/examples/old_workflow_insurance_claims.py +298 -0
- mistralai_workflows/examples/old_workflow_multi_turn_chat.py +169 -0
- mistralai_workflows/examples/worker_example.py +29 -0
- mistralai_workflows/examples/workflow_activity_kwargs.py +125 -0
- mistralai_workflows/examples/workflow_activity_optional_arg.py +20 -0
- mistralai_workflows/examples/workflow_example.py +78 -0
- mistralai_workflows/examples/workflow_example_different_task_queue.py +45 -0
- mistralai_workflows/examples/workflow_streaming_examples.py +153 -0
- mistralai_workflows/examples/workflow_utf8_encoding.py +34 -0
- mistralai_workflows/examples/workflow_validation_test.py +59 -0
- mistralai_workflows/examples/workflow_with_concurrency.py +157 -0
- mistralai_workflows/examples/workflow_with_continue_as_new.py +92 -0
- mistralai_workflows/examples/workflow_with_dependency_injection_example.py +85 -0
- mistralai_workflows/examples/workflow_with_local_activities.py +100 -0
- mistralai_workflows/examples/workflow_with_nested_input.py +77 -0
- mistralai_workflows/examples/workflow_with_rate_limit.py +180 -0
- mistralai_workflows/examples/workflow_with_schedule.py +49 -0
- mistralai_workflows/examples/workflow_with_signals_and_queries.py +270 -0
- mistralai_workflows/examples/workflow_with_sub_workflow.py +43 -0
- mistralai_workflows/examples/workflow_with_update.py +105 -0
- mistralai_workflows/examples/workflow_worker_versioning_example.py +97 -0
- mistralai_workflows/exceptions.py +196 -0
- mistralai_workflows/exports.py +78 -0
- mistralai_workflows/models/__init__.py +71 -0
- mistralai_workflows/models/attributes.py +34 -0
- mistralai_workflows/models/events.py +35 -0
- mistralai_workflows/models/handlers.py +41 -0
- mistralai_workflows/models/payload.py +99 -0
- mistralai_workflows/models/schedule.py +158 -0
- mistralai_workflows/models/storage.py +21 -0
- mistralai_workflows/models/workflow.py +93 -0
- mistralai_workflows/plugins/README.md +13 -0
- mistralai_workflows/plugins/_discovery.py +27 -0
- mistralai_workflows/protocol/__init__.py +0 -0
- mistralai_workflows/protocol/v1/__init__.py +0 -0
- mistralai_workflows/protocol/v1/events.py +757 -0
- mistralai_workflows/protocol/v1/namespace.py +12 -0
- mistralai_workflows/protocol/v1/streaming.py +83 -0
- mistralai_workflows/protocol/v1/tempo.py +79 -0
- mistralai_workflows/protocol/v1/worker.py +7 -0
- mistralai_workflows/protocol/v1/workflow.py +438 -0
- mistralai_workflows/py.typed +0 -0
- mistralai_workflows/scripts/dev_interactive_workflow_cli.py +999 -0
- mistralai_workflows/testing/__init__.py +85 -0
- mistralai_workflows/testing/constants.py +3 -0
- mistralai_workflows/testing/event_comparison.py +82 -0
- mistralai_workflows/testing/event_helpers.py +220 -0
- mistralai_workflows/testing/fixtures.py +58 -0
- mistralai_workflows/testing/test_worker.py +115 -0
- mistralai_workflows/testing/workflow_helpers.py +568 -0
- mistralai_workflows-2.0.0.dist-info/METADATA +121 -0
- mistralai_workflows-2.0.0.dist-info/RECORD +142 -0
- mistralai_workflows-2.0.0.dist-info/WHEEL +4 -0
- mistralai_workflows-2.0.0.dist-info/licenses/LICENSE +190 -0
|
@@ -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__
|