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.
Files changed (142) hide show
  1. mistralai_workflows/__init__.py +46 -0
  2. mistralai_workflows/client.py +979 -0
  3. mistralai_workflows/common/models.py +67 -0
  4. mistralai_workflows/constants.py +2 -0
  5. mistralai_workflows/core/__init__.py +1 -0
  6. mistralai_workflows/core/activity.py +448 -0
  7. mistralai_workflows/core/config/__init__.py +6 -0
  8. mistralai_workflows/core/config/config.py +385 -0
  9. mistralai_workflows/core/config/config_discovery.py +78 -0
  10. mistralai_workflows/core/definition/__init__.py +1 -0
  11. mistralai_workflows/core/definition/validation/__init__.py +1 -0
  12. mistralai_workflows/core/definition/validation/parameter_conversion.py +63 -0
  13. mistralai_workflows/core/definition/validation/schema_generator.py +120 -0
  14. mistralai_workflows/core/definition/validation/validator.py +286 -0
  15. mistralai_workflows/core/definition/workflow_definition.py +26 -0
  16. mistralai_workflows/core/dependencies/__init__.py +6 -0
  17. mistralai_workflows/core/dependencies/dependency_injector.py +182 -0
  18. mistralai_workflows/core/encoding/__init__.py +1 -0
  19. mistralai_workflows/core/encoding/fields_offloader.py +187 -0
  20. mistralai_workflows/core/encoding/payload_encoder.py +349 -0
  21. mistralai_workflows/core/events/__init__.py +1 -0
  22. mistralai_workflows/core/events/event_activities.py +241 -0
  23. mistralai_workflows/core/events/event_context.py +185 -0
  24. mistralai_workflows/core/events/event_interceptor.py +207 -0
  25. mistralai_workflows/core/events/event_utils.py +101 -0
  26. mistralai_workflows/core/events/json_patch.py +98 -0
  27. mistralai_workflows/core/execution/__init__.py +1 -0
  28. mistralai_workflows/core/execution/concurrency/__init__.py +16 -0
  29. mistralai_workflows/core/execution/concurrency/concurrency_workflow.py +49 -0
  30. mistralai_workflows/core/execution/concurrency/execute_activities_in_batch.py +38 -0
  31. mistralai_workflows/core/execution/concurrency/execute_activities_in_parallel.py +275 -0
  32. mistralai_workflows/core/execution/concurrency/executors/__init__.py +11 -0
  33. mistralai_workflows/core/execution/concurrency/executors/chain_executor.py +84 -0
  34. mistralai_workflows/core/execution/concurrency/executors/list_executor.py +89 -0
  35. mistralai_workflows/core/execution/concurrency/executors/offset_pagination_executor.py +91 -0
  36. mistralai_workflows/core/execution/concurrency/run_in_batches.py +84 -0
  37. mistralai_workflows/core/execution/concurrency/types.py +103 -0
  38. mistralai_workflows/core/execution/concurrency/utils.py +15 -0
  39. mistralai_workflows/core/execution/local_activity.py +36 -0
  40. mistralai_workflows/core/execution/sticky_session/__init__.py +0 -0
  41. mistralai_workflows/core/execution/sticky_session/get_sticky_worker_session.py +67 -0
  42. mistralai_workflows/core/execution/sticky_session/run_sticky_worker_session.py +71 -0
  43. mistralai_workflows/core/execution/sticky_session/sticky_worker_session.py +29 -0
  44. mistralai_workflows/core/execution/workflow_execution.py +101 -0
  45. mistralai_workflows/core/interactive_workflow.py +241 -0
  46. mistralai_workflows/core/logging.py +123 -0
  47. mistralai_workflows/core/rate_limiting/__init__.py +6 -0
  48. mistralai_workflows/core/rate_limiting/rate_limit.py +121 -0
  49. mistralai_workflows/core/storage/__init__.py +1 -0
  50. mistralai_workflows/core/storage/blob_storage.py +103 -0
  51. mistralai_workflows/core/storage/blob_storage_impl.py +333 -0
  52. mistralai_workflows/core/task/__init__.py +11 -0
  53. mistralai_workflows/core/task/create_task.py +127 -0
  54. mistralai_workflows/core/task/protocol.py +40 -0
  55. mistralai_workflows/core/task/task.py +237 -0
  56. mistralai_workflows/core/temporal/__init__.py +1 -0
  57. mistralai_workflows/core/temporal/activity_offloading_interceptor.py +54 -0
  58. mistralai_workflows/core/temporal/context_handler_interceptor.py +203 -0
  59. mistralai_workflows/core/temporal/payload_codec.py +120 -0
  60. mistralai_workflows/core/temporal/payload_converter.py +82 -0
  61. mistralai_workflows/core/temporal/temporal_client.py +117 -0
  62. mistralai_workflows/core/tracing/__init__.py +1 -0
  63. mistralai_workflows/core/tracing/init_tracing.py +81 -0
  64. mistralai_workflows/core/tracing/otel_config.py +138 -0
  65. mistralai_workflows/core/tracing/temporal_tracing_interceptor.py +280 -0
  66. mistralai_workflows/core/tracing/utils.py +282 -0
  67. mistralai_workflows/core/utils/__init__.py +12 -0
  68. mistralai_workflows/core/utils/cache.py +118 -0
  69. mistralai_workflows/core/utils/contextvars.py +41 -0
  70. mistralai_workflows/core/utils/id_generator.py +22 -0
  71. mistralai_workflows/core/worker.py +458 -0
  72. mistralai_workflows/core/workflow.py +614 -0
  73. mistralai_workflows/examples/__init__.py +0 -0
  74. mistralai_workflows/examples/all_workflows_worker.py +128 -0
  75. mistralai_workflows/examples/assist/__init__.py +0 -0
  76. mistralai_workflows/examples/assist/workflow_agent_tool_kwargs.py +209 -0
  77. mistralai_workflows/examples/assist/workflow_chat_parse.py +59 -0
  78. mistralai_workflows/examples/assist/workflow_embeddings.py +55 -0
  79. mistralai_workflows/examples/assist/workflow_example.py +49 -0
  80. mistralai_workflows/examples/assist/workflow_extract_markdown.py +56 -0
  81. mistralai_workflows/examples/assist/workflow_insurance_claims.py +212 -0
  82. mistralai_workflows/examples/assist/workflow_local_session_streaming.py +77 -0
  83. mistralai_workflows/examples/assist/workflow_multi_turn_chat.py +69 -0
  84. mistralai_workflows/examples/assist/workflow_pokemon_personality.py +163 -0
  85. mistralai_workflows/examples/assist/workflow_rfc_builder.py +269 -0
  86. mistralai_workflows/examples/assist/workflow_travel_agent_streaming.py +155 -0
  87. mistralai_workflows/examples/assist/workflow_with_agent.py +446 -0
  88. mistralai_workflows/examples/interactive_workflow_example.py +160 -0
  89. mistralai_workflows/examples/old_workflow_insurance_claims.py +298 -0
  90. mistralai_workflows/examples/old_workflow_multi_turn_chat.py +169 -0
  91. mistralai_workflows/examples/worker_example.py +29 -0
  92. mistralai_workflows/examples/workflow_activity_kwargs.py +125 -0
  93. mistralai_workflows/examples/workflow_activity_optional_arg.py +20 -0
  94. mistralai_workflows/examples/workflow_example.py +78 -0
  95. mistralai_workflows/examples/workflow_example_different_task_queue.py +45 -0
  96. mistralai_workflows/examples/workflow_streaming_examples.py +153 -0
  97. mistralai_workflows/examples/workflow_utf8_encoding.py +34 -0
  98. mistralai_workflows/examples/workflow_validation_test.py +59 -0
  99. mistralai_workflows/examples/workflow_with_concurrency.py +157 -0
  100. mistralai_workflows/examples/workflow_with_continue_as_new.py +92 -0
  101. mistralai_workflows/examples/workflow_with_dependency_injection_example.py +85 -0
  102. mistralai_workflows/examples/workflow_with_local_activities.py +100 -0
  103. mistralai_workflows/examples/workflow_with_nested_input.py +77 -0
  104. mistralai_workflows/examples/workflow_with_rate_limit.py +180 -0
  105. mistralai_workflows/examples/workflow_with_schedule.py +49 -0
  106. mistralai_workflows/examples/workflow_with_signals_and_queries.py +270 -0
  107. mistralai_workflows/examples/workflow_with_sub_workflow.py +43 -0
  108. mistralai_workflows/examples/workflow_with_update.py +105 -0
  109. mistralai_workflows/examples/workflow_worker_versioning_example.py +97 -0
  110. mistralai_workflows/exceptions.py +196 -0
  111. mistralai_workflows/exports.py +78 -0
  112. mistralai_workflows/models/__init__.py +71 -0
  113. mistralai_workflows/models/attributes.py +34 -0
  114. mistralai_workflows/models/events.py +35 -0
  115. mistralai_workflows/models/handlers.py +41 -0
  116. mistralai_workflows/models/payload.py +99 -0
  117. mistralai_workflows/models/schedule.py +158 -0
  118. mistralai_workflows/models/storage.py +21 -0
  119. mistralai_workflows/models/workflow.py +93 -0
  120. mistralai_workflows/plugins/README.md +13 -0
  121. mistralai_workflows/plugins/_discovery.py +27 -0
  122. mistralai_workflows/protocol/__init__.py +0 -0
  123. mistralai_workflows/protocol/v1/__init__.py +0 -0
  124. mistralai_workflows/protocol/v1/events.py +757 -0
  125. mistralai_workflows/protocol/v1/namespace.py +12 -0
  126. mistralai_workflows/protocol/v1/streaming.py +83 -0
  127. mistralai_workflows/protocol/v1/tempo.py +79 -0
  128. mistralai_workflows/protocol/v1/worker.py +7 -0
  129. mistralai_workflows/protocol/v1/workflow.py +438 -0
  130. mistralai_workflows/py.typed +0 -0
  131. mistralai_workflows/scripts/dev_interactive_workflow_cli.py +999 -0
  132. mistralai_workflows/testing/__init__.py +85 -0
  133. mistralai_workflows/testing/constants.py +3 -0
  134. mistralai_workflows/testing/event_comparison.py +82 -0
  135. mistralai_workflows/testing/event_helpers.py +220 -0
  136. mistralai_workflows/testing/fixtures.py +58 -0
  137. mistralai_workflows/testing/test_worker.py +115 -0
  138. mistralai_workflows/testing/workflow_helpers.py +568 -0
  139. mistralai_workflows-2.0.0.dist-info/METADATA +121 -0
  140. mistralai_workflows-2.0.0.dist-info/RECORD +142 -0
  141. mistralai_workflows-2.0.0.dist-info/WHEEL +4 -0
  142. 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__