capo-lex-runtime-service 0.1.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.
Files changed (115) hide show
  1. capo_lex_runtime_service-0.1.0/LICENSE +21 -0
  2. capo_lex_runtime_service-0.1.0/PKG-INFO +124 -0
  3. capo_lex_runtime_service-0.1.0/README.md +98 -0
  4. capo_lex_runtime_service-0.1.0/pyproject.toml +60 -0
  5. capo_lex_runtime_service-0.1.0/setup.cfg +4 -0
  6. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/__init__.py +74 -0
  7. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/_async.py +25 -0
  8. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/_auth/_identity.py +16 -0
  9. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/_auth/_providers.py +886 -0
  10. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/_auth/_signers.py +88 -0
  11. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/_auth/_sigv4.py +434 -0
  12. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/_auth/_zapros_handler.py +80 -0
  13. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/_iter.py +113 -0
  14. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/_operations/aws_deep_sense_run_time_service/delete_session.py +174 -0
  15. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/_operations/aws_deep_sense_run_time_service/get_session.py +179 -0
  16. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/_operations/aws_deep_sense_run_time_service/post_content.py +317 -0
  17. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/_operations/aws_deep_sense_run_time_service/post_text.py +202 -0
  18. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/_operations/aws_deep_sense_run_time_service/put_session.py +264 -0
  19. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/_pagination.py +21 -0
  20. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/_protocol/__init__.py +1 -0
  21. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/_protocol/errors.py +93 -0
  22. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/_protocol/eventstream.py +238 -0
  23. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/_protocol/serialize.py +47 -0
  24. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/_protocol/xml.py +33 -0
  25. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/_rule_engine/__init__.py +0 -0
  26. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/_rule_engine/_aws_partition.py +160 -0
  27. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/_rule_engine/_endpoint_rule_set.py +191 -0
  28. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/_rule_engine/_endpoint_runtime.py +389 -0
  29. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/_services/_aws_config.py +160 -0
  30. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/_services/_pipeline.py +198 -0
  31. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/_services/async_lex_runtime_service.py +526 -0
  32. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/_services/lex_runtime_service.py +521 -0
  33. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/errors/__init__.py +42 -0
  34. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/errors/_base.py +94 -0
  35. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/errors/bad_gateway_exception.py +49 -0
  36. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/errors/bad_request_exception.py +49 -0
  37. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/errors/conflict_exception.py +49 -0
  38. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/errors/dependency_failed_exception.py +51 -0
  39. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/errors/internal_failure_exception.py +51 -0
  40. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/errors/limit_exceeded_exception.py +52 -0
  41. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/errors/loop_detected_exception.py +51 -0
  42. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/errors/not_acceptable_exception.py +51 -0
  43. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/errors/not_found_exception.py +49 -0
  44. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/errors/request_timeout_exception.py +51 -0
  45. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/errors/unsupported_media_type_exception.py +53 -0
  46. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/py.typed +0 -0
  47. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/_prelude/blob.py +12 -0
  48. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/_prelude/timestamp.py +17 -0
  49. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/accept.py +5 -0
  50. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/active_context.py +71 -0
  51. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/active_context_name.py +5 -0
  52. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/active_context_parameters_map.py +29 -0
  53. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/active_context_time_to_live.py +39 -0
  54. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/active_context_time_to_live_in_seconds.py +5 -0
  55. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/active_context_turns_to_live.py +5 -0
  56. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/active_contexts_list.py +31 -0
  57. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/blob_stream.py +7 -0
  58. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/bot_alias.py +5 -0
  59. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/bot_name.py +5 -0
  60. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/bot_version.py +5 -0
  61. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/button.py +39 -0
  62. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/button_text_string_with_length.py +5 -0
  63. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/button_value_string_with_length.py +5 -0
  64. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/confirmation_status.py +18 -0
  65. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/content_type.py +14 -0
  66. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/delete_session_request.py +30 -0
  67. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/delete_session_response.py +49 -0
  68. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/dialog_action.py +119 -0
  69. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/dialog_action_type.py +20 -0
  70. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/dialog_state.py +21 -0
  71. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/double.py +5 -0
  72. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/error_message.py +5 -0
  73. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/fulfillment_state.py +18 -0
  74. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/generic_attachment.py +72 -0
  75. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/generic_attachment_list.py +35 -0
  76. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/get_session_request.py +35 -0
  77. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/get_session_response.py +112 -0
  78. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/http_content_type.py +5 -0
  79. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/intent_confidence.py +37 -0
  80. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/intent_list.py +33 -0
  81. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/intent_name.py +5 -0
  82. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/intent_summary.py +125 -0
  83. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/intent_summary_checkpoint_label.py +5 -0
  84. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/intent_summary_list.py +31 -0
  85. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/list_of_buttons.py +29 -0
  86. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/message_format_type.py +19 -0
  87. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/parameter_name.py +5 -0
  88. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/post_content_request.py +42 -0
  89. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/post_content_response.py +76 -0
  90. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/post_text_request.py +102 -0
  91. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/post_text_response.py +233 -0
  92. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/predicted_intent.py +64 -0
  93. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/put_session_request.py +117 -0
  94. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/put_session_response.py +56 -0
  95. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/response_card.py +66 -0
  96. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/sensitive_string.py +5 -0
  97. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/sensitive_string_unbounded.py +5 -0
  98. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/sentiment_label.py +5 -0
  99. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/sentiment_response.py +39 -0
  100. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/sentiment_score.py +5 -0
  101. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/string.py +5 -0
  102. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/string_map.py +28 -0
  103. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/string_url_with_length.py +5 -0
  104. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/string_with_length.py +5 -0
  105. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/synthesized_json_active_contexts_string.py +5 -0
  106. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/synthesized_json_attributes_string.py +5 -0
  107. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/synthesized_json_string.py +5 -0
  108. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/text.py +5 -0
  109. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service/types/user_id.py +5 -0
  110. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service.egg-info/PKG-INFO +124 -0
  111. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service.egg-info/SOURCES.txt +113 -0
  112. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service.egg-info/dependency_links.txt +1 -0
  113. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service.egg-info/requires.txt +6 -0
  114. capo_lex_runtime_service-0.1.0/src/capo_lex_runtime_service.egg-info/top_level.txt +1 -0
  115. capo_lex_runtime_service-0.1.0/tests/test_sigv4.py +557 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Karen Petrosyan
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,124 @@
1
+ Metadata-Version: 2.4
2
+ Name: capo-lex-runtime-service
3
+ Version: 0.1.0
4
+ Summary: Python SDK for Lex Runtime Service.
5
+ Classifier: Development Status :: 4 - Beta
6
+ Classifier: Intended Audience :: Developers
7
+ Classifier: License :: OSI Approved :: MIT License
8
+ Classifier: Operating System :: OS Independent
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: Programming Language :: Python :: 3.10
11
+ Classifier: Programming Language :: Python :: 3.11
12
+ Classifier: Programming Language :: Python :: 3.12
13
+ Classifier: Programming Language :: Python :: 3.13
14
+ Classifier: Programming Language :: Python :: 3.14
15
+ Classifier: Topic :: Software Development :: Code Generators
16
+ Classifier: Typing :: Typed
17
+ Requires-Python: >=3.10
18
+ Description-Content-Type: text/markdown
19
+ License-File: LICENSE
20
+ Requires-Dist: zapros>=0.13.0
21
+ Provides-Extra: sso
22
+ Requires-Dist: capo-sso>=0.2.0; extra == "sso"
23
+ Requires-Dist: capo-sso-oidc>=0.2.0; extra == "sso"
24
+ Requires-Dist: capo-sts>=0.3.0; extra == "sso"
25
+ Dynamic: license-file
26
+
27
+ # Getting Started
28
+
29
+ ## Installation
30
+
31
+ ```
32
+ pip install capo-lex-runtime-service
33
+ ```
34
+
35
+ ## Usage
36
+
37
+ ```python
38
+ from capo_lex_runtime_service import AsyncLexRuntimeServiceClient
39
+
40
+
41
+ async def main():
42
+ async with AsyncLexRuntimeServiceClient() as lex_runtime_service:
43
+ # Example: call the delete_session operation
44
+ response = await lex_runtime_service.delete_session()
45
+ print(response["bot_name"])
46
+ ```
47
+
48
+ ## Streaming Request
49
+
50
+ Some operations accept a streaming request body. Pass an async iterator of `bytes` chunks, or the whole body as `bytes`, for the streaming parameter.
51
+
52
+ ```python
53
+ from capo_lex_runtime_service import AsyncLexRuntimeServiceClient
54
+
55
+
56
+ async def main():
57
+ async with AsyncLexRuntimeServiceClient() as lex_runtime_service:
58
+ # Example: call post_content with a streaming request body
59
+ async def chunks():
60
+ yield b'Hello, World!'
61
+
62
+ response = await lex_runtime_service.post_content(input_stream=chunks())
63
+ print(response)
64
+
65
+ # Or pass the whole body as bytes
66
+ response = await lex_runtime_service.post_content(input_stream=b'Hello, World!')
67
+ print(response)
68
+ ```
69
+
70
+ ## Streaming Response
71
+
72
+ Some operations return a streaming response body. Use the operation as an async context manager and iterate over the response field to read chunks.
73
+
74
+ ```python
75
+ from capo_lex_runtime_service import AsyncLexRuntimeServiceClient
76
+
77
+
78
+ async def main():
79
+ async with AsyncLexRuntimeServiceClient() as lex_runtime_service:
80
+ # Example: call post_content and read the streaming response
81
+ async with lex_runtime_service.post_content() as response:
82
+ async for chunk in response["audio_stream"]:
83
+ print(chunk)
84
+ ```
85
+
86
+ ## Error Handling
87
+
88
+ The SDK raises exceptions for errors returned by the API. Catch them to handle failures gracefully.
89
+
90
+ ```python
91
+ from capo_lex_runtime_service import AsyncLexRuntimeServiceClient
92
+ from capo_lex_runtime_service.error import BadRequestException
93
+
94
+
95
+ async def main():
96
+ async with AsyncLexRuntimeServiceClient() as lex_runtime_service:
97
+ try:
98
+ await lex_runtime_service.delete_session()
99
+ except BadRequestException as e:
100
+ print(f"Error: {e}")
101
+ print(e.data) # additional error data
102
+ ```
103
+
104
+ ## Retrying
105
+
106
+ The SDK retries failed operations automatically. Retry behaviour follows the Smithy specification: errors are retried based on their `is_retryable` and `is_throttling_error` attributes. Throttling errors use a longer base delay. Network-level failures (connection errors and timeouts) are also retried. Non-retryable errors, such as client errors without the `@retryable` trait, are raised immediately without further attempts.
107
+
108
+ The number of attempts defaults to 3 and can be changed at the client level via `retry_max_attempts`, or per call via `config_overrides`.
109
+
110
+ ```python
111
+ from capo_lex_runtime_service import AsyncLexRuntimeServiceClient
112
+
113
+
114
+ async def main():
115
+ async with AsyncLexRuntimeServiceClient() as lex_runtime_service:
116
+ # Default: 3 attempts for every operation
117
+ response = await lex_runtime_service.delete_session()
118
+
119
+ # Override per operation
120
+ response = await lex_runtime_service.delete_session(config_overrides={"retry_max_attempts": 5})
121
+
122
+ # Disable retries for this call
123
+ response = await lex_runtime_service.delete_session(config_overrides={"retry_max_attempts": 1})
124
+ ```
@@ -0,0 +1,98 @@
1
+ # Getting Started
2
+
3
+ ## Installation
4
+
5
+ ```
6
+ pip install capo-lex-runtime-service
7
+ ```
8
+
9
+ ## Usage
10
+
11
+ ```python
12
+ from capo_lex_runtime_service import AsyncLexRuntimeServiceClient
13
+
14
+
15
+ async def main():
16
+ async with AsyncLexRuntimeServiceClient() as lex_runtime_service:
17
+ # Example: call the delete_session operation
18
+ response = await lex_runtime_service.delete_session()
19
+ print(response["bot_name"])
20
+ ```
21
+
22
+ ## Streaming Request
23
+
24
+ Some operations accept a streaming request body. Pass an async iterator of `bytes` chunks, or the whole body as `bytes`, for the streaming parameter.
25
+
26
+ ```python
27
+ from capo_lex_runtime_service import AsyncLexRuntimeServiceClient
28
+
29
+
30
+ async def main():
31
+ async with AsyncLexRuntimeServiceClient() as lex_runtime_service:
32
+ # Example: call post_content with a streaming request body
33
+ async def chunks():
34
+ yield b'Hello, World!'
35
+
36
+ response = await lex_runtime_service.post_content(input_stream=chunks())
37
+ print(response)
38
+
39
+ # Or pass the whole body as bytes
40
+ response = await lex_runtime_service.post_content(input_stream=b'Hello, World!')
41
+ print(response)
42
+ ```
43
+
44
+ ## Streaming Response
45
+
46
+ Some operations return a streaming response body. Use the operation as an async context manager and iterate over the response field to read chunks.
47
+
48
+ ```python
49
+ from capo_lex_runtime_service import AsyncLexRuntimeServiceClient
50
+
51
+
52
+ async def main():
53
+ async with AsyncLexRuntimeServiceClient() as lex_runtime_service:
54
+ # Example: call post_content and read the streaming response
55
+ async with lex_runtime_service.post_content() as response:
56
+ async for chunk in response["audio_stream"]:
57
+ print(chunk)
58
+ ```
59
+
60
+ ## Error Handling
61
+
62
+ The SDK raises exceptions for errors returned by the API. Catch them to handle failures gracefully.
63
+
64
+ ```python
65
+ from capo_lex_runtime_service import AsyncLexRuntimeServiceClient
66
+ from capo_lex_runtime_service.error import BadRequestException
67
+
68
+
69
+ async def main():
70
+ async with AsyncLexRuntimeServiceClient() as lex_runtime_service:
71
+ try:
72
+ await lex_runtime_service.delete_session()
73
+ except BadRequestException as e:
74
+ print(f"Error: {e}")
75
+ print(e.data) # additional error data
76
+ ```
77
+
78
+ ## Retrying
79
+
80
+ The SDK retries failed operations automatically. Retry behaviour follows the Smithy specification: errors are retried based on their `is_retryable` and `is_throttling_error` attributes. Throttling errors use a longer base delay. Network-level failures (connection errors and timeouts) are also retried. Non-retryable errors, such as client errors without the `@retryable` trait, are raised immediately without further attempts.
81
+
82
+ The number of attempts defaults to 3 and can be changed at the client level via `retry_max_attempts`, or per call via `config_overrides`.
83
+
84
+ ```python
85
+ from capo_lex_runtime_service import AsyncLexRuntimeServiceClient
86
+
87
+
88
+ async def main():
89
+ async with AsyncLexRuntimeServiceClient() as lex_runtime_service:
90
+ # Default: 3 attempts for every operation
91
+ response = await lex_runtime_service.delete_session()
92
+
93
+ # Override per operation
94
+ response = await lex_runtime_service.delete_session(config_overrides={"retry_max_attempts": 5})
95
+
96
+ # Disable retries for this call
97
+ response = await lex_runtime_service.delete_session(config_overrides={"retry_max_attempts": 1})
98
+ ```
@@ -0,0 +1,60 @@
1
+ [project]
2
+ name = "capo-lex-runtime-service"
3
+ version = "0.1.0"
4
+ description = "Python SDK for Lex Runtime Service."
5
+ readme = "README.md"
6
+ requires-python = ">=3.10"
7
+ classifiers = [
8
+ "Development Status :: 4 - Beta",
9
+ "Intended Audience :: Developers",
10
+ "License :: OSI Approved :: MIT License",
11
+ "Operating System :: OS Independent",
12
+ "Programming Language :: Python :: 3",
13
+ "Programming Language :: Python :: 3.10",
14
+ "Programming Language :: Python :: 3.11",
15
+ "Programming Language :: Python :: 3.12",
16
+ "Programming Language :: Python :: 3.13",
17
+ "Programming Language :: Python :: 3.14",
18
+ "Topic :: Software Development :: Code Generators",
19
+ "Typing :: Typed",
20
+ ]
21
+ dependencies = [
22
+ "zapros>=0.13.0",
23
+ ]
24
+
25
+ [project.optional-dependencies]
26
+ # IAM Identity Center (SSO), assume-role and web-identity credentials providers
27
+ sso = [
28
+ "capo-sso>=0.2.0",
29
+ "capo-sso-oidc>=0.2.0",
30
+ "capo-sts>=0.3.0",
31
+ ]
32
+
33
+ [tool.pytest.ini_options]
34
+ pythonpath = ["src"]
35
+ testpaths = ["tests"]
36
+
37
+ [tool.ty.environment]
38
+ python-version = "3.14"
39
+ root = ["./src"]
40
+
41
+ [tool.ty.src]
42
+ include = ["src", "tests"]
43
+
44
+ [tool.ty.rules]
45
+ missing-typed-dict-key = "ignore"
46
+ unused-type-ignore-comment = "ignore"
47
+
48
+ [tool.ruff.lint]
49
+ select = ["E", "F", "I"]
50
+ ignore = ["E501", "E741"]
51
+
52
+ [dependency-groups]
53
+ dev = [
54
+ "inline-snapshot>=0.33.0",
55
+ # TODO: fix for 0.0.69
56
+ "ty==0.0.68",
57
+ "pytest>=9.0.3",
58
+ "ruff>=0.15.14",
59
+ "trio",
60
+ ]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,74 @@
1
+ from __future__ import annotations
2
+
3
+ from . import _iter as _iter
4
+ from . import _protocol as _protocol
5
+ from ._auth._identity import Credentials as Credentials
6
+ from ._auth._identity import Identity as Identity
7
+ from ._auth._providers import (
8
+ AssumeRoleCredentialsProvider as AssumeRoleCredentialsProvider,
9
+ )
10
+ from ._auth._providers import (
11
+ AssumeRoleError as AssumeRoleError,
12
+ )
13
+ from ._auth._providers import (
14
+ CachedProvider as CachedProvider,
15
+ )
16
+ from ._auth._providers import (
17
+ ChainedProvider as ChainedProvider,
18
+ )
19
+ from ._auth._providers import (
20
+ CredentialsProvider as CredentialsProvider,
21
+ )
22
+ from ._auth._providers import (
23
+ EnvCredentialsProvider as EnvCredentialsProvider,
24
+ )
25
+ from ._auth._providers import (
26
+ IdentityNotFound as IdentityNotFound,
27
+ )
28
+ from ._auth._providers import (
29
+ IdentityProvider as IdentityProvider,
30
+ )
31
+ from ._auth._providers import (
32
+ MissingDependencyError as MissingDependencyError,
33
+ )
34
+ from ._auth._providers import (
35
+ ProfileCredentialsProvider as ProfileCredentialsProvider,
36
+ )
37
+ from ._auth._providers import (
38
+ SsoCredentialsProvider as SsoCredentialsProvider,
39
+ )
40
+ from ._auth._providers import (
41
+ SSOError as SSOError,
42
+ )
43
+ from ._auth._providers import (
44
+ StaticAwsCredentialsProvider as StaticAwsCredentialsProvider,
45
+ )
46
+ from ._auth._providers import (
47
+ WebIdentityCredentialsProvider as WebIdentityCredentialsProvider,
48
+ )
49
+ from ._auth._signers import Signer as Signer
50
+ from ._auth._signers import SigV4Signer as SigV4Signer
51
+ from ._services._pipeline import (
52
+ AsyncOperationOptions as AsyncOperationOptions,
53
+ )
54
+ from ._services._pipeline import (
55
+ AsyncOperationRequest as AsyncOperationRequest,
56
+ )
57
+ from ._services._pipeline import (
58
+ AsyncOperationResponse as AsyncOperationResponse,
59
+ )
60
+ from ._services._pipeline import (
61
+ OperationOptions as OperationOptions,
62
+ )
63
+ from ._services._pipeline import (
64
+ OperationRequest as OperationRequest,
65
+ )
66
+ from ._services._pipeline import (
67
+ OperationResponse as OperationResponse,
68
+ )
69
+ from ._services.async_lex_runtime_service import (
70
+ AsyncLexRuntimeServiceClient as AsyncLexRuntimeServiceClient,
71
+ )
72
+ from ._services.lex_runtime_service import (
73
+ LexRuntimeServiceClient as LexRuntimeServiceClient,
74
+ )
@@ -0,0 +1,25 @@
1
+ from __future__ import annotations
2
+
3
+ import asyncio
4
+ from typing import TYPE_CHECKING
5
+
6
+ if TYPE_CHECKING:
7
+ import trio
8
+ else:
9
+ try:
10
+ import trio
11
+ except ImportError:
12
+ trio = None
13
+
14
+
15
+ def in_trio_run() -> bool:
16
+ if trio is None:
17
+ return False
18
+ return trio.lowlevel.in_trio_run()
19
+
20
+
21
+ async def anysleep(delay: float) -> None:
22
+ if in_trio_run():
23
+ await trio.sleep(delay)
24
+ else:
25
+ await asyncio.sleep(delay)
@@ -0,0 +1,16 @@
1
+ from __future__ import annotations
2
+
3
+ from datetime import datetime
4
+ from typing import TypedDict
5
+
6
+ from typing_extensions import NotRequired
7
+
8
+
9
+ class Identity(TypedDict):
10
+ expiration: NotRequired[datetime | None]
11
+
12
+
13
+ class Credentials(Identity):
14
+ access_key: str
15
+ secret_key: str
16
+ session_token: NotRequired[str | None]