Skip to content

Comments

feat: align Azure/GCP SDKs with namespace vision (API-1988)#351

Open
Nelson-PROIA wants to merge 4 commits intomainfrom
nelson.proia/api-1988-sdk-v2-specific-providers-integration
Open

feat: align Azure/GCP SDKs with namespace vision (API-1988)#351
Nelson-PROIA wants to merge 4 commits intomainfrom
nelson.proia/api-1988-sdk-v2-specific-providers-integration

Conversation

@Nelson-PROIA
Copy link
Contributor

@Nelson-PROIA Nelson-PROIA commented Feb 16, 2026

Summary

Migrate Azure/GCP from standalone flat packages into PEP 420 namespace sub-packages.

# Before
from mistralai_azure import MistralAzure
from mistralai_gcp import MistralGoogleCloud

# After
from mistralai.azure.client import MistralAzure
from mistralai.gcp.client import MistralGCP

What changed

SDK migration

  • Rename packages/mistralai_azure/packages/azure/, packages/mistralai_gcp/packages/gcp/
  • Regenerate both SDKs under mistralai.azure.client / mistralai.gcp.client namespaces
  • Update hatch build config, dev-mode-dirs, and .genignore for new structure

Docs & examples

  • Rewrite all code examples with correct auth patterns (Azure: httpx.Client with api-version + follow_redirects; GCP: gcloud token + Vertex AI URL)
  • Remove all hardcoded env var defaults — use os.environ["VAR"] everywhere
  • Fix createcomplete heading/anchor mismatch in docs
  • Add missing imports (os, httpx, typing) in all code blocks
  • Add .env.example files for Azure and GCP

Config

  • Add namespace_packages = true to both pyproject.toml (mypy)
  • Fix pre-commit paths (example/examples/)
  • Fix tasks.py docstring placement

Tests

  • 157 Azure + 188 GCP parity tests (introspection, no credentials needed)
  • 21 Azure + 21 GCP integration tests (credential-gated)

Test plan

  • 347 passed, 42 skipped
  • Both wheels build and install side-by-side in clean venv
  • PEP 420 namespace integrity verified
  • Manual smoke test with Azure credentials
  • Manual smoke test with GCP credentials

@Nelson-PROIA Nelson-PROIA changed the title feat: migrate Azure/GCP SDKs to PEP 420 namespace packages (v2.0.0a1) feat: bundle Azure/GCP SDKs into single mistralai wheel with client subdirectory Feb 16, 2026
@Nelson-PROIA Nelson-PROIA changed the title feat: bundle Azure/GCP SDKs into single mistralai wheel with client subdirectory feat: align Azure/GCP SDKs with namespace vision (API-1988) Feb 16, 2026
@Nelson-PROIA Nelson-PROIA self-assigned this Feb 17, 2026
@Nelson-PROIA Nelson-PROIA force-pushed the nelson.proia/api-1988-sdk-v2-specific-providers-integration branch 5 times, most recently from d1fa5de to 379b180 Compare February 17, 2026 15:37
Copy link
Contributor

@louis-sanna-dev louis-sanna-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Nelson-PROIA I think it looks good, not an expert in python packaging to be fair.

Let's also check how to QA with actual Azure/GCP endpoints.

Two nitpicks proposed by Claude:

  • README import path inconsistency
    • README shows: from mistralai.azure import MistralAzure
    • Examples use: from mistralai.azure.client import MistralAzure[4:38 PM]  
  • Duplicate example files
    • examples/azure/az_chat_no_streaming.py and examples/azure/chat_no_streaming.py are identical
    • examples/gcp/async_chat_no_streaming.py and examples/gcp/gcp_async_chat_no_streaming.py are identical

@Nelson-PROIA Nelson-PROIA force-pushed the nelson.proia/api-1988-sdk-v2-specific-providers-integration branch 4 times, most recently from 3879e7f to a424d32 Compare February 20, 2026 10:48
Nelson-PROIA and others added 2 commits February 20, 2026 11:57
- Rename packages/mistralai_azure -> packages/azure,
  packages/mistralai_gcp -> packages/gcp
- Regenerate SDK code with v2 OpenAPI specs under PEP 420
  namespace layout (mistralai.azure.client, mistralai.gcp.client)
- Update build system: root pyproject.toml with dev-mode-dirs,
  wheel sources, bump to v2.0.0a4
- Update .speakeasy/workflow.yaml for new directory structure
- Cross-package consistency fixes: pydantic >=2.11.2,
  mypy ==1.15.0, package name hyphen, MistralGCPError,
  .genignore
- Update examples, migration guide
- Update lint script paths

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- test_azure_v2_parity.py: parametrized tests covering constructor,
  context manager, all chat/ocr params, sync/async parity
- test_gcp_v2_parity.py: parametrized tests covering constructor,
  context manager, all chat/fim params, sync/async parity
- test_azure_integration.py: credential-gated integration tests
  for Azure chat (sync/async/streaming/tools/JSON)
- test_gcp_integration.py: credential-gated integration tests
  for GCP chat + FIM (sync/async/streaming/tools)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Nelson-PROIA Nelson-PROIA force-pushed the nelson.proia/api-1988-sdk-v2-specific-providers-integration branch from a424d32 to 075db71 Compare February 20, 2026 10:58
Nelson-PROIA and others added 2 commits February 23, 2026 15:11
- Rewrite all code examples to use proper auth patterns (httpx.Client
  with api-version for Azure, gcloud token + Vertex URL for GCP)
- Remove hardcoded defaults everywhere; all env vars use os.environ[]
- Add .env.example files for Azure and GCP
- Fix create → complete heading mismatch in docs/sdks/
- Add missing imports (os, typing, httpx) across all code blocks
- Add follow_redirects=True consistently to Azure httpx clients
- Add namespace_packages=true to both pyproject.toml
- Fix pre-commit paths (example/ → examples/)
- Fix tasks.py docstring placement

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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