Skip to content

Conversation

@louis-sanna-dev
Copy link
Contributor

@louis-sanna-dev louis-sanna-dev commented Feb 10, 2026

Summary

Updates the Speakeasy generation configuration with recommended settings for the v2 SDK major version bump. These changes improve forward compatibility and fix various naming/type resolution issues.

Configuration Changes

generation.fixes section

Flag Value Description
nameResolutionFeb2025 true Fixes ambiguous type names by prefixing with context (e.g., ToolsConversationRequestTool)
methodSignaturesApr2024 true Standardizes method parameter ordering and signatures
securityFeb2025 true Fixes security scheme resolution and authentication handling
sharedErrorComponentsApr2025 true Enables sharing of error response components across operations
sharedNestedComponentsJan2026 true Enables sharing of nested schema components to reduce duplication

python section

Flag Value Description
preApplyUnionDiscriminators true Applies union discriminators at generation time for better Pydantic performance
forwardCompatibleEnumsByDefault true Enums accept unknown values without crashing when API adds new values
forwardCompatibleUnionsByDefault tagged-only Discriminated unions get an Unknown variant for unrecognized values
flatAdditionalProperties true Simplifies access to additional properties

Breaking Changes

Type renames (documented in MIGRATION.md):

  • ToolsConversationRequestTool
  • ToolsTypedDictConversationRequestToolTypedDict
  • HandoffExecutionConversationRequestHandoffExecution
  • AgentVersionConversationRequestAgentVersion

Local test

uv build

uv run --isolated --with ./dist/mistralai-2.0.0a2-py3-none-any.whl python -c "import os; from mistralai.client import Mistral; client = Mistral(api_key=os.environ['MISTRAL_API_KEY']); res = client.chat.complete(model='mistral-small-latest', messages=[{'role': 'user', 'content': 'Say OK'}]); print(res.choices[0].message.content)"

returns "OK! 😊 How can I help you today?"

Remote test

(already published)
uv publish --publish-url https://test.pypi.org/legacy/ --token "$TEST_PYPI_TOKEN"
https://test.pypi.org/project/mistralai/#history

uv run --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ --with mistralai==2.0.0a2 python -c "import os; from mistralai.client import Mistral; client = Mistral(api_key=os.environ['MISTRAL_API_KEY']); res = client.chat.complete(model='mistral-small-latest', messages=[{'role': 'user', 'content': 'Say OK'}]); print(res.choices[0].message.content)"

returns "OK! 😊 How can I help you today?"

Linear: https://linear.app/mistral-ai/issue/API-1859/use-recommended-speakeasy-configs

@louis-sanna-dev louis-sanna-dev force-pushed the louissanna/api-1859-use-recommended-speakeasy-configs branch from e78306b to c596fff Compare February 10, 2026 16:02
Update generation fixes:
- Enable nameResolutionFeb2025, securityFeb2025, sharedErrorComponentsApr2025
- Add methodSignaturesApr2024 and sharedNestedComponentsJan2026

Update python section:
- Enable preApplyUnionDiscriminators
- Add forwardCompatibleEnumsByDefault: true
- Add forwardCompatibleUnionsByDefault: tagged-only
- Add flatAdditionalProperties: true

Bump version to 2.0.0a2.
Regenerated with speakeasy v1.685.0 using the updated gen.yaml config.

Key changes from the new config flags:
- Forward-compatible enums (accept unknown values)
- Forward-compatible tagged unions (Unknown variant)
- Updated type names from name resolution fixes
- Flat additional properties
- Update type references: Tools -> ConversationRequestTool
- Remove type= parameter from FunctionTool constructor (now a constant)
- Use isinstance() check instead of .type attribute access
- Document type name changes in MIGRATION.md
@louis-sanna-dev louis-sanna-dev force-pushed the louissanna/api-1859-use-recommended-speakeasy-configs branch from c596fff to ab9747f Compare February 10, 2026 16:08
@louis-sanna-dev louis-sanna-dev force-pushed the louissanna/api-1859-use-recommended-speakeasy-configs branch from e47e3d1 to 20207ae Compare February 10, 2026 17:22
- Rename azure examples from .py.py to .py
- Fix message types in azure and mistral examples
- Add type annotations where needed for mypy
- Enable mypy for examples in lint_custom_code.sh
@louis-sanna-dev louis-sanna-dev force-pushed the louissanna/api-1859-use-recommended-speakeasy-configs branch from 20207ae to 7aa34cb Compare February 10, 2026 17:22
@louis-sanna-dev louis-sanna-dev marked this pull request as ready for review February 10, 2026 17:27
@louis-sanna-dev louis-sanna-dev merged commit 6475b1c into main Feb 11, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants