mirascope 2.0.0a2__py3-none-any.whl → 2.0.0a3__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 (204) hide show
  1. mirascope/__init__.py +2 -2
  2. mirascope/api/__init__.py +6 -0
  3. mirascope/api/_generated/README.md +207 -0
  4. mirascope/api/_generated/__init__.py +85 -0
  5. mirascope/api/_generated/client.py +155 -0
  6. mirascope/api/_generated/core/__init__.py +52 -0
  7. mirascope/api/_generated/core/api_error.py +23 -0
  8. mirascope/api/_generated/core/client_wrapper.py +58 -0
  9. mirascope/api/_generated/core/datetime_utils.py +30 -0
  10. mirascope/api/_generated/core/file.py +70 -0
  11. mirascope/api/_generated/core/force_multipart.py +16 -0
  12. mirascope/api/_generated/core/http_client.py +619 -0
  13. mirascope/api/_generated/core/http_response.py +55 -0
  14. mirascope/api/_generated/core/jsonable_encoder.py +102 -0
  15. mirascope/api/_generated/core/pydantic_utilities.py +310 -0
  16. mirascope/api/_generated/core/query_encoder.py +60 -0
  17. mirascope/api/_generated/core/remove_none_from_dict.py +11 -0
  18. mirascope/api/_generated/core/request_options.py +35 -0
  19. mirascope/api/_generated/core/serialization.py +282 -0
  20. mirascope/api/_generated/docs/__init__.py +4 -0
  21. mirascope/api/_generated/docs/client.py +95 -0
  22. mirascope/api/_generated/docs/raw_client.py +132 -0
  23. mirascope/api/_generated/environment.py +9 -0
  24. mirascope/api/_generated/errors/__init__.py +7 -0
  25. mirascope/api/_generated/errors/bad_request_error.py +15 -0
  26. mirascope/api/_generated/health/__init__.py +7 -0
  27. mirascope/api/_generated/health/client.py +96 -0
  28. mirascope/api/_generated/health/raw_client.py +129 -0
  29. mirascope/api/_generated/health/types/__init__.py +8 -0
  30. mirascope/api/_generated/health/types/health_check_response.py +24 -0
  31. mirascope/api/_generated/health/types/health_check_response_status.py +5 -0
  32. mirascope/api/_generated/reference.md +167 -0
  33. mirascope/api/_generated/traces/__init__.py +55 -0
  34. mirascope/api/_generated/traces/client.py +162 -0
  35. mirascope/api/_generated/traces/raw_client.py +168 -0
  36. mirascope/api/_generated/traces/types/__init__.py +95 -0
  37. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item.py +36 -0
  38. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_resource.py +31 -0
  39. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_resource_attributes_item.py +25 -0
  40. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_resource_attributes_item_value.py +54 -0
  41. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_resource_attributes_item_value_array_value.py +23 -0
  42. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_resource_attributes_item_value_kvlist_value.py +28 -0
  43. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_resource_attributes_item_value_kvlist_value_values_item.py +24 -0
  44. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item.py +35 -0
  45. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_scope.py +35 -0
  46. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_scope_attributes_item.py +27 -0
  47. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_scope_attributes_item_value.py +54 -0
  48. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_scope_attributes_item_value_array_value.py +23 -0
  49. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_scope_attributes_item_value_kvlist_value.py +28 -0
  50. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_scope_attributes_item_value_kvlist_value_values_item.py +24 -0
  51. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_spans_item.py +60 -0
  52. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_spans_item_attributes_item.py +29 -0
  53. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_spans_item_attributes_item_value.py +54 -0
  54. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_spans_item_attributes_item_value_array_value.py +23 -0
  55. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_spans_item_attributes_item_value_kvlist_value.py +28 -0
  56. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_spans_item_attributes_item_value_kvlist_value_values_item.py +24 -0
  57. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_spans_item_status.py +24 -0
  58. mirascope/api/_generated/traces/types/traces_create_response.py +27 -0
  59. mirascope/api/_generated/traces/types/traces_create_response_partial_success.py +28 -0
  60. mirascope/api/_generated/types/__init__.py +21 -0
  61. mirascope/api/_generated/types/http_api_decode_error.py +31 -0
  62. mirascope/api/_generated/types/http_api_decode_error_tag.py +5 -0
  63. mirascope/api/_generated/types/issue.py +44 -0
  64. mirascope/api/_generated/types/issue_tag.py +17 -0
  65. mirascope/api/_generated/types/property_key.py +7 -0
  66. mirascope/api/_generated/types/property_key_tag.py +29 -0
  67. mirascope/api/_generated/types/property_key_tag_tag.py +5 -0
  68. mirascope/api/client.py +255 -0
  69. mirascope/api/settings.py +81 -0
  70. mirascope/llm/__init__.py +41 -11
  71. mirascope/llm/calls/calls.py +81 -57
  72. mirascope/llm/calls/decorator.py +121 -115
  73. mirascope/llm/content/__init__.py +3 -2
  74. mirascope/llm/context/_utils.py +19 -6
  75. mirascope/llm/exceptions.py +30 -16
  76. mirascope/llm/formatting/_utils.py +9 -5
  77. mirascope/llm/formatting/format.py +2 -2
  78. mirascope/llm/formatting/from_call_args.py +2 -2
  79. mirascope/llm/messages/message.py +13 -5
  80. mirascope/llm/models/__init__.py +2 -2
  81. mirascope/llm/models/models.py +189 -81
  82. mirascope/llm/prompts/__init__.py +13 -12
  83. mirascope/llm/prompts/_utils.py +27 -24
  84. mirascope/llm/prompts/decorator.py +133 -204
  85. mirascope/llm/prompts/prompts.py +424 -0
  86. mirascope/llm/prompts/protocols.py +25 -59
  87. mirascope/llm/providers/__init__.py +38 -0
  88. mirascope/llm/{clients → providers}/_missing_import_stubs.py +8 -6
  89. mirascope/llm/providers/anthropic/__init__.py +24 -0
  90. mirascope/llm/{clients → providers}/anthropic/_utils/decode.py +5 -4
  91. mirascope/llm/{clients → providers}/anthropic/_utils/encode.py +31 -10
  92. mirascope/llm/providers/anthropic/model_id.py +40 -0
  93. mirascope/llm/{clients/anthropic/clients.py → providers/anthropic/provider.py} +33 -418
  94. mirascope/llm/{clients → providers}/base/__init__.py +3 -3
  95. mirascope/llm/{clients → providers}/base/_utils.py +10 -7
  96. mirascope/llm/{clients/base/client.py → providers/base/base_provider.py} +255 -126
  97. mirascope/llm/providers/google/__init__.py +21 -0
  98. mirascope/llm/{clients → providers}/google/_utils/decode.py +6 -4
  99. mirascope/llm/{clients → providers}/google/_utils/encode.py +30 -24
  100. mirascope/llm/providers/google/model_id.py +28 -0
  101. mirascope/llm/providers/google/provider.py +438 -0
  102. mirascope/llm/providers/load_provider.py +48 -0
  103. mirascope/llm/providers/mlx/__init__.py +24 -0
  104. mirascope/llm/providers/mlx/_utils.py +107 -0
  105. mirascope/llm/providers/mlx/encoding/__init__.py +8 -0
  106. mirascope/llm/providers/mlx/encoding/base.py +69 -0
  107. mirascope/llm/providers/mlx/encoding/transformers.py +131 -0
  108. mirascope/llm/providers/mlx/mlx.py +237 -0
  109. mirascope/llm/providers/mlx/model_id.py +17 -0
  110. mirascope/llm/providers/mlx/provider.py +411 -0
  111. mirascope/llm/providers/model_id.py +16 -0
  112. mirascope/llm/providers/openai/__init__.py +6 -0
  113. mirascope/llm/providers/openai/completions/__init__.py +20 -0
  114. mirascope/llm/{clients/openai/responses → providers/openai/completions}/_utils/__init__.py +2 -0
  115. mirascope/llm/{clients → providers}/openai/completions/_utils/decode.py +5 -3
  116. mirascope/llm/{clients → providers}/openai/completions/_utils/encode.py +33 -23
  117. mirascope/llm/providers/openai/completions/provider.py +456 -0
  118. mirascope/llm/providers/openai/model_id.py +31 -0
  119. mirascope/llm/providers/openai/model_info.py +246 -0
  120. mirascope/llm/providers/openai/provider.py +386 -0
  121. mirascope/llm/providers/openai/responses/__init__.py +21 -0
  122. mirascope/llm/{clients → providers}/openai/responses/_utils/decode.py +5 -3
  123. mirascope/llm/{clients → providers}/openai/responses/_utils/encode.py +28 -17
  124. mirascope/llm/providers/openai/responses/provider.py +470 -0
  125. mirascope/llm/{clients → providers}/openai/shared/_utils.py +7 -3
  126. mirascope/llm/providers/provider_id.py +13 -0
  127. mirascope/llm/providers/provider_registry.py +167 -0
  128. mirascope/llm/responses/base_response.py +10 -5
  129. mirascope/llm/responses/base_stream_response.py +10 -5
  130. mirascope/llm/responses/response.py +24 -13
  131. mirascope/llm/responses/root_response.py +7 -12
  132. mirascope/llm/responses/stream_response.py +35 -23
  133. mirascope/llm/tools/__init__.py +9 -2
  134. mirascope/llm/tools/_utils.py +12 -3
  135. mirascope/llm/tools/protocols.py +4 -4
  136. mirascope/llm/tools/tool_schema.py +44 -9
  137. mirascope/llm/tools/tools.py +10 -9
  138. mirascope/ops/__init__.py +156 -0
  139. mirascope/ops/_internal/__init__.py +5 -0
  140. mirascope/ops/_internal/closure.py +1118 -0
  141. mirascope/ops/_internal/configuration.py +126 -0
  142. mirascope/ops/_internal/context.py +76 -0
  143. mirascope/ops/_internal/exporters/__init__.py +26 -0
  144. mirascope/ops/_internal/exporters/exporters.py +342 -0
  145. mirascope/ops/_internal/exporters/processors.py +104 -0
  146. mirascope/ops/_internal/exporters/types.py +165 -0
  147. mirascope/ops/_internal/exporters/utils.py +29 -0
  148. mirascope/ops/_internal/instrumentation/__init__.py +8 -0
  149. mirascope/ops/_internal/instrumentation/llm/__init__.py +8 -0
  150. mirascope/ops/_internal/instrumentation/llm/encode.py +238 -0
  151. mirascope/ops/_internal/instrumentation/llm/gen_ai_types/__init__.py +38 -0
  152. mirascope/ops/_internal/instrumentation/llm/gen_ai_types/gen_ai_input_messages.py +31 -0
  153. mirascope/ops/_internal/instrumentation/llm/gen_ai_types/gen_ai_output_messages.py +38 -0
  154. mirascope/ops/_internal/instrumentation/llm/gen_ai_types/gen_ai_system_instructions.py +18 -0
  155. mirascope/ops/_internal/instrumentation/llm/gen_ai_types/shared.py +100 -0
  156. mirascope/ops/_internal/instrumentation/llm/llm.py +1288 -0
  157. mirascope/ops/_internal/propagation.py +198 -0
  158. mirascope/ops/_internal/protocols.py +51 -0
  159. mirascope/ops/_internal/session.py +139 -0
  160. mirascope/ops/_internal/spans.py +232 -0
  161. mirascope/ops/_internal/traced_calls.py +371 -0
  162. mirascope/ops/_internal/traced_functions.py +394 -0
  163. mirascope/ops/_internal/tracing.py +276 -0
  164. mirascope/ops/_internal/types.py +13 -0
  165. mirascope/ops/_internal/utils.py +75 -0
  166. mirascope/ops/_internal/versioned_calls.py +512 -0
  167. mirascope/ops/_internal/versioned_functions.py +346 -0
  168. mirascope/ops/_internal/versioning.py +303 -0
  169. mirascope/ops/exceptions.py +21 -0
  170. {mirascope-2.0.0a2.dist-info → mirascope-2.0.0a3.dist-info}/METADATA +76 -1
  171. mirascope-2.0.0a3.dist-info/RECORD +206 -0
  172. {mirascope-2.0.0a2.dist-info → mirascope-2.0.0a3.dist-info}/WHEEL +1 -1
  173. mirascope/graphs/__init__.py +0 -22
  174. mirascope/graphs/finite_state_machine.py +0 -625
  175. mirascope/llm/agents/__init__.py +0 -15
  176. mirascope/llm/agents/agent.py +0 -97
  177. mirascope/llm/agents/agent_template.py +0 -45
  178. mirascope/llm/agents/decorator.py +0 -176
  179. mirascope/llm/calls/base_call.py +0 -33
  180. mirascope/llm/clients/__init__.py +0 -34
  181. mirascope/llm/clients/anthropic/__init__.py +0 -25
  182. mirascope/llm/clients/anthropic/model_ids.py +0 -8
  183. mirascope/llm/clients/google/__init__.py +0 -20
  184. mirascope/llm/clients/google/clients.py +0 -853
  185. mirascope/llm/clients/google/model_ids.py +0 -15
  186. mirascope/llm/clients/openai/__init__.py +0 -25
  187. mirascope/llm/clients/openai/completions/__init__.py +0 -28
  188. mirascope/llm/clients/openai/completions/_utils/model_features.py +0 -81
  189. mirascope/llm/clients/openai/completions/clients.py +0 -833
  190. mirascope/llm/clients/openai/completions/model_ids.py +0 -8
  191. mirascope/llm/clients/openai/responses/__init__.py +0 -26
  192. mirascope/llm/clients/openai/responses/_utils/model_features.py +0 -87
  193. mirascope/llm/clients/openai/responses/clients.py +0 -832
  194. mirascope/llm/clients/openai/responses/model_ids.py +0 -8
  195. mirascope/llm/clients/providers.py +0 -175
  196. mirascope-2.0.0a2.dist-info/RECORD +0 -102
  197. /mirascope/llm/{clients → providers}/anthropic/_utils/__init__.py +0 -0
  198. /mirascope/llm/{clients → providers}/base/kwargs.py +0 -0
  199. /mirascope/llm/{clients → providers}/base/params.py +0 -0
  200. /mirascope/llm/{clients → providers}/google/_utils/__init__.py +0 -0
  201. /mirascope/llm/{clients → providers}/google/message.py +0 -0
  202. /mirascope/llm/{clients/openai/completions → providers/openai/responses}/_utils/__init__.py +0 -0
  203. /mirascope/llm/{clients → providers}/openai/shared/__init__.py +0 -0
  204. {mirascope-2.0.0a2.dist-info → mirascope-2.0.0a3.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,129 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+ from json.decoder import JSONDecodeError
5
+
6
+ from ..core.api_error import ApiError
7
+ from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
8
+ from ..core.http_response import AsyncHttpResponse, HttpResponse
9
+ from ..core.pydantic_utilities import parse_obj_as
10
+ from ..core.request_options import RequestOptions
11
+ from ..errors.bad_request_error import BadRequestError
12
+ from ..types.http_api_decode_error import HttpApiDecodeError
13
+ from .types.health_check_response import HealthCheckResponse
14
+
15
+
16
+ class RawHealthClient:
17
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
18
+ self._client_wrapper = client_wrapper
19
+
20
+ def check(
21
+ self, *, request_options: typing.Optional[RequestOptions] = None
22
+ ) -> HttpResponse[HealthCheckResponse]:
23
+ """
24
+ Parameters
25
+ ----------
26
+ request_options : typing.Optional[RequestOptions]
27
+ Request-specific configuration.
28
+
29
+ Returns
30
+ -------
31
+ HttpResponse[HealthCheckResponse]
32
+ Success
33
+ """
34
+ _response = self._client_wrapper.httpx_client.request(
35
+ "health",
36
+ method="GET",
37
+ request_options=request_options,
38
+ )
39
+ try:
40
+ if 200 <= _response.status_code < 300:
41
+ _data = typing.cast(
42
+ HealthCheckResponse,
43
+ parse_obj_as(
44
+ type_=HealthCheckResponse, # type: ignore
45
+ object_=_response.json(),
46
+ ),
47
+ )
48
+ return HttpResponse(response=_response, data=_data)
49
+ if _response.status_code == 400:
50
+ raise BadRequestError(
51
+ headers=dict(_response.headers),
52
+ body=typing.cast(
53
+ HttpApiDecodeError,
54
+ parse_obj_as(
55
+ type_=HttpApiDecodeError, # type: ignore
56
+ object_=_response.json(),
57
+ ),
58
+ ),
59
+ )
60
+ _response_json = _response.json()
61
+ except JSONDecodeError:
62
+ raise ApiError(
63
+ status_code=_response.status_code,
64
+ headers=dict(_response.headers),
65
+ body=_response.text,
66
+ )
67
+ raise ApiError(
68
+ status_code=_response.status_code,
69
+ headers=dict(_response.headers),
70
+ body=_response_json,
71
+ )
72
+
73
+
74
+ class AsyncRawHealthClient:
75
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
76
+ self._client_wrapper = client_wrapper
77
+
78
+ async def check(
79
+ self, *, request_options: typing.Optional[RequestOptions] = None
80
+ ) -> AsyncHttpResponse[HealthCheckResponse]:
81
+ """
82
+ Parameters
83
+ ----------
84
+ request_options : typing.Optional[RequestOptions]
85
+ Request-specific configuration.
86
+
87
+ Returns
88
+ -------
89
+ AsyncHttpResponse[HealthCheckResponse]
90
+ Success
91
+ """
92
+ _response = await self._client_wrapper.httpx_client.request(
93
+ "health",
94
+ method="GET",
95
+ request_options=request_options,
96
+ )
97
+ try:
98
+ if 200 <= _response.status_code < 300:
99
+ _data = typing.cast(
100
+ HealthCheckResponse,
101
+ parse_obj_as(
102
+ type_=HealthCheckResponse, # type: ignore
103
+ object_=_response.json(),
104
+ ),
105
+ )
106
+ return AsyncHttpResponse(response=_response, data=_data)
107
+ if _response.status_code == 400:
108
+ raise BadRequestError(
109
+ headers=dict(_response.headers),
110
+ body=typing.cast(
111
+ HttpApiDecodeError,
112
+ parse_obj_as(
113
+ type_=HttpApiDecodeError, # type: ignore
114
+ object_=_response.json(),
115
+ ),
116
+ ),
117
+ )
118
+ _response_json = _response.json()
119
+ except JSONDecodeError:
120
+ raise ApiError(
121
+ status_code=_response.status_code,
122
+ headers=dict(_response.headers),
123
+ body=_response.text,
124
+ )
125
+ raise ApiError(
126
+ status_code=_response.status_code,
127
+ headers=dict(_response.headers),
128
+ body=_response_json,
129
+ )
@@ -0,0 +1,8 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ # isort: skip_file
4
+
5
+ from .health_check_response import HealthCheckResponse
6
+ from .health_check_response_status import HealthCheckResponseStatus
7
+
8
+ __all__ = ["HealthCheckResponse", "HealthCheckResponseStatus"]
@@ -0,0 +1,24 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+ from .health_check_response_status import HealthCheckResponseStatus
8
+
9
+
10
+ class HealthCheckResponse(UniversalBaseModel):
11
+ status: HealthCheckResponseStatus
12
+ timestamp: str
13
+ environment: str
14
+
15
+ if IS_PYDANTIC_V2:
16
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
17
+ extra="allow", frozen=True
18
+ ) # type: ignore # Pydantic v2
19
+ else:
20
+
21
+ class Config:
22
+ frozen = True
23
+ smart_union = True
24
+ extra = pydantic.Extra.allow
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ HealthCheckResponseStatus = typing.Union[typing.Literal["ok"], typing.Any]
@@ -0,0 +1,167 @@
1
+ # Reference
2
+ ## health
3
+ <details><summary><code>client.health.<a href="src/mirascope/health/client.py">check</a>()</code></summary>
4
+ <dl>
5
+ <dd>
6
+
7
+ #### 🔌 Usage
8
+
9
+ <dl>
10
+ <dd>
11
+
12
+ <dl>
13
+ <dd>
14
+
15
+ ```python
16
+ from mirascope.api._generated import Mirascope
17
+
18
+ client = Mirascope()
19
+ client.health.check()
20
+
21
+ ```
22
+ </dd>
23
+ </dl>
24
+ </dd>
25
+ </dl>
26
+
27
+ #### ⚙️ Parameters
28
+
29
+ <dl>
30
+ <dd>
31
+
32
+ <dl>
33
+ <dd>
34
+
35
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
36
+
37
+ </dd>
38
+ </dl>
39
+ </dd>
40
+ </dl>
41
+
42
+
43
+ </dd>
44
+ </dl>
45
+ </details>
46
+
47
+ ## traces
48
+ <details><summary><code>client.traces.<a href="src/mirascope/traces/client.py">create</a>(...)</code></summary>
49
+ <dl>
50
+ <dd>
51
+
52
+ #### 🔌 Usage
53
+
54
+ <dl>
55
+ <dd>
56
+
57
+ <dl>
58
+ <dd>
59
+
60
+ ```python
61
+ from mirascope.api._generated import Mirascope
62
+ from mirascope.api._generated.traces import (
63
+ TracesCreateRequestResourceSpansItem,
64
+ TracesCreateRequestResourceSpansItemScopeSpansItem,
65
+ TracesCreateRequestResourceSpansItemScopeSpansItemSpansItem,
66
+ )
67
+
68
+ client = Mirascope()
69
+ client.traces.create(
70
+ resource_spans=[
71
+ TracesCreateRequestResourceSpansItem(
72
+ scope_spans=[
73
+ TracesCreateRequestResourceSpansItemScopeSpansItem(
74
+ spans=[
75
+ TracesCreateRequestResourceSpansItemScopeSpansItemSpansItem(
76
+ trace_id="traceId",
77
+ span_id="spanId",
78
+ name="name",
79
+ start_time_unix_nano="startTimeUnixNano",
80
+ end_time_unix_nano="endTimeUnixNano",
81
+ )
82
+ ],
83
+ )
84
+ ],
85
+ )
86
+ ],
87
+ )
88
+
89
+ ```
90
+ </dd>
91
+ </dl>
92
+ </dd>
93
+ </dl>
94
+
95
+ #### ⚙️ Parameters
96
+
97
+ <dl>
98
+ <dd>
99
+
100
+ <dl>
101
+ <dd>
102
+
103
+ **resource_spans:** `typing.Sequence[TracesCreateRequestResourceSpansItem]`
104
+
105
+ </dd>
106
+ </dl>
107
+
108
+ <dl>
109
+ <dd>
110
+
111
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
112
+
113
+ </dd>
114
+ </dl>
115
+ </dd>
116
+ </dl>
117
+
118
+
119
+ </dd>
120
+ </dl>
121
+ </details>
122
+
123
+ ## docs
124
+ <details><summary><code>client.docs.<a href="src/mirascope/docs/client.py">openapi</a>()</code></summary>
125
+ <dl>
126
+ <dd>
127
+
128
+ #### 🔌 Usage
129
+
130
+ <dl>
131
+ <dd>
132
+
133
+ <dl>
134
+ <dd>
135
+
136
+ ```python
137
+ from mirascope.api._generated import Mirascope
138
+
139
+ client = Mirascope()
140
+ client.docs.openapi()
141
+
142
+ ```
143
+ </dd>
144
+ </dl>
145
+ </dd>
146
+ </dl>
147
+
148
+ #### ⚙️ Parameters
149
+
150
+ <dl>
151
+ <dd>
152
+
153
+ <dl>
154
+ <dd>
155
+
156
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
157
+
158
+ </dd>
159
+ </dl>
160
+ </dd>
161
+ </dl>
162
+
163
+
164
+ </dd>
165
+ </dl>
166
+ </details>
167
+
@@ -0,0 +1,55 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ # isort: skip_file
4
+
5
+ from .types import (
6
+ TracesCreateRequestResourceSpansItem,
7
+ TracesCreateRequestResourceSpansItemResource,
8
+ TracesCreateRequestResourceSpansItemResourceAttributesItem,
9
+ TracesCreateRequestResourceSpansItemResourceAttributesItemValue,
10
+ TracesCreateRequestResourceSpansItemResourceAttributesItemValueArrayValue,
11
+ TracesCreateRequestResourceSpansItemResourceAttributesItemValueKvlistValue,
12
+ TracesCreateRequestResourceSpansItemResourceAttributesItemValueKvlistValueValuesItem,
13
+ TracesCreateRequestResourceSpansItemScopeSpansItem,
14
+ TracesCreateRequestResourceSpansItemScopeSpansItemScope,
15
+ TracesCreateRequestResourceSpansItemScopeSpansItemScopeAttributesItem,
16
+ TracesCreateRequestResourceSpansItemScopeSpansItemScopeAttributesItemValue,
17
+ TracesCreateRequestResourceSpansItemScopeSpansItemScopeAttributesItemValueArrayValue,
18
+ TracesCreateRequestResourceSpansItemScopeSpansItemScopeAttributesItemValueKvlistValue,
19
+ TracesCreateRequestResourceSpansItemScopeSpansItemScopeAttributesItemValueKvlistValueValuesItem,
20
+ TracesCreateRequestResourceSpansItemScopeSpansItemSpansItem,
21
+ TracesCreateRequestResourceSpansItemScopeSpansItemSpansItemAttributesItem,
22
+ TracesCreateRequestResourceSpansItemScopeSpansItemSpansItemAttributesItemValue,
23
+ TracesCreateRequestResourceSpansItemScopeSpansItemSpansItemAttributesItemValueArrayValue,
24
+ TracesCreateRequestResourceSpansItemScopeSpansItemSpansItemAttributesItemValueKvlistValue,
25
+ TracesCreateRequestResourceSpansItemScopeSpansItemSpansItemAttributesItemValueKvlistValueValuesItem,
26
+ TracesCreateRequestResourceSpansItemScopeSpansItemSpansItemStatus,
27
+ TracesCreateResponse,
28
+ TracesCreateResponsePartialSuccess,
29
+ )
30
+
31
+ __all__ = [
32
+ "TracesCreateRequestResourceSpansItem",
33
+ "TracesCreateRequestResourceSpansItemResource",
34
+ "TracesCreateRequestResourceSpansItemResourceAttributesItem",
35
+ "TracesCreateRequestResourceSpansItemResourceAttributesItemValue",
36
+ "TracesCreateRequestResourceSpansItemResourceAttributesItemValueArrayValue",
37
+ "TracesCreateRequestResourceSpansItemResourceAttributesItemValueKvlistValue",
38
+ "TracesCreateRequestResourceSpansItemResourceAttributesItemValueKvlistValueValuesItem",
39
+ "TracesCreateRequestResourceSpansItemScopeSpansItem",
40
+ "TracesCreateRequestResourceSpansItemScopeSpansItemScope",
41
+ "TracesCreateRequestResourceSpansItemScopeSpansItemScopeAttributesItem",
42
+ "TracesCreateRequestResourceSpansItemScopeSpansItemScopeAttributesItemValue",
43
+ "TracesCreateRequestResourceSpansItemScopeSpansItemScopeAttributesItemValueArrayValue",
44
+ "TracesCreateRequestResourceSpansItemScopeSpansItemScopeAttributesItemValueKvlistValue",
45
+ "TracesCreateRequestResourceSpansItemScopeSpansItemScopeAttributesItemValueKvlistValueValuesItem",
46
+ "TracesCreateRequestResourceSpansItemScopeSpansItemSpansItem",
47
+ "TracesCreateRequestResourceSpansItemScopeSpansItemSpansItemAttributesItem",
48
+ "TracesCreateRequestResourceSpansItemScopeSpansItemSpansItemAttributesItemValue",
49
+ "TracesCreateRequestResourceSpansItemScopeSpansItemSpansItemAttributesItemValueArrayValue",
50
+ "TracesCreateRequestResourceSpansItemScopeSpansItemSpansItemAttributesItemValueKvlistValue",
51
+ "TracesCreateRequestResourceSpansItemScopeSpansItemSpansItemAttributesItemValueKvlistValueValuesItem",
52
+ "TracesCreateRequestResourceSpansItemScopeSpansItemSpansItemStatus",
53
+ "TracesCreateResponse",
54
+ "TracesCreateResponsePartialSuccess",
55
+ ]
@@ -0,0 +1,162 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
6
+ from ..core.request_options import RequestOptions
7
+ from .raw_client import AsyncRawTracesClient, RawTracesClient
8
+ from .types.traces_create_request_resource_spans_item import (
9
+ TracesCreateRequestResourceSpansItem,
10
+ )
11
+ from .types.traces_create_response import TracesCreateResponse
12
+
13
+ # this is used as the default value for optional parameters
14
+ OMIT = typing.cast(typing.Any, ...)
15
+
16
+
17
+ class TracesClient:
18
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
19
+ self._raw_client = RawTracesClient(client_wrapper=client_wrapper)
20
+
21
+ @property
22
+ def with_raw_response(self) -> RawTracesClient:
23
+ """
24
+ Retrieves a raw implementation of this client that returns raw responses.
25
+
26
+ Returns
27
+ -------
28
+ RawTracesClient
29
+ """
30
+ return self._raw_client
31
+
32
+ def create(
33
+ self,
34
+ *,
35
+ resource_spans: typing.Sequence[TracesCreateRequestResourceSpansItem],
36
+ request_options: typing.Optional[RequestOptions] = None,
37
+ ) -> TracesCreateResponse:
38
+ """
39
+ Parameters
40
+ ----------
41
+ resource_spans : typing.Sequence[TracesCreateRequestResourceSpansItem]
42
+
43
+ request_options : typing.Optional[RequestOptions]
44
+ Request-specific configuration.
45
+
46
+ Returns
47
+ -------
48
+ TracesCreateResponse
49
+ Success
50
+
51
+ Examples
52
+ --------
53
+ from mirascope.api._generated import Mirascope
54
+ from mirascope.api._generated.traces import (
55
+ TracesCreateRequestResourceSpansItem,
56
+ TracesCreateRequestResourceSpansItemScopeSpansItem,
57
+ TracesCreateRequestResourceSpansItemScopeSpansItemSpansItem,
58
+ )
59
+
60
+ client = Mirascope()
61
+ client.traces.create(
62
+ resource_spans=[
63
+ TracesCreateRequestResourceSpansItem(
64
+ scope_spans=[
65
+ TracesCreateRequestResourceSpansItemScopeSpansItem(
66
+ spans=[
67
+ TracesCreateRequestResourceSpansItemScopeSpansItemSpansItem(
68
+ trace_id="traceId",
69
+ span_id="spanId",
70
+ name="name",
71
+ start_time_unix_nano="startTimeUnixNano",
72
+ end_time_unix_nano="endTimeUnixNano",
73
+ )
74
+ ],
75
+ )
76
+ ],
77
+ )
78
+ ],
79
+ )
80
+ """
81
+ _response = self._raw_client.create(
82
+ resource_spans=resource_spans, request_options=request_options
83
+ )
84
+ return _response.data
85
+
86
+
87
+ class AsyncTracesClient:
88
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
89
+ self._raw_client = AsyncRawTracesClient(client_wrapper=client_wrapper)
90
+
91
+ @property
92
+ def with_raw_response(self) -> AsyncRawTracesClient:
93
+ """
94
+ Retrieves a raw implementation of this client that returns raw responses.
95
+
96
+ Returns
97
+ -------
98
+ AsyncRawTracesClient
99
+ """
100
+ return self._raw_client
101
+
102
+ async def create(
103
+ self,
104
+ *,
105
+ resource_spans: typing.Sequence[TracesCreateRequestResourceSpansItem],
106
+ request_options: typing.Optional[RequestOptions] = None,
107
+ ) -> TracesCreateResponse:
108
+ """
109
+ Parameters
110
+ ----------
111
+ resource_spans : typing.Sequence[TracesCreateRequestResourceSpansItem]
112
+
113
+ request_options : typing.Optional[RequestOptions]
114
+ Request-specific configuration.
115
+
116
+ Returns
117
+ -------
118
+ TracesCreateResponse
119
+ Success
120
+
121
+ Examples
122
+ --------
123
+ import asyncio
124
+
125
+ from mirascope.api._generated import AsyncMirascope
126
+ from mirascope.api._generated.traces import (
127
+ TracesCreateRequestResourceSpansItem,
128
+ TracesCreateRequestResourceSpansItemScopeSpansItem,
129
+ TracesCreateRequestResourceSpansItemScopeSpansItemSpansItem,
130
+ )
131
+
132
+ client = AsyncMirascope()
133
+
134
+
135
+ async def main() -> None:
136
+ await client.traces.create(
137
+ resource_spans=[
138
+ TracesCreateRequestResourceSpansItem(
139
+ scope_spans=[
140
+ TracesCreateRequestResourceSpansItemScopeSpansItem(
141
+ spans=[
142
+ TracesCreateRequestResourceSpansItemScopeSpansItemSpansItem(
143
+ trace_id="traceId",
144
+ span_id="spanId",
145
+ name="name",
146
+ start_time_unix_nano="startTimeUnixNano",
147
+ end_time_unix_nano="endTimeUnixNano",
148
+ )
149
+ ],
150
+ )
151
+ ],
152
+ )
153
+ ],
154
+ )
155
+
156
+
157
+ asyncio.run(main())
158
+ """
159
+ _response = await self._raw_client.create(
160
+ resource_spans=resource_spans, request_options=request_options
161
+ )
162
+ return _response.data