From b6825b3d8c4ca064ecbbd3d9f04035268aba703a Mon Sep 17 00:00:00 2001 From: Nelson PROIA Date: Fri, 20 Feb 2026 11:57:46 +0100 Subject: [PATCH 1/2] feat: migrate Azure/GCP SDKs to PEP 420 namespace packages - 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 --- .genignore | 2 +- .speakeasy/workflow.lock | 26 +- .speakeasy/workflow.yaml | 4 +- MIGRATION.md | 20 + README.md | 78 +- docs/gen-yaml-diff.md | 43 ++ examples/azure/az_chat_no_streaming.py | 15 - examples/azure/chat_no_streaming.py | 10 +- examples/gcp/async_chat_no_streaming.py | 6 +- examples/gcp/gcp_async_chat_no_streaming.py | 24 - packages/azure/.genignore | 6 + .../{mistralai_azure => azure}/.gitattributes | 0 .../{mistralai_azure => azure}/.gitignore | 0 .../.speakeasy/gen.lock | 699 +++++++++--------- .../.speakeasy/gen.yaml | 21 +- .../CONTRIBUTING.md | 0 packages/{mistralai_azure => azure}/README.md | 65 +- .../{mistralai_azure => azure}/RELEASES.md | 0 packages/{mistralai_azure => azure}/USAGE.md | 12 +- .../docs/models/arguments.md | 0 .../docs/models/assistantmessage.md | 4 +- .../docs/models/assistantmessagecontent.md | 0 .../docs/models/chatcompletionchoice.md | 0 .../chatcompletionchoicefinishreason.md | 0 .../docs/models/chatcompletionrequest.md | 2 +- .../models/chatcompletionrequestmessage.md} | 2 +- .../docs/models/chatcompletionrequeststop.md | 0 .../models/chatcompletionrequesttoolchoice.md | 0 .../docs/models/chatcompletionresponse.md | 0 .../models/chatcompletionstreamrequest.md | 4 +- .../chatcompletionstreamrequestmessage.md} | 2 +- .../chatcompletionstreamrequeststop.md} | 2 +- .../chatcompletionstreamrequesttoolchoice.md | 0 .../docs/models/completionchunk.md | 0 .../docs/models/completionevent.md | 0 .../models/completionresponsestreamchoice.md | 10 + ...letionresponsestreamchoicefinishreason.md} | 2 +- .../docs/models/contentchunk.md | 0 packages/azure/docs/models/deltamessage.md | 10 + .../docs/models/deltamessagecontent.md} | 2 +- .../docs/models/document.md | 0 .../azure/docs/models/documenturlchunk.md | 10 + .../docs/models/filechunk.md | 0 .../docs/models/format_.md | 0 .../docs/models/function.md | 0 .../docs/models/functioncall.md | 0 .../docs/models/functionname.md | 0 .../docs/models/httpvalidationerror.md | 0 .../docs/models/imageurl.md | 0 packages/azure/docs/models/imageurlchunk.md | 11 + .../docs/models/imageurlunion.md} | 2 +- .../docs/models/jsonschema.md | 0 .../docs/models/loc.md | 0 .../docs/models/mistralpromptmode.md | 0 .../docs/models/ocrimageobject.md | 0 .../docs/models/ocrpagedimensions.md | 0 .../docs/models/ocrpageobject.md | 0 .../docs/models/ocrrequest.md | 0 .../docs/models/ocrresponse.md | 0 .../docs/models/ocrtableobject.md | 0 .../docs/models/ocrusageinfo.md | 0 .../docs/models/prediction.md | 0 packages/azure/docs/models/referencechunk.md | 9 + .../docs/models/responseformat.md | 0 .../docs/models/responseformats.md | 0 .../docs/models/security.md | 0 .../docs/models/systemmessage.md | 4 +- .../docs/models/systemmessagecontent.md | 0 .../docs/models/systemmessagecontentchunks.md | 0 .../docs/models/tableformat.md | 0 packages/azure/docs/models/textchunk.md | 9 + .../docs/models/thinkchunk.md | 4 +- .../docs/models/thinking.md | 0 .../docs/models/tool.md | 0 .../docs/models/toolcall.md | 0 .../docs/models/toolchoice.md | 0 .../docs/models/toolchoiceenum.md | 0 .../docs/models/toolmessage.md | 4 +- .../docs/models/toolmessagecontent.md | 0 .../docs/models/tooltypes.md | 0 .../docs/models/usageinfo.md | 0 .../docs/models/usermessage.md | 4 +- .../docs/models/usermessagecontent.md | 0 .../docs/models/utils/retryconfig.md | 0 .../docs/models/validationerror.md | 0 .../docs/sdks/chat/README.md | 12 +- .../docs/sdks/mistralazure/README.md | 0 packages/{mistralai_azure => azure}/py.typed | 0 packages/{mistralai_azure => azure}/pylintrc | 0 .../{mistralai_azure => azure}/pyproject.toml | 14 +- .../scripts/prepare_readme.py | 2 +- .../scripts/publish.sh | 0 .../src/mistralai/azure/client}/__init__.py | 0 .../azure/client}/_hooks/__init__.py | 0 .../azure/client}/_hooks/registration.py | 6 +- .../azure/client}/_hooks/sdkhooks.py | 2 +- .../mistralai/azure/client}/_hooks/types.py | 4 +- .../src/mistralai/azure/client}/_version.py | 6 +- .../src/mistralai/azure/client}/basesdk.py | 10 +- .../src/mistralai/azure/client}/chat.py | 54 +- .../src/mistralai/azure/client}/httpclient.py | 0 .../azure/client}/models/__init__.py | 111 +-- .../azure/client}/models/assistantmessage.py | 23 +- .../client}/models/chatcompletionchoice.py | 2 +- .../client}/models/chatcompletionrequest.py | 14 +- .../client}/models/chatcompletionresponse.py | 2 +- .../models/chatcompletionstreamrequest.py | 26 +- .../azure/client}/models/completionchunk.py | 2 +- .../azure/client}/models/completionevent.py | 2 +- .../models/completionresponsestreamchoice.py | 13 +- .../azure/client}/models/contentchunk.py | 2 +- .../azure/client}/models/deltamessage.py | 14 +- .../azure/client}/models/documenturlchunk.py | 24 +- .../azure/client}/models/filechunk.py | 4 +- .../azure/client}/models/function.py | 2 +- .../azure/client}/models/functioncall.py | 2 +- .../azure/client}/models/functionname.py | 2 +- .../client}/models/httpvalidationerror.py | 4 +- .../azure/client}/models/imageurl.py | 2 +- .../azure/client/models/imageurlchunk.py | 38 + .../azure/client}/models/jsonschema.py | 2 +- .../azure/client}/models/mistralazureerror.py | 0 .../azure/client}/models/mistralpromptmode.py | 2 +- .../azure/client}/models/no_response_error.py | 0 .../azure/client}/models/ocrimageobject.py | 2 +- .../azure/client}/models/ocrpagedimensions.py | 2 +- .../azure/client}/models/ocrpageobject.py | 2 +- .../azure/client}/models/ocrrequest.py | 2 +- .../azure/client}/models/ocrresponse.py | 2 +- .../azure/client}/models/ocrtableobject.py | 13 +- .../azure/client}/models/ocrusageinfo.py | 2 +- .../azure/client}/models/prediction.py | 4 +- .../azure/client/models/referencechunk.py | 25 + .../azure/client}/models/responseformat.py | 2 +- .../azure/client}/models/responseformats.py | 0 .../client}/models/responsevalidationerror.py | 2 +- .../azure/client}/models/sdkerror.py | 2 +- .../azure/client}/models/security.py | 4 +- .../azure/client}/models/systemmessage.py | 19 +- .../models/systemmessagecontentchunks.py | 6 +- .../azure/client/models/textchunk.py | 23 + .../azure/client}/models/thinkchunk.py | 19 +- .../mistralai/azure/client}/models/tool.py | 2 +- .../azure/client}/models/toolcall.py | 2 +- .../azure/client}/models/toolchoice.py | 2 +- .../azure/client}/models/toolchoiceenum.py | 0 .../azure/client}/models/toolmessage.py | 23 +- .../azure/client}/models/tooltypes.py | 2 +- .../azure/client}/models/usageinfo.py | 2 +- .../azure/client}/models/usermessage.py | 21 +- .../azure/client}/models/validationerror.py | 2 +- .../src/mistralai/azure/client}/ocr.py | 8 +- .../src/mistralai/azure/client}/py.typed | 0 .../src/mistralai/azure/client}/sdk.py | 67 +- .../azure/client}/sdkconfiguration.py | 4 +- .../mistralai/azure/client}/types/__init__.py | 0 .../azure/client}/types/basemodel.py | 0 .../mistralai/azure/client}/utils/__init__.py | 0 .../azure/client}/utils/annotations.py | 0 .../azure/client}/utils/datetimes.py | 0 .../mistralai/azure/client}/utils/enums.py | 0 .../azure/client}/utils/eventstreaming.py | 0 .../mistralai/azure/client}/utils/forms.py | 0 .../mistralai/azure/client}/utils/headers.py | 0 .../mistralai/azure/client}/utils/logger.py | 0 .../mistralai/azure/client}/utils/metadata.py | 0 .../azure/client}/utils/queryparams.py | 0 .../azure/client}/utils/requestbodies.py | 0 .../mistralai/azure/client}/utils/retries.py | 0 .../mistralai/azure/client}/utils/security.py | 0 .../azure/client}/utils/serializers.py | 0 .../client}/utils/unmarshal_json_response.py | 2 +- .../src/mistralai/azure/client}/utils/url.py | 0 .../mistralai/azure/client}/utils/values.py | 0 packages/{mistralai_azure => azure}/uv.lock | 2 +- packages/gcp/.genignore | 6 + .../{mistralai_gcp => gcp}/.gitattributes | 0 packages/{mistralai_gcp => gcp}/.gitignore | 0 .../.speakeasy/gen.lock | 647 ++++++++-------- .../.speakeasy/gen.yaml | 24 +- .../{mistralai_gcp => gcp}/CONTRIBUTING.md | 0 packages/{mistralai_gcp => gcp}/README.md | 29 +- packages/{mistralai_gcp => gcp}/RELEASES.md | 0 packages/{mistralai_gcp => gcp}/USAGE.md | 4 +- .../docs/models/arguments.md | 0 .../docs/models/assistantmessage.md | 4 +- .../docs/models/assistantmessagecontent.md | 0 .../docs/models/chatcompletionchoice.md | 0 .../chatcompletionchoicefinishreason.md | 0 .../docs/models/chatcompletionrequest.md | 2 +- .../models/chatcompletionrequestmessage.md} | 2 +- .../docs/models/chatcompletionrequeststop.md | 0 .../models/chatcompletionrequesttoolchoice.md | 0 .../docs/models/chatcompletionresponse.md | 0 .../models/chatcompletionstreamrequest.md | 4 +- .../chatcompletionstreamrequestmessage.md} | 2 +- .../chatcompletionstreamrequeststop.md} | 2 +- .../chatcompletionstreamrequesttoolchoice.md | 0 .../docs/models/completionchunk.md | 0 .../docs/models/completionevent.md | 0 .../models/completionresponsestreamchoice.md | 10 + ...letionresponsestreamchoicefinishreason.md} | 2 +- .../docs/models/contentchunk.md | 0 packages/gcp/docs/models/deltamessage.md | 10 + .../docs/models/deltamessagecontent.md} | 2 +- .../docs/models/fimcompletionrequest.md | 0 .../docs/models/fimcompletionrequeststop.md | 0 .../docs/models/fimcompletionresponse.md | 0 .../docs/models/fimcompletionstreamrequest.md | 0 .../models/fimcompletionstreamrequeststop.md | 0 .../docs/models/function.md | 0 .../docs/models/functioncall.md | 0 .../docs/models/functionname.md | 0 .../docs/models/httpvalidationerror.md | 0 .../docs/models/imageurl.md | 0 packages/gcp/docs/models/imageurlchunk.md | 11 + .../docs/models/imageurlunion.md} | 2 +- .../docs/models/jsonschema.md | 0 .../{mistralai_gcp => gcp}/docs/models/loc.md | 0 .../docs/models/mistralpromptmode.md | 0 .../docs/models/prediction.md | 0 packages/gcp/docs/models/referencechunk.md | 9 + .../docs/models/responseformat.md | 0 .../docs/models/responseformats.md | 0 .../docs/models/security.md | 0 .../docs/models/systemmessage.md | 4 +- .../docs/models/systemmessagecontent.md | 0 .../docs/models/systemmessagecontentchunks.md | 0 packages/gcp/docs/models/textchunk.md | 9 + .../docs/models/thinkchunk.md | 4 +- .../docs/models/thinking.md | 0 .../docs/models/tool.md | 0 .../docs/models/toolcall.md | 0 .../docs/models/toolchoice.md | 0 .../docs/models/toolchoiceenum.md | 0 .../docs/models/toolmessage.md | 4 +- .../docs/models/toolmessagecontent.md | 0 .../docs/models/tooltypes.md | 0 .../docs/models/usageinfo.md | 0 .../docs/models/usermessage.md | 4 +- .../docs/models/usermessagecontent.md | 0 .../docs/models/utils/retryconfig.md | 0 .../docs/models/validationerror.md | 0 .../docs/sdks/chat/README.md | 4 +- .../docs/sdks/fim/README.md | 4 +- .../docs/sdks/mistralgcp/README.md | 0 packages/{mistralai_gcp => gcp}/py.typed | 0 packages/{mistralai_gcp => gcp}/pylintrc | 0 .../{mistralai_gcp => gcp}/pyproject.toml | 18 +- .../scripts/prepare_readme.py | 2 +- .../{mistralai_gcp => gcp}/scripts/publish.sh | 0 .../src/mistralai/gcp/client}/__init__.py | 0 .../mistralai/gcp/client}/_hooks/__init__.py | 0 .../gcp/client/_hooks/registration.py | 43 ++ .../mistralai/gcp/client}/_hooks/sdkhooks.py | 2 +- .../src/mistralai/gcp/client}/_hooks/types.py | 4 +- .../src/mistralai/gcp/client}/_version.py | 4 +- .../src/mistralai/gcp/client}/basesdk.py | 10 +- .../src/mistralai/gcp/client}/chat.py | 54 +- .../src/mistralai/gcp/client}/fim.py | 10 +- .../src/mistralai/gcp/client}/httpclient.py | 0 .../mistralai/gcp/client}/models/__init__.py | 107 +-- .../gcp/client}/models/assistantmessage.py | 23 +- .../client}/models/chatcompletionchoice.py | 2 +- .../client}/models/chatcompletionrequest.py | 14 +- .../client}/models/chatcompletionresponse.py | 2 +- .../models/chatcompletionstreamrequest.py | 26 +- .../gcp/client}/models/completionchunk.py | 2 +- .../gcp/client}/models/completionevent.py | 2 +- .../models/completionresponsestreamchoice.py | 13 +- .../gcp/client}/models/contentchunk.py | 2 +- .../gcp/client}/models/deltamessage.py | 14 +- .../client}/models/fimcompletionrequest.py | 2 +- .../client}/models/fimcompletionresponse.py | 2 +- .../models/fimcompletionstreamrequest.py | 2 +- .../mistralai/gcp/client}/models/function.py | 2 +- .../gcp/client}/models/functioncall.py | 2 +- .../gcp/client}/models/functionname.py | 2 +- .../gcp/client}/models/httpvalidationerror.py | 6 +- .../mistralai/gcp/client}/models/imageurl.py | 2 +- .../gcp/client/models/imageurlchunk.py | 36 + .../gcp/client}/models/jsonschema.py | 2 +- .../gcp/client}/models/mistralgcperror.py | 2 +- .../gcp/client}/models/mistralpromptmode.py | 2 +- .../gcp/client}/models/no_response_error.py | 0 .../gcp/client}/models/prediction.py | 4 +- .../gcp/client/models/referencechunk.py | 25 + .../gcp/client}/models/responseformat.py | 2 +- .../gcp/client}/models/responseformats.py | 0 .../client}/models/responsevalidationerror.py | 4 +- .../mistralai/gcp/client}/models/sdkerror.py | 4 +- .../mistralai/gcp/client}/models/security.py | 4 +- .../gcp/client}/models/systemmessage.py | 19 +- .../models/systemmessagecontentchunks.py | 6 +- .../mistralai/gcp/client/models/textchunk.py | 23 + .../gcp/client}/models/thinkchunk.py | 19 +- .../src/mistralai/gcp/client}/models/tool.py | 2 +- .../mistralai/gcp/client}/models/toolcall.py | 2 +- .../gcp/client}/models/toolchoice.py | 2 +- .../gcp/client}/models/toolchoiceenum.py | 0 .../gcp/client}/models/toolmessage.py | 23 +- .../mistralai/gcp/client}/models/tooltypes.py | 2 +- .../mistralai/gcp/client}/models/usageinfo.py | 2 +- .../gcp/client}/models/usermessage.py | 21 +- .../gcp/client}/models/validationerror.py | 2 +- .../src/mistralai/gcp/client}/py.typed | 0 packages/gcp/src/mistralai/gcp/client/sdk.py | 189 +++++ .../mistralai/gcp/client}/sdkconfiguration.py | 4 +- .../mistralai/gcp/client}/types/__init__.py | 0 .../mistralai/gcp/client}/types/basemodel.py | 0 .../mistralai/gcp/client}/utils/__init__.py | 0 .../gcp/client}/utils/annotations.py | 0 .../mistralai/gcp/client}/utils/datetimes.py | 0 .../src/mistralai/gcp/client}/utils/enums.py | 0 .../gcp/client}/utils/eventstreaming.py | 0 .../src/mistralai/gcp/client}/utils/forms.py | 0 .../mistralai/gcp/client}/utils/headers.py | 0 .../src/mistralai/gcp/client}/utils/logger.py | 0 .../mistralai/gcp/client}/utils/metadata.py | 0 .../gcp/client}/utils/queryparams.py | 0 .../gcp/client}/utils/requestbodies.py | 0 .../mistralai/gcp/client}/utils/retries.py | 0 .../mistralai/gcp/client}/utils/security.py | 0 .../gcp/client}/utils/serializers.py | 0 .../client}/utils/unmarshal_json_response.py | 2 +- .../src/mistralai/gcp/client}/utils/url.py | 0 .../src/mistralai/gcp/client}/utils/values.py | 0 packages/{mistralai_gcp => gcp}/uv.lock | 62 +- packages/mistralai_azure/.genignore | 5 - .../mistralai_azure/.vscode/settings.json | 6 - .../docs/models/assistantmessagerole.md | 8 - .../models/completionresponsestreamchoice.md | 10 - .../docs/models/deltamessage.md | 10 - .../docs/models/documenturlchunk.md | 10 - .../docs/models/documenturlchunktype.md | 8 - .../docs/models/imageurlchunk.md | 11 - .../docs/models/imageurlchunktype.md | 8 - .../docs/models/referencechunk.md | 9 - .../docs/models/referencechunktype.md | 8 - packages/mistralai_azure/docs/models/role.md | 8 - .../mistralai_azure/docs/models/textchunk.md | 9 - .../docs/models/thinkchunktype.md | 8 - .../docs/models/toolmessagerole.md | 8 - packages/mistralai_azure/docs/models/type.md | 8 - .../docs/models/usermessagerole.md | 8 - .../_hooks/custom_user_agent.py | 22 - .../mistralai_azure/models/imageurlchunk.py | 33 - .../mistralai_azure/models/referencechunk.py | 20 - .../src/mistralai_azure/models/textchunk.py | 20 - packages/mistralai_gcp/.genignore | 5 - packages/mistralai_gcp/.vscode/settings.json | 6 - .../docs/models/assistantmessagerole.md | 8 - .../models/completionresponsestreamchoice.md | 10 - .../mistralai_gcp/docs/models/deltamessage.md | 10 - .../docs/models/imageurlchunk.md | 11 - .../docs/models/imageurlchunktype.md | 8 - .../docs/models/referencechunk.md | 9 - .../docs/models/referencechunktype.md | 8 - packages/mistralai_gcp/docs/models/role.md | 8 - .../mistralai_gcp/docs/models/textchunk.md | 9 - .../docs/models/thinkchunktype.md | 8 - .../docs/models/toolmessagerole.md | 8 - packages/mistralai_gcp/docs/models/type.md | 8 - .../docs/models/usermessagerole.md | 8 - .../mistralai_gcp/_hooks/custom_user_agent.py | 22 - .../src/mistralai_gcp/_hooks/registration.py | 15 - .../src/mistralai_gcp/models/imageurlchunk.py | 33 - .../mistralai_gcp/models/referencechunk.py | 20 - .../src/mistralai_gcp/models/textchunk.py | 20 - .../mistralai_gcp/src/mistralai_gcp/sdk.py | 233 ------ pyproject.toml | 23 +- scripts/lint_custom_code.sh | 14 +- scripts/run_examples.sh | 2 +- uv.lock | 4 +- 374 files changed, 2021 insertions(+), 2171 deletions(-) create mode 100644 docs/gen-yaml-diff.md delete mode 100644 examples/azure/az_chat_no_streaming.py delete mode 100755 examples/gcp/gcp_async_chat_no_streaming.py create mode 100644 packages/azure/.genignore rename packages/{mistralai_azure => azure}/.gitattributes (100%) rename packages/{mistralai_azure => azure}/.gitignore (100%) rename packages/{mistralai_azure => azure}/.speakeasy/gen.lock (69%) rename packages/{mistralai_azure => azure}/.speakeasy/gen.yaml (78%) rename packages/{mistralai_azure => azure}/CONTRIBUTING.md (100%) rename packages/{mistralai_azure => azure}/README.md (87%) rename packages/{mistralai_azure => azure}/RELEASES.md (100%) rename packages/{mistralai_azure => azure}/USAGE.md (76%) rename packages/{mistralai_azure => azure}/docs/models/arguments.md (100%) rename packages/{mistralai_azure => azure}/docs/models/assistantmessage.md (95%) rename packages/{mistralai_azure => azure}/docs/models/assistantmessagecontent.md (100%) rename packages/{mistralai_azure => azure}/docs/models/chatcompletionchoice.md (100%) rename packages/{mistralai_azure => azure}/docs/models/chatcompletionchoicefinishreason.md (100%) rename packages/{mistralai_azure => azure}/docs/models/chatcompletionrequest.md (99%) rename packages/{mistralai_azure/docs/models/messages.md => azure/docs/models/chatcompletionrequestmessage.md} (92%) rename packages/{mistralai_azure => azure}/docs/models/chatcompletionrequeststop.md (100%) rename packages/{mistralai_azure => azure}/docs/models/chatcompletionrequesttoolchoice.md (100%) rename packages/{mistralai_azure => azure}/docs/models/chatcompletionresponse.md (100%) rename packages/{mistralai_azure => azure}/docs/models/chatcompletionstreamrequest.md (99%) rename packages/{mistralai_gcp/docs/models/chatcompletionrequestmessages.md => azure/docs/models/chatcompletionstreamrequestmessage.md} (91%) rename packages/{mistralai_gcp/docs/models/stop.md => azure/docs/models/chatcompletionstreamrequeststop.md} (88%) rename packages/{mistralai_azure => azure}/docs/models/chatcompletionstreamrequesttoolchoice.md (100%) rename packages/{mistralai_azure => azure}/docs/models/completionchunk.md (100%) rename packages/{mistralai_azure => azure}/docs/models/completionevent.md (100%) create mode 100644 packages/azure/docs/models/completionresponsestreamchoice.md rename packages/{mistralai_gcp/docs/models/finishreason.md => azure/docs/models/completionresponsestreamchoicefinishreason.md} (81%) rename packages/{mistralai_azure => azure}/docs/models/contentchunk.md (100%) create mode 100644 packages/azure/docs/models/deltamessage.md rename packages/{mistralai_gcp/docs/models/content.md => azure/docs/models/deltamessagecontent.md} (89%) rename packages/{mistralai_azure => azure}/docs/models/document.md (100%) create mode 100644 packages/azure/docs/models/documenturlchunk.md rename packages/{mistralai_azure => azure}/docs/models/filechunk.md (100%) rename packages/{mistralai_azure => azure}/docs/models/format_.md (100%) rename packages/{mistralai_azure => azure}/docs/models/function.md (100%) rename packages/{mistralai_azure => azure}/docs/models/functioncall.md (100%) rename packages/{mistralai_azure => azure}/docs/models/functionname.md (100%) rename packages/{mistralai_azure => azure}/docs/models/httpvalidationerror.md (100%) rename packages/{mistralai_azure => azure}/docs/models/imageurl.md (100%) create mode 100644 packages/azure/docs/models/imageurlchunk.md rename packages/{mistralai_gcp/docs/models/imageurlchunkimageurl.md => azure/docs/models/imageurlunion.md} (86%) rename packages/{mistralai_azure => azure}/docs/models/jsonschema.md (100%) rename packages/{mistralai_azure => azure}/docs/models/loc.md (100%) rename packages/{mistralai_azure => azure}/docs/models/mistralpromptmode.md (100%) rename packages/{mistralai_azure => azure}/docs/models/ocrimageobject.md (100%) rename packages/{mistralai_azure => azure}/docs/models/ocrpagedimensions.md (100%) rename packages/{mistralai_azure => azure}/docs/models/ocrpageobject.md (100%) rename packages/{mistralai_azure => azure}/docs/models/ocrrequest.md (100%) rename packages/{mistralai_azure => azure}/docs/models/ocrresponse.md (100%) rename packages/{mistralai_azure => azure}/docs/models/ocrtableobject.md (100%) rename packages/{mistralai_azure => azure}/docs/models/ocrusageinfo.md (100%) rename packages/{mistralai_azure => azure}/docs/models/prediction.md (100%) create mode 100644 packages/azure/docs/models/referencechunk.md rename packages/{mistralai_azure => azure}/docs/models/responseformat.md (100%) rename packages/{mistralai_azure => azure}/docs/models/responseformats.md (100%) rename packages/{mistralai_azure => azure}/docs/models/security.md (100%) rename packages/{mistralai_gcp => azure}/docs/models/systemmessage.md (88%) rename packages/{mistralai_azure => azure}/docs/models/systemmessagecontent.md (100%) rename packages/{mistralai_azure => azure}/docs/models/systemmessagecontentchunks.md (100%) rename packages/{mistralai_azure => azure}/docs/models/tableformat.md (100%) create mode 100644 packages/azure/docs/models/textchunk.md rename packages/{mistralai_azure => azure}/docs/models/thinkchunk.md (91%) rename packages/{mistralai_azure => azure}/docs/models/thinking.md (100%) rename packages/{mistralai_azure => azure}/docs/models/tool.md (100%) rename packages/{mistralai_azure => azure}/docs/models/toolcall.md (100%) rename packages/{mistralai_azure => azure}/docs/models/toolchoice.md (100%) rename packages/{mistralai_azure => azure}/docs/models/toolchoiceenum.md (100%) rename packages/{mistralai_gcp => azure}/docs/models/toolmessage.md (92%) rename packages/{mistralai_azure => azure}/docs/models/toolmessagecontent.md (100%) rename packages/{mistralai_azure => azure}/docs/models/tooltypes.md (100%) rename packages/{mistralai_azure => azure}/docs/models/usageinfo.md (100%) rename packages/{mistralai_gcp => azure}/docs/models/usermessage.md (89%) rename packages/{mistralai_azure => azure}/docs/models/usermessagecontent.md (100%) rename packages/{mistralai_azure => azure}/docs/models/utils/retryconfig.md (100%) rename packages/{mistralai_azure => azure}/docs/models/validationerror.md (100%) rename packages/{mistralai_azure => azure}/docs/sdks/chat/README.md (98%) rename packages/{mistralai_azure => azure}/docs/sdks/mistralazure/README.md (100%) rename packages/{mistralai_azure => azure}/py.typed (100%) rename packages/{mistralai_azure => azure}/pylintrc (100%) rename packages/{mistralai_azure => azure}/pyproject.toml (79%) rename packages/{mistralai_gcp => azure}/scripts/prepare_readme.py (96%) rename packages/{mistralai_azure => azure}/scripts/publish.sh (100%) rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/__init__.py (100%) rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/_hooks/__init__.py (100%) rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/_hooks/registration.py (79%) rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/_hooks/sdkhooks.py (97%) rename packages/{mistralai_gcp/src/mistralai_gcp => azure/src/mistralai/azure/client}/_hooks/types.py (95%) rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/_version.py (69%) rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/basesdk.py (98%) rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/chat.py (96%) rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/httpclient.py (100%) rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/models/__init__.py (85%) rename packages/{mistralai_gcp/src/mistralai_gcp => azure/src/mistralai/azure/client}/models/assistantmessage.py (80%) rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/models/chatcompletionchoice.py (91%) rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/models/chatcompletionrequest.py (97%) rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/models/chatcompletionresponse.py (92%) rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/models/chatcompletionstreamrequest.py (94%) rename packages/{mistralai_gcp/src/mistralai_gcp => azure/src/mistralai/azure/client}/models/completionchunk.py (94%) rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/models/completionevent.py (87%) rename packages/{mistralai_gcp/src/mistralai_gcp => azure/src/mistralai/azure/client}/models/completionresponsestreamchoice.py (82%) rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/models/contentchunk.py (93%) rename packages/{mistralai_gcp/src/mistralai_gcp => azure/src/mistralai/azure/client}/models/deltamessage.py (81%) rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/models/documenturlchunk.py (72%) rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/models/filechunk.py (83%) rename packages/{mistralai_gcp/src/mistralai_gcp => azure/src/mistralai/azure/client}/models/function.py (90%) rename packages/{mistralai_gcp/src/mistralai_gcp => azure/src/mistralai/azure/client}/models/functioncall.py (91%) rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/models/functionname.py (89%) rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/models/httpvalidationerror.py (87%) rename packages/{mistralai_gcp/src/mistralai_gcp => azure/src/mistralai/azure/client}/models/imageurl.py (96%) create mode 100644 packages/azure/src/mistralai/azure/client/models/imageurlchunk.py rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/models/jsonschema.py (97%) rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/models/mistralazureerror.py (100%) rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/models/mistralpromptmode.py (89%) rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/models/no_response_error.py (100%) rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/models/ocrimageobject.py (98%) rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/models/ocrpagedimensions.py (91%) rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/models/ocrpageobject.py (98%) rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/models/ocrrequest.py (99%) rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/models/ocrresponse.py (97%) rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/models/ocrtableobject.py (78%) rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/models/ocrusageinfo.py (97%) rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/models/prediction.py (89%) create mode 100644 packages/azure/src/mistralai/azure/client/models/referencechunk.py rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/models/responseformat.py (98%) rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/models/responseformats.py (100%) rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/models/responsevalidationerror.py (92%) rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/models/sdkerror.py (95%) rename packages/{mistralai_gcp/src/mistralai_gcp => azure/src/mistralai/azure/client}/models/security.py (80%) rename packages/{mistralai_gcp/src/mistralai_gcp => azure/src/mistralai/azure/client}/models/systemmessage.py (57%) rename packages/{mistralai_gcp/src/mistralai_gcp => azure/src/mistralai/azure/client}/models/systemmessagecontentchunks.py (66%) create mode 100644 packages/azure/src/mistralai/azure/client/models/textchunk.py rename packages/{mistralai_gcp/src/mistralai_gcp => azure/src/mistralai/azure/client}/models/thinkchunk.py (65%) rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/models/tool.py (89%) rename packages/{mistralai_gcp/src/mistralai_gcp => azure/src/mistralai/azure/client}/models/toolcall.py (92%) rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/models/toolchoice.py (93%) rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/models/toolchoiceenum.py (100%) rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/models/toolmessage.py (77%) rename packages/{mistralai_gcp/src/mistralai_gcp => azure/src/mistralai/azure/client}/models/tooltypes.py (77%) rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/models/usageinfo.py (98%) rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/models/usermessage.py (73%) rename packages/{mistralai_gcp/src/mistralai_gcp => azure/src/mistralai/azure/client}/models/validationerror.py (90%) rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/ocr.py (97%) rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/py.typed (100%) rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/sdk.py (72%) rename packages/{mistralai_gcp/src/mistralai_gcp => azure/src/mistralai/azure/client}/sdkconfiguration.py (93%) rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/types/__init__.py (100%) rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/types/basemodel.py (100%) rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/utils/__init__.py (100%) rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/utils/annotations.py (100%) rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/utils/datetimes.py (100%) rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/utils/enums.py (100%) rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/utils/eventstreaming.py (100%) rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/utils/forms.py (100%) rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/utils/headers.py (100%) rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/utils/logger.py (100%) rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/utils/metadata.py (100%) rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/utils/queryparams.py (100%) rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/utils/requestbodies.py (100%) rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/utils/retries.py (100%) rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/utils/security.py (100%) rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/utils/serializers.py (100%) rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/utils/unmarshal_json_response.py (95%) rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/utils/url.py (100%) rename packages/{mistralai_azure/src/mistralai_azure => azure/src/mistralai/azure/client}/utils/values.py (100%) rename packages/{mistralai_azure => azure}/uv.lock (99%) create mode 100644 packages/gcp/.genignore rename packages/{mistralai_gcp => gcp}/.gitattributes (100%) rename packages/{mistralai_gcp => gcp}/.gitignore (100%) rename packages/{mistralai_gcp => gcp}/.speakeasy/gen.lock (55%) rename packages/{mistralai_gcp => gcp}/.speakeasy/gen.yaml (78%) rename packages/{mistralai_gcp => gcp}/CONTRIBUTING.md (100%) rename packages/{mistralai_gcp => gcp}/README.md (94%) rename packages/{mistralai_gcp => gcp}/RELEASES.md (100%) rename packages/{mistralai_gcp => gcp}/USAGE.md (92%) rename packages/{mistralai_gcp => gcp}/docs/models/arguments.md (100%) rename packages/{mistralai_gcp => gcp}/docs/models/assistantmessage.md (95%) rename packages/{mistralai_gcp => gcp}/docs/models/assistantmessagecontent.md (100%) rename packages/{mistralai_gcp => gcp}/docs/models/chatcompletionchoice.md (100%) rename packages/{mistralai_gcp => gcp}/docs/models/chatcompletionchoicefinishreason.md (100%) rename packages/{mistralai_gcp => gcp}/docs/models/chatcompletionrequest.md (99%) rename packages/{mistralai_gcp/docs/models/messages.md => gcp/docs/models/chatcompletionrequestmessage.md} (92%) rename packages/{mistralai_gcp => gcp}/docs/models/chatcompletionrequeststop.md (100%) rename packages/{mistralai_gcp => gcp}/docs/models/chatcompletionrequesttoolchoice.md (100%) rename packages/{mistralai_gcp => gcp}/docs/models/chatcompletionresponse.md (100%) rename packages/{mistralai_gcp => gcp}/docs/models/chatcompletionstreamrequest.md (99%) rename packages/{mistralai_azure/docs/models/chatcompletionrequestmessages.md => gcp/docs/models/chatcompletionstreamrequestmessage.md} (91%) rename packages/{mistralai_azure/docs/models/stop.md => gcp/docs/models/chatcompletionstreamrequeststop.md} (88%) rename packages/{mistralai_gcp => gcp}/docs/models/chatcompletionstreamrequesttoolchoice.md (100%) rename packages/{mistralai_gcp => gcp}/docs/models/completionchunk.md (100%) rename packages/{mistralai_gcp => gcp}/docs/models/completionevent.md (100%) create mode 100644 packages/gcp/docs/models/completionresponsestreamchoice.md rename packages/{mistralai_azure/docs/models/finishreason.md => gcp/docs/models/completionresponsestreamchoicefinishreason.md} (81%) rename packages/{mistralai_gcp => gcp}/docs/models/contentchunk.md (100%) create mode 100644 packages/gcp/docs/models/deltamessage.md rename packages/{mistralai_azure/docs/models/content.md => gcp/docs/models/deltamessagecontent.md} (89%) rename packages/{mistralai_gcp => gcp}/docs/models/fimcompletionrequest.md (100%) rename packages/{mistralai_gcp => gcp}/docs/models/fimcompletionrequeststop.md (100%) rename packages/{mistralai_gcp => gcp}/docs/models/fimcompletionresponse.md (100%) rename packages/{mistralai_gcp => gcp}/docs/models/fimcompletionstreamrequest.md (100%) rename packages/{mistralai_gcp => gcp}/docs/models/fimcompletionstreamrequeststop.md (100%) rename packages/{mistralai_gcp => gcp}/docs/models/function.md (100%) rename packages/{mistralai_gcp => gcp}/docs/models/functioncall.md (100%) rename packages/{mistralai_gcp => gcp}/docs/models/functionname.md (100%) rename packages/{mistralai_gcp => gcp}/docs/models/httpvalidationerror.md (100%) rename packages/{mistralai_gcp => gcp}/docs/models/imageurl.md (100%) create mode 100644 packages/gcp/docs/models/imageurlchunk.md rename packages/{mistralai_azure/docs/models/imageurlchunkimageurl.md => gcp/docs/models/imageurlunion.md} (86%) rename packages/{mistralai_gcp => gcp}/docs/models/jsonschema.md (100%) rename packages/{mistralai_gcp => gcp}/docs/models/loc.md (100%) rename packages/{mistralai_gcp => gcp}/docs/models/mistralpromptmode.md (100%) rename packages/{mistralai_gcp => gcp}/docs/models/prediction.md (100%) create mode 100644 packages/gcp/docs/models/referencechunk.md rename packages/{mistralai_gcp => gcp}/docs/models/responseformat.md (100%) rename packages/{mistralai_gcp => gcp}/docs/models/responseformats.md (100%) rename packages/{mistralai_gcp => gcp}/docs/models/security.md (100%) rename packages/{mistralai_azure => gcp}/docs/models/systemmessage.md (88%) rename packages/{mistralai_gcp => gcp}/docs/models/systemmessagecontent.md (100%) rename packages/{mistralai_gcp => gcp}/docs/models/systemmessagecontentchunks.md (100%) create mode 100644 packages/gcp/docs/models/textchunk.md rename packages/{mistralai_gcp => gcp}/docs/models/thinkchunk.md (91%) rename packages/{mistralai_gcp => gcp}/docs/models/thinking.md (100%) rename packages/{mistralai_gcp => gcp}/docs/models/tool.md (100%) rename packages/{mistralai_gcp => gcp}/docs/models/toolcall.md (100%) rename packages/{mistralai_gcp => gcp}/docs/models/toolchoice.md (100%) rename packages/{mistralai_gcp => gcp}/docs/models/toolchoiceenum.md (100%) rename packages/{mistralai_azure => gcp}/docs/models/toolmessage.md (92%) rename packages/{mistralai_gcp => gcp}/docs/models/toolmessagecontent.md (100%) rename packages/{mistralai_gcp => gcp}/docs/models/tooltypes.md (100%) rename packages/{mistralai_gcp => gcp}/docs/models/usageinfo.md (100%) rename packages/{mistralai_azure => gcp}/docs/models/usermessage.md (89%) rename packages/{mistralai_gcp => gcp}/docs/models/usermessagecontent.md (100%) rename packages/{mistralai_gcp => gcp}/docs/models/utils/retryconfig.md (100%) rename packages/{mistralai_gcp => gcp}/docs/models/validationerror.md (100%) rename packages/{mistralai_gcp => gcp}/docs/sdks/chat/README.md (99%) rename packages/{mistralai_gcp => gcp}/docs/sdks/fim/README.md (99%) rename packages/{mistralai_gcp => gcp}/docs/sdks/mistralgcp/README.md (100%) rename packages/{mistralai_gcp => gcp}/py.typed (100%) rename packages/{mistralai_gcp => gcp}/pylintrc (100%) rename packages/{mistralai_gcp => gcp}/pyproject.toml (80%) rename packages/{mistralai_azure => gcp}/scripts/prepare_readme.py (96%) rename packages/{mistralai_gcp => gcp}/scripts/publish.sh (100%) rename packages/{mistralai_gcp/src/mistralai_gcp => gcp/src/mistralai/gcp/client}/__init__.py (100%) rename packages/{mistralai_gcp/src/mistralai_gcp => gcp/src/mistralai/gcp/client}/_hooks/__init__.py (100%) create mode 100644 packages/gcp/src/mistralai/gcp/client/_hooks/registration.py rename packages/{mistralai_gcp/src/mistralai_gcp => gcp/src/mistralai/gcp/client}/_hooks/sdkhooks.py (97%) rename packages/{mistralai_azure/src/mistralai_azure => gcp/src/mistralai/gcp/client}/_hooks/types.py (96%) rename packages/{mistralai_gcp/src/mistralai_gcp => gcp/src/mistralai/gcp/client}/_version.py (76%) rename packages/{mistralai_gcp/src/mistralai_gcp => gcp/src/mistralai/gcp/client}/basesdk.py (98%) rename packages/{mistralai_gcp/src/mistralai_gcp => gcp/src/mistralai/gcp/client}/chat.py (96%) rename packages/{mistralai_gcp/src/mistralai_gcp => gcp/src/mistralai/gcp/client}/fim.py (98%) rename packages/{mistralai_gcp/src/mistralai_gcp => gcp/src/mistralai/gcp/client}/httpclient.py (100%) rename packages/{mistralai_gcp/src/mistralai_gcp => gcp/src/mistralai/gcp/client}/models/__init__.py (85%) rename packages/{mistralai_azure/src/mistralai_azure => gcp/src/mistralai/gcp/client}/models/assistantmessage.py (81%) rename packages/{mistralai_gcp/src/mistralai_gcp => gcp/src/mistralai/gcp/client}/models/chatcompletionchoice.py (91%) rename packages/{mistralai_gcp/src/mistralai_gcp => gcp/src/mistralai/gcp/client}/models/chatcompletionrequest.py (97%) rename packages/{mistralai_gcp/src/mistralai_gcp => gcp/src/mistralai/gcp/client}/models/chatcompletionresponse.py (93%) rename packages/{mistralai_gcp/src/mistralai_gcp => gcp/src/mistralai/gcp/client}/models/chatcompletionstreamrequest.py (94%) rename packages/{mistralai_azure/src/mistralai_azure => gcp/src/mistralai/gcp/client}/models/completionchunk.py (94%) rename packages/{mistralai_gcp/src/mistralai_gcp => gcp/src/mistralai/gcp/client}/models/completionevent.py (88%) rename packages/{mistralai_azure/src/mistralai_azure => gcp/src/mistralai/gcp/client}/models/completionresponsestreamchoice.py (82%) rename packages/{mistralai_gcp/src/mistralai_gcp => gcp/src/mistralai/gcp/client}/models/contentchunk.py (93%) rename packages/{mistralai_azure/src/mistralai_azure => gcp/src/mistralai/gcp/client}/models/deltamessage.py (81%) rename packages/{mistralai_gcp/src/mistralai_gcp => gcp/src/mistralai/gcp/client}/models/fimcompletionrequest.py (99%) rename packages/{mistralai_gcp/src/mistralai_gcp => gcp/src/mistralai/gcp/client}/models/fimcompletionresponse.py (93%) rename packages/{mistralai_gcp/src/mistralai_gcp => gcp/src/mistralai/gcp/client}/models/fimcompletionstreamrequest.py (99%) rename packages/{mistralai_azure/src/mistralai_azure => gcp/src/mistralai/gcp/client}/models/function.py (91%) rename packages/{mistralai_azure/src/mistralai_azure => gcp/src/mistralai/gcp/client}/models/functioncall.py (91%) rename packages/{mistralai_gcp/src/mistralai_gcp => gcp/src/mistralai/gcp/client}/models/functionname.py (89%) rename packages/{mistralai_gcp/src/mistralai_gcp => gcp/src/mistralai/gcp/client}/models/httpvalidationerror.py (82%) rename packages/{mistralai_azure/src/mistralai_azure => gcp/src/mistralai/gcp/client}/models/imageurl.py (97%) create mode 100644 packages/gcp/src/mistralai/gcp/client/models/imageurlchunk.py rename packages/{mistralai_gcp/src/mistralai_gcp => gcp/src/mistralai/gcp/client}/models/jsonschema.py (97%) rename packages/{mistralai_gcp/src/mistralai_gcp => gcp/src/mistralai/gcp/client}/models/mistralgcperror.py (96%) rename packages/{mistralai_gcp/src/mistralai_gcp => gcp/src/mistralai/gcp/client}/models/mistralpromptmode.py (89%) rename packages/{mistralai_gcp/src/mistralai_gcp => gcp/src/mistralai/gcp/client}/models/no_response_error.py (100%) rename packages/{mistralai_gcp/src/mistralai_gcp => gcp/src/mistralai/gcp/client}/models/prediction.py (89%) create mode 100644 packages/gcp/src/mistralai/gcp/client/models/referencechunk.py rename packages/{mistralai_gcp/src/mistralai_gcp => gcp/src/mistralai/gcp/client}/models/responseformat.py (98%) rename packages/{mistralai_gcp/src/mistralai_gcp => gcp/src/mistralai/gcp/client}/models/responseformats.py (100%) rename packages/{mistralai_gcp/src/mistralai_gcp => gcp/src/mistralai/gcp/client}/models/responsevalidationerror.py (86%) rename packages/{mistralai_gcp/src/mistralai_gcp => gcp/src/mistralai/gcp/client}/models/sdkerror.py (93%) rename packages/{mistralai_azure/src/mistralai_azure => gcp/src/mistralai/gcp/client}/models/security.py (81%) rename packages/{mistralai_azure/src/mistralai_azure => gcp/src/mistralai/gcp/client}/models/systemmessage.py (57%) rename packages/{mistralai_azure/src/mistralai_azure => gcp/src/mistralai/gcp/client}/models/systemmessagecontentchunks.py (66%) create mode 100644 packages/gcp/src/mistralai/gcp/client/models/textchunk.py rename packages/{mistralai_azure/src/mistralai_azure => gcp/src/mistralai/gcp/client}/models/thinkchunk.py (65%) rename packages/{mistralai_gcp/src/mistralai_gcp => gcp/src/mistralai/gcp/client}/models/tool.py (90%) rename packages/{mistralai_azure/src/mistralai_azure => gcp/src/mistralai/gcp/client}/models/toolcall.py (92%) rename packages/{mistralai_gcp/src/mistralai_gcp => gcp/src/mistralai/gcp/client}/models/toolchoice.py (94%) rename packages/{mistralai_gcp/src/mistralai_gcp => gcp/src/mistralai/gcp/client}/models/toolchoiceenum.py (100%) rename packages/{mistralai_gcp/src/mistralai_gcp => gcp/src/mistralai/gcp/client}/models/toolmessage.py (77%) rename packages/{mistralai_azure/src/mistralai_azure => gcp/src/mistralai/gcp/client}/models/tooltypes.py (78%) rename packages/{mistralai_gcp/src/mistralai_gcp => gcp/src/mistralai/gcp/client}/models/usageinfo.py (98%) rename packages/{mistralai_gcp/src/mistralai_gcp => gcp/src/mistralai/gcp/client}/models/usermessage.py (73%) rename packages/{mistralai_azure/src/mistralai_azure => gcp/src/mistralai/gcp/client}/models/validationerror.py (90%) rename packages/{mistralai_gcp/src/mistralai_gcp => gcp/src/mistralai/gcp/client}/py.typed (100%) create mode 100644 packages/gcp/src/mistralai/gcp/client/sdk.py rename packages/{mistralai_azure/src/mistralai_azure => gcp/src/mistralai/gcp/client}/sdkconfiguration.py (94%) rename packages/{mistralai_gcp/src/mistralai_gcp => gcp/src/mistralai/gcp/client}/types/__init__.py (100%) rename packages/{mistralai_gcp/src/mistralai_gcp => gcp/src/mistralai/gcp/client}/types/basemodel.py (100%) rename packages/{mistralai_gcp/src/mistralai_gcp => gcp/src/mistralai/gcp/client}/utils/__init__.py (100%) rename packages/{mistralai_gcp/src/mistralai_gcp => gcp/src/mistralai/gcp/client}/utils/annotations.py (100%) rename packages/{mistralai_gcp/src/mistralai_gcp => gcp/src/mistralai/gcp/client}/utils/datetimes.py (100%) rename packages/{mistralai_gcp/src/mistralai_gcp => gcp/src/mistralai/gcp/client}/utils/enums.py (100%) rename packages/{mistralai_gcp/src/mistralai_gcp => gcp/src/mistralai/gcp/client}/utils/eventstreaming.py (100%) rename packages/{mistralai_gcp/src/mistralai_gcp => gcp/src/mistralai/gcp/client}/utils/forms.py (100%) rename packages/{mistralai_gcp/src/mistralai_gcp => gcp/src/mistralai/gcp/client}/utils/headers.py (100%) rename packages/{mistralai_gcp/src/mistralai_gcp => gcp/src/mistralai/gcp/client}/utils/logger.py (100%) rename packages/{mistralai_gcp/src/mistralai_gcp => gcp/src/mistralai/gcp/client}/utils/metadata.py (100%) rename packages/{mistralai_gcp/src/mistralai_gcp => gcp/src/mistralai/gcp/client}/utils/queryparams.py (100%) rename packages/{mistralai_gcp/src/mistralai_gcp => gcp/src/mistralai/gcp/client}/utils/requestbodies.py (100%) rename packages/{mistralai_gcp/src/mistralai_gcp => gcp/src/mistralai/gcp/client}/utils/retries.py (100%) rename packages/{mistralai_gcp/src/mistralai_gcp => gcp/src/mistralai/gcp/client}/utils/security.py (100%) rename packages/{mistralai_gcp/src/mistralai_gcp => gcp/src/mistralai/gcp/client}/utils/serializers.py (100%) rename packages/{mistralai_gcp/src/mistralai_gcp => gcp/src/mistralai/gcp/client}/utils/unmarshal_json_response.py (95%) rename packages/{mistralai_gcp/src/mistralai_gcp => gcp/src/mistralai/gcp/client}/utils/url.py (100%) rename packages/{mistralai_gcp/src/mistralai_gcp => gcp/src/mistralai/gcp/client}/utils/values.py (100%) rename packages/{mistralai_gcp => gcp}/uv.lock (92%) delete mode 100644 packages/mistralai_azure/.genignore delete mode 100644 packages/mistralai_azure/.vscode/settings.json delete mode 100644 packages/mistralai_azure/docs/models/assistantmessagerole.md delete mode 100644 packages/mistralai_azure/docs/models/completionresponsestreamchoice.md delete mode 100644 packages/mistralai_azure/docs/models/deltamessage.md delete mode 100644 packages/mistralai_azure/docs/models/documenturlchunk.md delete mode 100644 packages/mistralai_azure/docs/models/documenturlchunktype.md delete mode 100644 packages/mistralai_azure/docs/models/imageurlchunk.md delete mode 100644 packages/mistralai_azure/docs/models/imageurlchunktype.md delete mode 100644 packages/mistralai_azure/docs/models/referencechunk.md delete mode 100644 packages/mistralai_azure/docs/models/referencechunktype.md delete mode 100644 packages/mistralai_azure/docs/models/role.md delete mode 100644 packages/mistralai_azure/docs/models/textchunk.md delete mode 100644 packages/mistralai_azure/docs/models/thinkchunktype.md delete mode 100644 packages/mistralai_azure/docs/models/toolmessagerole.md delete mode 100644 packages/mistralai_azure/docs/models/type.md delete mode 100644 packages/mistralai_azure/docs/models/usermessagerole.md delete mode 100644 packages/mistralai_azure/src/mistralai_azure/_hooks/custom_user_agent.py delete mode 100644 packages/mistralai_azure/src/mistralai_azure/models/imageurlchunk.py delete mode 100644 packages/mistralai_azure/src/mistralai_azure/models/referencechunk.py delete mode 100644 packages/mistralai_azure/src/mistralai_azure/models/textchunk.py delete mode 100644 packages/mistralai_gcp/.genignore delete mode 100644 packages/mistralai_gcp/.vscode/settings.json delete mode 100644 packages/mistralai_gcp/docs/models/assistantmessagerole.md delete mode 100644 packages/mistralai_gcp/docs/models/completionresponsestreamchoice.md delete mode 100644 packages/mistralai_gcp/docs/models/deltamessage.md delete mode 100644 packages/mistralai_gcp/docs/models/imageurlchunk.md delete mode 100644 packages/mistralai_gcp/docs/models/imageurlchunktype.md delete mode 100644 packages/mistralai_gcp/docs/models/referencechunk.md delete mode 100644 packages/mistralai_gcp/docs/models/referencechunktype.md delete mode 100644 packages/mistralai_gcp/docs/models/role.md delete mode 100644 packages/mistralai_gcp/docs/models/textchunk.md delete mode 100644 packages/mistralai_gcp/docs/models/thinkchunktype.md delete mode 100644 packages/mistralai_gcp/docs/models/toolmessagerole.md delete mode 100644 packages/mistralai_gcp/docs/models/type.md delete mode 100644 packages/mistralai_gcp/docs/models/usermessagerole.md delete mode 100644 packages/mistralai_gcp/src/mistralai_gcp/_hooks/custom_user_agent.py delete mode 100644 packages/mistralai_gcp/src/mistralai_gcp/_hooks/registration.py delete mode 100644 packages/mistralai_gcp/src/mistralai_gcp/models/imageurlchunk.py delete mode 100644 packages/mistralai_gcp/src/mistralai_gcp/models/referencechunk.py delete mode 100644 packages/mistralai_gcp/src/mistralai_gcp/models/textchunk.py delete mode 100644 packages/mistralai_gcp/src/mistralai_gcp/sdk.py diff --git a/.genignore b/.genignore index b80cf0f6..6bd11b26 100644 --- a/.genignore +++ b/.genignore @@ -1,6 +1,6 @@ pyproject.toml examples/* /utils/* -src/mistral/extra/* +src/mistralai/extra/* pylintrc scripts/prepare_readme.py diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index a9e18489..539a9004 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -2,14 +2,14 @@ speakeasyVersion: 1.685.0 sources: mistral-azure-source: sourceNamespace: mistral-openapi-azure - sourceRevisionDigest: sha256:d303e640ad565cc8a9801519b20dc7eab226efdfdab951c11256962d9e479f74 - sourceBlobDigest: sha256:6e4c789de61b2c9c604bf581e0abbadae90e360491d95ec4247678f4f70cee87 + sourceRevisionDigest: sha256:a57165e46202d35d2e53880f219fb19b35358b1bd61bfd2023606e7cdb445ed4 + sourceBlobDigest: sha256:b836ce324de54e4cf0c66293d21c08a4544c6493138f4500a36ce4e071337836 tags: - latest mistral-google-cloud-source: sourceNamespace: mistral-openapi-google-cloud - sourceRevisionDigest: sha256:351c4d392b8b2220c337a207e98ed5665ed27fd85de854871a70c4bc2b9c0784 - sourceBlobDigest: sha256:d79b21f70efb93b0cd261d2044939a288beaf8707a7caae86aca5c4d5de3821b + sourceRevisionDigest: sha256:0f53d01014da9f064fc87a4a25c6566c268f037f9dd3a92f83b3a65d4042f945 + sourceBlobDigest: sha256:26d64def9e3b1922237f7336f37e234315d402293cc78de23fafd887232b8091 tags: - latest mistral-openapi: @@ -22,24 +22,24 @@ targets: mistralai-azure-sdk: source: mistral-azure-source sourceNamespace: mistral-openapi-azure - sourceRevisionDigest: sha256:d303e640ad565cc8a9801519b20dc7eab226efdfdab951c11256962d9e479f74 - sourceBlobDigest: sha256:6e4c789de61b2c9c604bf581e0abbadae90e360491d95ec4247678f4f70cee87 + sourceRevisionDigest: sha256:a57165e46202d35d2e53880f219fb19b35358b1bd61bfd2023606e7cdb445ed4 + sourceBlobDigest: sha256:b836ce324de54e4cf0c66293d21c08a4544c6493138f4500a36ce4e071337836 codeSamplesNamespace: mistral-openapi-azure-code-samples - codeSamplesRevisionDigest: sha256:0109302b87fa17b0103ef1e372fae76356811b3c552103e659bd5373d537d759 + codeSamplesRevisionDigest: sha256:e7fbdb25b0273637fc1bb5bcf7f9376f009ef1564334ad0a12cc77f778fb85df mistralai-gcp-sdk: source: mistral-google-cloud-source sourceNamespace: mistral-openapi-google-cloud - sourceRevisionDigest: sha256:351c4d392b8b2220c337a207e98ed5665ed27fd85de854871a70c4bc2b9c0784 - sourceBlobDigest: sha256:d79b21f70efb93b0cd261d2044939a288beaf8707a7caae86aca5c4d5de3821b + sourceRevisionDigest: sha256:0f53d01014da9f064fc87a4a25c6566c268f037f9dd3a92f83b3a65d4042f945 + sourceBlobDigest: sha256:26d64def9e3b1922237f7336f37e234315d402293cc78de23fafd887232b8091 codeSamplesNamespace: mistral-openapi-google-cloud-code-samples - codeSamplesRevisionDigest: sha256:09bb7cbf291076170d228116db05d1c9606af541b301b6564609c4d76633258a + codeSamplesRevisionDigest: sha256:661da477dc87ca20dbb39b16a3f4de2481b5f8c9502a49d04abb363424b51d47 mistralai-sdk: source: mistral-openapi sourceNamespace: mistral-openapi sourceRevisionDigest: sha256:74d0de7750f6a1878b68c9da683eba7a447d7c367131d0cb8f5c3b1e05829624 sourceBlobDigest: sha256:41e8354c48993fc29be68959d835ea4f8e0cc1d4b4fbd527afcd970bc02c62a2 codeSamplesNamespace: mistral-openapi-code-samples - codeSamplesRevisionDigest: sha256:f37fb6188ad25957bef4cadaa03f454a4f9ab0c045db633a46d9cc89af145ba2 + codeSamplesRevisionDigest: sha256:99fcae1bc81801e3825648a44f5ffa62a8f124e3186e5570be40414de164e7f2 workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.685.0 @@ -57,7 +57,7 @@ workflow: mistralai-azure-sdk: target: python source: mistral-azure-source - output: ./packages/mistralai_azure + output: ./packages/azure publish: pypi: token: $pypi_token @@ -68,7 +68,7 @@ workflow: mistralai-gcp-sdk: target: python source: mistral-google-cloud-source - output: ./packages/mistralai_gcp + output: ./packages/gcp publish: pypi: token: $pypi_token diff --git a/.speakeasy/workflow.yaml b/.speakeasy/workflow.yaml index b45d6b3b..ba109c09 100644 --- a/.speakeasy/workflow.yaml +++ b/.speakeasy/workflow.yaml @@ -14,7 +14,7 @@ targets: mistralai-azure-sdk: target: python source: mistral-azure-source - output: ./packages/mistralai_azure + output: ./packages/azure publish: pypi: token: $pypi_token @@ -25,7 +25,7 @@ targets: mistralai-gcp-sdk: target: python source: mistral-google-cloud-source - output: ./packages/mistralai_gcp + output: ./packages/gcp publish: pypi: token: $pypi_token diff --git a/MIGRATION.md b/MIGRATION.md index 9f39cdb5..906173fe 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -33,6 +33,26 @@ from mistralai.client.types import BaseModel | `from mistralai.types import ...` | `from mistralai.client.types import ...` | | `from mistralai.utils import ...` | `from mistralai.client.utils import ...` | +### Azure & GCP Import Changes + +Azure and GCP SDKs now live under the `mistralai` namespace as separate distributions: + +| v1 | v2 | +|---|---| +| `from mistralai_azure import MistralAzure` | `from mistralai.azure.client import MistralAzure` | +| `from mistralai_azure.models import ...` | `from mistralai.azure.client.models import ...` | +| `from mistralai_gcp import MistralGoogleCloud` | `from mistralai.gcp.client import MistralGCP` | +| `from mistralai_gcp.models import ...` | `from mistralai.gcp.client.models import ...` | + +#### Installation Changes + +| v1 | v2 | +|---|---| +| `pip install mistralai` | `pip install mistralai` (includes Azure and GCP) | +| `pip install mistralai[gcp]` (for GCP auth) | `pip install "mistralai[gcp]"` (for GCP auth dependencies) | + +Azure and GCP are now standalone distributions that can be installed independently of the core SDK. The `mistralai[azure]` and `mistralai[gcp]` extras are syntactic sugar that pull in the respective distributions. + ### What Stays the Same - The `Mistral` client API is unchanged diff --git a/README.md b/README.md index 53de43f5..22c11c63 100644 --- a/README.md +++ b/README.md @@ -372,35 +372,35 @@ You can run the examples in the `examples/` directory using `uv run`. Before you begin, ensure you have `AZUREAI_ENDPOINT` and an `AZURE_API_KEY`. To obtain these, you will need to deploy Mistral on Azure AI. See [instructions for deploying Mistral on Azure AI here](https://docs.mistral.ai/deployment/cloud/azure/). +**Step 1: Install** + +```bash +pip install mistralai +``` + +**Step 2: Example Usage** + Here's a basic example to get you started. You can also run [the example in the `examples` directory](/examples/azure). ```python -import asyncio import os - -from mistralai_azure import MistralAzure +from mistralai.azure.client import MistralAzure client = MistralAzure( - azure_api_key=os.getenv("AZURE_API_KEY", ""), - azure_endpoint=os.getenv("AZURE_ENDPOINT", "") + api_key=os.getenv("AZURE_API_KEY", ""), + server_url=os.getenv("AZURE_ENDPOINT", "") ) -async def main() -> None: - res = await client.chat.complete_async( - max_tokens= 100, - temperature= 0.5, - messages= [ - { - "content": "Hello there!", - "role": "user" - } - ] - ) - print(res) - -asyncio.run(main()) +res = client.chat.complete( + messages=[ + { + "content": "Hello there!", + "role": "user" + } + ] +) +print(res.choices[0].message.content) ``` -The documentation for the Azure SDK is available [here](packages/mistralai_azure/README.md). ### Google Cloud @@ -417,40 +417,34 @@ gcloud auth application-default login **Step 1: Install** -Install the extras dependencies specific to Google Cloud: - ```bash +pip install mistralai +# For GCP authentication support: pip install "mistralai[gcp]" ``` **Step 2: Example Usage** -Here's a basic example to get you started. +Here's a basic example to get you started. You can also run [the example in the `examples` directory](/examples/gcp). ```python -import asyncio -from mistralai_gcp import MistralGoogleCloud - -client = MistralGoogleCloud() - +import os +from mistralai.gcp.client import MistralGCP -async def main() -> None: - res = await client.chat.complete_async( - model= "mistral-small-2402", - messages= [ - { - "content": "Hello there!", - "role": "user" - } - ] - ) - print(res) +client = MistralGCP(api_key=os.getenv("GCP_API_KEY", "")) -asyncio.run(main()) +res = client.chat.complete( + model="mistral-large-2407", + messages=[ + { + "content": "Hello there!", + "role": "user" + } + ] +) +print(res.choices[0].message.content) ``` -The documentation for the GCP SDK is available [here](packages/mistralai_gcp/README.md). - ## Available Resources and Operations diff --git a/docs/gen-yaml-diff.md b/docs/gen-yaml-diff.md new file mode 100644 index 00000000..881bb3b5 --- /dev/null +++ b/docs/gen-yaml-diff.md @@ -0,0 +1,43 @@ +# gen.yaml Diff: Main vs Azure vs GCP + +## `generation` section + +| Setting | Main | Azure | GCP | +|---------|------|-------|-----| +| `sdkClassName` | `Mistral` | `MistralAzure` | `MistralGCP` | +| `nameResolutionDec2023` | `true` | `true` | `true` | +| `nameResolutionFeb2025` | `true` | `true` | `true` | +| `parameterOrderingFeb2024` | `true` | `true` | `true` | +| `requestResponseComponentNamesFeb2024` | `true` | `true` | `true` | +| `securityFeb2025` | `true` | `true` | `true` | +| `sharedErrorComponentsApr2025` | `true` | `true` | `true` | +| `methodSignaturesApr2024` | `true` | `true` | `true` | +| `sharedNestedComponentsJan2026` | `true` | `true` | `true` | + +## `python` section + +| Setting | Main | Azure | GCP | +|---------|------|-------|-----| +| `version` | `2.0.0a4` | `2.0.0a4` | `2.0.0a4` | +| `additionalDependencies.main` | *none* | *none* | *none* | +| `baseErrorName` | `MistralError` | `MistralAzureError` | `MistralGcpError` | +| `description` | `...Mistral AI API.` | `...in Azure.` | `...in GCP.` | +| `enableCustomCodeRegions` | `true` | `false` | `false` | +| `envVarPrefix` | `MISTRAL` | *missing* | *missing* | +| `responseRequiredSep2024` | `true` | `true` | `true` | +| `flatAdditionalProperties` | `true` | `true` | `true` | +| `forwardCompatibleEnumsByDefault` | `true` | `true` | `true` | +| `forwardCompatibleUnionsByDefault` | `tagged-only` | `tagged-only` | `tagged-only` | +| `preApplyUnionDiscriminators` | `true` | `true` | `true` | +| `moduleName` | `mistralai.client` | `mistralai.azure.client` | `mistralai.gcp.client` | +| `packageName` | `mistralai` | `mistralai-azure` | `mistralai-gcp` | + +## Remaining intentional differences + +All fix flags and feature flags are now aligned. The only remaining differences are expected per-target values: + +- **`version`** -- all at 2.0.0a4 (versions may diverge independently) +- **`baseErrorName`** / `description` -- per-target identity +- **`enableCustomCodeRegions`** -- `false` in Azure/GCP (they have no custom code regions) +- **`envVarPrefix`** -- absent in Azure/GCP (only the main SDK reads `MISTRAL_*` env vars) +- **`moduleName`** / `packageName` -- per-target namespace diff --git a/examples/azure/az_chat_no_streaming.py b/examples/azure/az_chat_no_streaming.py deleted file mode 100644 index 4d5530dc..00000000 --- a/examples/azure/az_chat_no_streaming.py +++ /dev/null @@ -1,15 +0,0 @@ -import os - -from mistralai_azure import MistralAzure -from mistralai_azure.models import ChatCompletionRequestMessages, UserMessage - -client = MistralAzure( - azure_api_key=os.environ["AZURE_API_KEY"], - azure_endpoint=os.environ["AZURE_ENDPOINT"], -) - -messages: list[ChatCompletionRequestMessages] = [ - UserMessage(content="What is the capital of France?"), -] -res = client.chat.complete(messages=messages) -print(res.choices[0].message.content) diff --git a/examples/azure/chat_no_streaming.py b/examples/azure/chat_no_streaming.py index 4d5530dc..5c8665ff 100644 --- a/examples/azure/chat_no_streaming.py +++ b/examples/azure/chat_no_streaming.py @@ -1,14 +1,14 @@ import os -from mistralai_azure import MistralAzure -from mistralai_azure.models import ChatCompletionRequestMessages, UserMessage +from mistralai.azure.client import MistralAzure +from mistralai.azure.client.models import ChatCompletionRequestMessage, UserMessage client = MistralAzure( - azure_api_key=os.environ["AZURE_API_KEY"], - azure_endpoint=os.environ["AZURE_ENDPOINT"], + api_key=os.environ["AZURE_API_KEY"], + server_url=os.environ["AZURE_ENDPOINT"], ) -messages: list[ChatCompletionRequestMessages] = [ +messages: list[ChatCompletionRequestMessage] = [ UserMessage(content="What is the capital of France?"), ] res = client.chat.complete(messages=messages) diff --git a/examples/gcp/async_chat_no_streaming.py b/examples/gcp/async_chat_no_streaming.py index 178f151c..0e5643b9 100755 --- a/examples/gcp/async_chat_no_streaming.py +++ b/examples/gcp/async_chat_no_streaming.py @@ -3,14 +3,14 @@ import asyncio import os -from mistralai_gcp import MistralGoogleCloud -from mistralai_gcp.models.usermessage import UserMessage +from mistralai.gcp.client import MistralGCP +from mistralai.gcp.client.models.usermessage import UserMessage async def main(): model = "mistral-large-2407" - client = MistralGoogleCloud(project_id=os.environ["GCP_PROJECT_ID"]) + client = MistralGCP(api_key=os.environ["GCP_API_KEY"]) chat_response = await client.chat.complete_async( model=model, diff --git a/examples/gcp/gcp_async_chat_no_streaming.py b/examples/gcp/gcp_async_chat_no_streaming.py deleted file mode 100755 index 178f151c..00000000 --- a/examples/gcp/gcp_async_chat_no_streaming.py +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env python - -import asyncio -import os - -from mistralai_gcp import MistralGoogleCloud -from mistralai_gcp.models.usermessage import UserMessage - - -async def main(): - model = "mistral-large-2407" - - client = MistralGoogleCloud(project_id=os.environ["GCP_PROJECT_ID"]) - - chat_response = await client.chat.complete_async( - model=model, - messages=[UserMessage(content="What is the best French cheese?")], - ) - - print(chat_response.choices[0].message.content) - - -if __name__ == "__main__": - asyncio.run(main()) diff --git a/packages/azure/.genignore b/packages/azure/.genignore new file mode 100644 index 00000000..6bdf6621 --- /dev/null +++ b/packages/azure/.genignore @@ -0,0 +1,6 @@ +pyproject.toml +src/mistralai/azure/client/sdk.py +src/mistralai/azure/client/_hooks/registration.py +README.md +USAGE.md +docs/sdks/**/README.md diff --git a/packages/mistralai_azure/.gitattributes b/packages/azure/.gitattributes similarity index 100% rename from packages/mistralai_azure/.gitattributes rename to packages/azure/.gitattributes diff --git a/packages/mistralai_azure/.gitignore b/packages/azure/.gitignore similarity index 100% rename from packages/mistralai_azure/.gitignore rename to packages/azure/.gitignore diff --git a/packages/mistralai_azure/.speakeasy/gen.lock b/packages/azure/.speakeasy/gen.lock similarity index 69% rename from packages/mistralai_azure/.speakeasy/gen.lock rename to packages/azure/.speakeasy/gen.lock index a7cdba10..80bad198 100644 --- a/packages/mistralai_azure/.speakeasy/gen.lock +++ b/packages/azure/.speakeasy/gen.lock @@ -1,24 +1,25 @@ lockVersion: 2.0.0 id: dc40fa48-2c4d-46ad-ac8b-270749770f34 management: - docChecksum: 2bebd9aadeecb18391d46d1dadc340ef + docChecksum: 26d52f4a0646d5cd88e8b57194f73435 docVersion: 1.0.0 speakeasyVersion: 1.685.0 generationVersion: 2.794.1 - releaseVersion: 1.8.1 - configChecksum: 0448ba634aa36625c6ac276e17e3b3b5 + releaseVersion: 2.0.0a4 + configChecksum: 549cf1eae199d39bf97052462fd8e640 repoURL: https://github.com/mistralai/client-python.git - repoSubDirectory: packages/mistralai_azure - installationURL: https://github.com/mistralai/client-python.git#subdirectory=packages/mistralai_azure + repoSubDirectory: packages/azure + installationURL: https://github.com/mistralai/client-python.git#subdirectory=packages/azure published: true persistentEdits: - generation_id: ecb4f74f-ba8a-4f28-941d-36b3258200bd - pristine_commit_hash: 785c0560d42a9c4cff938392bb6d52d98a2f3529 - pristine_tree_hash: 50ed42d2e4b3d4ecd639935cd1511220354a41d7 + generation_id: 1c480e26-ffc8-4736-a8c9-c5a4928c32c5 + pristine_commit_hash: 2f99325ab9c57ed8b7caa24774261b300286939e + pristine_tree_hash: 08b1d09db4d7949c3dea052f9b68fb6402442bf8 features: python: additionalDependencies: 1.0.0 additionalProperties: 1.0.1 + configurableModuleName: 0.2.0 constsAndDefaults: 1.0.5 core: 5.23.18 defaultEnabledRetries: 0.2.0 @@ -57,16 +58,12 @@ trackedFiles: pristine_git_object: 2e54e27e0ca97bee87918b2ae38cc6c335669a79 docs/models/assistantmessage.md: id: 7e0218023943 - last_write_checksum: sha1:e75d407349842b2de46ee3ca6250f9f51121cf38 - pristine_git_object: 3d0bd90b4433c1a919f917f4bcf2518927cdcd50 + last_write_checksum: sha1:47d5cd1a1bef9e398c12c207f5b3d8486d94f359 + pristine_git_object: 9ef638379aee1198742743800e778409c47a9b9d docs/models/assistantmessagecontent.md: id: 9f1795bbe642 last_write_checksum: sha1:1ce4066623a8d62d969e5ed3a088d73a9ba26643 pristine_git_object: 047b7cf95f4db203bf2c501680b73ca0562a122d - docs/models/assistantmessagerole.md: - id: bb5d2a4bc72f - last_write_checksum: sha1:82f2c4f469426bd476c1003a91394afb89cb7c91 - pristine_git_object: 658229e77eb6419391cf7941568164541c528387 docs/models/chatcompletionchoice.md: id: 0d15c59ab501 last_write_checksum: sha1:a6274a39a4239e054816d08517bf8507cb5c4564 @@ -77,12 +74,12 @@ trackedFiles: pristine_git_object: b2f15ecbe88328de95b4961ddb3940fd8a6ee64b docs/models/chatcompletionrequest.md: id: adffe90369d0 - last_write_checksum: sha1:de5476eb16a5ff75942b1ece68dbe547110dbbb8 - pristine_git_object: 104a1f96e60e1d4b86305dab2829be084b00b153 - docs/models/chatcompletionrequestmessages.md: - id: ec996b350e12 - last_write_checksum: sha1:2ecec8d12cdb48426f4eb62732066fc79fcd4ec3 - pristine_git_object: bc7708a67f06d74e8a5bf1facb2b23fb1e08053c + last_write_checksum: sha1:a404d37c6605a5524f1f48b418bacf46e86a9a68 + pristine_git_object: 3b0f7270840e257475f4b0f15f27e0c0152818d2 + docs/models/chatcompletionrequestmessage.md: + id: 3f5e170d418c + last_write_checksum: sha1:7921c5a508a9f88adc01caab34e26182b8035607 + pristine_git_object: 91e9e062d0ef0cb69235c4ae4516548733ce28a9 docs/models/chatcompletionrequeststop.md: id: fcaf5bbea451 last_write_checksum: sha1:71a25f84f0d88c7acf72e801ced6159546201851 @@ -97,8 +94,16 @@ trackedFiles: pristine_git_object: a0465ffbfc5558628953e03fbc53b80bbdc8649b docs/models/chatcompletionstreamrequest.md: id: cf8f29558a68 - last_write_checksum: sha1:f6bc4a0f064fc3420ae9b29c7e6fc9100ae85e4d - pristine_git_object: 85f237b4fc59ffc487377f150952284cc2102d85 + last_write_checksum: sha1:daca00885f0d0f9863d8420bbee514723084813d + pristine_git_object: f78156a647ec63ca60ff423acbdee2b2404e4e60 + docs/models/chatcompletionstreamrequestmessage.md: + id: 053a98476cd2 + last_write_checksum: sha1:8270692463fab1243d9de4bbef7162daa64e52c5 + pristine_git_object: 2e4e93acca8983a3ea27b391d4606518946e13fe + docs/models/chatcompletionstreamrequeststop.md: + id: d0e89a4dca78 + last_write_checksum: sha1:a889e9580fa94bda7c848682d6ba501b7f5c0f41 + pristine_git_object: a48460a92ac47fec1de2188ba46b238229736d32 docs/models/chatcompletionstreamrequesttoolchoice.md: id: 210d5e5b1413 last_write_checksum: sha1:0543164caf3f4fb2bef3061dbd1a5e6b34b17ae9 @@ -113,40 +118,36 @@ trackedFiles: pristine_git_object: 7a66e8fee2bb0f1c58166177653893bb05b98f1d docs/models/completionresponsestreamchoice.md: id: d56824d615a6 - last_write_checksum: sha1:dcf4b125b533192cb5aea1a68551866954712dc5 - pristine_git_object: c807dacd98eb3561ee45f40db71a92cb72b0f6de - docs/models/content.md: - id: bfd859c99f86 - last_write_checksum: sha1:6673dbd19871a701955a322348a4f7e51c38ffc8 - pristine_git_object: a833dc2c6043e36b85131c9243b4cc02b9fcc4c6 + last_write_checksum: sha1:0296a490df009dbfd04893fdebcc88dd6102a872 + pristine_git_object: 1532c25b8fc065d486f52d4610a7f757e5340875 + docs/models/completionresponsestreamchoicefinishreason.md: + id: 5f1fbfc90b8e + last_write_checksum: sha1:20824b4a223cbd3658b32440973a7d47dcd108b9 + pristine_git_object: 0fece473297227c75db4e7ded63417a2f117cac0 docs/models/contentchunk.md: id: d2d3a32080cd last_write_checksum: sha1:5839a26cdc412b78caad7fb59df97bdcea57be6d pristine_git_object: 22023e8b19692df969693b7a14f8cf6e0143859f docs/models/deltamessage.md: id: 6c5ed6b60968 - last_write_checksum: sha1:c213149256c620715d744c89685d5b6cbdea6f58 - pristine_git_object: 61deabbf7e37388fdd4c1789089d120cc0b937b9 + last_write_checksum: sha1:00052476b9b2474dbc149f18dd18c71c86d0fc74 + pristine_git_object: e0ee575f3fce7c312114ce8c5390efc5c4854952 + docs/models/deltamessagecontent.md: + id: 7307bedc8733 + last_write_checksum: sha1:a1211b8cb576ad1358e68983680ee326c3920a5e + pristine_git_object: 8142772d7ea33ad8a75cf9cf822564ba3f630de2 docs/models/document.md: id: cd1d2a444370 last_write_checksum: sha1:d00a2ac808a0ae83a7b97da87e647ecc8dca9c52 pristine_git_object: 509d43b733d68d462853d9eb52fc913c855dff40 docs/models/documenturlchunk.md: id: 48437d297408 - last_write_checksum: sha1:38c3e2ad5353a4632bd827f00419c5d8eb2def54 - pristine_git_object: 6c9a5b4d9e6769be242b27ef0208f6af704689c0 - docs/models/documenturlchunktype.md: - id: a3574c91f539 - last_write_checksum: sha1:a0134fc0ea822d55b1204ee71140f2aa9d8dbe9c - pristine_git_object: 32e1fa9e975a3633fb49057b38b0ea0206b2d8ef + last_write_checksum: sha1:5f9294355929d66834c52c67990ba36a7f81387d + pristine_git_object: 9dbfbe5074de81b9fcf6f5bae8a0423fb2c82f71 docs/models/filechunk.md: id: edc076728e9d last_write_checksum: sha1:07ab5db503211adba2fa099e66d12ac3c4bbf680 pristine_git_object: 18217114060ac4e4b45fefabace4628684f27e5c - docs/models/finishreason.md: - id: 73315c2a39b3 - last_write_checksum: sha1:5b58c7fa9219f728b9731287e21abe1be9f11e4a - pristine_git_object: 45a5aedb7241cf080df3eb976a4413064d314009 docs/models/format_.md: id: a17c22228eda last_write_checksum: sha1:dad6de59fec6378d50356007602e2a0254d8d2e4 @@ -173,16 +174,12 @@ trackedFiles: pristine_git_object: 7c2bcbc36e99c3cf467d213d6a6a59d6300433d8 docs/models/imageurlchunk.md: id: 4407097bfff3 - last_write_checksum: sha1:7a478fd638234ece78770c7fc5e8d0adaf1c3727 - pristine_git_object: f1b926ef8e82443aa1446b1c64c2f02e33d7c789 - docs/models/imageurlchunkimageurl.md: - id: c7fae88454ce - last_write_checksum: sha1:5eff71b7a8be7baacb9ba8ca0be0a0f7a391a325 - pristine_git_object: 767389082d25f06e617fec2ef0134dd9fb2d4064 - docs/models/imageurlchunktype.md: - id: b9af2db9ff60 - last_write_checksum: sha1:990546f94648a09faf9d3ae55d7f6ee66de13e85 - pristine_git_object: 2064a0b405870313bd4b802a3b1988418ce8439e + last_write_checksum: sha1:da7a792f7b649f311062338dfbf3d25ff55fe6c5 + pristine_git_object: db0c53d22e29fa25222edb86b264e5135879a029 + docs/models/imageurlunion.md: + id: 9d3c691a9db0 + last_write_checksum: sha1:4e32bcd7d44746d2ddbfafbef96152bb2bdb2a15 + pristine_git_object: db97130f26199dcb354ecb7469d09530b035daa2 docs/models/jsonschema.md: id: a6b15ed6fac8 last_write_checksum: sha1:523465666ad3c292252b3fe60f345c7ffb29053f @@ -191,10 +188,6 @@ trackedFiles: id: b071d5a509cc last_write_checksum: sha1:09a04749333ab50ae806c3ac6adcaa90d54df0f1 pristine_git_object: d6094ac2c6e0326c039dad2f6b89158694ef6aa7 - docs/models/messages.md: - id: 2103cd675c2f - last_write_checksum: sha1:f6940c9c67b98c49ae2bc2764f6c14178321f244 - pristine_git_object: 1d394500e8ffdd140457575568fc2ce465a1cc3a docs/models/mistralpromptmode.md: id: d17d5db4d3b6 last_write_checksum: sha1:abcb7205c5086169c7d9449d15ac142448a7d258 @@ -233,12 +226,8 @@ trackedFiles: pristine_git_object: fae3c1ca4ba2c2ddb3b7de401ecdc8d56dcc7740 docs/models/referencechunk.md: id: 07895f9debfd - last_write_checksum: sha1:97d01dd2b907e87b58bebd9c950e1bef29747c89 - pristine_git_object: a132ca2fe6fbbaca644491cbc36d88b0c67cc6bc - docs/models/referencechunktype.md: - id: 0944b80ea9c8 - last_write_checksum: sha1:956b270766c7f11fe99f4a9b484cc29c159e7471 - pristine_git_object: 1e0e2fe64883ef5f3e628777b261b1224661d257 + last_write_checksum: sha1:4384049375a2566c7567599f97ce1ec19e9f6276 + pristine_git_object: d847e24845a399c7ca93d54701832fb65e01b3ab docs/models/responseformat.md: id: 50a1e4140614 last_write_checksum: sha1:e877b2e81470ef5eec5675dfb91a47e74d5d3add @@ -247,22 +236,14 @@ trackedFiles: id: cf1f250b82db last_write_checksum: sha1:105e1f9181913104b554051838cbdd0f728aa2c4 pristine_git_object: 2f5f1e5511b048323fee18a0ffdd506fe2b3d56f - docs/models/role.md: - id: b694540a5b1e - last_write_checksum: sha1:260a50c56a8bd03cc535edf98ebec06437f87f8d - pristine_git_object: affca78d5574cc42d8e6169f21968e5a8765e053 docs/models/security.md: id: 452e4d4eb67a last_write_checksum: sha1:ce2871b49c1632d50e22d0b1ebe4999021d52313 pristine_git_object: c698674c513f5b20c04f629e50154e67977275f7 - docs/models/stop.md: - id: f231cc9f5041 - last_write_checksum: sha1:86903cac5f57ad9b8ac07ecba6c454d40a53bdc8 - pristine_git_object: ba40ca83136d6d6cb4f1ef9e5ca3104a704e4846 docs/models/systemmessage.md: id: fdb7963e1cdf - last_write_checksum: sha1:97e726dff19a39b468767d5c01fc6256277ee71f - pristine_git_object: 0dba71c00f40c85e74b2c1967e077ffff9660f13 + last_write_checksum: sha1:c7603c5ce77ba2bcbda9eff65eeafdb1e9ecbec7 + pristine_git_object: 10bda10f921fb5d66c1606ff18e654b4e78ab197 docs/models/systemmessagecontent.md: id: 94a56febaeda last_write_checksum: sha1:6cb10b4b860b4204df57a29c650c85c826395aeb @@ -277,16 +258,12 @@ trackedFiles: pristine_git_object: 54f029b814fdcfa2e93e2b8b0594ef9e4eab792a docs/models/textchunk.md: id: 6cd12e0ef110 - last_write_checksum: sha1:6d41d1991d122805734ed0d90ee01592aa5ae6ff - pristine_git_object: 6daab3c381bd8c13d2935bf62578648a8470fc76 + last_write_checksum: sha1:aa448d4937c0c1cd562621f0a9080aa0dc6e4bd1 + pristine_git_object: b266619dcb57222ec343f373c43b2b5cef5b8b93 docs/models/thinkchunk.md: id: bca24d7153f6 - last_write_checksum: sha1:feb95a931bb9cdbfe28ab351618687e513cf830b - pristine_git_object: 66b2e0cde70e25e2927180d2e709503401fddeab - docs/models/thinkchunktype.md: - id: 0fbeed985341 - last_write_checksum: sha1:790f991f95c86c26a6abb9c9c5debda8b53526f5 - pristine_git_object: baf6f755252d027295be082b53ecf80555039414 + last_write_checksum: sha1:2b8ff7737fa7255673ca31da7cb2e6803fce9e02 + pristine_git_object: b07f598ebc5f0e9c041186c081dc98bc21104bdb docs/models/thinking.md: id: 07234f8dd364 last_write_checksum: sha1:a5962d1615b57996730da19e59fbfaa684321442 @@ -309,40 +286,28 @@ trackedFiles: pristine_git_object: 0be3d6c54b13a8bf30773398a2c12e0d30d3ae58 docs/models/toolmessage.md: id: 0553747c37a1 - last_write_checksum: sha1:3ac87031fdd4ba8b0996e95be8e7ef1a7ff41167 - pristine_git_object: a54f49332c2873471759b477fb4c712fa4fb61f5 + last_write_checksum: sha1:ac61e644ba7c6da607cb479eafd1db78d8e8012e + pristine_git_object: 7201481e61e269b238887deec30c03f7e16c53d7 docs/models/toolmessagecontent.md: id: f0522d2d3c93 last_write_checksum: sha1:783769c0200baa1b6751327aa3e009fa83da72ee pristine_git_object: 5c76091fbd2c8e0d768921fab19c7b761df73411 - docs/models/toolmessagerole.md: - id: f333d4d1ab56 - last_write_checksum: sha1:7e1c004bad24e928da0c286a9f053516b172d24f - pristine_git_object: c24e59c0c79ea886d266e38c673edd51531b9be6 docs/models/tooltypes.md: id: adb50fe63ea2 last_write_checksum: sha1:f224c3d8732450b9c969b3e04027b7df7892694c pristine_git_object: 84e49253c9b9bd1bd314e2a126106404cbb52f16 - docs/models/type.md: - id: 98c32f09b2c8 - last_write_checksum: sha1:8aa9ca999e9648ddc2240bf80780684e3e858ddf - pristine_git_object: eb0581e7174b6951d69c485a64af5244cb8687fa docs/models/usageinfo.md: id: ec6fe65028a9 last_write_checksum: sha1:cf71fb9676d870eba7c4d10a69636e1db4054adc pristine_git_object: f5204ac94a4d6191839031c66c5a9bc0124a1f35 docs/models/usermessage.md: id: ed66d7a0f80b - last_write_checksum: sha1:8291f7703e49ed669775dc953ea8cab6715dc7ed - pristine_git_object: 63b0131091cd211b3b1477c1d63b5666a26db546 + last_write_checksum: sha1:f0ed7d9cb7264f1d9e4a9190772df3f15e25346c + pristine_git_object: e7a932ed71496fa7cc358388c650d25f166f27a4 docs/models/usermessagecontent.md: id: 52c072c851e8 last_write_checksum: sha1:1de02bcf7082768ebe1bb912fdbebbec5a577b5a pristine_git_object: 8350f9e8f8996c136093e38760990f62fd01f8cf - docs/models/usermessagerole.md: - id: 99ffa937c462 - last_write_checksum: sha1:52014480516828b43827aa966b7319d9074f1111 - pristine_git_object: 171124e45988e784c56a6b92a0057ba00efc0db4 docs/models/utils/retryconfig.md: id: 4343ac43161c last_write_checksum: sha1:562c0f21e308ad10c27f85f75704c15592c6929d @@ -361,344 +326,344 @@ trackedFiles: pristine_git_object: a8fcb932ba2a01c5e96e3b04c59371e930b75558 scripts/prepare_readme.py: id: e0c5957a6035 - last_write_checksum: sha1:2291075229aebf4e036800b5b9299b37fcb8707c - pristine_git_object: ff1121fda23730f356d2df2ad17c8e991b9fc605 + last_write_checksum: sha1:26b29aad3c23a98912fd881698c976aac55749fe + pristine_git_object: 2b2577ea83873f64aa9f91d9d762bc6e1f250977 scripts/publish.sh: id: fe273b08f514 last_write_checksum: sha1:b290b25b36dca3d5eb1a2e66a2e1bcf2e7326cf3 pristine_git_object: c35748f360329c2bc370e9b189f49b1a360b2c48 - src/mistralai_azure/__init__.py: - id: 3cd9e92c2f72 + src/mistralai/azure/client/__init__.py: + id: 5624bda9196d last_write_checksum: sha1:36306d1d404b6aeb912d27f1d9c52f098ff7bf9b pristine_git_object: dd02e42e4cc509dc90e6ae70493054021faa5f9c - src/mistralai_azure/_hooks/__init__.py: - id: 66932eacf398 + src/mistralai/azure/client/_hooks/__init__.py: + id: 850c237217cb last_write_checksum: sha1:e3111289afd28ad557c21d9e2f918caabfb7037d pristine_git_object: 2ee66cdd592fe41731c24ddd407c8ca31c50aec1 - src/mistralai_azure/_hooks/sdkhooks.py: - id: 1184c9201c62 - last_write_checksum: sha1:c98774db1664db2bc6d80e8a5f4f5133260f201a - pristine_git_object: 37ff4e9f0ebd42a58ada6300098a5b1b85a54b69 - src/mistralai_azure/_hooks/types.py: - id: a32fe1943bce - last_write_checksum: sha1:78fc31840a38e668a73871885c779929196a8bec - pristine_git_object: 0c22d7ebccdd64097033454b7c698d10ee59987d - src/mistralai_azure/_version.py: - id: 7711a0bb1da3 - last_write_checksum: sha1:9a446d67d6a86cdf9d9e3447c1c09a4f719b2c9b - pristine_git_object: 79277f9a358b4c851363e11e1e8f534779e9f271 - src/mistralai_azure/basesdk.py: - id: 7d825dbc7d6e - last_write_checksum: sha1:4070786599952b3c603d1384d87d7b92bb13b974 - pristine_git_object: 89f7dc493d7f50d5f2d3f468c0a8392a6ec5e28b - src/mistralai_azure/chat.py: - id: ebf1c99bea88 - last_write_checksum: sha1:2d78fa9e8b3e300e18b6fb3bc116e824261efb55 - pristine_git_object: 10bb247fb89f0f9ef110300224c95f2a7653ad2f - src/mistralai_azure/httpclient.py: - id: 808a3f534ffa + src/mistralai/azure/client/_hooks/sdkhooks.py: + id: e9923767446c + last_write_checksum: sha1:ae162d6e73be0eb767c353c815d76b034395d50f + pristine_git_object: 2080681b7f2c52fcb80dcb95eff48654763e6258 + src/mistralai/azure/client/_hooks/types.py: + id: 07c892e06527 + last_write_checksum: sha1:fde2e0f6da6930232b67682009de520724b23398 + pristine_git_object: 3e4e39555d60adebe84e596c8323ee5b80676fc9 + src/mistralai/azure/client/_version.py: + id: a77160e60e5d + last_write_checksum: sha1:e26eb828e9a240042acc754f38dcf2e581e045aa + pristine_git_object: 4448d2a0fd803f43820378359c921d09eba6f43e + src/mistralai/azure/client/basesdk.py: + id: 5a585a95ec21 + last_write_checksum: sha1:d7a4a959d7d3ca3cd22d8daf144c3b4d5c0d1210 + pristine_git_object: b0391ac078b4e2a5d9107ed014c1ca939a553c23 + src/mistralai/azure/client/chat.py: + id: c18454e628d7 + last_write_checksum: sha1:cc1ff54b85ce494428ebf22ec01bd1199cd9e2b6 + pristine_git_object: 3348bf47eafb3fcfb2de0e7d512073e947b69554 + src/mistralai/azure/client/httpclient.py: + id: 60c81037fbd0 last_write_checksum: sha1:5e55338d6ee9f01ab648cad4380201a8a3da7dd7 pristine_git_object: 89560b566073785535643e694c112bedbd3db13d - src/mistralai_azure/models/__init__.py: - id: e5fcf3933d2c - last_write_checksum: sha1:43f0ebb24f64a382fd18202da65a321d9925dbee - pristine_git_object: 9baa3ff1865cd8aec9e9b93d6e3c315e8c7870c5 - src/mistralai_azure/models/assistantmessage.py: - id: 15f117b45380 - last_write_checksum: sha1:3c2872d06ad465dbbbedcf8d397d1f12961e1e2e - pristine_git_object: 7790eb10a034d892c3c1e793c412c75ff8820e40 - src/mistralai_azure/models/chatcompletionchoice.py: - id: 93cfc6cec0d2 - last_write_checksum: sha1:f5dfcf407d8abd5ce8eb23f058c589861c71a0df - pristine_git_object: 7c6eb933faf09cc5c6102575d371ac280f2e242d - src/mistralai_azure/models/chatcompletionrequest.py: - id: d046a16b5e58 - last_write_checksum: sha1:bc1e0b5c8b11bfef5a9b135436c2f3f555a11fa3 - pristine_git_object: a7b095f34c572e1805650e44f847946280ccb3fe - src/mistralai_azure/models/chatcompletionresponse.py: - id: fc342e80f579 - last_write_checksum: sha1:a93593ec734420bc122f0b0b8c49d630795f1d42 - pristine_git_object: 7a66f3221a154b1a0f47c4f808ece8e580280548 - src/mistralai_azure/models/chatcompletionstreamrequest.py: - id: 1052b055a791 - last_write_checksum: sha1:18f71c5eeda25d23f2c82ddcdb710a20b44b806c - pristine_git_object: 96cd631b0ed74e5c82c6e2492011001021b019f8 - src/mistralai_azure/models/completionchunk.py: - id: e04bc380589d - last_write_checksum: sha1:490c3236276ae8fdecb883744e263aecbe4c608c - pristine_git_object: d6cc2a86a1fda1ebce1f3c5a169ab1118705e3f0 - src/mistralai_azure/models/completionevent.py: - id: e75909f919b1 - last_write_checksum: sha1:9f5423ad56747fb7cc95a6f01e0826510571d4c1 - pristine_git_object: 5a2039c2492bab82184b4f2469806f8b977a7246 - src/mistralai_azure/models/completionresponsestreamchoice.py: - id: 24fe265a60d8 - last_write_checksum: sha1:df52342c3458cca6396d538c5d9a42f07131796d - pristine_git_object: 0e890aacf79f8f220f585d914c6fbe8863232036 - src/mistralai_azure/models/contentchunk.py: - id: 9e6b90acdf54 - last_write_checksum: sha1:e93c57ef87654a06d8849030f65db3d279f8f7ad - pristine_git_object: e6a3e24a8857ea1661874197eec967f0ac99e31d - src/mistralai_azure/models/deltamessage.py: - id: 593eaaeda97b - last_write_checksum: sha1:9c2f6e52c81d2f5bf71f520861158dc5eae6eab7 - pristine_git_object: 7fa3c3f216153ebc0a2d31e590793698e95a8be8 - src/mistralai_azure/models/documenturlchunk.py: - id: bff69bfa8014 - last_write_checksum: sha1:5c515c4c85b78d8f4cf147faab9cf01c3501e0b9 - pristine_git_object: ea8d5625a6d1579dd60f2e4a067f455c82334986 - src/mistralai_azure/models/filechunk.py: - id: 0de687fe41c1 - last_write_checksum: sha1:56a1765b46702d24ee9c00ab3a06ccdbffdd63f9 - pristine_git_object: 2c3edc078b5e781b4d7163ab01e02a3347c81e2f - src/mistralai_azure/models/function.py: - id: 16111a6101f2 - last_write_checksum: sha1:456d34df457592f1975b0d1e158207d4446a6c41 - pristine_git_object: a4642f92a0cf614b458591c220a83ae1c422ce25 - src/mistralai_azure/models/functioncall.py: - id: e383b31a7f16 - last_write_checksum: sha1:cec288f925fa58842bb7d9e688f6122a01973d4b - pristine_git_object: dd93c4629c3bd81dd6fb305474ce0cd5443e1bdb - src/mistralai_azure/models/functionname.py: - id: ebc3e07e4b6f - last_write_checksum: sha1:743cec4c3f586d67d1ab2816d8d76170f46a3ca1 - pristine_git_object: b55c82af3f29efe38698bc776a8532c647dccc36 - src/mistralai_azure/models/httpvalidationerror.py: - id: da4825943f94 - last_write_checksum: sha1:dce58ead8f7f901514250e1ae5965ba039b1da14 - pristine_git_object: 56607d9437ce39097deac134d4f622ea523cbda7 - src/mistralai_azure/models/imageurl.py: - id: 80cc0df94e9d - last_write_checksum: sha1:a1a416ae5bf9c559219cff5f008a90f251a52477 - pristine_git_object: a5a66360b017cbdc342775241aa4aa2322534c6a - src/mistralai_azure/models/imageurlchunk.py: - id: c5c6dd2f1782 - last_write_checksum: sha1:11634325be12aa567b42227f2117e9b8c854a51c - pristine_git_object: a40e451c60caca688a9379dcb20d545e9e6b76e2 - src/mistralai_azure/models/jsonschema.py: - id: 8c635811dd6b - last_write_checksum: sha1:a99a6de224e51eb6cf85fa6de8cf37266ab5fe6d - pristine_git_object: 0f7563fc17bf172d527d09507294b4ef5646c22c - src/mistralai_azure/models/mistralazureerror.py: - id: a919897c4ea9 + src/mistralai/azure/client/models/__init__.py: + id: "335011330e21" + last_write_checksum: sha1:8547985d1a082544fd1b09c515d8a404ed6623c2 + pristine_git_object: dbcaca247ed52252a656430fcfca94cd2727fe64 + src/mistralai/azure/client/models/assistantmessage.py: + id: 353ed9110f97 + last_write_checksum: sha1:e444c76e27b9b745b9238894bdf2b6a40bba6e6e + pristine_git_object: f5793f9455485c576293b44fb548be8bae9c7a65 + src/mistralai/azure/client/models/chatcompletionchoice.py: + id: 6942c7db5891 + last_write_checksum: sha1:817bfda6120a98248322c308629e404081e01279 + pristine_git_object: 67b5ba694217f4f3b95589d7f84af6a9bea9802d + src/mistralai/azure/client/models/chatcompletionrequest.py: + id: 0c711c870184 + last_write_checksum: sha1:fae2a92375aa3e58c258e4497acead859cd3b6dc + pristine_git_object: 921790959880ddf9b9ffce15d881e01f8adefa86 + src/mistralai/azure/client/models/chatcompletionresponse.py: + id: bdfacf065e9e + last_write_checksum: sha1:c72fb624e7475a551d37e0b291b64bcf772c402a + pristine_git_object: d41f9c6fab670cf7c961f50b1302f9a88cf48162 + src/mistralai/azure/client/models/chatcompletionstreamrequest.py: + id: da00a7feb4ef + last_write_checksum: sha1:c8c84c818b3b22bfec1e7f5737bbb281088dd3ba + pristine_git_object: be21eed2ecbe8354eb9a4bfa48122b28dada4aaf + src/mistralai/azure/client/models/completionchunk.py: + id: 28d620f25510 + last_write_checksum: sha1:413545e0521539346bff6e77fdec0c9e383bde17 + pristine_git_object: b94284b2d9c29c25a2f8eaa02828e2a205f4407e + src/mistralai/azure/client/models/completionevent.py: + id: a6f00a747933 + last_write_checksum: sha1:3d04bfbdaf11c52af5613ed0fd70c8dbc59f6d49 + pristine_git_object: c4b272871d9b3ea8443f469d29b0825706c25c00 + src/mistralai/azure/client/models/completionresponsestreamchoice.py: + id: 3ba5d7ba8a13 + last_write_checksum: sha1:f917300daf4febec7661f2c73bae675600ee0bdd + pristine_git_object: 2a4d053feb84cf2a9675d76ae08c83945b26644c + src/mistralai/azure/client/models/contentchunk.py: + id: 1f65e4f8f731 + last_write_checksum: sha1:79efbc90c1ae36b74492666125fb3e5ecaa5c27a + pristine_git_object: 0f09f76703efd95fcd96377b8ec6870d58dbf829 + src/mistralai/azure/client/models/deltamessage.py: + id: b7dab1d158de + last_write_checksum: sha1:553fdff5a3aec6909417be3cb390d99421af1693 + pristine_git_object: 2c01feae56c44d256f1e579c15f08e167dcc6481 + src/mistralai/azure/client/models/documenturlchunk.py: + id: e56fec6e977f + last_write_checksum: sha1:a43cee08f935933bf715b2f1a82b4c746b591f35 + pristine_git_object: 345bafc2bfe3cc056d746cf8151cf53b68771414 + src/mistralai/azure/client/models/filechunk.py: + id: 150d9f180110 + last_write_checksum: sha1:df1e010006338f6dd37009f2547ab8f0b90b917a + pristine_git_object: 829f03d84c25dd859d514ffa26e570f235e4e75b + src/mistralai/azure/client/models/function.py: + id: 6d1e2011a14b + last_write_checksum: sha1:62df160db82853d79907cccff4d0904f6bb9f142 + pristine_git_object: f4edce0fb8563f485d9a63a42439a9b2593a7f40 + src/mistralai/azure/client/models/functioncall.py: + id: ced560a1bd57 + last_write_checksum: sha1:490cb3a0305994de063e06fa4c77defa911271f3 + pristine_git_object: d476792ccbb5aa2002deb870f1c81cc1500f59d4 + src/mistralai/azure/client/models/functionname.py: + id: 6f09474ebc85 + last_write_checksum: sha1:651ceed24416ce8192f70db03cc5cd0db685899f + pristine_git_object: 839e0d557a902da6c819210962e38e1df9bda90f + src/mistralai/azure/client/models/httpvalidationerror.py: + id: ca155413681b + last_write_checksum: sha1:9dea33d9c74bbdf842ee9d157e4aaa05c36ae34a + pristine_git_object: 40bccddc4d0c0e761d70af713387561101e20b60 + src/mistralai/azure/client/models/imageurl.py: + id: c8882341c798 + last_write_checksum: sha1:12e8b9bfb4442197406d88c012165f145b0a562e + pristine_git_object: 08c954faa8e422fe36b5fb02762de322b2b14b22 + src/mistralai/azure/client/models/imageurlchunk.py: + id: b6f0abb574d7 + last_write_checksum: sha1:4651f12f779bc86874c8516f06e39b882e414c92 + pristine_git_object: ee6de50f2add830c19d0b8b030a7c7a2ab65cb11 + src/mistralai/azure/client/models/jsonschema.py: + id: bfd486f4bb18 + last_write_checksum: sha1:ffe7190393086a4301aaffa6854cb3d80b0db92f + pristine_git_object: 5aaa490af350ac1c436dafb3d3c73d56402cac11 + src/mistralai/azure/client/models/mistralazureerror.py: + id: 31ed29254e67 last_write_checksum: sha1:25f4411c7411faad753d46118edf74828b1c9f7c pristine_git_object: c5bf17528c7cf25bac8f8874f58692c601fcdd76 - src/mistralai_azure/models/mistralpromptmode.py: - id: f62a521bcdae - last_write_checksum: sha1:82190bc14d2e51440723176cb8108791485c1180 - pristine_git_object: 77230b7e5e61cc662fdc52c72e8b817a15e183c3 - src/mistralai_azure/models/no_response_error.py: - id: 54523e14f29b + src/mistralai/azure/client/models/mistralpromptmode.py: + id: d0028b1e4129 + last_write_checksum: sha1:46fe1ab8ac2d5867877368a59a4aa5be2fabadeb + pristine_git_object: 26e7adbdc4a981c92d51b72542c966b0ba0fb8f8 + src/mistralai/azure/client/models/no_response_error.py: + id: a956d6cd06f0 last_write_checksum: sha1:7f326424a7d5ae1bcd5c89a0d6b3dbda9138942f pristine_git_object: 1deab64bc43e1e65bf3c412d326a4032ce342366 - src/mistralai_azure/models/ocrimageobject.py: - id: 6c349909fb0c - last_write_checksum: sha1:0fed6abf8172f6ee40e703ef86ee9d902c6e5d7e - pristine_git_object: 9d0dd01dbb5be095e234aa3ec9469fface68c3d2 - src/mistralai_azure/models/ocrpagedimensions.py: - id: f33f598001b2 - last_write_checksum: sha1:5281879ef3d737a17a539cefda9f222302ead7da - pristine_git_object: efb62a58f22ad62c730b3af93bff151586105957 - src/mistralai_azure/models/ocrpageobject.py: - id: 99f20768c4d6 - last_write_checksum: sha1:c7479b83b0eb619e6b0f82344e81bc691f0b3a46 - pristine_git_object: e95718001e07bb89ba2fc9094f88b894572148bb - src/mistralai_azure/models/ocrrequest.py: - id: 4e574d5fb9be - last_write_checksum: sha1:1b03dc8b392069f6b142228e74179c8341b09ffa - pristine_git_object: e9c23afcdd7440660f17c7819406d7e603eabbec - src/mistralai_azure/models/ocrresponse.py: - id: 326a4d9fab25 - last_write_checksum: sha1:cf597498a5841a56bbd1aeb8478bd57a01d93cb1 - pristine_git_object: 3e43fa8eb7b80fafbd9344ad5a98c0ead98c54cb - src/mistralai_azure/models/ocrtableobject.py: - id: 3ba1292c343a - last_write_checksum: sha1:2d1d05902a9ed6bccdb41ccac6782f015450cf2e - pristine_git_object: 189f059eaa8a32cc32a5320ea9fe33d779e8ef1c - src/mistralai_azure/models/ocrusageinfo.py: - id: 0de4eae62e4b - last_write_checksum: sha1:85e5a850bd2f847e4a02b0731b0327ca0a02f643 - pristine_git_object: 1f5c9f1bc2cf2d728dec06b0930602852474a29e - src/mistralai_azure/models/prediction.py: - id: 9e8a0a7a3ca7 - last_write_checksum: sha1:e78af600f109a7489a5bcce80b48adf29cc0c4c3 - pristine_git_object: b23a935c00cd7ce4e7b7bd6fe8f2da87f8aaca92 - src/mistralai_azure/models/referencechunk.py: - id: 420a12dfec3b - last_write_checksum: sha1:f49da7a4541f55b283e9391e6397a9e4286570bd - pristine_git_object: 32d2ca68e67be3f03e14f74fd7e7692fa05b70f5 - src/mistralai_azure/models/responseformat.py: - id: aa7acbc1bda7 - last_write_checksum: sha1:70e7960bb4ec5db5f133c4cc8f6e813e39f8c671 - pristine_git_object: c989f3a4467c21416ea59b33fbc734a1477a6eb3 - src/mistralai_azure/models/responseformats.py: - id: 780a7aa0e87e + src/mistralai/azure/client/models/ocrimageobject.py: + id: 9c9f987d94bb + last_write_checksum: sha1:b86f5187d1c425ddf27ed4815657a7c41d71855c + pristine_git_object: 38e9d3e48df5cee8cdd0cd1d7b6df62182814104 + src/mistralai/azure/client/models/ocrpagedimensions.py: + id: 7669a25f32b3 + last_write_checksum: sha1:60642db6bb61f0e96204fb78d3aa0bd80dd0a7e5 + pristine_git_object: 12858da92de99aa6da9d6e148df3ba7ee37496c7 + src/mistralai/azure/client/models/ocrpageobject.py: + id: eea193b05126 + last_write_checksum: sha1:baada584537b75e2e184738424068e61afe263c7 + pristine_git_object: 5fb821c19fd3cca2c2e149bd058a7ca49d2d002b + src/mistralai/azure/client/models/ocrrequest.py: + id: 365a5b4776a2 + last_write_checksum: sha1:9d3a9bccd341219934470688d3818557231b9b62 + pristine_git_object: fece2713166fc943194b7b38ec9b82db295bba0a + src/mistralai/azure/client/models/ocrresponse.py: + id: b8cde8c16a4c + last_write_checksum: sha1:e6f08c68f0388919ca7bcbc4f0cb134525053fcd + pristine_git_object: 787289fa995ba6cbf4b2ef3d3c41edb31f656674 + src/mistralai/azure/client/models/ocrtableobject.py: + id: c2cd51b8789e + last_write_checksum: sha1:11052d42f0d91916f038437923ea656bf882032c + pristine_git_object: 3e3c25830a3216f4ef325f5b1056a0c1a267b090 + src/mistralai/azure/client/models/ocrusageinfo.py: + id: 5e9118cac468 + last_write_checksum: sha1:6b27c09b5ec447c6ede22aa75190a1e06353349c + pristine_git_object: e2ceba35eb3f6e148389a7fd466dea5c051480a4 + src/mistralai/azure/client/models/prediction.py: + id: bd6abfa93083 + last_write_checksum: sha1:87eb3c43fa31b245c13c4708602b300956aa9efb + pristine_git_object: 6b8d6480b9ba1cb6683bdc93c24fb762ccfba146 + src/mistralai/azure/client/models/referencechunk.py: + id: c9612f854670 + last_write_checksum: sha1:b96507bcc82939fa4057532ef7e6a440baabd973 + pristine_git_object: e0bcb06be4d4c8d947ee267a9728aeae3a2c52fe + src/mistralai/azure/client/models/responseformat.py: + id: c124e7c316aa + last_write_checksum: sha1:f8c9e581053d1d885196c210a219a3e7aa086610 + pristine_git_object: 39fb03a25efdbc0a92ea91c72038ddd86ee056be + src/mistralai/azure/client/models/responseformats.py: + id: fef416cefcd4 last_write_checksum: sha1:a212e85d286b5b49219f57d071a2232ff8b5263b pristine_git_object: cbf83ce7b54ff8634f741334831807bfb5c98991 - src/mistralai_azure/models/responsevalidationerror.py: - id: 1952c765e2ec - last_write_checksum: sha1:d516c0c88210dd28b65747daa2fa1b63f432fe89 - pristine_git_object: a33954ccead3a8df87bdcc30a090efbb0ebecb94 - src/mistralai_azure/models/sdkerror.py: - id: bd8616367442 - last_write_checksum: sha1:41c259fac1bd50d33f1a2fd64d1ed17fd8d0d075 - pristine_git_object: 216d7f8fca986ac29162a1a7cba8c18b7f73d012 - src/mistralai_azure/models/security.py: - id: 7b3bcb55164e - last_write_checksum: sha1:9cacce270a27809ded4ee91aecac4a681154f5f0 - pristine_git_object: c1ae83138b09eab742f755a0f11428cf8c0fd60d - src/mistralai_azure/models/systemmessage.py: - id: 2e15bb043753 - last_write_checksum: sha1:8ec96bfc0533414a698d92387021cac116eadade - pristine_git_object: f99bf4ffb112b068159a3b95bc99ec7ce91b3f7d - src/mistralai_azure/models/systemmessagecontentchunks.py: - id: b6d9a4838359 - last_write_checksum: sha1:1e3f4688317d10f207dd42ef39cf2ac8f6042e54 - pristine_git_object: 4615a16cf39496dffc4982c6f0552d8bf353e280 - src/mistralai_azure/models/textchunk.py: - id: c169e3f0ffc9 - last_write_checksum: sha1:6cb623bafd4005e527dca9b908bb9f4b371342da - pristine_git_object: 5845456e5ca3089bcb551112408a0de84c597a91 - src/mistralai_azure/models/thinkchunk.py: - id: b1b9aeee4dcf - last_write_checksum: sha1:d15b39ef3e12195183664c32854233b9410d565b - pristine_git_object: f53a9f1ad2e6f124a36c9fb9be65bc09dbfbff4b - src/mistralai_azure/models/tool.py: - id: 99c8106f5428 - last_write_checksum: sha1:6142383805723bbc2b22f1bfcc660288378d1e42 - pristine_git_object: c91deec28488062a0220af41492fdfb34330e7a4 - src/mistralai_azure/models/toolcall.py: - id: 3643db1054cd - last_write_checksum: sha1:9b095f1efe1ea554cfacbc4a8e0c59b1c57d7f32 - pristine_git_object: 44fe8ec86b8f31ad8ee9591ae49036e8caa9ac41 - src/mistralai_azure/models/toolchoice.py: - id: 669768b7cbda - last_write_checksum: sha1:1217d8186e64d16f4c369079c62e3ac466726c60 - pristine_git_object: 93b4b7fe72f05a2ece9fed08a83139f4510b2574 - src/mistralai_azure/models/toolchoiceenum.py: - id: 5f7df8457771 + src/mistralai/azure/client/models/responsevalidationerror.py: + id: afdb9463b434 + last_write_checksum: sha1:26f01befeb347a63928012e7eb36c95a8a392145 + pristine_git_object: cbdffcbba45a988805cdd52d111e77b0ca777dbf + src/mistralai/azure/client/models/sdkerror.py: + id: 4601c7297af7 + last_write_checksum: sha1:b54041f9751e1f2a38dd02a6f8eadb3907fa3df0 + pristine_git_object: a1e9aacaa2fcc839dcb2638788dd7c94298adee7 + src/mistralai/azure/client/models/security.py: + id: 4a2e4760ec08 + last_write_checksum: sha1:0cd2ae54cecd88cfd8d43e92c0d3da7efa48942c + pristine_git_object: 9b83ba98336090bed89fbeda40b4a07b212a1106 + src/mistralai/azure/client/models/systemmessage.py: + id: 8fa0dee9e4e1 + last_write_checksum: sha1:2b52c44b92a098b559ec8b7a80449532169cd317 + pristine_git_object: 38c280c809148e190e329619858718d132da6bc0 + src/mistralai/azure/client/models/systemmessagecontentchunks.py: + id: 5918e770869d + last_write_checksum: sha1:55529f2f29ba3087fbf117dbbe64e1dda92b2958 + pristine_git_object: 225f38b712f5f3c7abfd526cc8c0386687814f36 + src/mistralai/azure/client/models/textchunk.py: + id: 9c81c76a6325 + last_write_checksum: sha1:d1c9eaffeb80299f023351dc8d07eb53e49133f2 + pristine_git_object: e513c1434cc7a4766bb9ef039ad8eed2bf0c12ca + src/mistralai/azure/client/models/thinkchunk.py: + id: df6bbd55b3eb + last_write_checksum: sha1:ec9af4cb7faa6ba8ed033b37db1d1d5a1406ac3f + pristine_git_object: e769399fe6ba90ddb2503f8fadb4b6cebc7d6f85 + src/mistralai/azure/client/models/tool.py: + id: 4075ef72c086 + last_write_checksum: sha1:0c041eaa008ee1851e05bf90e57602c0338f362f + pristine_git_object: 169305bc4c538e88b1e0cf1120aa10e424118880 + src/mistralai/azure/client/models/toolcall.py: + id: c65e6f79e539 + last_write_checksum: sha1:dd2290e019322e9df73b119e054a1d738eb5f3ba + pristine_git_object: a589b1b38ef4caaba2753f8335228bc16cd68961 + src/mistralai/azure/client/models/toolchoice.py: + id: c25062b5de34 + last_write_checksum: sha1:db82f8d3f811461226cffbeacf2699103a5e0689 + pristine_git_object: 1f623222084f12eaa63f2cea656dc7da10b12a3a + src/mistralai/azure/client/models/toolchoiceenum.py: + id: cc06ba3a8d21 last_write_checksum: sha1:3dbba9a58c5569aafe115f3f7713a52b01ad8620 pristine_git_object: 01f6f677b379f9e3c99db9d1ad248cb0033a2804 - src/mistralai_azure/models/toolmessage.py: - id: 1d9845bf98b3 - last_write_checksum: sha1:52bd15280bcae27ec7ba6a1c64b15648de5b0868 - pristine_git_object: 4bc5c9a9b509fdb89a4cf5ce81231189bf46bab4 - src/mistralai_azure/models/tooltypes.py: - id: 34c499f03e21 - last_write_checksum: sha1:f060bd3aebf7d42c1066c543c47cfa020e61eb27 - pristine_git_object: 638890c589ee642fd0a43e00337505e53ea3ec3a - src/mistralai_azure/models/usageinfo.py: - id: 59a5033672bf - last_write_checksum: sha1:7d0e7a483331077309b78e035cab9d65e87d3f65 - pristine_git_object: bbe5cdfaae260df81e93da11d05a1ba55ecbe329 - src/mistralai_azure/models/usermessage.py: - id: c54119314021 - last_write_checksum: sha1:b45f38755a96b07100baf5149631f366009e701f - pristine_git_object: 85fedb4bd1bcf64f69e4ead5310cf3fb354a6e3c - src/mistralai_azure/models/validationerror.py: - id: 83cd7bfd6d92 - last_write_checksum: sha1:250ed57498dabd11c0e2b6d255969e0285bb4214 - pristine_git_object: 4caff4a6b74aeb322bf42cd2070b7bd576ca834a - src/mistralai_azure/ocr.py: - id: 77e2e0f594ad - last_write_checksum: sha1:7daae9b0c14093d6d0bc0258b0bce008cb845a1e - pristine_git_object: 31e27f6eaa6dcc2b8450656d4a59dd4a7a50a29a - src/mistralai_azure/py.typed: - id: 98df238e554c + src/mistralai/azure/client/models/toolmessage.py: + id: 84ac736fa955 + last_write_checksum: sha1:11841bba4b66179321a35ea1a4d4d3571fa997b7 + pristine_git_object: a73fd6bf8355043f1b40caf7e8b9ded90c1fda0f + src/mistralai/azure/client/models/tooltypes.py: + id: fa881b046d34 + last_write_checksum: sha1:cd28ddc02fff9a5abbb59c82fe9e0dcbdb9b6d2a + pristine_git_object: 1cce7446f2772b998208ea1c78c7969e3881d5d0 + src/mistralai/azure/client/models/usageinfo.py: + id: 3edc9c81b329 + last_write_checksum: sha1:0b2117285b13d846a25c6c59436c4628b9d84a03 + pristine_git_object: 19a6b09fb63a3732719c45f8dfca92cfc2c57353 + src/mistralai/azure/client/models/usermessage.py: + id: 3796508adc07 + last_write_checksum: sha1:f4baa9d8b8f99f715873cea83191baf055c3296a + pristine_git_object: 96439c64a979ac3edf8900d39154d706846a3a95 + src/mistralai/azure/client/models/validationerror.py: + id: f2b84813e2ea + last_write_checksum: sha1:f0f9706a5af2ac4f6b234e768fdd492bbdd8a18c + pristine_git_object: 817ecf7a56470369ccacd0f5e0bb739656a5f92c + src/mistralai/azure/client/ocr.py: + id: 5817c10c9297 + last_write_checksum: sha1:24fec22877024154ea417e31ea443b4795c443ba + pristine_git_object: 098e764b6580e35ad0e81242ca601ce821656ee9 + src/mistralai/azure/client/py.typed: + id: e88369f116d2 last_write_checksum: sha1:8efc425ffe830805ffcc0f3055871bdcdc542c60 pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544 - src/mistralai_azure/sdkconfiguration.py: - id: 476a4f9e2f3e - last_write_checksum: sha1:6b117889b46a546be6e949c1bf843834ceff7417 - pristine_git_object: 51289cf05559ba32dd17e45fab78df4a8697063f - src/mistralai_azure/types/__init__.py: - id: d761bb7a67a5 + src/mistralai/azure/client/sdkconfiguration.py: + id: 602f74633eed + last_write_checksum: sha1:163fe779949725d81181f39b70d6922fc2cb8099 + pristine_git_object: 919225f9bf2e4315f879f0da6c7f8b3e6157bd58 + src/mistralai/azure/client/types/__init__.py: + id: f79033f78412 last_write_checksum: sha1:140ebdd01a46f92ffc710c52c958c4eba3cf68ed pristine_git_object: fc76fe0c5505e29859b5d2bb707d48fd27661b8c - src/mistralai_azure/types/basemodel.py: - id: 68c97875efb7 + src/mistralai/azure/client/types/basemodel.py: + id: fd244927c80c last_write_checksum: sha1:10d84aedeb9d35edfdadf2c3020caa1d24d8b584 pristine_git_object: a9a640a1a7048736383f96c67c6290c86bf536ee - src/mistralai_azure/utils/__init__.py: - id: 3c68abef839b + src/mistralai/azure/client/utils/__init__.py: + id: 26f1a707325b last_write_checksum: sha1:887f56a717845fab7445cc368d2a17d850c3565a pristine_git_object: 05f26ade57efb8c54a774fbcb939fb1a7dc655ce - src/mistralai_azure/utils/annotations.py: - id: 476ee839718f + src/mistralai/azure/client/utils/annotations.py: + id: bb1f6c189fdb last_write_checksum: sha1:a4824ad65f730303e4e1e3ec1febf87b4eb46dbc pristine_git_object: 12e0aa4f1151bb52474cc02e88397329b90703f6 - src/mistralai_azure/utils/datetimes.py: - id: e9faf3b28c48 + src/mistralai/azure/client/utils/datetimes.py: + id: 2b7db09ee0ab last_write_checksum: sha1:c721e4123000e7dc61ec52b28a739439d9e17341 pristine_git_object: a6c52cd61bbe2d459046c940ce5e8c469f2f0664 - src/mistralai_azure/utils/enums.py: - id: 4d10693bf655 + src/mistralai/azure/client/utils/enums.py: + id: ffbdb1917a68 last_write_checksum: sha1:bc8c3c1285ae09ba8a094ee5c3d9c7f41fa1284d pristine_git_object: 3324e1bc2668c54c4d5f5a1a845675319757a828 - src/mistralai_azure/utils/eventstreaming.py: - id: 5f5e90529fd7 + src/mistralai/azure/client/utils/eventstreaming.py: + id: bdc37b70360c last_write_checksum: sha1:bababae5d54b7efc360db701daa49e18a92c2f3b pristine_git_object: 0969899bfc491e5e408d05643525f347ea95e4fc - src/mistralai_azure/utils/forms.py: - id: 91c3fe9ba311 + src/mistralai/azure/client/utils/forms.py: + id: 51696122c557 last_write_checksum: sha1:15fa7e9ab1611e062a9984cf06cb20969713d295 pristine_git_object: f961e76beaf0a8b1fe0dda44754a74eebd3608e7 - src/mistralai_azure/utils/headers.py: - id: d37ef2f03e41 + src/mistralai/azure/client/utils/headers.py: + id: e42840c8cb13 last_write_checksum: sha1:7c6df233ee006332b566a8afa9ce9a245941d935 pristine_git_object: 37864cbbbc40d1a47112bbfdd3ba79568fc8818a - src/mistralai_azure/utils/logger.py: - id: 9122a46617cc + src/mistralai/azure/client/utils/logger.py: + id: 9db88755a137 last_write_checksum: sha1:f3fdb154a3f09b8cc43d74c7e9c02f899f8086e4 pristine_git_object: b661aff65d38b77d035149699aea09b2785d2fc6 - src/mistralai_azure/utils/metadata.py: - id: 2d93fa8523eb + src/mistralai/azure/client/utils/metadata.py: + id: 44f85bd3b2e2 last_write_checksum: sha1:c6a560bd0c63ab158582f34dadb69433ea73b3d4 pristine_git_object: 173b3e5ce658675c2f504222a56b3daaaa68107d - src/mistralai_azure/utils/queryparams.py: - id: dfd31ba97c2b + src/mistralai/azure/client/utils/queryparams.py: + id: ec1c03114156 last_write_checksum: sha1:b94c3f314fd3da0d1d215afc2731f48748e2aa59 pristine_git_object: c04e0db82b68eca041f2cb2614d748fbac80fd41 - src/mistralai_azure/utils/requestbodies.py: - id: c91db641d5b9 + src/mistralai/azure/client/utils/requestbodies.py: + id: 1030c47d624d last_write_checksum: sha1:41e2d2d2d3ecc394c8122ca4d4b85e1c3e03f054 pristine_git_object: 1de32b6d26f46590232f398fdba6ce0072f1659c - src/mistralai_azure/utils/retries.py: - id: 6f0cd9f6169d + src/mistralai/azure/client/utils/retries.py: + id: d50ed6e400b2 last_write_checksum: sha1:5b97ac4f59357d70c2529975d50364c88bcad607 pristine_git_object: 88a91b10cd2076b4a2c6cff2ac6bfaa5e3c5ad13 - src/mistralai_azure/utils/security.py: - id: "270040388028" + src/mistralai/azure/client/utils/security.py: + id: 1d35741ce5f1 last_write_checksum: sha1:a17130ace2c0db6394f38dd941ad2b700cc755c8 pristine_git_object: 295a3f40031dbb40073ad227fd4a355660f97ab2 - src/mistralai_azure/utils/serializers.py: - id: 595ddab03803 + src/mistralai/azure/client/utils/serializers.py: + id: a1f26d73c3ad last_write_checksum: sha1:ce1d8d7f500a9ccba0aeca5057cee9c271f4dfd7 pristine_git_object: 14321eb479de81d0d9580ec8291e0ff91bf29e57 - src/mistralai_azure/utils/unmarshal_json_response.py: - id: bde89a892417 - last_write_checksum: sha1:d2ce9e3478b38e54e4bb3a43610ee0bab00c2e27 - pristine_git_object: f5813119b559442ee85c0b310765db3866bfa09d - src/mistralai_azure/utils/url.py: - id: 080c62716b06 + src/mistralai/azure/client/utils/unmarshal_json_response.py: + id: 947f4fc4db62 + last_write_checksum: sha1:99bd357d24d2236e3974630d9bd18bae22610cbc + pristine_git_object: 5317ac87097ccb35628202cf7fc5cb21e186855f + src/mistralai/azure/client/utils/url.py: + id: 4976c88d0e3b last_write_checksum: sha1:6479961baa90432ca25626f8e40a7bbc32e73b41 pristine_git_object: c78ccbae426ce6d385709d97ce0b1c2813ea2418 - src/mistralai_azure/utils/values.py: - id: 640889083cda + src/mistralai/azure/client/utils/values.py: + id: 3974a1553447 last_write_checksum: sha1:acaa178a7c41ddd000f58cc691e4632d925b2553 pristine_git_object: dae01a44384ac3bc13ae07453a053bf6c898ebe3 examples: stream_chat: speakeasy-default-stream-chat: requestBody: - application/json: {"model": "azureai", "stream": true, "messages": [{"content": "Who is the best French painter? Answer in one short sentence.", "role": "user"}], "response_format": {"type": "text"}} + application/json: {"model": "azureai", "stream": true, "messages": [{"role": "user", "content": "Who is the best French painter? Answer in one short sentence."}], "response_format": {"type": "text"}} responses: "422": application/json: {} chat_completion_v1_chat_completions_post: speakeasy-default-chat-completion-v1-chat-completions-post: requestBody: - application/json: {"model": "azureai", "stream": false, "messages": [{"content": "Who is the best French painter? Answer in one short sentence.", "role": "user"}], "response_format": {"type": "text"}} + application/json: {"model": "azureai", "stream": false, "messages": [{"role": "user", "content": "Who is the best French painter? Answer in one short sentence."}], "response_format": {"type": "text"}} responses: "200": application/json: {"id": "cmpl-e5cc70bb28c444948073e77776eb30ef", "object": "chat.completion", "model": "mistral-small-latest", "usage": {"prompt_tokens": 0, "completion_tokens": 0, "total_tokens": 0}, "created": 1702256327, "choices": []} @@ -715,7 +680,7 @@ examples: application/json: {} userExample: requestBody: - application/json: {"model": "CX-9", "document": {"document_url": "https://upset-labourer.net/", "type": "document_url"}, "bbox_annotation_format": {"type": "text"}, "document_annotation_format": {"type": "text"}} + application/json: {"model": "CX-9", "document": {"type": "document_url", "document_url": "https://upset-labourer.net/"}, "bbox_annotation_format": {"type": "text"}, "document_annotation_format": {"type": "text"}} responses: "200": application/json: {"pages": [{"index": 1, "markdown": "# LEVERAGING UNLABELED DATA TO PREDICT OUT-OF-DISTRIBUTION PERFORMANCE\nSaurabh Garg*
Carnegie Mellon University
sgarg2@andrew.cmu.edu
Sivaraman Balakrishnan
Carnegie Mellon University
sbalakri@andrew.cmu.edu
Zachary C. Lipton
Carnegie Mellon University
zlipton@andrew.cmu.edu\n## Behnam Neyshabur\nGoogle Research, Blueshift team
neyshabur@google.com\nHanie Sedghi
Google Research, Brain team
hsedghi@google.com\n#### Abstract\nReal-world machine learning deployments are characterized by mismatches between the source (training) and target (test) distributions that may cause performance drops. In this work, we investigate methods for predicting the target domain accuracy using only labeled source data and unlabeled target data. We propose Average Thresholded Confidence (ATC), a practical method that learns a threshold on the model's confidence, predicting accuracy as the fraction of unlabeled examples for which model confidence exceeds that threshold. ATC outperforms previous methods across several model architectures, types of distribution shifts (e.g., due to synthetic corruptions, dataset reproduction, or novel subpopulations), and datasets (WILDS, ImageNet, BREEDS, CIFAR, and MNIST). In our experiments, ATC estimates target performance $2-4 \\times$ more accurately than prior methods. We also explore the theoretical foundations of the problem, proving that, in general, identifying the accuracy is just as hard as identifying the optimal predictor and thus, the efficacy of any method rests upon (perhaps unstated) assumptions on the nature of the shift. Finally, analyzing our method on some toy distributions, we provide insights concerning when it works ${ }^{1}$.\n## 1 INTRODUCTION\nMachine learning models deployed in the real world typically encounter examples from previously unseen distributions. While the IID assumption enables us to evaluate models using held-out data from the source distribution (from which training data is sampled), this estimate is no longer valid in presence of a distribution shift. Moreover, under such shifts, model accuracy tends to degrade (Szegedy et al., 2014; Recht et al., 2019; Koh et al., 2021). Commonly, the only data available to the practitioner are a labeled training set (source) and unlabeled deployment-time data which makes the problem more difficult. In this setting, detecting shifts in the distribution of covariates is known to be possible (but difficult) in theory (Ramdas et al., 2015), and in practice (Rabanser et al., 2018). However, producing an optimal predictor using only labeled source and unlabeled target data is well-known to be impossible absent further assumptions (Ben-David et al., 2010; Lipton et al., 2018).\nTwo vital questions that remain are: (i) the precise conditions under which we can estimate a classifier's target-domain accuracy; and (ii) which methods are most practically useful. To begin, the straightforward way to assess the performance of a model under distribution shift would be to collect labeled (target domain) examples and then to evaluate the model on that data. However, collecting fresh labeled data from the target distribution is prohibitively expensive and time-consuming, especially if the target distribution is non-stationary. Hence, instead of using labeled data, we aim to use unlabeled data from the target distribution, that is comparatively abundant, to predict model performance. Note that in this work, our focus is not to improve performance on the target but, rather, to estimate the accuracy on the target for a given classifier.\n[^0]: Work done in part while Saurabh Garg was interning at Google ${ }^{1}$ Code is available at [https://github.com/saurabhgarg1996/ATC_code](https://github.com/saurabhgarg1996/ATC_code).\n", "images": [], "dimensions": {"dpi": 200, "height": 2200, "width": 1700}}, {"index": 2, "markdown": "![img-0.jpeg](img-0.jpeg)\nFigure 1: Illustration of our proposed method ATC. Left: using source domain validation data, we identify a threshold on a score (e.g. negative entropy) computed on model confidence such that fraction of examples above the threshold matches the validation set accuracy. ATC estimates accuracy on unlabeled target data as the fraction of examples with the score above the threshold. Interestingly, this threshold yields accurate estimates on a wide set of target distributions resulting from natural and synthetic shifts. Right: Efficacy of ATC over previously proposed approaches on our testbed with a post-hoc calibrated model. To obtain errors on the same scale, we rescale all errors with Average Confidence (AC) error. Lower estimation error is better. See Table 1 for exact numbers and comparison on various types of distribution shift. See Sec. 5 for details on our testbed.\nRecently, numerous methods have been proposed for this purpose (Deng & Zheng, 2021; Chen et al., 2021b; Jiang et al., 2021; Deng et al., 2021; Guillory et al., 2021). These methods either require calibration on the target domain to yield consistent estimates (Jiang et al., 2021; Guillory et al., 2021) or additional labeled data from several target domains to learn a linear regression function on a distributional distance that then predicts model performance (Deng et al., 2021; Deng & Zheng, 2021; Guillory et al., 2021). However, methods that require calibration on the target domain typically yield poor estimates since deep models trained and calibrated on source data are not, in general, calibrated on a (previously unseen) target domain (Ovadia et al., 2019). Besides, methods that leverage labeled data from target domains rely on the fact that unseen target domains exhibit strong linear correlation with seen target domains on the underlying distance measure and, hence, can be rendered ineffective when such target domains with labeled data are unavailable (in Sec. 5.1 we demonstrate such a failure on a real-world distribution shift problem). Therefore, throughout the paper, we assume access to labeled source data and only unlabeled data from target domain(s).\nIn this work, we first show that absent assumptions on the source classifier or the nature of the shift, no method of estimating accuracy will work generally (even in non-contrived settings). To estimate accuracy on target domain perfectly, we highlight that even given perfect knowledge of the labeled source distribution (i.e., $p_{s}(x, y)$ ) and unlabeled target distribution (i.e., $p_{t}(x)$ ), we need restrictions on the nature of the shift such that we can uniquely identify the target conditional $p_{t}(y \\mid x)$. Thus, in general, identifying the accuracy of the classifier is as hard as identifying the optimal predictor.\nSecond, motivated by the superiority of methods that use maximum softmax probability (or logit) of a model for Out-Of-Distribution (OOD) detection (Hendrycks & Gimpel, 2016; Hendrycks et al., 2019), we propose a simple method that leverages softmax probability to predict model performance. Our method, Average Thresholded Confidence (ATC), learns a threshold on a score (e.g., maximum confidence or negative entropy) of model confidence on validation source data and predicts target domain accuracy as the fraction of unlabeled target points that receive a score above that threshold. ATC selects a threshold on validation source data such that the fraction of source examples that receive the score above the threshold match the accuracy of those examples. Our primary contribution in ATC is the proposal of obtaining the threshold and observing its efficacy on (practical) accuracy estimation. Importantly, our work takes a step forward in positively answering the question raised in Deng & Zheng (2021); Deng et al. (2021) about a practical strategy to select a threshold that enables accuracy prediction with thresholded model confidence.\n", "images": [{"id": "img-0.jpeg", "top_left_x": 292, "top_left_y": 217, "bottom_right_x": 1405, "bottom_right_y": 649, "image_base64": ""}], "dimensions": {"dpi": 200, "height": 2200, "width": 1700}}, {"index": 3, "markdown": "", "images": [], "dimensions": {"dpi": 539192, "height": 944919, "width": 247256}}, {"index": 27, "markdown": "![img-8.jpeg](img-8.jpeg)\nFigure 9: Scatter plot of predicted accuracy versus (true) OOD accuracy for vision datasets except MNIST with a ResNet50 model. Results reported by aggregating MAE numbers over 4 different seeds.\n", "images": [{"id": "img-8.jpeg", "top_left_x": 290, "top_left_y": 226, "bottom_right_x": 1405, "bottom_right_y": 1834, "image_base64": ""}], "dimensions": {"dpi": 200, "height": 2200, "width": 1700}}, {"index": 28, "markdown": "| Dataset | Shift | IM | | AC | | DOC | | GDE | ATC-MC (Ours) | | ATC-NE (Ours) | | | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | | | | Pre T | Post T | Pre T | Post T | Pre T | Post T | Post T | Pre T | Post T | Pre T | Post T | | CIFAR10 | Natural | 6.60 | 5.74 | 9.88 | 6.89 | 7.25 | 6.07 | 4.77 | 3.21 | 3.02 | 2.99 | 2.85 | | | | (0.35) | (0.30) | (0.16) | (0.13) | (0.15) | (0.16) | (0.13) | (0.49) | (0.40) | (0.37) | (0.29) | | | Synthetic | 12.33 | 10.20 | 16.50 | 11.91 | 13.87 | 11.08 | 6.55 | 4.65 | 4.25 | 4.21 | 3.87 | | | | (0.51) | (0.48) | (0.26) | (0.17) | (0.18) | (0.17) | (0.35) | (0.55) | (0.55) | (0.55) | (0.75) | | CIFAR100 | Synthetic | 13.69 | 11.51 | 23.61 | 13.10 | 14.60 | 10.14 | 9.85 | 5.50 | 4.75 | 4.72 | 4.94 | | | | (0.55) | (0.41) | (1.16) | (0.80) | (0.77) | (0.64) | (0.57) | (0.70) | (0.73) | (0.74) | (0.74) | | ImageNet200 | Natural | 12.37 | 8.19 | 22.07 | 8.61 | 15.17 | 7.81 | 5.13 | 4.37 | 2.04 | 3.79 | 1.45 | | | | (0.25) | (0.33) | (0.08) | (0.25) | (0.11) | (0.29) | (0.08) | (0.39) | (0.24) | (0.30) | (0.27) | | | Synthetic | 19.86 | 12.94 | 32.44 | 13.35 | 25.02 | 12.38 | 5.41 | 5.93 | 3.09 | 5.00 | 2.68 | | | | (1.38) | (1.81) | (1.00) | (1.30) | (1.10) | (1.38) | (0.89) | (1.38) | (0.87) | (1.28) | (0.45) | | ImageNet | Natural | 7.77 | 6.50 | 18.13 | 6.02 | 8.13 | 5.76 | 6.23 | 3.88 | 2.17 | 2.06 | 0.80 | | | | (0.27) | (0.33) | (0.23) | (0.34) | (0.27) | (0.37) | (0.41) | (0.53) | (0.62) | (0.54) | (0.44) | | | Synthetic | 13.39 | 10.12 | 24.62 | 8.51 | 13.55 | 7.90 | 6.32 | 3.34 | 2.53 | 2.61 | 4.89 | | | | (0.53) | (0.63) | (0.64) | (0.71) | (0.61) | (0.72) | (0.33) | (0.53) | (0.36) | (0.33) | (0.83) | | FMoW-WILDS | Natural | 5.53 | 4.31 | 33.53 | 12.84 | 5.94 | 4.45 | 5.74 | 3.06 | 2.70 | 3.02 | 2.72 | | | | (0.33) | (0.63) | (0.13) | (12.06) | (0.36) | (0.77) | (0.55) | (0.36) | (0.54) | (0.35) | (0.44) | | RxRx1-WILDS | Natural | 5.80 | 5.72 | 7.90 | 4.84 | 5.98 | 5.98 | 6.03 | 4.66 | 4.56 | 4.41 | 4.47 | | | | (0.17) | (0.15) | (0.24) | (0.09) | (0.15) | (0.13) | (0.08) | (0.38) | (0.38) | (0.31) | (0.26) | | Amazon-WILDS | Natural | 2.40 | 2.29 | 8.01 | 2.38 | 2.40 | 2.28 | 17.87 | 1.65 | 1.62 | 1.60 | 1.59 | | | | (0.08) | (0.09) | (0.53) | (0.17) | (0.09) | (0.09) | (0.18) | (0.06) | (0.05) | (0.14) | (0.15) | | CivilCom.-WILDS | Natural | 12.64 | 10.80 | 16.76 | 11.03 | 13.31 | 10.99 | 16.65 | | 7.14 | | | | | | (0.52) | (0.48) | (0.53) | (0.49) | (0.52) | (0.49) | (0.25) | | (0.41) | | | | MNIST | Natural | 18.48 | 15.99 | 21.17 | 14.81 | 20.19 | 14.56 | 24.42 | 5.02 | 2.40 | 3.14 | 3.50 | | | | (0.45) | (1.53) | (0.24) | (3.89) | (0.23) | (3.47) | (0.41) | (0.44) | (1.83) | (0.49) | (0.17) | | ENTITY-13 | Same | 16.23 | 11.14 | 24.97 | 10.88 | 19.08 | 10.47 | 10.71 | 5.39 | 3.88 | 4.58 | 4.19 | | | | (0.77) | (0.65) | (0.70) | (0.77) | (0.65) | (0.72) | (0.74) | (0.92) | (0.61) | (0.85) | (0.16) | | | Novel | 28.53 | 22.02 | 38.33 | 21.64 | 32.43 | 21.22 | 20.61 | 13.58 | 10.28 | 12.25 | 6.63 | | | | (0.82) | (0.68) | (0.75) | (0.86) | (0.69) | (0.80) | (0.60) | (1.15) | (1.34) | (1.21) | (0.93) | | ENTITY-30 | Same | 18.59 | 14.46 | 28.82 | 14.30 | 21.63 | 13.46 | 12.92 | 9.12 | 7.75 | 8.15 | 7.64 | | | | (0.51) | (0.52) | (0.43) | (0.71) | (0.37) | (0.59) | (0.14) | (0.62) | (0.72) | (0.68) | (0.88) | | | Novel | 32.34 | 26.85 | 44.02 | 26.27 | 36.82 | 25.42 | 23.16 | 17.75 | 14.30 | 15.60 | 10.57 | | | | (0.60) | (0.58) | (0.56) | (0.79) | (0.47) | (0.68) | (0.12) | (0.76) | (0.85) | (0.86) | (0.86) | | NONLIVING-26 | Same | 18.66 | 17.17 | 26.39 | 16.14 | 19.86 | 15.58 | 16.63 | 10.87 | 10.24 | 10.07 | 10.26 | | | | (0.76) | (0.74) | (0.82) | (0.81) | (0.67) | (0.76) | (0.45) | (0.98) | (0.83) | (0.92) | (1.18) | | | Novel | 33.43 | 31.53 | 41.66 | 29.87 | 35.13 | 29.31 | 29.56 | 21.70 | 20.12 | 19.08 | 18.26 | | | | (0.67) | (0.65) | (0.67) | (0.71) | (0.54) | (0.64) | (0.21) | (0.86) | (0.75) | (0.82) | (1.12) | | LIVING-17 | Same | 12.63 | 11.05 | 18.32 | 10.46 | 14.43 | 10.14 | 9.87 | 4.57 | 3.95 | 3.81 | 4.21 | | | | (1.25) | (1.20) | (1.01) | (1.12) | (1.11) | (1.16) | (0.61) | (0.71) | (0.48) | (0.22) | (0.53) | | | Novel | 29.03 | 26.96 | 35.67 | 26.11 | 31.73 | 25.73 | 23.53 | 16.15 | 14.49 | 12.97 | 11.39 | | | | (1.44) | (1.38) | (1.09) | (1.27) | (1.19) | (1.35) | (0.52) | (1.36) | (1.46) | (1.52) | (1.72) |\nTable 3: Mean Absolute estimation Error (MAE) results for different datasets in our setup grouped by the nature of shift. 'Same' refers to same subpopulation shifts and 'Novel' refers novel subpopulation shifts. We include details about the target sets considered in each shift in Table 2. Post T denotes use of TS calibration on source. For language datasets, we use DistilBERT-base-uncased, for vision dataset we report results with DenseNet model with the exception of MNIST where we use FCN. Across all datasets, we observe that ATC achieves superior performance (lower MAE is better). For GDE post T and pre T estimates match since TS doesn't alter the argmax prediction. Results reported by aggregating MAE numbers over 4 different seeds. Values in parenthesis (i.e., $(\\cdot)$ ) denote standard deviation values.\n", "images": [], "dimensions": {"dpi": 200, "height": 2200, "width": 1700}}, {"index": 29, "markdown": "| Dataset | Shift | IM | | AC | | DOC | | GDE | ATC-MC (Ours) | | ATC-NE (Ours) | | | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | | | | Pre T | Post T | Pre T | Post T | Pre T | Post T | Post T | Pre T | Post T | Pre T | Post T | | CIFAR10 | Natural | 7.14 | 6.20 | 10.25 | 7.06 | 7.68 | 6.35 | 5.74 | 4.02 | 3.85 | 3.76 | 3.38 | | | | (0.14) | (0.11) | (0.31) | (0.33) | (0.28) | (0.27) | (0.25) | (0.38) | (0.30) | (0.33) | (0.32) | | | Synthetic | 12.62 | 10.75 | 16.50 | 11.91 | 13.93 | 11.20 | 7.97 | 5.66 | 5.03 | 4.87 | 3.63 | | | | (0.76) | (0.71) | (0.28) | (0.24) | (0.29) | (0.28) | (0.13) | (0.64) | (0.71) | (0.71) | (0.62) | | CIFAR100 | Synthetic | 12.77 | 12.34 | 16.89 | 12.73 | 11.18 | 9.63 | 12.00 | 5.61 | 5.55 | 5.65 | 5.76 | | | | (0.43) | (0.68) | (0.20) | (2.59) | (0.35) | (1.25) | (0.48) | (0.51) | (0.55) | (0.35) | (0.27) | | ImageNet200 | Natural | 12.63 | 7.99 | 23.08 | 7.22 | 15.40 | 6.33 | 5.00 | 4.60 | 1.80 | 4.06 | 1.38 | | | | (0.59) | (0.47) | (0.31) | (0.22) | (0.42) | (0.24) | (0.36) | (0.63) | (0.17) | (0.69) | (0.29) | | | Synthetic | 20.17 | 11.74 | 33.69 | 9.51 | 25.49 | 8.61 | 4.19 | 5.37 | 2.78 | 4.53 | 3.58 | | | | (0.74) | (0.80) | (0.73) | (0.51) | (0.66) | (0.50) | (0.14) | (0.88) | (0.23) | (0.79) | (0.33) | | ImageNet | Natural | 8.09 | 6.42 | 21.66 | 5.91 | 8.53 | 5.21 | 5.90 | 3.93 | 1.89 | 2.45 | 0.73 | | | | (0.25) | (0.28) | (0.38) | (0.22) | (0.26) | (0.25) | (0.44) | (0.26) | (0.21) | (0.16) | (0.10) | | | Synthetic | 13.93 | 9.90 | 28.05 | 7.56 | 13.82 | 6.19 | 6.70 | 3.33 | 2.55 | 2.12 | 5.06 | | | | (0.14) | (0.23) | (0.39) | (0.13) | (0.31) | (0.07) | (0.52) | (0.25) | (0.25) | (0.31) | (0.27) | | FMoW-WILDS | Natural | 5.15 | 3.55 | 34.64 | 5.03 | 5.58 | 3.46 | 5.08 | 2.59 | 2.33 | 2.52 | 2.22 | | | | (0.19) | (0.41) | (0.22) | (0.29) | (0.17) | (0.37) | (0.46) | (0.32) | (0.28) | (0.25) | (0.30) | | RxRx1-WILDS | Natural | 6.17 | 6.11 | 21.05 | 5.21 | 6.54 | 6.27 | 6.82 | 5.30 | 5.20 | 5.19 | 5.63 | | | | (0.20) | (0.24) | (0.31) | (0.18) | (0.21) | (0.20) | (0.31) | (0.30) | (0.44) | (0.43) | (0.55) | | Entity-13 | Same | 18.32 | 14.38 | 27.79 | 13.56 | 20.50 | 13.22 | 16.09 | 9.35 | 7.50 | 7.80 | 6.94 | | | | (0.29) | (0.53) | (1.18) | (0.58) | (0.47) | (0.58) | (0.84) | (0.79) | (0.65) | (0.62) | (0.71) | | | Novel | 28.82 | 24.03 | 38.97 | 22.96 | 31.66 | 22.61 | 25.26 | 17.11 | 13.96 | 14.75 | 9.94 | | | | (0.30) | (0.55) | (1.32) | (0.59) | (0.54) | (0.58) | (1.08) | (0.93) | (0.64) | (0.78) | | | Entity-30 | Same | 16.91 | 14.61 | 26.84 | 14.37 | 18.60 | 13.11 | 13.74 | 8.54 | 7.94 | 7.77 | 8.04 | | | | (1.33) | (1.11) | (2.15) | (1.34) | (1.69) | (1.30) | (1.07) | (1.47) | (1.38) | (1.44) | (1.51) | | | Novel | 28.66 | 25.83 | 39.21 | 25.03 | 30.95 | 23.73 | 23.15 | 15.57 | 13.24 | 12.44 | 11.05 | | | | (1.16) | (0.88) | (2.03) | (1.11) | (1.64) | (1.11) | (0.51) | (1.44) | (1.15) | (1.26) | (1.13) | | NonLIVING-26 | Same | 17.43 | 15.95 | 27.70 | 15.40 | 18.06 | 14.58 | 16.99 | 10.79 | 10.13 | 10.05 | 10.29 | | | | (0.90) | (0.86) | (0.90) | (0.69) | (1.00) | (0.78) | (1.25) | (0.62) | (0.32) | (0.46) | (0.79) | | | Novel | 29.51 | 27.75 | 40.02 | 26.77 | 30.36 | 25.93 | 27.70 | 19.64 | 17.75 | 16.90 | 15.69 | | | | (0.86) | (0.82) | (0.76) | (0.82) | (0.95) | (0.80) | (1.42) | (0.68) | (0.53) | (0.60) | (0.83) | | LIVING-17 | Same | 14.28 | 12.21 | 23.46 | 11.16 | 15.22 | 10.78 | 10.49 | 4.92 | 4.23 | 4.19 | 4.73 | | | | (0.96) | (0.93) | (1.16) | (0.90) | (0.96) | (0.99) | (0.97) | (0.57) | (0.42) | (0.35) | (0.24) | | | Novel | 28.91 | 26.35 | 38.62 | 24.91 | 30.32 | 24.52 | 22.49 | 15.42 | 13.02 | 12.29 | 10.34 | | | | (0.66) | (0.73) | (1.01) | (0.61) | (0.59) | (0.74) | (0.85) | (0.59) | (0.53) | (0.73) | (0.62) |\nTable 4: Mean Absolute estimation Error (MAE) results for different datasets in our setup grouped by the nature of shift for ResNet model. 'Same' refers to same subpopulation shifts and 'Novel' refers novel subpopulation shifts. We include details about the target sets considered in each shift in Table 2. Post T denotes use of TS calibration on source. Across all datasets, we observe that ATC achieves superior performance (lower MAE is better). For GDE post T and pre T estimates match since TS doesn't alter the argmax prediction. Results reported by aggregating MAE numbers over 4 different seeds. Values in parenthesis (i.e., $(\\cdot)$ ) denote standard deviation values.\n", "images": [], "dimensions": {"dpi": 200, "height": 2200, "width": 1700}}], "model": "mistral-ocr-2503-completion", "usage_info": {"pages_processed": 29, "doc_size_bytes": null}} diff --git a/packages/mistralai_azure/.speakeasy/gen.yaml b/packages/azure/.speakeasy/gen.yaml similarity index 78% rename from packages/mistralai_azure/.speakeasy/gen.yaml rename to packages/azure/.speakeasy/gen.yaml index e2be4d84..729cdfcf 100644 --- a/packages/mistralai_azure/.speakeasy/gen.yaml +++ b/packages/azure/.speakeasy/gen.yaml @@ -8,11 +8,13 @@ generation: useClassNamesForArrayFields: true fixes: nameResolutionDec2023: true - nameResolutionFeb2025: false + nameResolutionFeb2025: true parameterOrderingFeb2024: true requestResponseComponentNamesFeb2024: true - securityFeb2025: false - sharedErrorComponentsApr2025: false + securityFeb2025: true + sharedErrorComponentsApr2025: true + methodSignaturesApr2024: true + sharedNestedComponentsJan2026: true auth: oAuth2ClientCredentialsEnabled: true oAuth2PasswordEnabled: false @@ -26,7 +28,7 @@ generation: generateNewTests: false skipResponseBodyAssertions: false python: - version: 1.8.1 + version: 2.0.0a4 additionalDependencies: dev: pytest: ^8.2.2 @@ -45,10 +47,13 @@ python: enableCustomCodeRegions: false enumFormat: union fixFlags: - responseRequiredSep2024: false + responseRequiredSep2024: true + flatAdditionalProperties: true flattenGlobalSecurity: true flattenRequests: true flatteningOrder: parameters-first + forwardCompatibleEnumsByDefault: true + forwardCompatibleUnionsByDefault: tagged-only imports: option: openapi paths: @@ -62,12 +67,12 @@ python: license: "" maxMethodParams: 15 methodArguments: infer-optional-args - moduleName: "" + moduleName: mistralai.azure.client multipartArrayFormat: legacy outputModelSuffix: output packageManager: uv - packageName: mistralai_azure - preApplyUnionDiscriminators: false + packageName: mistralai-azure + preApplyUnionDiscriminators: true pytestFilterWarnings: [] pytestTimeout: 0 responseFormat: flat diff --git a/packages/mistralai_azure/CONTRIBUTING.md b/packages/azure/CONTRIBUTING.md similarity index 100% rename from packages/mistralai_azure/CONTRIBUTING.md rename to packages/azure/CONTRIBUTING.md diff --git a/packages/mistralai_azure/README.md b/packages/azure/README.md similarity index 87% rename from packages/mistralai_azure/README.md rename to packages/azure/README.md index f869b90a..05872306 100644 --- a/packages/mistralai_azure/README.md +++ b/packages/azure/README.md @@ -26,12 +26,12 @@ This example shows how to create chat completions. ```python # Synchronous Example -from mistralai_azure import MistralAzure +from mistralai.azure.client import MistralAzure import os s = MistralAzure( - azure_api_key=os.getenv("AZURE_API_KEY", ""), - azure_endpoint=os.getenv("AZURE_ENDPOINT", "") + api_key=os.getenv("AZURE_API_KEY", ""), + server_url=os.getenv("AZURE_ENDPOINT", "") ) @@ -56,13 +56,13 @@ The same SDK client can also be used to make asychronous requests by importing a ```python # Asynchronous Example import asyncio -from mistralai_azure import MistralAzure +from mistralai.azure.client import MistralAzure import os async def main(): s = MistralAzure( - azure_api_key=os.getenv("AZURE_API_KEY", ""), - azure_endpoint=os.getenv("AZURE_ENDPOINT", "") + api_key=os.getenv("AZURE_API_KEY", ""), + server_url=os.getenv("AZURE_ENDPOINT", "") ) res = await s.chat.complete_async( messages=[ @@ -100,12 +100,12 @@ terminate when the server no longer has any events to send and closes the underlying connection. ```python -from mistralai_azure import MistralAzure +from mistralai.azure.client import MistralAzure import os s = MistralAzure( - azure_api_key=os.getenv("AZURE_API_KEY", ""), - azure_endpoint=os.getenv("AZURE_ENDPOINT", "") + api_key=os.getenv("AZURE_API_KEY", ""), + server_url=os.getenv("AZURE_ENDPOINT", "") ) @@ -137,13 +137,13 @@ Some of the endpoints in this SDK support retries. If you use the SDK without an To change the default retry strategy for a single API call, simply provide a `RetryConfig` object to the call: ```python -from mistralai_azure import MistralAzure -from mistralazure.utils import BackoffStrategy, RetryConfig +from mistralai.azure.client import MistralAzure +from mistralai.azure.client.utils import BackoffStrategy, RetryConfig import os s = MistralAzure( - azure_api_key=os.getenv("AZURE_API_KEY", ""), - azure_endpoint=os.getenv("AZURE_ENDPOINT", "") + api_key=os.getenv("AZURE_API_KEY", ""), + server_url=os.getenv("AZURE_ENDPOINT", "") ) @@ -164,14 +164,14 @@ if res is not None: If you'd like to override the default retry strategy for all operations that support retries, you can use the `retry_config` optional parameter when initializing the SDK: ```python -from mistralai_azure import MistralAzure -from mistralazure.utils import BackoffStrategy, RetryConfig +from mistralai.azure.client import MistralAzure +from mistralai.azure.client.utils import BackoffStrategy, RetryConfig import os s = MistralAzure( retry_config=RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False), - azure_api_key=os.getenv("AZURE_API_KEY", ""), - azure_endpoint=os.getenv("AZURE_ENDPOINT", "") + api_key=os.getenv("AZURE_API_KEY", ""), + server_url=os.getenv("AZURE_ENDPOINT", "") ) @@ -203,12 +203,13 @@ Handling errors in this SDK should largely match your expectations. All operati ### Example ```python -from mistralai_azure import MistralAzure, models +from mistralai.azure.client import MistralAzure +from mistralai.azure.client import models import os s = MistralAzure( - azure_api_key=os.getenv("AZURE_API_KEY", ""), - azure_endpoint=os.getenv("AZURE_ENDPOINT", "") + api_key=os.getenv("AZURE_API_KEY", ""), + server_url=os.getenv("AZURE_ENDPOINT", "") ) res = None @@ -248,13 +249,13 @@ You can override the default server globally by passing a server name to the `se #### Example ```python -from mistralai_azure import MistralAzure +from mistralai.azure.client import MistralAzure import os s = MistralAzure( server="prod", - azure_api_key=os.getenv("AZURE_API_KEY", ""), - azure_endpoint=os.getenv("AZURE_ENDPOINT", "") + api_key=os.getenv("AZURE_API_KEY", ""), + server_url=os.getenv("AZURE_ENDPOINT", "") ) @@ -277,13 +278,13 @@ if res is not None: 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: ```python -from mistralai_azure import MistralAzure +from mistralai.azure.client import MistralAzure import os s = MistralAzure( server_url="https://api.mistral.ai", - azure_api_key=os.getenv("AZURE_API_KEY", ""), - azure_endpoint=os.getenv("AZURE_ENDPOINT", "") + api_key=os.getenv("AZURE_API_KEY", ""), + server_url=os.getenv("AZURE_ENDPOINT", "") ) @@ -311,7 +312,7 @@ This allows you to wrap the client with your own custom logic, such as adding cu For example, you could specify a header for every request that this sdk makes as follows: ```python -from mistralai_azure import MistralAzure +from mistralai.azure.client import MistralAzure import httpx http_client = httpx.Client(headers={"x-custom-header": "someValue"}) @@ -320,8 +321,8 @@ s = MistralAzure(client=http_client) or you could wrap the client with your own custom logic: ```python -from mistralai_azure import MistralAzure -from mistralai_azure.httpclient import AsyncHttpClient +from mistralai.azure.client import MistralAzure +from mistralai.azure.client.httpclient import AsyncHttpClient import httpx class CustomClient(AsyncHttpClient): @@ -396,12 +397,12 @@ This SDK supports the following security scheme globally: To authenticate with the API the `api_key` parameter must be set when initializing the SDK client instance. For example: ```python -from mistralai_azure import MistralAzure +from mistralai.azure.client import MistralAzure import os s = MistralAzure( - azure_api_key=os.getenv("AZURE_API_KEY", ""), - azure_endpoint=os.getenv("AZURE_ENDPOINT", "") + api_key=os.getenv("AZURE_API_KEY", ""), + server_url=os.getenv("AZURE_ENDPOINT", "") ) diff --git a/packages/mistralai_azure/RELEASES.md b/packages/azure/RELEASES.md similarity index 100% rename from packages/mistralai_azure/RELEASES.md rename to packages/azure/RELEASES.md diff --git a/packages/mistralai_azure/USAGE.md b/packages/azure/USAGE.md similarity index 76% rename from packages/mistralai_azure/USAGE.md rename to packages/azure/USAGE.md index 0ccf3d70..0f90c161 100644 --- a/packages/mistralai_azure/USAGE.md +++ b/packages/azure/USAGE.md @@ -5,12 +5,12 @@ This example shows how to create chat completions. ```python # Synchronous Example -from mistralai_azure import MistralAzure +from mistralai.azure.client import MistralAzure import os s = MistralAzure( - azure_api_key=os.getenv("AZURE_API_KEY", ""), - azure_endpoint=os.getenv("AZURE_ENDPOINT", "") + api_key=os.getenv("AZURE_API_KEY", ""), + server_url=os.getenv("AZURE_ENDPOINT", "") ) @@ -32,13 +32,13 @@ The same SDK client can also be used to make asychronous requests by importing a ```python # Asynchronous Example import asyncio -from mistralai_azure import MistralAzure +from mistralai.azure.client import MistralAzure import os async def main(): s = MistralAzure( - azure_api_key=os.getenv("AZURE_API_KEY", ""), - azure_endpoint=os.getenv("AZURE_ENDPOINT", "") + api_key=os.getenv("AZURE_API_KEY", ""), + server_url=os.getenv("AZURE_ENDPOINT", "") ) res = await s.chat.complete_async(messages=[ { diff --git a/packages/mistralai_azure/docs/models/arguments.md b/packages/azure/docs/models/arguments.md similarity index 100% rename from packages/mistralai_azure/docs/models/arguments.md rename to packages/azure/docs/models/arguments.md diff --git a/packages/mistralai_azure/docs/models/assistantmessage.md b/packages/azure/docs/models/assistantmessage.md similarity index 95% rename from packages/mistralai_azure/docs/models/assistantmessage.md rename to packages/azure/docs/models/assistantmessage.md index 3d0bd90b..9ef63837 100644 --- a/packages/mistralai_azure/docs/models/assistantmessage.md +++ b/packages/azure/docs/models/assistantmessage.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `role` | *Optional[Literal["assistant"]]* | :heavy_minus_sign: | N/A | | `content` | [OptionalNullable[models.AssistantMessageContent]](../models/assistantmessagecontent.md) | :heavy_minus_sign: | N/A | | `tool_calls` | List[[models.ToolCall](../models/toolcall.md)] | :heavy_minus_sign: | N/A | -| `prefix` | *Optional[bool]* | :heavy_minus_sign: | Set this to `true` when adding an assistant message as prefix to condition the model response. The role of the prefix message is to force the model to start its answer by the content of the message. | -| `role` | [Optional[models.AssistantMessageRole]](../models/assistantmessagerole.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `prefix` | *Optional[bool]* | :heavy_minus_sign: | Set this to `true` when adding an assistant message as prefix to condition the model response. The role of the prefix message is to force the model to start its answer by the content of the message. | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/assistantmessagecontent.md b/packages/azure/docs/models/assistantmessagecontent.md similarity index 100% rename from packages/mistralai_azure/docs/models/assistantmessagecontent.md rename to packages/azure/docs/models/assistantmessagecontent.md diff --git a/packages/mistralai_azure/docs/models/chatcompletionchoice.md b/packages/azure/docs/models/chatcompletionchoice.md similarity index 100% rename from packages/mistralai_azure/docs/models/chatcompletionchoice.md rename to packages/azure/docs/models/chatcompletionchoice.md diff --git a/packages/mistralai_azure/docs/models/chatcompletionchoicefinishreason.md b/packages/azure/docs/models/chatcompletionchoicefinishreason.md similarity index 100% rename from packages/mistralai_azure/docs/models/chatcompletionchoicefinishreason.md rename to packages/azure/docs/models/chatcompletionchoicefinishreason.md diff --git a/packages/mistralai_azure/docs/models/chatcompletionrequest.md b/packages/azure/docs/models/chatcompletionrequest.md similarity index 99% rename from packages/mistralai_azure/docs/models/chatcompletionrequest.md rename to packages/azure/docs/models/chatcompletionrequest.md index 104a1f96..3b0f7270 100644 --- a/packages/mistralai_azure/docs/models/chatcompletionrequest.md +++ b/packages/azure/docs/models/chatcompletionrequest.md @@ -13,7 +13,7 @@ | `stop` | [Optional[models.ChatCompletionRequestStop]](../models/chatcompletionrequeststop.md) | :heavy_minus_sign: | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array | | | `random_seed` | *OptionalNullable[int]* | :heavy_minus_sign: | The seed to use for random sampling. If set, different calls will generate deterministic results. | | | `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | | -| `messages` | List[[models.ChatCompletionRequestMessages](../models/chatcompletionrequestmessages.md)] | :heavy_check_mark: | The prompt(s) to generate completions for, encoded as a list of dict with role and content. | [
{
"role": "user",
"content": "Who is the best French painter? Answer in one short sentence."
}
] | +| `messages` | List[[models.ChatCompletionRequestMessage](../models/chatcompletionrequestmessage.md)] | :heavy_check_mark: | The prompt(s) to generate completions for, encoded as a list of dict with role and content. | [
{
"role": "user",
"content": "Who is the best French painter? Answer in one short sentence."
}
] | | `response_format` | [Optional[models.ResponseFormat]](../models/responseformat.md) | :heavy_minus_sign: | Specify the format that the model must output. By default it will use `{ "type": "text" }`. Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ "type": "json_schema" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide. | {
"type": "text"
} | | `tools` | List[[models.Tool](../models/tool.md)] | :heavy_minus_sign: | A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for. | | | `tool_choice` | [Optional[models.ChatCompletionRequestToolChoice]](../models/chatcompletionrequesttoolchoice.md) | :heavy_minus_sign: | Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. | | diff --git a/packages/mistralai_azure/docs/models/messages.md b/packages/azure/docs/models/chatcompletionrequestmessage.md similarity index 92% rename from packages/mistralai_azure/docs/models/messages.md rename to packages/azure/docs/models/chatcompletionrequestmessage.md index 1d394500..91e9e062 100644 --- a/packages/mistralai_azure/docs/models/messages.md +++ b/packages/azure/docs/models/chatcompletionrequestmessage.md @@ -1,4 +1,4 @@ -# Messages +# ChatCompletionRequestMessage ## Supported Types diff --git a/packages/mistralai_azure/docs/models/chatcompletionrequeststop.md b/packages/azure/docs/models/chatcompletionrequeststop.md similarity index 100% rename from packages/mistralai_azure/docs/models/chatcompletionrequeststop.md rename to packages/azure/docs/models/chatcompletionrequeststop.md diff --git a/packages/mistralai_azure/docs/models/chatcompletionrequesttoolchoice.md b/packages/azure/docs/models/chatcompletionrequesttoolchoice.md similarity index 100% rename from packages/mistralai_azure/docs/models/chatcompletionrequesttoolchoice.md rename to packages/azure/docs/models/chatcompletionrequesttoolchoice.md diff --git a/packages/mistralai_azure/docs/models/chatcompletionresponse.md b/packages/azure/docs/models/chatcompletionresponse.md similarity index 100% rename from packages/mistralai_azure/docs/models/chatcompletionresponse.md rename to packages/azure/docs/models/chatcompletionresponse.md diff --git a/packages/mistralai_azure/docs/models/chatcompletionstreamrequest.md b/packages/azure/docs/models/chatcompletionstreamrequest.md similarity index 99% rename from packages/mistralai_azure/docs/models/chatcompletionstreamrequest.md rename to packages/azure/docs/models/chatcompletionstreamrequest.md index 85f237b4..f78156a6 100644 --- a/packages/mistralai_azure/docs/models/chatcompletionstreamrequest.md +++ b/packages/azure/docs/models/chatcompletionstreamrequest.md @@ -10,10 +10,10 @@ | `top_p` | *Optional[float]* | :heavy_minus_sign: | Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. | | | `max_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. | | | `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A | | -| `stop` | [Optional[models.Stop]](../models/stop.md) | :heavy_minus_sign: | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array | | +| `stop` | [Optional[models.ChatCompletionStreamRequestStop]](../models/chatcompletionstreamrequeststop.md) | :heavy_minus_sign: | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array | | | `random_seed` | *OptionalNullable[int]* | :heavy_minus_sign: | The seed to use for random sampling. If set, different calls will generate deterministic results. | | | `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | | -| `messages` | List[[models.Messages](../models/messages.md)] | :heavy_check_mark: | The prompt(s) to generate completions for, encoded as a list of dict with role and content. | [
{
"role": "user",
"content": "Who is the best French painter? Answer in one short sentence."
}
] | +| `messages` | List[[models.ChatCompletionStreamRequestMessage](../models/chatcompletionstreamrequestmessage.md)] | :heavy_check_mark: | The prompt(s) to generate completions for, encoded as a list of dict with role and content. | [
{
"role": "user",
"content": "Who is the best French painter? Answer in one short sentence."
}
] | | `response_format` | [Optional[models.ResponseFormat]](../models/responseformat.md) | :heavy_minus_sign: | Specify the format that the model must output. By default it will use `{ "type": "text" }`. Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ "type": "json_schema" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide. | {
"type": "text"
} | | `tools` | List[[models.Tool](../models/tool.md)] | :heavy_minus_sign: | A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for. | | | `tool_choice` | [Optional[models.ChatCompletionStreamRequestToolChoice]](../models/chatcompletionstreamrequesttoolchoice.md) | :heavy_minus_sign: | Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. | | diff --git a/packages/mistralai_gcp/docs/models/chatcompletionrequestmessages.md b/packages/azure/docs/models/chatcompletionstreamrequestmessage.md similarity index 91% rename from packages/mistralai_gcp/docs/models/chatcompletionrequestmessages.md rename to packages/azure/docs/models/chatcompletionstreamrequestmessage.md index bc7708a6..2e4e93ac 100644 --- a/packages/mistralai_gcp/docs/models/chatcompletionrequestmessages.md +++ b/packages/azure/docs/models/chatcompletionstreamrequestmessage.md @@ -1,4 +1,4 @@ -# ChatCompletionRequestMessages +# ChatCompletionStreamRequestMessage ## Supported Types diff --git a/packages/mistralai_gcp/docs/models/stop.md b/packages/azure/docs/models/chatcompletionstreamrequeststop.md similarity index 88% rename from packages/mistralai_gcp/docs/models/stop.md rename to packages/azure/docs/models/chatcompletionstreamrequeststop.md index ba40ca83..a48460a9 100644 --- a/packages/mistralai_gcp/docs/models/stop.md +++ b/packages/azure/docs/models/chatcompletionstreamrequeststop.md @@ -1,4 +1,4 @@ -# Stop +# ChatCompletionStreamRequestStop Stop generation if this token is detected. Or if one of these tokens is detected when providing an array diff --git a/packages/mistralai_azure/docs/models/chatcompletionstreamrequesttoolchoice.md b/packages/azure/docs/models/chatcompletionstreamrequesttoolchoice.md similarity index 100% rename from packages/mistralai_azure/docs/models/chatcompletionstreamrequesttoolchoice.md rename to packages/azure/docs/models/chatcompletionstreamrequesttoolchoice.md diff --git a/packages/mistralai_azure/docs/models/completionchunk.md b/packages/azure/docs/models/completionchunk.md similarity index 100% rename from packages/mistralai_azure/docs/models/completionchunk.md rename to packages/azure/docs/models/completionchunk.md diff --git a/packages/mistralai_azure/docs/models/completionevent.md b/packages/azure/docs/models/completionevent.md similarity index 100% rename from packages/mistralai_azure/docs/models/completionevent.md rename to packages/azure/docs/models/completionevent.md diff --git a/packages/azure/docs/models/completionresponsestreamchoice.md b/packages/azure/docs/models/completionresponsestreamchoice.md new file mode 100644 index 00000000..1532c25b --- /dev/null +++ b/packages/azure/docs/models/completionresponsestreamchoice.md @@ -0,0 +1,10 @@ +# CompletionResponseStreamChoice + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | +| `index` | *int* | :heavy_check_mark: | N/A | +| `delta` | [models.DeltaMessage](../models/deltamessage.md) | :heavy_check_mark: | N/A | +| `finish_reason` | [Nullable[models.CompletionResponseStreamChoiceFinishReason]](../models/completionresponsestreamchoicefinishreason.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/finishreason.md b/packages/azure/docs/models/completionresponsestreamchoicefinishreason.md similarity index 81% rename from packages/mistralai_gcp/docs/models/finishreason.md rename to packages/azure/docs/models/completionresponsestreamchoicefinishreason.md index 45a5aedb..0fece473 100644 --- a/packages/mistralai_gcp/docs/models/finishreason.md +++ b/packages/azure/docs/models/completionresponsestreamchoicefinishreason.md @@ -1,4 +1,4 @@ -# FinishReason +# CompletionResponseStreamChoiceFinishReason ## Values diff --git a/packages/mistralai_azure/docs/models/contentchunk.md b/packages/azure/docs/models/contentchunk.md similarity index 100% rename from packages/mistralai_azure/docs/models/contentchunk.md rename to packages/azure/docs/models/contentchunk.md diff --git a/packages/azure/docs/models/deltamessage.md b/packages/azure/docs/models/deltamessage.md new file mode 100644 index 00000000..e0ee575f --- /dev/null +++ b/packages/azure/docs/models/deltamessage.md @@ -0,0 +1,10 @@ +# DeltaMessage + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `role` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `content` | [OptionalNullable[models.DeltaMessageContent]](../models/deltamessagecontent.md) | :heavy_minus_sign: | N/A | +| `tool_calls` | List[[models.ToolCall](../models/toolcall.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/content.md b/packages/azure/docs/models/deltamessagecontent.md similarity index 89% rename from packages/mistralai_gcp/docs/models/content.md rename to packages/azure/docs/models/deltamessagecontent.md index a833dc2c..8142772d 100644 --- a/packages/mistralai_gcp/docs/models/content.md +++ b/packages/azure/docs/models/deltamessagecontent.md @@ -1,4 +1,4 @@ -# Content +# DeltaMessageContent ## Supported Types diff --git a/packages/mistralai_azure/docs/models/document.md b/packages/azure/docs/models/document.md similarity index 100% rename from packages/mistralai_azure/docs/models/document.md rename to packages/azure/docs/models/document.md diff --git a/packages/azure/docs/models/documenturlchunk.md b/packages/azure/docs/models/documenturlchunk.md new file mode 100644 index 00000000..9dbfbe50 --- /dev/null +++ b/packages/azure/docs/models/documenturlchunk.md @@ -0,0 +1,10 @@ +# DocumentURLChunk + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | +| `type` | *Optional[Literal["document_url"]]* | :heavy_minus_sign: | N/A | +| `document_url` | *str* | :heavy_check_mark: | N/A | +| `document_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The filename of the document | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/filechunk.md b/packages/azure/docs/models/filechunk.md similarity index 100% rename from packages/mistralai_azure/docs/models/filechunk.md rename to packages/azure/docs/models/filechunk.md diff --git a/packages/mistralai_azure/docs/models/format_.md b/packages/azure/docs/models/format_.md similarity index 100% rename from packages/mistralai_azure/docs/models/format_.md rename to packages/azure/docs/models/format_.md diff --git a/packages/mistralai_azure/docs/models/function.md b/packages/azure/docs/models/function.md similarity index 100% rename from packages/mistralai_azure/docs/models/function.md rename to packages/azure/docs/models/function.md diff --git a/packages/mistralai_azure/docs/models/functioncall.md b/packages/azure/docs/models/functioncall.md similarity index 100% rename from packages/mistralai_azure/docs/models/functioncall.md rename to packages/azure/docs/models/functioncall.md diff --git a/packages/mistralai_azure/docs/models/functionname.md b/packages/azure/docs/models/functionname.md similarity index 100% rename from packages/mistralai_azure/docs/models/functionname.md rename to packages/azure/docs/models/functionname.md diff --git a/packages/mistralai_azure/docs/models/httpvalidationerror.md b/packages/azure/docs/models/httpvalidationerror.md similarity index 100% rename from packages/mistralai_azure/docs/models/httpvalidationerror.md rename to packages/azure/docs/models/httpvalidationerror.md diff --git a/packages/mistralai_azure/docs/models/imageurl.md b/packages/azure/docs/models/imageurl.md similarity index 100% rename from packages/mistralai_azure/docs/models/imageurl.md rename to packages/azure/docs/models/imageurl.md diff --git a/packages/azure/docs/models/imageurlchunk.md b/packages/azure/docs/models/imageurlchunk.md new file mode 100644 index 00000000..db0c53d2 --- /dev/null +++ b/packages/azure/docs/models/imageurlchunk.md @@ -0,0 +1,11 @@ +# ImageURLChunk + +{"type":"image_url","image_url":{"url":"data:image/png;base64,iVBORw0 + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | +| `type` | *Optional[Literal["image_url"]]* | :heavy_minus_sign: | N/A | +| `image_url` | [models.ImageURLUnion](../models/imageurlunion.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/imageurlchunkimageurl.md b/packages/azure/docs/models/imageurlunion.md similarity index 86% rename from packages/mistralai_gcp/docs/models/imageurlchunkimageurl.md rename to packages/azure/docs/models/imageurlunion.md index 76738908..db97130f 100644 --- a/packages/mistralai_gcp/docs/models/imageurlchunkimageurl.md +++ b/packages/azure/docs/models/imageurlunion.md @@ -1,4 +1,4 @@ -# ImageURLChunkImageURL +# ImageURLUnion ## Supported Types diff --git a/packages/mistralai_azure/docs/models/jsonschema.md b/packages/azure/docs/models/jsonschema.md similarity index 100% rename from packages/mistralai_azure/docs/models/jsonschema.md rename to packages/azure/docs/models/jsonschema.md diff --git a/packages/mistralai_azure/docs/models/loc.md b/packages/azure/docs/models/loc.md similarity index 100% rename from packages/mistralai_azure/docs/models/loc.md rename to packages/azure/docs/models/loc.md diff --git a/packages/mistralai_azure/docs/models/mistralpromptmode.md b/packages/azure/docs/models/mistralpromptmode.md similarity index 100% rename from packages/mistralai_azure/docs/models/mistralpromptmode.md rename to packages/azure/docs/models/mistralpromptmode.md diff --git a/packages/mistralai_azure/docs/models/ocrimageobject.md b/packages/azure/docs/models/ocrimageobject.md similarity index 100% rename from packages/mistralai_azure/docs/models/ocrimageobject.md rename to packages/azure/docs/models/ocrimageobject.md diff --git a/packages/mistralai_azure/docs/models/ocrpagedimensions.md b/packages/azure/docs/models/ocrpagedimensions.md similarity index 100% rename from packages/mistralai_azure/docs/models/ocrpagedimensions.md rename to packages/azure/docs/models/ocrpagedimensions.md diff --git a/packages/mistralai_azure/docs/models/ocrpageobject.md b/packages/azure/docs/models/ocrpageobject.md similarity index 100% rename from packages/mistralai_azure/docs/models/ocrpageobject.md rename to packages/azure/docs/models/ocrpageobject.md diff --git a/packages/mistralai_azure/docs/models/ocrrequest.md b/packages/azure/docs/models/ocrrequest.md similarity index 100% rename from packages/mistralai_azure/docs/models/ocrrequest.md rename to packages/azure/docs/models/ocrrequest.md diff --git a/packages/mistralai_azure/docs/models/ocrresponse.md b/packages/azure/docs/models/ocrresponse.md similarity index 100% rename from packages/mistralai_azure/docs/models/ocrresponse.md rename to packages/azure/docs/models/ocrresponse.md diff --git a/packages/mistralai_azure/docs/models/ocrtableobject.md b/packages/azure/docs/models/ocrtableobject.md similarity index 100% rename from packages/mistralai_azure/docs/models/ocrtableobject.md rename to packages/azure/docs/models/ocrtableobject.md diff --git a/packages/mistralai_azure/docs/models/ocrusageinfo.md b/packages/azure/docs/models/ocrusageinfo.md similarity index 100% rename from packages/mistralai_azure/docs/models/ocrusageinfo.md rename to packages/azure/docs/models/ocrusageinfo.md diff --git a/packages/mistralai_azure/docs/models/prediction.md b/packages/azure/docs/models/prediction.md similarity index 100% rename from packages/mistralai_azure/docs/models/prediction.md rename to packages/azure/docs/models/prediction.md diff --git a/packages/azure/docs/models/referencechunk.md b/packages/azure/docs/models/referencechunk.md new file mode 100644 index 00000000..d847e248 --- /dev/null +++ b/packages/azure/docs/models/referencechunk.md @@ -0,0 +1,9 @@ +# ReferenceChunk + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | +| `type` | *Optional[Literal["reference"]]* | :heavy_minus_sign: | N/A | +| `reference_ids` | List[*int*] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/responseformat.md b/packages/azure/docs/models/responseformat.md similarity index 100% rename from packages/mistralai_azure/docs/models/responseformat.md rename to packages/azure/docs/models/responseformat.md diff --git a/packages/mistralai_azure/docs/models/responseformats.md b/packages/azure/docs/models/responseformats.md similarity index 100% rename from packages/mistralai_azure/docs/models/responseformats.md rename to packages/azure/docs/models/responseformats.md diff --git a/packages/mistralai_azure/docs/models/security.md b/packages/azure/docs/models/security.md similarity index 100% rename from packages/mistralai_azure/docs/models/security.md rename to packages/azure/docs/models/security.md diff --git a/packages/mistralai_gcp/docs/models/systemmessage.md b/packages/azure/docs/models/systemmessage.md similarity index 88% rename from packages/mistralai_gcp/docs/models/systemmessage.md rename to packages/azure/docs/models/systemmessage.md index 0dba71c0..10bda10f 100644 --- a/packages/mistralai_gcp/docs/models/systemmessage.md +++ b/packages/azure/docs/models/systemmessage.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | -| `content` | [models.SystemMessageContent](../models/systemmessagecontent.md) | :heavy_check_mark: | N/A | -| `role` | [Optional[models.Role]](../models/role.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `role` | *Literal["system"]* | :heavy_check_mark: | N/A | +| `content` | [models.SystemMessageContent](../models/systemmessagecontent.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/systemmessagecontent.md b/packages/azure/docs/models/systemmessagecontent.md similarity index 100% rename from packages/mistralai_azure/docs/models/systemmessagecontent.md rename to packages/azure/docs/models/systemmessagecontent.md diff --git a/packages/mistralai_azure/docs/models/systemmessagecontentchunks.md b/packages/azure/docs/models/systemmessagecontentchunks.md similarity index 100% rename from packages/mistralai_azure/docs/models/systemmessagecontentchunks.md rename to packages/azure/docs/models/systemmessagecontentchunks.md diff --git a/packages/mistralai_azure/docs/models/tableformat.md b/packages/azure/docs/models/tableformat.md similarity index 100% rename from packages/mistralai_azure/docs/models/tableformat.md rename to packages/azure/docs/models/tableformat.md diff --git a/packages/azure/docs/models/textchunk.md b/packages/azure/docs/models/textchunk.md new file mode 100644 index 00000000..b266619d --- /dev/null +++ b/packages/azure/docs/models/textchunk.md @@ -0,0 +1,9 @@ +# TextChunk + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `type` | *Literal["text"]* | :heavy_check_mark: | N/A | +| `text` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/thinkchunk.md b/packages/azure/docs/models/thinkchunk.md similarity index 91% rename from packages/mistralai_azure/docs/models/thinkchunk.md rename to packages/azure/docs/models/thinkchunk.md index 66b2e0cd..b07f598e 100644 --- a/packages/mistralai_azure/docs/models/thinkchunk.md +++ b/packages/azure/docs/models/thinkchunk.md @@ -5,6 +5,6 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | +| `type` | *Literal["thinking"]* | :heavy_check_mark: | N/A | | `thinking` | List[[models.Thinking](../models/thinking.md)] | :heavy_check_mark: | N/A | -| `closed` | *Optional[bool]* | :heavy_minus_sign: | Whether the thinking chunk is closed or not. Currently only used for prefixing. | -| `type` | [Optional[models.ThinkChunkType]](../models/thinkchunktype.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `closed` | *Optional[bool]* | :heavy_minus_sign: | Whether the thinking chunk is closed or not. Currently only used for prefixing. | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/thinking.md b/packages/azure/docs/models/thinking.md similarity index 100% rename from packages/mistralai_azure/docs/models/thinking.md rename to packages/azure/docs/models/thinking.md diff --git a/packages/mistralai_azure/docs/models/tool.md b/packages/azure/docs/models/tool.md similarity index 100% rename from packages/mistralai_azure/docs/models/tool.md rename to packages/azure/docs/models/tool.md diff --git a/packages/mistralai_azure/docs/models/toolcall.md b/packages/azure/docs/models/toolcall.md similarity index 100% rename from packages/mistralai_azure/docs/models/toolcall.md rename to packages/azure/docs/models/toolcall.md diff --git a/packages/mistralai_azure/docs/models/toolchoice.md b/packages/azure/docs/models/toolchoice.md similarity index 100% rename from packages/mistralai_azure/docs/models/toolchoice.md rename to packages/azure/docs/models/toolchoice.md diff --git a/packages/mistralai_azure/docs/models/toolchoiceenum.md b/packages/azure/docs/models/toolchoiceenum.md similarity index 100% rename from packages/mistralai_azure/docs/models/toolchoiceenum.md rename to packages/azure/docs/models/toolchoiceenum.md diff --git a/packages/mistralai_gcp/docs/models/toolmessage.md b/packages/azure/docs/models/toolmessage.md similarity index 92% rename from packages/mistralai_gcp/docs/models/toolmessage.md rename to packages/azure/docs/models/toolmessage.md index a54f4933..7201481e 100644 --- a/packages/mistralai_gcp/docs/models/toolmessage.md +++ b/packages/azure/docs/models/toolmessage.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `role` | *Literal["tool"]* | :heavy_check_mark: | N/A | | `content` | [Nullable[models.ToolMessageContent]](../models/toolmessagecontent.md) | :heavy_check_mark: | N/A | | `tool_call_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `role` | [Optional[models.ToolMessageRole]](../models/toolmessagerole.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/toolmessagecontent.md b/packages/azure/docs/models/toolmessagecontent.md similarity index 100% rename from packages/mistralai_azure/docs/models/toolmessagecontent.md rename to packages/azure/docs/models/toolmessagecontent.md diff --git a/packages/mistralai_azure/docs/models/tooltypes.md b/packages/azure/docs/models/tooltypes.md similarity index 100% rename from packages/mistralai_azure/docs/models/tooltypes.md rename to packages/azure/docs/models/tooltypes.md diff --git a/packages/mistralai_azure/docs/models/usageinfo.md b/packages/azure/docs/models/usageinfo.md similarity index 100% rename from packages/mistralai_azure/docs/models/usageinfo.md rename to packages/azure/docs/models/usageinfo.md diff --git a/packages/mistralai_gcp/docs/models/usermessage.md b/packages/azure/docs/models/usermessage.md similarity index 89% rename from packages/mistralai_gcp/docs/models/usermessage.md rename to packages/azure/docs/models/usermessage.md index 63b01310..e7a932ed 100644 --- a/packages/mistralai_gcp/docs/models/usermessage.md +++ b/packages/azure/docs/models/usermessage.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | -| `content` | [Nullable[models.UserMessageContent]](../models/usermessagecontent.md) | :heavy_check_mark: | N/A | -| `role` | [Optional[models.UserMessageRole]](../models/usermessagerole.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `role` | *Literal["user"]* | :heavy_check_mark: | N/A | +| `content` | [Nullable[models.UserMessageContent]](../models/usermessagecontent.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/usermessagecontent.md b/packages/azure/docs/models/usermessagecontent.md similarity index 100% rename from packages/mistralai_azure/docs/models/usermessagecontent.md rename to packages/azure/docs/models/usermessagecontent.md diff --git a/packages/mistralai_azure/docs/models/utils/retryconfig.md b/packages/azure/docs/models/utils/retryconfig.md similarity index 100% rename from packages/mistralai_azure/docs/models/utils/retryconfig.md rename to packages/azure/docs/models/utils/retryconfig.md diff --git a/packages/mistralai_azure/docs/models/validationerror.md b/packages/azure/docs/models/validationerror.md similarity index 100% rename from packages/mistralai_azure/docs/models/validationerror.md rename to packages/azure/docs/models/validationerror.md diff --git a/packages/mistralai_azure/docs/sdks/chat/README.md b/packages/azure/docs/sdks/chat/README.md similarity index 98% rename from packages/mistralai_azure/docs/sdks/chat/README.md rename to packages/azure/docs/sdks/chat/README.md index 26d20bb4..3c5e46b2 100644 --- a/packages/mistralai_azure/docs/sdks/chat/README.md +++ b/packages/azure/docs/sdks/chat/README.md @@ -17,12 +17,12 @@ Mistral AI provides the ability to stream responses back to a client in order to ### Example Usage ```python -from mistralai_azure import MistralAzure +from mistralai.azure.client import MistralAzure import os s = MistralAzure( - azure_api_key=os.getenv("AZURE_API_KEY", ""), - azure_endpoint=os.getenv("AZURE_ENDPOINT", "") + api_key=os.getenv("AZURE_API_KEY", ""), + server_url=os.getenv("AZURE_ENDPOINT", "") ) @@ -76,12 +76,12 @@ Chat Completion ### Example Usage ```python -from mistralai_azure import MistralAzure +from mistralai.azure.client import MistralAzure import os s = MistralAzure( - azure_api_key=os.getenv("AZURE_API_KEY", ""), - azure_endpoint=os.getenv("AZURE_ENDPOINT", "") + api_key=os.getenv("AZURE_API_KEY", ""), + server_url=os.getenv("AZURE_ENDPOINT", "") ) diff --git a/packages/mistralai_azure/docs/sdks/mistralazure/README.md b/packages/azure/docs/sdks/mistralazure/README.md similarity index 100% rename from packages/mistralai_azure/docs/sdks/mistralazure/README.md rename to packages/azure/docs/sdks/mistralazure/README.md diff --git a/packages/mistralai_azure/py.typed b/packages/azure/py.typed similarity index 100% rename from packages/mistralai_azure/py.typed rename to packages/azure/py.typed diff --git a/packages/mistralai_azure/pylintrc b/packages/azure/pylintrc similarity index 100% rename from packages/mistralai_azure/pylintrc rename to packages/azure/pylintrc diff --git a/packages/mistralai_azure/pyproject.toml b/packages/azure/pyproject.toml similarity index 79% rename from packages/mistralai_azure/pyproject.toml rename to packages/azure/pyproject.toml index d129a290..3407d020 100644 --- a/packages/mistralai_azure/pyproject.toml +++ b/packages/azure/pyproject.toml @@ -1,6 +1,6 @@ [project] -name = "mistralai_azure" -version = "1.8.0" +name = "mistralai-azure" +version = "2.0.0a4" description = "Python Client SDK for the Mistral AI API in Azure." authors = [{ name = "Mistral" }] requires-python = ">=3.10" @@ -21,20 +21,20 @@ dev = [ ] [tool.setuptools.package-data] -"*" = ["py.typed", "src/mistralai_azure/py.typed"] +"*" = ["py.typed", "src/mistralai/azure/client/py.typed"] [tool.hatch.build.targets.sdist] -include = ["src/mistralai_azure"] +include = ["src/mistralai"] [tool.hatch.build.targets.sdist.force-include] "py.typed" = "py.typed" -"src/mistralai_azure/py.typed" = "src/mistralai_azure/py.typed" +"src/mistralai/azure/client/py.typed" = "src/mistralai/azure/client/py.typed" [tool.hatch.build.targets.wheel] -include = ["src/mistralai_azure"] +include = ["src/mistralai"] [tool.hatch.build.targets.wheel.sources] -"src/mistralai_azure" = "mistralai_azure" +"src" = "" [virtualenvs] in-project = true diff --git a/packages/mistralai_gcp/scripts/prepare_readme.py b/packages/azure/scripts/prepare_readme.py similarity index 96% rename from packages/mistralai_gcp/scripts/prepare_readme.py rename to packages/azure/scripts/prepare_readme.py index 6c4b9932..2b2577ea 100644 --- a/packages/mistralai_gcp/scripts/prepare_readme.py +++ b/packages/azure/scripts/prepare_readme.py @@ -10,7 +10,7 @@ GITHUB_URL = ( GITHUB_URL[: -len(".git")] if GITHUB_URL.endswith(".git") else GITHUB_URL ) - REPO_SUBDIR = "packages/mistralai_gcp" + REPO_SUBDIR = "packages/azure" # Ensure the subdirectory has a trailing slash if not REPO_SUBDIR.endswith("/"): REPO_SUBDIR += "/" diff --git a/packages/mistralai_azure/scripts/publish.sh b/packages/azure/scripts/publish.sh similarity index 100% rename from packages/mistralai_azure/scripts/publish.sh rename to packages/azure/scripts/publish.sh diff --git a/packages/mistralai_azure/src/mistralai_azure/__init__.py b/packages/azure/src/mistralai/azure/client/__init__.py similarity index 100% rename from packages/mistralai_azure/src/mistralai_azure/__init__.py rename to packages/azure/src/mistralai/azure/client/__init__.py diff --git a/packages/mistralai_azure/src/mistralai_azure/_hooks/__init__.py b/packages/azure/src/mistralai/azure/client/_hooks/__init__.py similarity index 100% rename from packages/mistralai_azure/src/mistralai_azure/_hooks/__init__.py rename to packages/azure/src/mistralai/azure/client/_hooks/__init__.py diff --git a/packages/mistralai_azure/src/mistralai_azure/_hooks/registration.py b/packages/azure/src/mistralai/azure/client/_hooks/registration.py similarity index 79% rename from packages/mistralai_azure/src/mistralai_azure/_hooks/registration.py rename to packages/azure/src/mistralai/azure/client/_hooks/registration.py index 304edfa2..cab47787 100644 --- a/packages/mistralai_azure/src/mistralai_azure/_hooks/registration.py +++ b/packages/azure/src/mistralai/azure/client/_hooks/registration.py @@ -1,6 +1,6 @@ -from .custom_user_agent import CustomUserAgentHook from .types import Hooks + # This file is only ever generated once on the first generation and then is free to be modified. # Any hooks you wish to add should be registered in the init_hooks function. Feel free to define them # in this file or in separate files in the hooks folder. @@ -10,6 +10,4 @@ def init_hooks(hooks: Hooks): # pylint: disable=unused-argument """Add hooks by calling hooks.register{sdk_init/before_request/after_success/after_error}Hook with an instance of a hook that implements that specific Hook interface - Hooks are registered per SDK instance, and are valid for the lifetime of the SDK instance - """ - hooks.register_before_request_hook(CustomUserAgentHook()) + Hooks are registered per SDK instance, and are valid for the lifetime of the SDK instance""" diff --git a/packages/mistralai_azure/src/mistralai_azure/_hooks/sdkhooks.py b/packages/azure/src/mistralai/azure/client/_hooks/sdkhooks.py similarity index 97% rename from packages/mistralai_azure/src/mistralai_azure/_hooks/sdkhooks.py rename to packages/azure/src/mistralai/azure/client/_hooks/sdkhooks.py index 37ff4e9f..2080681b 100644 --- a/packages/mistralai_azure/src/mistralai_azure/_hooks/sdkhooks.py +++ b/packages/azure/src/mistralai/azure/client/_hooks/sdkhooks.py @@ -13,7 +13,7 @@ ) from .registration import init_hooks from typing import List, Optional, Tuple -from mistralai_azure.httpclient import HttpClient +from mistralai.azure.client.httpclient import HttpClient class SDKHooks(Hooks): diff --git a/packages/mistralai_gcp/src/mistralai_gcp/_hooks/types.py b/packages/azure/src/mistralai/azure/client/_hooks/types.py similarity index 95% rename from packages/mistralai_gcp/src/mistralai_gcp/_hooks/types.py rename to packages/azure/src/mistralai/azure/client/_hooks/types.py index f8088f4c..3e4e3955 100644 --- a/packages/mistralai_gcp/src/mistralai_gcp/_hooks/types.py +++ b/packages/azure/src/mistralai/azure/client/_hooks/types.py @@ -2,8 +2,8 @@ from abc import ABC, abstractmethod import httpx -from mistralai_gcp.httpclient import HttpClient -from mistralai_gcp.sdkconfiguration import SDKConfiguration +from mistralai.azure.client.httpclient import HttpClient +from mistralai.azure.client.sdkconfiguration import SDKConfiguration from typing import Any, Callable, List, Optional, Tuple, Union diff --git a/packages/mistralai_azure/src/mistralai_azure/_version.py b/packages/azure/src/mistralai/azure/client/_version.py similarity index 69% rename from packages/mistralai_azure/src/mistralai_azure/_version.py rename to packages/azure/src/mistralai/azure/client/_version.py index 79277f9a..4448d2a0 100644 --- a/packages/mistralai_azure/src/mistralai_azure/_version.py +++ b/packages/azure/src/mistralai/azure/client/_version.py @@ -2,11 +2,11 @@ import importlib.metadata -__title__: str = "mistralai_azure" -__version__: str = "1.8.1" +__title__: str = "mistralai-azure" +__version__: str = "2.0.0a4" __openapi_doc_version__: str = "1.0.0" __gen_version__: str = "2.794.1" -__user_agent__: str = "speakeasy-sdk/python 1.8.1 2.794.1 1.0.0 mistralai_azure" +__user_agent__: str = "speakeasy-sdk/python 2.0.0a4 2.794.1 1.0.0 mistralai-azure" try: if __package__ is not None: diff --git a/packages/mistralai_azure/src/mistralai_azure/basesdk.py b/packages/azure/src/mistralai/azure/client/basesdk.py similarity index 98% rename from packages/mistralai_azure/src/mistralai_azure/basesdk.py rename to packages/azure/src/mistralai/azure/client/basesdk.py index 89f7dc49..b0391ac0 100644 --- a/packages/mistralai_azure/src/mistralai_azure/basesdk.py +++ b/packages/azure/src/mistralai/azure/client/basesdk.py @@ -2,13 +2,17 @@ from .sdkconfiguration import SDKConfiguration import httpx -from mistralai_azure import models, utils -from mistralai_azure._hooks import ( +from mistralai.azure.client import models, utils +from mistralai.azure.client._hooks import ( AfterErrorContext, AfterSuccessContext, BeforeRequestContext, ) -from mistralai_azure.utils import RetryConfig, SerializedRequestBody, get_body_content +from mistralai.azure.client.utils import ( + RetryConfig, + SerializedRequestBody, + get_body_content, +) from typing import Callable, List, Mapping, Optional, Tuple from urllib.parse import parse_qs, urlparse diff --git a/packages/mistralai_azure/src/mistralai_azure/chat.py b/packages/azure/src/mistralai/azure/client/chat.py similarity index 96% rename from packages/mistralai_azure/src/mistralai_azure/chat.py rename to packages/azure/src/mistralai/azure/client/chat.py index 10bb247f..3348bf47 100644 --- a/packages/mistralai_azure/src/mistralai_azure/chat.py +++ b/packages/azure/src/mistralai/azure/client/chat.py @@ -1,11 +1,11 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from .basesdk import BaseSDK -from mistralai_azure import models, utils -from mistralai_azure._hooks import HookContext -from mistralai_azure.types import OptionalNullable, UNSET -from mistralai_azure.utils import eventstreaming -from mistralai_azure.utils.unmarshal_json_response import unmarshal_json_response +from mistralai.azure.client import models, utils +from mistralai.azure.client._hooks import HookContext +from mistralai.azure.client.types import OptionalNullable, UNSET +from mistralai.azure.client.utils import eventstreaming +from mistralai.azure.client.utils.unmarshal_json_response import unmarshal_json_response from typing import Any, Dict, List, Mapping, Optional, Union @@ -15,13 +15,21 @@ class Chat(BaseSDK): def stream( self, *, - messages: Union[List[models.Messages], List[models.MessagesTypedDict]], + messages: Union[ + List[models.ChatCompletionStreamRequestMessage], + List[models.ChatCompletionStreamRequestMessageTypedDict], + ], model: Optional[str] = "azureai", temperature: OptionalNullable[float] = UNSET, top_p: Optional[float] = None, max_tokens: OptionalNullable[int] = UNSET, stream: Optional[bool] = True, - stop: Optional[Union[models.Stop, models.StopTypedDict]] = None, + stop: Optional[ + Union[ + models.ChatCompletionStreamRequestStop, + models.ChatCompletionStreamRequestStopTypedDict, + ] + ] = None, random_seed: OptionalNullable[int] = UNSET, metadata: OptionalNullable[Dict[str, Any]] = UNSET, response_format: Optional[ @@ -97,7 +105,9 @@ def stream( stop=stop, random_seed=random_seed, metadata=metadata, - messages=utils.get_pydantic_model(messages, List[models.Messages]), + messages=utils.get_pydantic_model( + messages, List[models.ChatCompletionStreamRequestMessage] + ), response_format=utils.get_pydantic_model( response_format, Optional[models.ResponseFormat] ), @@ -185,13 +195,21 @@ def stream( async def stream_async( self, *, - messages: Union[List[models.Messages], List[models.MessagesTypedDict]], + messages: Union[ + List[models.ChatCompletionStreamRequestMessage], + List[models.ChatCompletionStreamRequestMessageTypedDict], + ], model: Optional[str] = "azureai", temperature: OptionalNullable[float] = UNSET, top_p: Optional[float] = None, max_tokens: OptionalNullable[int] = UNSET, stream: Optional[bool] = True, - stop: Optional[Union[models.Stop, models.StopTypedDict]] = None, + stop: Optional[ + Union[ + models.ChatCompletionStreamRequestStop, + models.ChatCompletionStreamRequestStopTypedDict, + ] + ] = None, random_seed: OptionalNullable[int] = UNSET, metadata: OptionalNullable[Dict[str, Any]] = UNSET, response_format: Optional[ @@ -267,7 +285,9 @@ async def stream_async( stop=stop, random_seed=random_seed, metadata=metadata, - messages=utils.get_pydantic_model(messages, List[models.Messages]), + messages=utils.get_pydantic_model( + messages, List[models.ChatCompletionStreamRequestMessage] + ), response_format=utils.get_pydantic_model( response_format, Optional[models.ResponseFormat] ), @@ -356,8 +376,8 @@ def complete( self, *, messages: Union[ - List[models.ChatCompletionRequestMessages], - List[models.ChatCompletionRequestMessagesTypedDict], + List[models.ChatCompletionRequestMessage], + List[models.ChatCompletionRequestMessageTypedDict], ], model: Optional[str] = "azureai", temperature: OptionalNullable[float] = UNSET, @@ -444,7 +464,7 @@ def complete( random_seed=random_seed, metadata=metadata, messages=utils.get_pydantic_model( - messages, List[models.ChatCompletionRequestMessages] + messages, List[models.ChatCompletionRequestMessage] ), response_format=utils.get_pydantic_model( response_format, Optional[models.ResponseFormat] @@ -526,8 +546,8 @@ async def complete_async( self, *, messages: Union[ - List[models.ChatCompletionRequestMessages], - List[models.ChatCompletionRequestMessagesTypedDict], + List[models.ChatCompletionRequestMessage], + List[models.ChatCompletionRequestMessageTypedDict], ], model: Optional[str] = "azureai", temperature: OptionalNullable[float] = UNSET, @@ -614,7 +634,7 @@ async def complete_async( random_seed=random_seed, metadata=metadata, messages=utils.get_pydantic_model( - messages, List[models.ChatCompletionRequestMessages] + messages, List[models.ChatCompletionRequestMessage] ), response_format=utils.get_pydantic_model( response_format, Optional[models.ResponseFormat] diff --git a/packages/mistralai_azure/src/mistralai_azure/httpclient.py b/packages/azure/src/mistralai/azure/client/httpclient.py similarity index 100% rename from packages/mistralai_azure/src/mistralai_azure/httpclient.py rename to packages/azure/src/mistralai/azure/client/httpclient.py diff --git a/packages/mistralai_azure/src/mistralai_azure/models/__init__.py b/packages/azure/src/mistralai/azure/client/models/__init__.py similarity index 85% rename from packages/mistralai_azure/src/mistralai_azure/models/__init__.py rename to packages/azure/src/mistralai/azure/client/models/__init__.py index 9baa3ff1..dbcaca24 100644 --- a/packages/mistralai_azure/src/mistralai_azure/models/__init__.py +++ b/packages/azure/src/mistralai/azure/client/models/__init__.py @@ -11,7 +11,6 @@ AssistantMessage, AssistantMessageContent, AssistantMessageContentTypedDict, - AssistantMessageRole, AssistantMessageTypedDict, ) from .chatcompletionchoice import ( @@ -21,8 +20,8 @@ ) from .chatcompletionrequest import ( ChatCompletionRequest, - ChatCompletionRequestMessages, - ChatCompletionRequestMessagesTypedDict, + ChatCompletionRequestMessage, + ChatCompletionRequestMessageTypedDict, ChatCompletionRequestStop, ChatCompletionRequestStopTypedDict, ChatCompletionRequestToolChoice, @@ -35,33 +34,29 @@ ) from .chatcompletionstreamrequest import ( ChatCompletionStreamRequest, + ChatCompletionStreamRequestMessage, + ChatCompletionStreamRequestMessageTypedDict, + ChatCompletionStreamRequestStop, + ChatCompletionStreamRequestStopTypedDict, ChatCompletionStreamRequestToolChoice, ChatCompletionStreamRequestToolChoiceTypedDict, ChatCompletionStreamRequestTypedDict, - Messages, - MessagesTypedDict, - Stop, - StopTypedDict, ) from .completionchunk import CompletionChunk, CompletionChunkTypedDict from .completionevent import CompletionEvent, CompletionEventTypedDict from .completionresponsestreamchoice import ( CompletionResponseStreamChoice, + CompletionResponseStreamChoiceFinishReason, CompletionResponseStreamChoiceTypedDict, - FinishReason, ) from .contentchunk import ContentChunk, ContentChunkTypedDict from .deltamessage import ( - Content, - ContentTypedDict, DeltaMessage, + DeltaMessageContent, + DeltaMessageContentTypedDict, DeltaMessageTypedDict, ) - from .documenturlchunk import ( - DocumentURLChunk, - DocumentURLChunkType, - DocumentURLChunkTypedDict, - ) + from .documenturlchunk import DocumentURLChunk, DocumentURLChunkTypedDict from .filechunk import FileChunk, FileChunkTypedDict from .function import Function, FunctionTypedDict from .functioncall import ( @@ -75,10 +70,9 @@ from .imageurl import ImageURL, ImageURLTypedDict from .imageurlchunk import ( ImageURLChunk, - ImageURLChunkImageURL, - ImageURLChunkImageURLTypedDict, - ImageURLChunkType, ImageURLChunkTypedDict, + ImageURLUnion, + ImageURLUnionTypedDict, ) from .jsonschema import JSONSchema, JSONSchemaTypedDict from .mistralpromptmode import MistralPromptMode @@ -97,18 +91,13 @@ from .ocrtableobject import Format, OCRTableObject, OCRTableObjectTypedDict from .ocrusageinfo import OCRUsageInfo, OCRUsageInfoTypedDict from .prediction import Prediction, PredictionTypedDict - from .referencechunk import ( - ReferenceChunk, - ReferenceChunkType, - ReferenceChunkTypedDict, - ) + from .referencechunk import ReferenceChunk, ReferenceChunkTypedDict from .responseformat import ResponseFormat, ResponseFormatTypedDict from .responseformats import ResponseFormats from .responsevalidationerror import ResponseValidationError from .sdkerror import SDKError from .security import Security, SecurityTypedDict from .systemmessage import ( - Role, SystemMessage, SystemMessageContent, SystemMessageContentTypedDict, @@ -118,14 +107,8 @@ SystemMessageContentChunks, SystemMessageContentChunksTypedDict, ) - from .textchunk import TextChunk, TextChunkTypedDict, Type - from .thinkchunk import ( - ThinkChunk, - ThinkChunkType, - ThinkChunkTypedDict, - Thinking, - ThinkingTypedDict, - ) + from .textchunk import TextChunk, TextChunkTypedDict + from .thinkchunk import ThinkChunk, ThinkChunkTypedDict, Thinking, ThinkingTypedDict from .tool import Tool, ToolTypedDict from .toolcall import ToolCall, ToolCallTypedDict from .toolchoice import ToolChoice, ToolChoiceTypedDict @@ -134,7 +117,6 @@ ToolMessage, ToolMessageContent, ToolMessageContentTypedDict, - ToolMessageRole, ToolMessageTypedDict, ) from .tooltypes import ToolTypes @@ -143,7 +125,6 @@ UserMessage, UserMessageContent, UserMessageContentTypedDict, - UserMessageRole, UserMessageTypedDict, ) from .validationerror import ( @@ -159,14 +140,13 @@ "AssistantMessage", "AssistantMessageContent", "AssistantMessageContentTypedDict", - "AssistantMessageRole", "AssistantMessageTypedDict", "ChatCompletionChoice", "ChatCompletionChoiceFinishReason", "ChatCompletionChoiceTypedDict", "ChatCompletionRequest", - "ChatCompletionRequestMessages", - "ChatCompletionRequestMessagesTypedDict", + "ChatCompletionRequestMessage", + "ChatCompletionRequestMessageTypedDict", "ChatCompletionRequestStop", "ChatCompletionRequestStopTypedDict", "ChatCompletionRequestToolChoice", @@ -175,6 +155,10 @@ "ChatCompletionResponse", "ChatCompletionResponseTypedDict", "ChatCompletionStreamRequest", + "ChatCompletionStreamRequestMessage", + "ChatCompletionStreamRequestMessageTypedDict", + "ChatCompletionStreamRequestStop", + "ChatCompletionStreamRequestStopTypedDict", "ChatCompletionStreamRequestToolChoice", "ChatCompletionStreamRequestToolChoiceTypedDict", "ChatCompletionStreamRequestTypedDict", @@ -183,21 +167,20 @@ "CompletionEvent", "CompletionEventTypedDict", "CompletionResponseStreamChoice", + "CompletionResponseStreamChoiceFinishReason", "CompletionResponseStreamChoiceTypedDict", - "Content", "ContentChunk", "ContentChunkTypedDict", - "ContentTypedDict", "DeltaMessage", + "DeltaMessageContent", + "DeltaMessageContentTypedDict", "DeltaMessageTypedDict", "Document", "DocumentTypedDict", "DocumentURLChunk", - "DocumentURLChunkType", "DocumentURLChunkTypedDict", "FileChunk", "FileChunkTypedDict", - "FinishReason", "Format", "Function", "FunctionCall", @@ -209,17 +192,14 @@ "HTTPValidationErrorData", "ImageURL", "ImageURLChunk", - "ImageURLChunkImageURL", - "ImageURLChunkImageURLTypedDict", - "ImageURLChunkType", "ImageURLChunkTypedDict", "ImageURLTypedDict", + "ImageURLUnion", + "ImageURLUnionTypedDict", "JSONSchema", "JSONSchemaTypedDict", "Loc", "LocTypedDict", - "Messages", - "MessagesTypedDict", "MistralAzureError", "MistralPromptMode", "NoResponseError", @@ -240,18 +220,14 @@ "Prediction", "PredictionTypedDict", "ReferenceChunk", - "ReferenceChunkType", "ReferenceChunkTypedDict", "ResponseFormat", "ResponseFormatTypedDict", "ResponseFormats", "ResponseValidationError", - "Role", "SDKError", "Security", "SecurityTypedDict", - "Stop", - "StopTypedDict", "SystemMessage", "SystemMessageContent", "SystemMessageContentChunks", @@ -262,7 +238,6 @@ "TextChunk", "TextChunkTypedDict", "ThinkChunk", - "ThinkChunkType", "ThinkChunkTypedDict", "Thinking", "ThinkingTypedDict", @@ -275,17 +250,14 @@ "ToolMessage", "ToolMessageContent", "ToolMessageContentTypedDict", - "ToolMessageRole", "ToolMessageTypedDict", "ToolTypedDict", "ToolTypes", - "Type", "UsageInfo", "UsageInfoTypedDict", "UserMessage", "UserMessageContent", "UserMessageContentTypedDict", - "UserMessageRole", "UserMessageTypedDict", "ValidationError", "ValidationErrorTypedDict", @@ -295,14 +267,13 @@ "AssistantMessage": ".assistantmessage", "AssistantMessageContent": ".assistantmessage", "AssistantMessageContentTypedDict": ".assistantmessage", - "AssistantMessageRole": ".assistantmessage", "AssistantMessageTypedDict": ".assistantmessage", "ChatCompletionChoice": ".chatcompletionchoice", "ChatCompletionChoiceFinishReason": ".chatcompletionchoice", "ChatCompletionChoiceTypedDict": ".chatcompletionchoice", "ChatCompletionRequest": ".chatcompletionrequest", - "ChatCompletionRequestMessages": ".chatcompletionrequest", - "ChatCompletionRequestMessagesTypedDict": ".chatcompletionrequest", + "ChatCompletionRequestMessage": ".chatcompletionrequest", + "ChatCompletionRequestMessageTypedDict": ".chatcompletionrequest", "ChatCompletionRequestStop": ".chatcompletionrequest", "ChatCompletionRequestStopTypedDict": ".chatcompletionrequest", "ChatCompletionRequestToolChoice": ".chatcompletionrequest", @@ -311,28 +282,27 @@ "ChatCompletionResponse": ".chatcompletionresponse", "ChatCompletionResponseTypedDict": ".chatcompletionresponse", "ChatCompletionStreamRequest": ".chatcompletionstreamrequest", + "ChatCompletionStreamRequestMessage": ".chatcompletionstreamrequest", + "ChatCompletionStreamRequestMessageTypedDict": ".chatcompletionstreamrequest", + "ChatCompletionStreamRequestStop": ".chatcompletionstreamrequest", + "ChatCompletionStreamRequestStopTypedDict": ".chatcompletionstreamrequest", "ChatCompletionStreamRequestToolChoice": ".chatcompletionstreamrequest", "ChatCompletionStreamRequestToolChoiceTypedDict": ".chatcompletionstreamrequest", "ChatCompletionStreamRequestTypedDict": ".chatcompletionstreamrequest", - "Messages": ".chatcompletionstreamrequest", - "MessagesTypedDict": ".chatcompletionstreamrequest", - "Stop": ".chatcompletionstreamrequest", - "StopTypedDict": ".chatcompletionstreamrequest", "CompletionChunk": ".completionchunk", "CompletionChunkTypedDict": ".completionchunk", "CompletionEvent": ".completionevent", "CompletionEventTypedDict": ".completionevent", "CompletionResponseStreamChoice": ".completionresponsestreamchoice", + "CompletionResponseStreamChoiceFinishReason": ".completionresponsestreamchoice", "CompletionResponseStreamChoiceTypedDict": ".completionresponsestreamchoice", - "FinishReason": ".completionresponsestreamchoice", "ContentChunk": ".contentchunk", "ContentChunkTypedDict": ".contentchunk", - "Content": ".deltamessage", - "ContentTypedDict": ".deltamessage", "DeltaMessage": ".deltamessage", + "DeltaMessageContent": ".deltamessage", + "DeltaMessageContentTypedDict": ".deltamessage", "DeltaMessageTypedDict": ".deltamessage", "DocumentURLChunk": ".documenturlchunk", - "DocumentURLChunkType": ".documenturlchunk", "DocumentURLChunkTypedDict": ".documenturlchunk", "FileChunk": ".filechunk", "FileChunkTypedDict": ".filechunk", @@ -349,10 +319,9 @@ "ImageURL": ".imageurl", "ImageURLTypedDict": ".imageurl", "ImageURLChunk": ".imageurlchunk", - "ImageURLChunkImageURL": ".imageurlchunk", - "ImageURLChunkImageURLTypedDict": ".imageurlchunk", - "ImageURLChunkType": ".imageurlchunk", "ImageURLChunkTypedDict": ".imageurlchunk", + "ImageURLUnion": ".imageurlchunk", + "ImageURLUnionTypedDict": ".imageurlchunk", "JSONSchema": ".jsonschema", "JSONSchemaTypedDict": ".jsonschema", "MistralPromptMode": ".mistralpromptmode", @@ -378,7 +347,6 @@ "Prediction": ".prediction", "PredictionTypedDict": ".prediction", "ReferenceChunk": ".referencechunk", - "ReferenceChunkType": ".referencechunk", "ReferenceChunkTypedDict": ".referencechunk", "ResponseFormat": ".responseformat", "ResponseFormatTypedDict": ".responseformat", @@ -387,7 +355,6 @@ "SDKError": ".sdkerror", "Security": ".security", "SecurityTypedDict": ".security", - "Role": ".systemmessage", "SystemMessage": ".systemmessage", "SystemMessageContent": ".systemmessage", "SystemMessageContentTypedDict": ".systemmessage", @@ -396,9 +363,7 @@ "SystemMessageContentChunksTypedDict": ".systemmessagecontentchunks", "TextChunk": ".textchunk", "TextChunkTypedDict": ".textchunk", - "Type": ".textchunk", "ThinkChunk": ".thinkchunk", - "ThinkChunkType": ".thinkchunk", "ThinkChunkTypedDict": ".thinkchunk", "Thinking": ".thinkchunk", "ThinkingTypedDict": ".thinkchunk", @@ -412,7 +377,6 @@ "ToolMessage": ".toolmessage", "ToolMessageContent": ".toolmessage", "ToolMessageContentTypedDict": ".toolmessage", - "ToolMessageRole": ".toolmessage", "ToolMessageTypedDict": ".toolmessage", "ToolTypes": ".tooltypes", "UsageInfo": ".usageinfo", @@ -420,7 +384,6 @@ "UserMessage": ".usermessage", "UserMessageContent": ".usermessage", "UserMessageContentTypedDict": ".usermessage", - "UserMessageRole": ".usermessage", "UserMessageTypedDict": ".usermessage", "Loc": ".validationerror", "LocTypedDict": ".validationerror", diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/assistantmessage.py b/packages/azure/src/mistralai/azure/client/models/assistantmessage.py similarity index 80% rename from packages/mistralai_gcp/src/mistralai_gcp/models/assistantmessage.py rename to packages/azure/src/mistralai/azure/client/models/assistantmessage.py index 17d740b6..f5793f94 100644 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/assistantmessage.py +++ b/packages/azure/src/mistralai/azure/client/models/assistantmessage.py @@ -3,16 +3,19 @@ from __future__ import annotations from .contentchunk import ContentChunk, ContentChunkTypedDict from .toolcall import ToolCall, ToolCallTypedDict -from mistralai_gcp.types import ( +from mistralai.azure.client.types import ( BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL, ) +from mistralai.azure.client.utils import validate_const +import pydantic from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator from typing import List, Literal, Optional, Union -from typing_extensions import NotRequired, TypeAliasType, TypedDict +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict AssistantMessageContentTypedDict = TypeAliasType( @@ -25,18 +28,22 @@ ) -AssistantMessageRole = Literal["assistant",] - - class AssistantMessageTypedDict(TypedDict): + role: Literal["assistant"] content: NotRequired[Nullable[AssistantMessageContentTypedDict]] tool_calls: NotRequired[Nullable[List[ToolCallTypedDict]]] prefix: NotRequired[bool] r"""Set this to `true` when adding an assistant message as prefix to condition the model response. The role of the prefix message is to force the model to start its answer by the content of the message.""" - role: NotRequired[AssistantMessageRole] class AssistantMessage(BaseModel): + ROLE: Annotated[ + Annotated[ + Optional[Literal["assistant"]], AfterValidator(validate_const("assistant")) + ], + pydantic.Field(alias="role"), + ] = "assistant" + content: OptionalNullable[AssistantMessageContent] = UNSET tool_calls: OptionalNullable[List[ToolCall]] = UNSET @@ -44,11 +51,9 @@ class AssistantMessage(BaseModel): prefix: Optional[bool] = False r"""Set this to `true` when adding an assistant message as prefix to condition the model response. The role of the prefix message is to force the model to start its answer by the content of the message.""" - role: Optional[AssistantMessageRole] = "assistant" - @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = ["content", "tool_calls", "prefix", "role"] + optional_fields = ["role", "content", "tool_calls", "prefix"] nullable_fields = ["content", "tool_calls"] null_default_fields = [] diff --git a/packages/mistralai_azure/src/mistralai_azure/models/chatcompletionchoice.py b/packages/azure/src/mistralai/azure/client/models/chatcompletionchoice.py similarity index 91% rename from packages/mistralai_azure/src/mistralai_azure/models/chatcompletionchoice.py rename to packages/azure/src/mistralai/azure/client/models/chatcompletionchoice.py index 7c6eb933..67b5ba69 100644 --- a/packages/mistralai_azure/src/mistralai_azure/models/chatcompletionchoice.py +++ b/packages/azure/src/mistralai/azure/client/models/chatcompletionchoice.py @@ -2,7 +2,7 @@ from __future__ import annotations from .assistantmessage import AssistantMessage, AssistantMessageTypedDict -from mistralai_azure.types import BaseModel, UnrecognizedStr +from mistralai.azure.client.types import BaseModel, UnrecognizedStr from typing import Literal, Union from typing_extensions import TypedDict diff --git a/packages/mistralai_azure/src/mistralai_azure/models/chatcompletionrequest.py b/packages/azure/src/mistralai/azure/client/models/chatcompletionrequest.py similarity index 97% rename from packages/mistralai_azure/src/mistralai_azure/models/chatcompletionrequest.py rename to packages/azure/src/mistralai/azure/client/models/chatcompletionrequest.py index a7b095f3..92179095 100644 --- a/packages/mistralai_azure/src/mistralai_azure/models/chatcompletionrequest.py +++ b/packages/azure/src/mistralai/azure/client/models/chatcompletionrequest.py @@ -11,14 +11,14 @@ from .toolchoiceenum import ToolChoiceEnum from .toolmessage import ToolMessage, ToolMessageTypedDict from .usermessage import UserMessage, UserMessageTypedDict -from mistralai_azure.types import ( +from mistralai.azure.client.types import ( BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL, ) -from mistralai_azure.utils import get_discriminator +from mistralai.azure.client.utils import get_discriminator from pydantic import Discriminator, Tag, model_serializer from typing import Any, Dict, List, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -36,8 +36,8 @@ r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" -ChatCompletionRequestMessagesTypedDict = TypeAliasType( - "ChatCompletionRequestMessagesTypedDict", +ChatCompletionRequestMessageTypedDict = TypeAliasType( + "ChatCompletionRequestMessageTypedDict", Union[ SystemMessageTypedDict, UserMessageTypedDict, @@ -47,7 +47,7 @@ ) -ChatCompletionRequestMessages = Annotated[ +ChatCompletionRequestMessage = Annotated[ Union[ Annotated[AssistantMessage, Tag("assistant")], Annotated[SystemMessage, Tag("system")], @@ -72,7 +72,7 @@ class ChatCompletionRequestTypedDict(TypedDict): - messages: List[ChatCompletionRequestMessagesTypedDict] + messages: List[ChatCompletionRequestMessageTypedDict] r"""The prompt(s) to generate completions for, encoded as a list of dict with role and content.""" model: NotRequired[str] r"""The ID of the model to use for this request.""" @@ -112,7 +112,7 @@ class ChatCompletionRequestTypedDict(TypedDict): class ChatCompletionRequest(BaseModel): - messages: List[ChatCompletionRequestMessages] + messages: List[ChatCompletionRequestMessage] r"""The prompt(s) to generate completions for, encoded as a list of dict with role and content.""" model: Optional[str] = "azureai" diff --git a/packages/mistralai_azure/src/mistralai_azure/models/chatcompletionresponse.py b/packages/azure/src/mistralai/azure/client/models/chatcompletionresponse.py similarity index 92% rename from packages/mistralai_azure/src/mistralai_azure/models/chatcompletionresponse.py rename to packages/azure/src/mistralai/azure/client/models/chatcompletionresponse.py index 7a66f322..d41f9c6f 100644 --- a/packages/mistralai_azure/src/mistralai_azure/models/chatcompletionresponse.py +++ b/packages/azure/src/mistralai/azure/client/models/chatcompletionresponse.py @@ -3,7 +3,7 @@ from __future__ import annotations from .chatcompletionchoice import ChatCompletionChoice, ChatCompletionChoiceTypedDict from .usageinfo import UsageInfo, UsageInfoTypedDict -from mistralai_azure.types import BaseModel +from mistralai.azure.client.types import BaseModel from typing import List from typing_extensions import TypedDict diff --git a/packages/mistralai_azure/src/mistralai_azure/models/chatcompletionstreamrequest.py b/packages/azure/src/mistralai/azure/client/models/chatcompletionstreamrequest.py similarity index 94% rename from packages/mistralai_azure/src/mistralai_azure/models/chatcompletionstreamrequest.py rename to packages/azure/src/mistralai/azure/client/models/chatcompletionstreamrequest.py index 96cd631b..be21eed2 100644 --- a/packages/mistralai_azure/src/mistralai_azure/models/chatcompletionstreamrequest.py +++ b/packages/azure/src/mistralai/azure/client/models/chatcompletionstreamrequest.py @@ -11,29 +11,33 @@ from .toolchoiceenum import ToolChoiceEnum from .toolmessage import ToolMessage, ToolMessageTypedDict from .usermessage import UserMessage, UserMessageTypedDict -from mistralai_azure.types import ( +from mistralai.azure.client.types import ( BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL, ) -from mistralai_azure.utils import get_discriminator +from mistralai.azure.client.utils import get_discriminator from pydantic import Discriminator, Tag, model_serializer from typing import Any, Dict, List, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict -StopTypedDict = TypeAliasType("StopTypedDict", Union[str, List[str]]) +ChatCompletionStreamRequestStopTypedDict = TypeAliasType( + "ChatCompletionStreamRequestStopTypedDict", Union[str, List[str]] +) r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" -Stop = TypeAliasType("Stop", Union[str, List[str]]) +ChatCompletionStreamRequestStop = TypeAliasType( + "ChatCompletionStreamRequestStop", Union[str, List[str]] +) r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" -MessagesTypedDict = TypeAliasType( - "MessagesTypedDict", +ChatCompletionStreamRequestMessageTypedDict = TypeAliasType( + "ChatCompletionStreamRequestMessageTypedDict", Union[ SystemMessageTypedDict, UserMessageTypedDict, @@ -43,7 +47,7 @@ ) -Messages = Annotated[ +ChatCompletionStreamRequestMessage = Annotated[ Union[ Annotated[AssistantMessage, Tag("assistant")], Annotated[SystemMessage, Tag("system")], @@ -68,7 +72,7 @@ class ChatCompletionStreamRequestTypedDict(TypedDict): - messages: List[MessagesTypedDict] + messages: List[ChatCompletionStreamRequestMessageTypedDict] r"""The prompt(s) to generate completions for, encoded as a list of dict with role and content.""" model: NotRequired[str] r"""The ID of the model to use for this request.""" @@ -79,7 +83,7 @@ class ChatCompletionStreamRequestTypedDict(TypedDict): max_tokens: NotRequired[Nullable[int]] r"""The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length.""" stream: NotRequired[bool] - stop: NotRequired[StopTypedDict] + stop: NotRequired[ChatCompletionStreamRequestStopTypedDict] r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" random_seed: NotRequired[Nullable[int]] r"""The seed to use for random sampling. If set, different calls will generate deterministic results.""" @@ -107,7 +111,7 @@ class ChatCompletionStreamRequestTypedDict(TypedDict): class ChatCompletionStreamRequest(BaseModel): - messages: List[Messages] + messages: List[ChatCompletionStreamRequestMessage] r"""The prompt(s) to generate completions for, encoded as a list of dict with role and content.""" model: Optional[str] = "azureai" @@ -124,7 +128,7 @@ class ChatCompletionStreamRequest(BaseModel): stream: Optional[bool] = True - stop: Optional[Stop] = None + stop: Optional[ChatCompletionStreamRequestStop] = None r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" random_seed: OptionalNullable[int] = UNSET diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/completionchunk.py b/packages/azure/src/mistralai/azure/client/models/completionchunk.py similarity index 94% rename from packages/mistralai_gcp/src/mistralai_gcp/models/completionchunk.py rename to packages/azure/src/mistralai/azure/client/models/completionchunk.py index ca002f52..b94284b2 100644 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/completionchunk.py +++ b/packages/azure/src/mistralai/azure/client/models/completionchunk.py @@ -6,7 +6,7 @@ CompletionResponseStreamChoiceTypedDict, ) from .usageinfo import UsageInfo, UsageInfoTypedDict -from mistralai_gcp.types import BaseModel +from mistralai.azure.client.types import BaseModel from typing import List, Optional from typing_extensions import NotRequired, TypedDict diff --git a/packages/mistralai_azure/src/mistralai_azure/models/completionevent.py b/packages/azure/src/mistralai/azure/client/models/completionevent.py similarity index 87% rename from packages/mistralai_azure/src/mistralai_azure/models/completionevent.py rename to packages/azure/src/mistralai/azure/client/models/completionevent.py index 5a2039c2..c4b27287 100644 --- a/packages/mistralai_azure/src/mistralai_azure/models/completionevent.py +++ b/packages/azure/src/mistralai/azure/client/models/completionevent.py @@ -2,7 +2,7 @@ from __future__ import annotations from .completionchunk import CompletionChunk, CompletionChunkTypedDict -from mistralai_azure.types import BaseModel +from mistralai.azure.client.types import BaseModel from typing_extensions import TypedDict diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/completionresponsestreamchoice.py b/packages/azure/src/mistralai/azure/client/models/completionresponsestreamchoice.py similarity index 82% rename from packages/mistralai_gcp/src/mistralai_gcp/models/completionresponsestreamchoice.py rename to packages/azure/src/mistralai/azure/client/models/completionresponsestreamchoice.py index ec9df528..2a4d053f 100644 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/completionresponsestreamchoice.py +++ b/packages/azure/src/mistralai/azure/client/models/completionresponsestreamchoice.py @@ -2,13 +2,18 @@ from __future__ import annotations from .deltamessage import DeltaMessage, DeltaMessageTypedDict -from mistralai_gcp.types import BaseModel, Nullable, UNSET_SENTINEL, UnrecognizedStr +from mistralai.azure.client.types import ( + BaseModel, + Nullable, + UNSET_SENTINEL, + UnrecognizedStr, +) from pydantic import model_serializer from typing import Literal, Union from typing_extensions import TypedDict -FinishReason = Union[ +CompletionResponseStreamChoiceFinishReason = Union[ Literal[ "stop", "length", @@ -22,7 +27,7 @@ class CompletionResponseStreamChoiceTypedDict(TypedDict): index: int delta: DeltaMessageTypedDict - finish_reason: Nullable[FinishReason] + finish_reason: Nullable[CompletionResponseStreamChoiceFinishReason] class CompletionResponseStreamChoice(BaseModel): @@ -30,7 +35,7 @@ class CompletionResponseStreamChoice(BaseModel): delta: DeltaMessage - finish_reason: Nullable[FinishReason] + finish_reason: Nullable[CompletionResponseStreamChoiceFinishReason] @model_serializer(mode="wrap") def serialize_model(self, handler): diff --git a/packages/mistralai_azure/src/mistralai_azure/models/contentchunk.py b/packages/azure/src/mistralai/azure/client/models/contentchunk.py similarity index 93% rename from packages/mistralai_azure/src/mistralai_azure/models/contentchunk.py rename to packages/azure/src/mistralai/azure/client/models/contentchunk.py index e6a3e24a..0f09f767 100644 --- a/packages/mistralai_azure/src/mistralai_azure/models/contentchunk.py +++ b/packages/azure/src/mistralai/azure/client/models/contentchunk.py @@ -4,7 +4,7 @@ from .imageurlchunk import ImageURLChunk, ImageURLChunkTypedDict from .referencechunk import ReferenceChunk, ReferenceChunkTypedDict from .textchunk import TextChunk, TextChunkTypedDict -from mistralai_azure.utils import get_discriminator +from mistralai.azure.client.utils import get_discriminator from pydantic import Discriminator, Tag from typing import Union from typing_extensions import Annotated, TypeAliasType diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/deltamessage.py b/packages/azure/src/mistralai/azure/client/models/deltamessage.py similarity index 81% rename from packages/mistralai_gcp/src/mistralai_gcp/models/deltamessage.py rename to packages/azure/src/mistralai/azure/client/models/deltamessage.py index 1801ac76..2c01feae 100644 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/deltamessage.py +++ b/packages/azure/src/mistralai/azure/client/models/deltamessage.py @@ -3,7 +3,7 @@ from __future__ import annotations from .contentchunk import ContentChunk, ContentChunkTypedDict from .toolcall import ToolCall, ToolCallTypedDict -from mistralai_gcp.types import ( +from mistralai.azure.client.types import ( BaseModel, Nullable, OptionalNullable, @@ -15,24 +15,26 @@ from typing_extensions import NotRequired, TypeAliasType, TypedDict -ContentTypedDict = TypeAliasType( - "ContentTypedDict", Union[str, List[ContentChunkTypedDict]] +DeltaMessageContentTypedDict = TypeAliasType( + "DeltaMessageContentTypedDict", Union[str, List[ContentChunkTypedDict]] ) -Content = TypeAliasType("Content", Union[str, List[ContentChunk]]) +DeltaMessageContent = TypeAliasType( + "DeltaMessageContent", Union[str, List[ContentChunk]] +) class DeltaMessageTypedDict(TypedDict): role: NotRequired[Nullable[str]] - content: NotRequired[Nullable[ContentTypedDict]] + content: NotRequired[Nullable[DeltaMessageContentTypedDict]] tool_calls: NotRequired[Nullable[List[ToolCallTypedDict]]] class DeltaMessage(BaseModel): role: OptionalNullable[str] = UNSET - content: OptionalNullable[Content] = UNSET + content: OptionalNullable[DeltaMessageContent] = UNSET tool_calls: OptionalNullable[List[ToolCall]] = UNSET diff --git a/packages/mistralai_azure/src/mistralai_azure/models/documenturlchunk.py b/packages/azure/src/mistralai/azure/client/models/documenturlchunk.py similarity index 72% rename from packages/mistralai_azure/src/mistralai_azure/models/documenturlchunk.py rename to packages/azure/src/mistralai/azure/client/models/documenturlchunk.py index ea8d5625..345bafc2 100644 --- a/packages/mistralai_azure/src/mistralai_azure/models/documenturlchunk.py +++ b/packages/azure/src/mistralai/azure/client/models/documenturlchunk.py @@ -1,39 +1,45 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from mistralai_azure.types import ( +from mistralai.azure.client.types import ( BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL, ) +from mistralai.azure.client.utils import validate_const +import pydantic from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator from typing import Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -DocumentURLChunkType = Literal["document_url",] +from typing_extensions import Annotated, NotRequired, TypedDict class DocumentURLChunkTypedDict(TypedDict): document_url: str + type: Literal["document_url"] document_name: NotRequired[Nullable[str]] r"""The filename of the document""" - type: NotRequired[DocumentURLChunkType] class DocumentURLChunk(BaseModel): document_url: str + TYPE: Annotated[ + Annotated[ + Optional[Literal["document_url"]], + AfterValidator(validate_const("document_url")), + ], + pydantic.Field(alias="type"), + ] = "document_url" + document_name: OptionalNullable[str] = UNSET r"""The filename of the document""" - type: Optional[DocumentURLChunkType] = "document_url" - @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = ["document_name", "type"] + optional_fields = ["type", "document_name"] nullable_fields = ["document_name"] null_default_fields = [] diff --git a/packages/mistralai_azure/src/mistralai_azure/models/filechunk.py b/packages/azure/src/mistralai/azure/client/models/filechunk.py similarity index 83% rename from packages/mistralai_azure/src/mistralai_azure/models/filechunk.py rename to packages/azure/src/mistralai/azure/client/models/filechunk.py index 2c3edc07..829f03d8 100644 --- a/packages/mistralai_azure/src/mistralai_azure/models/filechunk.py +++ b/packages/azure/src/mistralai/azure/client/models/filechunk.py @@ -1,8 +1,8 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from mistralai_azure.types import BaseModel -from mistralai_azure.utils import validate_const +from mistralai.azure.client.types import BaseModel +from mistralai.azure.client.utils import validate_const import pydantic from pydantic.functional_validators import AfterValidator from typing import Literal, Optional diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/function.py b/packages/azure/src/mistralai/azure/client/models/function.py similarity index 90% rename from packages/mistralai_gcp/src/mistralai_gcp/models/function.py rename to packages/azure/src/mistralai/azure/client/models/function.py index 7ad1ae64..f4edce0f 100644 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/function.py +++ b/packages/azure/src/mistralai/azure/client/models/function.py @@ -1,7 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from mistralai_gcp.types import BaseModel +from mistralai.azure.client.types import BaseModel from typing import Any, Dict, Optional from typing_extensions import NotRequired, TypedDict diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/functioncall.py b/packages/azure/src/mistralai/azure/client/models/functioncall.py similarity index 91% rename from packages/mistralai_gcp/src/mistralai_gcp/models/functioncall.py rename to packages/azure/src/mistralai/azure/client/models/functioncall.py index 99554c88..d476792c 100644 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/functioncall.py +++ b/packages/azure/src/mistralai/azure/client/models/functioncall.py @@ -1,7 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from mistralai_gcp.types import BaseModel +from mistralai.azure.client.types import BaseModel from typing import Any, Dict, Union from typing_extensions import TypeAliasType, TypedDict diff --git a/packages/mistralai_azure/src/mistralai_azure/models/functionname.py b/packages/azure/src/mistralai/azure/client/models/functionname.py similarity index 89% rename from packages/mistralai_azure/src/mistralai_azure/models/functionname.py rename to packages/azure/src/mistralai/azure/client/models/functionname.py index b55c82af..839e0d55 100644 --- a/packages/mistralai_azure/src/mistralai_azure/models/functionname.py +++ b/packages/azure/src/mistralai/azure/client/models/functionname.py @@ -1,7 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from mistralai_azure.types import BaseModel +from mistralai.azure.client.types import BaseModel from typing_extensions import TypedDict diff --git a/packages/mistralai_azure/src/mistralai_azure/models/httpvalidationerror.py b/packages/azure/src/mistralai/azure/client/models/httpvalidationerror.py similarity index 87% rename from packages/mistralai_azure/src/mistralai_azure/models/httpvalidationerror.py rename to packages/azure/src/mistralai/azure/client/models/httpvalidationerror.py index 56607d94..40bccddc 100644 --- a/packages/mistralai_azure/src/mistralai_azure/models/httpvalidationerror.py +++ b/packages/azure/src/mistralai/azure/client/models/httpvalidationerror.py @@ -4,8 +4,8 @@ from .validationerror import ValidationError from dataclasses import dataclass, field import httpx -from mistralai_azure.models import MistralAzureError -from mistralai_azure.types import BaseModel +from mistralai.azure.client.models import MistralAzureError +from mistralai.azure.client.types import BaseModel from typing import List, Optional diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/imageurl.py b/packages/azure/src/mistralai/azure/client/models/imageurl.py similarity index 96% rename from packages/mistralai_gcp/src/mistralai_gcp/models/imageurl.py rename to packages/azure/src/mistralai/azure/client/models/imageurl.py index 20d4ba77..08c954fa 100644 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/imageurl.py +++ b/packages/azure/src/mistralai/azure/client/models/imageurl.py @@ -1,7 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from mistralai_gcp.types import ( +from mistralai.azure.client.types import ( BaseModel, Nullable, OptionalNullable, diff --git a/packages/azure/src/mistralai/azure/client/models/imageurlchunk.py b/packages/azure/src/mistralai/azure/client/models/imageurlchunk.py new file mode 100644 index 00000000..ee6de50f --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/imageurlchunk.py @@ -0,0 +1,38 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .imageurl import ImageURL, ImageURLTypedDict +from mistralai.azure.client.types import BaseModel +from mistralai.azure.client.utils import validate_const +import pydantic +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional, Union +from typing_extensions import Annotated, TypeAliasType, TypedDict + + +ImageURLUnionTypedDict = TypeAliasType( + "ImageURLUnionTypedDict", Union[ImageURLTypedDict, str] +) + + +ImageURLUnion = TypeAliasType("ImageURLUnion", Union[ImageURL, str]) + + +class ImageURLChunkTypedDict(TypedDict): + r"""{\"type\":\"image_url\",\"image_url\":{\"url\":\"data:image/png;base64,iVBORw0""" + + image_url: ImageURLUnionTypedDict + type: Literal["image_url"] + + +class ImageURLChunk(BaseModel): + r"""{\"type\":\"image_url\",\"image_url\":{\"url\":\"data:image/png;base64,iVBORw0""" + + image_url: ImageURLUnion + + TYPE: Annotated[ + Annotated[ + Optional[Literal["image_url"]], AfterValidator(validate_const("image_url")) + ], + pydantic.Field(alias="type"), + ] = "image_url" diff --git a/packages/mistralai_azure/src/mistralai_azure/models/jsonschema.py b/packages/azure/src/mistralai/azure/client/models/jsonschema.py similarity index 97% rename from packages/mistralai_azure/src/mistralai_azure/models/jsonschema.py rename to packages/azure/src/mistralai/azure/client/models/jsonschema.py index 0f7563fc..5aaa490a 100644 --- a/packages/mistralai_azure/src/mistralai_azure/models/jsonschema.py +++ b/packages/azure/src/mistralai/azure/client/models/jsonschema.py @@ -1,7 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from mistralai_azure.types import ( +from mistralai.azure.client.types import ( BaseModel, Nullable, OptionalNullable, diff --git a/packages/mistralai_azure/src/mistralai_azure/models/mistralazureerror.py b/packages/azure/src/mistralai/azure/client/models/mistralazureerror.py similarity index 100% rename from packages/mistralai_azure/src/mistralai_azure/models/mistralazureerror.py rename to packages/azure/src/mistralai/azure/client/models/mistralazureerror.py diff --git a/packages/mistralai_azure/src/mistralai_azure/models/mistralpromptmode.py b/packages/azure/src/mistralai/azure/client/models/mistralpromptmode.py similarity index 89% rename from packages/mistralai_azure/src/mistralai_azure/models/mistralpromptmode.py rename to packages/azure/src/mistralai/azure/client/models/mistralpromptmode.py index 77230b7e..26e7adbd 100644 --- a/packages/mistralai_azure/src/mistralai_azure/models/mistralpromptmode.py +++ b/packages/azure/src/mistralai/azure/client/models/mistralpromptmode.py @@ -1,7 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from mistralai_azure.types import UnrecognizedStr +from mistralai.azure.client.types import UnrecognizedStr from typing import Literal, Union diff --git a/packages/mistralai_azure/src/mistralai_azure/models/no_response_error.py b/packages/azure/src/mistralai/azure/client/models/no_response_error.py similarity index 100% rename from packages/mistralai_azure/src/mistralai_azure/models/no_response_error.py rename to packages/azure/src/mistralai/azure/client/models/no_response_error.py diff --git a/packages/mistralai_azure/src/mistralai_azure/models/ocrimageobject.py b/packages/azure/src/mistralai/azure/client/models/ocrimageobject.py similarity index 98% rename from packages/mistralai_azure/src/mistralai_azure/models/ocrimageobject.py rename to packages/azure/src/mistralai/azure/client/models/ocrimageobject.py index 9d0dd01d..38e9d3e4 100644 --- a/packages/mistralai_azure/src/mistralai_azure/models/ocrimageobject.py +++ b/packages/azure/src/mistralai/azure/client/models/ocrimageobject.py @@ -1,7 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from mistralai_azure.types import ( +from mistralai.azure.client.types import ( BaseModel, Nullable, OptionalNullable, diff --git a/packages/mistralai_azure/src/mistralai_azure/models/ocrpagedimensions.py b/packages/azure/src/mistralai/azure/client/models/ocrpagedimensions.py similarity index 91% rename from packages/mistralai_azure/src/mistralai_azure/models/ocrpagedimensions.py rename to packages/azure/src/mistralai/azure/client/models/ocrpagedimensions.py index efb62a58..12858da9 100644 --- a/packages/mistralai_azure/src/mistralai_azure/models/ocrpagedimensions.py +++ b/packages/azure/src/mistralai/azure/client/models/ocrpagedimensions.py @@ -1,7 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from mistralai_azure.types import BaseModel +from mistralai.azure.client.types import BaseModel from typing_extensions import TypedDict diff --git a/packages/mistralai_azure/src/mistralai_azure/models/ocrpageobject.py b/packages/azure/src/mistralai/azure/client/models/ocrpageobject.py similarity index 98% rename from packages/mistralai_azure/src/mistralai_azure/models/ocrpageobject.py rename to packages/azure/src/mistralai/azure/client/models/ocrpageobject.py index e9571800..5fb821c1 100644 --- a/packages/mistralai_azure/src/mistralai_azure/models/ocrpageobject.py +++ b/packages/azure/src/mistralai/azure/client/models/ocrpageobject.py @@ -4,7 +4,7 @@ from .ocrimageobject import OCRImageObject, OCRImageObjectTypedDict from .ocrpagedimensions import OCRPageDimensions, OCRPageDimensionsTypedDict from .ocrtableobject import OCRTableObject, OCRTableObjectTypedDict -from mistralai_azure.types import ( +from mistralai.azure.client.types import ( BaseModel, Nullable, OptionalNullable, diff --git a/packages/mistralai_azure/src/mistralai_azure/models/ocrrequest.py b/packages/azure/src/mistralai/azure/client/models/ocrrequest.py similarity index 99% rename from packages/mistralai_azure/src/mistralai_azure/models/ocrrequest.py rename to packages/azure/src/mistralai/azure/client/models/ocrrequest.py index e9c23afc..fece2713 100644 --- a/packages/mistralai_azure/src/mistralai_azure/models/ocrrequest.py +++ b/packages/azure/src/mistralai/azure/client/models/ocrrequest.py @@ -5,7 +5,7 @@ from .filechunk import FileChunk, FileChunkTypedDict from .imageurlchunk import ImageURLChunk, ImageURLChunkTypedDict from .responseformat import ResponseFormat, ResponseFormatTypedDict -from mistralai_azure.types import ( +from mistralai.azure.client.types import ( BaseModel, Nullable, OptionalNullable, diff --git a/packages/mistralai_azure/src/mistralai_azure/models/ocrresponse.py b/packages/azure/src/mistralai/azure/client/models/ocrresponse.py similarity index 97% rename from packages/mistralai_azure/src/mistralai_azure/models/ocrresponse.py rename to packages/azure/src/mistralai/azure/client/models/ocrresponse.py index 3e43fa8e..787289fa 100644 --- a/packages/mistralai_azure/src/mistralai_azure/models/ocrresponse.py +++ b/packages/azure/src/mistralai/azure/client/models/ocrresponse.py @@ -3,7 +3,7 @@ from __future__ import annotations from .ocrpageobject import OCRPageObject, OCRPageObjectTypedDict from .ocrusageinfo import OCRUsageInfo, OCRUsageInfoTypedDict -from mistralai_azure.types import ( +from mistralai.azure.client.types import ( BaseModel, Nullable, OptionalNullable, diff --git a/packages/mistralai_azure/src/mistralai_azure/models/ocrtableobject.py b/packages/azure/src/mistralai/azure/client/models/ocrtableobject.py similarity index 78% rename from packages/mistralai_azure/src/mistralai_azure/models/ocrtableobject.py rename to packages/azure/src/mistralai/azure/client/models/ocrtableobject.py index 189f059e..3e3c2583 100644 --- a/packages/mistralai_azure/src/mistralai_azure/models/ocrtableobject.py +++ b/packages/azure/src/mistralai/azure/client/models/ocrtableobject.py @@ -1,15 +1,18 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from mistralai_azure.types import BaseModel +from mistralai.azure.client.types import BaseModel, UnrecognizedStr import pydantic -from typing import Literal +from typing import Literal, Union from typing_extensions import Annotated, TypedDict -Format = Literal[ - "markdown", - "html", +Format = Union[ + Literal[ + "markdown", + "html", + ], + UnrecognizedStr, ] r"""Format of the table""" diff --git a/packages/mistralai_azure/src/mistralai_azure/models/ocrusageinfo.py b/packages/azure/src/mistralai/azure/client/models/ocrusageinfo.py similarity index 97% rename from packages/mistralai_azure/src/mistralai_azure/models/ocrusageinfo.py rename to packages/azure/src/mistralai/azure/client/models/ocrusageinfo.py index 1f5c9f1b..e2ceba35 100644 --- a/packages/mistralai_azure/src/mistralai_azure/models/ocrusageinfo.py +++ b/packages/azure/src/mistralai/azure/client/models/ocrusageinfo.py @@ -1,7 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from mistralai_azure.types import ( +from mistralai.azure.client.types import ( BaseModel, Nullable, OptionalNullable, diff --git a/packages/mistralai_azure/src/mistralai_azure/models/prediction.py b/packages/azure/src/mistralai/azure/client/models/prediction.py similarity index 89% rename from packages/mistralai_azure/src/mistralai_azure/models/prediction.py rename to packages/azure/src/mistralai/azure/client/models/prediction.py index b23a935c..6b8d6480 100644 --- a/packages/mistralai_azure/src/mistralai_azure/models/prediction.py +++ b/packages/azure/src/mistralai/azure/client/models/prediction.py @@ -1,8 +1,8 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from mistralai_azure.types import BaseModel -from mistralai_azure.utils import validate_const +from mistralai.azure.client.types import BaseModel +from mistralai.azure.client.utils import validate_const import pydantic from pydantic.functional_validators import AfterValidator from typing import Literal, Optional diff --git a/packages/azure/src/mistralai/azure/client/models/referencechunk.py b/packages/azure/src/mistralai/azure/client/models/referencechunk.py new file mode 100644 index 00000000..e0bcb06b --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/referencechunk.py @@ -0,0 +1,25 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from mistralai.azure.client.types import BaseModel +from mistralai.azure.client.utils import validate_const +import pydantic +from pydantic.functional_validators import AfterValidator +from typing import List, Literal, Optional +from typing_extensions import Annotated, TypedDict + + +class ReferenceChunkTypedDict(TypedDict): + reference_ids: List[int] + type: Literal["reference"] + + +class ReferenceChunk(BaseModel): + reference_ids: List[int] + + TYPE: Annotated[ + Annotated[ + Optional[Literal["reference"]], AfterValidator(validate_const("reference")) + ], + pydantic.Field(alias="type"), + ] = "reference" diff --git a/packages/mistralai_azure/src/mistralai_azure/models/responseformat.py b/packages/azure/src/mistralai/azure/client/models/responseformat.py similarity index 98% rename from packages/mistralai_azure/src/mistralai_azure/models/responseformat.py rename to packages/azure/src/mistralai/azure/client/models/responseformat.py index c989f3a4..39fb03a2 100644 --- a/packages/mistralai_azure/src/mistralai_azure/models/responseformat.py +++ b/packages/azure/src/mistralai/azure/client/models/responseformat.py @@ -3,7 +3,7 @@ from __future__ import annotations from .jsonschema import JSONSchema, JSONSchemaTypedDict from .responseformats import ResponseFormats -from mistralai_azure.types import ( +from mistralai.azure.client.types import ( BaseModel, Nullable, OptionalNullable, diff --git a/packages/mistralai_azure/src/mistralai_azure/models/responseformats.py b/packages/azure/src/mistralai/azure/client/models/responseformats.py similarity index 100% rename from packages/mistralai_azure/src/mistralai_azure/models/responseformats.py rename to packages/azure/src/mistralai/azure/client/models/responseformats.py diff --git a/packages/mistralai_azure/src/mistralai_azure/models/responsevalidationerror.py b/packages/azure/src/mistralai/azure/client/models/responsevalidationerror.py similarity index 92% rename from packages/mistralai_azure/src/mistralai_azure/models/responsevalidationerror.py rename to packages/azure/src/mistralai/azure/client/models/responsevalidationerror.py index a33954cc..cbdffcbb 100644 --- a/packages/mistralai_azure/src/mistralai_azure/models/responsevalidationerror.py +++ b/packages/azure/src/mistralai/azure/client/models/responsevalidationerror.py @@ -4,7 +4,7 @@ from typing import Optional from dataclasses import dataclass -from mistralai_azure.models import MistralAzureError +from mistralai.azure.client.models import MistralAzureError @dataclass(unsafe_hash=True) diff --git a/packages/mistralai_azure/src/mistralai_azure/models/sdkerror.py b/packages/azure/src/mistralai/azure/client/models/sdkerror.py similarity index 95% rename from packages/mistralai_azure/src/mistralai_azure/models/sdkerror.py rename to packages/azure/src/mistralai/azure/client/models/sdkerror.py index 216d7f8f..a1e9aaca 100644 --- a/packages/mistralai_azure/src/mistralai_azure/models/sdkerror.py +++ b/packages/azure/src/mistralai/azure/client/models/sdkerror.py @@ -4,7 +4,7 @@ from typing import Optional from dataclasses import dataclass -from mistralai_azure.models import MistralAzureError +from mistralai.azure.client.models import MistralAzureError MAX_MESSAGE_LEN = 10_000 diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/security.py b/packages/azure/src/mistralai/azure/client/models/security.py similarity index 80% rename from packages/mistralai_gcp/src/mistralai_gcp/models/security.py rename to packages/azure/src/mistralai/azure/client/models/security.py index 38574942..9b83ba98 100644 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/security.py +++ b/packages/azure/src/mistralai/azure/client/models/security.py @@ -1,8 +1,8 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from mistralai_gcp.types import BaseModel -from mistralai_gcp.utils import FieldMetadata, SecurityMetadata +from mistralai.azure.client.types import BaseModel +from mistralai.azure.client.utils import FieldMetadata, SecurityMetadata from typing_extensions import Annotated, TypedDict diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/systemmessage.py b/packages/azure/src/mistralai/azure/client/models/systemmessage.py similarity index 57% rename from packages/mistralai_gcp/src/mistralai_gcp/models/systemmessage.py rename to packages/azure/src/mistralai/azure/client/models/systemmessage.py index d74bdf32..38c280c8 100644 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/systemmessage.py +++ b/packages/azure/src/mistralai/azure/client/models/systemmessage.py @@ -5,9 +5,12 @@ SystemMessageContentChunks, SystemMessageContentChunksTypedDict, ) -from mistralai_gcp.types import BaseModel -from typing import List, Literal, Optional, Union -from typing_extensions import NotRequired, TypeAliasType, TypedDict +from mistralai.azure.client.types import BaseModel +from mistralai.azure.client.utils import validate_const +import pydantic +from pydantic.functional_validators import AfterValidator +from typing import List, Literal, Union +from typing_extensions import Annotated, TypeAliasType, TypedDict SystemMessageContentTypedDict = TypeAliasType( @@ -21,15 +24,15 @@ ) -Role = Literal["system",] - - class SystemMessageTypedDict(TypedDict): content: SystemMessageContentTypedDict - role: NotRequired[Role] + role: Literal["system"] class SystemMessage(BaseModel): content: SystemMessageContent - role: Optional[Role] = "system" + ROLE: Annotated[ + Annotated[Literal["system"], AfterValidator(validate_const("system"))], + pydantic.Field(alias="role"), + ] = "system" diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/systemmessagecontentchunks.py b/packages/azure/src/mistralai/azure/client/models/systemmessagecontentchunks.py similarity index 66% rename from packages/mistralai_gcp/src/mistralai_gcp/models/systemmessagecontentchunks.py rename to packages/azure/src/mistralai/azure/client/models/systemmessagecontentchunks.py index e0b5bbc3..225f38b7 100644 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/systemmessagecontentchunks.py +++ b/packages/azure/src/mistralai/azure/client/models/systemmessagecontentchunks.py @@ -3,8 +3,7 @@ from __future__ import annotations from .textchunk import TextChunk, TextChunkTypedDict from .thinkchunk import ThinkChunk, ThinkChunkTypedDict -from mistralai_gcp.utils import get_discriminator -from pydantic import Discriminator, Tag +from pydantic import Field from typing import Union from typing_extensions import Annotated, TypeAliasType @@ -16,6 +15,5 @@ SystemMessageContentChunks = Annotated[ - Union[Annotated[TextChunk, Tag("text")], Annotated[ThinkChunk, Tag("thinking")]], - Discriminator(lambda m: get_discriminator(m, "type", "type")), + Union[TextChunk, ThinkChunk], Field(discriminator="TYPE") ] diff --git a/packages/azure/src/mistralai/azure/client/models/textchunk.py b/packages/azure/src/mistralai/azure/client/models/textchunk.py new file mode 100644 index 00000000..e513c143 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/textchunk.py @@ -0,0 +1,23 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from mistralai.azure.client.types import BaseModel +from mistralai.azure.client.utils import validate_const +import pydantic +from pydantic.functional_validators import AfterValidator +from typing import Literal +from typing_extensions import Annotated, TypedDict + + +class TextChunkTypedDict(TypedDict): + text: str + type: Literal["text"] + + +class TextChunk(BaseModel): + text: str + + TYPE: Annotated[ + Annotated[Literal["text"], AfterValidator(validate_const("text"))], + pydantic.Field(alias="type"), + ] = "text" diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/thinkchunk.py b/packages/azure/src/mistralai/azure/client/models/thinkchunk.py similarity index 65% rename from packages/mistralai_gcp/src/mistralai_gcp/models/thinkchunk.py rename to packages/azure/src/mistralai/azure/client/models/thinkchunk.py index b88c0cb5..e769399f 100644 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/thinkchunk.py +++ b/packages/azure/src/mistralai/azure/client/models/thinkchunk.py @@ -3,9 +3,12 @@ from __future__ import annotations from .referencechunk import ReferenceChunk, ReferenceChunkTypedDict from .textchunk import TextChunk, TextChunkTypedDict -from mistralai_gcp.types import BaseModel +from mistralai.azure.client.types import BaseModel +from mistralai.azure.client.utils import validate_const +import pydantic +from pydantic.functional_validators import AfterValidator from typing import List, Literal, Optional, Union -from typing_extensions import NotRequired, TypeAliasType, TypedDict +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict ThinkingTypedDict = TypeAliasType( @@ -16,20 +19,20 @@ Thinking = TypeAliasType("Thinking", Union[ReferenceChunk, TextChunk]) -ThinkChunkType = Literal["thinking",] - - class ThinkChunkTypedDict(TypedDict): thinking: List[ThinkingTypedDict] + type: Literal["thinking"] closed: NotRequired[bool] r"""Whether the thinking chunk is closed or not. Currently only used for prefixing.""" - type: NotRequired[ThinkChunkType] class ThinkChunk(BaseModel): thinking: List[Thinking] + TYPE: Annotated[ + Annotated[Literal["thinking"], AfterValidator(validate_const("thinking"))], + pydantic.Field(alias="type"), + ] = "thinking" + closed: Optional[bool] = None r"""Whether the thinking chunk is closed or not. Currently only used for prefixing.""" - - type: Optional[ThinkChunkType] = "thinking" diff --git a/packages/mistralai_azure/src/mistralai_azure/models/tool.py b/packages/azure/src/mistralai/azure/client/models/tool.py similarity index 89% rename from packages/mistralai_azure/src/mistralai_azure/models/tool.py rename to packages/azure/src/mistralai/azure/client/models/tool.py index c91deec2..169305bc 100644 --- a/packages/mistralai_azure/src/mistralai_azure/models/tool.py +++ b/packages/azure/src/mistralai/azure/client/models/tool.py @@ -3,7 +3,7 @@ from __future__ import annotations from .function import Function, FunctionTypedDict from .tooltypes import ToolTypes -from mistralai_azure.types import BaseModel +from mistralai.azure.client.types import BaseModel from typing import Optional from typing_extensions import NotRequired, TypedDict diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/toolcall.py b/packages/azure/src/mistralai/azure/client/models/toolcall.py similarity index 92% rename from packages/mistralai_gcp/src/mistralai_gcp/models/toolcall.py rename to packages/azure/src/mistralai/azure/client/models/toolcall.py index 23ef157a..a589b1b3 100644 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/toolcall.py +++ b/packages/azure/src/mistralai/azure/client/models/toolcall.py @@ -3,7 +3,7 @@ from __future__ import annotations from .functioncall import FunctionCall, FunctionCallTypedDict from .tooltypes import ToolTypes -from mistralai_gcp.types import BaseModel +from mistralai.azure.client.types import BaseModel from typing import Optional from typing_extensions import NotRequired, TypedDict diff --git a/packages/mistralai_azure/src/mistralai_azure/models/toolchoice.py b/packages/azure/src/mistralai/azure/client/models/toolchoice.py similarity index 93% rename from packages/mistralai_azure/src/mistralai_azure/models/toolchoice.py rename to packages/azure/src/mistralai/azure/client/models/toolchoice.py index 93b4b7fe..1f623222 100644 --- a/packages/mistralai_azure/src/mistralai_azure/models/toolchoice.py +++ b/packages/azure/src/mistralai/azure/client/models/toolchoice.py @@ -3,7 +3,7 @@ from __future__ import annotations from .functionname import FunctionName, FunctionNameTypedDict from .tooltypes import ToolTypes -from mistralai_azure.types import BaseModel +from mistralai.azure.client.types import BaseModel from typing import Optional from typing_extensions import NotRequired, TypedDict diff --git a/packages/mistralai_azure/src/mistralai_azure/models/toolchoiceenum.py b/packages/azure/src/mistralai/azure/client/models/toolchoiceenum.py similarity index 100% rename from packages/mistralai_azure/src/mistralai_azure/models/toolchoiceenum.py rename to packages/azure/src/mistralai/azure/client/models/toolchoiceenum.py diff --git a/packages/mistralai_azure/src/mistralai_azure/models/toolmessage.py b/packages/azure/src/mistralai/azure/client/models/toolmessage.py similarity index 77% rename from packages/mistralai_azure/src/mistralai_azure/models/toolmessage.py rename to packages/azure/src/mistralai/azure/client/models/toolmessage.py index 4bc5c9a9..a73fd6bf 100644 --- a/packages/mistralai_azure/src/mistralai_azure/models/toolmessage.py +++ b/packages/azure/src/mistralai/azure/client/models/toolmessage.py @@ -2,16 +2,19 @@ from __future__ import annotations from .contentchunk import ContentChunk, ContentChunkTypedDict -from mistralai_azure.types import ( +from mistralai.azure.client.types import ( BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL, ) +from mistralai.azure.client.utils import validate_const +import pydantic from pydantic import model_serializer -from typing import List, Literal, Optional, Union -from typing_extensions import NotRequired, TypeAliasType, TypedDict +from pydantic.functional_validators import AfterValidator +from typing import List, Literal, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict ToolMessageContentTypedDict = TypeAliasType( @@ -22,28 +25,28 @@ ToolMessageContent = TypeAliasType("ToolMessageContent", Union[str, List[ContentChunk]]) -ToolMessageRole = Literal["tool",] - - class ToolMessageTypedDict(TypedDict): content: Nullable[ToolMessageContentTypedDict] + role: Literal["tool"] tool_call_id: NotRequired[Nullable[str]] name: NotRequired[Nullable[str]] - role: NotRequired[ToolMessageRole] class ToolMessage(BaseModel): content: Nullable[ToolMessageContent] + ROLE: Annotated[ + Annotated[Literal["tool"], AfterValidator(validate_const("tool"))], + pydantic.Field(alias="role"), + ] = "tool" + tool_call_id: OptionalNullable[str] = UNSET name: OptionalNullable[str] = UNSET - role: Optional[ToolMessageRole] = "tool" - @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = ["tool_call_id", "name", "role"] + optional_fields = ["tool_call_id", "name"] nullable_fields = ["content", "tool_call_id", "name"] null_default_fields = [] diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/tooltypes.py b/packages/azure/src/mistralai/azure/client/models/tooltypes.py similarity index 77% rename from packages/mistralai_gcp/src/mistralai_gcp/models/tooltypes.py rename to packages/azure/src/mistralai/azure/client/models/tooltypes.py index 8b812ae0..1cce7446 100644 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/tooltypes.py +++ b/packages/azure/src/mistralai/azure/client/models/tooltypes.py @@ -1,7 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from mistralai_gcp.types import UnrecognizedStr +from mistralai.azure.client.types import UnrecognizedStr from typing import Literal, Union diff --git a/packages/mistralai_azure/src/mistralai_azure/models/usageinfo.py b/packages/azure/src/mistralai/azure/client/models/usageinfo.py similarity index 98% rename from packages/mistralai_azure/src/mistralai_azure/models/usageinfo.py rename to packages/azure/src/mistralai/azure/client/models/usageinfo.py index bbe5cdfa..19a6b09f 100644 --- a/packages/mistralai_azure/src/mistralai_azure/models/usageinfo.py +++ b/packages/azure/src/mistralai/azure/client/models/usageinfo.py @@ -1,7 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from mistralai_azure.types import ( +from mistralai.azure.client.types import ( BaseModel, Nullable, OptionalNullable, diff --git a/packages/mistralai_azure/src/mistralai_azure/models/usermessage.py b/packages/azure/src/mistralai/azure/client/models/usermessage.py similarity index 73% rename from packages/mistralai_azure/src/mistralai_azure/models/usermessage.py rename to packages/azure/src/mistralai/azure/client/models/usermessage.py index 85fedb4b..96439c64 100644 --- a/packages/mistralai_azure/src/mistralai_azure/models/usermessage.py +++ b/packages/azure/src/mistralai/azure/client/models/usermessage.py @@ -2,10 +2,13 @@ from __future__ import annotations from .contentchunk import ContentChunk, ContentChunkTypedDict -from mistralai_azure.types import BaseModel, Nullable, UNSET_SENTINEL +from mistralai.azure.client.types import BaseModel, Nullable, UNSET_SENTINEL +from mistralai.azure.client.utils import validate_const +import pydantic from pydantic import model_serializer -from typing import List, Literal, Optional, Union -from typing_extensions import NotRequired, TypeAliasType, TypedDict +from pydantic.functional_validators import AfterValidator +from typing import List, Literal, Union +from typing_extensions import Annotated, TypeAliasType, TypedDict UserMessageContentTypedDict = TypeAliasType( @@ -16,22 +19,22 @@ UserMessageContent = TypeAliasType("UserMessageContent", Union[str, List[ContentChunk]]) -UserMessageRole = Literal["user",] - - class UserMessageTypedDict(TypedDict): content: Nullable[UserMessageContentTypedDict] - role: NotRequired[UserMessageRole] + role: Literal["user"] class UserMessage(BaseModel): content: Nullable[UserMessageContent] - role: Optional[UserMessageRole] = "user" + ROLE: Annotated[ + Annotated[Literal["user"], AfterValidator(validate_const("user"))], + pydantic.Field(alias="role"), + ] = "user" @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = ["role"] + optional_fields = [] nullable_fields = ["content"] null_default_fields = [] diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/validationerror.py b/packages/azure/src/mistralai/azure/client/models/validationerror.py similarity index 90% rename from packages/mistralai_gcp/src/mistralai_gcp/models/validationerror.py rename to packages/azure/src/mistralai/azure/client/models/validationerror.py index 033d4b63..817ecf7a 100644 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/validationerror.py +++ b/packages/azure/src/mistralai/azure/client/models/validationerror.py @@ -1,7 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from mistralai_gcp.types import BaseModel +from mistralai.azure.client.types import BaseModel from typing import List, Union from typing_extensions import TypeAliasType, TypedDict diff --git a/packages/mistralai_azure/src/mistralai_azure/ocr.py b/packages/azure/src/mistralai/azure/client/ocr.py similarity index 97% rename from packages/mistralai_azure/src/mistralai_azure/ocr.py rename to packages/azure/src/mistralai/azure/client/ocr.py index 31e27f6e..098e764b 100644 --- a/packages/mistralai_azure/src/mistralai_azure/ocr.py +++ b/packages/azure/src/mistralai/azure/client/ocr.py @@ -1,10 +1,10 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from .basesdk import BaseSDK -from mistralai_azure import models, utils -from mistralai_azure._hooks import HookContext -from mistralai_azure.types import Nullable, OptionalNullable, UNSET -from mistralai_azure.utils.unmarshal_json_response import unmarshal_json_response +from mistralai.azure.client import models, utils +from mistralai.azure.client._hooks import HookContext +from mistralai.azure.client.types import Nullable, OptionalNullable, UNSET +from mistralai.azure.client.utils.unmarshal_json_response import unmarshal_json_response from typing import Any, List, Mapping, Optional, Union diff --git a/packages/mistralai_azure/src/mistralai_azure/py.typed b/packages/azure/src/mistralai/azure/client/py.typed similarity index 100% rename from packages/mistralai_azure/src/mistralai_azure/py.typed rename to packages/azure/src/mistralai/azure/client/py.typed diff --git a/packages/mistralai_azure/src/mistralai_azure/sdk.py b/packages/azure/src/mistralai/azure/client/sdk.py similarity index 72% rename from packages/mistralai_azure/src/mistralai_azure/sdk.py rename to packages/azure/src/mistralai/azure/client/sdk.py index 04bc7743..879c841d 100644 --- a/packages/mistralai_azure/src/mistralai_azure/sdk.py +++ b/packages/azure/src/mistralai/azure/client/sdk.py @@ -7,32 +7,37 @@ from .utils.retries import RetryConfig import httpx import importlib -from mistralai_azure import models, utils -from mistralai_azure._hooks import SDKHooks -from mistralai_azure.types import OptionalNullable, UNSET +from mistralai.azure.client import models, utils +from mistralai.azure.client._hooks import SDKHooks +from mistralai.azure.client.types import OptionalNullable, UNSET +import sys from typing import Any, Callable, Dict, Optional, TYPE_CHECKING, Union, cast import weakref if TYPE_CHECKING: - from mistralai_azure.chat import Chat - from mistralai_azure.ocr import Ocr + from mistralai.azure.client.chat import Chat + from mistralai.azure.client.ocr import Ocr class MistralAzure(BaseSDK): - r"""Mistral AI API: Our Chat Completion and Embeddings APIs specification. Create your account on [La Plateforme](https://console.mistral.ai) to get access and read the [docs](https://docs.mistral.ai) to learn how to use it.""" + r"""Mistral AI API: Dora OpenAPI schema + + Our Chat Completion and Embeddings APIs specification. Create your account on [La Plateforme](https://console.mistral.ai) to get access and read the [docs](https://docs.mistral.ai) to learn how to use it. + """ chat: "Chat" r"""Chat Completion API.""" ocr: "Ocr" _sub_sdk_map = { - "chat": ("mistralai_azure.chat", "Chat"), - "ocr": ("mistralai_azure.ocr", "Ocr"), + "chat": ("mistralai.azure.client.chat", "Chat"), + "ocr": ("mistralai.azure.client.ocr", "Ocr"), } def __init__( self, - azure_api_key: Union[str, Callable[[], str]], - azure_endpoint: str, + api_key: Union[str, Callable[[], str]], + server: Optional[str] = None, + server_url: Optional[str] = None, url_params: Optional[Dict[str, str]] = None, client: Optional[HttpClient] = None, async_client: Optional[AsyncHttpClient] = None, @@ -42,25 +47,18 @@ def __init__( ) -> None: r"""Instantiates the SDK configuring it with the provided parameters. - :param azure_api_key: The azure_api_key required for authentication - :param azure_endpoint: The Azure AI endpoint URL to use for all methods + :param api_key: The api_key required for authentication + :param server: The server by name to use for all methods + :param server_url: The server URL to use for all methods :param url_params: Parameters to optionally template the server URL with :param client: The HTTP client to use for all synchronous methods :param async_client: The Async HTTP client to use for all asynchronous methods :param retry_config: The retry configuration to use for all supported methods :param timeout_ms: Optional request timeout applied to each operation in milliseconds """ - - # if azure_endpoint doesn't end with `/v1` add it - if not azure_endpoint.endswith("/"): - azure_endpoint += "/" - if not azure_endpoint.endswith("v1/"): - azure_endpoint += "v1/" - server_url = azure_endpoint - client_supplied = True if client is None: - client = httpx.Client() + client = httpx.Client(follow_redirects=True) client_supplied = False assert issubclass( @@ -69,7 +67,7 @@ def __init__( async_client_supplied = True if async_client is None: - async_client = httpx.AsyncClient() + async_client = httpx.AsyncClient(follow_redirects=True) async_client_supplied = False if debug_logger is None: @@ -80,10 +78,11 @@ def __init__( ), "The provided async_client must implement the AsyncHttpClient protocol." security: Any = None - if callable(azure_api_key): - security = lambda: models.Security(api_key=azure_api_key()) # pylint: disable=unnecessary-lambda-assignment + if callable(api_key): + # pylint: disable=unnecessary-lambda-assignment + security = lambda: models.Security(api_key=api_key()) else: - security = models.Security(api_key=azure_api_key) + security = models.Security(api_key=api_key) if server_url is not None: if url_params is not None: @@ -98,11 +97,12 @@ def __init__( async_client_supplied=async_client_supplied, security=security, server_url=server_url, - server=None, + server=server, retry_config=retry_config, timeout_ms=timeout_ms, debug_logger=debug_logger, ), + parent_ref=self, ) hooks = SDKHooks() @@ -127,13 +127,24 @@ def __init__( self.sdk_configuration.async_client_supplied, ) + def dynamic_import(self, modname, retries=3): + for attempt in range(retries): + try: + return importlib.import_module(modname) + except KeyError: + # Clear any half-initialized module and retry + sys.modules.pop(modname, None) + if attempt == retries - 1: + break + raise KeyError(f"Failed to import module '{modname}' after {retries} attempts") + def __getattr__(self, name: str): if name in self._sub_sdk_map: module_path, class_name = self._sub_sdk_map[name] try: - module = importlib.import_module(module_path) + module = self.dynamic_import(module_path) klass = getattr(module, class_name) - instance = klass(self.sdk_configuration) + instance = klass(self.sdk_configuration, parent_ref=self) setattr(self, name, instance) return instance except ImportError as e: diff --git a/packages/mistralai_gcp/src/mistralai_gcp/sdkconfiguration.py b/packages/azure/src/mistralai/azure/client/sdkconfiguration.py similarity index 93% rename from packages/mistralai_gcp/src/mistralai_gcp/sdkconfiguration.py rename to packages/azure/src/mistralai/azure/client/sdkconfiguration.py index cf85c47e..919225f9 100644 --- a/packages/mistralai_gcp/src/mistralai_gcp/sdkconfiguration.py +++ b/packages/azure/src/mistralai/azure/client/sdkconfiguration.py @@ -9,8 +9,8 @@ from .httpclient import AsyncHttpClient, HttpClient from .utils import Logger, RetryConfig, remove_suffix from dataclasses import dataclass -from mistralai_gcp import models -from mistralai_gcp.types import OptionalNullable, UNSET +from mistralai.azure.client import models +from mistralai.azure.client.types import OptionalNullable, UNSET from pydantic import Field from typing import Callable, Dict, Optional, Tuple, Union diff --git a/packages/mistralai_azure/src/mistralai_azure/types/__init__.py b/packages/azure/src/mistralai/azure/client/types/__init__.py similarity index 100% rename from packages/mistralai_azure/src/mistralai_azure/types/__init__.py rename to packages/azure/src/mistralai/azure/client/types/__init__.py diff --git a/packages/mistralai_azure/src/mistralai_azure/types/basemodel.py b/packages/azure/src/mistralai/azure/client/types/basemodel.py similarity index 100% rename from packages/mistralai_azure/src/mistralai_azure/types/basemodel.py rename to packages/azure/src/mistralai/azure/client/types/basemodel.py diff --git a/packages/mistralai_azure/src/mistralai_azure/utils/__init__.py b/packages/azure/src/mistralai/azure/client/utils/__init__.py similarity index 100% rename from packages/mistralai_azure/src/mistralai_azure/utils/__init__.py rename to packages/azure/src/mistralai/azure/client/utils/__init__.py diff --git a/packages/mistralai_azure/src/mistralai_azure/utils/annotations.py b/packages/azure/src/mistralai/azure/client/utils/annotations.py similarity index 100% rename from packages/mistralai_azure/src/mistralai_azure/utils/annotations.py rename to packages/azure/src/mistralai/azure/client/utils/annotations.py diff --git a/packages/mistralai_azure/src/mistralai_azure/utils/datetimes.py b/packages/azure/src/mistralai/azure/client/utils/datetimes.py similarity index 100% rename from packages/mistralai_azure/src/mistralai_azure/utils/datetimes.py rename to packages/azure/src/mistralai/azure/client/utils/datetimes.py diff --git a/packages/mistralai_azure/src/mistralai_azure/utils/enums.py b/packages/azure/src/mistralai/azure/client/utils/enums.py similarity index 100% rename from packages/mistralai_azure/src/mistralai_azure/utils/enums.py rename to packages/azure/src/mistralai/azure/client/utils/enums.py diff --git a/packages/mistralai_azure/src/mistralai_azure/utils/eventstreaming.py b/packages/azure/src/mistralai/azure/client/utils/eventstreaming.py similarity index 100% rename from packages/mistralai_azure/src/mistralai_azure/utils/eventstreaming.py rename to packages/azure/src/mistralai/azure/client/utils/eventstreaming.py diff --git a/packages/mistralai_azure/src/mistralai_azure/utils/forms.py b/packages/azure/src/mistralai/azure/client/utils/forms.py similarity index 100% rename from packages/mistralai_azure/src/mistralai_azure/utils/forms.py rename to packages/azure/src/mistralai/azure/client/utils/forms.py diff --git a/packages/mistralai_azure/src/mistralai_azure/utils/headers.py b/packages/azure/src/mistralai/azure/client/utils/headers.py similarity index 100% rename from packages/mistralai_azure/src/mistralai_azure/utils/headers.py rename to packages/azure/src/mistralai/azure/client/utils/headers.py diff --git a/packages/mistralai_azure/src/mistralai_azure/utils/logger.py b/packages/azure/src/mistralai/azure/client/utils/logger.py similarity index 100% rename from packages/mistralai_azure/src/mistralai_azure/utils/logger.py rename to packages/azure/src/mistralai/azure/client/utils/logger.py diff --git a/packages/mistralai_azure/src/mistralai_azure/utils/metadata.py b/packages/azure/src/mistralai/azure/client/utils/metadata.py similarity index 100% rename from packages/mistralai_azure/src/mistralai_azure/utils/metadata.py rename to packages/azure/src/mistralai/azure/client/utils/metadata.py diff --git a/packages/mistralai_azure/src/mistralai_azure/utils/queryparams.py b/packages/azure/src/mistralai/azure/client/utils/queryparams.py similarity index 100% rename from packages/mistralai_azure/src/mistralai_azure/utils/queryparams.py rename to packages/azure/src/mistralai/azure/client/utils/queryparams.py diff --git a/packages/mistralai_azure/src/mistralai_azure/utils/requestbodies.py b/packages/azure/src/mistralai/azure/client/utils/requestbodies.py similarity index 100% rename from packages/mistralai_azure/src/mistralai_azure/utils/requestbodies.py rename to packages/azure/src/mistralai/azure/client/utils/requestbodies.py diff --git a/packages/mistralai_azure/src/mistralai_azure/utils/retries.py b/packages/azure/src/mistralai/azure/client/utils/retries.py similarity index 100% rename from packages/mistralai_azure/src/mistralai_azure/utils/retries.py rename to packages/azure/src/mistralai/azure/client/utils/retries.py diff --git a/packages/mistralai_azure/src/mistralai_azure/utils/security.py b/packages/azure/src/mistralai/azure/client/utils/security.py similarity index 100% rename from packages/mistralai_azure/src/mistralai_azure/utils/security.py rename to packages/azure/src/mistralai/azure/client/utils/security.py diff --git a/packages/mistralai_azure/src/mistralai_azure/utils/serializers.py b/packages/azure/src/mistralai/azure/client/utils/serializers.py similarity index 100% rename from packages/mistralai_azure/src/mistralai_azure/utils/serializers.py rename to packages/azure/src/mistralai/azure/client/utils/serializers.py diff --git a/packages/mistralai_azure/src/mistralai_azure/utils/unmarshal_json_response.py b/packages/azure/src/mistralai/azure/client/utils/unmarshal_json_response.py similarity index 95% rename from packages/mistralai_azure/src/mistralai_azure/utils/unmarshal_json_response.py rename to packages/azure/src/mistralai/azure/client/utils/unmarshal_json_response.py index f5813119..5317ac87 100644 --- a/packages/mistralai_azure/src/mistralai_azure/utils/unmarshal_json_response.py +++ b/packages/azure/src/mistralai/azure/client/utils/unmarshal_json_response.py @@ -5,7 +5,7 @@ import httpx from .serializers import unmarshal_json -from mistralai_azure import models +from mistralai.azure.client import models T = TypeVar("T") diff --git a/packages/mistralai_azure/src/mistralai_azure/utils/url.py b/packages/azure/src/mistralai/azure/client/utils/url.py similarity index 100% rename from packages/mistralai_azure/src/mistralai_azure/utils/url.py rename to packages/azure/src/mistralai/azure/client/utils/url.py diff --git a/packages/mistralai_azure/src/mistralai_azure/utils/values.py b/packages/azure/src/mistralai/azure/client/utils/values.py similarity index 100% rename from packages/mistralai_azure/src/mistralai_azure/utils/values.py rename to packages/azure/src/mistralai/azure/client/utils/values.py diff --git a/packages/mistralai_azure/uv.lock b/packages/azure/uv.lock similarity index 99% rename from packages/mistralai_azure/uv.lock rename to packages/azure/uv.lock index a227d093..cedb1ce8 100644 --- a/packages/mistralai_azure/uv.lock +++ b/packages/azure/uv.lock @@ -154,7 +154,7 @@ wheels = [ [[package]] name = "mistralai-azure" -version = "1.8.0" +version = "2.0.0a4" source = { editable = "." } dependencies = [ { name = "httpcore" }, diff --git a/packages/gcp/.genignore b/packages/gcp/.genignore new file mode 100644 index 00000000..9a119b75 --- /dev/null +++ b/packages/gcp/.genignore @@ -0,0 +1,6 @@ +pyproject.toml +src/mistralai/gcp/client/sdk.py +src/mistralai/gcp/client/_hooks/registration.py +README.md +USAGE.md +docs/sdks/**/README.md diff --git a/packages/mistralai_gcp/.gitattributes b/packages/gcp/.gitattributes similarity index 100% rename from packages/mistralai_gcp/.gitattributes rename to packages/gcp/.gitattributes diff --git a/packages/mistralai_gcp/.gitignore b/packages/gcp/.gitignore similarity index 100% rename from packages/mistralai_gcp/.gitignore rename to packages/gcp/.gitignore diff --git a/packages/mistralai_gcp/.speakeasy/gen.lock b/packages/gcp/.speakeasy/gen.lock similarity index 55% rename from packages/mistralai_gcp/.speakeasy/gen.lock rename to packages/gcp/.speakeasy/gen.lock index 31eb1bc7..397a5fec 100644 --- a/packages/mistralai_gcp/.speakeasy/gen.lock +++ b/packages/gcp/.speakeasy/gen.lock @@ -1,24 +1,25 @@ lockVersion: 2.0.0 id: ec60f2d8-7869-45c1-918e-773d41a8cf74 management: - docChecksum: d91fd326da9118e6c9dddea48eaf47a7 + docChecksum: 9594c5b1f8b00d641a6ff9fe47796331 docVersion: 1.0.0 speakeasyVersion: 1.685.0 generationVersion: 2.794.1 - releaseVersion: 1.8.0 - configChecksum: 42a1e5752a774fcdb0a5949bd6535933 + releaseVersion: 2.0.0a4 + configChecksum: 95fb33ae488fa72fb4ba17c6b93551a9 repoURL: https://github.com/mistralai/client-python.git - repoSubDirectory: packages/mistralai_gcp - installationURL: https://github.com/mistralai/client-python.git#subdirectory=packages/mistralai_gcp + repoSubDirectory: packages/gcp + installationURL: https://github.com/mistralai/client-python.git#subdirectory=packages/gcp published: true persistentEdits: - generation_id: e1cf1217-2a08-4cb8-b92c-542b4f885caa - pristine_commit_hash: 57fe0df69b76fe4754f039d49f7c40770fb3097d - pristine_tree_hash: c4c1037865fb86650ada485b300f96784045922f + generation_id: 2815a95b-4223-417a-9e29-8183faa24193 + pristine_commit_hash: 8fe2243e1f88aba66f47b144c6eeca70d930c059 + pristine_tree_hash: c151bcbea517886a35e9885d8643944d5963c7da features: python: additionalDependencies: 1.0.0 additionalProperties: 1.0.1 + configurableModuleName: 0.2.0 constsAndDefaults: 1.0.5 core: 5.23.18 defaultEnabledRetries: 0.2.0 @@ -57,16 +58,12 @@ trackedFiles: pristine_git_object: 2e54e27e0ca97bee87918b2ae38cc6c335669a79 docs/models/assistantmessage.md: id: 7e0218023943 - last_write_checksum: sha1:e75d407349842b2de46ee3ca6250f9f51121cf38 - pristine_git_object: 3d0bd90b4433c1a919f917f4bcf2518927cdcd50 + last_write_checksum: sha1:47d5cd1a1bef9e398c12c207f5b3d8486d94f359 + pristine_git_object: 9ef638379aee1198742743800e778409c47a9b9d docs/models/assistantmessagecontent.md: id: 9f1795bbe642 last_write_checksum: sha1:1ce4066623a8d62d969e5ed3a088d73a9ba26643 pristine_git_object: 047b7cf95f4db203bf2c501680b73ca0562a122d - docs/models/assistantmessagerole.md: - id: bb5d2a4bc72f - last_write_checksum: sha1:82f2c4f469426bd476c1003a91394afb89cb7c91 - pristine_git_object: 658229e77eb6419391cf7941568164541c528387 docs/models/chatcompletionchoice.md: id: 0d15c59ab501 last_write_checksum: sha1:a6274a39a4239e054816d08517bf8507cb5c4564 @@ -77,12 +74,12 @@ trackedFiles: pristine_git_object: b2f15ecbe88328de95b4961ddb3940fd8a6ee64b docs/models/chatcompletionrequest.md: id: adffe90369d0 - last_write_checksum: sha1:1ac7d6b5a8aba9c922cf5fe45f94aee55228f9db - pristine_git_object: 6886f9dcd43e8d61f4ec6692235f281cb03a5c86 - docs/models/chatcompletionrequestmessages.md: - id: ec996b350e12 - last_write_checksum: sha1:2ecec8d12cdb48426f4eb62732066fc79fcd4ec3 - pristine_git_object: bc7708a67f06d74e8a5bf1facb2b23fb1e08053c + last_write_checksum: sha1:2bf5152388f18436be4fe1c541b8d423dcae175c + pristine_git_object: 61a25d86e7dc292621f7f6c0f8909137a16b9112 + docs/models/chatcompletionrequestmessage.md: + id: 3f5e170d418c + last_write_checksum: sha1:7921c5a508a9f88adc01caab34e26182b8035607 + pristine_git_object: 91e9e062d0ef0cb69235c4ae4516548733ce28a9 docs/models/chatcompletionrequeststop.md: id: fcaf5bbea451 last_write_checksum: sha1:71a25f84f0d88c7acf72e801ced6159546201851 @@ -97,8 +94,16 @@ trackedFiles: pristine_git_object: a0465ffbfc5558628953e03fbc53b80bbdc8649b docs/models/chatcompletionstreamrequest.md: id: cf8f29558a68 - last_write_checksum: sha1:33778fdf71aa9b934ae48d51664daaa0dd817e04 - pristine_git_object: ff1940dd8a92d7892d895c3fc0e0a4b321e55534 + last_write_checksum: sha1:f30b2a7353e7406eb30af841a1a211ea5cb30cb0 + pristine_git_object: 3e790e7dc7143b0ae287ad2df14ae7e7a4085e3f + docs/models/chatcompletionstreamrequestmessage.md: + id: 053a98476cd2 + last_write_checksum: sha1:8270692463fab1243d9de4bbef7162daa64e52c5 + pristine_git_object: 2e4e93acca8983a3ea27b391d4606518946e13fe + docs/models/chatcompletionstreamrequeststop.md: + id: d0e89a4dca78 + last_write_checksum: sha1:a889e9580fa94bda7c848682d6ba501b7f5c0f41 + pristine_git_object: a48460a92ac47fec1de2188ba46b238229736d32 docs/models/chatcompletionstreamrequesttoolchoice.md: id: 210d5e5b1413 last_write_checksum: sha1:0543164caf3f4fb2bef3061dbd1a5e6b34b17ae9 @@ -113,20 +118,24 @@ trackedFiles: pristine_git_object: 7a66e8fee2bb0f1c58166177653893bb05b98f1d docs/models/completionresponsestreamchoice.md: id: d56824d615a6 - last_write_checksum: sha1:dcf4b125b533192cb5aea1a68551866954712dc5 - pristine_git_object: c807dacd98eb3561ee45f40db71a92cb72b0f6de - docs/models/content.md: - id: bfd859c99f86 - last_write_checksum: sha1:6673dbd19871a701955a322348a4f7e51c38ffc8 - pristine_git_object: a833dc2c6043e36b85131c9243b4cc02b9fcc4c6 + last_write_checksum: sha1:0296a490df009dbfd04893fdebcc88dd6102a872 + pristine_git_object: 1532c25b8fc065d486f52d4610a7f757e5340875 + docs/models/completionresponsestreamchoicefinishreason.md: + id: 5f1fbfc90b8e + last_write_checksum: sha1:20824b4a223cbd3658b32440973a7d47dcd108b9 + pristine_git_object: 0fece473297227c75db4e7ded63417a2f117cac0 docs/models/contentchunk.md: id: d2d3a32080cd last_write_checksum: sha1:5839a26cdc412b78caad7fb59df97bdcea57be6d pristine_git_object: 22023e8b19692df969693b7a14f8cf6e0143859f docs/models/deltamessage.md: id: 6c5ed6b60968 - last_write_checksum: sha1:c213149256c620715d744c89685d5b6cbdea6f58 - pristine_git_object: 61deabbf7e37388fdd4c1789089d120cc0b937b9 + last_write_checksum: sha1:00052476b9b2474dbc149f18dd18c71c86d0fc74 + pristine_git_object: e0ee575f3fce7c312114ce8c5390efc5c4854952 + docs/models/deltamessagecontent.md: + id: 7307bedc8733 + last_write_checksum: sha1:a1211b8cb576ad1358e68983680ee326c3920a5e + pristine_git_object: 8142772d7ea33ad8a75cf9cf822564ba3f630de2 docs/models/fimcompletionrequest.md: id: b44677ecc293 last_write_checksum: sha1:24bcb54d39b3fabd487549a27b4c0a65dd5ffe50 @@ -147,10 +156,6 @@ trackedFiles: id: c97a11b764e9 last_write_checksum: sha1:958d5087050fdeb128745884ebcf565b4fdc3886 pristine_git_object: 5a9e2ff020d4939f7fd42c0673ea7bdd16cca99d - docs/models/finishreason.md: - id: 73315c2a39b3 - last_write_checksum: sha1:5b58c7fa9219f728b9731287e21abe1be9f11e4a - pristine_git_object: 45a5aedb7241cf080df3eb976a4413064d314009 docs/models/function.md: id: 416a80fba031 last_write_checksum: sha1:a9485076d430a7753558461ce87bf42d09e34511 @@ -173,16 +178,12 @@ trackedFiles: pristine_git_object: 7c2bcbc36e99c3cf467d213d6a6a59d6300433d8 docs/models/imageurlchunk.md: id: 4407097bfff3 - last_write_checksum: sha1:7a478fd638234ece78770c7fc5e8d0adaf1c3727 - pristine_git_object: f1b926ef8e82443aa1446b1c64c2f02e33d7c789 - docs/models/imageurlchunkimageurl.md: - id: c7fae88454ce - last_write_checksum: sha1:5eff71b7a8be7baacb9ba8ca0be0a0f7a391a325 - pristine_git_object: 767389082d25f06e617fec2ef0134dd9fb2d4064 - docs/models/imageurlchunktype.md: - id: b9af2db9ff60 - last_write_checksum: sha1:990546f94648a09faf9d3ae55d7f6ee66de13e85 - pristine_git_object: 2064a0b405870313bd4b802a3b1988418ce8439e + last_write_checksum: sha1:30b72826963e22cadf76ac0b7604288dbc4fb943 + pristine_git_object: a84dac32b99390e3fd0559714ca43795742192c6 + docs/models/imageurlunion.md: + id: 9d3c691a9db0 + last_write_checksum: sha1:4e32bcd7d44746d2ddbfafbef96152bb2bdb2a15 + pristine_git_object: db97130f26199dcb354ecb7469d09530b035daa2 docs/models/jsonschema.md: id: a6b15ed6fac8 last_write_checksum: sha1:523465666ad3c292252b3fe60f345c7ffb29053f @@ -191,10 +192,6 @@ trackedFiles: id: b071d5a509cc last_write_checksum: sha1:09a04749333ab50ae806c3ac6adcaa90d54df0f1 pristine_git_object: d6094ac2c6e0326c039dad2f6b89158694ef6aa7 - docs/models/messages.md: - id: 2103cd675c2f - last_write_checksum: sha1:f6940c9c67b98c49ae2bc2764f6c14178321f244 - pristine_git_object: 1d394500e8ffdd140457575568fc2ce465a1cc3a docs/models/mistralpromptmode.md: id: d17d5db4d3b6 last_write_checksum: sha1:abcb7205c5086169c7d9449d15ac142448a7d258 @@ -205,12 +202,8 @@ trackedFiles: pristine_git_object: fae3c1ca4ba2c2ddb3b7de401ecdc8d56dcc7740 docs/models/referencechunk.md: id: 07895f9debfd - last_write_checksum: sha1:97d01dd2b907e87b58bebd9c950e1bef29747c89 - pristine_git_object: a132ca2fe6fbbaca644491cbc36d88b0c67cc6bc - docs/models/referencechunktype.md: - id: 0944b80ea9c8 - last_write_checksum: sha1:956b270766c7f11fe99f4a9b484cc29c159e7471 - pristine_git_object: 1e0e2fe64883ef5f3e628777b261b1224661d257 + last_write_checksum: sha1:4384049375a2566c7567599f97ce1ec19e9f6276 + pristine_git_object: d847e24845a399c7ca93d54701832fb65e01b3ab docs/models/responseformat.md: id: 50a1e4140614 last_write_checksum: sha1:e877b2e81470ef5eec5675dfb91a47e74d5d3add @@ -219,22 +212,14 @@ trackedFiles: id: cf1f250b82db last_write_checksum: sha1:105e1f9181913104b554051838cbdd0f728aa2c4 pristine_git_object: 2f5f1e5511b048323fee18a0ffdd506fe2b3d56f - docs/models/role.md: - id: b694540a5b1e - last_write_checksum: sha1:260a50c56a8bd03cc535edf98ebec06437f87f8d - pristine_git_object: affca78d5574cc42d8e6169f21968e5a8765e053 docs/models/security.md: id: 452e4d4eb67a last_write_checksum: sha1:ce2871b49c1632d50e22d0b1ebe4999021d52313 pristine_git_object: c698674c513f5b20c04f629e50154e67977275f7 - docs/models/stop.md: - id: f231cc9f5041 - last_write_checksum: sha1:86903cac5f57ad9b8ac07ecba6c454d40a53bdc8 - pristine_git_object: ba40ca83136d6d6cb4f1ef9e5ca3104a704e4846 docs/models/systemmessage.md: id: fdb7963e1cdf - last_write_checksum: sha1:97e726dff19a39b468767d5c01fc6256277ee71f - pristine_git_object: 0dba71c00f40c85e74b2c1967e077ffff9660f13 + last_write_checksum: sha1:c7603c5ce77ba2bcbda9eff65eeafdb1e9ecbec7 + pristine_git_object: 10bda10f921fb5d66c1606ff18e654b4e78ab197 docs/models/systemmessagecontent.md: id: 94a56febaeda last_write_checksum: sha1:6cb10b4b860b4204df57a29c650c85c826395aeb @@ -245,16 +230,12 @@ trackedFiles: pristine_git_object: 40030c170746d9953d25b979ab7e6f522018e230 docs/models/textchunk.md: id: 6cd12e0ef110 - last_write_checksum: sha1:6d41d1991d122805734ed0d90ee01592aa5ae6ff - pristine_git_object: 6daab3c381bd8c13d2935bf62578648a8470fc76 + last_write_checksum: sha1:aa448d4937c0c1cd562621f0a9080aa0dc6e4bd1 + pristine_git_object: b266619dcb57222ec343f373c43b2b5cef5b8b93 docs/models/thinkchunk.md: id: bca24d7153f6 - last_write_checksum: sha1:feb95a931bb9cdbfe28ab351618687e513cf830b - pristine_git_object: 66b2e0cde70e25e2927180d2e709503401fddeab - docs/models/thinkchunktype.md: - id: 0fbeed985341 - last_write_checksum: sha1:790f991f95c86c26a6abb9c9c5debda8b53526f5 - pristine_git_object: baf6f755252d027295be082b53ecf80555039414 + last_write_checksum: sha1:2b8ff7737fa7255673ca31da7cb2e6803fce9e02 + pristine_git_object: b07f598ebc5f0e9c041186c081dc98bc21104bdb docs/models/thinking.md: id: 07234f8dd364 last_write_checksum: sha1:a5962d1615b57996730da19e59fbfaa684321442 @@ -277,40 +258,28 @@ trackedFiles: pristine_git_object: 0be3d6c54b13a8bf30773398a2c12e0d30d3ae58 docs/models/toolmessage.md: id: 0553747c37a1 - last_write_checksum: sha1:3ac87031fdd4ba8b0996e95be8e7ef1a7ff41167 - pristine_git_object: a54f49332c2873471759b477fb4c712fa4fb61f5 + last_write_checksum: sha1:ac61e644ba7c6da607cb479eafd1db78d8e8012e + pristine_git_object: 7201481e61e269b238887deec30c03f7e16c53d7 docs/models/toolmessagecontent.md: id: f0522d2d3c93 last_write_checksum: sha1:783769c0200baa1b6751327aa3e009fa83da72ee pristine_git_object: 5c76091fbd2c8e0d768921fab19c7b761df73411 - docs/models/toolmessagerole.md: - id: f333d4d1ab56 - last_write_checksum: sha1:7e1c004bad24e928da0c286a9f053516b172d24f - pristine_git_object: c24e59c0c79ea886d266e38c673edd51531b9be6 docs/models/tooltypes.md: id: adb50fe63ea2 last_write_checksum: sha1:f224c3d8732450b9c969b3e04027b7df7892694c pristine_git_object: 84e49253c9b9bd1bd314e2a126106404cbb52f16 - docs/models/type.md: - id: 98c32f09b2c8 - last_write_checksum: sha1:8aa9ca999e9648ddc2240bf80780684e3e858ddf - pristine_git_object: eb0581e7174b6951d69c485a64af5244cb8687fa docs/models/usageinfo.md: id: ec6fe65028a9 last_write_checksum: sha1:cf71fb9676d870eba7c4d10a69636e1db4054adc pristine_git_object: f5204ac94a4d6191839031c66c5a9bc0124a1f35 docs/models/usermessage.md: id: ed66d7a0f80b - last_write_checksum: sha1:8291f7703e49ed669775dc953ea8cab6715dc7ed - pristine_git_object: 63b0131091cd211b3b1477c1d63b5666a26db546 + last_write_checksum: sha1:f0ed7d9cb7264f1d9e4a9190772df3f15e25346c + pristine_git_object: e7a932ed71496fa7cc358388c650d25f166f27a4 docs/models/usermessagecontent.md: id: 52c072c851e8 last_write_checksum: sha1:1de02bcf7082768ebe1bb912fdbebbec5a577b5a pristine_git_object: 8350f9e8f8996c136093e38760990f62fd01f8cf - docs/models/usermessagerole.md: - id: 99ffa937c462 - last_write_checksum: sha1:52014480516828b43827aa966b7319d9074f1111 - pristine_git_object: 171124e45988e784c56a6b92a0057ba00efc0db4 docs/models/utils/retryconfig.md: id: 4343ac43161c last_write_checksum: sha1:562c0f21e308ad10c27f85f75704c15592c6929d @@ -329,320 +298,320 @@ trackedFiles: pristine_git_object: a8fcb932ba2a01c5e96e3b04c59371e930b75558 scripts/prepare_readme.py: id: e0c5957a6035 - last_write_checksum: sha1:81c7dbabc0e726a4a150e6ef1bcba578d3f1153d - pristine_git_object: 6c4b993238c1a60d4df4bb7de0a0b0a82e385dbf + last_write_checksum: sha1:eb988bc0e00ed4bb14e9a3572845af14f06c9b42 + pristine_git_object: ae27b555c05c3c9f35d84e8bbe6a7c9f80cf94b2 scripts/publish.sh: id: fe273b08f514 last_write_checksum: sha1:b290b25b36dca3d5eb1a2e66a2e1bcf2e7326cf3 pristine_git_object: c35748f360329c2bc370e9b189f49b1a360b2c48 - src/mistralai_gcp/__init__.py: - id: b6565f49e73b + src/mistralai/gcp/client/__init__.py: + id: 4f63decd432e last_write_checksum: sha1:36306d1d404b6aeb912d27f1d9c52f098ff7bf9b pristine_git_object: dd02e42e4cc509dc90e6ae70493054021faa5f9c - src/mistralai_gcp/_hooks/__init__.py: - id: 663f3129700b + src/mistralai/gcp/client/_hooks/__init__.py: + id: adcb191838d1 last_write_checksum: sha1:e3111289afd28ad557c21d9e2f918caabfb7037d pristine_git_object: 2ee66cdd592fe41731c24ddd407c8ca31c50aec1 - src/mistralai_gcp/_hooks/sdkhooks.py: - id: 46ab7e644296 - last_write_checksum: sha1:a2c018871bea47706a76b03d9a17dab717c339c0 - pristine_git_object: b81c2a2739d316cfed54daec48df6375155eb802 - src/mistralai_gcp/_hooks/types.py: - id: 1f77198243ec - last_write_checksum: sha1:fbf5f1fb258b75133c6b12ae688c03c18b2debd5 - pristine_git_object: f8088f4c26d3ae27202c716c80c391d4daed4156 - src/mistralai_gcp/_version.py: - id: 4e2b8c406f49 - last_write_checksum: sha1:18c7db41065d76e733dc84c997f2a7808892a7c7 - pristine_git_object: a170f0ab6d229979b9077477809b10f2774a0144 - src/mistralai_gcp/basesdk.py: - id: b84fa6111b69 - last_write_checksum: sha1:41381dd799bd5e1f8a15bb65a0672dc6cc4796c4 - pristine_git_object: 7a93de23ad83096b2392e05b11f29030b5961456 - src/mistralai_gcp/chat.py: - id: 1cc7d54332ba - last_write_checksum: sha1:b4b4db3cfeac555718e2d74e897c6ba22b07a672 - pristine_git_object: 3dd6040fc7a565ffc4854bcc25e1e24a6683896d - src/mistralai_gcp/fim.py: - id: 1e5bec08157c - last_write_checksum: sha1:2c27170c5932893d4e8bec8ce45b2dc6e0957cd6 - pristine_git_object: 36d9fd60baaad606d9d57a30afdd9566b06b4caa - src/mistralai_gcp/httpclient.py: - id: 7de4ac861042 + src/mistralai/gcp/client/_hooks/sdkhooks.py: + id: 7e23394c3f65 + last_write_checksum: sha1:4a03a16da35168f25ed0cccfdb0d4c4d86bbe242 + pristine_git_object: 2af4deeda8055f4c57c0c7f00a7b79033435cf34 + src/mistralai/gcp/client/_hooks/types.py: + id: 4f37fd18bfd9 + last_write_checksum: sha1:2b295cc28d5fa2c79495510c8b97a1ea60f993e0 + pristine_git_object: ea95bed210db9180824efddfb1b3e47f5bf96489 + src/mistralai/gcp/client/_version.py: + id: f87319e32c7b + last_write_checksum: sha1:8c07e6351bf2df8239b3c02db75ee469dba53394 + pristine_git_object: ba48dac120cadd3f586b38659dc04e50838daa11 + src/mistralai/gcp/client/basesdk.py: + id: 4d594572857b + last_write_checksum: sha1:45ed4b6078e01d52d1dcf4bdc5494b700f1a6cde + pristine_git_object: 6f9f5fd9a2cadc8893d6693c1d40a8114c0fdc2a + src/mistralai/gcp/client/chat.py: + id: 4c41f05f786e + last_write_checksum: sha1:a4d5609f51dee25dfc34f83e1eda2888aa01dda6 + pristine_git_object: 78541248204cbd5b92b6d6d362924fcdada8a948 + src/mistralai/gcp/client/fim.py: + id: 13d2d208e0ef + last_write_checksum: sha1:e6226c1720effd314afa7b9a21e5ec2347e5a74f + pristine_git_object: e2acacd58c28fa7ea718240b01a3714f7fc0b8f6 + src/mistralai/gcp/client/httpclient.py: + id: a53dd7be6a4c last_write_checksum: sha1:5e55338d6ee9f01ab648cad4380201a8a3da7dd7 pristine_git_object: 89560b566073785535643e694c112bedbd3db13d - src/mistralai_gcp/models/__init__.py: - id: 9a7b2a1f0dba - last_write_checksum: sha1:54654df1aecc8d4f634ebd4dbcb0fed16da80309 - pristine_git_object: fe85b133a3a7652cfcfd3b44074be3729c8a9b7b - src/mistralai_gcp/models/assistantmessage.py: - id: 0779dd85c548 - last_write_checksum: sha1:ccf5d6a93bf007d47f0415320afb047278e10172 - pristine_git_object: 17d740b6eeb433b2865a652d1dd760227ad38191 - src/mistralai_gcp/models/chatcompletionchoice.py: - id: b5843c853153 - last_write_checksum: sha1:d389ddcfb64980b6c56a42d53bce7c63e26cc569 - pristine_git_object: fe3ee952a207f772ec49972cbd30f83654c84ad9 - src/mistralai_gcp/models/chatcompletionrequest.py: - id: 42d6cdf4646f - last_write_checksum: sha1:9685d594f13e8500e9c7fbab1e0d4042fccfc23d - pristine_git_object: 80345f9d956f64396f48850641842b2a3a6f8bee - src/mistralai_gcp/models/chatcompletionresponse.py: - id: 14720f23411e - last_write_checksum: sha1:46f14c3e00d21e9f01756f111d353768ad939494 - pristine_git_object: a7953eb156cc8185d70f92df8a75a2ebb77840b9 - src/mistralai_gcp/models/chatcompletionstreamrequest.py: - id: 2e17680adc7e - last_write_checksum: sha1:37c2daaad5c557234b5f067152280440f4c96933 - pristine_git_object: e857d51522dc9964cde865d7f681bd856a3cbdaf - src/mistralai_gcp/models/completionchunk.py: - id: 7fa670acf4b8 - last_write_checksum: sha1:0d0fdb8efda7f0b6a8ff376b7da94cac8060e4e2 - pristine_git_object: ca002f52239f69b96dd967b5e91cb4ed544e51d0 - src/mistralai_gcp/models/completionevent.py: - id: c25e6676e263 - last_write_checksum: sha1:528f13beedc9befc6fb71d4f9f2a2d4ff5e91817 - pristine_git_object: 33278c119c62205b8d9b09297066dc61c2a86cd1 - src/mistralai_gcp/models/completionresponsestreamchoice.py: - id: 46946832a23e - last_write_checksum: sha1:bc42569eb80dc034a1bde9170c35e6bc4ff52bb8 - pristine_git_object: ec9df52818fabf6bef33094bc7d25398066df3af - src/mistralai_gcp/models/contentchunk.py: - id: 96dd7160dff7 - last_write_checksum: sha1:484722b90615ca7af20993c570de79fe990a50f2 - pristine_git_object: da5671e348d363927af77188da6af07240398826 - src/mistralai_gcp/models/deltamessage.py: - id: db6c3c4d3384 - last_write_checksum: sha1:e596610fa0dd100203cd7e515750782bfbdb0445 - pristine_git_object: 1801ac76522df2efc362712d46262aeba95abc87 - src/mistralai_gcp/models/fimcompletionrequest.py: - id: ed8593c435af - last_write_checksum: sha1:6561263425e385568189ffc61e6b00034136adc3 - pristine_git_object: bcc97c90d4d327c83666423317dae2dc90db3b82 - src/mistralai_gcp/models/fimcompletionresponse.py: - id: 5f85a7cdb5fd - last_write_checksum: sha1:3ac2057157c7d1cb1bfc81fca2915ba72546f968 - pristine_git_object: e1940b0a2290fc3f9afcbd9e945397b1b90660ec - src/mistralai_gcp/models/fimcompletionstreamrequest.py: - id: f17c4f8fa580 - last_write_checksum: sha1:ebbe89e576d498070fde6b195d5afa2dc8bd5eac - pristine_git_object: 34d2ba65682b971f675f427cdf3aa6539071ce3a - src/mistralai_gcp/models/function.py: - id: 4612d6f83b9a - last_write_checksum: sha1:7692ea8102475e4d82d83722a8aea1efde668774 - pristine_git_object: 7ad1ae645f99ab13c022c92e7733ff4b15d39cac - src/mistralai_gcp/models/functioncall.py: - id: a3ca765a9368 - last_write_checksum: sha1:e044de5b26b15d46dce8ad8bd0d13bdf3d24ef7d - pristine_git_object: 99554c8862922184a05074bf01f71fbe20ac8fea - src/mistralai_gcp/models/functionname.py: - id: f97eb2c1bae3 - last_write_checksum: sha1:6343e5b4f724db6088c2055b058a9ebdd9bda995 - pristine_git_object: 00ec22f5ca6ff2d68d5cce2a020846a672ab0a1b - src/mistralai_gcp/models/httpvalidationerror.py: - id: f1ac6b7c81f3 - last_write_checksum: sha1:8e98e27a5440e2e1dbe330d1c889d43919d90b51 - pristine_git_object: 79609351e675148ef074988bb6ea8a11b81087dc - src/mistralai_gcp/models/imageurl.py: - id: 1668e9d55730 - last_write_checksum: sha1:2b8eaac00c956beb87434f8d5a21dff12611c788 - pristine_git_object: 20d4ba7719a6c04d2c7864459a68cca808e1a3f2 - src/mistralai_gcp/models/imageurlchunk.py: - id: ebc4dfed0347 - last_write_checksum: sha1:5c625584449139a410138c9986323d1f86b52735 - pristine_git_object: ddb53f21a13aeed7884e213e92752de1870d9fb5 - src/mistralai_gcp/models/jsonschema.py: - id: 4c32e4fa593e - last_write_checksum: sha1:3c972f731f2bd92262ea04a65771c093254d3a5f - pristine_git_object: 26914b2f8562da07e2d54d68a5806bedd32ec16a - src/mistralai_gcp/models/mistralgcperror.py: - id: 690cf29f596b - last_write_checksum: sha1:0ec55c68e3daccf2aba3c52f0a7c77ad5102f4c9 - pristine_git_object: fec729a590b2ea981e01f4af99d8b36ba52b4664 - src/mistralai_gcp/models/mistralpromptmode.py: - id: d2ba58ed5184 - last_write_checksum: sha1:6fb8323de88682846a2a09e68550f3508a29f1f5 - pristine_git_object: a5cc534f8c53bc87b8451aac1b2a79e695530e71 - src/mistralai_gcp/models/no_response_error.py: - id: 7a773ba0687f + src/mistralai/gcp/client/models/__init__.py: + id: d9e976d01972 + last_write_checksum: sha1:5e5ee4c5a73ad0732e7f8c4fce43e62f760b5e62 + pristine_git_object: 275af8eca983ce49f609a162cd7e9613f0411c4c + src/mistralai/gcp/client/models/assistantmessage.py: + id: d39c4bdd289e + last_write_checksum: sha1:08fa98315561d5bb2c094bf57e7d66639b86e3ee + pristine_git_object: 7061775b3dbd9be0b978ff2a2cb07e52c01fc80a + src/mistralai/gcp/client/models/chatcompletionchoice.py: + id: 8e65b56f3e6d + last_write_checksum: sha1:e6d1382e9f880b866130d900fd866997aaf80e45 + pristine_git_object: ae5a2fbf38afbd86233dcaa8aa1c8441f5ed9eba + src/mistralai/gcp/client/models/chatcompletionrequest.py: + id: 4694a31c0003 + last_write_checksum: sha1:edb744ec2baca1f9ba6574662fffb36fb7d3faab + pristine_git_object: 1bc039221910bf88396c96affe735c8ac822920b + src/mistralai/gcp/client/models/chatcompletionresponse.py: + id: dd9e4796fca9 + last_write_checksum: sha1:76d7257583389ff5021e320a8f9a45a6deb07c7c + pristine_git_object: 317c4d84e378c14294d58c5aefd8c55ffe28754a + src/mistralai/gcp/client/models/chatcompletionstreamrequest.py: + id: 7294862af8ea + last_write_checksum: sha1:75d5bfcc204339b152dc78e33ac449c3aa9b5432 + pristine_git_object: 0a5a0021a4862e7b92a5c31679bf42bfa704d15b + src/mistralai/gcp/client/models/completionchunk.py: + id: 6b9ed8c30877 + last_write_checksum: sha1:4afc07c1824d81640f52a5c8bf89fde8893269b9 + pristine_git_object: 9e54cb6dfaccf7f815b40be585e11585cb5fef78 + src/mistralai/gcp/client/models/completionevent.py: + id: 3f55c4b8fc75 + last_write_checksum: sha1:66665d921fd27df6ef0efce996a5446e49b989d8 + pristine_git_object: bb1550093ce9adcb9bcd0548b69796e82f4f260b + src/mistralai/gcp/client/models/completionresponsestreamchoice.py: + id: ad9b98ca7e1c + last_write_checksum: sha1:04d195584fe4ea16544685e9989e5ae35205179a + pristine_git_object: 6f306721fbe47780c778833b80e97ab5d25d8367 + src/mistralai/gcp/client/models/contentchunk.py: + id: 8714d3bf2698 + last_write_checksum: sha1:347f43b4d7dcab18e09e6c3323f745a25ecfb04c + pristine_git_object: 1cd9e502ab7d4860daa79f907beafa71da086ab3 + src/mistralai/gcp/client/models/deltamessage.py: + id: 404fc85f1a4c + last_write_checksum: sha1:3375624531d12279d225fb07a68e0396483b962f + pristine_git_object: 96923518438137cb729a69149b5b99be49836ad7 + src/mistralai/gcp/client/models/fimcompletionrequest.py: + id: 5b79e2595d31 + last_write_checksum: sha1:cc4fa68c60a6a500a9887e47dd2e9220327c6226 + pristine_git_object: f37bbcc3cab020224531da898dd99cc175d49cd9 + src/mistralai/gcp/client/models/fimcompletionresponse.py: + id: 402f602d29b8 + last_write_checksum: sha1:cfe26848c7b14d6e374b7944d7ad44df822990b0 + pristine_git_object: 5b80da3f03e4e99dfca971a53af1cf6472c889bb + src/mistralai/gcp/client/models/fimcompletionstreamrequest.py: + id: 31190cf25070 + last_write_checksum: sha1:720f0a039a62cb508d513475a0e4bad45a9aa03c + pristine_git_object: 8e6102612998bde70d830bb0b8ee3a5e2a4dd01e + src/mistralai/gcp/client/models/function.py: + id: 2285a899b32e + last_write_checksum: sha1:a69ad9c8cd723e78a3949deefe43bcbf57426916 + pristine_git_object: 28577eff06d052aeb58c2795dd0a92ae4f2e7552 + src/mistralai/gcp/client/models/functioncall.py: + id: 17bb51f08e5f + last_write_checksum: sha1:b5fe2f061ea5f47057ee50011babc80de27e0ee6 + pristine_git_object: 0f1b24251ce728b3c2a0fb9e9ca94f90a9c3b7be + src/mistralai/gcp/client/models/functionname.py: + id: 313a6001145f + last_write_checksum: sha1:fe1eefaed314efa788bd15beb63bf6b81abb307e + pristine_git_object: 585b9e39762e49356823e211ad86f701bca389b8 + src/mistralai/gcp/client/models/httpvalidationerror.py: + id: bdb67f678798 + last_write_checksum: sha1:58b6b7a2b2f8e4f66fc14c38540a26cfd2541a1e + pristine_git_object: 57df72607adc980b061d092f77140c6dbd36ecec + src/mistralai/gcp/client/models/imageurl.py: + id: 4e330f3eae74 + last_write_checksum: sha1:a64daae7e0ef71f8024a6381e7f4da465a13f427 + pristine_git_object: e66d77ec412bc27c0c44a94a1da5525438dd7338 + src/mistralai/gcp/client/models/imageurlchunk.py: + id: e68a4a393e9b + last_write_checksum: sha1:2eb2c8a205e5f8b320e2f597075cad9e5e27475b + pristine_git_object: fc5284c102c17a33c1ba6029c87515d509cd014b + src/mistralai/gcp/client/models/jsonschema.py: + id: 39c6e7d412a0 + last_write_checksum: sha1:29ba87457959588ff7d8188ae2382fb88740151d + pristine_git_object: 443c429dd1461d7a6817335626cd585577c5bffe + src/mistralai/gcp/client/models/mistralgcperror.py: + id: 278d296220ff + last_write_checksum: sha1:7267c829a842a94c5b84ac248a1610ce45f3db4e + pristine_git_object: 9de91bf2a4abf8b0d0922eb6062fe2ab817a8aee + src/mistralai/gcp/client/models/mistralpromptmode.py: + id: 8be4a4a683e4 + last_write_checksum: sha1:c958567e95490abf3941fde69be69733e8afb90e + pristine_git_object: c765e4f1a0b86735255771231377f13d62f3d7a6 + src/mistralai/gcp/client/models/no_response_error.py: + id: 2a7fa173594b last_write_checksum: sha1:7f326424a7d5ae1bcd5c89a0d6b3dbda9138942f pristine_git_object: 1deab64bc43e1e65bf3c412d326a4032ce342366 - src/mistralai_gcp/models/prediction.py: - id: cd3b43190e22 - last_write_checksum: sha1:a0411a8e3b1ecb42b91405dd9ee2a2ee5f3fad59 - pristine_git_object: 36c87ab046ed9f1a28a371fbdc5c7d584d71b6d3 - src/mistralai_gcp/models/referencechunk.py: - id: ee00a52fb6dd - last_write_checksum: sha1:d0c05b6b1e7d085833d4a9ef85f1e0088c86d3a5 - pristine_git_object: 904e8b8250570371e2b59895196986a45e6d3562 - src/mistralai_gcp/models/responseformat.py: - id: ad17dac36a51 - last_write_checksum: sha1:296d4b52f934c48490b71d85e1e9d0e207cee21a - pristine_git_object: 9fe5116ca46d713f5f23c92ec1de8a73c5124408 - src/mistralai_gcp/models/responseformats.py: - id: deb9c36c5ec5 + src/mistralai/gcp/client/models/prediction.py: + id: 7a5463285bc8 + last_write_checksum: sha1:1d1e81082d1c2bfd613f0bc00f7173995ad67c0c + pristine_git_object: f53579edc665dd7fc1cc2497b0cd05b69e541cd8 + src/mistralai/gcp/client/models/referencechunk.py: + id: 523e477f8725 + last_write_checksum: sha1:d29c5fc1d8b6850fdeb3abc7f83185de92571b23 + pristine_git_object: 274ea7f7b142714d96040428fe7b87eeb48432cb + src/mistralai/gcp/client/models/responseformat.py: + id: 06774bb65b42 + last_write_checksum: sha1:a52a60dc45c0b0939b99754d6c0c603ef2f737d3 + pristine_git_object: 34ae6b039a6c83c603fc6d47f6b2f233ec6c817a + src/mistralai/gcp/client/models/responseformats.py: + id: 18112ad0f6db last_write_checksum: sha1:a212e85d286b5b49219f57d071a2232ff8b5263b pristine_git_object: cbf83ce7b54ff8634f741334831807bfb5c98991 - src/mistralai_gcp/models/responsevalidationerror.py: - id: 78e210042d35 - last_write_checksum: sha1:b8ba70238453017393e721c7d61b5f1e268d7c17 - pristine_git_object: ebd4f214747d451dc2733d6ea838c67bb0c84797 - src/mistralai_gcp/models/sdkerror.py: - id: beed68eccaa1 - last_write_checksum: sha1:a058f2519ec22f72457e800600be469f13ff9915 - pristine_git_object: 7f53bbcd548d15f4fdd529bd3caea5249eb5e8e6 - src/mistralai_gcp/models/security.py: - id: 32f877bd1399 - last_write_checksum: sha1:7bad1150440143f9f6faefe33911edf6c2afdec1 - pristine_git_object: 3857494264c0444d330c54570483710a5ed321f0 - src/mistralai_gcp/models/systemmessage.py: - id: 13826cd6cb74 - last_write_checksum: sha1:876e84816c4e27ad77d6313777ba841ea3086cf9 - pristine_git_object: d74bdf3255bac53335eea08a6010cf1cc19380dd - src/mistralai_gcp/models/systemmessagecontentchunks.py: - id: 8233735d37db - last_write_checksum: sha1:38fedfdb83824054a1734bcc7d39e7e040bf4792 - pristine_git_object: e0b5bbc30828cbf572e603efc86ee2695102ea31 - src/mistralai_gcp/models/textchunk.py: - id: a330626b2006 - last_write_checksum: sha1:b801cf9b1913a70841c8fbdc9d433f0380ea82d8 - pristine_git_object: c4a8cf28cd2281cfda40cefa70ce1bd64d3e750d - src/mistralai_gcp/models/thinkchunk.py: - id: c38f6a213cc1 - last_write_checksum: sha1:a072f3bf01c2dc90ef6cc1b188b2e00e15923e07 - pristine_git_object: b88c0cb54c6926b3c896b3c192c5f3c51c676a51 - src/mistralai_gcp/models/tool.py: - id: 86b94d6a3bcb - last_write_checksum: sha1:14a081eb8639d834a7c4f209a79e7d1270202205 - pristine_git_object: 800de633962a0ccddab52596eae542318bb491b0 - src/mistralai_gcp/models/toolcall.py: - id: 3047e78c2ac3 - last_write_checksum: sha1:d219f8d7de19f501b799caf0e232bdce95e2c891 - pristine_git_object: 23ef157aa1d24498805a489a8cebf3c0e257d919 - src/mistralai_gcp/models/toolchoice.py: - id: 1f3d5233426e - last_write_checksum: sha1:936b1ac7b44bc1bf357e6a66cc42ed0127ad015e - pristine_git_object: 4a1483305f606afcc704e8d51ae363468354849e - src/mistralai_gcp/models/toolchoiceenum.py: - id: b4431b9cf3fd + src/mistralai/gcp/client/models/responsevalidationerror.py: + id: b90c1c09ac00 + last_write_checksum: sha1:e4321c1141ba7b1f6a8c217124e02ea0c70d9ad1 + pristine_git_object: 0e86ea6cb79fd4598d527dfef403ba66d435d3bb + src/mistralai/gcp/client/models/sdkerror.py: + id: a7cf4fa8974b + last_write_checksum: sha1:a3b60234deceb7fbcb57926c265e02e9fefc0835 + pristine_git_object: 00bc1d99353e7e2415d92c3e906c2c09712e5a64 + src/mistralai/gcp/client/models/security.py: + id: 7e13bda8273b + last_write_checksum: sha1:7086e929823d4eefe80cc279b605adfc8bbb08aa + pristine_git_object: 10a469b54d5e03873fb7d7d98627f2376c93d484 + src/mistralai/gcp/client/models/systemmessage.py: + id: 6537664d2d1b + last_write_checksum: sha1:e7f8dc73154c6985fcdbb77259df9bbc4745f976 + pristine_git_object: a7d695a7791eb5e97cd8f74e81c475c78e4b1a67 + src/mistralai/gcp/client/models/systemmessagecontentchunks.py: + id: e120a6469c89 + last_write_checksum: sha1:55529f2f29ba3087fbf117dbbe64e1dda92b2958 + pristine_git_object: 225f38b712f5f3c7abfd526cc8c0386687814f36 + src/mistralai/gcp/client/models/textchunk.py: + id: a134f120d4dc + last_write_checksum: sha1:9f46381e01f235560017ea80fbc85210eb625a99 + pristine_git_object: 77576c9fd87f0861bf6a3496aeae7e8bb8dc986a + src/mistralai/gcp/client/models/thinkchunk.py: + id: 59a1d1ef2020 + last_write_checksum: sha1:9fcccb19d87bc41f771cae710eeb8f28c229070d + pristine_git_object: b65fffb21d5cb060acaa648a70e337a43595cd32 + src/mistralai/gcp/client/models/tool.py: + id: 4b27d45e56ad + last_write_checksum: sha1:6d139575b740ea1f9f68a73b7bc2c95c30a10345 + pristine_git_object: d09c68542f2cb1f3bae0ffc7a7b163ad08a8e973 + src/mistralai/gcp/client/models/toolcall.py: + id: e6c25869a579 + last_write_checksum: sha1:5acf0eca8b1f4c459c6d8cadbbbd90605201ddc0 + pristine_git_object: a1edf3370426957980ff212367d56909ea8fa548 + src/mistralai/gcp/client/models/toolchoice.py: + id: cb13a9f64c92 + last_write_checksum: sha1:3ad6b48b24b39609e86229193ad18d84b1b3c818 + pristine_git_object: de3828dac8bc23e32b9f9434adccc770b5ce1212 + src/mistralai/gcp/client/models/toolchoiceenum.py: + id: d62e9c92d93c last_write_checksum: sha1:3dbba9a58c5569aafe115f3f7713a52b01ad8620 pristine_git_object: 01f6f677b379f9e3c99db9d1ad248cb0033a2804 - src/mistralai_gcp/models/toolmessage.py: - id: e21a2326eb31 - last_write_checksum: sha1:c332f72e272fff7970f52e2b15223a2898ce9b15 - pristine_git_object: d6aa2621b83bde261fab7bd15f58273861f88738 - src/mistralai_gcp/models/tooltypes.py: - id: b4c1716d51b3 - last_write_checksum: sha1:0f8fe0c437736eb584cce298a5e72c4e25f7c42b - pristine_git_object: 8b812ae0cfee81a1cd8ab0180e65f57d19a0dcbd - src/mistralai_gcp/models/usageinfo.py: - id: 574d1999c265 - last_write_checksum: sha1:a0a88fe5b3cae9317781b99cb3cc1916a9ba17cc - pristine_git_object: 59f36158761c3a86900256a6ed73845c455417c7 - src/mistralai_gcp/models/usermessage.py: - id: cf3691ffafa6 - last_write_checksum: sha1:d0ed86a67403d65ed6ac7a31aa5f73e19ecfa670 - pristine_git_object: 0168b45235bc891888c095565af832535dd26139 - src/mistralai_gcp/models/validationerror.py: - id: f1a6468621bd - last_write_checksum: sha1:a4cc5969f12e00be3506edc90ec21a01d5415eff - pristine_git_object: 033d4b63d1c321ae2c49e8684b34817adddca4c2 - src/mistralai_gcp/py.typed: - id: 7f25f97fed44 + src/mistralai/gcp/client/models/toolmessage.py: + id: b3774786c2e9 + last_write_checksum: sha1:ef21eb555f41ec70010dbcea1a155af988936061 + pristine_git_object: 65b1d9d62d37361a06b3fd3ee1790eb3a976a94f + src/mistralai/gcp/client/models/tooltypes.py: + id: 5926c64f5229 + last_write_checksum: sha1:ffd576511eed9f823c3d67df9fc5574d8d53c54b + pristine_git_object: fd1aa13d7b8c5d9bdb0922e04b8bd653ff843f60 + src/mistralai/gcp/client/models/usageinfo.py: + id: 3aab1af66cff + last_write_checksum: sha1:47c6311bc1db47849a72c8e1bcc64dac9cec637e + pristine_git_object: 9b7207b10ea9d46d8216c104c45be1a52fb093d9 + src/mistralai/gcp/client/models/usermessage.py: + id: 9cfa7260463e + last_write_checksum: sha1:580acf868a3d180eef34b2af9c2d20f78e4fb693 + pristine_git_object: c083e16d4aa536beec9f9e1151ebbe8c1797798c + src/mistralai/gcp/client/models/validationerror.py: + id: 6b4f4910ea9c + last_write_checksum: sha1:2792fd656f55519902f37670fb9fb3b43b4aa016 + pristine_git_object: 2d330e9acb579cc4928fa27fdd72288ce8832b8b + src/mistralai/gcp/client/py.typed: + id: 98b8ab80ab0d last_write_checksum: sha1:8efc425ffe830805ffcc0f3055871bdcdc542c60 pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544 - src/mistralai_gcp/sdkconfiguration.py: - id: 84fd7d3e219a - last_write_checksum: sha1:df51450c87f807c849e2aefb0a154aa4426fd8e3 - pristine_git_object: cf85c47e5e33956a64ddea53d85cdb7cc4bb687e - src/mistralai_gcp/types/__init__.py: - id: 15a92fdbd0a1 + src/mistralai/gcp/client/sdkconfiguration.py: + id: 57be0f79ea1e + last_write_checksum: sha1:0c5905e7c6092f57c15ee4318a85c0985bcc1ccf + pristine_git_object: d56a634f688f6697ba84962381084dc2d0836ac9 + src/mistralai/gcp/client/types/__init__.py: + id: f7ef15ac2ba1 last_write_checksum: sha1:140ebdd01a46f92ffc710c52c958c4eba3cf68ed pristine_git_object: fc76fe0c5505e29859b5d2bb707d48fd27661b8c - src/mistralai_gcp/types/basemodel.py: - id: 0dd6dc277359 + src/mistralai/gcp/client/types/basemodel.py: + id: 24babf758c19 last_write_checksum: sha1:10d84aedeb9d35edfdadf2c3020caa1d24d8b584 pristine_git_object: a9a640a1a7048736383f96c67c6290c86bf536ee - src/mistralai_gcp/utils/__init__.py: - id: bb44726e5fa4 + src/mistralai/gcp/client/utils/__init__.py: + id: a30c8ff6dcff last_write_checksum: sha1:887f56a717845fab7445cc368d2a17d850c3565a pristine_git_object: 05f26ade57efb8c54a774fbcb939fb1a7dc655ce - src/mistralai_gcp/utils/annotations.py: - id: aeecca0c40a3 + src/mistralai/gcp/client/utils/annotations.py: + id: 9b2cd4ffc6e9 last_write_checksum: sha1:a4824ad65f730303e4e1e3ec1febf87b4eb46dbc pristine_git_object: 12e0aa4f1151bb52474cc02e88397329b90703f6 - src/mistralai_gcp/utils/datetimes.py: - id: e3e3bb6cb264 + src/mistralai/gcp/client/utils/datetimes.py: + id: dd1f0f91ea9d last_write_checksum: sha1:c721e4123000e7dc61ec52b28a739439d9e17341 pristine_git_object: a6c52cd61bbe2d459046c940ce5e8c469f2f0664 - src/mistralai_gcp/utils/enums.py: - id: 9f020fc8d361 + src/mistralai/gcp/client/utils/enums.py: + id: 2341407d5443 last_write_checksum: sha1:bc8c3c1285ae09ba8a094ee5c3d9c7f41fa1284d pristine_git_object: 3324e1bc2668c54c4d5f5a1a845675319757a828 - src/mistralai_gcp/utils/eventstreaming.py: - id: d570df9074cf + src/mistralai/gcp/client/utils/eventstreaming.py: + id: bb66f0c3e0dc last_write_checksum: sha1:bababae5d54b7efc360db701daa49e18a92c2f3b pristine_git_object: 0969899bfc491e5e408d05643525f347ea95e4fc - src/mistralai_gcp/utils/forms.py: - id: fe642748c385 + src/mistralai/gcp/client/utils/forms.py: + id: ebf34781d6bd last_write_checksum: sha1:15fa7e9ab1611e062a9984cf06cb20969713d295 pristine_git_object: f961e76beaf0a8b1fe0dda44754a74eebd3608e7 - src/mistralai_gcp/utils/headers.py: - id: 0cb933d098ed + src/mistralai/gcp/client/utils/headers.py: + id: 4c369582903e last_write_checksum: sha1:7c6df233ee006332b566a8afa9ce9a245941d935 pristine_git_object: 37864cbbbc40d1a47112bbfdd3ba79568fc8818a - src/mistralai_gcp/utils/logger.py: - id: 2992f9bda9c7 + src/mistralai/gcp/client/utils/logger.py: + id: 082d86b60820 last_write_checksum: sha1:f3fdb154a3f09b8cc43d74c7e9c02f899f8086e4 pristine_git_object: b661aff65d38b77d035149699aea09b2785d2fc6 - src/mistralai_gcp/utils/metadata.py: - id: af274ae68c93 + src/mistralai/gcp/client/utils/metadata.py: + id: ff0e832b8b9c last_write_checksum: sha1:c6a560bd0c63ab158582f34dadb69433ea73b3d4 pristine_git_object: 173b3e5ce658675c2f504222a56b3daaaa68107d - src/mistralai_gcp/utils/queryparams.py: - id: b20aa8da5982 + src/mistralai/gcp/client/utils/queryparams.py: + id: 133b8408e73e last_write_checksum: sha1:b94c3f314fd3da0d1d215afc2731f48748e2aa59 pristine_git_object: c04e0db82b68eca041f2cb2614d748fbac80fd41 - src/mistralai_gcp/utils/requestbodies.py: - id: 1a2ddaa8f5a2 + src/mistralai/gcp/client/utils/requestbodies.py: + id: 1be13a660954 last_write_checksum: sha1:41e2d2d2d3ecc394c8122ca4d4b85e1c3e03f054 pristine_git_object: 1de32b6d26f46590232f398fdba6ce0072f1659c - src/mistralai_gcp/utils/retries.py: - id: 8caeba1fe4ab + src/mistralai/gcp/client/utils/retries.py: + id: 542ebd75b79b last_write_checksum: sha1:5b97ac4f59357d70c2529975d50364c88bcad607 pristine_git_object: 88a91b10cd2076b4a2c6cff2ac6bfaa5e3c5ad13 - src/mistralai_gcp/utils/security.py: - id: fa4f52aaad5d + src/mistralai/gcp/client/utils/security.py: + id: 5273152365f4 last_write_checksum: sha1:a17130ace2c0db6394f38dd941ad2b700cc755c8 pristine_git_object: 295a3f40031dbb40073ad227fd4a355660f97ab2 - src/mistralai_gcp/utils/serializers.py: - id: 920ccb5c87f2 + src/mistralai/gcp/client/utils/serializers.py: + id: a7836e553d41 last_write_checksum: sha1:ce1d8d7f500a9ccba0aeca5057cee9c271f4dfd7 pristine_git_object: 14321eb479de81d0d9580ec8291e0ff91bf29e57 - src/mistralai_gcp/utils/unmarshal_json_response.py: - id: 65d5fa644cf8 - last_write_checksum: sha1:877dd4bb58700039a481fdf7d7216d2d9a0b3e92 - pristine_git_object: c168a293f7018fc3b83cac0d8f723475e5f05631 - src/mistralai_gcp/utils/url.py: - id: 116eb5a78ca7 + src/mistralai/gcp/client/utils/unmarshal_json_response.py: + id: d972d22cf934 + last_write_checksum: sha1:a68b9e491188e6c1956a749530eac3c7dc8004e7 + pristine_git_object: 83e8275e59adf51fb01a0579ae26627ee29fee49 + src/mistralai/gcp/client/utils/url.py: + id: 0d311bbcb8f8 last_write_checksum: sha1:6479961baa90432ca25626f8e40a7bbc32e73b41 pristine_git_object: c78ccbae426ce6d385709d97ce0b1c2813ea2418 - src/mistralai_gcp/utils/values.py: - id: 9cc9ee47c951 + src/mistralai/gcp/client/utils/values.py: + id: 328207e9ae81 last_write_checksum: sha1:acaa178a7c41ddd000f58cc691e4632d925b2553 pristine_git_object: dae01a44384ac3bc13ae07453a053bf6c898ebe3 examples: stream_chat: speakeasy-default-stream-chat: requestBody: - application/json: {"model": "mistral-large-latest", "stream": true, "messages": [{"content": "Who is the best French painter? Answer in one short sentence.", "role": "user"}], "response_format": {"type": "text"}} + application/json: {"model": "mistral-large-latest", "stream": true, "messages": [{"role": "user", "content": "Who is the best French painter? Answer in one short sentence."}], "response_format": {"type": "text"}} responses: "422": application/json: {} chat_completion_v1_chat_completions_post: speakeasy-default-chat-completion-v1-chat-completions-post: requestBody: - application/json: {"model": "mistral-large-latest", "stream": false, "messages": [{"content": "Who is the best French painter? Answer in one short sentence.", "role": "user"}], "response_format": {"type": "text"}} + application/json: {"model": "mistral-large-latest", "stream": false, "messages": [{"role": "user", "content": "Who is the best French painter? Answer in one short sentence."}], "response_format": {"type": "text"}} responses: "200": application/json: {"id": "cmpl-e5cc70bb28c444948073e77776eb30ef", "object": "chat.completion", "model": "mistral-small-latest", "usage": {"prompt_tokens": 0, "completion_tokens": 0, "total_tokens": 0}, "created": 1702256327, "choices": []} @@ -661,7 +630,7 @@ examples: application/json: {"model": "codestral-latest", "top_p": 1, "stream": false, "prompt": "def", "suffix": "return a+b"} responses: "200": - application/json: {"id": "447e3e0d457e42e98248b5d2ef52a2a3", "object": "chat.completion", "model": "codestral-2508", "usage": {"prompt_tokens": 8, "completion_tokens": 91, "total_tokens": 99}, "created": 1759496862, "choices": [{"index": 0, "message": {"content": "add_numbers(a: int, b: int) -> int:\n \"\"\"\n You are given two integers `a` and `b`. Your task is to write a function that\n returns the sum of these two integers. The function should be implemented in a\n way that it can handle very large integers (up to 10^18). As a reminder, your\n code has to be in python\n \"\"\"\n", "tool_calls": null, "prefix": false, "role": "assistant"}, "finish_reason": "stop"}]} + application/json: {"id": "447e3e0d457e42e98248b5d2ef52a2a3", "object": "chat.completion", "model": "codestral-2508", "usage": {"prompt_tokens": 8, "completion_tokens": 91, "total_tokens": 99}, "created": 1759496862, "choices": [{"index": 0, "message": {"role": "assistant", "content": "add_numbers(a: int, b: int) -> int:\n \"\"\"\n You are given two integers `a` and `b`. Your task is to write a function that\n returns the sum of these two integers. The function should be implemented in a\n way that it can handle very large integers (up to 10^18). As a reminder, your\n code has to be in python\n \"\"\"\n", "tool_calls": null, "prefix": false}, "finish_reason": "stop"}]} examplesVersion: 1.0.2 generatedTests: {} generatedFiles: diff --git a/packages/mistralai_gcp/.speakeasy/gen.yaml b/packages/gcp/.speakeasy/gen.yaml similarity index 78% rename from packages/mistralai_gcp/.speakeasy/gen.yaml rename to packages/gcp/.speakeasy/gen.yaml index 2aacaa62..93cc5a42 100644 --- a/packages/mistralai_gcp/.speakeasy/gen.yaml +++ b/packages/gcp/.speakeasy/gen.yaml @@ -8,11 +8,13 @@ generation: useClassNamesForArrayFields: true fixes: nameResolutionDec2023: true - nameResolutionFeb2025: false + nameResolutionFeb2025: true parameterOrderingFeb2024: true requestResponseComponentNamesFeb2024: true - securityFeb2025: false - sharedErrorComponentsApr2025: false + securityFeb2025: true + sharedErrorComponentsApr2025: true + methodSignaturesApr2024: true + sharedNestedComponentsJan2026: true auth: oAuth2ClientCredentialsEnabled: true oAuth2PasswordEnabled: false @@ -26,21 +28,18 @@ generation: generateNewTests: false skipResponseBodyAssertions: false python: - version: 1.8.0 + version: 2.0.0a4 additionalDependencies: dev: pytest: ^8.2.2 pytest-asyncio: ^0.23.7 - main: - google-auth: ^2.31.0 - requests: ^2.32.3 allowedRedefinedBuiltins: - id - object asyncMode: both authors: - Mistral - baseErrorName: MistralGcpError + baseErrorName: MistralGCPError clientServerStatusCodesAsErrors: true constFieldCasing: upper defaultErrorName: SDKError @@ -48,10 +47,13 @@ python: enableCustomCodeRegions: false enumFormat: union fixFlags: - responseRequiredSep2024: false + responseRequiredSep2024: true + flatAdditionalProperties: true flattenGlobalSecurity: true flattenRequests: true flatteningOrder: parameters-first + forwardCompatibleEnumsByDefault: true + forwardCompatibleUnionsByDefault: tagged-only imports: option: openapi paths: @@ -65,12 +67,12 @@ python: license: "" maxMethodParams: 15 methodArguments: infer-optional-args - moduleName: "" + moduleName: mistralai.gcp.client multipartArrayFormat: legacy outputModelSuffix: output packageManager: uv packageName: mistralai-gcp - preApplyUnionDiscriminators: false + preApplyUnionDiscriminators: true pytestFilterWarnings: [] pytestTimeout: 0 responseFormat: flat diff --git a/packages/mistralai_gcp/CONTRIBUTING.md b/packages/gcp/CONTRIBUTING.md similarity index 100% rename from packages/mistralai_gcp/CONTRIBUTING.md rename to packages/gcp/CONTRIBUTING.md diff --git a/packages/mistralai_gcp/README.md b/packages/gcp/README.md similarity index 94% rename from packages/mistralai_gcp/README.md rename to packages/gcp/README.md index a4233244..2c6e3584 100644 --- a/packages/mistralai_gcp/README.md +++ b/packages/gcp/README.md @@ -28,7 +28,7 @@ This example shows how to create chat completions. ```python # Synchronous Example -from mistralai_gcp import MistralGCP +from mistralai.gcp.client import MistralGCP import os ) @@ -51,7 +51,7 @@ The same SDK client can also be used to make asychronous requests by importing a ```python # Asynchronous Example import asyncio -from mistralai_gcp import MistralGCP +from mistralai.gcp.client import MistralGCP import os async def main(): @@ -96,7 +96,7 @@ terminate when the server no longer has any events to send and closes the underlying connection. ```python -from mistralai_gcp import MistralGCP +from mistralai.gcp.client import MistralGCP import os s = MistralGCP() @@ -127,8 +127,8 @@ Some of the endpoints in this SDK support retries. If you use the SDK without an To change the default retry strategy for a single API call, simply provide a `RetryConfig` object to the call: ```python -from mistralai_gcp import MistralGCP -from mistralgcp.utils import BackoffStrategy, RetryConfig +from mistralai.gcp.client import MistralGCP +from mistralai.gcp.client.utils import BackoffStrategy, RetryConfig import os s = MistralGCP() @@ -158,8 +158,8 @@ if res is not None: If you'd like to override the default retry strategy for all operations that support retries, you can use the `retry_config` optional parameter when initializing the SDK: ```python -from mistralai_gcp import MistralGCP -from mistralgcp.utils import BackoffStrategy, RetryConfig +from mistralai.gcp.client import MistralGCP +from mistralai.gcp.client.utils import BackoffStrategy, RetryConfig import os s = MistralGCP( @@ -198,7 +198,8 @@ Handling errors in this SDK should largely match your expectations. All operati ### Example ```python -from mistralai_gcp import MistralGCP, models +from mistralai.gcp.client import MistralGCP +from mistralai.gcp.client import models import os s = MistralGCP() @@ -243,7 +244,7 @@ You can override the default server globally by passing a server name to the `se #### Example ```python -from mistralai_gcp import MistralGCP +from mistralai.gcp.client import MistralGCP import os s = MistralGCP(server="prod") @@ -271,7 +272,7 @@ if res is not None: 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: ```python -from mistralai_gcp import MistralGCP +from mistralai.gcp.client import MistralGCP import os s = MistralGCP( @@ -306,7 +307,7 @@ This allows you to wrap the client with your own custom logic, such as adding cu For example, you could specify a header for every request that this sdk makes as follows: ```python -from mistralai_gcp import MistralGCP +from mistralai.gcp.client import MistralGCP import httpx http_client = httpx.Client(headers={"x-custom-header": "someValue"}) @@ -315,8 +316,8 @@ s = MistralGCP(client=http_client) or you could wrap the client with your own custom logic: ```python -from mistralai_gcp import MistralGCP -from mistralai_gcp.httpclient import AsyncHttpClient +from mistralai.gcp.client import MistralGCP +from mistralai.gcp.client.httpclient import AsyncHttpClient import httpx class CustomClient(AsyncHttpClient): @@ -391,7 +392,7 @@ This SDK supports the following security scheme globally: To authenticate with the API the `api_key` parameter must be set when initializing the SDK client instance. For example: ```python -from mistralai_gcp import MistralGCP +from mistralai.gcp.client import MistralGCP import os s = MistralGCP() diff --git a/packages/mistralai_gcp/RELEASES.md b/packages/gcp/RELEASES.md similarity index 100% rename from packages/mistralai_gcp/RELEASES.md rename to packages/gcp/RELEASES.md diff --git a/packages/mistralai_gcp/USAGE.md b/packages/gcp/USAGE.md similarity index 92% rename from packages/mistralai_gcp/USAGE.md rename to packages/gcp/USAGE.md index 30fa08aa..732d92e3 100644 --- a/packages/mistralai_gcp/USAGE.md +++ b/packages/gcp/USAGE.md @@ -5,7 +5,7 @@ This example shows how to create chat completions. ```python # Synchronous Example -from mistralai_gcp import MistralGCP +from mistralai.gcp.client import MistralGCP import os s = MistralGCP() @@ -29,7 +29,7 @@ The same SDK client can also be used to make asychronous requests by importing a ```python # Asynchronous Example import asyncio -from mistralai_gcp import MistralGCP +from mistralai.gcp.client import MistralGCP import os async def main(): diff --git a/packages/mistralai_gcp/docs/models/arguments.md b/packages/gcp/docs/models/arguments.md similarity index 100% rename from packages/mistralai_gcp/docs/models/arguments.md rename to packages/gcp/docs/models/arguments.md diff --git a/packages/mistralai_gcp/docs/models/assistantmessage.md b/packages/gcp/docs/models/assistantmessage.md similarity index 95% rename from packages/mistralai_gcp/docs/models/assistantmessage.md rename to packages/gcp/docs/models/assistantmessage.md index 3d0bd90b..9ef63837 100644 --- a/packages/mistralai_gcp/docs/models/assistantmessage.md +++ b/packages/gcp/docs/models/assistantmessage.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `role` | *Optional[Literal["assistant"]]* | :heavy_minus_sign: | N/A | | `content` | [OptionalNullable[models.AssistantMessageContent]](../models/assistantmessagecontent.md) | :heavy_minus_sign: | N/A | | `tool_calls` | List[[models.ToolCall](../models/toolcall.md)] | :heavy_minus_sign: | N/A | -| `prefix` | *Optional[bool]* | :heavy_minus_sign: | Set this to `true` when adding an assistant message as prefix to condition the model response. The role of the prefix message is to force the model to start its answer by the content of the message. | -| `role` | [Optional[models.AssistantMessageRole]](../models/assistantmessagerole.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `prefix` | *Optional[bool]* | :heavy_minus_sign: | Set this to `true` when adding an assistant message as prefix to condition the model response. The role of the prefix message is to force the model to start its answer by the content of the message. | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/assistantmessagecontent.md b/packages/gcp/docs/models/assistantmessagecontent.md similarity index 100% rename from packages/mistralai_gcp/docs/models/assistantmessagecontent.md rename to packages/gcp/docs/models/assistantmessagecontent.md diff --git a/packages/mistralai_gcp/docs/models/chatcompletionchoice.md b/packages/gcp/docs/models/chatcompletionchoice.md similarity index 100% rename from packages/mistralai_gcp/docs/models/chatcompletionchoice.md rename to packages/gcp/docs/models/chatcompletionchoice.md diff --git a/packages/mistralai_gcp/docs/models/chatcompletionchoicefinishreason.md b/packages/gcp/docs/models/chatcompletionchoicefinishreason.md similarity index 100% rename from packages/mistralai_gcp/docs/models/chatcompletionchoicefinishreason.md rename to packages/gcp/docs/models/chatcompletionchoicefinishreason.md diff --git a/packages/mistralai_gcp/docs/models/chatcompletionrequest.md b/packages/gcp/docs/models/chatcompletionrequest.md similarity index 99% rename from packages/mistralai_gcp/docs/models/chatcompletionrequest.md rename to packages/gcp/docs/models/chatcompletionrequest.md index 6886f9dc..61a25d86 100644 --- a/packages/mistralai_gcp/docs/models/chatcompletionrequest.md +++ b/packages/gcp/docs/models/chatcompletionrequest.md @@ -13,7 +13,7 @@ | `stop` | [Optional[models.ChatCompletionRequestStop]](../models/chatcompletionrequeststop.md) | :heavy_minus_sign: | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array | | | `random_seed` | *OptionalNullable[int]* | :heavy_minus_sign: | The seed to use for random sampling. If set, different calls will generate deterministic results. | | | `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | | -| `messages` | List[[models.ChatCompletionRequestMessages](../models/chatcompletionrequestmessages.md)] | :heavy_check_mark: | The prompt(s) to generate completions for, encoded as a list of dict with role and content. | [
{
"role": "user",
"content": "Who is the best French painter? Answer in one short sentence."
}
] | +| `messages` | List[[models.ChatCompletionRequestMessage](../models/chatcompletionrequestmessage.md)] | :heavy_check_mark: | The prompt(s) to generate completions for, encoded as a list of dict with role and content. | [
{
"role": "user",
"content": "Who is the best French painter? Answer in one short sentence."
}
] | | `response_format` | [Optional[models.ResponseFormat]](../models/responseformat.md) | :heavy_minus_sign: | Specify the format that the model must output. By default it will use `{ "type": "text" }`. Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ "type": "json_schema" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide. | {
"type": "text"
} | | `tools` | List[[models.Tool](../models/tool.md)] | :heavy_minus_sign: | A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for. | | | `tool_choice` | [Optional[models.ChatCompletionRequestToolChoice]](../models/chatcompletionrequesttoolchoice.md) | :heavy_minus_sign: | Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. | | diff --git a/packages/mistralai_gcp/docs/models/messages.md b/packages/gcp/docs/models/chatcompletionrequestmessage.md similarity index 92% rename from packages/mistralai_gcp/docs/models/messages.md rename to packages/gcp/docs/models/chatcompletionrequestmessage.md index 1d394500..91e9e062 100644 --- a/packages/mistralai_gcp/docs/models/messages.md +++ b/packages/gcp/docs/models/chatcompletionrequestmessage.md @@ -1,4 +1,4 @@ -# Messages +# ChatCompletionRequestMessage ## Supported Types diff --git a/packages/mistralai_gcp/docs/models/chatcompletionrequeststop.md b/packages/gcp/docs/models/chatcompletionrequeststop.md similarity index 100% rename from packages/mistralai_gcp/docs/models/chatcompletionrequeststop.md rename to packages/gcp/docs/models/chatcompletionrequeststop.md diff --git a/packages/mistralai_gcp/docs/models/chatcompletionrequesttoolchoice.md b/packages/gcp/docs/models/chatcompletionrequesttoolchoice.md similarity index 100% rename from packages/mistralai_gcp/docs/models/chatcompletionrequesttoolchoice.md rename to packages/gcp/docs/models/chatcompletionrequesttoolchoice.md diff --git a/packages/mistralai_gcp/docs/models/chatcompletionresponse.md b/packages/gcp/docs/models/chatcompletionresponse.md similarity index 100% rename from packages/mistralai_gcp/docs/models/chatcompletionresponse.md rename to packages/gcp/docs/models/chatcompletionresponse.md diff --git a/packages/mistralai_gcp/docs/models/chatcompletionstreamrequest.md b/packages/gcp/docs/models/chatcompletionstreamrequest.md similarity index 99% rename from packages/mistralai_gcp/docs/models/chatcompletionstreamrequest.md rename to packages/gcp/docs/models/chatcompletionstreamrequest.md index ff1940dd..3e790e7d 100644 --- a/packages/mistralai_gcp/docs/models/chatcompletionstreamrequest.md +++ b/packages/gcp/docs/models/chatcompletionstreamrequest.md @@ -10,10 +10,10 @@ | `top_p` | *Optional[float]* | :heavy_minus_sign: | Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. | | | `max_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. | | | `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A | | -| `stop` | [Optional[models.Stop]](../models/stop.md) | :heavy_minus_sign: | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array | | +| `stop` | [Optional[models.ChatCompletionStreamRequestStop]](../models/chatcompletionstreamrequeststop.md) | :heavy_minus_sign: | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array | | | `random_seed` | *OptionalNullable[int]* | :heavy_minus_sign: | The seed to use for random sampling. If set, different calls will generate deterministic results. | | | `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | | -| `messages` | List[[models.Messages](../models/messages.md)] | :heavy_check_mark: | The prompt(s) to generate completions for, encoded as a list of dict with role and content. | [
{
"role": "user",
"content": "Who is the best French painter? Answer in one short sentence."
}
] | +| `messages` | List[[models.ChatCompletionStreamRequestMessage](../models/chatcompletionstreamrequestmessage.md)] | :heavy_check_mark: | The prompt(s) to generate completions for, encoded as a list of dict with role and content. | [
{
"role": "user",
"content": "Who is the best French painter? Answer in one short sentence."
}
] | | `response_format` | [Optional[models.ResponseFormat]](../models/responseformat.md) | :heavy_minus_sign: | Specify the format that the model must output. By default it will use `{ "type": "text" }`. Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ "type": "json_schema" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide. | {
"type": "text"
} | | `tools` | List[[models.Tool](../models/tool.md)] | :heavy_minus_sign: | A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for. | | | `tool_choice` | [Optional[models.ChatCompletionStreamRequestToolChoice]](../models/chatcompletionstreamrequesttoolchoice.md) | :heavy_minus_sign: | Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. | | diff --git a/packages/mistralai_azure/docs/models/chatcompletionrequestmessages.md b/packages/gcp/docs/models/chatcompletionstreamrequestmessage.md similarity index 91% rename from packages/mistralai_azure/docs/models/chatcompletionrequestmessages.md rename to packages/gcp/docs/models/chatcompletionstreamrequestmessage.md index bc7708a6..2e4e93ac 100644 --- a/packages/mistralai_azure/docs/models/chatcompletionrequestmessages.md +++ b/packages/gcp/docs/models/chatcompletionstreamrequestmessage.md @@ -1,4 +1,4 @@ -# ChatCompletionRequestMessages +# ChatCompletionStreamRequestMessage ## Supported Types diff --git a/packages/mistralai_azure/docs/models/stop.md b/packages/gcp/docs/models/chatcompletionstreamrequeststop.md similarity index 88% rename from packages/mistralai_azure/docs/models/stop.md rename to packages/gcp/docs/models/chatcompletionstreamrequeststop.md index ba40ca83..a48460a9 100644 --- a/packages/mistralai_azure/docs/models/stop.md +++ b/packages/gcp/docs/models/chatcompletionstreamrequeststop.md @@ -1,4 +1,4 @@ -# Stop +# ChatCompletionStreamRequestStop Stop generation if this token is detected. Or if one of these tokens is detected when providing an array diff --git a/packages/mistralai_gcp/docs/models/chatcompletionstreamrequesttoolchoice.md b/packages/gcp/docs/models/chatcompletionstreamrequesttoolchoice.md similarity index 100% rename from packages/mistralai_gcp/docs/models/chatcompletionstreamrequesttoolchoice.md rename to packages/gcp/docs/models/chatcompletionstreamrequesttoolchoice.md diff --git a/packages/mistralai_gcp/docs/models/completionchunk.md b/packages/gcp/docs/models/completionchunk.md similarity index 100% rename from packages/mistralai_gcp/docs/models/completionchunk.md rename to packages/gcp/docs/models/completionchunk.md diff --git a/packages/mistralai_gcp/docs/models/completionevent.md b/packages/gcp/docs/models/completionevent.md similarity index 100% rename from packages/mistralai_gcp/docs/models/completionevent.md rename to packages/gcp/docs/models/completionevent.md diff --git a/packages/gcp/docs/models/completionresponsestreamchoice.md b/packages/gcp/docs/models/completionresponsestreamchoice.md new file mode 100644 index 00000000..1532c25b --- /dev/null +++ b/packages/gcp/docs/models/completionresponsestreamchoice.md @@ -0,0 +1,10 @@ +# CompletionResponseStreamChoice + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | +| `index` | *int* | :heavy_check_mark: | N/A | +| `delta` | [models.DeltaMessage](../models/deltamessage.md) | :heavy_check_mark: | N/A | +| `finish_reason` | [Nullable[models.CompletionResponseStreamChoiceFinishReason]](../models/completionresponsestreamchoicefinishreason.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/finishreason.md b/packages/gcp/docs/models/completionresponsestreamchoicefinishreason.md similarity index 81% rename from packages/mistralai_azure/docs/models/finishreason.md rename to packages/gcp/docs/models/completionresponsestreamchoicefinishreason.md index 45a5aedb..0fece473 100644 --- a/packages/mistralai_azure/docs/models/finishreason.md +++ b/packages/gcp/docs/models/completionresponsestreamchoicefinishreason.md @@ -1,4 +1,4 @@ -# FinishReason +# CompletionResponseStreamChoiceFinishReason ## Values diff --git a/packages/mistralai_gcp/docs/models/contentchunk.md b/packages/gcp/docs/models/contentchunk.md similarity index 100% rename from packages/mistralai_gcp/docs/models/contentchunk.md rename to packages/gcp/docs/models/contentchunk.md diff --git a/packages/gcp/docs/models/deltamessage.md b/packages/gcp/docs/models/deltamessage.md new file mode 100644 index 00000000..e0ee575f --- /dev/null +++ b/packages/gcp/docs/models/deltamessage.md @@ -0,0 +1,10 @@ +# DeltaMessage + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `role` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `content` | [OptionalNullable[models.DeltaMessageContent]](../models/deltamessagecontent.md) | :heavy_minus_sign: | N/A | +| `tool_calls` | List[[models.ToolCall](../models/toolcall.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/content.md b/packages/gcp/docs/models/deltamessagecontent.md similarity index 89% rename from packages/mistralai_azure/docs/models/content.md rename to packages/gcp/docs/models/deltamessagecontent.md index a833dc2c..8142772d 100644 --- a/packages/mistralai_azure/docs/models/content.md +++ b/packages/gcp/docs/models/deltamessagecontent.md @@ -1,4 +1,4 @@ -# Content +# DeltaMessageContent ## Supported Types diff --git a/packages/mistralai_gcp/docs/models/fimcompletionrequest.md b/packages/gcp/docs/models/fimcompletionrequest.md similarity index 100% rename from packages/mistralai_gcp/docs/models/fimcompletionrequest.md rename to packages/gcp/docs/models/fimcompletionrequest.md diff --git a/packages/mistralai_gcp/docs/models/fimcompletionrequeststop.md b/packages/gcp/docs/models/fimcompletionrequeststop.md similarity index 100% rename from packages/mistralai_gcp/docs/models/fimcompletionrequeststop.md rename to packages/gcp/docs/models/fimcompletionrequeststop.md diff --git a/packages/mistralai_gcp/docs/models/fimcompletionresponse.md b/packages/gcp/docs/models/fimcompletionresponse.md similarity index 100% rename from packages/mistralai_gcp/docs/models/fimcompletionresponse.md rename to packages/gcp/docs/models/fimcompletionresponse.md diff --git a/packages/mistralai_gcp/docs/models/fimcompletionstreamrequest.md b/packages/gcp/docs/models/fimcompletionstreamrequest.md similarity index 100% rename from packages/mistralai_gcp/docs/models/fimcompletionstreamrequest.md rename to packages/gcp/docs/models/fimcompletionstreamrequest.md diff --git a/packages/mistralai_gcp/docs/models/fimcompletionstreamrequeststop.md b/packages/gcp/docs/models/fimcompletionstreamrequeststop.md similarity index 100% rename from packages/mistralai_gcp/docs/models/fimcompletionstreamrequeststop.md rename to packages/gcp/docs/models/fimcompletionstreamrequeststop.md diff --git a/packages/mistralai_gcp/docs/models/function.md b/packages/gcp/docs/models/function.md similarity index 100% rename from packages/mistralai_gcp/docs/models/function.md rename to packages/gcp/docs/models/function.md diff --git a/packages/mistralai_gcp/docs/models/functioncall.md b/packages/gcp/docs/models/functioncall.md similarity index 100% rename from packages/mistralai_gcp/docs/models/functioncall.md rename to packages/gcp/docs/models/functioncall.md diff --git a/packages/mistralai_gcp/docs/models/functionname.md b/packages/gcp/docs/models/functionname.md similarity index 100% rename from packages/mistralai_gcp/docs/models/functionname.md rename to packages/gcp/docs/models/functionname.md diff --git a/packages/mistralai_gcp/docs/models/httpvalidationerror.md b/packages/gcp/docs/models/httpvalidationerror.md similarity index 100% rename from packages/mistralai_gcp/docs/models/httpvalidationerror.md rename to packages/gcp/docs/models/httpvalidationerror.md diff --git a/packages/mistralai_gcp/docs/models/imageurl.md b/packages/gcp/docs/models/imageurl.md similarity index 100% rename from packages/mistralai_gcp/docs/models/imageurl.md rename to packages/gcp/docs/models/imageurl.md diff --git a/packages/gcp/docs/models/imageurlchunk.md b/packages/gcp/docs/models/imageurlchunk.md new file mode 100644 index 00000000..a84dac32 --- /dev/null +++ b/packages/gcp/docs/models/imageurlchunk.md @@ -0,0 +1,11 @@ +# ImageURLChunk + +{"type":"image_url","image_url":{"url":"data:image/png;base64,iVBORw0 + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | +| `type` | *Literal["image_url"]* | :heavy_check_mark: | N/A | +| `image_url` | [models.ImageURLUnion](../models/imageurlunion.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/imageurlchunkimageurl.md b/packages/gcp/docs/models/imageurlunion.md similarity index 86% rename from packages/mistralai_azure/docs/models/imageurlchunkimageurl.md rename to packages/gcp/docs/models/imageurlunion.md index 76738908..db97130f 100644 --- a/packages/mistralai_azure/docs/models/imageurlchunkimageurl.md +++ b/packages/gcp/docs/models/imageurlunion.md @@ -1,4 +1,4 @@ -# ImageURLChunkImageURL +# ImageURLUnion ## Supported Types diff --git a/packages/mistralai_gcp/docs/models/jsonschema.md b/packages/gcp/docs/models/jsonschema.md similarity index 100% rename from packages/mistralai_gcp/docs/models/jsonschema.md rename to packages/gcp/docs/models/jsonschema.md diff --git a/packages/mistralai_gcp/docs/models/loc.md b/packages/gcp/docs/models/loc.md similarity index 100% rename from packages/mistralai_gcp/docs/models/loc.md rename to packages/gcp/docs/models/loc.md diff --git a/packages/mistralai_gcp/docs/models/mistralpromptmode.md b/packages/gcp/docs/models/mistralpromptmode.md similarity index 100% rename from packages/mistralai_gcp/docs/models/mistralpromptmode.md rename to packages/gcp/docs/models/mistralpromptmode.md diff --git a/packages/mistralai_gcp/docs/models/prediction.md b/packages/gcp/docs/models/prediction.md similarity index 100% rename from packages/mistralai_gcp/docs/models/prediction.md rename to packages/gcp/docs/models/prediction.md diff --git a/packages/gcp/docs/models/referencechunk.md b/packages/gcp/docs/models/referencechunk.md new file mode 100644 index 00000000..d847e248 --- /dev/null +++ b/packages/gcp/docs/models/referencechunk.md @@ -0,0 +1,9 @@ +# ReferenceChunk + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | +| `type` | *Optional[Literal["reference"]]* | :heavy_minus_sign: | N/A | +| `reference_ids` | List[*int*] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/responseformat.md b/packages/gcp/docs/models/responseformat.md similarity index 100% rename from packages/mistralai_gcp/docs/models/responseformat.md rename to packages/gcp/docs/models/responseformat.md diff --git a/packages/mistralai_gcp/docs/models/responseformats.md b/packages/gcp/docs/models/responseformats.md similarity index 100% rename from packages/mistralai_gcp/docs/models/responseformats.md rename to packages/gcp/docs/models/responseformats.md diff --git a/packages/mistralai_gcp/docs/models/security.md b/packages/gcp/docs/models/security.md similarity index 100% rename from packages/mistralai_gcp/docs/models/security.md rename to packages/gcp/docs/models/security.md diff --git a/packages/mistralai_azure/docs/models/systemmessage.md b/packages/gcp/docs/models/systemmessage.md similarity index 88% rename from packages/mistralai_azure/docs/models/systemmessage.md rename to packages/gcp/docs/models/systemmessage.md index 0dba71c0..10bda10f 100644 --- a/packages/mistralai_azure/docs/models/systemmessage.md +++ b/packages/gcp/docs/models/systemmessage.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | -| `content` | [models.SystemMessageContent](../models/systemmessagecontent.md) | :heavy_check_mark: | N/A | -| `role` | [Optional[models.Role]](../models/role.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `role` | *Literal["system"]* | :heavy_check_mark: | N/A | +| `content` | [models.SystemMessageContent](../models/systemmessagecontent.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/systemmessagecontent.md b/packages/gcp/docs/models/systemmessagecontent.md similarity index 100% rename from packages/mistralai_gcp/docs/models/systemmessagecontent.md rename to packages/gcp/docs/models/systemmessagecontent.md diff --git a/packages/mistralai_gcp/docs/models/systemmessagecontentchunks.md b/packages/gcp/docs/models/systemmessagecontentchunks.md similarity index 100% rename from packages/mistralai_gcp/docs/models/systemmessagecontentchunks.md rename to packages/gcp/docs/models/systemmessagecontentchunks.md diff --git a/packages/gcp/docs/models/textchunk.md b/packages/gcp/docs/models/textchunk.md new file mode 100644 index 00000000..b266619d --- /dev/null +++ b/packages/gcp/docs/models/textchunk.md @@ -0,0 +1,9 @@ +# TextChunk + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `type` | *Literal["text"]* | :heavy_check_mark: | N/A | +| `text` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/thinkchunk.md b/packages/gcp/docs/models/thinkchunk.md similarity index 91% rename from packages/mistralai_gcp/docs/models/thinkchunk.md rename to packages/gcp/docs/models/thinkchunk.md index 66b2e0cd..b07f598e 100644 --- a/packages/mistralai_gcp/docs/models/thinkchunk.md +++ b/packages/gcp/docs/models/thinkchunk.md @@ -5,6 +5,6 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | +| `type` | *Literal["thinking"]* | :heavy_check_mark: | N/A | | `thinking` | List[[models.Thinking](../models/thinking.md)] | :heavy_check_mark: | N/A | -| `closed` | *Optional[bool]* | :heavy_minus_sign: | Whether the thinking chunk is closed or not. Currently only used for prefixing. | -| `type` | [Optional[models.ThinkChunkType]](../models/thinkchunktype.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `closed` | *Optional[bool]* | :heavy_minus_sign: | Whether the thinking chunk is closed or not. Currently only used for prefixing. | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/thinking.md b/packages/gcp/docs/models/thinking.md similarity index 100% rename from packages/mistralai_gcp/docs/models/thinking.md rename to packages/gcp/docs/models/thinking.md diff --git a/packages/mistralai_gcp/docs/models/tool.md b/packages/gcp/docs/models/tool.md similarity index 100% rename from packages/mistralai_gcp/docs/models/tool.md rename to packages/gcp/docs/models/tool.md diff --git a/packages/mistralai_gcp/docs/models/toolcall.md b/packages/gcp/docs/models/toolcall.md similarity index 100% rename from packages/mistralai_gcp/docs/models/toolcall.md rename to packages/gcp/docs/models/toolcall.md diff --git a/packages/mistralai_gcp/docs/models/toolchoice.md b/packages/gcp/docs/models/toolchoice.md similarity index 100% rename from packages/mistralai_gcp/docs/models/toolchoice.md rename to packages/gcp/docs/models/toolchoice.md diff --git a/packages/mistralai_gcp/docs/models/toolchoiceenum.md b/packages/gcp/docs/models/toolchoiceenum.md similarity index 100% rename from packages/mistralai_gcp/docs/models/toolchoiceenum.md rename to packages/gcp/docs/models/toolchoiceenum.md diff --git a/packages/mistralai_azure/docs/models/toolmessage.md b/packages/gcp/docs/models/toolmessage.md similarity index 92% rename from packages/mistralai_azure/docs/models/toolmessage.md rename to packages/gcp/docs/models/toolmessage.md index a54f4933..7201481e 100644 --- a/packages/mistralai_azure/docs/models/toolmessage.md +++ b/packages/gcp/docs/models/toolmessage.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `role` | *Literal["tool"]* | :heavy_check_mark: | N/A | | `content` | [Nullable[models.ToolMessageContent]](../models/toolmessagecontent.md) | :heavy_check_mark: | N/A | | `tool_call_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `role` | [Optional[models.ToolMessageRole]](../models/toolmessagerole.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/toolmessagecontent.md b/packages/gcp/docs/models/toolmessagecontent.md similarity index 100% rename from packages/mistralai_gcp/docs/models/toolmessagecontent.md rename to packages/gcp/docs/models/toolmessagecontent.md diff --git a/packages/mistralai_gcp/docs/models/tooltypes.md b/packages/gcp/docs/models/tooltypes.md similarity index 100% rename from packages/mistralai_gcp/docs/models/tooltypes.md rename to packages/gcp/docs/models/tooltypes.md diff --git a/packages/mistralai_gcp/docs/models/usageinfo.md b/packages/gcp/docs/models/usageinfo.md similarity index 100% rename from packages/mistralai_gcp/docs/models/usageinfo.md rename to packages/gcp/docs/models/usageinfo.md diff --git a/packages/mistralai_azure/docs/models/usermessage.md b/packages/gcp/docs/models/usermessage.md similarity index 89% rename from packages/mistralai_azure/docs/models/usermessage.md rename to packages/gcp/docs/models/usermessage.md index 63b01310..e7a932ed 100644 --- a/packages/mistralai_azure/docs/models/usermessage.md +++ b/packages/gcp/docs/models/usermessage.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | -| `content` | [Nullable[models.UserMessageContent]](../models/usermessagecontent.md) | :heavy_check_mark: | N/A | -| `role` | [Optional[models.UserMessageRole]](../models/usermessagerole.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `role` | *Literal["user"]* | :heavy_check_mark: | N/A | +| `content` | [Nullable[models.UserMessageContent]](../models/usermessagecontent.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/usermessagecontent.md b/packages/gcp/docs/models/usermessagecontent.md similarity index 100% rename from packages/mistralai_gcp/docs/models/usermessagecontent.md rename to packages/gcp/docs/models/usermessagecontent.md diff --git a/packages/mistralai_gcp/docs/models/utils/retryconfig.md b/packages/gcp/docs/models/utils/retryconfig.md similarity index 100% rename from packages/mistralai_gcp/docs/models/utils/retryconfig.md rename to packages/gcp/docs/models/utils/retryconfig.md diff --git a/packages/mistralai_gcp/docs/models/validationerror.md b/packages/gcp/docs/models/validationerror.md similarity index 100% rename from packages/mistralai_gcp/docs/models/validationerror.md rename to packages/gcp/docs/models/validationerror.md diff --git a/packages/mistralai_gcp/docs/sdks/chat/README.md b/packages/gcp/docs/sdks/chat/README.md similarity index 99% rename from packages/mistralai_gcp/docs/sdks/chat/README.md rename to packages/gcp/docs/sdks/chat/README.md index 6f5f1977..3fc4f708 100644 --- a/packages/mistralai_gcp/docs/sdks/chat/README.md +++ b/packages/gcp/docs/sdks/chat/README.md @@ -17,7 +17,7 @@ Mistral AI provides the ability to stream responses back to a client in order to ### Example Usage ```python -from mistralai_gcp import MistralGCP +from mistralai.gcp.client import MistralGCP import os s = MistralGCP() @@ -72,7 +72,7 @@ Chat Completion ### Example Usage ```python -from mistralai_gcp import MistralGCP +from mistralai.gcp.client import MistralGCP import os s = MistralGCP() diff --git a/packages/mistralai_gcp/docs/sdks/fim/README.md b/packages/gcp/docs/sdks/fim/README.md similarity index 99% rename from packages/mistralai_gcp/docs/sdks/fim/README.md rename to packages/gcp/docs/sdks/fim/README.md index b997fabf..a4c13bd6 100644 --- a/packages/mistralai_gcp/docs/sdks/fim/README.md +++ b/packages/gcp/docs/sdks/fim/README.md @@ -17,7 +17,7 @@ Mistral AI provides the ability to stream responses back to a client in order to ### Example Usage ```python -from mistralai_gcp import MistralGCP +from mistralai.gcp.client import MistralGCP import os s = MistralGCP() @@ -65,7 +65,7 @@ FIM completion. ### Example Usage ```python -from mistralai_gcp import MistralGCP +from mistralai.gcp.client import MistralGCP import os s = MistralGCP() diff --git a/packages/mistralai_gcp/docs/sdks/mistralgcp/README.md b/packages/gcp/docs/sdks/mistralgcp/README.md similarity index 100% rename from packages/mistralai_gcp/docs/sdks/mistralgcp/README.md rename to packages/gcp/docs/sdks/mistralgcp/README.md diff --git a/packages/mistralai_gcp/py.typed b/packages/gcp/py.typed similarity index 100% rename from packages/mistralai_gcp/py.typed rename to packages/gcp/py.typed diff --git a/packages/mistralai_gcp/pylintrc b/packages/gcp/pylintrc similarity index 100% rename from packages/mistralai_gcp/pylintrc rename to packages/gcp/pylintrc diff --git a/packages/mistralai_gcp/pyproject.toml b/packages/gcp/pyproject.toml similarity index 80% rename from packages/mistralai_gcp/pyproject.toml rename to packages/gcp/pyproject.toml index df3e43ae..5a0684d5 100644 --- a/packages/mistralai_gcp/pyproject.toml +++ b/packages/gcp/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "mistralai-gcp" -version = "1.8.0" +version = "2.0.0a4" description = "Python Client SDK for the Mistral AI API in GCP." authors = [{ name = "Mistral" }] requires-python = ">=3.10" @@ -9,7 +9,7 @@ dependencies = [ "eval-type-backport >=0.2.0", "google-auth (>=2.31.0,<3.0.0)", "httpx >=0.28.1", - "pydantic >=2.10.3", + "pydantic >=2.11.2", "python-dateutil >=2.8.2", "requests (>=2.32.3,<3.0.0)", "typing-inspection >=0.4.0", @@ -17,7 +17,7 @@ dependencies = [ [dependency-groups] dev = [ - "mypy==1.14.1", + "mypy==1.15.0", "pylint==3.2.3", "pyright>=1.1.401,<2", "pytest>=8.2.2,<9", @@ -26,20 +26,20 @@ dev = [ ] [tool.setuptools.package-data] -"*" = ["py.typed", "src/mistralai_gcp/py.typed"] +"*" = ["py.typed", "src/mistralai/gcp/client/py.typed"] [tool.hatch.build.targets.sdist] -include = ["src/mistralai_gcp"] +include = ["src/mistralai"] [tool.hatch.build.targets.sdist.force-include] "py.typed" = "py.typed" -"src/mistralai_gcp/py.typed" = "src/mistralai_gcp/py.typed" +"src/mistralai/gcp/client/py.typed" = "src/mistralai/gcp/client/py.typed" [tool.hatch.build.targets.wheel] -include = ["src/mistralai_gcp"] +include = ["src/mistralai"] [tool.hatch.build.targets.wheel.sources] -"src/mistralai_gcp" = "mistralai_gcp" +"src" = "" [virtualenvs] in-project = true @@ -53,6 +53,8 @@ pythonpath = ["src"] [tool.mypy] disable_error_code = "misc" +explicit_package_bases = true +mypy_path = "src" [[tool.mypy.overrides]] module = "typing_inspect" diff --git a/packages/mistralai_azure/scripts/prepare_readme.py b/packages/gcp/scripts/prepare_readme.py similarity index 96% rename from packages/mistralai_azure/scripts/prepare_readme.py rename to packages/gcp/scripts/prepare_readme.py index ff1121fd..ae27b555 100644 --- a/packages/mistralai_azure/scripts/prepare_readme.py +++ b/packages/gcp/scripts/prepare_readme.py @@ -10,7 +10,7 @@ GITHUB_URL = ( GITHUB_URL[: -len(".git")] if GITHUB_URL.endswith(".git") else GITHUB_URL ) - REPO_SUBDIR = "packages/mistralai_azure" + REPO_SUBDIR = "packages/gcp" # Ensure the subdirectory has a trailing slash if not REPO_SUBDIR.endswith("/"): REPO_SUBDIR += "/" diff --git a/packages/mistralai_gcp/scripts/publish.sh b/packages/gcp/scripts/publish.sh similarity index 100% rename from packages/mistralai_gcp/scripts/publish.sh rename to packages/gcp/scripts/publish.sh diff --git a/packages/mistralai_gcp/src/mistralai_gcp/__init__.py b/packages/gcp/src/mistralai/gcp/client/__init__.py similarity index 100% rename from packages/mistralai_gcp/src/mistralai_gcp/__init__.py rename to packages/gcp/src/mistralai/gcp/client/__init__.py diff --git a/packages/mistralai_gcp/src/mistralai_gcp/_hooks/__init__.py b/packages/gcp/src/mistralai/gcp/client/_hooks/__init__.py similarity index 100% rename from packages/mistralai_gcp/src/mistralai_gcp/_hooks/__init__.py rename to packages/gcp/src/mistralai/gcp/client/_hooks/__init__.py diff --git a/packages/gcp/src/mistralai/gcp/client/_hooks/registration.py b/packages/gcp/src/mistralai/gcp/client/_hooks/registration.py new file mode 100644 index 00000000..afb4ad91 --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/_hooks/registration.py @@ -0,0 +1,43 @@ +from .types import BeforeRequestHook, BeforeRequestContext, Hooks +import httpx + + +# This file is only ever generated once on the first generation and then is free to be modified. +# Any hooks you wish to add should be registered in the init_hooks function. Feel free to define them +# in this file or in separate files in the hooks folder. + + +class GCPCustomMethodPathHook(BeforeRequestHook): + """Rewrite Vertex AI custom method paths from /rawPredict to :rawPredict. + + Google Cloud APIs use colon-prefixed custom methods (e.g., :rawPredict) + but OpenAPI 3.x requires paths to start with /. This hook fixes the URL + at request time. + """ + + REWRITES = { + "/rawPredict": ":rawPredict", + "/streamRawPredict": ":streamRawPredict", + } + + def before_request( + self, hook_ctx: BeforeRequestContext, request: httpx.Request + ) -> httpx.Request: + path = request.url.path # excludes query params and fragments + for old, new in self.REWRITES.items(): + if path.endswith(old): + url_str = str(request.url) + idx = url_str.rfind(old) + if idx != -1: + url_str = url_str[:idx] + new + url_str[idx + len(old):] + return httpx.Request( + method=request.method, + url=url_str, + headers=request.headers, + content=request.content, + ) + return request + + +def init_hooks(hooks: Hooks): + hooks.register_before_request_hook(GCPCustomMethodPathHook()) diff --git a/packages/mistralai_gcp/src/mistralai_gcp/_hooks/sdkhooks.py b/packages/gcp/src/mistralai/gcp/client/_hooks/sdkhooks.py similarity index 97% rename from packages/mistralai_gcp/src/mistralai_gcp/_hooks/sdkhooks.py rename to packages/gcp/src/mistralai/gcp/client/_hooks/sdkhooks.py index b81c2a27..2af4deed 100644 --- a/packages/mistralai_gcp/src/mistralai_gcp/_hooks/sdkhooks.py +++ b/packages/gcp/src/mistralai/gcp/client/_hooks/sdkhooks.py @@ -13,7 +13,7 @@ ) from .registration import init_hooks from typing import List, Optional, Tuple -from mistralai_gcp.httpclient import HttpClient +from mistralai.gcp.client.httpclient import HttpClient class SDKHooks(Hooks): diff --git a/packages/mistralai_azure/src/mistralai_azure/_hooks/types.py b/packages/gcp/src/mistralai/gcp/client/_hooks/types.py similarity index 96% rename from packages/mistralai_azure/src/mistralai_azure/_hooks/types.py rename to packages/gcp/src/mistralai/gcp/client/_hooks/types.py index 0c22d7eb..ea95bed2 100644 --- a/packages/mistralai_azure/src/mistralai_azure/_hooks/types.py +++ b/packages/gcp/src/mistralai/gcp/client/_hooks/types.py @@ -2,8 +2,8 @@ from abc import ABC, abstractmethod import httpx -from mistralai_azure.httpclient import HttpClient -from mistralai_azure.sdkconfiguration import SDKConfiguration +from mistralai.gcp.client.httpclient import HttpClient +from mistralai.gcp.client.sdkconfiguration import SDKConfiguration from typing import Any, Callable, List, Optional, Tuple, Union diff --git a/packages/mistralai_gcp/src/mistralai_gcp/_version.py b/packages/gcp/src/mistralai/gcp/client/_version.py similarity index 76% rename from packages/mistralai_gcp/src/mistralai_gcp/_version.py rename to packages/gcp/src/mistralai/gcp/client/_version.py index a170f0ab..ba48dac1 100644 --- a/packages/mistralai_gcp/src/mistralai_gcp/_version.py +++ b/packages/gcp/src/mistralai/gcp/client/_version.py @@ -3,10 +3,10 @@ import importlib.metadata __title__: str = "mistralai-gcp" -__version__: str = "1.8.0" +__version__: str = "2.0.0a4" __openapi_doc_version__: str = "1.0.0" __gen_version__: str = "2.794.1" -__user_agent__: str = "speakeasy-sdk/python 1.8.0 2.794.1 1.0.0 mistralai-gcp" +__user_agent__: str = "speakeasy-sdk/python 2.0.0a4 2.794.1 1.0.0 mistralai-gcp" try: if __package__ is not None: diff --git a/packages/mistralai_gcp/src/mistralai_gcp/basesdk.py b/packages/gcp/src/mistralai/gcp/client/basesdk.py similarity index 98% rename from packages/mistralai_gcp/src/mistralai_gcp/basesdk.py rename to packages/gcp/src/mistralai/gcp/client/basesdk.py index 7a93de23..6f9f5fd9 100644 --- a/packages/mistralai_gcp/src/mistralai_gcp/basesdk.py +++ b/packages/gcp/src/mistralai/gcp/client/basesdk.py @@ -2,13 +2,17 @@ from .sdkconfiguration import SDKConfiguration import httpx -from mistralai_gcp import models, utils -from mistralai_gcp._hooks import ( +from mistralai.gcp.client import models, utils +from mistralai.gcp.client._hooks import ( AfterErrorContext, AfterSuccessContext, BeforeRequestContext, ) -from mistralai_gcp.utils import RetryConfig, SerializedRequestBody, get_body_content +from mistralai.gcp.client.utils import ( + RetryConfig, + SerializedRequestBody, + get_body_content, +) from typing import Callable, List, Mapping, Optional, Tuple from urllib.parse import parse_qs, urlparse diff --git a/packages/mistralai_gcp/src/mistralai_gcp/chat.py b/packages/gcp/src/mistralai/gcp/client/chat.py similarity index 96% rename from packages/mistralai_gcp/src/mistralai_gcp/chat.py rename to packages/gcp/src/mistralai/gcp/client/chat.py index 3dd6040f..78541248 100644 --- a/packages/mistralai_gcp/src/mistralai_gcp/chat.py +++ b/packages/gcp/src/mistralai/gcp/client/chat.py @@ -1,11 +1,11 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from .basesdk import BaseSDK -from mistralai_gcp import models, utils -from mistralai_gcp._hooks import HookContext -from mistralai_gcp.types import OptionalNullable, UNSET -from mistralai_gcp.utils import eventstreaming -from mistralai_gcp.utils.unmarshal_json_response import unmarshal_json_response +from mistralai.gcp.client import models, utils +from mistralai.gcp.client._hooks import HookContext +from mistralai.gcp.client.types import OptionalNullable, UNSET +from mistralai.gcp.client.utils import eventstreaming +from mistralai.gcp.client.utils.unmarshal_json_response import unmarshal_json_response from typing import Any, Dict, List, Mapping, Optional, Union @@ -16,12 +16,20 @@ def stream( self, *, model: str, - messages: Union[List[models.Messages], List[models.MessagesTypedDict]], + messages: Union[ + List[models.ChatCompletionStreamRequestMessage], + List[models.ChatCompletionStreamRequestMessageTypedDict], + ], temperature: OptionalNullable[float] = UNSET, top_p: Optional[float] = None, max_tokens: OptionalNullable[int] = UNSET, stream: Optional[bool] = True, - stop: Optional[Union[models.Stop, models.StopTypedDict]] = None, + stop: Optional[ + Union[ + models.ChatCompletionStreamRequestStop, + models.ChatCompletionStreamRequestStopTypedDict, + ] + ] = None, random_seed: OptionalNullable[int] = UNSET, metadata: OptionalNullable[Dict[str, Any]] = UNSET, response_format: Optional[ @@ -95,7 +103,9 @@ def stream( stop=stop, random_seed=random_seed, metadata=metadata, - messages=utils.get_pydantic_model(messages, List[models.Messages]), + messages=utils.get_pydantic_model( + messages, List[models.ChatCompletionStreamRequestMessage] + ), response_format=utils.get_pydantic_model( response_format, Optional[models.ResponseFormat] ), @@ -183,12 +193,20 @@ async def stream_async( self, *, model: str, - messages: Union[List[models.Messages], List[models.MessagesTypedDict]], + messages: Union[ + List[models.ChatCompletionStreamRequestMessage], + List[models.ChatCompletionStreamRequestMessageTypedDict], + ], temperature: OptionalNullable[float] = UNSET, top_p: Optional[float] = None, max_tokens: OptionalNullable[int] = UNSET, stream: Optional[bool] = True, - stop: Optional[Union[models.Stop, models.StopTypedDict]] = None, + stop: Optional[ + Union[ + models.ChatCompletionStreamRequestStop, + models.ChatCompletionStreamRequestStopTypedDict, + ] + ] = None, random_seed: OptionalNullable[int] = UNSET, metadata: OptionalNullable[Dict[str, Any]] = UNSET, response_format: Optional[ @@ -262,7 +280,9 @@ async def stream_async( stop=stop, random_seed=random_seed, metadata=metadata, - messages=utils.get_pydantic_model(messages, List[models.Messages]), + messages=utils.get_pydantic_model( + messages, List[models.ChatCompletionStreamRequestMessage] + ), response_format=utils.get_pydantic_model( response_format, Optional[models.ResponseFormat] ), @@ -351,8 +371,8 @@ def complete( *, model: str, messages: Union[ - List[models.ChatCompletionRequestMessages], - List[models.ChatCompletionRequestMessagesTypedDict], + List[models.ChatCompletionRequestMessage], + List[models.ChatCompletionRequestMessageTypedDict], ], temperature: OptionalNullable[float] = UNSET, top_p: Optional[float] = None, @@ -436,7 +456,7 @@ def complete( random_seed=random_seed, metadata=metadata, messages=utils.get_pydantic_model( - messages, List[models.ChatCompletionRequestMessages] + messages, List[models.ChatCompletionRequestMessage] ), response_format=utils.get_pydantic_model( response_format, Optional[models.ResponseFormat] @@ -518,8 +538,8 @@ async def complete_async( *, model: str, messages: Union[ - List[models.ChatCompletionRequestMessages], - List[models.ChatCompletionRequestMessagesTypedDict], + List[models.ChatCompletionRequestMessage], + List[models.ChatCompletionRequestMessageTypedDict], ], temperature: OptionalNullable[float] = UNSET, top_p: Optional[float] = None, @@ -603,7 +623,7 @@ async def complete_async( random_seed=random_seed, metadata=metadata, messages=utils.get_pydantic_model( - messages, List[models.ChatCompletionRequestMessages] + messages, List[models.ChatCompletionRequestMessage] ), response_format=utils.get_pydantic_model( response_format, Optional[models.ResponseFormat] diff --git a/packages/mistralai_gcp/src/mistralai_gcp/fim.py b/packages/gcp/src/mistralai/gcp/client/fim.py similarity index 98% rename from packages/mistralai_gcp/src/mistralai_gcp/fim.py rename to packages/gcp/src/mistralai/gcp/client/fim.py index 36d9fd60..e2acacd5 100644 --- a/packages/mistralai_gcp/src/mistralai_gcp/fim.py +++ b/packages/gcp/src/mistralai/gcp/client/fim.py @@ -1,11 +1,11 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from .basesdk import BaseSDK -from mistralai_gcp import models, utils -from mistralai_gcp._hooks import HookContext -from mistralai_gcp.types import OptionalNullable, UNSET -from mistralai_gcp.utils import eventstreaming -from mistralai_gcp.utils.unmarshal_json_response import unmarshal_json_response +from mistralai.gcp.client import models, utils +from mistralai.gcp.client._hooks import HookContext +from mistralai.gcp.client.types import OptionalNullable, UNSET +from mistralai.gcp.client.utils import eventstreaming +from mistralai.gcp.client.utils.unmarshal_json_response import unmarshal_json_response from typing import Any, Dict, Mapping, Optional, Union diff --git a/packages/mistralai_gcp/src/mistralai_gcp/httpclient.py b/packages/gcp/src/mistralai/gcp/client/httpclient.py similarity index 100% rename from packages/mistralai_gcp/src/mistralai_gcp/httpclient.py rename to packages/gcp/src/mistralai/gcp/client/httpclient.py diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/__init__.py b/packages/gcp/src/mistralai/gcp/client/models/__init__.py similarity index 85% rename from packages/mistralai_gcp/src/mistralai_gcp/models/__init__.py rename to packages/gcp/src/mistralai/gcp/client/models/__init__.py index fe85b133..275af8ec 100644 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/__init__.py +++ b/packages/gcp/src/mistralai/gcp/client/models/__init__.py @@ -1,6 +1,6 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" -from .mistralgcperror import MistralGcpError +from .mistralgcperror import MistralGCPError from typing import TYPE_CHECKING from importlib import import_module import builtins @@ -11,7 +11,6 @@ AssistantMessage, AssistantMessageContent, AssistantMessageContentTypedDict, - AssistantMessageRole, AssistantMessageTypedDict, ) from .chatcompletionchoice import ( @@ -21,8 +20,8 @@ ) from .chatcompletionrequest import ( ChatCompletionRequest, - ChatCompletionRequestMessages, - ChatCompletionRequestMessagesTypedDict, + ChatCompletionRequestMessage, + ChatCompletionRequestMessageTypedDict, ChatCompletionRequestStop, ChatCompletionRequestStopTypedDict, ChatCompletionRequestToolChoice, @@ -35,26 +34,26 @@ ) from .chatcompletionstreamrequest import ( ChatCompletionStreamRequest, + ChatCompletionStreamRequestMessage, + ChatCompletionStreamRequestMessageTypedDict, + ChatCompletionStreamRequestStop, + ChatCompletionStreamRequestStopTypedDict, ChatCompletionStreamRequestToolChoice, ChatCompletionStreamRequestToolChoiceTypedDict, ChatCompletionStreamRequestTypedDict, - Messages, - MessagesTypedDict, - Stop, - StopTypedDict, ) from .completionchunk import CompletionChunk, CompletionChunkTypedDict from .completionevent import CompletionEvent, CompletionEventTypedDict from .completionresponsestreamchoice import ( CompletionResponseStreamChoice, + CompletionResponseStreamChoiceFinishReason, CompletionResponseStreamChoiceTypedDict, - FinishReason, ) from .contentchunk import ContentChunk, ContentChunkTypedDict from .deltamessage import ( - Content, - ContentTypedDict, DeltaMessage, + DeltaMessageContent, + DeltaMessageContentTypedDict, DeltaMessageTypedDict, ) from .fimcompletionrequest import ( @@ -85,27 +84,21 @@ from .imageurl import ImageURL, ImageURLTypedDict from .imageurlchunk import ( ImageURLChunk, - ImageURLChunkImageURL, - ImageURLChunkImageURLTypedDict, - ImageURLChunkType, ImageURLChunkTypedDict, + ImageURLUnion, + ImageURLUnionTypedDict, ) from .jsonschema import JSONSchema, JSONSchemaTypedDict from .mistralpromptmode import MistralPromptMode from .no_response_error import NoResponseError from .prediction import Prediction, PredictionTypedDict - from .referencechunk import ( - ReferenceChunk, - ReferenceChunkType, - ReferenceChunkTypedDict, - ) + from .referencechunk import ReferenceChunk, ReferenceChunkTypedDict from .responseformat import ResponseFormat, ResponseFormatTypedDict from .responseformats import ResponseFormats from .responsevalidationerror import ResponseValidationError from .sdkerror import SDKError from .security import Security, SecurityTypedDict from .systemmessage import ( - Role, SystemMessage, SystemMessageContent, SystemMessageContentTypedDict, @@ -115,14 +108,8 @@ SystemMessageContentChunks, SystemMessageContentChunksTypedDict, ) - from .textchunk import TextChunk, TextChunkTypedDict, Type - from .thinkchunk import ( - ThinkChunk, - ThinkChunkType, - ThinkChunkTypedDict, - Thinking, - ThinkingTypedDict, - ) + from .textchunk import TextChunk, TextChunkTypedDict + from .thinkchunk import ThinkChunk, ThinkChunkTypedDict, Thinking, ThinkingTypedDict from .tool import Tool, ToolTypedDict from .toolcall import ToolCall, ToolCallTypedDict from .toolchoice import ToolChoice, ToolChoiceTypedDict @@ -131,7 +118,6 @@ ToolMessage, ToolMessageContent, ToolMessageContentTypedDict, - ToolMessageRole, ToolMessageTypedDict, ) from .tooltypes import ToolTypes @@ -140,7 +126,6 @@ UserMessage, UserMessageContent, UserMessageContentTypedDict, - UserMessageRole, UserMessageTypedDict, ) from .validationerror import ( @@ -156,14 +141,13 @@ "AssistantMessage", "AssistantMessageContent", "AssistantMessageContentTypedDict", - "AssistantMessageRole", "AssistantMessageTypedDict", "ChatCompletionChoice", "ChatCompletionChoiceFinishReason", "ChatCompletionChoiceTypedDict", "ChatCompletionRequest", - "ChatCompletionRequestMessages", - "ChatCompletionRequestMessagesTypedDict", + "ChatCompletionRequestMessage", + "ChatCompletionRequestMessageTypedDict", "ChatCompletionRequestStop", "ChatCompletionRequestStopTypedDict", "ChatCompletionRequestToolChoice", @@ -172,6 +156,10 @@ "ChatCompletionResponse", "ChatCompletionResponseTypedDict", "ChatCompletionStreamRequest", + "ChatCompletionStreamRequestMessage", + "ChatCompletionStreamRequestMessageTypedDict", + "ChatCompletionStreamRequestStop", + "ChatCompletionStreamRequestStopTypedDict", "ChatCompletionStreamRequestToolChoice", "ChatCompletionStreamRequestToolChoiceTypedDict", "ChatCompletionStreamRequestTypedDict", @@ -180,12 +168,13 @@ "CompletionEvent", "CompletionEventTypedDict", "CompletionResponseStreamChoice", + "CompletionResponseStreamChoiceFinishReason", "CompletionResponseStreamChoiceTypedDict", - "Content", "ContentChunk", "ContentChunkTypedDict", - "ContentTypedDict", "DeltaMessage", + "DeltaMessageContent", + "DeltaMessageContentTypedDict", "DeltaMessageTypedDict", "FIMCompletionRequest", "FIMCompletionRequestStop", @@ -197,7 +186,6 @@ "FIMCompletionStreamRequestStop", "FIMCompletionStreamRequestStopTypedDict", "FIMCompletionStreamRequestTypedDict", - "FinishReason", "Function", "FunctionCall", "FunctionCallTypedDict", @@ -208,35 +196,28 @@ "HTTPValidationErrorData", "ImageURL", "ImageURLChunk", - "ImageURLChunkImageURL", - "ImageURLChunkImageURLTypedDict", - "ImageURLChunkType", "ImageURLChunkTypedDict", "ImageURLTypedDict", + "ImageURLUnion", + "ImageURLUnionTypedDict", "JSONSchema", "JSONSchemaTypedDict", "Loc", "LocTypedDict", - "Messages", - "MessagesTypedDict", - "MistralGcpError", + "MistralGCPError", "MistralPromptMode", "NoResponseError", "Prediction", "PredictionTypedDict", "ReferenceChunk", - "ReferenceChunkType", "ReferenceChunkTypedDict", "ResponseFormat", "ResponseFormatTypedDict", "ResponseFormats", "ResponseValidationError", - "Role", "SDKError", "Security", "SecurityTypedDict", - "Stop", - "StopTypedDict", "SystemMessage", "SystemMessageContent", "SystemMessageContentChunks", @@ -246,7 +227,6 @@ "TextChunk", "TextChunkTypedDict", "ThinkChunk", - "ThinkChunkType", "ThinkChunkTypedDict", "Thinking", "ThinkingTypedDict", @@ -259,17 +239,14 @@ "ToolMessage", "ToolMessageContent", "ToolMessageContentTypedDict", - "ToolMessageRole", "ToolMessageTypedDict", "ToolTypedDict", "ToolTypes", - "Type", "UsageInfo", "UsageInfoTypedDict", "UserMessage", "UserMessageContent", "UserMessageContentTypedDict", - "UserMessageRole", "UserMessageTypedDict", "ValidationError", "ValidationErrorTypedDict", @@ -279,14 +256,13 @@ "AssistantMessage": ".assistantmessage", "AssistantMessageContent": ".assistantmessage", "AssistantMessageContentTypedDict": ".assistantmessage", - "AssistantMessageRole": ".assistantmessage", "AssistantMessageTypedDict": ".assistantmessage", "ChatCompletionChoice": ".chatcompletionchoice", "ChatCompletionChoiceFinishReason": ".chatcompletionchoice", "ChatCompletionChoiceTypedDict": ".chatcompletionchoice", "ChatCompletionRequest": ".chatcompletionrequest", - "ChatCompletionRequestMessages": ".chatcompletionrequest", - "ChatCompletionRequestMessagesTypedDict": ".chatcompletionrequest", + "ChatCompletionRequestMessage": ".chatcompletionrequest", + "ChatCompletionRequestMessageTypedDict": ".chatcompletionrequest", "ChatCompletionRequestStop": ".chatcompletionrequest", "ChatCompletionRequestStopTypedDict": ".chatcompletionrequest", "ChatCompletionRequestToolChoice": ".chatcompletionrequest", @@ -295,25 +271,25 @@ "ChatCompletionResponse": ".chatcompletionresponse", "ChatCompletionResponseTypedDict": ".chatcompletionresponse", "ChatCompletionStreamRequest": ".chatcompletionstreamrequest", + "ChatCompletionStreamRequestMessage": ".chatcompletionstreamrequest", + "ChatCompletionStreamRequestMessageTypedDict": ".chatcompletionstreamrequest", + "ChatCompletionStreamRequestStop": ".chatcompletionstreamrequest", + "ChatCompletionStreamRequestStopTypedDict": ".chatcompletionstreamrequest", "ChatCompletionStreamRequestToolChoice": ".chatcompletionstreamrequest", "ChatCompletionStreamRequestToolChoiceTypedDict": ".chatcompletionstreamrequest", "ChatCompletionStreamRequestTypedDict": ".chatcompletionstreamrequest", - "Messages": ".chatcompletionstreamrequest", - "MessagesTypedDict": ".chatcompletionstreamrequest", - "Stop": ".chatcompletionstreamrequest", - "StopTypedDict": ".chatcompletionstreamrequest", "CompletionChunk": ".completionchunk", "CompletionChunkTypedDict": ".completionchunk", "CompletionEvent": ".completionevent", "CompletionEventTypedDict": ".completionevent", "CompletionResponseStreamChoice": ".completionresponsestreamchoice", + "CompletionResponseStreamChoiceFinishReason": ".completionresponsestreamchoice", "CompletionResponseStreamChoiceTypedDict": ".completionresponsestreamchoice", - "FinishReason": ".completionresponsestreamchoice", "ContentChunk": ".contentchunk", "ContentChunkTypedDict": ".contentchunk", - "Content": ".deltamessage", - "ContentTypedDict": ".deltamessage", "DeltaMessage": ".deltamessage", + "DeltaMessageContent": ".deltamessage", + "DeltaMessageContentTypedDict": ".deltamessage", "DeltaMessageTypedDict": ".deltamessage", "FIMCompletionRequest": ".fimcompletionrequest", "FIMCompletionRequestStop": ".fimcompletionrequest", @@ -338,10 +314,9 @@ "ImageURL": ".imageurl", "ImageURLTypedDict": ".imageurl", "ImageURLChunk": ".imageurlchunk", - "ImageURLChunkImageURL": ".imageurlchunk", - "ImageURLChunkImageURLTypedDict": ".imageurlchunk", - "ImageURLChunkType": ".imageurlchunk", "ImageURLChunkTypedDict": ".imageurlchunk", + "ImageURLUnion": ".imageurlchunk", + "ImageURLUnionTypedDict": ".imageurlchunk", "JSONSchema": ".jsonschema", "JSONSchemaTypedDict": ".jsonschema", "MistralPromptMode": ".mistralpromptmode", @@ -349,7 +324,6 @@ "Prediction": ".prediction", "PredictionTypedDict": ".prediction", "ReferenceChunk": ".referencechunk", - "ReferenceChunkType": ".referencechunk", "ReferenceChunkTypedDict": ".referencechunk", "ResponseFormat": ".responseformat", "ResponseFormatTypedDict": ".responseformat", @@ -358,7 +332,6 @@ "SDKError": ".sdkerror", "Security": ".security", "SecurityTypedDict": ".security", - "Role": ".systemmessage", "SystemMessage": ".systemmessage", "SystemMessageContent": ".systemmessage", "SystemMessageContentTypedDict": ".systemmessage", @@ -367,9 +340,7 @@ "SystemMessageContentChunksTypedDict": ".systemmessagecontentchunks", "TextChunk": ".textchunk", "TextChunkTypedDict": ".textchunk", - "Type": ".textchunk", "ThinkChunk": ".thinkchunk", - "ThinkChunkType": ".thinkchunk", "ThinkChunkTypedDict": ".thinkchunk", "Thinking": ".thinkchunk", "ThinkingTypedDict": ".thinkchunk", @@ -383,7 +354,6 @@ "ToolMessage": ".toolmessage", "ToolMessageContent": ".toolmessage", "ToolMessageContentTypedDict": ".toolmessage", - "ToolMessageRole": ".toolmessage", "ToolMessageTypedDict": ".toolmessage", "ToolTypes": ".tooltypes", "UsageInfo": ".usageinfo", @@ -391,7 +361,6 @@ "UserMessage": ".usermessage", "UserMessageContent": ".usermessage", "UserMessageContentTypedDict": ".usermessage", - "UserMessageRole": ".usermessage", "UserMessageTypedDict": ".usermessage", "Loc": ".validationerror", "LocTypedDict": ".validationerror", diff --git a/packages/mistralai_azure/src/mistralai_azure/models/assistantmessage.py b/packages/gcp/src/mistralai/gcp/client/models/assistantmessage.py similarity index 81% rename from packages/mistralai_azure/src/mistralai_azure/models/assistantmessage.py rename to packages/gcp/src/mistralai/gcp/client/models/assistantmessage.py index 7790eb10..7061775b 100644 --- a/packages/mistralai_azure/src/mistralai_azure/models/assistantmessage.py +++ b/packages/gcp/src/mistralai/gcp/client/models/assistantmessage.py @@ -3,16 +3,19 @@ from __future__ import annotations from .contentchunk import ContentChunk, ContentChunkTypedDict from .toolcall import ToolCall, ToolCallTypedDict -from mistralai_azure.types import ( +from mistralai.gcp.client.types import ( BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL, ) +from mistralai.gcp.client.utils import validate_const +import pydantic from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator from typing import List, Literal, Optional, Union -from typing_extensions import NotRequired, TypeAliasType, TypedDict +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict AssistantMessageContentTypedDict = TypeAliasType( @@ -25,18 +28,22 @@ ) -AssistantMessageRole = Literal["assistant",] - - class AssistantMessageTypedDict(TypedDict): + role: Literal["assistant"] content: NotRequired[Nullable[AssistantMessageContentTypedDict]] tool_calls: NotRequired[Nullable[List[ToolCallTypedDict]]] prefix: NotRequired[bool] r"""Set this to `true` when adding an assistant message as prefix to condition the model response. The role of the prefix message is to force the model to start its answer by the content of the message.""" - role: NotRequired[AssistantMessageRole] class AssistantMessage(BaseModel): + ROLE: Annotated[ + Annotated[ + Optional[Literal["assistant"]], AfterValidator(validate_const("assistant")) + ], + pydantic.Field(alias="role"), + ] = "assistant" + content: OptionalNullable[AssistantMessageContent] = UNSET tool_calls: OptionalNullable[List[ToolCall]] = UNSET @@ -44,11 +51,9 @@ class AssistantMessage(BaseModel): prefix: Optional[bool] = False r"""Set this to `true` when adding an assistant message as prefix to condition the model response. The role of the prefix message is to force the model to start its answer by the content of the message.""" - role: Optional[AssistantMessageRole] = "assistant" - @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = ["content", "tool_calls", "prefix", "role"] + optional_fields = ["role", "content", "tool_calls", "prefix"] nullable_fields = ["content", "tool_calls"] null_default_fields = [] diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/chatcompletionchoice.py b/packages/gcp/src/mistralai/gcp/client/models/chatcompletionchoice.py similarity index 91% rename from packages/mistralai_gcp/src/mistralai_gcp/models/chatcompletionchoice.py rename to packages/gcp/src/mistralai/gcp/client/models/chatcompletionchoice.py index fe3ee952..ae5a2fbf 100644 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/chatcompletionchoice.py +++ b/packages/gcp/src/mistralai/gcp/client/models/chatcompletionchoice.py @@ -2,7 +2,7 @@ from __future__ import annotations from .assistantmessage import AssistantMessage, AssistantMessageTypedDict -from mistralai_gcp.types import BaseModel, UnrecognizedStr +from mistralai.gcp.client.types import BaseModel, UnrecognizedStr from typing import Literal, Union from typing_extensions import TypedDict diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/chatcompletionrequest.py b/packages/gcp/src/mistralai/gcp/client/models/chatcompletionrequest.py similarity index 97% rename from packages/mistralai_gcp/src/mistralai_gcp/models/chatcompletionrequest.py rename to packages/gcp/src/mistralai/gcp/client/models/chatcompletionrequest.py index 80345f9d..1bc03922 100644 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/chatcompletionrequest.py +++ b/packages/gcp/src/mistralai/gcp/client/models/chatcompletionrequest.py @@ -11,14 +11,14 @@ from .toolchoiceenum import ToolChoiceEnum from .toolmessage import ToolMessage, ToolMessageTypedDict from .usermessage import UserMessage, UserMessageTypedDict -from mistralai_gcp.types import ( +from mistralai.gcp.client.types import ( BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL, ) -from mistralai_gcp.utils import get_discriminator +from mistralai.gcp.client.utils import get_discriminator from pydantic import Discriminator, Tag, model_serializer from typing import Any, Dict, List, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -36,8 +36,8 @@ r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" -ChatCompletionRequestMessagesTypedDict = TypeAliasType( - "ChatCompletionRequestMessagesTypedDict", +ChatCompletionRequestMessageTypedDict = TypeAliasType( + "ChatCompletionRequestMessageTypedDict", Union[ SystemMessageTypedDict, UserMessageTypedDict, @@ -47,7 +47,7 @@ ) -ChatCompletionRequestMessages = Annotated[ +ChatCompletionRequestMessage = Annotated[ Union[ Annotated[AssistantMessage, Tag("assistant")], Annotated[SystemMessage, Tag("system")], @@ -74,7 +74,7 @@ class ChatCompletionRequestTypedDict(TypedDict): model: str r"""ID of the model to use. You can use the [List Available Models](/api/#tag/models/operation/list_models_v1_models_get) API to see all of your available models, or see our [Model overview](/models) for model descriptions.""" - messages: List[ChatCompletionRequestMessagesTypedDict] + messages: List[ChatCompletionRequestMessageTypedDict] r"""The prompt(s) to generate completions for, encoded as a list of dict with role and content.""" temperature: NotRequired[Nullable[float]] r"""What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value.""" @@ -113,7 +113,7 @@ class ChatCompletionRequest(BaseModel): model: str r"""ID of the model to use. You can use the [List Available Models](/api/#tag/models/operation/list_models_v1_models_get) API to see all of your available models, or see our [Model overview](/models) for model descriptions.""" - messages: List[ChatCompletionRequestMessages] + messages: List[ChatCompletionRequestMessage] r"""The prompt(s) to generate completions for, encoded as a list of dict with role and content.""" temperature: OptionalNullable[float] = UNSET diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/chatcompletionresponse.py b/packages/gcp/src/mistralai/gcp/client/models/chatcompletionresponse.py similarity index 93% rename from packages/mistralai_gcp/src/mistralai_gcp/models/chatcompletionresponse.py rename to packages/gcp/src/mistralai/gcp/client/models/chatcompletionresponse.py index a7953eb1..317c4d84 100644 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/chatcompletionresponse.py +++ b/packages/gcp/src/mistralai/gcp/client/models/chatcompletionresponse.py @@ -3,7 +3,7 @@ from __future__ import annotations from .chatcompletionchoice import ChatCompletionChoice, ChatCompletionChoiceTypedDict from .usageinfo import UsageInfo, UsageInfoTypedDict -from mistralai_gcp.types import BaseModel +from mistralai.gcp.client.types import BaseModel from typing import List from typing_extensions import TypedDict diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/chatcompletionstreamrequest.py b/packages/gcp/src/mistralai/gcp/client/models/chatcompletionstreamrequest.py similarity index 94% rename from packages/mistralai_gcp/src/mistralai_gcp/models/chatcompletionstreamrequest.py rename to packages/gcp/src/mistralai/gcp/client/models/chatcompletionstreamrequest.py index e857d515..0a5a0021 100644 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/chatcompletionstreamrequest.py +++ b/packages/gcp/src/mistralai/gcp/client/models/chatcompletionstreamrequest.py @@ -11,29 +11,33 @@ from .toolchoiceenum import ToolChoiceEnum from .toolmessage import ToolMessage, ToolMessageTypedDict from .usermessage import UserMessage, UserMessageTypedDict -from mistralai_gcp.types import ( +from mistralai.gcp.client.types import ( BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL, ) -from mistralai_gcp.utils import get_discriminator +from mistralai.gcp.client.utils import get_discriminator from pydantic import Discriminator, Tag, model_serializer from typing import Any, Dict, List, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict -StopTypedDict = TypeAliasType("StopTypedDict", Union[str, List[str]]) +ChatCompletionStreamRequestStopTypedDict = TypeAliasType( + "ChatCompletionStreamRequestStopTypedDict", Union[str, List[str]] +) r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" -Stop = TypeAliasType("Stop", Union[str, List[str]]) +ChatCompletionStreamRequestStop = TypeAliasType( + "ChatCompletionStreamRequestStop", Union[str, List[str]] +) r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" -MessagesTypedDict = TypeAliasType( - "MessagesTypedDict", +ChatCompletionStreamRequestMessageTypedDict = TypeAliasType( + "ChatCompletionStreamRequestMessageTypedDict", Union[ SystemMessageTypedDict, UserMessageTypedDict, @@ -43,7 +47,7 @@ ) -Messages = Annotated[ +ChatCompletionStreamRequestMessage = Annotated[ Union[ Annotated[AssistantMessage, Tag("assistant")], Annotated[SystemMessage, Tag("system")], @@ -70,7 +74,7 @@ class ChatCompletionStreamRequestTypedDict(TypedDict): model: str r"""ID of the model to use. You can use the [List Available Models](/api/#tag/models/operation/list_models_v1_models_get) API to see all of your available models, or see our [Model overview](/models) for model descriptions.""" - messages: List[MessagesTypedDict] + messages: List[ChatCompletionStreamRequestMessageTypedDict] r"""The prompt(s) to generate completions for, encoded as a list of dict with role and content.""" temperature: NotRequired[Nullable[float]] r"""What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value.""" @@ -79,7 +83,7 @@ class ChatCompletionStreamRequestTypedDict(TypedDict): max_tokens: NotRequired[Nullable[int]] r"""The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length.""" stream: NotRequired[bool] - stop: NotRequired[StopTypedDict] + stop: NotRequired[ChatCompletionStreamRequestStopTypedDict] r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" random_seed: NotRequired[Nullable[int]] r"""The seed to use for random sampling. If set, different calls will generate deterministic results.""" @@ -108,7 +112,7 @@ class ChatCompletionStreamRequest(BaseModel): model: str r"""ID of the model to use. You can use the [List Available Models](/api/#tag/models/operation/list_models_v1_models_get) API to see all of your available models, or see our [Model overview](/models) for model descriptions.""" - messages: List[Messages] + messages: List[ChatCompletionStreamRequestMessage] r"""The prompt(s) to generate completions for, encoded as a list of dict with role and content.""" temperature: OptionalNullable[float] = UNSET @@ -122,7 +126,7 @@ class ChatCompletionStreamRequest(BaseModel): stream: Optional[bool] = True - stop: Optional[Stop] = None + stop: Optional[ChatCompletionStreamRequestStop] = None r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" random_seed: OptionalNullable[int] = UNSET diff --git a/packages/mistralai_azure/src/mistralai_azure/models/completionchunk.py b/packages/gcp/src/mistralai/gcp/client/models/completionchunk.py similarity index 94% rename from packages/mistralai_azure/src/mistralai_azure/models/completionchunk.py rename to packages/gcp/src/mistralai/gcp/client/models/completionchunk.py index d6cc2a86..9e54cb6d 100644 --- a/packages/mistralai_azure/src/mistralai_azure/models/completionchunk.py +++ b/packages/gcp/src/mistralai/gcp/client/models/completionchunk.py @@ -6,7 +6,7 @@ CompletionResponseStreamChoiceTypedDict, ) from .usageinfo import UsageInfo, UsageInfoTypedDict -from mistralai_azure.types import BaseModel +from mistralai.gcp.client.types import BaseModel from typing import List, Optional from typing_extensions import NotRequired, TypedDict diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/completionevent.py b/packages/gcp/src/mistralai/gcp/client/models/completionevent.py similarity index 88% rename from packages/mistralai_gcp/src/mistralai_gcp/models/completionevent.py rename to packages/gcp/src/mistralai/gcp/client/models/completionevent.py index 33278c11..bb155009 100644 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/completionevent.py +++ b/packages/gcp/src/mistralai/gcp/client/models/completionevent.py @@ -2,7 +2,7 @@ from __future__ import annotations from .completionchunk import CompletionChunk, CompletionChunkTypedDict -from mistralai_gcp.types import BaseModel +from mistralai.gcp.client.types import BaseModel from typing_extensions import TypedDict diff --git a/packages/mistralai_azure/src/mistralai_azure/models/completionresponsestreamchoice.py b/packages/gcp/src/mistralai/gcp/client/models/completionresponsestreamchoice.py similarity index 82% rename from packages/mistralai_azure/src/mistralai_azure/models/completionresponsestreamchoice.py rename to packages/gcp/src/mistralai/gcp/client/models/completionresponsestreamchoice.py index 0e890aac..6f306721 100644 --- a/packages/mistralai_azure/src/mistralai_azure/models/completionresponsestreamchoice.py +++ b/packages/gcp/src/mistralai/gcp/client/models/completionresponsestreamchoice.py @@ -2,13 +2,18 @@ from __future__ import annotations from .deltamessage import DeltaMessage, DeltaMessageTypedDict -from mistralai_azure.types import BaseModel, Nullable, UNSET_SENTINEL, UnrecognizedStr +from mistralai.gcp.client.types import ( + BaseModel, + Nullable, + UNSET_SENTINEL, + UnrecognizedStr, +) from pydantic import model_serializer from typing import Literal, Union from typing_extensions import TypedDict -FinishReason = Union[ +CompletionResponseStreamChoiceFinishReason = Union[ Literal[ "stop", "length", @@ -22,7 +27,7 @@ class CompletionResponseStreamChoiceTypedDict(TypedDict): index: int delta: DeltaMessageTypedDict - finish_reason: Nullable[FinishReason] + finish_reason: Nullable[CompletionResponseStreamChoiceFinishReason] class CompletionResponseStreamChoice(BaseModel): @@ -30,7 +35,7 @@ class CompletionResponseStreamChoice(BaseModel): delta: DeltaMessage - finish_reason: Nullable[FinishReason] + finish_reason: Nullable[CompletionResponseStreamChoiceFinishReason] @model_serializer(mode="wrap") def serialize_model(self, handler): diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/contentchunk.py b/packages/gcp/src/mistralai/gcp/client/models/contentchunk.py similarity index 93% rename from packages/mistralai_gcp/src/mistralai_gcp/models/contentchunk.py rename to packages/gcp/src/mistralai/gcp/client/models/contentchunk.py index da5671e3..1cd9e502 100644 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/contentchunk.py +++ b/packages/gcp/src/mistralai/gcp/client/models/contentchunk.py @@ -4,7 +4,7 @@ from .imageurlchunk import ImageURLChunk, ImageURLChunkTypedDict from .referencechunk import ReferenceChunk, ReferenceChunkTypedDict from .textchunk import TextChunk, TextChunkTypedDict -from mistralai_gcp.utils import get_discriminator +from mistralai.gcp.client.utils import get_discriminator from pydantic import Discriminator, Tag from typing import Union from typing_extensions import Annotated, TypeAliasType diff --git a/packages/mistralai_azure/src/mistralai_azure/models/deltamessage.py b/packages/gcp/src/mistralai/gcp/client/models/deltamessage.py similarity index 81% rename from packages/mistralai_azure/src/mistralai_azure/models/deltamessage.py rename to packages/gcp/src/mistralai/gcp/client/models/deltamessage.py index 7fa3c3f2..96923518 100644 --- a/packages/mistralai_azure/src/mistralai_azure/models/deltamessage.py +++ b/packages/gcp/src/mistralai/gcp/client/models/deltamessage.py @@ -3,7 +3,7 @@ from __future__ import annotations from .contentchunk import ContentChunk, ContentChunkTypedDict from .toolcall import ToolCall, ToolCallTypedDict -from mistralai_azure.types import ( +from mistralai.gcp.client.types import ( BaseModel, Nullable, OptionalNullable, @@ -15,24 +15,26 @@ from typing_extensions import NotRequired, TypeAliasType, TypedDict -ContentTypedDict = TypeAliasType( - "ContentTypedDict", Union[str, List[ContentChunkTypedDict]] +DeltaMessageContentTypedDict = TypeAliasType( + "DeltaMessageContentTypedDict", Union[str, List[ContentChunkTypedDict]] ) -Content = TypeAliasType("Content", Union[str, List[ContentChunk]]) +DeltaMessageContent = TypeAliasType( + "DeltaMessageContent", Union[str, List[ContentChunk]] +) class DeltaMessageTypedDict(TypedDict): role: NotRequired[Nullable[str]] - content: NotRequired[Nullable[ContentTypedDict]] + content: NotRequired[Nullable[DeltaMessageContentTypedDict]] tool_calls: NotRequired[Nullable[List[ToolCallTypedDict]]] class DeltaMessage(BaseModel): role: OptionalNullable[str] = UNSET - content: OptionalNullable[Content] = UNSET + content: OptionalNullable[DeltaMessageContent] = UNSET tool_calls: OptionalNullable[List[ToolCall]] = UNSET diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/fimcompletionrequest.py b/packages/gcp/src/mistralai/gcp/client/models/fimcompletionrequest.py similarity index 99% rename from packages/mistralai_gcp/src/mistralai_gcp/models/fimcompletionrequest.py rename to packages/gcp/src/mistralai/gcp/client/models/fimcompletionrequest.py index bcc97c90..f37bbcc3 100644 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/fimcompletionrequest.py +++ b/packages/gcp/src/mistralai/gcp/client/models/fimcompletionrequest.py @@ -1,7 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from mistralai_gcp.types import ( +from mistralai.gcp.client.types import ( BaseModel, Nullable, OptionalNullable, diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/fimcompletionresponse.py b/packages/gcp/src/mistralai/gcp/client/models/fimcompletionresponse.py similarity index 93% rename from packages/mistralai_gcp/src/mistralai_gcp/models/fimcompletionresponse.py rename to packages/gcp/src/mistralai/gcp/client/models/fimcompletionresponse.py index e1940b0a..5b80da3f 100644 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/fimcompletionresponse.py +++ b/packages/gcp/src/mistralai/gcp/client/models/fimcompletionresponse.py @@ -3,7 +3,7 @@ from __future__ import annotations from .chatcompletionchoice import ChatCompletionChoice, ChatCompletionChoiceTypedDict from .usageinfo import UsageInfo, UsageInfoTypedDict -from mistralai_gcp.types import BaseModel +from mistralai.gcp.client.types import BaseModel from typing import List from typing_extensions import TypedDict diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/fimcompletionstreamrequest.py b/packages/gcp/src/mistralai/gcp/client/models/fimcompletionstreamrequest.py similarity index 99% rename from packages/mistralai_gcp/src/mistralai_gcp/models/fimcompletionstreamrequest.py rename to packages/gcp/src/mistralai/gcp/client/models/fimcompletionstreamrequest.py index 34d2ba65..8e610261 100644 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/fimcompletionstreamrequest.py +++ b/packages/gcp/src/mistralai/gcp/client/models/fimcompletionstreamrequest.py @@ -1,7 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from mistralai_gcp.types import ( +from mistralai.gcp.client.types import ( BaseModel, Nullable, OptionalNullable, diff --git a/packages/mistralai_azure/src/mistralai_azure/models/function.py b/packages/gcp/src/mistralai/gcp/client/models/function.py similarity index 91% rename from packages/mistralai_azure/src/mistralai_azure/models/function.py rename to packages/gcp/src/mistralai/gcp/client/models/function.py index a4642f92..28577eff 100644 --- a/packages/mistralai_azure/src/mistralai_azure/models/function.py +++ b/packages/gcp/src/mistralai/gcp/client/models/function.py @@ -1,7 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from mistralai_azure.types import BaseModel +from mistralai.gcp.client.types import BaseModel from typing import Any, Dict, Optional from typing_extensions import NotRequired, TypedDict diff --git a/packages/mistralai_azure/src/mistralai_azure/models/functioncall.py b/packages/gcp/src/mistralai/gcp/client/models/functioncall.py similarity index 91% rename from packages/mistralai_azure/src/mistralai_azure/models/functioncall.py rename to packages/gcp/src/mistralai/gcp/client/models/functioncall.py index dd93c462..0f1b2425 100644 --- a/packages/mistralai_azure/src/mistralai_azure/models/functioncall.py +++ b/packages/gcp/src/mistralai/gcp/client/models/functioncall.py @@ -1,7 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from mistralai_azure.types import BaseModel +from mistralai.gcp.client.types import BaseModel from typing import Any, Dict, Union from typing_extensions import TypeAliasType, TypedDict diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/functionname.py b/packages/gcp/src/mistralai/gcp/client/models/functionname.py similarity index 89% rename from packages/mistralai_gcp/src/mistralai_gcp/models/functionname.py rename to packages/gcp/src/mistralai/gcp/client/models/functionname.py index 00ec22f5..585b9e39 100644 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/functionname.py +++ b/packages/gcp/src/mistralai/gcp/client/models/functionname.py @@ -1,7 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from mistralai_gcp.types import BaseModel +from mistralai.gcp.client.types import BaseModel from typing_extensions import TypedDict diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/httpvalidationerror.py b/packages/gcp/src/mistralai/gcp/client/models/httpvalidationerror.py similarity index 82% rename from packages/mistralai_gcp/src/mistralai_gcp/models/httpvalidationerror.py rename to packages/gcp/src/mistralai/gcp/client/models/httpvalidationerror.py index 79609351..57df7260 100644 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/httpvalidationerror.py +++ b/packages/gcp/src/mistralai/gcp/client/models/httpvalidationerror.py @@ -4,8 +4,8 @@ from .validationerror import ValidationError from dataclasses import dataclass, field import httpx -from mistralai_gcp.models import MistralGcpError -from mistralai_gcp.types import BaseModel +from mistralai.gcp.client.models import MistralGCPError +from mistralai.gcp.client.types import BaseModel from typing import List, Optional @@ -14,7 +14,7 @@ class HTTPValidationErrorData(BaseModel): @dataclass(unsafe_hash=True) -class HTTPValidationError(MistralGcpError): +class HTTPValidationError(MistralGCPError): data: HTTPValidationErrorData = field(hash=False) def __init__( diff --git a/packages/mistralai_azure/src/mistralai_azure/models/imageurl.py b/packages/gcp/src/mistralai/gcp/client/models/imageurl.py similarity index 97% rename from packages/mistralai_azure/src/mistralai_azure/models/imageurl.py rename to packages/gcp/src/mistralai/gcp/client/models/imageurl.py index a5a66360..e66d77ec 100644 --- a/packages/mistralai_azure/src/mistralai_azure/models/imageurl.py +++ b/packages/gcp/src/mistralai/gcp/client/models/imageurl.py @@ -1,7 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from mistralai_azure.types import ( +from mistralai.gcp.client.types import ( BaseModel, Nullable, OptionalNullable, diff --git a/packages/gcp/src/mistralai/gcp/client/models/imageurlchunk.py b/packages/gcp/src/mistralai/gcp/client/models/imageurlchunk.py new file mode 100644 index 00000000..fc5284c1 --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/models/imageurlchunk.py @@ -0,0 +1,36 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .imageurl import ImageURL, ImageURLTypedDict +from mistralai.gcp.client.types import BaseModel +from mistralai.gcp.client.utils import validate_const +import pydantic +from pydantic.functional_validators import AfterValidator +from typing import Literal, Union +from typing_extensions import Annotated, TypeAliasType, TypedDict + + +ImageURLUnionTypedDict = TypeAliasType( + "ImageURLUnionTypedDict", Union[ImageURLTypedDict, str] +) + + +ImageURLUnion = TypeAliasType("ImageURLUnion", Union[ImageURL, str]) + + +class ImageURLChunkTypedDict(TypedDict): + r"""{\"type\":\"image_url\",\"image_url\":{\"url\":\"data:image/png;base64,iVBORw0""" + + image_url: ImageURLUnionTypedDict + type: Literal["image_url"] + + +class ImageURLChunk(BaseModel): + r"""{\"type\":\"image_url\",\"image_url\":{\"url\":\"data:image/png;base64,iVBORw0""" + + image_url: ImageURLUnion + + TYPE: Annotated[ + Annotated[Literal["image_url"], AfterValidator(validate_const("image_url"))], + pydantic.Field(alias="type"), + ] = "image_url" diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/jsonschema.py b/packages/gcp/src/mistralai/gcp/client/models/jsonschema.py similarity index 97% rename from packages/mistralai_gcp/src/mistralai_gcp/models/jsonschema.py rename to packages/gcp/src/mistralai/gcp/client/models/jsonschema.py index 26914b2f..443c429d 100644 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/jsonschema.py +++ b/packages/gcp/src/mistralai/gcp/client/models/jsonschema.py @@ -1,7 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from mistralai_gcp.types import ( +from mistralai.gcp.client.types import ( BaseModel, Nullable, OptionalNullable, diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/mistralgcperror.py b/packages/gcp/src/mistralai/gcp/client/models/mistralgcperror.py similarity index 96% rename from packages/mistralai_gcp/src/mistralai_gcp/models/mistralgcperror.py rename to packages/gcp/src/mistralai/gcp/client/models/mistralgcperror.py index fec729a5..9de91bf2 100644 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/mistralgcperror.py +++ b/packages/gcp/src/mistralai/gcp/client/models/mistralgcperror.py @@ -6,7 +6,7 @@ @dataclass(unsafe_hash=True) -class MistralGcpError(Exception): +class MistralGCPError(Exception): """The base class for all HTTP error responses.""" message: str diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/mistralpromptmode.py b/packages/gcp/src/mistralai/gcp/client/models/mistralpromptmode.py similarity index 89% rename from packages/mistralai_gcp/src/mistralai_gcp/models/mistralpromptmode.py rename to packages/gcp/src/mistralai/gcp/client/models/mistralpromptmode.py index a5cc534f..c765e4f1 100644 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/mistralpromptmode.py +++ b/packages/gcp/src/mistralai/gcp/client/models/mistralpromptmode.py @@ -1,7 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from mistralai_gcp.types import UnrecognizedStr +from mistralai.gcp.client.types import UnrecognizedStr from typing import Literal, Union diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/no_response_error.py b/packages/gcp/src/mistralai/gcp/client/models/no_response_error.py similarity index 100% rename from packages/mistralai_gcp/src/mistralai_gcp/models/no_response_error.py rename to packages/gcp/src/mistralai/gcp/client/models/no_response_error.py diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/prediction.py b/packages/gcp/src/mistralai/gcp/client/models/prediction.py similarity index 89% rename from packages/mistralai_gcp/src/mistralai_gcp/models/prediction.py rename to packages/gcp/src/mistralai/gcp/client/models/prediction.py index 36c87ab0..f53579ed 100644 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/prediction.py +++ b/packages/gcp/src/mistralai/gcp/client/models/prediction.py @@ -1,8 +1,8 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from mistralai_gcp.types import BaseModel -from mistralai_gcp.utils import validate_const +from mistralai.gcp.client.types import BaseModel +from mistralai.gcp.client.utils import validate_const import pydantic from pydantic.functional_validators import AfterValidator from typing import Literal, Optional diff --git a/packages/gcp/src/mistralai/gcp/client/models/referencechunk.py b/packages/gcp/src/mistralai/gcp/client/models/referencechunk.py new file mode 100644 index 00000000..274ea7f7 --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/models/referencechunk.py @@ -0,0 +1,25 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from mistralai.gcp.client.types import BaseModel +from mistralai.gcp.client.utils import validate_const +import pydantic +from pydantic.functional_validators import AfterValidator +from typing import List, Literal, Optional +from typing_extensions import Annotated, TypedDict + + +class ReferenceChunkTypedDict(TypedDict): + reference_ids: List[int] + type: Literal["reference"] + + +class ReferenceChunk(BaseModel): + reference_ids: List[int] + + TYPE: Annotated[ + Annotated[ + Optional[Literal["reference"]], AfterValidator(validate_const("reference")) + ], + pydantic.Field(alias="type"), + ] = "reference" diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/responseformat.py b/packages/gcp/src/mistralai/gcp/client/models/responseformat.py similarity index 98% rename from packages/mistralai_gcp/src/mistralai_gcp/models/responseformat.py rename to packages/gcp/src/mistralai/gcp/client/models/responseformat.py index 9fe5116c..34ae6b03 100644 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/responseformat.py +++ b/packages/gcp/src/mistralai/gcp/client/models/responseformat.py @@ -3,7 +3,7 @@ from __future__ import annotations from .jsonschema import JSONSchema, JSONSchemaTypedDict from .responseformats import ResponseFormats -from mistralai_gcp.types import ( +from mistralai.gcp.client.types import ( BaseModel, Nullable, OptionalNullable, diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/responseformats.py b/packages/gcp/src/mistralai/gcp/client/models/responseformats.py similarity index 100% rename from packages/mistralai_gcp/src/mistralai_gcp/models/responseformats.py rename to packages/gcp/src/mistralai/gcp/client/models/responseformats.py diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/responsevalidationerror.py b/packages/gcp/src/mistralai/gcp/client/models/responsevalidationerror.py similarity index 86% rename from packages/mistralai_gcp/src/mistralai_gcp/models/responsevalidationerror.py rename to packages/gcp/src/mistralai/gcp/client/models/responsevalidationerror.py index ebd4f214..0e86ea6c 100644 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/responsevalidationerror.py +++ b/packages/gcp/src/mistralai/gcp/client/models/responsevalidationerror.py @@ -4,11 +4,11 @@ from typing import Optional from dataclasses import dataclass -from mistralai_gcp.models import MistralGcpError +from mistralai.gcp.client.models import MistralGCPError @dataclass(unsafe_hash=True) -class ResponseValidationError(MistralGcpError): +class ResponseValidationError(MistralGCPError): """Error raised when there is a type mismatch between the response data and the expected Pydantic model.""" def __init__( diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/sdkerror.py b/packages/gcp/src/mistralai/gcp/client/models/sdkerror.py similarity index 93% rename from packages/mistralai_gcp/src/mistralai_gcp/models/sdkerror.py rename to packages/gcp/src/mistralai/gcp/client/models/sdkerror.py index 7f53bbcd..00bc1d99 100644 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/sdkerror.py +++ b/packages/gcp/src/mistralai/gcp/client/models/sdkerror.py @@ -4,13 +4,13 @@ from typing import Optional from dataclasses import dataclass -from mistralai_gcp.models import MistralGcpError +from mistralai.gcp.client.models import MistralGCPError MAX_MESSAGE_LEN = 10_000 @dataclass(unsafe_hash=True) -class SDKError(MistralGcpError): +class SDKError(MistralGCPError): """The fallback error class if no more specific error class is matched.""" def __init__( diff --git a/packages/mistralai_azure/src/mistralai_azure/models/security.py b/packages/gcp/src/mistralai/gcp/client/models/security.py similarity index 81% rename from packages/mistralai_azure/src/mistralai_azure/models/security.py rename to packages/gcp/src/mistralai/gcp/client/models/security.py index c1ae8313..10a469b5 100644 --- a/packages/mistralai_azure/src/mistralai_azure/models/security.py +++ b/packages/gcp/src/mistralai/gcp/client/models/security.py @@ -1,8 +1,8 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from mistralai_azure.types import BaseModel -from mistralai_azure.utils import FieldMetadata, SecurityMetadata +from mistralai.gcp.client.types import BaseModel +from mistralai.gcp.client.utils import FieldMetadata, SecurityMetadata from typing_extensions import Annotated, TypedDict diff --git a/packages/mistralai_azure/src/mistralai_azure/models/systemmessage.py b/packages/gcp/src/mistralai/gcp/client/models/systemmessage.py similarity index 57% rename from packages/mistralai_azure/src/mistralai_azure/models/systemmessage.py rename to packages/gcp/src/mistralai/gcp/client/models/systemmessage.py index f99bf4ff..a7d695a7 100644 --- a/packages/mistralai_azure/src/mistralai_azure/models/systemmessage.py +++ b/packages/gcp/src/mistralai/gcp/client/models/systemmessage.py @@ -5,9 +5,12 @@ SystemMessageContentChunks, SystemMessageContentChunksTypedDict, ) -from mistralai_azure.types import BaseModel -from typing import List, Literal, Optional, Union -from typing_extensions import NotRequired, TypeAliasType, TypedDict +from mistralai.gcp.client.types import BaseModel +from mistralai.gcp.client.utils import validate_const +import pydantic +from pydantic.functional_validators import AfterValidator +from typing import List, Literal, Union +from typing_extensions import Annotated, TypeAliasType, TypedDict SystemMessageContentTypedDict = TypeAliasType( @@ -21,15 +24,15 @@ ) -Role = Literal["system",] - - class SystemMessageTypedDict(TypedDict): content: SystemMessageContentTypedDict - role: NotRequired[Role] + role: Literal["system"] class SystemMessage(BaseModel): content: SystemMessageContent - role: Optional[Role] = "system" + ROLE: Annotated[ + Annotated[Literal["system"], AfterValidator(validate_const("system"))], + pydantic.Field(alias="role"), + ] = "system" diff --git a/packages/mistralai_azure/src/mistralai_azure/models/systemmessagecontentchunks.py b/packages/gcp/src/mistralai/gcp/client/models/systemmessagecontentchunks.py similarity index 66% rename from packages/mistralai_azure/src/mistralai_azure/models/systemmessagecontentchunks.py rename to packages/gcp/src/mistralai/gcp/client/models/systemmessagecontentchunks.py index 4615a16c..225f38b7 100644 --- a/packages/mistralai_azure/src/mistralai_azure/models/systemmessagecontentchunks.py +++ b/packages/gcp/src/mistralai/gcp/client/models/systemmessagecontentchunks.py @@ -3,8 +3,7 @@ from __future__ import annotations from .textchunk import TextChunk, TextChunkTypedDict from .thinkchunk import ThinkChunk, ThinkChunkTypedDict -from mistralai_azure.utils import get_discriminator -from pydantic import Discriminator, Tag +from pydantic import Field from typing import Union from typing_extensions import Annotated, TypeAliasType @@ -16,6 +15,5 @@ SystemMessageContentChunks = Annotated[ - Union[Annotated[TextChunk, Tag("text")], Annotated[ThinkChunk, Tag("thinking")]], - Discriminator(lambda m: get_discriminator(m, "type", "type")), + Union[TextChunk, ThinkChunk], Field(discriminator="TYPE") ] diff --git a/packages/gcp/src/mistralai/gcp/client/models/textchunk.py b/packages/gcp/src/mistralai/gcp/client/models/textchunk.py new file mode 100644 index 00000000..77576c9f --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/models/textchunk.py @@ -0,0 +1,23 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from mistralai.gcp.client.types import BaseModel +from mistralai.gcp.client.utils import validate_const +import pydantic +from pydantic.functional_validators import AfterValidator +from typing import Literal +from typing_extensions import Annotated, TypedDict + + +class TextChunkTypedDict(TypedDict): + text: str + type: Literal["text"] + + +class TextChunk(BaseModel): + text: str + + TYPE: Annotated[ + Annotated[Literal["text"], AfterValidator(validate_const("text"))], + pydantic.Field(alias="type"), + ] = "text" diff --git a/packages/mistralai_azure/src/mistralai_azure/models/thinkchunk.py b/packages/gcp/src/mistralai/gcp/client/models/thinkchunk.py similarity index 65% rename from packages/mistralai_azure/src/mistralai_azure/models/thinkchunk.py rename to packages/gcp/src/mistralai/gcp/client/models/thinkchunk.py index f53a9f1a..b65fffb2 100644 --- a/packages/mistralai_azure/src/mistralai_azure/models/thinkchunk.py +++ b/packages/gcp/src/mistralai/gcp/client/models/thinkchunk.py @@ -3,9 +3,12 @@ from __future__ import annotations from .referencechunk import ReferenceChunk, ReferenceChunkTypedDict from .textchunk import TextChunk, TextChunkTypedDict -from mistralai_azure.types import BaseModel +from mistralai.gcp.client.types import BaseModel +from mistralai.gcp.client.utils import validate_const +import pydantic +from pydantic.functional_validators import AfterValidator from typing import List, Literal, Optional, Union -from typing_extensions import NotRequired, TypeAliasType, TypedDict +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict ThinkingTypedDict = TypeAliasType( @@ -16,20 +19,20 @@ Thinking = TypeAliasType("Thinking", Union[ReferenceChunk, TextChunk]) -ThinkChunkType = Literal["thinking",] - - class ThinkChunkTypedDict(TypedDict): thinking: List[ThinkingTypedDict] + type: Literal["thinking"] closed: NotRequired[bool] r"""Whether the thinking chunk is closed or not. Currently only used for prefixing.""" - type: NotRequired[ThinkChunkType] class ThinkChunk(BaseModel): thinking: List[Thinking] + TYPE: Annotated[ + Annotated[Literal["thinking"], AfterValidator(validate_const("thinking"))], + pydantic.Field(alias="type"), + ] = "thinking" + closed: Optional[bool] = None r"""Whether the thinking chunk is closed or not. Currently only used for prefixing.""" - - type: Optional[ThinkChunkType] = "thinking" diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/tool.py b/packages/gcp/src/mistralai/gcp/client/models/tool.py similarity index 90% rename from packages/mistralai_gcp/src/mistralai_gcp/models/tool.py rename to packages/gcp/src/mistralai/gcp/client/models/tool.py index 800de633..d09c6854 100644 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/tool.py +++ b/packages/gcp/src/mistralai/gcp/client/models/tool.py @@ -3,7 +3,7 @@ from __future__ import annotations from .function import Function, FunctionTypedDict from .tooltypes import ToolTypes -from mistralai_gcp.types import BaseModel +from mistralai.gcp.client.types import BaseModel from typing import Optional from typing_extensions import NotRequired, TypedDict diff --git a/packages/mistralai_azure/src/mistralai_azure/models/toolcall.py b/packages/gcp/src/mistralai/gcp/client/models/toolcall.py similarity index 92% rename from packages/mistralai_azure/src/mistralai_azure/models/toolcall.py rename to packages/gcp/src/mistralai/gcp/client/models/toolcall.py index 44fe8ec8..a1edf337 100644 --- a/packages/mistralai_azure/src/mistralai_azure/models/toolcall.py +++ b/packages/gcp/src/mistralai/gcp/client/models/toolcall.py @@ -3,7 +3,7 @@ from __future__ import annotations from .functioncall import FunctionCall, FunctionCallTypedDict from .tooltypes import ToolTypes -from mistralai_azure.types import BaseModel +from mistralai.gcp.client.types import BaseModel from typing import Optional from typing_extensions import NotRequired, TypedDict diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/toolchoice.py b/packages/gcp/src/mistralai/gcp/client/models/toolchoice.py similarity index 94% rename from packages/mistralai_gcp/src/mistralai_gcp/models/toolchoice.py rename to packages/gcp/src/mistralai/gcp/client/models/toolchoice.py index 4a148330..de3828da 100644 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/toolchoice.py +++ b/packages/gcp/src/mistralai/gcp/client/models/toolchoice.py @@ -3,7 +3,7 @@ from __future__ import annotations from .functionname import FunctionName, FunctionNameTypedDict from .tooltypes import ToolTypes -from mistralai_gcp.types import BaseModel +from mistralai.gcp.client.types import BaseModel from typing import Optional from typing_extensions import NotRequired, TypedDict diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/toolchoiceenum.py b/packages/gcp/src/mistralai/gcp/client/models/toolchoiceenum.py similarity index 100% rename from packages/mistralai_gcp/src/mistralai_gcp/models/toolchoiceenum.py rename to packages/gcp/src/mistralai/gcp/client/models/toolchoiceenum.py diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/toolmessage.py b/packages/gcp/src/mistralai/gcp/client/models/toolmessage.py similarity index 77% rename from packages/mistralai_gcp/src/mistralai_gcp/models/toolmessage.py rename to packages/gcp/src/mistralai/gcp/client/models/toolmessage.py index d6aa2621..65b1d9d6 100644 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/toolmessage.py +++ b/packages/gcp/src/mistralai/gcp/client/models/toolmessage.py @@ -2,16 +2,19 @@ from __future__ import annotations from .contentchunk import ContentChunk, ContentChunkTypedDict -from mistralai_gcp.types import ( +from mistralai.gcp.client.types import ( BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL, ) +from mistralai.gcp.client.utils import validate_const +import pydantic from pydantic import model_serializer -from typing import List, Literal, Optional, Union -from typing_extensions import NotRequired, TypeAliasType, TypedDict +from pydantic.functional_validators import AfterValidator +from typing import List, Literal, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict ToolMessageContentTypedDict = TypeAliasType( @@ -22,28 +25,28 @@ ToolMessageContent = TypeAliasType("ToolMessageContent", Union[str, List[ContentChunk]]) -ToolMessageRole = Literal["tool",] - - class ToolMessageTypedDict(TypedDict): content: Nullable[ToolMessageContentTypedDict] + role: Literal["tool"] tool_call_id: NotRequired[Nullable[str]] name: NotRequired[Nullable[str]] - role: NotRequired[ToolMessageRole] class ToolMessage(BaseModel): content: Nullable[ToolMessageContent] + ROLE: Annotated[ + Annotated[Literal["tool"], AfterValidator(validate_const("tool"))], + pydantic.Field(alias="role"), + ] = "tool" + tool_call_id: OptionalNullable[str] = UNSET name: OptionalNullable[str] = UNSET - role: Optional[ToolMessageRole] = "tool" - @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = ["tool_call_id", "name", "role"] + optional_fields = ["tool_call_id", "name"] nullable_fields = ["content", "tool_call_id", "name"] null_default_fields = [] diff --git a/packages/mistralai_azure/src/mistralai_azure/models/tooltypes.py b/packages/gcp/src/mistralai/gcp/client/models/tooltypes.py similarity index 78% rename from packages/mistralai_azure/src/mistralai_azure/models/tooltypes.py rename to packages/gcp/src/mistralai/gcp/client/models/tooltypes.py index 638890c5..fd1aa13d 100644 --- a/packages/mistralai_azure/src/mistralai_azure/models/tooltypes.py +++ b/packages/gcp/src/mistralai/gcp/client/models/tooltypes.py @@ -1,7 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from mistralai_azure.types import UnrecognizedStr +from mistralai.gcp.client.types import UnrecognizedStr from typing import Literal, Union diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/usageinfo.py b/packages/gcp/src/mistralai/gcp/client/models/usageinfo.py similarity index 98% rename from packages/mistralai_gcp/src/mistralai_gcp/models/usageinfo.py rename to packages/gcp/src/mistralai/gcp/client/models/usageinfo.py index 59f36158..9b7207b1 100644 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/usageinfo.py +++ b/packages/gcp/src/mistralai/gcp/client/models/usageinfo.py @@ -1,7 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from mistralai_gcp.types import ( +from mistralai.gcp.client.types import ( BaseModel, Nullable, OptionalNullable, diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/usermessage.py b/packages/gcp/src/mistralai/gcp/client/models/usermessage.py similarity index 73% rename from packages/mistralai_gcp/src/mistralai_gcp/models/usermessage.py rename to packages/gcp/src/mistralai/gcp/client/models/usermessage.py index 0168b452..c083e16d 100644 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/usermessage.py +++ b/packages/gcp/src/mistralai/gcp/client/models/usermessage.py @@ -2,10 +2,13 @@ from __future__ import annotations from .contentchunk import ContentChunk, ContentChunkTypedDict -from mistralai_gcp.types import BaseModel, Nullable, UNSET_SENTINEL +from mistralai.gcp.client.types import BaseModel, Nullable, UNSET_SENTINEL +from mistralai.gcp.client.utils import validate_const +import pydantic from pydantic import model_serializer -from typing import List, Literal, Optional, Union -from typing_extensions import NotRequired, TypeAliasType, TypedDict +from pydantic.functional_validators import AfterValidator +from typing import List, Literal, Union +from typing_extensions import Annotated, TypeAliasType, TypedDict UserMessageContentTypedDict = TypeAliasType( @@ -16,22 +19,22 @@ UserMessageContent = TypeAliasType("UserMessageContent", Union[str, List[ContentChunk]]) -UserMessageRole = Literal["user",] - - class UserMessageTypedDict(TypedDict): content: Nullable[UserMessageContentTypedDict] - role: NotRequired[UserMessageRole] + role: Literal["user"] class UserMessage(BaseModel): content: Nullable[UserMessageContent] - role: Optional[UserMessageRole] = "user" + ROLE: Annotated[ + Annotated[Literal["user"], AfterValidator(validate_const("user"))], + pydantic.Field(alias="role"), + ] = "user" @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = ["role"] + optional_fields = [] nullable_fields = ["content"] null_default_fields = [] diff --git a/packages/mistralai_azure/src/mistralai_azure/models/validationerror.py b/packages/gcp/src/mistralai/gcp/client/models/validationerror.py similarity index 90% rename from packages/mistralai_azure/src/mistralai_azure/models/validationerror.py rename to packages/gcp/src/mistralai/gcp/client/models/validationerror.py index 4caff4a6..2d330e9a 100644 --- a/packages/mistralai_azure/src/mistralai_azure/models/validationerror.py +++ b/packages/gcp/src/mistralai/gcp/client/models/validationerror.py @@ -1,7 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from mistralai_azure.types import BaseModel +from mistralai.gcp.client.types import BaseModel from typing import List, Union from typing_extensions import TypeAliasType, TypedDict diff --git a/packages/mistralai_gcp/src/mistralai_gcp/py.typed b/packages/gcp/src/mistralai/gcp/client/py.typed similarity index 100% rename from packages/mistralai_gcp/src/mistralai_gcp/py.typed rename to packages/gcp/src/mistralai/gcp/client/py.typed diff --git a/packages/gcp/src/mistralai/gcp/client/sdk.py b/packages/gcp/src/mistralai/gcp/client/sdk.py new file mode 100644 index 00000000..63a766a4 --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/sdk.py @@ -0,0 +1,189 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from .httpclient import AsyncHttpClient, ClientOwner, HttpClient, close_clients +from .sdkconfiguration import SDKConfiguration +from .utils.logger import Logger, get_default_logger +from .utils.retries import RetryConfig +import httpx +import importlib +from mistralai.gcp.client import models, utils +from mistralai.gcp.client._hooks import SDKHooks +from mistralai.gcp.client.types import OptionalNullable, UNSET +import sys +from typing import Any, Callable, Dict, Optional, TYPE_CHECKING, Union, cast +import weakref + +if TYPE_CHECKING: + from mistralai.gcp.client.chat import Chat + from mistralai.gcp.client.fim import Fim + + +class MistralGCP(BaseSDK): + r"""Mistral AI API: Dora OpenAPI schema + + Our Chat Completion and Embeddings APIs specification. Create your account on [La Plateforme](https://console.mistral.ai) to get access and read the [docs](https://docs.mistral.ai) to learn how to use it. + """ + + chat: "Chat" + r"""Chat Completion API.""" + fim: "Fim" + r"""Fill-in-the-middle API.""" + _sub_sdk_map = { + "chat": ("mistralai.gcp.client.chat", "Chat"), + "fim": ("mistralai.gcp.client.fim", "Fim"), + } + + def __init__( + self, + api_key: Union[str, Callable[[], str]], + server: Optional[str] = None, + server_url: Optional[str] = None, + url_params: Optional[Dict[str, str]] = None, + client: Optional[HttpClient] = None, + async_client: Optional[AsyncHttpClient] = None, + retry_config: OptionalNullable[RetryConfig] = UNSET, + timeout_ms: Optional[int] = None, + debug_logger: Optional[Logger] = None, + ) -> None: + r"""Instantiates the SDK configuring it with the provided parameters. + + :param api_key: The api_key required for authentication + :param server: The server by name to use for all methods + :param server_url: The server URL to use for all methods + :param url_params: Parameters to optionally template the server URL with + :param client: The HTTP client to use for all synchronous methods + :param async_client: The Async HTTP client to use for all asynchronous methods + :param retry_config: The retry configuration to use for all supported methods + :param timeout_ms: Optional request timeout applied to each operation in milliseconds + """ + client_supplied = True + if client is None: + client = httpx.Client(follow_redirects=True) + client_supplied = False + + assert issubclass( + type(client), HttpClient + ), "The provided client must implement the HttpClient protocol." + + async_client_supplied = True + if async_client is None: + async_client = httpx.AsyncClient(follow_redirects=True) + async_client_supplied = False + + if debug_logger is None: + debug_logger = get_default_logger() + + assert issubclass( + type(async_client), AsyncHttpClient + ), "The provided async_client must implement the AsyncHttpClient protocol." + + security: Any = None + if callable(api_key): + # pylint: disable=unnecessary-lambda-assignment + security = lambda: models.Security(api_key=api_key()) + else: + security = models.Security(api_key=api_key) + + if server_url is not None: + if url_params is not None: + server_url = utils.template_url(server_url, url_params) + + BaseSDK.__init__( + self, + SDKConfiguration( + client=client, + client_supplied=client_supplied, + async_client=async_client, + async_client_supplied=async_client_supplied, + security=security, + server_url=server_url, + server=server, + retry_config=retry_config, + timeout_ms=timeout_ms, + debug_logger=debug_logger, + ), + parent_ref=self, + ) + + hooks = SDKHooks() + + # pylint: disable=protected-access + self.sdk_configuration.__dict__["_hooks"] = hooks + + current_server_url, *_ = self.sdk_configuration.get_server_details() + server_url, self.sdk_configuration.client = hooks.sdk_init( + current_server_url, client + ) + if current_server_url != server_url: + self.sdk_configuration.server_url = server_url + + weakref.finalize( + self, + close_clients, + cast(ClientOwner, self.sdk_configuration), + self.sdk_configuration.client, + self.sdk_configuration.client_supplied, + self.sdk_configuration.async_client, + self.sdk_configuration.async_client_supplied, + ) + + def dynamic_import(self, modname, retries=3): + for attempt in range(retries): + try: + return importlib.import_module(modname) + except KeyError: + # Clear any half-initialized module and retry + sys.modules.pop(modname, None) + if attempt == retries - 1: + break + raise KeyError(f"Failed to import module '{modname}' after {retries} attempts") + + def __getattr__(self, name: str): + if name in self._sub_sdk_map: + module_path, class_name = self._sub_sdk_map[name] + try: + module = self.dynamic_import(module_path) + klass = getattr(module, class_name) + instance = klass(self.sdk_configuration, parent_ref=self) + setattr(self, name, instance) + return instance + except ImportError as e: + raise AttributeError( + f"Failed to import module {module_path} for attribute {name}: {e}" + ) from e + except AttributeError as e: + raise AttributeError( + f"Failed to find class {class_name} in module {module_path} for attribute {name}: {e}" + ) from e + + raise AttributeError( + f"'{type(self).__name__}' object has no attribute '{name}'" + ) + + def __dir__(self): + default_attrs = list(super().__dir__()) + lazy_attrs = list(self._sub_sdk_map.keys()) + return sorted(list(set(default_attrs + lazy_attrs))) + + def __enter__(self): + return self + + async def __aenter__(self): + return self + + def __exit__(self, exc_type, exc_val, exc_tb): + if ( + self.sdk_configuration.client is not None + and not self.sdk_configuration.client_supplied + ): + self.sdk_configuration.client.close() + self.sdk_configuration.client = None + + async def __aexit__(self, exc_type, exc_val, exc_tb): + if ( + self.sdk_configuration.async_client is not None + and not self.sdk_configuration.async_client_supplied + ): + await self.sdk_configuration.async_client.aclose() + self.sdk_configuration.async_client = None diff --git a/packages/mistralai_azure/src/mistralai_azure/sdkconfiguration.py b/packages/gcp/src/mistralai/gcp/client/sdkconfiguration.py similarity index 94% rename from packages/mistralai_azure/src/mistralai_azure/sdkconfiguration.py rename to packages/gcp/src/mistralai/gcp/client/sdkconfiguration.py index 51289cf0..d56a634f 100644 --- a/packages/mistralai_azure/src/mistralai_azure/sdkconfiguration.py +++ b/packages/gcp/src/mistralai/gcp/client/sdkconfiguration.py @@ -9,8 +9,8 @@ from .httpclient import AsyncHttpClient, HttpClient from .utils import Logger, RetryConfig, remove_suffix from dataclasses import dataclass -from mistralai_azure import models -from mistralai_azure.types import OptionalNullable, UNSET +from mistralai.gcp.client import models +from mistralai.gcp.client.types import OptionalNullable, UNSET from pydantic import Field from typing import Callable, Dict, Optional, Tuple, Union diff --git a/packages/mistralai_gcp/src/mistralai_gcp/types/__init__.py b/packages/gcp/src/mistralai/gcp/client/types/__init__.py similarity index 100% rename from packages/mistralai_gcp/src/mistralai_gcp/types/__init__.py rename to packages/gcp/src/mistralai/gcp/client/types/__init__.py diff --git a/packages/mistralai_gcp/src/mistralai_gcp/types/basemodel.py b/packages/gcp/src/mistralai/gcp/client/types/basemodel.py similarity index 100% rename from packages/mistralai_gcp/src/mistralai_gcp/types/basemodel.py rename to packages/gcp/src/mistralai/gcp/client/types/basemodel.py diff --git a/packages/mistralai_gcp/src/mistralai_gcp/utils/__init__.py b/packages/gcp/src/mistralai/gcp/client/utils/__init__.py similarity index 100% rename from packages/mistralai_gcp/src/mistralai_gcp/utils/__init__.py rename to packages/gcp/src/mistralai/gcp/client/utils/__init__.py diff --git a/packages/mistralai_gcp/src/mistralai_gcp/utils/annotations.py b/packages/gcp/src/mistralai/gcp/client/utils/annotations.py similarity index 100% rename from packages/mistralai_gcp/src/mistralai_gcp/utils/annotations.py rename to packages/gcp/src/mistralai/gcp/client/utils/annotations.py diff --git a/packages/mistralai_gcp/src/mistralai_gcp/utils/datetimes.py b/packages/gcp/src/mistralai/gcp/client/utils/datetimes.py similarity index 100% rename from packages/mistralai_gcp/src/mistralai_gcp/utils/datetimes.py rename to packages/gcp/src/mistralai/gcp/client/utils/datetimes.py diff --git a/packages/mistralai_gcp/src/mistralai_gcp/utils/enums.py b/packages/gcp/src/mistralai/gcp/client/utils/enums.py similarity index 100% rename from packages/mistralai_gcp/src/mistralai_gcp/utils/enums.py rename to packages/gcp/src/mistralai/gcp/client/utils/enums.py diff --git a/packages/mistralai_gcp/src/mistralai_gcp/utils/eventstreaming.py b/packages/gcp/src/mistralai/gcp/client/utils/eventstreaming.py similarity index 100% rename from packages/mistralai_gcp/src/mistralai_gcp/utils/eventstreaming.py rename to packages/gcp/src/mistralai/gcp/client/utils/eventstreaming.py diff --git a/packages/mistralai_gcp/src/mistralai_gcp/utils/forms.py b/packages/gcp/src/mistralai/gcp/client/utils/forms.py similarity index 100% rename from packages/mistralai_gcp/src/mistralai_gcp/utils/forms.py rename to packages/gcp/src/mistralai/gcp/client/utils/forms.py diff --git a/packages/mistralai_gcp/src/mistralai_gcp/utils/headers.py b/packages/gcp/src/mistralai/gcp/client/utils/headers.py similarity index 100% rename from packages/mistralai_gcp/src/mistralai_gcp/utils/headers.py rename to packages/gcp/src/mistralai/gcp/client/utils/headers.py diff --git a/packages/mistralai_gcp/src/mistralai_gcp/utils/logger.py b/packages/gcp/src/mistralai/gcp/client/utils/logger.py similarity index 100% rename from packages/mistralai_gcp/src/mistralai_gcp/utils/logger.py rename to packages/gcp/src/mistralai/gcp/client/utils/logger.py diff --git a/packages/mistralai_gcp/src/mistralai_gcp/utils/metadata.py b/packages/gcp/src/mistralai/gcp/client/utils/metadata.py similarity index 100% rename from packages/mistralai_gcp/src/mistralai_gcp/utils/metadata.py rename to packages/gcp/src/mistralai/gcp/client/utils/metadata.py diff --git a/packages/mistralai_gcp/src/mistralai_gcp/utils/queryparams.py b/packages/gcp/src/mistralai/gcp/client/utils/queryparams.py similarity index 100% rename from packages/mistralai_gcp/src/mistralai_gcp/utils/queryparams.py rename to packages/gcp/src/mistralai/gcp/client/utils/queryparams.py diff --git a/packages/mistralai_gcp/src/mistralai_gcp/utils/requestbodies.py b/packages/gcp/src/mistralai/gcp/client/utils/requestbodies.py similarity index 100% rename from packages/mistralai_gcp/src/mistralai_gcp/utils/requestbodies.py rename to packages/gcp/src/mistralai/gcp/client/utils/requestbodies.py diff --git a/packages/mistralai_gcp/src/mistralai_gcp/utils/retries.py b/packages/gcp/src/mistralai/gcp/client/utils/retries.py similarity index 100% rename from packages/mistralai_gcp/src/mistralai_gcp/utils/retries.py rename to packages/gcp/src/mistralai/gcp/client/utils/retries.py diff --git a/packages/mistralai_gcp/src/mistralai_gcp/utils/security.py b/packages/gcp/src/mistralai/gcp/client/utils/security.py similarity index 100% rename from packages/mistralai_gcp/src/mistralai_gcp/utils/security.py rename to packages/gcp/src/mistralai/gcp/client/utils/security.py diff --git a/packages/mistralai_gcp/src/mistralai_gcp/utils/serializers.py b/packages/gcp/src/mistralai/gcp/client/utils/serializers.py similarity index 100% rename from packages/mistralai_gcp/src/mistralai_gcp/utils/serializers.py rename to packages/gcp/src/mistralai/gcp/client/utils/serializers.py diff --git a/packages/mistralai_gcp/src/mistralai_gcp/utils/unmarshal_json_response.py b/packages/gcp/src/mistralai/gcp/client/utils/unmarshal_json_response.py similarity index 95% rename from packages/mistralai_gcp/src/mistralai_gcp/utils/unmarshal_json_response.py rename to packages/gcp/src/mistralai/gcp/client/utils/unmarshal_json_response.py index c168a293..83e8275e 100644 --- a/packages/mistralai_gcp/src/mistralai_gcp/utils/unmarshal_json_response.py +++ b/packages/gcp/src/mistralai/gcp/client/utils/unmarshal_json_response.py @@ -5,7 +5,7 @@ import httpx from .serializers import unmarshal_json -from mistralai_gcp import models +from mistralai.gcp.client import models T = TypeVar("T") diff --git a/packages/mistralai_gcp/src/mistralai_gcp/utils/url.py b/packages/gcp/src/mistralai/gcp/client/utils/url.py similarity index 100% rename from packages/mistralai_gcp/src/mistralai_gcp/utils/url.py rename to packages/gcp/src/mistralai/gcp/client/utils/url.py diff --git a/packages/mistralai_gcp/src/mistralai_gcp/utils/values.py b/packages/gcp/src/mistralai/gcp/client/utils/values.py similarity index 100% rename from packages/mistralai_gcp/src/mistralai_gcp/utils/values.py rename to packages/gcp/src/mistralai/gcp/client/utils/values.py diff --git a/packages/mistralai_gcp/uv.lock b/packages/gcp/uv.lock similarity index 92% rename from packages/mistralai_gcp/uv.lock rename to packages/gcp/uv.lock index 4fbca724..a49757c9 100644 --- a/packages/mistralai_gcp/uv.lock +++ b/packages/gcp/uv.lock @@ -277,7 +277,7 @@ wheels = [ [[package]] name = "mistralai-gcp" -version = "1.8.0" +version = "2.0.0a4" source = { editable = "." } dependencies = [ { name = "eval-type-backport" }, @@ -304,7 +304,7 @@ requires-dist = [ { name = "eval-type-backport", specifier = ">=0.2.0" }, { name = "google-auth", specifier = ">=2.31.0,<3.0.0" }, { name = "httpx", specifier = ">=0.28.1" }, - { name = "pydantic", specifier = ">=2.10.3" }, + { name = "pydantic", specifier = ">=2.11.2" }, { name = "python-dateutil", specifier = ">=2.8.2" }, { name = "requests", specifier = ">=2.32.3,<3.0.0" }, { name = "typing-inspection", specifier = ">=0.4.0" }, @@ -312,7 +312,7 @@ requires-dist = [ [package.metadata.requires-dev] dev = [ - { name = "mypy", specifier = "==1.14.1" }, + { name = "mypy", specifier = "==1.15.0" }, { name = "pylint", specifier = "==3.2.3" }, { name = "pyright", specifier = ">=1.1.401,<2" }, { name = "pytest", specifier = ">=8.2.2,<9" }, @@ -322,40 +322,40 @@ dev = [ [[package]] name = "mypy" -version = "1.14.1" +version = "1.15.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "mypy-extensions" }, { name = "tomli", marker = "python_full_version < '3.11'" }, { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/b9/eb/2c92d8ea1e684440f54fa49ac5d9a5f19967b7b472a281f419e69a8d228e/mypy-1.14.1.tar.gz", hash = "sha256:7ec88144fe9b510e8475ec2f5f251992690fcf89ccb4500b214b4226abcd32d6", size = 3216051, upload-time = "2024-12-30T16:39:07.335Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/9b/7a/87ae2adb31d68402da6da1e5f30c07ea6063e9f09b5e7cfc9dfa44075e74/mypy-1.14.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:52686e37cf13d559f668aa398dd7ddf1f92c5d613e4f8cb262be2fb4fedb0fcb", size = 11211002, upload-time = "2024-12-30T16:37:22.435Z" }, - { url = "https://files.pythonhosted.org/packages/e1/23/eada4c38608b444618a132be0d199b280049ded278b24cbb9d3fc59658e4/mypy-1.14.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:1fb545ca340537d4b45d3eecdb3def05e913299ca72c290326be19b3804b39c0", size = 10358400, upload-time = "2024-12-30T16:37:53.526Z" }, - { url = "https://files.pythonhosted.org/packages/43/c9/d6785c6f66241c62fd2992b05057f404237deaad1566545e9f144ced07f5/mypy-1.14.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:90716d8b2d1f4cd503309788e51366f07c56635a3309b0f6a32547eaaa36a64d", size = 12095172, upload-time = "2024-12-30T16:37:50.332Z" }, - { url = "https://files.pythonhosted.org/packages/c3/62/daa7e787770c83c52ce2aaf1a111eae5893de9e004743f51bfcad9e487ec/mypy-1.14.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:2ae753f5c9fef278bcf12e1a564351764f2a6da579d4a81347e1d5a15819997b", size = 12828732, upload-time = "2024-12-30T16:37:29.96Z" }, - { url = "https://files.pythonhosted.org/packages/1b/a2/5fb18318a3637f29f16f4e41340b795da14f4751ef4f51c99ff39ab62e52/mypy-1.14.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:e0fe0f5feaafcb04505bcf439e991c6d8f1bf8b15f12b05feeed96e9e7bf1427", size = 13012197, upload-time = "2024-12-30T16:38:05.037Z" }, - { url = "https://files.pythonhosted.org/packages/28/99/e153ce39105d164b5f02c06c35c7ba958aaff50a2babba7d080988b03fe7/mypy-1.14.1-cp310-cp310-win_amd64.whl", hash = "sha256:7d54bd85b925e501c555a3227f3ec0cfc54ee8b6930bd6141ec872d1c572f81f", size = 9780836, upload-time = "2024-12-30T16:37:19.726Z" }, - { url = "https://files.pythonhosted.org/packages/da/11/a9422850fd506edbcdc7f6090682ecceaf1f87b9dd847f9df79942da8506/mypy-1.14.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:f995e511de847791c3b11ed90084a7a0aafdc074ab88c5a9711622fe4751138c", size = 11120432, upload-time = "2024-12-30T16:37:11.533Z" }, - { url = "https://files.pythonhosted.org/packages/b6/9e/47e450fd39078d9c02d620545b2cb37993a8a8bdf7db3652ace2f80521ca/mypy-1.14.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:d64169ec3b8461311f8ce2fd2eb5d33e2d0f2c7b49116259c51d0d96edee48d1", size = 10279515, upload-time = "2024-12-30T16:37:40.724Z" }, - { url = "https://files.pythonhosted.org/packages/01/b5/6c8d33bd0f851a7692a8bfe4ee75eb82b6983a3cf39e5e32a5d2a723f0c1/mypy-1.14.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ba24549de7b89b6381b91fbc068d798192b1b5201987070319889e93038967a8", size = 12025791, upload-time = "2024-12-30T16:36:58.73Z" }, - { url = "https://files.pythonhosted.org/packages/f0/4c/e10e2c46ea37cab5c471d0ddaaa9a434dc1d28650078ac1b56c2d7b9b2e4/mypy-1.14.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:183cf0a45457d28ff9d758730cd0210419ac27d4d3f285beda038c9083363b1f", size = 12749203, upload-time = "2024-12-30T16:37:03.741Z" }, - { url = "https://files.pythonhosted.org/packages/88/55/beacb0c69beab2153a0f57671ec07861d27d735a0faff135a494cd4f5020/mypy-1.14.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:f2a0ecc86378f45347f586e4163d1769dd81c5a223d577fe351f26b179e148b1", size = 12885900, upload-time = "2024-12-30T16:37:57.948Z" }, - { url = "https://files.pythonhosted.org/packages/a2/75/8c93ff7f315c4d086a2dfcde02f713004357d70a163eddb6c56a6a5eff40/mypy-1.14.1-cp311-cp311-win_amd64.whl", hash = "sha256:ad3301ebebec9e8ee7135d8e3109ca76c23752bac1e717bc84cd3836b4bf3eae", size = 9777869, upload-time = "2024-12-30T16:37:33.428Z" }, - { url = "https://files.pythonhosted.org/packages/43/1b/b38c079609bb4627905b74fc6a49849835acf68547ac33d8ceb707de5f52/mypy-1.14.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:30ff5ef8519bbc2e18b3b54521ec319513a26f1bba19a7582e7b1f58a6e69f14", size = 11266668, upload-time = "2024-12-30T16:38:02.211Z" }, - { url = "https://files.pythonhosted.org/packages/6b/75/2ed0d2964c1ffc9971c729f7a544e9cd34b2cdabbe2d11afd148d7838aa2/mypy-1.14.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:cb9f255c18052343c70234907e2e532bc7e55a62565d64536dbc7706a20b78b9", size = 10254060, upload-time = "2024-12-30T16:37:46.131Z" }, - { url = "https://files.pythonhosted.org/packages/a1/5f/7b8051552d4da3c51bbe8fcafffd76a6823779101a2b198d80886cd8f08e/mypy-1.14.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8b4e3413e0bddea671012b063e27591b953d653209e7a4fa5e48759cda77ca11", size = 11933167, upload-time = "2024-12-30T16:37:43.534Z" }, - { url = "https://files.pythonhosted.org/packages/04/90/f53971d3ac39d8b68bbaab9a4c6c58c8caa4d5fd3d587d16f5927eeeabe1/mypy-1.14.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:553c293b1fbdebb6c3c4030589dab9fafb6dfa768995a453d8a5d3b23784af2e", size = 12864341, upload-time = "2024-12-30T16:37:36.249Z" }, - { url = "https://files.pythonhosted.org/packages/03/d2/8bc0aeaaf2e88c977db41583559319f1821c069e943ada2701e86d0430b7/mypy-1.14.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:fad79bfe3b65fe6a1efaed97b445c3d37f7be9fdc348bdb2d7cac75579607c89", size = 12972991, upload-time = "2024-12-30T16:37:06.743Z" }, - { url = "https://files.pythonhosted.org/packages/6f/17/07815114b903b49b0f2cf7499f1c130e5aa459411596668267535fe9243c/mypy-1.14.1-cp312-cp312-win_amd64.whl", hash = "sha256:8fa2220e54d2946e94ab6dbb3ba0a992795bd68b16dc852db33028df2b00191b", size = 9879016, upload-time = "2024-12-30T16:37:15.02Z" }, - { url = "https://files.pythonhosted.org/packages/9e/15/bb6a686901f59222275ab228453de741185f9d54fecbaacec041679496c6/mypy-1.14.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:92c3ed5afb06c3a8e188cb5da4984cab9ec9a77ba956ee419c68a388b4595255", size = 11252097, upload-time = "2024-12-30T16:37:25.144Z" }, - { url = "https://files.pythonhosted.org/packages/f8/b3/8b0f74dfd072c802b7fa368829defdf3ee1566ba74c32a2cb2403f68024c/mypy-1.14.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:dbec574648b3e25f43d23577309b16534431db4ddc09fda50841f1e34e64ed34", size = 10239728, upload-time = "2024-12-30T16:38:08.634Z" }, - { url = "https://files.pythonhosted.org/packages/c5/9b/4fd95ab20c52bb5b8c03cc49169be5905d931de17edfe4d9d2986800b52e/mypy-1.14.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8c6d94b16d62eb3e947281aa7347d78236688e21081f11de976376cf010eb31a", size = 11924965, upload-time = "2024-12-30T16:38:12.132Z" }, - { url = "https://files.pythonhosted.org/packages/56/9d/4a236b9c57f5d8f08ed346914b3f091a62dd7e19336b2b2a0d85485f82ff/mypy-1.14.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d4b19b03fdf54f3c5b2fa474c56b4c13c9dbfb9a2db4370ede7ec11a2c5927d9", size = 12867660, upload-time = "2024-12-30T16:38:17.342Z" }, - { url = "https://files.pythonhosted.org/packages/40/88/a61a5497e2f68d9027de2bb139c7bb9abaeb1be1584649fa9d807f80a338/mypy-1.14.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:0c911fde686394753fff899c409fd4e16e9b294c24bfd5e1ea4675deae1ac6fd", size = 12969198, upload-time = "2024-12-30T16:38:32.839Z" }, - { url = "https://files.pythonhosted.org/packages/54/da/3d6fc5d92d324701b0c23fb413c853892bfe0e1dbe06c9138037d459756b/mypy-1.14.1-cp313-cp313-win_amd64.whl", hash = "sha256:8b21525cb51671219f5307be85f7e646a153e5acc656e5cebf64bfa076c50107", size = 9885276, upload-time = "2024-12-30T16:38:20.828Z" }, - { url = "https://files.pythonhosted.org/packages/a0/b5/32dd67b69a16d088e533962e5044e51004176a9952419de0370cdaead0f8/mypy-1.14.1-py3-none-any.whl", hash = "sha256:b66a60cc4073aeb8ae00057f9c1f64d49e90f918fbcef9a977eb121da8b8f1d1", size = 2752905, upload-time = "2024-12-30T16:38:42.021Z" }, +sdist = { url = "https://files.pythonhosted.org/packages/ce/43/d5e49a86afa64bd3839ea0d5b9c7103487007d728e1293f52525d6d5486a/mypy-1.15.0.tar.gz", hash = "sha256:404534629d51d3efea5c800ee7c42b72a6554d6c400e6a79eafe15d11341fd43", size = 3239717, upload-time = "2025-02-05T03:50:34.655Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/68/f8/65a7ce8d0e09b6329ad0c8d40330d100ea343bd4dd04c4f8ae26462d0a17/mypy-1.15.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:979e4e1a006511dacf628e36fadfecbcc0160a8af6ca7dad2f5025529e082c13", size = 10738433, upload-time = "2025-02-05T03:49:29.145Z" }, + { url = "https://files.pythonhosted.org/packages/b4/95/9c0ecb8eacfe048583706249439ff52105b3f552ea9c4024166c03224270/mypy-1.15.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:c4bb0e1bd29f7d34efcccd71cf733580191e9a264a2202b0239da95984c5b559", size = 9861472, upload-time = "2025-02-05T03:49:16.986Z" }, + { url = "https://files.pythonhosted.org/packages/84/09/9ec95e982e282e20c0d5407bc65031dfd0f0f8ecc66b69538296e06fcbee/mypy-1.15.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:be68172e9fd9ad8fb876c6389f16d1c1b5f100ffa779f77b1fb2176fcc9ab95b", size = 11611424, upload-time = "2025-02-05T03:49:46.908Z" }, + { url = "https://files.pythonhosted.org/packages/78/13/f7d14e55865036a1e6a0a69580c240f43bc1f37407fe9235c0d4ef25ffb0/mypy-1.15.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c7be1e46525adfa0d97681432ee9fcd61a3964c2446795714699a998d193f1a3", size = 12365450, upload-time = "2025-02-05T03:50:05.89Z" }, + { url = "https://files.pythonhosted.org/packages/48/e1/301a73852d40c241e915ac6d7bcd7fedd47d519246db2d7b86b9d7e7a0cb/mypy-1.15.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:2e2c2e6d3593f6451b18588848e66260ff62ccca522dd231cd4dd59b0160668b", size = 12551765, upload-time = "2025-02-05T03:49:33.56Z" }, + { url = "https://files.pythonhosted.org/packages/77/ba/c37bc323ae5fe7f3f15a28e06ab012cd0b7552886118943e90b15af31195/mypy-1.15.0-cp310-cp310-win_amd64.whl", hash = "sha256:6983aae8b2f653e098edb77f893f7b6aca69f6cffb19b2cc7443f23cce5f4828", size = 9274701, upload-time = "2025-02-05T03:49:38.981Z" }, + { url = "https://files.pythonhosted.org/packages/03/bc/f6339726c627bd7ca1ce0fa56c9ae2d0144604a319e0e339bdadafbbb599/mypy-1.15.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:2922d42e16d6de288022e5ca321cd0618b238cfc5570e0263e5ba0a77dbef56f", size = 10662338, upload-time = "2025-02-05T03:50:17.287Z" }, + { url = "https://files.pythonhosted.org/packages/e2/90/8dcf506ca1a09b0d17555cc00cd69aee402c203911410136cd716559efe7/mypy-1.15.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:2ee2d57e01a7c35de00f4634ba1bbf015185b219e4dc5909e281016df43f5ee5", size = 9787540, upload-time = "2025-02-05T03:49:51.21Z" }, + { url = "https://files.pythonhosted.org/packages/05/05/a10f9479681e5da09ef2f9426f650d7b550d4bafbef683b69aad1ba87457/mypy-1.15.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:973500e0774b85d9689715feeffcc980193086551110fd678ebe1f4342fb7c5e", size = 11538051, upload-time = "2025-02-05T03:50:20.885Z" }, + { url = "https://files.pythonhosted.org/packages/e9/9a/1f7d18b30edd57441a6411fcbc0c6869448d1a4bacbaee60656ac0fc29c8/mypy-1.15.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:5a95fb17c13e29d2d5195869262f8125dfdb5c134dc8d9a9d0aecf7525b10c2c", size = 12286751, upload-time = "2025-02-05T03:49:42.408Z" }, + { url = "https://files.pythonhosted.org/packages/72/af/19ff499b6f1dafcaf56f9881f7a965ac2f474f69f6f618b5175b044299f5/mypy-1.15.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:1905f494bfd7d85a23a88c5d97840888a7bd516545fc5aaedff0267e0bb54e2f", size = 12421783, upload-time = "2025-02-05T03:49:07.707Z" }, + { url = "https://files.pythonhosted.org/packages/96/39/11b57431a1f686c1aed54bf794870efe0f6aeca11aca281a0bd87a5ad42c/mypy-1.15.0-cp311-cp311-win_amd64.whl", hash = "sha256:c9817fa23833ff189db061e6d2eff49b2f3b6ed9856b4a0a73046e41932d744f", size = 9265618, upload-time = "2025-02-05T03:49:54.581Z" }, + { url = "https://files.pythonhosted.org/packages/98/3a/03c74331c5eb8bd025734e04c9840532226775c47a2c39b56a0c8d4f128d/mypy-1.15.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:aea39e0583d05124836ea645f412e88a5c7d0fd77a6d694b60d9b6b2d9f184fd", size = 10793981, upload-time = "2025-02-05T03:50:28.25Z" }, + { url = "https://files.pythonhosted.org/packages/f0/1a/41759b18f2cfd568848a37c89030aeb03534411eef981df621d8fad08a1d/mypy-1.15.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:2f2147ab812b75e5b5499b01ade1f4a81489a147c01585cda36019102538615f", size = 9749175, upload-time = "2025-02-05T03:50:13.411Z" }, + { url = "https://files.pythonhosted.org/packages/12/7e/873481abf1ef112c582db832740f4c11b2bfa510e829d6da29b0ab8c3f9c/mypy-1.15.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ce436f4c6d218a070048ed6a44c0bbb10cd2cc5e272b29e7845f6a2f57ee4464", size = 11455675, upload-time = "2025-02-05T03:50:31.421Z" }, + { url = "https://files.pythonhosted.org/packages/b3/d0/92ae4cde706923a2d3f2d6c39629134063ff64b9dedca9c1388363da072d/mypy-1.15.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8023ff13985661b50a5928fc7a5ca15f3d1affb41e5f0a9952cb68ef090b31ee", size = 12410020, upload-time = "2025-02-05T03:48:48.705Z" }, + { url = "https://files.pythonhosted.org/packages/46/8b/df49974b337cce35f828ba6fda228152d6db45fed4c86ba56ffe442434fd/mypy-1.15.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:1124a18bc11a6a62887e3e137f37f53fbae476dc36c185d549d4f837a2a6a14e", size = 12498582, upload-time = "2025-02-05T03:49:03.628Z" }, + { url = "https://files.pythonhosted.org/packages/13/50/da5203fcf6c53044a0b699939f31075c45ae8a4cadf538a9069b165c1050/mypy-1.15.0-cp312-cp312-win_amd64.whl", hash = "sha256:171a9ca9a40cd1843abeca0e405bc1940cd9b305eaeea2dda769ba096932bb22", size = 9366614, upload-time = "2025-02-05T03:50:00.313Z" }, + { url = "https://files.pythonhosted.org/packages/6a/9b/fd2e05d6ffff24d912f150b87db9e364fa8282045c875654ce7e32fffa66/mypy-1.15.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:93faf3fdb04768d44bf28693293f3904bbb555d076b781ad2530214ee53e3445", size = 10788592, upload-time = "2025-02-05T03:48:55.789Z" }, + { url = "https://files.pythonhosted.org/packages/74/37/b246d711c28a03ead1fd906bbc7106659aed7c089d55fe40dd58db812628/mypy-1.15.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:811aeccadfb730024c5d3e326b2fbe9249bb7413553f15499a4050f7c30e801d", size = 9753611, upload-time = "2025-02-05T03:48:44.581Z" }, + { url = "https://files.pythonhosted.org/packages/a6/ac/395808a92e10cfdac8003c3de9a2ab6dc7cde6c0d2a4df3df1b815ffd067/mypy-1.15.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:98b7b9b9aedb65fe628c62a6dc57f6d5088ef2dfca37903a7d9ee374d03acca5", size = 11438443, upload-time = "2025-02-05T03:49:25.514Z" }, + { url = "https://files.pythonhosted.org/packages/d2/8b/801aa06445d2de3895f59e476f38f3f8d610ef5d6908245f07d002676cbf/mypy-1.15.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c43a7682e24b4f576d93072216bf56eeff70d9140241f9edec0c104d0c515036", size = 12402541, upload-time = "2025-02-05T03:49:57.623Z" }, + { url = "https://files.pythonhosted.org/packages/c7/67/5a4268782eb77344cc613a4cf23540928e41f018a9a1ec4c6882baf20ab8/mypy-1.15.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:baefc32840a9f00babd83251560e0ae1573e2f9d1b067719479bfb0e987c6357", size = 12494348, upload-time = "2025-02-05T03:48:52.361Z" }, + { url = "https://files.pythonhosted.org/packages/83/3e/57bb447f7bbbfaabf1712d96f9df142624a386d98fb026a761532526057e/mypy-1.15.0-cp313-cp313-win_amd64.whl", hash = "sha256:b9378e2c00146c44793c98b8d5a61039a048e31f429fb0eb546d93f4b000bedf", size = 9373648, upload-time = "2025-02-05T03:49:11.395Z" }, + { url = "https://files.pythonhosted.org/packages/09/4e/a7d65c7322c510de2c409ff3828b03354a7c43f5a8ed458a7a131b41c7b9/mypy-1.15.0-py3-none-any.whl", hash = "sha256:5469affef548bd1895d86d3bf10ce2b44e33d86923c29e4d675b3e323437ea3e", size = 2221777, upload-time = "2025-02-05T03:50:08.348Z" }, ] [[package]] diff --git a/packages/mistralai_azure/.genignore b/packages/mistralai_azure/.genignore deleted file mode 100644 index ba7f2350..00000000 --- a/packages/mistralai_azure/.genignore +++ /dev/null @@ -1,5 +0,0 @@ -pyproject.toml -src/mistralai_azure/sdk.py -README.md -USAGE.md -docs/sdks/**/README.md \ No newline at end of file diff --git a/packages/mistralai_azure/.vscode/settings.json b/packages/mistralai_azure/.vscode/settings.json deleted file mode 100644 index 8d79f0ab..00000000 --- a/packages/mistralai_azure/.vscode/settings.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "python.testing.pytestArgs": ["tests", "-vv"], - "python.testing.unittestEnabled": false, - "python.testing.pytestEnabled": true, - "pylint.args": ["--rcfile=pylintrc"] -} diff --git a/packages/mistralai_azure/docs/models/assistantmessagerole.md b/packages/mistralai_azure/docs/models/assistantmessagerole.md deleted file mode 100644 index 658229e7..00000000 --- a/packages/mistralai_azure/docs/models/assistantmessagerole.md +++ /dev/null @@ -1,8 +0,0 @@ -# AssistantMessageRole - - -## Values - -| Name | Value | -| ----------- | ----------- | -| `ASSISTANT` | assistant | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/completionresponsestreamchoice.md b/packages/mistralai_azure/docs/models/completionresponsestreamchoice.md deleted file mode 100644 index c807dacd..00000000 --- a/packages/mistralai_azure/docs/models/completionresponsestreamchoice.md +++ /dev/null @@ -1,10 +0,0 @@ -# CompletionResponseStreamChoice - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | -| `index` | *int* | :heavy_check_mark: | N/A | -| `delta` | [models.DeltaMessage](../models/deltamessage.md) | :heavy_check_mark: | N/A | -| `finish_reason` | [Nullable[models.FinishReason]](../models/finishreason.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/deltamessage.md b/packages/mistralai_azure/docs/models/deltamessage.md deleted file mode 100644 index 61deabbf..00000000 --- a/packages/mistralai_azure/docs/models/deltamessage.md +++ /dev/null @@ -1,10 +0,0 @@ -# DeltaMessage - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -| `role` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `content` | [OptionalNullable[models.Content]](../models/content.md) | :heavy_minus_sign: | N/A | -| `tool_calls` | List[[models.ToolCall](../models/toolcall.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/documenturlchunk.md b/packages/mistralai_azure/docs/models/documenturlchunk.md deleted file mode 100644 index 6c9a5b4d..00000000 --- a/packages/mistralai_azure/docs/models/documenturlchunk.md +++ /dev/null @@ -1,10 +0,0 @@ -# DocumentURLChunk - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -| `document_url` | *str* | :heavy_check_mark: | N/A | -| `document_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The filename of the document | -| `type` | [Optional[models.DocumentURLChunkType]](../models/documenturlchunktype.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/documenturlchunktype.md b/packages/mistralai_azure/docs/models/documenturlchunktype.md deleted file mode 100644 index 32e1fa9e..00000000 --- a/packages/mistralai_azure/docs/models/documenturlchunktype.md +++ /dev/null @@ -1,8 +0,0 @@ -# DocumentURLChunkType - - -## Values - -| Name | Value | -| -------------- | -------------- | -| `DOCUMENT_URL` | document_url | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/imageurlchunk.md b/packages/mistralai_azure/docs/models/imageurlchunk.md deleted file mode 100644 index f1b926ef..00000000 --- a/packages/mistralai_azure/docs/models/imageurlchunk.md +++ /dev/null @@ -1,11 +0,0 @@ -# ImageURLChunk - -{"type":"image_url","image_url":{"url":"data:image/png;base64,iVBORw0 - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -| `image_url` | [models.ImageURLChunkImageURL](../models/imageurlchunkimageurl.md) | :heavy_check_mark: | N/A | -| `type` | [Optional[models.ImageURLChunkType]](../models/imageurlchunktype.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/imageurlchunktype.md b/packages/mistralai_azure/docs/models/imageurlchunktype.md deleted file mode 100644 index 2064a0b4..00000000 --- a/packages/mistralai_azure/docs/models/imageurlchunktype.md +++ /dev/null @@ -1,8 +0,0 @@ -# ImageURLChunkType - - -## Values - -| Name | Value | -| ----------- | ----------- | -| `IMAGE_URL` | image_url | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/referencechunk.md b/packages/mistralai_azure/docs/models/referencechunk.md deleted file mode 100644 index a132ca2f..00000000 --- a/packages/mistralai_azure/docs/models/referencechunk.md +++ /dev/null @@ -1,9 +0,0 @@ -# ReferenceChunk - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | -| `reference_ids` | List[*int*] | :heavy_check_mark: | N/A | -| `type` | [Optional[models.ReferenceChunkType]](../models/referencechunktype.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/referencechunktype.md b/packages/mistralai_azure/docs/models/referencechunktype.md deleted file mode 100644 index 1e0e2fe6..00000000 --- a/packages/mistralai_azure/docs/models/referencechunktype.md +++ /dev/null @@ -1,8 +0,0 @@ -# ReferenceChunkType - - -## Values - -| Name | Value | -| ----------- | ----------- | -| `REFERENCE` | reference | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/role.md b/packages/mistralai_azure/docs/models/role.md deleted file mode 100644 index affca78d..00000000 --- a/packages/mistralai_azure/docs/models/role.md +++ /dev/null @@ -1,8 +0,0 @@ -# Role - - -## Values - -| Name | Value | -| -------- | -------- | -| `SYSTEM` | system | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/textchunk.md b/packages/mistralai_azure/docs/models/textchunk.md deleted file mode 100644 index 6daab3c3..00000000 --- a/packages/mistralai_azure/docs/models/textchunk.md +++ /dev/null @@ -1,9 +0,0 @@ -# TextChunk - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | -| `text` | *str* | :heavy_check_mark: | N/A | -| `type` | [Optional[models.Type]](../models/type.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/thinkchunktype.md b/packages/mistralai_azure/docs/models/thinkchunktype.md deleted file mode 100644 index baf6f755..00000000 --- a/packages/mistralai_azure/docs/models/thinkchunktype.md +++ /dev/null @@ -1,8 +0,0 @@ -# ThinkChunkType - - -## Values - -| Name | Value | -| ---------- | ---------- | -| `THINKING` | thinking | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/toolmessagerole.md b/packages/mistralai_azure/docs/models/toolmessagerole.md deleted file mode 100644 index c24e59c0..00000000 --- a/packages/mistralai_azure/docs/models/toolmessagerole.md +++ /dev/null @@ -1,8 +0,0 @@ -# ToolMessageRole - - -## Values - -| Name | Value | -| ------ | ------ | -| `TOOL` | tool | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/type.md b/packages/mistralai_azure/docs/models/type.md deleted file mode 100644 index eb0581e7..00000000 --- a/packages/mistralai_azure/docs/models/type.md +++ /dev/null @@ -1,8 +0,0 @@ -# Type - - -## Values - -| Name | Value | -| ------ | ------ | -| `TEXT` | text | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/usermessagerole.md b/packages/mistralai_azure/docs/models/usermessagerole.md deleted file mode 100644 index 171124e4..00000000 --- a/packages/mistralai_azure/docs/models/usermessagerole.md +++ /dev/null @@ -1,8 +0,0 @@ -# UserMessageRole - - -## Values - -| Name | Value | -| ------ | ------ | -| `USER` | user | \ No newline at end of file diff --git a/packages/mistralai_azure/src/mistralai_azure/_hooks/custom_user_agent.py b/packages/mistralai_azure/src/mistralai_azure/_hooks/custom_user_agent.py deleted file mode 100644 index 77df6aef..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/_hooks/custom_user_agent.py +++ /dev/null @@ -1,22 +0,0 @@ -# THIS FILE IS THE EXACT COPY OF THE ORIGINAL FILE FROM src/mistralai/_hooks/custom_user_agent.py -from typing import Union - -import httpx - -from .types import BeforeRequestContext, BeforeRequestHook - -PREFIX = "mistral-client-python/" - -class CustomUserAgentHook(BeforeRequestHook): - def before_request( - self, hook_ctx: BeforeRequestContext, request: httpx.Request - ) -> Union[httpx.Request, Exception]: - current = request.headers["user-agent"] - if current.startswith(PREFIX): - return request - - request.headers["user-agent"] = ( - PREFIX + current.split(" ")[1] - ) - - return request diff --git a/packages/mistralai_azure/src/mistralai_azure/models/imageurlchunk.py b/packages/mistralai_azure/src/mistralai_azure/models/imageurlchunk.py deleted file mode 100644 index a40e451c..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/models/imageurlchunk.py +++ /dev/null @@ -1,33 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .imageurl import ImageURL, ImageURLTypedDict -from mistralai_azure.types import BaseModel -from typing import Literal, Optional, Union -from typing_extensions import NotRequired, TypeAliasType, TypedDict - - -ImageURLChunkImageURLTypedDict = TypeAliasType( - "ImageURLChunkImageURLTypedDict", Union[ImageURLTypedDict, str] -) - - -ImageURLChunkImageURL = TypeAliasType("ImageURLChunkImageURL", Union[ImageURL, str]) - - -ImageURLChunkType = Literal["image_url",] - - -class ImageURLChunkTypedDict(TypedDict): - r"""{\"type\":\"image_url\",\"image_url\":{\"url\":\"data:image/png;base64,iVBORw0""" - - image_url: ImageURLChunkImageURLTypedDict - type: NotRequired[ImageURLChunkType] - - -class ImageURLChunk(BaseModel): - r"""{\"type\":\"image_url\",\"image_url\":{\"url\":\"data:image/png;base64,iVBORw0""" - - image_url: ImageURLChunkImageURL - - type: Optional[ImageURLChunkType] = "image_url" diff --git a/packages/mistralai_azure/src/mistralai_azure/models/referencechunk.py b/packages/mistralai_azure/src/mistralai_azure/models/referencechunk.py deleted file mode 100644 index 32d2ca68..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/models/referencechunk.py +++ /dev/null @@ -1,20 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai_azure.types import BaseModel -from typing import List, Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -ReferenceChunkType = Literal["reference",] - - -class ReferenceChunkTypedDict(TypedDict): - reference_ids: List[int] - type: NotRequired[ReferenceChunkType] - - -class ReferenceChunk(BaseModel): - reference_ids: List[int] - - type: Optional[ReferenceChunkType] = "reference" diff --git a/packages/mistralai_azure/src/mistralai_azure/models/textchunk.py b/packages/mistralai_azure/src/mistralai_azure/models/textchunk.py deleted file mode 100644 index 5845456e..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/models/textchunk.py +++ /dev/null @@ -1,20 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai_azure.types import BaseModel -from typing import Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -Type = Literal["text",] - - -class TextChunkTypedDict(TypedDict): - text: str - type: NotRequired[Type] - - -class TextChunk(BaseModel): - text: str - - type: Optional[Type] = "text" diff --git a/packages/mistralai_gcp/.genignore b/packages/mistralai_gcp/.genignore deleted file mode 100644 index 76043176..00000000 --- a/packages/mistralai_gcp/.genignore +++ /dev/null @@ -1,5 +0,0 @@ -pyproject.toml -src/mistralai_gcp/sdk.py -README.md -USAGE.md -docs/sdks/**/README.md \ No newline at end of file diff --git a/packages/mistralai_gcp/.vscode/settings.json b/packages/mistralai_gcp/.vscode/settings.json deleted file mode 100644 index 8d79f0ab..00000000 --- a/packages/mistralai_gcp/.vscode/settings.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "python.testing.pytestArgs": ["tests", "-vv"], - "python.testing.unittestEnabled": false, - "python.testing.pytestEnabled": true, - "pylint.args": ["--rcfile=pylintrc"] -} diff --git a/packages/mistralai_gcp/docs/models/assistantmessagerole.md b/packages/mistralai_gcp/docs/models/assistantmessagerole.md deleted file mode 100644 index 658229e7..00000000 --- a/packages/mistralai_gcp/docs/models/assistantmessagerole.md +++ /dev/null @@ -1,8 +0,0 @@ -# AssistantMessageRole - - -## Values - -| Name | Value | -| ----------- | ----------- | -| `ASSISTANT` | assistant | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/completionresponsestreamchoice.md b/packages/mistralai_gcp/docs/models/completionresponsestreamchoice.md deleted file mode 100644 index c807dacd..00000000 --- a/packages/mistralai_gcp/docs/models/completionresponsestreamchoice.md +++ /dev/null @@ -1,10 +0,0 @@ -# CompletionResponseStreamChoice - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | -| `index` | *int* | :heavy_check_mark: | N/A | -| `delta` | [models.DeltaMessage](../models/deltamessage.md) | :heavy_check_mark: | N/A | -| `finish_reason` | [Nullable[models.FinishReason]](../models/finishreason.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/deltamessage.md b/packages/mistralai_gcp/docs/models/deltamessage.md deleted file mode 100644 index 61deabbf..00000000 --- a/packages/mistralai_gcp/docs/models/deltamessage.md +++ /dev/null @@ -1,10 +0,0 @@ -# DeltaMessage - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -| `role` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `content` | [OptionalNullable[models.Content]](../models/content.md) | :heavy_minus_sign: | N/A | -| `tool_calls` | List[[models.ToolCall](../models/toolcall.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/imageurlchunk.md b/packages/mistralai_gcp/docs/models/imageurlchunk.md deleted file mode 100644 index f1b926ef..00000000 --- a/packages/mistralai_gcp/docs/models/imageurlchunk.md +++ /dev/null @@ -1,11 +0,0 @@ -# ImageURLChunk - -{"type":"image_url","image_url":{"url":"data:image/png;base64,iVBORw0 - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -| `image_url` | [models.ImageURLChunkImageURL](../models/imageurlchunkimageurl.md) | :heavy_check_mark: | N/A | -| `type` | [Optional[models.ImageURLChunkType]](../models/imageurlchunktype.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/imageurlchunktype.md b/packages/mistralai_gcp/docs/models/imageurlchunktype.md deleted file mode 100644 index 2064a0b4..00000000 --- a/packages/mistralai_gcp/docs/models/imageurlchunktype.md +++ /dev/null @@ -1,8 +0,0 @@ -# ImageURLChunkType - - -## Values - -| Name | Value | -| ----------- | ----------- | -| `IMAGE_URL` | image_url | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/referencechunk.md b/packages/mistralai_gcp/docs/models/referencechunk.md deleted file mode 100644 index a132ca2f..00000000 --- a/packages/mistralai_gcp/docs/models/referencechunk.md +++ /dev/null @@ -1,9 +0,0 @@ -# ReferenceChunk - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | -| `reference_ids` | List[*int*] | :heavy_check_mark: | N/A | -| `type` | [Optional[models.ReferenceChunkType]](../models/referencechunktype.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/referencechunktype.md b/packages/mistralai_gcp/docs/models/referencechunktype.md deleted file mode 100644 index 1e0e2fe6..00000000 --- a/packages/mistralai_gcp/docs/models/referencechunktype.md +++ /dev/null @@ -1,8 +0,0 @@ -# ReferenceChunkType - - -## Values - -| Name | Value | -| ----------- | ----------- | -| `REFERENCE` | reference | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/role.md b/packages/mistralai_gcp/docs/models/role.md deleted file mode 100644 index affca78d..00000000 --- a/packages/mistralai_gcp/docs/models/role.md +++ /dev/null @@ -1,8 +0,0 @@ -# Role - - -## Values - -| Name | Value | -| -------- | -------- | -| `SYSTEM` | system | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/textchunk.md b/packages/mistralai_gcp/docs/models/textchunk.md deleted file mode 100644 index 6daab3c3..00000000 --- a/packages/mistralai_gcp/docs/models/textchunk.md +++ /dev/null @@ -1,9 +0,0 @@ -# TextChunk - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | -| `text` | *str* | :heavy_check_mark: | N/A | -| `type` | [Optional[models.Type]](../models/type.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/thinkchunktype.md b/packages/mistralai_gcp/docs/models/thinkchunktype.md deleted file mode 100644 index baf6f755..00000000 --- a/packages/mistralai_gcp/docs/models/thinkchunktype.md +++ /dev/null @@ -1,8 +0,0 @@ -# ThinkChunkType - - -## Values - -| Name | Value | -| ---------- | ---------- | -| `THINKING` | thinking | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/toolmessagerole.md b/packages/mistralai_gcp/docs/models/toolmessagerole.md deleted file mode 100644 index c24e59c0..00000000 --- a/packages/mistralai_gcp/docs/models/toolmessagerole.md +++ /dev/null @@ -1,8 +0,0 @@ -# ToolMessageRole - - -## Values - -| Name | Value | -| ------ | ------ | -| `TOOL` | tool | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/type.md b/packages/mistralai_gcp/docs/models/type.md deleted file mode 100644 index eb0581e7..00000000 --- a/packages/mistralai_gcp/docs/models/type.md +++ /dev/null @@ -1,8 +0,0 @@ -# Type - - -## Values - -| Name | Value | -| ------ | ------ | -| `TEXT` | text | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/usermessagerole.md b/packages/mistralai_gcp/docs/models/usermessagerole.md deleted file mode 100644 index 171124e4..00000000 --- a/packages/mistralai_gcp/docs/models/usermessagerole.md +++ /dev/null @@ -1,8 +0,0 @@ -# UserMessageRole - - -## Values - -| Name | Value | -| ------ | ------ | -| `USER` | user | \ No newline at end of file diff --git a/packages/mistralai_gcp/src/mistralai_gcp/_hooks/custom_user_agent.py b/packages/mistralai_gcp/src/mistralai_gcp/_hooks/custom_user_agent.py deleted file mode 100644 index 77df6aef..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/_hooks/custom_user_agent.py +++ /dev/null @@ -1,22 +0,0 @@ -# THIS FILE IS THE EXACT COPY OF THE ORIGINAL FILE FROM src/mistralai/_hooks/custom_user_agent.py -from typing import Union - -import httpx - -from .types import BeforeRequestContext, BeforeRequestHook - -PREFIX = "mistral-client-python/" - -class CustomUserAgentHook(BeforeRequestHook): - def before_request( - self, hook_ctx: BeforeRequestContext, request: httpx.Request - ) -> Union[httpx.Request, Exception]: - current = request.headers["user-agent"] - if current.startswith(PREFIX): - return request - - request.headers["user-agent"] = ( - PREFIX + current.split(" ")[1] - ) - - return request diff --git a/packages/mistralai_gcp/src/mistralai_gcp/_hooks/registration.py b/packages/mistralai_gcp/src/mistralai_gcp/_hooks/registration.py deleted file mode 100644 index 304edfa2..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/_hooks/registration.py +++ /dev/null @@ -1,15 +0,0 @@ -from .custom_user_agent import CustomUserAgentHook -from .types import Hooks - -# This file is only ever generated once on the first generation and then is free to be modified. -# Any hooks you wish to add should be registered in the init_hooks function. Feel free to define them -# in this file or in separate files in the hooks folder. - - -def init_hooks(hooks: Hooks): - # pylint: disable=unused-argument - """Add hooks by calling hooks.register{sdk_init/before_request/after_success/after_error}Hook - with an instance of a hook that implements that specific Hook interface - Hooks are registered per SDK instance, and are valid for the lifetime of the SDK instance - """ - hooks.register_before_request_hook(CustomUserAgentHook()) diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/imageurlchunk.py b/packages/mistralai_gcp/src/mistralai_gcp/models/imageurlchunk.py deleted file mode 100644 index ddb53f21..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/imageurlchunk.py +++ /dev/null @@ -1,33 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .imageurl import ImageURL, ImageURLTypedDict -from mistralai_gcp.types import BaseModel -from typing import Literal, Optional, Union -from typing_extensions import NotRequired, TypeAliasType, TypedDict - - -ImageURLChunkImageURLTypedDict = TypeAliasType( - "ImageURLChunkImageURLTypedDict", Union[ImageURLTypedDict, str] -) - - -ImageURLChunkImageURL = TypeAliasType("ImageURLChunkImageURL", Union[ImageURL, str]) - - -ImageURLChunkType = Literal["image_url",] - - -class ImageURLChunkTypedDict(TypedDict): - r"""{\"type\":\"image_url\",\"image_url\":{\"url\":\"data:image/png;base64,iVBORw0""" - - image_url: ImageURLChunkImageURLTypedDict - type: NotRequired[ImageURLChunkType] - - -class ImageURLChunk(BaseModel): - r"""{\"type\":\"image_url\",\"image_url\":{\"url\":\"data:image/png;base64,iVBORw0""" - - image_url: ImageURLChunkImageURL - - type: Optional[ImageURLChunkType] = "image_url" diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/referencechunk.py b/packages/mistralai_gcp/src/mistralai_gcp/models/referencechunk.py deleted file mode 100644 index 904e8b82..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/referencechunk.py +++ /dev/null @@ -1,20 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai_gcp.types import BaseModel -from typing import List, Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -ReferenceChunkType = Literal["reference",] - - -class ReferenceChunkTypedDict(TypedDict): - reference_ids: List[int] - type: NotRequired[ReferenceChunkType] - - -class ReferenceChunk(BaseModel): - reference_ids: List[int] - - type: Optional[ReferenceChunkType] = "reference" diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/textchunk.py b/packages/mistralai_gcp/src/mistralai_gcp/models/textchunk.py deleted file mode 100644 index c4a8cf28..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/textchunk.py +++ /dev/null @@ -1,20 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai_gcp.types import BaseModel -from typing import Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -Type = Literal["text",] - - -class TextChunkTypedDict(TypedDict): - text: str - type: NotRequired[Type] - - -class TextChunk(BaseModel): - text: str - - type: Optional[Type] = "text" diff --git a/packages/mistralai_gcp/src/mistralai_gcp/sdk.py b/packages/mistralai_gcp/src/mistralai_gcp/sdk.py deleted file mode 100644 index de48fbbb..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/sdk.py +++ /dev/null @@ -1,233 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -import json -import weakref -from typing import Any, Optional, Union, cast - -import google.auth -import google.auth.credentials -import google.auth.transport -import google.auth.transport.requests -import httpx - -from mistralai_gcp import models -from mistralai_gcp._hooks import BeforeRequestHook, SDKHooks -from mistralai_gcp.chat import Chat -from mistralai_gcp.fim import Fim -from mistralai_gcp.types import UNSET, OptionalNullable - -from .basesdk import BaseSDK -from .httpclient import AsyncHttpClient, ClientOwner, HttpClient, close_clients -from .sdkconfiguration import SDKConfiguration -from .utils.logger import Logger, get_default_logger -from .utils.retries import RetryConfig - -LEGACY_MODEL_ID_FORMAT = { - "codestral-2405": "codestral@2405", - "mistral-large-2407": "mistral-large@2407", - "mistral-nemo-2407": "mistral-nemo@2407", -} - - -def get_model_info(model: str) -> tuple[str, str]: - # if the model requiers the legacy fomat, use it, else do nothing. - if model in LEGACY_MODEL_ID_FORMAT: - return "-".join(model.split("-")[:-1]), LEGACY_MODEL_ID_FORMAT[model] - return model, model - - -class MistralGoogleCloud(BaseSDK): - r"""Mistral AI API: Our Chat Completion and Embeddings APIs specification. Create your account on [La Plateforme](https://console.mistral.ai) to get access and read the [docs](https://docs.mistral.ai) to learn how to use it.""" - - chat: Chat - r"""Chat Completion API.""" - fim: Fim - r"""Fill-in-the-middle API.""" - - def __init__( - self, - region: str = "europe-west4", - project_id: Optional[str] = None, - access_token: Optional[str] = None, - client: Optional[HttpClient] = None, - async_client: Optional[AsyncHttpClient] = None, - retry_config: OptionalNullable[RetryConfig] = UNSET, - timeout_ms: Optional[int] = None, - debug_logger: Optional[Logger] = None, - ) -> None: - r"""Instantiates the SDK configuring it with the provided parameters. - - :param api_key: The api_key required for authentication - :param server: The server by name to use for all methods - :param server_url: The server URL to use for all methods - :param url_params: Parameters to optionally template the server URL with - :param client: The HTTP client to use for all synchronous methods - :param async_client: The Async HTTP client to use for all asynchronous methods - :param retry_config: The retry configuration to use for all supported methods - :param timeout_ms: Optional request timeout applied to each operation in milliseconds - """ - - credentials = None - if not access_token: - credentials, loaded_project_id = google.auth.default( - scopes=["https://www.googleapis.com/auth/cloud-platform"], - ) - - # default will already raise a google.auth.exceptions.DefaultCredentialsError if no credentials are found - assert isinstance( - credentials, google.auth.credentials.Credentials - ), "credentials must be an instance of google.auth.credentials.Credentials" - - credentials.refresh(google.auth.transport.requests.Request()) - project_id = project_id or loaded_project_id - - if project_id is None: - raise ValueError("project_id must be provided") - - def auth_token() -> str: - if access_token: - return access_token - - assert credentials is not None, "credentials must be initialized" - credentials.refresh(google.auth.transport.requests.Request()) - token = credentials.token - if not token: - raise Exception("Failed to get token from credentials") - return token - - client_supplied = True - if client is None: - client = httpx.Client() - client_supplied = False - - assert issubclass( - type(client), HttpClient - ), "The provided client must implement the HttpClient protocol." - - async_client_supplied = True - if async_client is None: - async_client = httpx.AsyncClient() - async_client_supplied = False - - if debug_logger is None: - debug_logger = get_default_logger() - - assert issubclass( - type(async_client), AsyncHttpClient - ), "The provided async_client must implement the AsyncHttpClient protocol." - - security: Any = None - if callable(auth_token): - security = lambda: models.Security( # pylint: disable=unnecessary-lambda-assignment - api_key=auth_token() - ) - else: - security = models.Security(api_key=auth_token) - - BaseSDK.__init__( - self, - SDKConfiguration( - client=client, - client_supplied=client_supplied, - async_client=async_client, - async_client_supplied=async_client_supplied, - security=security, - server_url=f"https://{region}-aiplatform.googleapis.com", - server=None, - retry_config=retry_config, - timeout_ms=timeout_ms, - debug_logger=debug_logger, - ), - ) - - hooks = SDKHooks() - hook = GoogleCloudBeforeRequestHook(region, project_id) - hooks.register_before_request_hook(hook) - current_server_url, *_ = self.sdk_configuration.get_server_details() - server_url, self.sdk_configuration.client = hooks.sdk_init( - current_server_url, client - ) - if current_server_url != server_url: - self.sdk_configuration.server_url = server_url - - # pylint: disable=protected-access - self.sdk_configuration.__dict__["_hooks"] = hooks - - weakref.finalize( - self, - close_clients, - cast(ClientOwner, self.sdk_configuration), - self.sdk_configuration.client, - self.sdk_configuration.client_supplied, - self.sdk_configuration.async_client, - self.sdk_configuration.async_client_supplied, - ) - - self._init_sdks() - - def _init_sdks(self): - self.chat = Chat(self.sdk_configuration) - self.fim = Fim(self.sdk_configuration) - - def __enter__(self): - return self - - async def __aenter__(self): - return self - - def __exit__(self, exc_type, exc_val, exc_tb): - if ( - self.sdk_configuration.client is not None - and not self.sdk_configuration.client_supplied - ): - self.sdk_configuration.client.close() - self.sdk_configuration.client = None - - async def __aexit__(self, exc_type, exc_val, exc_tb): - if ( - self.sdk_configuration.async_client is not None - and not self.sdk_configuration.async_client_supplied - ): - await self.sdk_configuration.async_client.aclose() - self.sdk_configuration.async_client = None - - -class GoogleCloudBeforeRequestHook(BeforeRequestHook): - def __init__(self, region: str, project_id: str): - self.region = region - self.project_id = project_id - - def before_request( - self, hook_ctx, request: httpx.Request - ) -> Union[httpx.Request, Exception]: - # The goal of this function is to template in the region, project and model into the URL path - # We do this here so that the API remains more user-friendly - model_id = None - new_content = None - if request.content: - parsed = json.loads(request.content.decode("utf-8")) - model_raw = parsed.get("model") - model_name, model_id = get_model_info(model_raw) - parsed["model"] = model_name - new_content = json.dumps(parsed).encode("utf-8") - - if model_id == "": - raise ValueError("model must be provided") - - stream = "streamRawPredict" in request.url.path - specifier = "streamRawPredict" if stream else "rawPredict" - url = f"/v1/projects/{self.project_id}/locations/{self.region}/publishers/mistralai/models/{model_id}:{specifier}" - - headers = dict(request.headers) - # Delete content-length header as it will need to be recalculated - headers.pop("content-length", None) - - next_request = httpx.Request( - method=request.method, - url=request.url.copy_with(path=url), - headers=headers, - content=new_content, - stream=None, - ) - - return next_request diff --git a/pyproject.toml b/pyproject.toml index f8006e7d..859cbe96 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "mistralai" -version = "2.0.0a3" +version = "2.0.0a4" description = "Python Client SDK for the Mistral AI API." authors = [{ name = "Mistral" }] requires-python = ">=3.10" @@ -8,7 +8,7 @@ readme = "README.md" dependencies = [ "eval-type-backport >=0.2.0", "httpx >=0.28.1", - "pydantic >=2.10.3", + "pydantic >=2.11.2", "python-dateutil >=2.8.2", "typing-inspection >=0.4.0", "pyyaml (>=6.0.2,<7.0.0)", @@ -65,11 +65,18 @@ default-groups = [ [tool.setuptools.package-data] "*" = ["py.typed", "src/mistralai/client/py.typed"] +[tool.hatch.build] +dev-mode-dirs = [ + "src", + "packages/azure/src", + "packages/gcp/src", +] + [tool.hatch.build.targets.sdist] include = [ "src/mistralai", - "packages/mistralai_azure/src/mistralai_azure", - "packages/mistralai_gcp/src/mistralai_gcp", + "packages/azure/src/mistralai", + "packages/gcp/src/mistralai", ] [tool.hatch.build.targets.sdist.force-include] @@ -79,14 +86,14 @@ include = [ [tool.hatch.build.targets.wheel] include = [ "src/mistralai", - "packages/mistralai_azure/src/mistralai_azure", - "packages/mistralai_gcp/src/mistralai_gcp", + "packages/azure/src/mistralai", + "packages/gcp/src/mistralai", ] [tool.hatch.build.targets.wheel.sources] "src/mistralai" = "mistralai" -"packages/mistralai_azure/src/mistralai_azure" = "mistralai_azure" -"packages/mistralai_gcp/src/mistralai_gcp" = "mistralai_gcp" +"packages/azure/src/mistralai/azure" = "mistralai/azure" +"packages/gcp/src/mistralai/gcp" = "mistralai/gcp" [build-system] requires = ["hatchling"] diff --git a/scripts/lint_custom_code.sh b/scripts/lint_custom_code.sh index 57bab71a..dbc9b683 100755 --- a/scripts/lint_custom_code.sh +++ b/scripts/lint_custom_code.sh @@ -7,7 +7,19 @@ if [ -f src/mistralai/__init__.py ]; then echo "ERROR: PEP 420 violation - src/mistralai/__init__.py must not exist" ERRORS=1 else - echo "-> PEP 420 namespace OK" + echo "-> PEP 420 namespace OK (core)" +fi +if [ -f packages/azure/src/mistralai/__init__.py ]; then + echo "ERROR: PEP 420 violation - packages/azure/src/mistralai/__init__.py must not exist" + ERRORS=1 +else + echo "-> PEP 420 namespace OK (azure)" +fi +if [ -f packages/gcp/src/mistralai/__init__.py ]; then + echo "ERROR: PEP 420 violation - packages/gcp/src/mistralai/__init__.py must not exist" + ERRORS=1 +else + echo "-> PEP 420 namespace OK (gcp)" fi echo "Running mypy..." diff --git a/scripts/run_examples.sh b/scripts/run_examples.sh index 22fc94e5..183ea6f8 100755 --- a/scripts/run_examples.sh +++ b/scripts/run_examples.sh @@ -29,8 +29,8 @@ done exclude_files=( "examples/mistral/chat/chatbot_with_streaming.py" "examples/mistral/agents/async_conversation_run_mcp_remote_auth.py" - "examples/mistral/jobs/async_fine_tuning_chat.py" "examples/mistral/jobs/async_fine_tuning.py" + "examples/mistral/jobs/async_fine_tuning_chat.py" "examples/mistral/jobs/fine_tuning.py" "examples/mistral/jobs/fine_tuning_dry_run.py" "examples/mistral/classifier/async_classifier.py" diff --git a/uv.lock b/uv.lock index 1e667c77..8c689c4a 100644 --- a/uv.lock +++ b/uv.lock @@ -563,7 +563,7 @@ wheels = [ [[package]] name = "mistralai" -version = "2.0.0a2" +version = "2.0.0a4" source = { editable = "." } dependencies = [ { name = "eval-type-backport" }, @@ -626,7 +626,7 @@ requires-dist = [ { name = "opentelemetry-exporter-otlp-proto-http", specifier = ">=1.37.0,<2.0.0" }, { name = "opentelemetry-sdk", specifier = ">=1.33.1,<2.0.0" }, { name = "opentelemetry-semantic-conventions", specifier = ">=0.59b0,<0.61" }, - { name = "pydantic", specifier = ">=2.10.3" }, + { name = "pydantic", specifier = ">=2.11.2" }, { name = "python-dateutil", specifier = ">=2.8.2" }, { name = "pyyaml", specifier = ">=6.0.2,<7.0.0" }, { name = "requests", marker = "extra == 'gcp'", specifier = ">=2.32.3" }, From 075db714fd762b5feb88b92f1f0722fa74637914 Mon Sep 17 00:00:00 2001 From: Nelson PROIA Date: Fri, 20 Feb 2026 11:57:53 +0100 Subject: [PATCH 2/2] test: add exhaustive parity and integration tests for Azure/GCP v2 - 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 --- tests/test_azure_integration.py | 438 ++++++++++++++++++++++++++++ tests/test_azure_v2_parity.py | 268 +++++++++++++++++ tests/test_gcp_integration.py | 492 ++++++++++++++++++++++++++++++++ tests/test_gcp_v2_parity.py | 328 +++++++++++++++++++++ 4 files changed, 1526 insertions(+) create mode 100644 tests/test_azure_integration.py create mode 100644 tests/test_azure_v2_parity.py create mode 100644 tests/test_gcp_integration.py create mode 100644 tests/test_gcp_v2_parity.py diff --git a/tests/test_azure_integration.py b/tests/test_azure_integration.py new file mode 100644 index 00000000..c5268872 --- /dev/null +++ b/tests/test_azure_integration.py @@ -0,0 +1,438 @@ +""" +Integration tests for Azure SDK. + +These tests require credentials and make real API calls. +Skip if AZURE_API_KEY env var is not set. + +Prerequisites: + 1. Azure API key (stored in Bitwarden at "[MaaS] - Azure Foundry API key") + 2. Tailscale connected via gw-0 exit node + +Usage: + AZURE_API_KEY=xxx pytest tests/test_azure_integration.py -v + +Environment variables: + AZURE_API_KEY: API key (required) + AZURE_ENDPOINT: Base URL (default: https://maas-qa-aifoundry.services.ai.azure.com/models) + AZURE_MODEL: Model name (default: maas-qa-ministral-3b) + AZURE_API_VERSION: API version query param (default: 2024-05-01-preview) + +Note: AZURE_ENDPOINT should be the base URL without path suffixes. +The SDK appends /chat/completions to this URL. The api-version query +parameter is injected via httpx.Client params. + +Available models: + Chat: maas-qa-ministral-3b, maas-qa-mistral-large-3, maas-qa-mistral-medium-2505 + OCR: maas-qa-mistral-document-ai-2505, maas-qa-mistral-document-ai-2512 + (OCR uses a separate endpoint, not tested here) +""" +import json +import os + +import httpx +import pytest + +# Configuration from env vars +AZURE_API_KEY = os.environ.get("AZURE_API_KEY") +AZURE_ENDPOINT = os.environ.get( + "AZURE_ENDPOINT", + "https://maas-qa-aifoundry.services.ai.azure.com/models", +) +AZURE_MODEL = os.environ.get("AZURE_MODEL", "maas-qa-ministral-3b") +AZURE_API_VERSION = os.environ.get("AZURE_API_VERSION", "2024-05-01-preview") + +SKIP_REASON = "AZURE_API_KEY env var required" + +pytestmark = pytest.mark.skipif( + not AZURE_API_KEY, + reason=SKIP_REASON +) + +# Shared tool definition for tool-call tests +WEATHER_TOOL = { + "type": "function", + "function": { + "name": "get_weather", + "description": "Get the weather in a city", + "parameters": { + "type": "object", + "properties": {"city": {"type": "string"}}, + "required": ["city"], + }, + }, +} + + +@pytest.fixture +def azure_client(): + """Create an Azure client with api-version query param.""" + from mistralai.azure.client import MistralAzure + client = httpx.Client( + follow_redirects=True, + params={"api-version": AZURE_API_VERSION}, + ) + return MistralAzure( + api_key=AZURE_API_KEY, + server_url=AZURE_ENDPOINT, + client=client, + ) + + +class TestAzureChatComplete: + """Test synchronous chat completion.""" + + def test_basic_completion(self, azure_client): + """Test basic chat completion returns a response.""" + res = azure_client.chat.complete( + model=AZURE_MODEL, + messages=[ + {"role": "user", "content": "Say 'hello' and nothing else."} + ], + ) + assert res is not None + assert res.choices is not None + assert len(res.choices) > 0 + assert res.choices[0].message is not None + assert res.choices[0].message.content is not None + assert len(res.choices[0].message.content) > 0 + + def test_completion_with_system_message(self, azure_client): + """Test chat completion with system + user message.""" + res = azure_client.chat.complete( + model=AZURE_MODEL, + messages=[ + {"role": "system", "content": "You are a pirate. Respond in pirate speak."}, + {"role": "user", "content": "Say hello."}, + ], + ) + assert res is not None + assert res.choices[0].message.content is not None + assert len(res.choices[0].message.content) > 0 + + def test_completion_with_max_tokens(self, azure_client): + """Test chat completion respects max_tokens.""" + res = azure_client.chat.complete( + model=AZURE_MODEL, + messages=[ + {"role": "user", "content": "Count from 1 to 100."} + ], + max_tokens=10, + ) + assert res is not None + assert res.choices[0].finish_reason in ("length", "stop") + + def test_completion_with_temperature(self, azure_client): + """Test chat completion accepts temperature parameter.""" + res = azure_client.chat.complete( + model=AZURE_MODEL, + messages=[ + {"role": "user", "content": "Say 'test'."} + ], + temperature=0.0, + ) + assert res is not None + assert res.choices[0].message.content is not None + + def test_completion_with_stop_sequence(self, azure_client): + """Test chat completion stops at stop sequence.""" + res = azure_client.chat.complete( + model=AZURE_MODEL, + messages=[ + {"role": "user", "content": "Write three sentences about the sky."} + ], + stop=["."], + ) + assert res is not None + content = res.choices[0].message.content + assert content is not None + # The model should stop at or before the first period + assert content.count(".") <= 1 + + def test_completion_with_random_seed(self, azure_client): + """Test chat completion with random_seed returns valid responses.""" + res1 = azure_client.chat.complete( + model=AZURE_MODEL, + messages=[ + {"role": "user", "content": "Say 'deterministic'."} + ], + random_seed=42, + ) + res2 = azure_client.chat.complete( + model=AZURE_MODEL, + messages=[ + {"role": "user", "content": "Say 'deterministic'."} + ], + random_seed=42, + ) + # Both should return valid responses (not asserting equality due to model non-determinism) + assert res1.choices[0].message.content is not None + assert res2.choices[0].message.content is not None + + def test_multi_turn_conversation(self, azure_client): + """Test multi-turn conversation with user/assistant round-trip.""" + res1 = azure_client.chat.complete( + model=AZURE_MODEL, + messages=[ + {"role": "user", "content": "My name is Alice."} + ], + ) + assert res1.choices[0].message.content is not None + + res2 = azure_client.chat.complete( + model=AZURE_MODEL, + messages=[ + {"role": "user", "content": "My name is Alice."}, + {"role": "assistant", "content": res1.choices[0].message.content}, + {"role": "user", "content": "What is my name?"}, + ], + ) + assert res2.choices[0].message.content is not None + assert "Alice" in res2.choices[0].message.content + + def test_tool_call(self, azure_client): + """Test that the model returns a tool call when given tools.""" + res = azure_client.chat.complete( + model=AZURE_MODEL, + messages=[ + {"role": "user", "content": "What is the weather in Paris?"} + ], + tools=[WEATHER_TOOL], + tool_choice="any", + ) + assert res is not None + choice = res.choices[0] + assert choice.message.tool_calls is not None + assert len(choice.message.tool_calls) > 0 + tool_call = choice.message.tool_calls[0] + assert tool_call.function.name == "get_weather" + args = json.loads(tool_call.function.arguments) + assert "city" in args + + def test_json_response_format(self, azure_client): + """Test JSON response format returns valid JSON.""" + res = azure_client.chat.complete( + model=AZURE_MODEL, + messages=[ + {"role": "user", "content": "Return a JSON object with a key 'greeting' and value 'hello'."} + ], + response_format={"type": "json_object"}, + ) + assert res is not None + content = res.choices[0].message.content + assert content is not None + parsed = json.loads(content) + assert isinstance(parsed, dict) + + def test_completion_with_n(self, azure_client): + """Test completion with n=2 returns multiple choices.""" + res = azure_client.chat.complete( + model=AZURE_MODEL, + messages=[ + {"role": "user", "content": "Say a random word."} + ], + n=2, + ) + assert res is not None + assert len(res.choices) == 2 + for choice in res.choices: + assert choice.message.content is not None + + +class TestAzureChatStream: + """Test streaming chat completion.""" + + def test_basic_stream(self, azure_client): + """Test streaming returns chunks with content.""" + stream = azure_client.chat.stream( + model=AZURE_MODEL, + messages=[ + {"role": "user", "content": "Say 'hello' and nothing else."} + ], + ) + + chunks = list(stream) + assert len(chunks) > 0 + + content = "" + for chunk in chunks: + if chunk.data.choices and chunk.data.choices[0].delta.content: + content += chunk.data.choices[0].delta.content + + assert len(content) > 0 + + def test_stream_with_max_tokens(self, azure_client): + """Test streaming respects max_tokens truncation.""" + stream = azure_client.chat.stream( + model=AZURE_MODEL, + messages=[ + {"role": "user", "content": "Count from 1 to 100."} + ], + max_tokens=10, + ) + + chunks = list(stream) + assert len(chunks) > 0 + + # Find finish_reason in any chunk + finish_reasons = [ + chunk.data.choices[0].finish_reason + for chunk in chunks + if chunk.data.choices and chunk.data.choices[0].finish_reason is not None + ] + assert len(finish_reasons) > 0 + assert finish_reasons[-1] in ("length", "stop") + + def test_stream_finish_reason(self, azure_client): + """Test that the last chunk has a finish_reason.""" + stream = azure_client.chat.stream( + model=AZURE_MODEL, + messages=[ + {"role": "user", "content": "Say 'hi'."} + ], + ) + + chunks = list(stream) + assert len(chunks) > 0 + + # The final chunk(s) should contain a finish_reason + finish_reasons = [ + chunk.data.choices[0].finish_reason + for chunk in chunks + if chunk.data.choices and chunk.data.choices[0].finish_reason is not None + ] + assert len(finish_reasons) > 0 + assert finish_reasons[-1] == "stop" + + def test_stream_tool_call(self, azure_client): + """Test tool call via streaming, collecting tool_call delta chunks.""" + stream = azure_client.chat.stream( + model=AZURE_MODEL, + messages=[ + {"role": "user", "content": "What is the weather in Paris?"} + ], + tools=[WEATHER_TOOL], + tool_choice="any", + ) + + chunks = list(stream) + assert len(chunks) > 0 + + # Collect tool call information from delta chunks + tool_call_found = False + for chunk in chunks: + if chunk.data.choices and chunk.data.choices[0].delta.tool_calls: + tool_call_found = True + break + + assert tool_call_found, "Expected tool_call delta chunks in stream" + + +class TestAzureChatCompleteAsync: + """Test async chat completion.""" + + @pytest.mark.asyncio + async def test_basic_completion_async(self, azure_client): + """Test async chat completion returns a response.""" + res = await azure_client.chat.complete_async( + model=AZURE_MODEL, + messages=[ + {"role": "user", "content": "Say 'hello' and nothing else."} + ], + ) + assert res is not None + assert res.choices is not None + assert len(res.choices) > 0 + assert res.choices[0].message.content is not None + + @pytest.mark.asyncio + async def test_completion_with_system_message_async(self, azure_client): + """Test async chat completion with system + user message.""" + res = await azure_client.chat.complete_async( + model=AZURE_MODEL, + messages=[ + {"role": "system", "content": "You are a helpful assistant."}, + {"role": "user", "content": "Say 'hello'."}, + ], + ) + assert res is not None + assert res.choices[0].message.content is not None + + @pytest.mark.asyncio + async def test_tool_call_async(self, azure_client): + """Test async tool call returns tool_calls.""" + res = await azure_client.chat.complete_async( + model=AZURE_MODEL, + messages=[ + {"role": "user", "content": "What is the weather in Paris?"} + ], + tools=[WEATHER_TOOL], + tool_choice="any", + ) + assert res is not None + choice = res.choices[0] + assert choice.message.tool_calls is not None + assert len(choice.message.tool_calls) > 0 + assert choice.message.tool_calls[0].function.name == "get_weather" + + +class TestAzureChatStreamAsync: + """Test async streaming chat completion.""" + + @pytest.mark.asyncio + async def test_basic_stream_async(self, azure_client): + """Test async streaming returns chunks with content.""" + stream = await azure_client.chat.stream_async( + model=AZURE_MODEL, + messages=[ + {"role": "user", "content": "Say 'hello' and nothing else."} + ], + ) + + content = "" + async for chunk in stream: + if chunk.data.choices and chunk.data.choices[0].delta.content: + content += chunk.data.choices[0].delta.content + + assert len(content) > 0 + + +class TestAzureContextManager: + """Test context manager support.""" + + def test_sync_context_manager(self): + """Test that MistralAzure works as a sync context manager.""" + from mistralai.azure.client import MistralAzure + http_client = httpx.Client( + follow_redirects=True, + params={"api-version": AZURE_API_VERSION}, + ) + with MistralAzure( + api_key=AZURE_API_KEY, + server_url=AZURE_ENDPOINT, + client=http_client, + ) as client: + res = client.chat.complete( + model=AZURE_MODEL, + messages=[ + {"role": "user", "content": "Say 'context'."} + ], + ) + assert res is not None + assert res.choices[0].message.content is not None + + @pytest.mark.asyncio + async def test_async_context_manager(self): + """Test that MistralAzure works as an async context manager.""" + from mistralai.azure.client import MistralAzure + async with MistralAzure( + api_key=AZURE_API_KEY, + server_url=AZURE_ENDPOINT, + ) as client: + res = await client.chat.complete_async( + model=AZURE_MODEL, + messages=[ + {"role": "user", "content": "Say 'async context'."} + ], + ) + assert res is not None + assert res.choices[0].message.content is not None diff --git a/tests/test_azure_v2_parity.py b/tests/test_azure_v2_parity.py new file mode 100644 index 00000000..ac28cee7 --- /dev/null +++ b/tests/test_azure_v2_parity.py @@ -0,0 +1,268 @@ +""" +Parity tests for the Azure v2 SDK. + +Verifies that the regenerated mistralai.azure package exposes +the same public API surface as the v1 mistralai_azure package. +Uses introspection only — no API calls or credentials required. +""" +import inspect + +import pytest + +from mistralai.azure.client import MistralAzure +from mistralai.azure.client.chat import Chat +from mistralai.azure.client.ocr import Ocr +from mistralai.azure.client.types import UNSET + +AZURE_METHODS: dict[str, set[str]] = { + "chat": {"complete", "stream"}, + "ocr": {"process"}, +} + +TESTED_METHODS: set[str] = set() + +_EMPTY = inspect.Parameter.empty + + +def mark_tested(resource: str, method: str) -> None: + TESTED_METHODS.add(f"{resource}.{method}") + + +# --------------------------------------------------------------------------- +# Expected parameter specs: (name, expected_default) +# Use _EMPTY for required params, UNSET for OptionalNullable, None for Optional +# --------------------------------------------------------------------------- + +CONSTRUCTOR_PARAMS = [ + ("api_key", _EMPTY), + ("server", None), + ("server_url", None), + ("url_params", None), + ("client", None), + ("async_client", None), + ("retry_config", UNSET), + ("timeout_ms", None), + ("debug_logger", None), +] + +CHAT_COMPLETE_PARAMS = [ + ("messages", _EMPTY), + ("model", "azureai"), + ("temperature", UNSET), + ("top_p", None), + ("max_tokens", UNSET), + ("stream", False), + ("stop", None), + ("random_seed", UNSET), + ("metadata", UNSET), + ("response_format", None), + ("tools", UNSET), + ("tool_choice", None), + ("presence_penalty", None), + ("frequency_penalty", None), + ("n", UNSET), + ("prediction", None), + ("parallel_tool_calls", None), + ("prompt_mode", UNSET), + ("safe_prompt", None), + ("retries", UNSET), + ("server_url", None), + ("timeout_ms", None), + ("http_headers", None), +] + +CHAT_STREAM_PARAMS = [ + (name, True if name == "stream" else default) + for name, default in CHAT_COMPLETE_PARAMS +] + +OCR_PROCESS_PARAMS = [ + ("model", _EMPTY), + ("document", _EMPTY), + ("id", None), + ("pages", UNSET), + ("include_image_base64", UNSET), + ("image_limit", UNSET), + ("image_min_size", UNSET), + ("bbox_annotation_format", UNSET), + ("document_annotation_format", UNSET), + ("document_annotation_prompt", UNSET), + ("table_format", UNSET), + ("extract_header", None), + ("extract_footer", None), + ("retries", UNSET), + ("server_url", None), + ("timeout_ms", None), + ("http_headers", None), +] + + +# --------------------------------------------------------------------------- +# Tests +# --------------------------------------------------------------------------- + + +class TestAzureSDKStructure: + def test_sdk_has_chat(self): + assert "chat" in MistralAzure.__annotations__ + + def test_sdk_has_ocr(self): + assert "ocr" in MistralAzure.__annotations__ + + @pytest.mark.parametrize("param_name,expected_default", CONSTRUCTOR_PARAMS) + def test_constructor_param(self, param_name, expected_default): + sig = inspect.signature(MistralAzure.__init__) + assert param_name in sig.parameters, f"Missing constructor param: {param_name}" + actual = sig.parameters[param_name].default + assert actual == expected_default, ( + f"Constructor param {param_name}: expected {expected_default!r}, got {actual!r}" + ) + + @pytest.mark.parametrize("method", ["__enter__", "__exit__", "__aenter__", "__aexit__"]) + def test_context_manager_support(self, method): + assert hasattr(MistralAzure, method), f"MistralAzure missing {method}" + + +class TestAzureChat: + def test_has_complete(self): + assert hasattr(Chat, "complete") + mark_tested("chat", "complete") + + def test_has_complete_async(self): + assert hasattr(Chat, "complete_async") + mark_tested("chat", "complete_async") + + def test_has_stream(self): + assert hasattr(Chat, "stream") + mark_tested("chat", "stream") + + def test_has_stream_async(self): + assert hasattr(Chat, "stream_async") + mark_tested("chat", "stream_async") + + # -- complete params -- + @pytest.mark.parametrize("param_name,expected_default", CHAT_COMPLETE_PARAMS) + def test_complete_has_param(self, param_name, expected_default): + sig = inspect.signature(Chat.complete) + assert param_name in sig.parameters, f"Chat.complete missing param: {param_name}" + actual = sig.parameters[param_name].default + assert actual == expected_default, ( + f"Chat.complete param {param_name}: expected {expected_default!r}, got {actual!r}" + ) + + # -- stream params -- + @pytest.mark.parametrize("param_name,expected_default", CHAT_STREAM_PARAMS) + def test_stream_has_param(self, param_name, expected_default): + sig = inspect.signature(Chat.stream) + assert param_name in sig.parameters, f"Chat.stream missing param: {param_name}" + actual = sig.parameters[param_name].default + assert actual == expected_default, ( + f"Chat.stream param {param_name}: expected {expected_default!r}, got {actual!r}" + ) + + # -- complete_async matches complete -- + @pytest.mark.parametrize("param_name,expected_default", CHAT_COMPLETE_PARAMS) + def test_complete_async_has_param(self, param_name, expected_default): + sig = inspect.signature(Chat.complete_async) + assert param_name in sig.parameters, f"Chat.complete_async missing param: {param_name}" + actual = sig.parameters[param_name].default + assert actual == expected_default, ( + f"Chat.complete_async param {param_name}: expected {expected_default!r}, got {actual!r}" + ) + + # -- stream_async matches stream -- + @pytest.mark.parametrize("param_name,expected_default", CHAT_STREAM_PARAMS) + def test_stream_async_has_param(self, param_name, expected_default): + sig = inspect.signature(Chat.stream_async) + assert param_name in sig.parameters, f"Chat.stream_async missing param: {param_name}" + actual = sig.parameters[param_name].default + assert actual == expected_default, ( + f"Chat.stream_async param {param_name}: expected {expected_default!r}, got {actual!r}" + ) + + # -- sync/async parity -- + def test_complete_async_matches_complete(self): + sync_params = set(inspect.signature(Chat.complete).parameters) - {"self"} + async_params = set(inspect.signature(Chat.complete_async).parameters) - {"self"} + assert sync_params == async_params + + def test_stream_async_matches_stream(self): + sync_params = set(inspect.signature(Chat.stream).parameters) - {"self"} + async_params = set(inspect.signature(Chat.stream_async).parameters) - {"self"} + assert sync_params == async_params + + # -- key defaults -- + def test_complete_model_defaults_azureai(self): + sig = inspect.signature(Chat.complete) + assert sig.parameters["model"].default == "azureai" + + def test_stream_model_defaults_azureai(self): + sig = inspect.signature(Chat.stream) + assert sig.parameters["model"].default == "azureai" + + def test_complete_stream_defaults_false(self): + sig = inspect.signature(Chat.complete) + assert sig.parameters["stream"].default is False + + def test_stream_stream_defaults_true(self): + sig = inspect.signature(Chat.stream) + assert sig.parameters["stream"].default is True + + +class TestAzureOcr: + def test_has_process(self): + assert hasattr(Ocr, "process") + mark_tested("ocr", "process") + + def test_has_process_async(self): + assert hasattr(Ocr, "process_async") + mark_tested("ocr", "process_async") + + # -- process params -- + @pytest.mark.parametrize("param_name,expected_default", OCR_PROCESS_PARAMS) + def test_process_has_param(self, param_name, expected_default): + sig = inspect.signature(Ocr.process) + assert param_name in sig.parameters, f"Ocr.process missing param: {param_name}" + actual = sig.parameters[param_name].default + assert actual == expected_default, ( + f"Ocr.process param {param_name}: expected {expected_default!r}, got {actual!r}" + ) + + # -- process_async matches process -- + @pytest.mark.parametrize("param_name,expected_default", OCR_PROCESS_PARAMS) + def test_process_async_has_param(self, param_name, expected_default): + sig = inspect.signature(Ocr.process_async) + assert param_name in sig.parameters, f"Ocr.process_async missing param: {param_name}" + actual = sig.parameters[param_name].default + assert actual == expected_default, ( + f"Ocr.process_async param {param_name}: expected {expected_default!r}, got {actual!r}" + ) + + # -- sync/async parity -- + def test_process_async_matches_process(self): + sync_params = set(inspect.signature(Ocr.process).parameters) - {"self"} + async_params = set(inspect.signature(Ocr.process_async).parameters) - {"self"} + assert sync_params == async_params + + +class TestAzureCoverage: + def test_all_methods_tested(self): + expected = set() + for resource, methods in AZURE_METHODS.items(): + for method in methods: + expected.add(f"{resource}.{method}") + expected.add(f"{resource}.{method}_async") + untested = expected - TESTED_METHODS + assert not untested, f"Untested methods: {untested}" + + def test_no_unexpected_public_methods_on_chat(self): + public = {m for m in dir(Chat) if not m.startswith("_") and callable(getattr(Chat, m, None))} + known = {"complete", "complete_async", "stream", "stream_async", "do_request", "do_request_async"} + unexpected = public - known + assert not unexpected, f"Unexpected Chat methods: {unexpected}" + + def test_no_unexpected_public_methods_on_ocr(self): + public = {m for m in dir(Ocr) if not m.startswith("_") and callable(getattr(Ocr, m, None))} + known = {"process", "process_async", "do_request", "do_request_async"} + unexpected = public - known + assert not unexpected, f"Unexpected Ocr methods: {unexpected}" diff --git a/tests/test_gcp_integration.py b/tests/test_gcp_integration.py new file mode 100644 index 00000000..2510bc38 --- /dev/null +++ b/tests/test_gcp_integration.py @@ -0,0 +1,492 @@ +""" +Integration tests for GCP SDK. + +These tests require GCP credentials and make real API calls. +Skip if GCP_PROJECT_ID env var is not set. + +Prerequisites: + 1. Authenticate with GCP: gcloud auth application-default login + 2. Have "Vertex AI User" role on the project (e.g. model-garden-420509) + 3. gcloud CLI installed and authenticated + +The Vertex AI URL is auto-constructed from project ID, region, and model: + https://{region}-aiplatform.googleapis.com/v1/projects/{project_id}/locations/{region}/publishers/mistralai/models/{model} + +Available models: + - Chat: mistral-small-2503, mistral-large-2501, ... + - FIM: codestral-2 + See: https://cloud.google.com/vertex-ai/generative-ai/docs/partner-models/mistral + +Usage: + GCP_PROJECT_ID=model-garden-420509 pytest tests/test_gcp_integration.py -v + +Environment variables: + GCP_PROJECT_ID: GCP project ID (required) + GCP_REGION: Vertex AI region (default: us-central1) + GCP_MODEL: Model name for chat (default: mistral-small-2503) + GCP_FIM_MODEL: Model name for FIM (default: codestral-2) + +""" +import json +import os +import subprocess + +import pytest + +# Configuration from env vars +GCP_PROJECT_ID = os.environ.get("GCP_PROJECT_ID") +GCP_REGION = os.environ.get("GCP_REGION", "us-central1") +GCP_MODEL = os.environ.get("GCP_MODEL", "mistral-small-2503") +GCP_FIM_MODEL = os.environ.get("GCP_FIM_MODEL", "codestral-2") + +SKIP_REASON = "GCP_PROJECT_ID env var required" + +pytestmark = pytest.mark.skipif( + not GCP_PROJECT_ID, + reason=SKIP_REASON +) + +# Shared tool definition for tool-call tests +WEATHER_TOOL = { + "type": "function", + "function": { + "name": "get_weather", + "description": "Get the weather in a city", + "parameters": { + "type": "object", + "properties": {"city": {"type": "string"}}, + "required": ["city"], + }, + }, +} + + +def build_vertex_url(project_id, region, model): + """Construct the Vertex AI endpoint URL for a given model.""" + return ( + f"https://{region}-aiplatform.googleapis.com/v1/" + f"projects/{project_id}/locations/{region}/" + f"publishers/mistralai/models/{model}" + ) + + +def get_fresh_token(): + """Get fresh GCP token via gcloud CLI.""" + result = subprocess.run( + ["gcloud", "auth", "print-access-token"], + capture_output=True, text=True + ) + return result.stdout.strip() + + +@pytest.fixture +def gcp_client(): + """Create a GCP client for chat tests.""" + from mistralai.gcp.client import MistralGCP + token = get_fresh_token() + server_url = build_vertex_url(GCP_PROJECT_ID, GCP_REGION, GCP_MODEL) + return MistralGCP( + api_key=token, + server_url=server_url, + ) + + +class TestGCPChatComplete: + """Test synchronous chat completion.""" + + def test_basic_completion(self, gcp_client): + """Test basic chat completion returns a response.""" + res = gcp_client.chat.complete( + model=GCP_MODEL, + messages=[ + {"role": "user", "content": "Say 'hello' and nothing else."} + ], + ) + assert res is not None + assert res.choices is not None + assert len(res.choices) > 0 + assert res.choices[0].message is not None + assert res.choices[0].message.content is not None + assert len(res.choices[0].message.content) > 0 + + def test_completion_with_system_message(self, gcp_client): + """Test chat completion with system + user message.""" + res = gcp_client.chat.complete( + model=GCP_MODEL, + messages=[ + {"role": "system", "content": "You are a pirate. Respond in pirate speak."}, + {"role": "user", "content": "Say hello."}, + ], + ) + assert res is not None + assert res.choices[0].message.content is not None + assert len(res.choices[0].message.content) > 0 + + def test_completion_with_max_tokens(self, gcp_client): + """Test chat completion respects max_tokens.""" + res = gcp_client.chat.complete( + model=GCP_MODEL, + messages=[ + {"role": "user", "content": "Count from 1 to 100."} + ], + max_tokens=10, + ) + assert res is not None + assert res.choices[0].finish_reason in ("length", "stop") + + def test_completion_with_temperature(self, gcp_client): + """Test chat completion accepts temperature parameter.""" + res = gcp_client.chat.complete( + model=GCP_MODEL, + messages=[ + {"role": "user", "content": "Say 'test'."} + ], + temperature=0.0, + ) + assert res is not None + assert res.choices[0].message.content is not None + + def test_completion_with_stop_sequence(self, gcp_client): + """Test chat completion stops at stop sequence.""" + res = gcp_client.chat.complete( + model=GCP_MODEL, + messages=[ + {"role": "user", "content": "Write three sentences about the sky."} + ], + stop=["."], + ) + assert res is not None + content = res.choices[0].message.content + assert content is not None + # The model should stop at or before the first period + assert content.count(".") <= 1 + + def test_completion_with_random_seed(self, gcp_client): + """Test chat completion with random_seed returns valid responses.""" + res1 = gcp_client.chat.complete( + model=GCP_MODEL, + messages=[ + {"role": "user", "content": "Say 'deterministic'."} + ], + random_seed=42, + ) + res2 = gcp_client.chat.complete( + model=GCP_MODEL, + messages=[ + {"role": "user", "content": "Say 'deterministic'."} + ], + random_seed=42, + ) + # Both should return valid responses (not asserting equality due to model non-determinism) + assert res1.choices[0].message.content is not None + assert res2.choices[0].message.content is not None + + def test_multi_turn_conversation(self, gcp_client): + """Test multi-turn conversation with user/assistant round-trip.""" + res1 = gcp_client.chat.complete( + model=GCP_MODEL, + messages=[ + {"role": "user", "content": "My name is Alice."} + ], + ) + assert res1.choices[0].message.content is not None + + res2 = gcp_client.chat.complete( + model=GCP_MODEL, + messages=[ + {"role": "user", "content": "My name is Alice."}, + {"role": "assistant", "content": res1.choices[0].message.content}, + {"role": "user", "content": "What is my name?"}, + ], + ) + assert res2.choices[0].message.content is not None + assert "Alice" in res2.choices[0].message.content + + def test_tool_call(self, gcp_client): + """Test that the model returns a tool call when given tools.""" + res = gcp_client.chat.complete( + model=GCP_MODEL, + messages=[ + {"role": "user", "content": "What is the weather in Paris?"} + ], + tools=[WEATHER_TOOL], + tool_choice="any", + ) + assert res is not None + choice = res.choices[0] + assert choice.message.tool_calls is not None + assert len(choice.message.tool_calls) > 0 + tool_call = choice.message.tool_calls[0] + assert tool_call.function.name == "get_weather" + args = json.loads(tool_call.function.arguments) + assert "city" in args + + def test_json_response_format(self, gcp_client): + """Test JSON response format returns valid JSON.""" + res = gcp_client.chat.complete( + model=GCP_MODEL, + messages=[ + {"role": "user", "content": "Return a JSON object with a key 'greeting' and value 'hello'."} + ], + response_format={"type": "json_object"}, + ) + assert res is not None + content = res.choices[0].message.content + assert content is not None + parsed = json.loads(content) + assert isinstance(parsed, dict) + + +class TestGCPChatStream: + """Test streaming chat completion.""" + + def test_basic_stream(self, gcp_client): + """Test streaming returns chunks with content.""" + stream = gcp_client.chat.stream( + model=GCP_MODEL, + messages=[ + {"role": "user", "content": "Say 'hello' and nothing else."} + ], + ) + + chunks = list(stream) + assert len(chunks) > 0 + + content = "" + for chunk in chunks: + if chunk.data.choices and chunk.data.choices[0].delta.content: + content += chunk.data.choices[0].delta.content + + assert len(content) > 0 + + def test_stream_with_max_tokens(self, gcp_client): + """Test streaming respects max_tokens truncation.""" + stream = gcp_client.chat.stream( + model=GCP_MODEL, + messages=[ + {"role": "user", "content": "Count from 1 to 100."} + ], + max_tokens=10, + ) + + chunks = list(stream) + assert len(chunks) > 0 + + # Find finish_reason in any chunk + finish_reasons = [ + chunk.data.choices[0].finish_reason + for chunk in chunks + if chunk.data.choices and chunk.data.choices[0].finish_reason is not None + ] + assert len(finish_reasons) > 0 + assert finish_reasons[-1] in ("length", "stop") + + def test_stream_finish_reason(self, gcp_client): + """Test that the last chunk has a finish_reason.""" + stream = gcp_client.chat.stream( + model=GCP_MODEL, + messages=[ + {"role": "user", "content": "Say 'hi'."} + ], + ) + + chunks = list(stream) + assert len(chunks) > 0 + + # The final chunk(s) should contain a finish_reason + finish_reasons = [ + chunk.data.choices[0].finish_reason + for chunk in chunks + if chunk.data.choices and chunk.data.choices[0].finish_reason is not None + ] + assert len(finish_reasons) > 0 + assert finish_reasons[-1] == "stop" + + def test_stream_tool_call(self, gcp_client): + """Test tool call via streaming, collecting tool_call delta chunks.""" + stream = gcp_client.chat.stream( + model=GCP_MODEL, + messages=[ + {"role": "user", "content": "What is the weather in Paris?"} + ], + tools=[WEATHER_TOOL], + tool_choice="any", + ) + + chunks = list(stream) + assert len(chunks) > 0 + + # Collect tool call information from delta chunks + tool_call_found = False + for chunk in chunks: + if chunk.data.choices and chunk.data.choices[0].delta.tool_calls: + tool_call_found = True + break + + assert tool_call_found, "Expected tool_call delta chunks in stream" + + +class TestGCPChatCompleteAsync: + """Test async chat completion.""" + + @pytest.mark.asyncio + async def test_basic_completion_async(self, gcp_client): + """Test async chat completion returns a response.""" + res = await gcp_client.chat.complete_async( + model=GCP_MODEL, + messages=[ + {"role": "user", "content": "Say 'hello' and nothing else."} + ], + ) + assert res is not None + assert res.choices is not None + assert len(res.choices) > 0 + assert res.choices[0].message.content is not None + + @pytest.mark.asyncio + async def test_completion_with_system_message_async(self, gcp_client): + """Test async chat completion with system + user message.""" + res = await gcp_client.chat.complete_async( + model=GCP_MODEL, + messages=[ + {"role": "system", "content": "You are a helpful assistant."}, + {"role": "user", "content": "Say 'hello'."}, + ], + ) + assert res is not None + assert res.choices[0].message.content is not None + + @pytest.mark.asyncio + async def test_tool_call_async(self, gcp_client): + """Test async tool call returns tool_calls.""" + res = await gcp_client.chat.complete_async( + model=GCP_MODEL, + messages=[ + {"role": "user", "content": "What is the weather in Paris?"} + ], + tools=[WEATHER_TOOL], + tool_choice="any", + ) + assert res is not None + choice = res.choices[0] + assert choice.message.tool_calls is not None + assert len(choice.message.tool_calls) > 0 + assert choice.message.tool_calls[0].function.name == "get_weather" + + +class TestGCPChatStreamAsync: + """Test async streaming chat completion.""" + + @pytest.mark.asyncio + async def test_basic_stream_async(self, gcp_client): + """Test async streaming returns chunks with content.""" + stream = await gcp_client.chat.stream_async( + model=GCP_MODEL, + messages=[ + {"role": "user", "content": "Say 'hello' and nothing else."} + ], + ) + + content = "" + async for chunk in stream: + if chunk.data.choices and chunk.data.choices[0].delta.content: + content += chunk.data.choices[0].delta.content + + assert len(content) > 0 + + +class TestGCPContextManager: + """Test context manager support.""" + + def test_sync_context_manager(self): + """Test that MistralGCP works as a sync context manager.""" + from mistralai.gcp.client import MistralGCP + token = get_fresh_token() + server_url = build_vertex_url(GCP_PROJECT_ID, GCP_REGION, GCP_MODEL) + with MistralGCP( + api_key=token, + server_url=server_url, + ) as client: + res = client.chat.complete( + model=GCP_MODEL, + messages=[ + {"role": "user", "content": "Say 'context'."} + ], + ) + assert res is not None + assert res.choices[0].message.content is not None + + @pytest.mark.asyncio + async def test_async_context_manager(self): + """Test that MistralGCP works as an async context manager.""" + from mistralai.gcp.client import MistralGCP + token = get_fresh_token() + server_url = build_vertex_url(GCP_PROJECT_ID, GCP_REGION, GCP_MODEL) + async with MistralGCP( + api_key=token, + server_url=server_url, + ) as client: + res = await client.chat.complete_async( + model=GCP_MODEL, + messages=[ + {"role": "user", "content": "Say 'async context'."} + ], + ) + assert res is not None + assert res.choices[0].message.content is not None + + +class TestGCPFIM: + """Test FIM (Fill-in-the-middle) completion.""" + + def _make_fim_client(self): + """Create a GCP client configured for FIM model.""" + from mistralai.gcp.client import MistralGCP + token = get_fresh_token() + server_url = build_vertex_url(GCP_PROJECT_ID, GCP_REGION, GCP_FIM_MODEL) + return MistralGCP(api_key=token, server_url=server_url) + + def test_fim_complete(self): + """Test FIM completion returns a response.""" + client = self._make_fim_client() + res = client.fim.complete( + model=GCP_FIM_MODEL, + prompt="def fib():", + suffix=" return result", + timeout_ms=10000, + ) + assert res is not None + assert res.choices is not None + assert len(res.choices) > 0 + assert res.choices[0].message.content is not None + + def test_fim_stream(self): + """Test FIM streaming returns chunks.""" + client = self._make_fim_client() + stream = client.fim.stream( + model=GCP_FIM_MODEL, + prompt="def hello():", + suffix=" return greeting", + timeout_ms=10000, + ) + chunks = list(stream) + assert len(chunks) > 0 + + content = "" + for chunk in chunks: + if chunk.data.choices and chunk.data.choices[0].delta.content: + content += chunk.data.choices[0].delta.content + assert len(content) > 0 + + def test_fim_with_max_tokens(self): + """Test FIM completion with max_tokens.""" + client = self._make_fim_client() + res = client.fim.complete( + model=GCP_FIM_MODEL, + prompt="def add(a, b):", + suffix=" return result", + max_tokens=10, + timeout_ms=10000, + ) + assert res is not None + assert res.choices[0].finish_reason in ("length", "stop") diff --git a/tests/test_gcp_v2_parity.py b/tests/test_gcp_v2_parity.py new file mode 100644 index 00000000..6a69af79 --- /dev/null +++ b/tests/test_gcp_v2_parity.py @@ -0,0 +1,328 @@ +""" +Parity tests for the GCP v2 SDK. + +Verifies that the regenerated mistralai.gcp package exposes +the same public API surface as the v1 mistralai_gcp package. +Uses introspection only — no API calls or credentials required. +""" +import inspect + +import pytest + +from mistralai.gcp.client import MistralGCP +from mistralai.gcp.client.chat import Chat +from mistralai.gcp.client.fim import Fim +from mistralai.gcp.client.types import UNSET + +GCP_METHODS: dict[str, set[str]] = { + "chat": {"complete", "stream"}, + "fim": {"complete", "stream"}, +} + +TESTED_METHODS: set[str] = set() + +_EMPTY = inspect.Parameter.empty + + +def mark_tested(resource: str, method: str) -> None: + TESTED_METHODS.add(f"{resource}.{method}") + + +# --------------------------------------------------------------------------- +# Expected parameter specs: (name, expected_default) +# Use _EMPTY for required params, UNSET for OptionalNullable, None for Optional +# --------------------------------------------------------------------------- + +CONSTRUCTOR_PARAMS = [ + ("api_key", _EMPTY), + ("server", None), + ("server_url", None), + ("url_params", None), + ("client", None), + ("async_client", None), + ("retry_config", UNSET), + ("timeout_ms", None), + ("debug_logger", None), +] + +CHAT_COMPLETE_PARAMS = [ + ("model", _EMPTY), + ("messages", _EMPTY), + ("temperature", UNSET), + ("top_p", None), + ("max_tokens", UNSET), + ("stream", False), + ("stop", None), + ("random_seed", UNSET), + ("metadata", UNSET), + ("response_format", None), + ("tools", UNSET), + ("tool_choice", None), + ("presence_penalty", None), + ("frequency_penalty", None), + ("n", UNSET), + ("prediction", None), + ("parallel_tool_calls", None), + ("prompt_mode", UNSET), + ("retries", UNSET), + ("server_url", None), + ("timeout_ms", None), + ("http_headers", None), +] + +CHAT_STREAM_PARAMS = [ + (name, True if name == "stream" else default) + for name, default in CHAT_COMPLETE_PARAMS +] + +FIM_COMPLETE_PARAMS = [ + ("model", _EMPTY), + ("prompt", _EMPTY), + ("temperature", UNSET), + ("top_p", 1), + ("max_tokens", UNSET), + ("stream", False), + ("stop", None), + ("random_seed", UNSET), + ("metadata", UNSET), + ("suffix", UNSET), + ("min_tokens", UNSET), + ("retries", UNSET), + ("server_url", None), + ("timeout_ms", None), + ("http_headers", None), +] + +FIM_STREAM_PARAMS = [ + (name, True if name == "stream" else default) + for name, default in FIM_COMPLETE_PARAMS +] + + +# --------------------------------------------------------------------------- +# Tests +# --------------------------------------------------------------------------- + + +class TestGCPSDKStructure: + def test_sdk_has_chat(self): + assert "chat" in MistralGCP.__annotations__ + + def test_sdk_has_fim(self): + assert "fim" in MistralGCP.__annotations__ + + @pytest.mark.parametrize("param_name,expected_default", CONSTRUCTOR_PARAMS) + def test_constructor_param(self, param_name, expected_default): + sig = inspect.signature(MistralGCP.__init__) + assert param_name in sig.parameters, f"Missing constructor param: {param_name}" + actual = sig.parameters[param_name].default + assert actual == expected_default, ( + f"Constructor param {param_name}: expected {expected_default!r}, got {actual!r}" + ) + + @pytest.mark.parametrize("method", ["__enter__", "__exit__", "__aenter__", "__aexit__"]) + def test_context_manager_support(self, method): + assert hasattr(MistralGCP, method), f"MistralGCP missing {method}" + + +class TestGCPChat: + def test_has_complete(self): + assert hasattr(Chat, "complete") + mark_tested("chat", "complete") + + def test_has_complete_async(self): + assert hasattr(Chat, "complete_async") + mark_tested("chat", "complete_async") + + def test_has_stream(self): + assert hasattr(Chat, "stream") + mark_tested("chat", "stream") + + def test_has_stream_async(self): + assert hasattr(Chat, "stream_async") + mark_tested("chat", "stream_async") + + # -- complete params -- + @pytest.mark.parametrize("param_name,expected_default", CHAT_COMPLETE_PARAMS) + def test_complete_has_param(self, param_name, expected_default): + sig = inspect.signature(Chat.complete) + assert param_name in sig.parameters, f"Chat.complete missing param: {param_name}" + actual = sig.parameters[param_name].default + assert actual == expected_default, ( + f"Chat.complete param {param_name}: expected {expected_default!r}, got {actual!r}" + ) + + # -- stream params -- + @pytest.mark.parametrize("param_name,expected_default", CHAT_STREAM_PARAMS) + def test_stream_has_param(self, param_name, expected_default): + sig = inspect.signature(Chat.stream) + assert param_name in sig.parameters, f"Chat.stream missing param: {param_name}" + actual = sig.parameters[param_name].default + assert actual == expected_default, ( + f"Chat.stream param {param_name}: expected {expected_default!r}, got {actual!r}" + ) + + # -- complete_async matches complete -- + @pytest.mark.parametrize("param_name,expected_default", CHAT_COMPLETE_PARAMS) + def test_complete_async_has_param(self, param_name, expected_default): + sig = inspect.signature(Chat.complete_async) + assert param_name in sig.parameters, f"Chat.complete_async missing param: {param_name}" + actual = sig.parameters[param_name].default + assert actual == expected_default, ( + f"Chat.complete_async param {param_name}: expected {expected_default!r}, got {actual!r}" + ) + + # -- stream_async matches stream -- + @pytest.mark.parametrize("param_name,expected_default", CHAT_STREAM_PARAMS) + def test_stream_async_has_param(self, param_name, expected_default): + sig = inspect.signature(Chat.stream_async) + assert param_name in sig.parameters, f"Chat.stream_async missing param: {param_name}" + actual = sig.parameters[param_name].default + assert actual == expected_default, ( + f"Chat.stream_async param {param_name}: expected {expected_default!r}, got {actual!r}" + ) + + # -- sync/async parity -- + def test_complete_async_matches_complete(self): + sync_params = set(inspect.signature(Chat.complete).parameters) - {"self"} + async_params = set(inspect.signature(Chat.complete_async).parameters) - {"self"} + assert sync_params == async_params + + def test_stream_async_matches_stream(self): + sync_params = set(inspect.signature(Chat.stream).parameters) - {"self"} + async_params = set(inspect.signature(Chat.stream_async).parameters) - {"self"} + assert sync_params == async_params + + # -- key defaults -- + def test_complete_model_required(self): + sig = inspect.signature(Chat.complete) + assert sig.parameters["model"].default is _EMPTY + + def test_stream_model_required(self): + sig = inspect.signature(Chat.stream) + assert sig.parameters["model"].default is _EMPTY + + def test_complete_stream_defaults_false(self): + sig = inspect.signature(Chat.complete) + assert sig.parameters["stream"].default is False + + def test_stream_stream_defaults_true(self): + sig = inspect.signature(Chat.stream) + assert sig.parameters["stream"].default is True + + +class TestGCPFim: + def test_has_complete(self): + assert hasattr(Fim, "complete") + mark_tested("fim", "complete") + + def test_has_complete_async(self): + assert hasattr(Fim, "complete_async") + mark_tested("fim", "complete_async") + + def test_has_stream(self): + assert hasattr(Fim, "stream") + mark_tested("fim", "stream") + + def test_has_stream_async(self): + assert hasattr(Fim, "stream_async") + mark_tested("fim", "stream_async") + + # -- complete params -- + @pytest.mark.parametrize("param_name,expected_default", FIM_COMPLETE_PARAMS) + def test_complete_has_param(self, param_name, expected_default): + sig = inspect.signature(Fim.complete) + assert param_name in sig.parameters, f"Fim.complete missing param: {param_name}" + actual = sig.parameters[param_name].default + assert actual == expected_default, ( + f"Fim.complete param {param_name}: expected {expected_default!r}, got {actual!r}" + ) + + # -- stream params -- + @pytest.mark.parametrize("param_name,expected_default", FIM_STREAM_PARAMS) + def test_stream_has_param(self, param_name, expected_default): + sig = inspect.signature(Fim.stream) + assert param_name in sig.parameters, f"Fim.stream missing param: {param_name}" + actual = sig.parameters[param_name].default + assert actual == expected_default, ( + f"Fim.stream param {param_name}: expected {expected_default!r}, got {actual!r}" + ) + + # -- complete_async matches complete -- + @pytest.mark.parametrize("param_name,expected_default", FIM_COMPLETE_PARAMS) + def test_complete_async_has_param(self, param_name, expected_default): + sig = inspect.signature(Fim.complete_async) + assert param_name in sig.parameters, f"Fim.complete_async missing param: {param_name}" + actual = sig.parameters[param_name].default + assert actual == expected_default, ( + f"Fim.complete_async param {param_name}: expected {expected_default!r}, got {actual!r}" + ) + + # -- stream_async matches stream -- + @pytest.mark.parametrize("param_name,expected_default", FIM_STREAM_PARAMS) + def test_stream_async_has_param(self, param_name, expected_default): + sig = inspect.signature(Fim.stream_async) + assert param_name in sig.parameters, f"Fim.stream_async missing param: {param_name}" + actual = sig.parameters[param_name].default + assert actual == expected_default, ( + f"Fim.stream_async param {param_name}: expected {expected_default!r}, got {actual!r}" + ) + + # -- sync/async parity -- + def test_complete_async_matches_complete(self): + sync_params = set(inspect.signature(Fim.complete).parameters) - {"self"} + async_params = set(inspect.signature(Fim.complete_async).parameters) - {"self"} + assert sync_params == async_params + + def test_stream_async_matches_stream(self): + sync_params = set(inspect.signature(Fim.stream).parameters) - {"self"} + async_params = set(inspect.signature(Fim.stream_async).parameters) - {"self"} + assert sync_params == async_params + + # -- key defaults -- + def test_complete_model_required(self): + sig = inspect.signature(Fim.complete) + assert sig.parameters["model"].default is _EMPTY + + def test_stream_model_required(self): + sig = inspect.signature(Fim.stream) + assert sig.parameters["model"].default is _EMPTY + + def test_complete_stream_defaults_false(self): + sig = inspect.signature(Fim.complete) + assert sig.parameters["stream"].default is False + + def test_stream_stream_defaults_true(self): + sig = inspect.signature(Fim.stream) + assert sig.parameters["stream"].default is True + + def test_complete_top_p_defaults_to_1(self): + sig = inspect.signature(Fim.complete) + assert sig.parameters["top_p"].default == 1 + + def test_stream_top_p_defaults_to_1(self): + sig = inspect.signature(Fim.stream) + assert sig.parameters["top_p"].default == 1 + + +class TestGCPCoverage: + def test_all_methods_tested(self): + expected = set() + for resource, methods in GCP_METHODS.items(): + for method in methods: + expected.add(f"{resource}.{method}") + expected.add(f"{resource}.{method}_async") + untested = expected - TESTED_METHODS + assert not untested, f"Untested methods: {untested}" + + def test_no_unexpected_public_methods_on_chat(self): + public = {m for m in dir(Chat) if not m.startswith("_") and callable(getattr(Chat, m, None))} + known = {"complete", "complete_async", "stream", "stream_async", "do_request", "do_request_async"} + unexpected = public - known + assert not unexpected, f"Unexpected Chat methods: {unexpected}" + + def test_no_unexpected_public_methods_on_fim(self): + public = {m for m in dir(Fim) if not m.startswith("_") and callable(getattr(Fim, m, None))} + known = {"complete", "complete_async", "stream", "stream_async", "do_request", "do_request_async"} + unexpected = public - known + assert not unexpected, f"Unexpected Fim methods: {unexpected}"