mirascope 2.0.0a3__py3-none-any.whl → 2.0.0a5__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 (118) hide show
  1. mirascope/api/_generated/__init__.py +78 -6
  2. mirascope/api/_generated/api_keys/__init__.py +7 -0
  3. mirascope/api/_generated/api_keys/client.py +453 -0
  4. mirascope/api/_generated/api_keys/raw_client.py +853 -0
  5. mirascope/api/_generated/api_keys/types/__init__.py +9 -0
  6. mirascope/api/_generated/api_keys/types/api_keys_create_response.py +36 -0
  7. mirascope/api/_generated/api_keys/types/api_keys_get_response.py +35 -0
  8. mirascope/api/_generated/api_keys/types/api_keys_list_response_item.py +35 -0
  9. mirascope/api/_generated/client.py +14 -0
  10. mirascope/api/_generated/environments/__init__.py +17 -0
  11. mirascope/api/_generated/environments/client.py +532 -0
  12. mirascope/api/_generated/environments/raw_client.py +1088 -0
  13. mirascope/api/_generated/environments/types/__init__.py +15 -0
  14. mirascope/api/_generated/environments/types/environments_create_response.py +26 -0
  15. mirascope/api/_generated/environments/types/environments_get_response.py +26 -0
  16. mirascope/api/_generated/environments/types/environments_list_response_item.py +26 -0
  17. mirascope/api/_generated/environments/types/environments_update_response.py +26 -0
  18. mirascope/api/_generated/errors/__init__.py +11 -1
  19. mirascope/api/_generated/errors/conflict_error.py +15 -0
  20. mirascope/api/_generated/errors/forbidden_error.py +15 -0
  21. mirascope/api/_generated/errors/internal_server_error.py +15 -0
  22. mirascope/api/_generated/errors/not_found_error.py +15 -0
  23. mirascope/api/_generated/organizations/__init__.py +25 -0
  24. mirascope/api/_generated/organizations/client.py +404 -0
  25. mirascope/api/_generated/organizations/raw_client.py +902 -0
  26. mirascope/api/_generated/organizations/types/__init__.py +23 -0
  27. mirascope/api/_generated/organizations/types/organizations_create_response.py +25 -0
  28. mirascope/api/_generated/organizations/types/organizations_create_response_role.py +7 -0
  29. mirascope/api/_generated/organizations/types/organizations_get_response.py +25 -0
  30. mirascope/api/_generated/organizations/types/organizations_get_response_role.py +7 -0
  31. mirascope/api/_generated/organizations/types/organizations_list_response_item.py +25 -0
  32. mirascope/api/_generated/organizations/types/organizations_list_response_item_role.py +7 -0
  33. mirascope/api/_generated/organizations/types/organizations_update_response.py +25 -0
  34. mirascope/api/_generated/organizations/types/organizations_update_response_role.py +7 -0
  35. mirascope/api/_generated/projects/__init__.py +17 -0
  36. mirascope/api/_generated/projects/client.py +482 -0
  37. mirascope/api/_generated/projects/raw_client.py +1058 -0
  38. mirascope/api/_generated/projects/types/__init__.py +15 -0
  39. mirascope/api/_generated/projects/types/projects_create_response.py +31 -0
  40. mirascope/api/_generated/projects/types/projects_get_response.py +31 -0
  41. mirascope/api/_generated/projects/types/projects_list_response_item.py +31 -0
  42. mirascope/api/_generated/projects/types/projects_update_response.py +31 -0
  43. mirascope/api/_generated/reference.md +1311 -0
  44. mirascope/api/_generated/types/__init__.py +20 -4
  45. mirascope/api/_generated/types/already_exists_error.py +24 -0
  46. mirascope/api/_generated/types/already_exists_error_tag.py +5 -0
  47. mirascope/api/_generated/types/database_error.py +24 -0
  48. mirascope/api/_generated/types/database_error_tag.py +5 -0
  49. mirascope/api/_generated/types/http_api_decode_error.py +1 -3
  50. mirascope/api/_generated/types/issue.py +1 -5
  51. mirascope/api/_generated/types/not_found_error_body.py +24 -0
  52. mirascope/api/_generated/types/not_found_error_tag.py +5 -0
  53. mirascope/api/_generated/types/permission_denied_error.py +24 -0
  54. mirascope/api/_generated/types/permission_denied_error_tag.py +7 -0
  55. mirascope/api/_generated/types/property_key.py +2 -2
  56. mirascope/api/_generated/types/{property_key_tag.py → property_key_key.py} +3 -5
  57. mirascope/api/_generated/types/{property_key_tag_tag.py → property_key_key_tag.py} +1 -1
  58. mirascope/llm/__init__.py +6 -2
  59. mirascope/llm/exceptions.py +28 -0
  60. mirascope/llm/providers/__init__.py +12 -4
  61. mirascope/llm/providers/anthropic/__init__.py +6 -1
  62. mirascope/llm/providers/anthropic/_utils/__init__.py +17 -5
  63. mirascope/llm/providers/anthropic/_utils/beta_decode.py +271 -0
  64. mirascope/llm/providers/anthropic/_utils/beta_encode.py +216 -0
  65. mirascope/llm/providers/anthropic/_utils/decode.py +39 -7
  66. mirascope/llm/providers/anthropic/_utils/encode.py +156 -64
  67. mirascope/llm/providers/anthropic/_utils/errors.py +46 -0
  68. mirascope/llm/providers/anthropic/beta_provider.py +328 -0
  69. mirascope/llm/providers/anthropic/model_id.py +10 -27
  70. mirascope/llm/providers/anthropic/model_info.py +87 -0
  71. mirascope/llm/providers/anthropic/provider.py +132 -145
  72. mirascope/llm/providers/base/__init__.py +2 -1
  73. mirascope/llm/providers/base/_utils.py +15 -1
  74. mirascope/llm/providers/base/base_provider.py +173 -58
  75. mirascope/llm/providers/google/_utils/__init__.py +2 -0
  76. mirascope/llm/providers/google/_utils/decode.py +55 -3
  77. mirascope/llm/providers/google/_utils/encode.py +14 -6
  78. mirascope/llm/providers/google/_utils/errors.py +49 -0
  79. mirascope/llm/providers/google/model_id.py +7 -13
  80. mirascope/llm/providers/google/model_info.py +62 -0
  81. mirascope/llm/providers/google/provider.py +13 -8
  82. mirascope/llm/providers/mlx/_utils.py +31 -2
  83. mirascope/llm/providers/mlx/encoding/transformers.py +17 -1
  84. mirascope/llm/providers/mlx/provider.py +12 -0
  85. mirascope/llm/providers/ollama/__init__.py +19 -0
  86. mirascope/llm/providers/ollama/provider.py +71 -0
  87. mirascope/llm/providers/openai/__init__.py +10 -1
  88. mirascope/llm/providers/openai/_utils/__init__.py +5 -0
  89. mirascope/llm/providers/openai/_utils/errors.py +46 -0
  90. mirascope/llm/providers/openai/completions/__init__.py +6 -1
  91. mirascope/llm/providers/openai/completions/_utils/decode.py +57 -5
  92. mirascope/llm/providers/openai/completions/_utils/encode.py +9 -8
  93. mirascope/llm/providers/openai/completions/base_provider.py +513 -0
  94. mirascope/llm/providers/openai/completions/provider.py +13 -447
  95. mirascope/llm/providers/openai/model_info.py +57 -0
  96. mirascope/llm/providers/openai/provider.py +30 -5
  97. mirascope/llm/providers/openai/responses/_utils/decode.py +55 -4
  98. mirascope/llm/providers/openai/responses/_utils/encode.py +9 -9
  99. mirascope/llm/providers/openai/responses/provider.py +33 -28
  100. mirascope/llm/providers/provider_id.py +11 -1
  101. mirascope/llm/providers/provider_registry.py +59 -4
  102. mirascope/llm/providers/together/__init__.py +19 -0
  103. mirascope/llm/providers/together/provider.py +40 -0
  104. mirascope/llm/responses/__init__.py +3 -0
  105. mirascope/llm/responses/base_response.py +4 -0
  106. mirascope/llm/responses/base_stream_response.py +25 -1
  107. mirascope/llm/responses/finish_reason.py +1 -0
  108. mirascope/llm/responses/response.py +9 -0
  109. mirascope/llm/responses/root_response.py +5 -1
  110. mirascope/llm/responses/usage.py +95 -0
  111. mirascope/ops/_internal/closure.py +62 -11
  112. {mirascope-2.0.0a3.dist-info → mirascope-2.0.0a5.dist-info}/METADATA +3 -3
  113. {mirascope-2.0.0a3.dist-info → mirascope-2.0.0a5.dist-info}/RECORD +115 -56
  114. mirascope/llm/providers/load_provider.py +0 -48
  115. mirascope/llm/providers/openai/shared/__init__.py +0 -7
  116. mirascope/llm/providers/openai/shared/_utils.py +0 -59
  117. {mirascope-2.0.0a3.dist-info → mirascope-2.0.0a5.dist-info}/WHEEL +0 -0
  118. {mirascope-2.0.0a3.dist-info → mirascope-2.0.0a5.dist-info}/licenses/LICENSE +0 -0
@@ -2,20 +2,36 @@
2
2
 
3
3
  # isort: skip_file
4
4
 
5
+ from .already_exists_error import AlreadyExistsError
6
+ from .already_exists_error_tag import AlreadyExistsErrorTag
7
+ from .database_error import DatabaseError
8
+ from .database_error_tag import DatabaseErrorTag
5
9
  from .http_api_decode_error import HttpApiDecodeError
6
10
  from .http_api_decode_error_tag import HttpApiDecodeErrorTag
7
11
  from .issue import Issue
8
12
  from .issue_tag import IssueTag
13
+ from .not_found_error_body import NotFoundErrorBody
14
+ from .not_found_error_tag import NotFoundErrorTag
15
+ from .permission_denied_error import PermissionDeniedError
16
+ from .permission_denied_error_tag import PermissionDeniedErrorTag
9
17
  from .property_key import PropertyKey
10
- from .property_key_tag import PropertyKeyTag
11
- from .property_key_tag_tag import PropertyKeyTagTag
18
+ from .property_key_key import PropertyKeyKey
19
+ from .property_key_key_tag import PropertyKeyKeyTag
12
20
 
13
21
  __all__ = [
22
+ "AlreadyExistsError",
23
+ "AlreadyExistsErrorTag",
24
+ "DatabaseError",
25
+ "DatabaseErrorTag",
14
26
  "HttpApiDecodeError",
15
27
  "HttpApiDecodeErrorTag",
16
28
  "Issue",
17
29
  "IssueTag",
30
+ "NotFoundErrorBody",
31
+ "NotFoundErrorTag",
32
+ "PermissionDeniedError",
33
+ "PermissionDeniedErrorTag",
18
34
  "PropertyKey",
19
- "PropertyKeyTag",
20
- "PropertyKeyTagTag",
35
+ "PropertyKeyKey",
36
+ "PropertyKeyKeyTag",
21
37
  ]
@@ -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 .already_exists_error_tag import AlreadyExistsErrorTag
8
+
9
+
10
+ class AlreadyExistsError(UniversalBaseModel):
11
+ message: str
12
+ resource: typing.Optional[str] = None
13
+ tag: AlreadyExistsErrorTag
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
+ AlreadyExistsErrorTag = typing.Union[typing.Literal["AlreadyExistsError"], typing.Any]
@@ -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 .database_error_tag import DatabaseErrorTag
8
+
9
+
10
+ class DatabaseError(UniversalBaseModel):
11
+ message: str
12
+ cause: typing.Optional[typing.Optional[typing.Any]] = None
13
+ tag: DatabaseErrorTag
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
+ DatabaseErrorTag = typing.Union[typing.Literal["DatabaseError"], typing.Any]
@@ -3,9 +3,7 @@
3
3
  import typing
4
4
 
5
5
  import pydantic
6
- import typing_extensions
7
6
  from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
8
- from ..core.serialization import FieldMetadata
9
7
  from .http_api_decode_error_tag import HttpApiDecodeErrorTag
10
8
  from .issue import Issue
11
9
 
@@ -17,7 +15,7 @@ class HttpApiDecodeError(UniversalBaseModel):
17
15
 
18
16
  issues: typing.List[Issue]
19
17
  message: str
20
- tag: typing_extensions.Annotated[HttpApiDecodeErrorTag, FieldMetadata(alias="_tag")]
18
+ tag: HttpApiDecodeErrorTag
21
19
 
22
20
  if IS_PYDANTIC_V2:
23
21
  model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
@@ -3,9 +3,7 @@
3
3
  import typing
4
4
 
5
5
  import pydantic
6
- import typing_extensions
7
6
  from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
8
- from ..core.serialization import FieldMetadata
9
7
  from .issue_tag import IssueTag
10
8
  from .property_key import PropertyKey
11
9
 
@@ -15,9 +13,7 @@ class Issue(UniversalBaseModel):
15
13
  Represents an error encountered while parsing a value to match the schema
16
14
  """
17
15
 
18
- tag: typing_extensions.Annotated[IssueTag, FieldMetadata(alias="_tag")] = (
19
- pydantic.Field()
20
- )
16
+ tag: IssueTag = pydantic.Field()
21
17
  """
22
18
  The tag identifying the type of parse issue
23
19
  """
@@ -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 .not_found_error_tag import NotFoundErrorTag
8
+
9
+
10
+ class NotFoundErrorBody(UniversalBaseModel):
11
+ message: str
12
+ resource: typing.Optional[str] = None
13
+ tag: NotFoundErrorTag
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
+ NotFoundErrorTag = typing.Union[typing.Literal["NotFoundError"], typing.Any]
@@ -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 .permission_denied_error_tag import PermissionDeniedErrorTag
8
+
9
+
10
+ class PermissionDeniedError(UniversalBaseModel):
11
+ message: str
12
+ resource: typing.Optional[str] = None
13
+ tag: PermissionDeniedErrorTag
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,7 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ PermissionDeniedErrorTag = typing.Union[
6
+ typing.Literal["PermissionDeniedError"], typing.Any
7
+ ]
@@ -2,6 +2,6 @@
2
2
 
3
3
  import typing
4
4
 
5
- from .property_key_tag import PropertyKeyTag
5
+ from .property_key_key import PropertyKeyKey
6
6
 
7
- PropertyKey = typing.Union[str, float, PropertyKeyTag]
7
+ PropertyKey = typing.Union[str, float, PropertyKeyKey]
@@ -3,18 +3,16 @@
3
3
  import typing
4
4
 
5
5
  import pydantic
6
- import typing_extensions
7
6
  from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
8
- from ..core.serialization import FieldMetadata
9
- from .property_key_tag_tag import PropertyKeyTagTag
7
+ from .property_key_key_tag import PropertyKeyKeyTag
10
8
 
11
9
 
12
- class PropertyKeyTag(UniversalBaseModel):
10
+ class PropertyKeyKey(UniversalBaseModel):
13
11
  """
14
12
  an object to be decoded into a globally shared symbol
15
13
  """
16
14
 
17
- tag: typing_extensions.Annotated[PropertyKeyTagTag, FieldMetadata(alias="_tag")]
15
+ tag: PropertyKeyKeyTag
18
16
  key: str
19
17
 
20
18
  if IS_PYDANTIC_V2:
@@ -2,4 +2,4 @@
2
2
 
3
3
  import typing
4
4
 
5
- PropertyKeyTagTag = typing.Union[typing.Literal["symbol"], typing.Any]
5
+ PropertyKeyKeyTag = typing.Union[typing.Literal["symbol"], typing.Any]
mirascope/llm/__init__.py CHANGED
@@ -92,8 +92,8 @@ from .providers import (
92
92
  Params,
93
93
  Provider,
94
94
  ProviderId,
95
- load_provider,
96
95
  register_provider,
96
+ reset_provider_registry,
97
97
  )
98
98
  from .responses import (
99
99
  AsyncChunkIterator,
@@ -117,6 +117,8 @@ from .responses import (
117
117
  TextStream,
118
118
  ThoughtStream,
119
119
  ToolCallStream,
120
+ Usage,
121
+ UsageDeltaChunk,
120
122
  )
121
123
  from .tools import (
122
124
  AsyncContextTool,
@@ -219,6 +221,8 @@ __all__ = [
219
221
  "ToolOutput",
220
222
  "Toolkit",
221
223
  "URLImageSource",
224
+ "Usage",
225
+ "UsageDeltaChunk",
222
226
  "UserContent",
223
227
  "UserContentPart",
224
228
  "UserMessage",
@@ -228,7 +232,6 @@ __all__ = [
228
232
  "exceptions",
229
233
  "format",
230
234
  "formatting",
231
- "load_provider",
232
235
  "mcp",
233
236
  "messages",
234
237
  "model",
@@ -238,6 +241,7 @@ __all__ = [
238
241
  "prompts",
239
242
  "providers",
240
243
  "register_provider",
244
+ "reset_provider_registry",
241
245
  "responses",
242
246
  "tool",
243
247
  "tools",
@@ -11,6 +11,7 @@ class MirascopeLLMError(Exception):
11
11
  """Base exception for all Mirascope LLM errors."""
12
12
 
13
13
  original_exception: Exception | None
14
+ provider: "ProviderId | None"
14
15
 
15
16
 
16
17
  class APIError(MirascopeLLMError):
@@ -18,6 +19,10 @@ class APIError(MirascopeLLMError):
18
19
 
19
20
  status_code: int | None
20
21
 
22
+ def __init__(self, message: str, status_code: int | None = None) -> None:
23
+ super().__init__(message)
24
+ self.status_code = status_code
25
+
21
26
 
22
27
  class ConnectionError(MirascopeLLMError):
23
28
  """Raised when unable to connect to the API (network issues, timeouts)."""
@@ -26,18 +31,30 @@ class ConnectionError(MirascopeLLMError):
26
31
  class AuthenticationError(APIError):
27
32
  """Raised for authentication failures (401, invalid API keys)."""
28
33
 
34
+ def __init__(self, message: str, status_code: int | None = None) -> None:
35
+ super().__init__(message, status_code=status_code or 401)
36
+
29
37
 
30
38
  class PermissionError(APIError):
31
39
  """Raised for permission/authorization failures (403)."""
32
40
 
41
+ def __init__(self, message: str, status_code: int | None = None) -> None:
42
+ super().__init__(message, status_code=status_code or 403)
43
+
33
44
 
34
45
  class BadRequestError(APIError):
35
46
  """Raised for malformed requests (400, 422)."""
36
47
 
48
+ def __init__(self, message: str, status_code: int | None = None) -> None:
49
+ super().__init__(message, status_code=status_code or 400)
50
+
37
51
 
38
52
  class NotFoundError(APIError):
39
53
  """Raised when requested resource is not found (404)."""
40
54
 
55
+ def __init__(self, message: str, status_code: int | None = None) -> None:
56
+ super().__init__(message, status_code=status_code or 404)
57
+
41
58
 
42
59
  class ToolNotFoundError(MirascopeLLMError):
43
60
  """Raised if a tool_call cannot be converted to any corresponding tool."""
@@ -96,15 +113,26 @@ class FormattingModeNotSupportedError(FeatureNotSupportedError):
96
113
  class RateLimitError(APIError):
97
114
  """Raised when rate limits are exceeded (429)."""
98
115
 
116
+ def __init__(self, message: str, status_code: int | None = None) -> None:
117
+ super().__init__(message, status_code=status_code or 429)
118
+
99
119
 
100
120
  class ServerError(APIError):
101
121
  """Raised for server-side errors (500+)."""
102
122
 
123
+ def __init__(self, message: str, status_code: int | None = None) -> None:
124
+ super().__init__(message, status_code=status_code or 500)
125
+
103
126
 
104
127
  class TimeoutError(MirascopeLLMError):
105
128
  """Raised when requests timeout or deadline exceeded."""
106
129
 
107
130
 
131
+ # This wraps the APIResponseValidationErrors that OpenAI and Anthropic both return.
132
+ class ResponseValidationError(MirascopeLLMError):
133
+ """Raised when API response fails validation."""
134
+
135
+
108
136
  class NoRegisteredProviderError(MirascopeLLMError):
109
137
  """Raised when no provider is registered for a given model_id."""
110
138
 
@@ -6,33 +6,41 @@ from .anthropic import (
6
6
  )
7
7
  from .base import BaseProvider, Params, Provider
8
8
  from .google import GoogleModelId, GoogleProvider
9
- from .load_provider import load, load_provider
10
9
  from .mlx import MLXModelId, MLXProvider
11
10
  from .model_id import ModelId
11
+ from .ollama import OllamaProvider
12
12
  from .openai import (
13
13
  OpenAIModelId,
14
14
  OpenAIProvider,
15
15
  )
16
+ from .openai.completions import BaseOpenAICompletionsProvider
16
17
  from .provider_id import KNOWN_PROVIDER_IDS, ProviderId
17
- from .provider_registry import get_provider_for_model, register_provider
18
+ from .provider_registry import (
19
+ get_provider_for_model,
20
+ register_provider,
21
+ reset_provider_registry,
22
+ )
23
+ from .together import TogetherProvider
18
24
 
19
25
  __all__ = [
20
26
  "KNOWN_PROVIDER_IDS",
21
27
  "AnthropicModelId",
22
28
  "AnthropicProvider",
29
+ "BaseOpenAICompletionsProvider",
23
30
  "BaseProvider",
24
31
  "GoogleModelId",
25
32
  "GoogleProvider",
26
33
  "MLXModelId",
27
34
  "MLXProvider",
28
35
  "ModelId",
36
+ "OllamaProvider",
29
37
  "OpenAIModelId",
30
38
  "OpenAIProvider",
31
39
  "Params",
32
40
  "Provider",
33
41
  "ProviderId",
42
+ "TogetherProvider",
34
43
  "get_provider_for_model",
35
- "load",
36
- "load_provider",
37
44
  "register_provider",
45
+ "reset_provider_registry",
38
46
  ]
@@ -3,22 +3,27 @@
3
3
  from typing import TYPE_CHECKING
4
4
 
5
5
  if TYPE_CHECKING:
6
+ from .beta_provider import AnthropicBetaProvider
6
7
  from .model_id import AnthropicModelId
7
8
  from .provider import AnthropicProvider
8
9
  else:
9
10
  try:
11
+ from .beta_provider import AnthropicBetaProvider
10
12
  from .model_id import AnthropicModelId
11
13
  from .provider import AnthropicProvider
12
14
  except ImportError: # pragma: no cover
13
15
  from .._missing_import_stubs import (
14
- create_import_error_stub,
15
16
  create_provider_stub,
16
17
  )
17
18
 
19
+ AnthropicBetaProvider = create_provider_stub(
20
+ "anthropic", "AnthropicBetaProvider"
21
+ )
18
22
  AnthropicProvider = create_provider_stub("anthropic", "AnthropicProvider")
19
23
  AnthropicModelId = str
20
24
 
21
25
  __all__ = [
26
+ "AnthropicBetaProvider",
22
27
  "AnthropicModelId",
23
28
  "AnthropicProvider",
24
29
  ]
@@ -1,13 +1,25 @@
1
- from .decode import (
2
- decode_async_stream,
3
- decode_response,
4
- decode_stream,
1
+ """Shared Anthropic utilities."""
2
+
3
+ from .decode import decode_async_stream, decode_response, decode_stream
4
+ from .encode import (
5
+ DEFAULT_FORMAT_MODE,
6
+ DEFAULT_MAX_TOKENS,
7
+ AnthropicImageMimeType,
8
+ encode_image_mime_type,
9
+ encode_request,
10
+ process_params,
5
11
  )
6
- from .encode import encode_request
12
+ from .errors import ANTHROPIC_ERROR_MAP
7
13
 
8
14
  __all__ = [
15
+ "ANTHROPIC_ERROR_MAP",
16
+ "DEFAULT_FORMAT_MODE",
17
+ "DEFAULT_MAX_TOKENS",
18
+ "AnthropicImageMimeType",
9
19
  "decode_async_stream",
10
20
  "decode_response",
11
21
  "decode_stream",
22
+ "encode_image_mime_type",
12
23
  "encode_request",
24
+ "process_params",
13
25
  ]