mirascope 2.0.0a4__py3-none-any.whl → 2.0.0a6__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 (215) hide show
  1. mirascope/__init__.py +10 -1
  2. mirascope/_stubs.py +363 -0
  3. mirascope/api/__init__.py +8 -0
  4. mirascope/api/_generated/__init__.py +119 -1
  5. mirascope/api/_generated/annotations/__init__.py +33 -0
  6. mirascope/api/_generated/annotations/client.py +474 -0
  7. mirascope/api/_generated/annotations/raw_client.py +1095 -0
  8. mirascope/api/_generated/annotations/types/__init__.py +31 -0
  9. mirascope/api/_generated/annotations/types/annotations_create_request_label.py +5 -0
  10. mirascope/api/_generated/annotations/types/annotations_create_response.py +35 -0
  11. mirascope/api/_generated/annotations/types/annotations_create_response_label.py +5 -0
  12. mirascope/api/_generated/annotations/types/annotations_get_response.py +35 -0
  13. mirascope/api/_generated/annotations/types/annotations_get_response_label.py +5 -0
  14. mirascope/api/_generated/annotations/types/annotations_list_request_label.py +5 -0
  15. mirascope/api/_generated/annotations/types/annotations_list_response.py +21 -0
  16. mirascope/api/_generated/annotations/types/annotations_list_response_annotations_item.py +35 -0
  17. mirascope/api/_generated/annotations/types/annotations_list_response_annotations_item_label.py +5 -0
  18. mirascope/api/_generated/annotations/types/annotations_update_request_label.py +5 -0
  19. mirascope/api/_generated/annotations/types/annotations_update_response.py +35 -0
  20. mirascope/api/_generated/annotations/types/annotations_update_response_label.py +5 -0
  21. mirascope/api/_generated/api_keys/__init__.py +7 -0
  22. mirascope/api/_generated/api_keys/client.py +429 -0
  23. mirascope/api/_generated/api_keys/raw_client.py +788 -0
  24. mirascope/api/_generated/api_keys/types/__init__.py +9 -0
  25. mirascope/api/_generated/api_keys/types/api_keys_create_response.py +28 -0
  26. mirascope/api/_generated/api_keys/types/api_keys_get_response.py +27 -0
  27. mirascope/api/_generated/api_keys/types/api_keys_list_response_item.py +27 -0
  28. mirascope/api/_generated/client.py +12 -0
  29. mirascope/api/_generated/core/client_wrapper.py +2 -14
  30. mirascope/api/_generated/core/datetime_utils.py +1 -3
  31. mirascope/api/_generated/core/file.py +2 -5
  32. mirascope/api/_generated/core/http_client.py +36 -112
  33. mirascope/api/_generated/core/jsonable_encoder.py +1 -3
  34. mirascope/api/_generated/core/pydantic_utilities.py +19 -74
  35. mirascope/api/_generated/core/query_encoder.py +1 -3
  36. mirascope/api/_generated/core/serialization.py +4 -10
  37. mirascope/api/_generated/docs/client.py +2 -6
  38. mirascope/api/_generated/docs/raw_client.py +4 -20
  39. mirascope/api/_generated/environments/__init__.py +17 -0
  40. mirascope/api/_generated/environments/client.py +500 -0
  41. mirascope/api/_generated/environments/raw_client.py +999 -0
  42. mirascope/api/_generated/environments/types/__init__.py +15 -0
  43. mirascope/api/_generated/environments/types/environments_create_response.py +24 -0
  44. mirascope/api/_generated/environments/types/environments_get_response.py +24 -0
  45. mirascope/api/_generated/environments/types/environments_list_response_item.py +24 -0
  46. mirascope/api/_generated/environments/types/environments_update_response.py +24 -0
  47. mirascope/api/_generated/errors/__init__.py +2 -0
  48. mirascope/api/_generated/errors/bad_request_error.py +1 -5
  49. mirascope/api/_generated/errors/conflict_error.py +1 -5
  50. mirascope/api/_generated/errors/forbidden_error.py +1 -5
  51. mirascope/api/_generated/errors/internal_server_error.py +1 -6
  52. mirascope/api/_generated/errors/not_found_error.py +1 -5
  53. mirascope/api/_generated/errors/unauthorized_error.py +11 -0
  54. mirascope/api/_generated/functions/__init__.py +29 -0
  55. mirascope/api/_generated/functions/client.py +433 -0
  56. mirascope/api/_generated/functions/raw_client.py +1049 -0
  57. mirascope/api/_generated/functions/types/__init__.py +29 -0
  58. mirascope/api/_generated/functions/types/functions_create_request_dependencies_value.py +20 -0
  59. mirascope/api/_generated/functions/types/functions_create_response.py +37 -0
  60. mirascope/api/_generated/functions/types/functions_create_response_dependencies_value.py +20 -0
  61. mirascope/api/_generated/functions/types/functions_find_by_hash_response.py +39 -0
  62. mirascope/api/_generated/functions/types/functions_find_by_hash_response_dependencies_value.py +20 -0
  63. mirascope/api/_generated/functions/types/functions_get_response.py +37 -0
  64. mirascope/api/_generated/functions/types/functions_get_response_dependencies_value.py +20 -0
  65. mirascope/api/_generated/functions/types/functions_list_response.py +21 -0
  66. mirascope/api/_generated/functions/types/functions_list_response_functions_item.py +41 -0
  67. mirascope/api/_generated/functions/types/functions_list_response_functions_item_dependencies_value.py +20 -0
  68. mirascope/api/_generated/health/client.py +2 -6
  69. mirascope/api/_generated/health/raw_client.py +5 -23
  70. mirascope/api/_generated/health/types/health_check_response.py +1 -3
  71. mirascope/api/_generated/organizations/__init__.py +2 -0
  72. mirascope/api/_generated/organizations/client.py +94 -27
  73. mirascope/api/_generated/organizations/raw_client.py +246 -128
  74. mirascope/api/_generated/organizations/types/__init__.py +2 -0
  75. mirascope/api/_generated/organizations/types/organizations_create_response.py +5 -3
  76. mirascope/api/_generated/organizations/types/organizations_create_response_role.py +1 -3
  77. mirascope/api/_generated/organizations/types/organizations_credits_response.py +19 -0
  78. mirascope/api/_generated/organizations/types/organizations_get_response.py +5 -3
  79. mirascope/api/_generated/organizations/types/organizations_get_response_role.py +1 -3
  80. mirascope/api/_generated/organizations/types/organizations_list_response_item.py +5 -3
  81. mirascope/api/_generated/organizations/types/organizations_list_response_item_role.py +1 -3
  82. mirascope/api/_generated/organizations/types/organizations_update_response.py +5 -3
  83. mirascope/api/_generated/organizations/types/organizations_update_response_role.py +1 -3
  84. mirascope/api/_generated/projects/__init__.py +2 -12
  85. mirascope/api/_generated/projects/client.py +38 -68
  86. mirascope/api/_generated/projects/raw_client.py +92 -163
  87. mirascope/api/_generated/projects/types/__init__.py +1 -6
  88. mirascope/api/_generated/projects/types/projects_create_response.py +4 -9
  89. mirascope/api/_generated/projects/types/projects_get_response.py +4 -9
  90. mirascope/api/_generated/projects/types/projects_list_response_item.py +4 -9
  91. mirascope/api/_generated/projects/types/projects_update_response.py +4 -9
  92. mirascope/api/_generated/reference.md +1862 -70
  93. mirascope/api/_generated/traces/__init__.py +22 -0
  94. mirascope/api/_generated/traces/client.py +398 -0
  95. mirascope/api/_generated/traces/raw_client.py +902 -18
  96. mirascope/api/_generated/traces/types/__init__.py +32 -0
  97. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item.py +4 -11
  98. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_resource.py +2 -6
  99. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_resource_attributes_item.py +1 -3
  100. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_resource_attributes_item_value.py +8 -24
  101. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_resource_attributes_item_value_array_value.py +2 -6
  102. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_resource_attributes_item_value_kvlist_value.py +3 -9
  103. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_resource_attributes_item_value_kvlist_value_values_item.py +2 -6
  104. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item.py +3 -9
  105. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_scope.py +4 -8
  106. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_scope_attributes_item.py +2 -6
  107. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_scope_attributes_item_value.py +8 -24
  108. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_scope_attributes_item_value_array_value.py +2 -6
  109. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_scope_attributes_item_value_kvlist_value.py +3 -9
  110. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_scope_attributes_item_value_kvlist_value_values_item.py +1 -3
  111. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_spans_item.py +6 -18
  112. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_spans_item_attributes_item.py +3 -9
  113. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_spans_item_attributes_item_value.py +8 -24
  114. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_spans_item_attributes_item_value_array_value.py +2 -6
  115. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_spans_item_attributes_item_value_kvlist_value.py +2 -6
  116. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_spans_item_attributes_item_value_kvlist_value_values_item.py +1 -3
  117. mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_spans_item_status.py +2 -6
  118. mirascope/api/_generated/traces/types/traces_create_response.py +2 -5
  119. mirascope/api/_generated/traces/types/traces_create_response_partial_success.py +3 -9
  120. mirascope/api/_generated/traces/types/traces_get_analytics_summary_response.py +54 -0
  121. mirascope/api/_generated/traces/types/traces_get_analytics_summary_response_top_functions_item.py +24 -0
  122. mirascope/api/_generated/traces/types/traces_get_analytics_summary_response_top_models_item.py +22 -0
  123. mirascope/api/_generated/traces/types/traces_get_trace_detail_response.py +33 -0
  124. mirascope/api/_generated/traces/types/traces_get_trace_detail_response_spans_item.py +90 -0
  125. mirascope/api/_generated/traces/types/traces_search_request_attribute_filters_item.py +26 -0
  126. mirascope/api/_generated/traces/types/traces_search_request_attribute_filters_item_operator.py +7 -0
  127. mirascope/api/_generated/traces/types/traces_search_request_sort_by.py +7 -0
  128. mirascope/api/_generated/traces/types/traces_search_request_sort_order.py +5 -0
  129. mirascope/api/_generated/traces/types/traces_search_response.py +26 -0
  130. mirascope/api/_generated/traces/types/traces_search_response_spans_item.py +41 -0
  131. mirascope/api/_generated/types/__init__.py +18 -0
  132. mirascope/api/_generated/types/already_exists_error.py +1 -3
  133. mirascope/api/_generated/types/click_house_error.py +22 -0
  134. mirascope/api/_generated/types/database_error.py +1 -3
  135. mirascope/api/_generated/types/http_api_decode_error.py +1 -3
  136. mirascope/api/_generated/types/internal_server_error_body.py +49 -0
  137. mirascope/api/_generated/types/issue.py +1 -3
  138. mirascope/api/_generated/types/issue_tag.py +1 -8
  139. mirascope/api/_generated/types/not_found_error_body.py +1 -3
  140. mirascope/api/_generated/types/number_from_string.py +3 -0
  141. mirascope/api/_generated/types/permission_denied_error.py +1 -3
  142. mirascope/api/_generated/types/permission_denied_error_tag.py +1 -3
  143. mirascope/api/_generated/types/property_key_key.py +1 -3
  144. mirascope/api/_generated/types/stripe_error.py +20 -0
  145. mirascope/api/_generated/types/unauthorized_error_body.py +21 -0
  146. mirascope/api/_generated/types/unauthorized_error_tag.py +5 -0
  147. mirascope/llm/__init__.py +6 -2
  148. mirascope/llm/content/tool_call.py +6 -0
  149. mirascope/llm/exceptions.py +28 -0
  150. mirascope/llm/formatting/__init__.py +2 -2
  151. mirascope/llm/formatting/format.py +120 -8
  152. mirascope/llm/formatting/types.py +1 -56
  153. mirascope/llm/mcp/__init__.py +2 -2
  154. mirascope/llm/mcp/mcp_client.py +130 -0
  155. mirascope/llm/providers/__init__.py +26 -5
  156. mirascope/llm/providers/anthropic/__init__.py +3 -21
  157. mirascope/llm/providers/anthropic/_utils/__init__.py +2 -0
  158. mirascope/llm/providers/anthropic/_utils/beta_decode.py +4 -2
  159. mirascope/llm/providers/anthropic/_utils/beta_encode.py +13 -12
  160. mirascope/llm/providers/anthropic/_utils/decode.py +4 -2
  161. mirascope/llm/providers/anthropic/_utils/encode.py +57 -14
  162. mirascope/llm/providers/anthropic/_utils/errors.py +46 -0
  163. mirascope/llm/providers/anthropic/beta_provider.py +6 -0
  164. mirascope/llm/providers/anthropic/provider.py +5 -0
  165. mirascope/llm/providers/base/__init__.py +5 -2
  166. mirascope/llm/providers/base/_utils.py +2 -7
  167. mirascope/llm/providers/base/base_provider.py +173 -58
  168. mirascope/llm/providers/base/params.py +63 -34
  169. mirascope/llm/providers/google/__init__.py +2 -17
  170. mirascope/llm/providers/google/_utils/__init__.py +2 -0
  171. mirascope/llm/providers/google/_utils/decode.py +17 -8
  172. mirascope/llm/providers/google/_utils/encode.py +105 -16
  173. mirascope/llm/providers/google/_utils/errors.py +49 -0
  174. mirascope/llm/providers/google/model_info.py +1 -0
  175. mirascope/llm/providers/google/provider.py +9 -5
  176. mirascope/llm/providers/mirascope/__init__.py +5 -0
  177. mirascope/llm/providers/mirascope/_utils.py +77 -0
  178. mirascope/llm/providers/mirascope/provider.py +318 -0
  179. mirascope/llm/providers/mlx/__init__.py +2 -17
  180. mirascope/llm/providers/mlx/_utils.py +9 -2
  181. mirascope/llm/providers/mlx/provider.py +8 -0
  182. mirascope/llm/providers/ollama/__init__.py +1 -13
  183. mirascope/llm/providers/openai/__init__.py +10 -1
  184. mirascope/llm/providers/openai/_utils/__init__.py +5 -0
  185. mirascope/llm/providers/openai/_utils/errors.py +46 -0
  186. mirascope/llm/providers/openai/completions/__init__.py +2 -20
  187. mirascope/llm/providers/openai/completions/_utils/decode.py +14 -3
  188. mirascope/llm/providers/openai/completions/_utils/encode.py +15 -12
  189. mirascope/llm/providers/openai/completions/base_provider.py +6 -6
  190. mirascope/llm/providers/openai/provider.py +14 -1
  191. mirascope/llm/providers/openai/responses/__init__.py +1 -17
  192. mirascope/llm/providers/openai/responses/_utils/decode.py +2 -2
  193. mirascope/llm/providers/openai/responses/_utils/encode.py +43 -15
  194. mirascope/llm/providers/openai/responses/provider.py +13 -7
  195. mirascope/llm/providers/provider_id.py +1 -0
  196. mirascope/llm/providers/provider_registry.py +59 -3
  197. mirascope/llm/providers/together/__init__.py +1 -13
  198. mirascope/llm/responses/base_stream_response.py +24 -20
  199. mirascope/llm/tools/decorator.py +8 -4
  200. mirascope/llm/tools/tool_schema.py +33 -6
  201. mirascope/llm/tools/tools.py +84 -16
  202. mirascope/ops/__init__.py +60 -109
  203. mirascope/ops/_internal/closure.py +62 -11
  204. mirascope/ops/_internal/instrumentation/llm/llm.py +1 -2
  205. mirascope/ops/_internal/traced_functions.py +23 -4
  206. mirascope/ops/_internal/versioned_functions.py +54 -43
  207. {mirascope-2.0.0a4.dist-info → mirascope-2.0.0a6.dist-info}/METADATA +7 -7
  208. mirascope-2.0.0a6.dist-info/RECORD +316 -0
  209. mirascope/llm/formatting/_utils.py +0 -78
  210. mirascope/llm/mcp/client.py +0 -118
  211. mirascope/llm/providers/_missing_import_stubs.py +0 -49
  212. mirascope/llm/providers/load_provider.py +0 -54
  213. mirascope-2.0.0a4.dist-info/RECORD +0 -247
  214. {mirascope-2.0.0a4.dist-info → mirascope-2.0.0a6.dist-info}/WHEEL +0 -0
  215. {mirascope-2.0.0a4.dist-info → mirascope-2.0.0a6.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,15 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ # isort: skip_file
4
+
5
+ from .environments_create_response import EnvironmentsCreateResponse
6
+ from .environments_get_response import EnvironmentsGetResponse
7
+ from .environments_list_response_item import EnvironmentsListResponseItem
8
+ from .environments_update_response import EnvironmentsUpdateResponse
9
+
10
+ __all__ = [
11
+ "EnvironmentsCreateResponse",
12
+ "EnvironmentsGetResponse",
13
+ "EnvironmentsListResponseItem",
14
+ "EnvironmentsUpdateResponse",
15
+ ]
@@ -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
+ import typing_extensions
7
+ from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
8
+ from ...core.serialization import FieldMetadata
9
+
10
+
11
+ class EnvironmentsCreateResponse(UniversalBaseModel):
12
+ id: str
13
+ name: str
14
+ slug: str
15
+ project_id: typing_extensions.Annotated[str, FieldMetadata(alias="projectId")]
16
+
17
+ if IS_PYDANTIC_V2:
18
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # 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,24 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ import typing_extensions
7
+ from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
8
+ from ...core.serialization import FieldMetadata
9
+
10
+
11
+ class EnvironmentsGetResponse(UniversalBaseModel):
12
+ id: str
13
+ name: str
14
+ slug: str
15
+ project_id: typing_extensions.Annotated[str, FieldMetadata(alias="projectId")]
16
+
17
+ if IS_PYDANTIC_V2:
18
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # 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,24 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ import typing_extensions
7
+ from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
8
+ from ...core.serialization import FieldMetadata
9
+
10
+
11
+ class EnvironmentsListResponseItem(UniversalBaseModel):
12
+ id: str
13
+ name: str
14
+ slug: str
15
+ project_id: typing_extensions.Annotated[str, FieldMetadata(alias="projectId")]
16
+
17
+ if IS_PYDANTIC_V2:
18
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # 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,24 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ import typing_extensions
7
+ from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
8
+ from ...core.serialization import FieldMetadata
9
+
10
+
11
+ class EnvironmentsUpdateResponse(UniversalBaseModel):
12
+ id: str
13
+ name: str
14
+ slug: str
15
+ project_id: typing_extensions.Annotated[str, FieldMetadata(alias="projectId")]
16
+
17
+ if IS_PYDANTIC_V2:
18
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
19
+ else:
20
+
21
+ class Config:
22
+ frozen = True
23
+ smart_union = True
24
+ extra = pydantic.Extra.allow
@@ -7,6 +7,7 @@ from .conflict_error import ConflictError
7
7
  from .forbidden_error import ForbiddenError
8
8
  from .internal_server_error import InternalServerError
9
9
  from .not_found_error import NotFoundError
10
+ from .unauthorized_error import UnauthorizedError
10
11
 
11
12
  __all__ = [
12
13
  "BadRequestError",
@@ -14,4 +15,5 @@ __all__ = [
14
15
  "ForbiddenError",
15
16
  "InternalServerError",
16
17
  "NotFoundError",
18
+ "UnauthorizedError",
17
19
  ]
@@ -7,9 +7,5 @@ from ..types.http_api_decode_error import HttpApiDecodeError
7
7
 
8
8
 
9
9
  class BadRequestError(ApiError):
10
- def __init__(
11
- self,
12
- body: HttpApiDecodeError,
13
- headers: typing.Optional[typing.Dict[str, str]] = None,
14
- ):
10
+ def __init__(self, body: HttpApiDecodeError, headers: typing.Optional[typing.Dict[str, str]] = None):
15
11
  super().__init__(status_code=400, headers=headers, body=body)
@@ -7,9 +7,5 @@ from ..types.already_exists_error import AlreadyExistsError
7
7
 
8
8
 
9
9
  class ConflictError(ApiError):
10
- def __init__(
11
- self,
12
- body: AlreadyExistsError,
13
- headers: typing.Optional[typing.Dict[str, str]] = None,
14
- ):
10
+ def __init__(self, body: AlreadyExistsError, headers: typing.Optional[typing.Dict[str, str]] = None):
15
11
  super().__init__(status_code=409, headers=headers, body=body)
@@ -7,9 +7,5 @@ from ..types.permission_denied_error import PermissionDeniedError
7
7
 
8
8
 
9
9
  class ForbiddenError(ApiError):
10
- def __init__(
11
- self,
12
- body: PermissionDeniedError,
13
- headers: typing.Optional[typing.Dict[str, str]] = None,
14
- ):
10
+ def __init__(self, body: PermissionDeniedError, headers: typing.Optional[typing.Dict[str, str]] = None):
15
11
  super().__init__(status_code=403, headers=headers, body=body)
@@ -3,13 +3,8 @@
3
3
  import typing
4
4
 
5
5
  from ..core.api_error import ApiError
6
- from ..types.database_error import DatabaseError
7
6
 
8
7
 
9
8
  class InternalServerError(ApiError):
10
- def __init__(
11
- self,
12
- body: DatabaseError,
13
- headers: typing.Optional[typing.Dict[str, str]] = None,
14
- ):
9
+ def __init__(self, body: typing.Optional[typing.Any], headers: typing.Optional[typing.Dict[str, str]] = None):
15
10
  super().__init__(status_code=500, headers=headers, body=body)
@@ -7,9 +7,5 @@ from ..types.not_found_error_body import NotFoundErrorBody
7
7
 
8
8
 
9
9
  class NotFoundError(ApiError):
10
- def __init__(
11
- self,
12
- body: NotFoundErrorBody,
13
- headers: typing.Optional[typing.Dict[str, str]] = None,
14
- ):
10
+ def __init__(self, body: NotFoundErrorBody, headers: typing.Optional[typing.Dict[str, str]] = None):
15
11
  super().__init__(status_code=404, headers=headers, body=body)
@@ -0,0 +1,11 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ from ..core.api_error import ApiError
6
+ from ..types.unauthorized_error_body import UnauthorizedErrorBody
7
+
8
+
9
+ class UnauthorizedError(ApiError):
10
+ def __init__(self, body: UnauthorizedErrorBody, headers: typing.Optional[typing.Dict[str, str]] = None):
11
+ super().__init__(status_code=401, headers=headers, body=body)
@@ -0,0 +1,29 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ # isort: skip_file
4
+
5
+ from .types import (
6
+ FunctionsCreateRequestDependenciesValue,
7
+ FunctionsCreateResponse,
8
+ FunctionsCreateResponseDependenciesValue,
9
+ FunctionsFindByHashResponse,
10
+ FunctionsFindByHashResponseDependenciesValue,
11
+ FunctionsGetResponse,
12
+ FunctionsGetResponseDependenciesValue,
13
+ FunctionsListResponse,
14
+ FunctionsListResponseFunctionsItem,
15
+ FunctionsListResponseFunctionsItemDependenciesValue,
16
+ )
17
+
18
+ __all__ = [
19
+ "FunctionsCreateRequestDependenciesValue",
20
+ "FunctionsCreateResponse",
21
+ "FunctionsCreateResponseDependenciesValue",
22
+ "FunctionsFindByHashResponse",
23
+ "FunctionsFindByHashResponseDependenciesValue",
24
+ "FunctionsGetResponse",
25
+ "FunctionsGetResponseDependenciesValue",
26
+ "FunctionsListResponse",
27
+ "FunctionsListResponseFunctionsItem",
28
+ "FunctionsListResponseFunctionsItemDependenciesValue",
29
+ ]
@@ -0,0 +1,433 @@
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 AsyncRawFunctionsClient, RawFunctionsClient
8
+ from .types.functions_create_request_dependencies_value import FunctionsCreateRequestDependenciesValue
9
+ from .types.functions_create_response import FunctionsCreateResponse
10
+ from .types.functions_find_by_hash_response import FunctionsFindByHashResponse
11
+ from .types.functions_get_response import FunctionsGetResponse
12
+ from .types.functions_list_response import FunctionsListResponse
13
+
14
+ # this is used as the default value for optional parameters
15
+ OMIT = typing.cast(typing.Any, ...)
16
+
17
+
18
+ class FunctionsClient:
19
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
20
+ self._raw_client = RawFunctionsClient(client_wrapper=client_wrapper)
21
+
22
+ @property
23
+ def with_raw_response(self) -> RawFunctionsClient:
24
+ """
25
+ Retrieves a raw implementation of this client that returns raw responses.
26
+
27
+ Returns
28
+ -------
29
+ RawFunctionsClient
30
+ """
31
+ return self._raw_client
32
+
33
+ def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> FunctionsListResponse:
34
+ """
35
+ Parameters
36
+ ----------
37
+ request_options : typing.Optional[RequestOptions]
38
+ Request-specific configuration.
39
+
40
+ Returns
41
+ -------
42
+ FunctionsListResponse
43
+ Success
44
+
45
+ Examples
46
+ --------
47
+ from mirascope.api._generated import Mirascope
48
+
49
+ client = Mirascope()
50
+ client.functions.list()
51
+ """
52
+ _response = self._raw_client.list(request_options=request_options)
53
+ return _response.data
54
+
55
+ def create(
56
+ self,
57
+ *,
58
+ code: str,
59
+ hash: str,
60
+ signature: str,
61
+ signature_hash: str,
62
+ name: str,
63
+ description: typing.Optional[str] = OMIT,
64
+ tags: typing.Optional[typing.Sequence[str]] = OMIT,
65
+ metadata: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT,
66
+ dependencies: typing.Optional[
67
+ typing.Dict[str, typing.Optional[FunctionsCreateRequestDependenciesValue]]
68
+ ] = OMIT,
69
+ request_options: typing.Optional[RequestOptions] = None,
70
+ ) -> FunctionsCreateResponse:
71
+ """
72
+ Parameters
73
+ ----------
74
+ code : str
75
+
76
+ hash : str
77
+
78
+ signature : str
79
+
80
+ signature_hash : str
81
+
82
+ name : str
83
+
84
+ description : typing.Optional[str]
85
+
86
+ tags : typing.Optional[typing.Sequence[str]]
87
+
88
+ metadata : typing.Optional[typing.Dict[str, typing.Optional[str]]]
89
+
90
+ dependencies : typing.Optional[typing.Dict[str, typing.Optional[FunctionsCreateRequestDependenciesValue]]]
91
+
92
+ request_options : typing.Optional[RequestOptions]
93
+ Request-specific configuration.
94
+
95
+ Returns
96
+ -------
97
+ FunctionsCreateResponse
98
+ Success
99
+
100
+ Examples
101
+ --------
102
+ from mirascope.api._generated import Mirascope
103
+
104
+ client = Mirascope()
105
+ client.functions.create(
106
+ code="code",
107
+ hash="hash",
108
+ signature="signature",
109
+ signature_hash="signatureHash",
110
+ name="name",
111
+ )
112
+ """
113
+ _response = self._raw_client.create(
114
+ code=code,
115
+ hash=hash,
116
+ signature=signature,
117
+ signature_hash=signature_hash,
118
+ name=name,
119
+ description=description,
120
+ tags=tags,
121
+ metadata=metadata,
122
+ dependencies=dependencies,
123
+ request_options=request_options,
124
+ )
125
+ return _response.data
126
+
127
+ def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> FunctionsGetResponse:
128
+ """
129
+ Parameters
130
+ ----------
131
+ id : str
132
+
133
+ request_options : typing.Optional[RequestOptions]
134
+ Request-specific configuration.
135
+
136
+ Returns
137
+ -------
138
+ FunctionsGetResponse
139
+ Success
140
+
141
+ Examples
142
+ --------
143
+ from mirascope.api._generated import Mirascope
144
+
145
+ client = Mirascope()
146
+ client.functions.get(
147
+ id="id",
148
+ )
149
+ """
150
+ _response = self._raw_client.get(id, request_options=request_options)
151
+ return _response.data
152
+
153
+ def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
154
+ """
155
+ Parameters
156
+ ----------
157
+ id : str
158
+
159
+ request_options : typing.Optional[RequestOptions]
160
+ Request-specific configuration.
161
+
162
+ Returns
163
+ -------
164
+ None
165
+
166
+ Examples
167
+ --------
168
+ from mirascope.api._generated import Mirascope
169
+
170
+ client = Mirascope()
171
+ client.functions.delete(
172
+ id="id",
173
+ )
174
+ """
175
+ _response = self._raw_client.delete(id, request_options=request_options)
176
+ return _response.data
177
+
178
+ def findbyhash(
179
+ self, hash: str, *, request_options: typing.Optional[RequestOptions] = None
180
+ ) -> FunctionsFindByHashResponse:
181
+ """
182
+ Parameters
183
+ ----------
184
+ hash : str
185
+
186
+ request_options : typing.Optional[RequestOptions]
187
+ Request-specific configuration.
188
+
189
+ Returns
190
+ -------
191
+ FunctionsFindByHashResponse
192
+ Success
193
+
194
+ Examples
195
+ --------
196
+ from mirascope.api._generated import Mirascope
197
+
198
+ client = Mirascope()
199
+ client.functions.findbyhash(
200
+ hash="hash",
201
+ )
202
+ """
203
+ _response = self._raw_client.findbyhash(hash, request_options=request_options)
204
+ return _response.data
205
+
206
+
207
+ class AsyncFunctionsClient:
208
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
209
+ self._raw_client = AsyncRawFunctionsClient(client_wrapper=client_wrapper)
210
+
211
+ @property
212
+ def with_raw_response(self) -> AsyncRawFunctionsClient:
213
+ """
214
+ Retrieves a raw implementation of this client that returns raw responses.
215
+
216
+ Returns
217
+ -------
218
+ AsyncRawFunctionsClient
219
+ """
220
+ return self._raw_client
221
+
222
+ async def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> FunctionsListResponse:
223
+ """
224
+ Parameters
225
+ ----------
226
+ request_options : typing.Optional[RequestOptions]
227
+ Request-specific configuration.
228
+
229
+ Returns
230
+ -------
231
+ FunctionsListResponse
232
+ Success
233
+
234
+ Examples
235
+ --------
236
+ import asyncio
237
+
238
+ from mirascope.api._generated import AsyncMirascope
239
+
240
+ client = AsyncMirascope()
241
+
242
+
243
+ async def main() -> None:
244
+ await client.functions.list()
245
+
246
+
247
+ asyncio.run(main())
248
+ """
249
+ _response = await self._raw_client.list(request_options=request_options)
250
+ return _response.data
251
+
252
+ async def create(
253
+ self,
254
+ *,
255
+ code: str,
256
+ hash: str,
257
+ signature: str,
258
+ signature_hash: str,
259
+ name: str,
260
+ description: typing.Optional[str] = OMIT,
261
+ tags: typing.Optional[typing.Sequence[str]] = OMIT,
262
+ metadata: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT,
263
+ dependencies: typing.Optional[
264
+ typing.Dict[str, typing.Optional[FunctionsCreateRequestDependenciesValue]]
265
+ ] = OMIT,
266
+ request_options: typing.Optional[RequestOptions] = None,
267
+ ) -> FunctionsCreateResponse:
268
+ """
269
+ Parameters
270
+ ----------
271
+ code : str
272
+
273
+ hash : str
274
+
275
+ signature : str
276
+
277
+ signature_hash : str
278
+
279
+ name : str
280
+
281
+ description : typing.Optional[str]
282
+
283
+ tags : typing.Optional[typing.Sequence[str]]
284
+
285
+ metadata : typing.Optional[typing.Dict[str, typing.Optional[str]]]
286
+
287
+ dependencies : typing.Optional[typing.Dict[str, typing.Optional[FunctionsCreateRequestDependenciesValue]]]
288
+
289
+ request_options : typing.Optional[RequestOptions]
290
+ Request-specific configuration.
291
+
292
+ Returns
293
+ -------
294
+ FunctionsCreateResponse
295
+ Success
296
+
297
+ Examples
298
+ --------
299
+ import asyncio
300
+
301
+ from mirascope.api._generated import AsyncMirascope
302
+
303
+ client = AsyncMirascope()
304
+
305
+
306
+ async def main() -> None:
307
+ await client.functions.create(
308
+ code="code",
309
+ hash="hash",
310
+ signature="signature",
311
+ signature_hash="signatureHash",
312
+ name="name",
313
+ )
314
+
315
+
316
+ asyncio.run(main())
317
+ """
318
+ _response = await self._raw_client.create(
319
+ code=code,
320
+ hash=hash,
321
+ signature=signature,
322
+ signature_hash=signature_hash,
323
+ name=name,
324
+ description=description,
325
+ tags=tags,
326
+ metadata=metadata,
327
+ dependencies=dependencies,
328
+ request_options=request_options,
329
+ )
330
+ return _response.data
331
+
332
+ async def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> FunctionsGetResponse:
333
+ """
334
+ Parameters
335
+ ----------
336
+ id : str
337
+
338
+ request_options : typing.Optional[RequestOptions]
339
+ Request-specific configuration.
340
+
341
+ Returns
342
+ -------
343
+ FunctionsGetResponse
344
+ Success
345
+
346
+ Examples
347
+ --------
348
+ import asyncio
349
+
350
+ from mirascope.api._generated import AsyncMirascope
351
+
352
+ client = AsyncMirascope()
353
+
354
+
355
+ async def main() -> None:
356
+ await client.functions.get(
357
+ id="id",
358
+ )
359
+
360
+
361
+ asyncio.run(main())
362
+ """
363
+ _response = await self._raw_client.get(id, request_options=request_options)
364
+ return _response.data
365
+
366
+ async def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
367
+ """
368
+ Parameters
369
+ ----------
370
+ id : str
371
+
372
+ request_options : typing.Optional[RequestOptions]
373
+ Request-specific configuration.
374
+
375
+ Returns
376
+ -------
377
+ None
378
+
379
+ Examples
380
+ --------
381
+ import asyncio
382
+
383
+ from mirascope.api._generated import AsyncMirascope
384
+
385
+ client = AsyncMirascope()
386
+
387
+
388
+ async def main() -> None:
389
+ await client.functions.delete(
390
+ id="id",
391
+ )
392
+
393
+
394
+ asyncio.run(main())
395
+ """
396
+ _response = await self._raw_client.delete(id, request_options=request_options)
397
+ return _response.data
398
+
399
+ async def findbyhash(
400
+ self, hash: str, *, request_options: typing.Optional[RequestOptions] = None
401
+ ) -> FunctionsFindByHashResponse:
402
+ """
403
+ Parameters
404
+ ----------
405
+ hash : str
406
+
407
+ request_options : typing.Optional[RequestOptions]
408
+ Request-specific configuration.
409
+
410
+ Returns
411
+ -------
412
+ FunctionsFindByHashResponse
413
+ Success
414
+
415
+ Examples
416
+ --------
417
+ import asyncio
418
+
419
+ from mirascope.api._generated import AsyncMirascope
420
+
421
+ client = AsyncMirascope()
422
+
423
+
424
+ async def main() -> None:
425
+ await client.functions.findbyhash(
426
+ hash="hash",
427
+ )
428
+
429
+
430
+ asyncio.run(main())
431
+ """
432
+ _response = await self._raw_client.findbyhash(hash, request_options=request_options)
433
+ return _response.data