diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 6ad8a4b..26d49c2 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: 2d045ec7-2ebb-4f4d-ad25-40953b132161 management: - docChecksum: ee15d853ecc28d415d6b33191893a6ff + docChecksum: 87f5a2bcfbc64bec79241e2b0de25b9f docVersion: 0.0.2 - speakeasyVersion: 1.434.7 - generationVersion: 2.452.0 - releaseVersion: 1.2.1 - configChecksum: 5d659f51b118508e47958545e6b539d2 + speakeasyVersion: 1.438.1 + generationVersion: 2.457.2 + releaseVersion: 1.2.2 + configChecksum: bfa571f32b68bdb4917b69135c2eb818 repoURL: https://github.com/mistralai/client-python.git installationURL: https://github.com/mistralai/client-python.git published: true diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 501ac53..2419fdb 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -13,7 +13,7 @@ generation: oAuth2ClientCredentialsEnabled: true oAuth2PasswordEnabled: false python: - version: 1.2.1 + version: 1.2.2 additionalDependencies: dev: pytest: ^8.2.2 @@ -21,6 +21,7 @@ python: authors: - Mistral clientServerStatusCodesAsErrors: true + defaultErrorName: SDKError description: Python Client SDK for the Mistral AI API. enumFormat: union envVarPrefix: MISTRAL diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 5e498aa..da0afab 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,4 +1,4 @@ -speakeasyVersion: 1.434.7 +speakeasyVersion: 1.438.1 sources: mistral-azure-source: sourceNamespace: mistral-openapi-azure @@ -14,8 +14,8 @@ sources: - latest mistral-openapi: sourceNamespace: mistral-openapi - sourceRevisionDigest: sha256:e658442ebfc83351cbb7873fb17b03f07ff9edebd8eddfce5577e2c5c7bfafce - sourceBlobDigest: sha256:559403eaaa97c021eaf0022adddb1066694d879a946c87057e942806d5a2a2a2 + sourceRevisionDigest: sha256:e44702b93f6a8ac450f1d85b4197f6640f8efb3d5e06be98418ea79acd8f70be + sourceBlobDigest: sha256:94a9891a3bdf3fafea5c41cee226c5e366c206e91e39e734cd2d1163af74f688 tags: - latest - main @@ -33,10 +33,10 @@ targets: mistralai-sdk: source: mistral-openapi sourceNamespace: mistral-openapi - sourceRevisionDigest: sha256:e658442ebfc83351cbb7873fb17b03f07ff9edebd8eddfce5577e2c5c7bfafce - sourceBlobDigest: sha256:559403eaaa97c021eaf0022adddb1066694d879a946c87057e942806d5a2a2a2 + sourceRevisionDigest: sha256:e44702b93f6a8ac450f1d85b4197f6640f8efb3d5e06be98418ea79acd8f70be + sourceBlobDigest: sha256:94a9891a3bdf3fafea5c41cee226c5e366c206e91e39e734cd2d1163af74f688 codeSamplesNamespace: mistral-openapi-code-samples - codeSamplesRevisionDigest: sha256:f48900efe513aa95888e4035452ba1d54a2b1f8e872454ccb5bdca24d4fc7b09 + codeSamplesRevisionDigest: sha256:9e9f8f0da360280a8d42e2ccbee423871b74abd07e872e10892636ba4be4e3a5 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest @@ -44,18 +44,12 @@ workflow: mistral-azure-source: inputs: - location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-azure:main - registry: - location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-azure:main mistral-google-cloud-source: inputs: - location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-google-cloud:main - registry: - location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-google-cloud:main mistral-openapi: inputs: - location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi:main - registry: - location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi:main targets: mistralai-azure-sdk: target: python diff --git a/README.md b/README.md index a73c133..24c744a 100644 --- a/README.md +++ b/README.md @@ -556,10 +556,10 @@ By default, an API error will raise a models.SDKError exception, which has the f When custom error responses are specified for an operation, the SDK may also raise their associated exceptions. You can refer to respective *Errors* tables in SDK docs for more details on possible exception types for each operation. For example, the `list_async` method may raise the following exceptions: -| Error Type | Status Code | Content Type | -| -------------------------- | -------------------------- | -------------------------- | -| models.HTTPValidationError | 422 | application/json | -| models.SDKError | 4XX, 5XX | \*/\* | +| Error Type | Status Code | Content Type | +| -------------------------- | ----------- | ---------------- | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | ### Example @@ -595,9 +595,9 @@ except models.SDKError as e: You can override the default server globally by passing a server name to the `server: str` optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the names associated with the available servers: -| Name | Server | Variables | -| ----- | ------ | --------- | -| `eu` | `https://api.mistral.ai` | None | +| Name | Server | +| ---- | ------------------------ | +| `eu` | `https://api.mistral.ai` | #### Example @@ -618,7 +618,6 @@ if res is not None: ``` - ### Override Server URL Per-Client The default server can also be overridden globally by passing a URL to the `server_url: str` optional parameter when initializing the SDK client instance. For example: @@ -728,9 +727,9 @@ s = Mistral(async_client=CustomClient(httpx.AsyncClient())) This SDK supports the following security scheme globally: -| Name | Type | Scheme | Environment Variable | -| -------------------- | -------------------- | -------------------- | -------------------- | -| `api_key` | http | HTTP Bearer | `MISTRAL_API_KEY` | +| Name | Type | Scheme | Environment Variable | +| --------- | ---- | ----------- | -------------------- | +| `api_key` | http | HTTP Bearer | `MISTRAL_API_KEY` | To authenticate with the API the `api_key` parameter must be set when initializing the SDK client instance. For example: ```python diff --git a/RELEASES.md b/RELEASES.md index 6ffcd17..19d5c3b 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -68,4 +68,14 @@ Based on: ### Generated - [python v1.2.1] . ### Releases -- [PyPI v1.2.1] https://pypi.org/project/mistralai/1.2.1 - . \ No newline at end of file +- [PyPI v1.2.1] https://pypi.org/project/mistralai/1.2.1 - . + +## 2024-11-12 18:04:16 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.438.1 (2.457.2) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v1.2.2] . +### Releases +- [PyPI v1.2.2] https://pypi.org/project/mistralai/1.2.2 - . \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index a239400..95ac305 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "mistralai" -version = "1.2.1" +version = "1.2.2" description = "Python Client SDK for the Mistral AI API." authors = ["Mistral"] readme = "README-PYPI.md" diff --git a/src/mistralai/_version.py b/src/mistralai/_version.py index b7e6d2f..c6e29cc 100644 --- a/src/mistralai/_version.py +++ b/src/mistralai/_version.py @@ -3,7 +3,7 @@ import importlib.metadata __title__: str = "mistralai" -__version__: str = "1.2.1" +__version__: str = "1.2.2" try: if __package__ is not None: diff --git a/src/mistralai/agents.py b/src/mistralai/agents.py index 1b5c6a1..a45bcec 100644 --- a/src/mistralai/agents.py +++ b/src/mistralai/agents.py @@ -40,8 +40,8 @@ def complete( models.AgentsCompletionRequestToolChoiceTypedDict, ] ] = None, - presence_penalty: Optional[float] = 0, - frequency_penalty: Optional[float] = 0, + presence_penalty: Optional[float] = None, + frequency_penalty: Optional[float] = None, n: OptionalNullable[int] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, @@ -185,8 +185,8 @@ async def complete_async( models.AgentsCompletionRequestToolChoiceTypedDict, ] ] = None, - presence_penalty: Optional[float] = 0, - frequency_penalty: Optional[float] = 0, + presence_penalty: Optional[float] = None, + frequency_penalty: Optional[float] = None, n: OptionalNullable[int] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, @@ -330,8 +330,8 @@ def stream( models.AgentsCompletionStreamRequestToolChoiceTypedDict, ] ] = None, - presence_penalty: Optional[float] = 0, - frequency_penalty: Optional[float] = 0, + presence_penalty: Optional[float] = None, + frequency_penalty: Optional[float] = None, n: OptionalNullable[int] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, @@ -481,8 +481,8 @@ async def stream_async( models.AgentsCompletionStreamRequestToolChoiceTypedDict, ] ] = None, - presence_penalty: Optional[float] = 0, - frequency_penalty: Optional[float] = 0, + presence_penalty: Optional[float] = None, + frequency_penalty: Optional[float] = None, n: OptionalNullable[int] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, diff --git a/src/mistralai/chat.py b/src/mistralai/chat.py index dd5ca69..53313ca 100644 --- a/src/mistralai/chat.py +++ b/src/mistralai/chat.py @@ -34,8 +34,8 @@ def complete( models.ChatCompletionRequestToolChoiceTypedDict, ] ] = None, - presence_penalty: Optional[float] = 0, - frequency_penalty: Optional[float] = 0, + presence_penalty: Optional[float] = None, + frequency_penalty: Optional[float] = None, n: OptionalNullable[int] = UNSET, safe_prompt: Optional[bool] = False, retries: OptionalNullable[utils.RetryConfig] = UNSET, @@ -178,8 +178,8 @@ async def complete_async( models.ChatCompletionRequestToolChoiceTypedDict, ] ] = None, - presence_penalty: Optional[float] = 0, - frequency_penalty: Optional[float] = 0, + presence_penalty: Optional[float] = None, + frequency_penalty: Optional[float] = None, n: OptionalNullable[int] = UNSET, safe_prompt: Optional[bool] = False, retries: OptionalNullable[utils.RetryConfig] = UNSET, @@ -330,8 +330,8 @@ def stream( models.ChatCompletionStreamRequestToolChoiceTypedDict, ] ] = None, - presence_penalty: Optional[float] = 0, - frequency_penalty: Optional[float] = 0, + presence_penalty: Optional[float] = None, + frequency_penalty: Optional[float] = None, n: OptionalNullable[int] = UNSET, safe_prompt: Optional[bool] = False, retries: OptionalNullable[utils.RetryConfig] = UNSET, @@ -490,8 +490,8 @@ async def stream_async( models.ChatCompletionStreamRequestToolChoiceTypedDict, ] ] = None, - presence_penalty: Optional[float] = 0, - frequency_penalty: Optional[float] = 0, + presence_penalty: Optional[float] = None, + frequency_penalty: Optional[float] = None, n: OptionalNullable[int] = UNSET, safe_prompt: Optional[bool] = False, retries: OptionalNullable[utils.RetryConfig] = UNSET, diff --git a/src/mistralai/models/agentscompletionrequest.py b/src/mistralai/models/agentscompletionrequest.py index 99d074d..bce326a 100644 --- a/src/mistralai/models/agentscompletionrequest.py +++ b/src/mistralai/models/agentscompletionrequest.py @@ -98,10 +98,10 @@ class AgentsCompletionRequest(BaseModel): tool_choice: Optional[AgentsCompletionRequestToolChoice] = None - presence_penalty: Optional[float] = 0 + presence_penalty: Optional[float] = None r"""presence_penalty determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative.""" - frequency_penalty: Optional[float] = 0 + frequency_penalty: Optional[float] = None r"""frequency_penalty penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition.""" n: OptionalNullable[int] = UNSET diff --git a/src/mistralai/models/agentscompletionstreamrequest.py b/src/mistralai/models/agentscompletionstreamrequest.py index 4e1757a..94cc983 100644 --- a/src/mistralai/models/agentscompletionstreamrequest.py +++ b/src/mistralai/models/agentscompletionstreamrequest.py @@ -98,10 +98,10 @@ class AgentsCompletionStreamRequest(BaseModel): tool_choice: Optional[AgentsCompletionStreamRequestToolChoice] = None - presence_penalty: Optional[float] = 0 + presence_penalty: Optional[float] = None r"""presence_penalty determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative.""" - frequency_penalty: Optional[float] = 0 + frequency_penalty: Optional[float] = None r"""frequency_penalty penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition.""" n: OptionalNullable[int] = UNSET diff --git a/src/mistralai/models/chatcompletionrequest.py b/src/mistralai/models/chatcompletionrequest.py index 6cdf97b..b3435d5 100644 --- a/src/mistralai/models/chatcompletionrequest.py +++ b/src/mistralai/models/chatcompletionrequest.py @@ -110,10 +110,10 @@ class ChatCompletionRequest(BaseModel): tool_choice: Optional[ChatCompletionRequestToolChoice] = None - presence_penalty: Optional[float] = 0 + presence_penalty: Optional[float] = None r"""presence_penalty determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative.""" - frequency_penalty: Optional[float] = 0 + frequency_penalty: Optional[float] = None r"""frequency_penalty penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition.""" n: OptionalNullable[int] = UNSET diff --git a/src/mistralai/models/chatcompletionstreamrequest.py b/src/mistralai/models/chatcompletionstreamrequest.py index c56f523..a98eb33 100644 --- a/src/mistralai/models/chatcompletionstreamrequest.py +++ b/src/mistralai/models/chatcompletionstreamrequest.py @@ -110,10 +110,10 @@ class ChatCompletionStreamRequest(BaseModel): tool_choice: Optional[ChatCompletionStreamRequestToolChoice] = None - presence_penalty: Optional[float] = 0 + presence_penalty: Optional[float] = None r"""presence_penalty determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative.""" - frequency_penalty: Optional[float] = 0 + frequency_penalty: Optional[float] = None r"""frequency_penalty penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition.""" n: OptionalNullable[int] = UNSET diff --git a/src/mistralai/sdkconfiguration.py b/src/mistralai/sdkconfiguration.py index cc20551..72d59f5 100644 --- a/src/mistralai/sdkconfiguration.py +++ b/src/mistralai/sdkconfiguration.py @@ -28,9 +28,9 @@ class SDKConfiguration: server: Optional[str] = "" language: str = "python" openapi_doc_version: str = "0.0.2" - sdk_version: str = "1.2.1" - gen_version: str = "2.452.0" - user_agent: str = "speakeasy-sdk/python 1.2.1 2.452.0 0.0.2 mistralai" + sdk_version: str = "1.2.2" + gen_version: str = "2.457.2" + user_agent: str = "speakeasy-sdk/python 1.2.2 2.457.2 0.0.2 mistralai" retry_config: OptionalNullable[RetryConfig] = Field(default_factory=lambda: UNSET) timeout_ms: Optional[int] = None