From ecece9a25dd7610d3318359d2cd72d1165f6d5fe Mon Sep 17 00:00:00 2001 From: Alexandre Menasria Date: Fri, 27 Jun 2025 15:16:39 +0200 Subject: [PATCH 1/3] Bump speakeasy to 1.568.2 --- .gitignore | 3 + .speakeasy/gen.lock | 442 ++-- .speakeasy/gen.yaml | 11 +- .speakeasy/workflow.lock | 13 +- .speakeasy/workflow.yaml | 8 +- README.md | 17 +- USAGE.md | 8 +- docs/models/agent.md | 14 +- docs/models/agentconversation.md | 8 +- docs/models/agentcreationrequest.md | 4 +- docs/models/agenthandoffdoneevent.md | 8 +- docs/models/agenthandoffentry.md | 10 +- docs/models/agenthandoffstartedevent.md | 8 +- docs/models/agentscompletionrequest.md | 6 +- docs/models/agentscompletionstreamrequest.md | 6 +- docs/models/basemodelcard.md | 2 +- docs/models/batchjobout.md | 8 +- docs/models/batchjobsout.md | 4 +- docs/models/chatcompletionrequest.md | 2 +- docs/models/chatcompletionstreamrequest.md | 2 +- docs/models/classifierdetailedjobout.md | 6 +- docs/models/classifierftmodelout.md | 8 +- docs/models/classifierjobout.md | 4 +- docs/models/completionchunk.md | 6 +- docs/models/completiondetailedjobout.md | 2 +- docs/models/completionftmodelout.md | 6 +- docs/models/completionjobout.md | 2 +- docs/models/conversationhistory.md | 4 +- docs/models/conversationmessages.md | 4 +- docs/models/conversationresponse.md | 4 +- docs/models/conversationrestartrequest.md | 2 +- .../conversationrestartstreamrequest.md | 2 +- docs/models/documentlibrarytool.md | 4 +- docs/models/eventout.md | 4 +- docs/models/fileschema.md | 4 +- docs/models/fimcompletionrequest.md | 2 +- docs/models/fimcompletionstreamrequest.md | 2 +- docs/models/ftmodelcard.md | 6 +- docs/models/function.md | 4 +- docs/models/functioncallentry.md | 8 +- docs/models/functioncallevent.md | 8 +- docs/models/functionresultentry.md | 6 +- docs/models/functiontool.md | 4 +- docs/models/githubrepositoryin.md | 6 +- docs/models/githubrepositoryout.md | 6 +- docs/models/jobin.md | 2 +- docs/models/jobsout.md | 4 +- docs/models/jsonschema.md | 2 +- docs/models/legacyjobmetadataout.md | 2 +- docs/models/messageinputentry.md | 6 +- docs/models/messageoutputentry.md | 4 +- docs/models/messageoutputevent.md | 6 +- docs/models/modelconversation.md | 10 +- docs/models/ocrrequest.md | 2 +- docs/models/ocrresponse.md | 4 +- docs/models/responsedoneevent.md | 4 +- docs/models/responseerrorevent.md | 6 +- docs/models/responsestartedevent.md | 4 +- docs/models/retrievefileout.md | 4 +- docs/models/tool.md | 4 +- docs/models/toolcall.md | 2 +- docs/models/toolchoice.md | 4 +- docs/models/toolexecutiondoneevent.md | 4 +- docs/models/toolexecutionentry.md | 2 +- docs/models/toolexecutionstartedevent.md | 6 +- docs/models/toolfilechunk.md | 2 +- docs/models/toolreferencechunk.md | 2 +- docs/models/uploadfileout.md | 4 +- docs/models/wandbintegration.md | 4 +- docs/models/wandbintegrationout.md | 2 +- docs/sdks/agents/README.md | 4 +- docs/sdks/chat/README.md | 4 +- docs/sdks/classifiers/README.md | 69 +- docs/sdks/conversations/README.md | 28 +- docs/sdks/files/README.md | 10 +- docs/sdks/fim/README.md | 4 +- docs/sdks/jobs/README.md | 12 +- docs/sdks/mistralagents/README.md | 6 +- docs/sdks/mistraljobs/README.md | 10 +- docs/sdks/ocr/README.md | 8 +- pyproject.toml | 2 +- src/mistralai/_hooks/types.py | 7 + src/mistralai/_version.py | 6 +- src/mistralai/agents.py | 4 + src/mistralai/basesdk.py | 32 +- src/mistralai/chat.py | 4 + src/mistralai/classifiers.py | 8 + src/mistralai/conversations.py | 20 + src/mistralai/embeddings.py | 2 + src/mistralai/files.py | 12 + src/mistralai/fim.py | 4 + src/mistralai/httpclient.py | 22 +- src/mistralai/jobs.py | 10 + src/mistralai/mistral_agents.py | 10 + src/mistralai/mistral_jobs.py | 8 + src/mistralai/models/__init__.py | 2074 +++++++++++------ src/mistralai/models/agent.py | 2 +- src/mistralai/models/agentconversation.py | 2 +- src/mistralai/models/agentcreationrequest.py | 2 +- src/mistralai/models/agenthandoffentry.py | 2 +- .../models/agentscompletionrequest.py | 2 +- .../models/agentscompletionstreamrequest.py | 2 +- src/mistralai/models/agentupdaterequest.py | 2 +- src/mistralai/models/assistantmessage.py | 2 +- src/mistralai/models/basemodelcard.py | 2 +- src/mistralai/models/batchjobin.py | 2 +- src/mistralai/models/batchjobout.py | 2 +- src/mistralai/models/chatcompletionrequest.py | 2 +- .../models/chatcompletionstreamrequest.py | 2 +- .../models/classifierdetailedjobout.py | 2 +- src/mistralai/models/classifierftmodelout.py | 2 +- src/mistralai/models/classifierjobout.py | 2 +- src/mistralai/models/classifiertargetin.py | 2 +- .../models/classifiertrainingparameters.py | 2 +- .../models/classifiertrainingparametersin.py | 2 +- src/mistralai/models/completionargs.py | 2 +- .../models/completiondetailedjobout.py | 2 +- src/mistralai/models/completionftmodelout.py | 2 +- src/mistralai/models/completionjobout.py | 2 +- .../models/completionresponsestreamchoice.py | 2 +- .../models/completiontrainingparameters.py | 2 +- .../models/completiontrainingparametersin.py | 2 +- src/mistralai/models/conversationrequest.py | 2 +- .../models/conversationstreamrequest.py | 2 +- src/mistralai/models/conversationusageinfo.py | 2 +- src/mistralai/models/deltamessage.py | 2 +- src/mistralai/models/documenturlchunk.py | 2 +- src/mistralai/models/embeddingrequest.py | 2 +- src/mistralai/models/eventout.py | 2 +- .../models/files_api_routes_list_filesop.py | 2 +- src/mistralai/models/fileschema.py | 2 +- src/mistralai/models/fimcompletionrequest.py | 2 +- .../models/fimcompletionstreamrequest.py | 2 +- src/mistralai/models/ftmodelcard.py | 2 +- src/mistralai/models/functioncallentry.py | 2 +- src/mistralai/models/functionresultentry.py | 2 +- src/mistralai/models/githubrepositoryin.py | 2 +- src/mistralai/models/githubrepositoryout.py | 2 +- src/mistralai/models/imageurl.py | 2 +- src/mistralai/models/jobin.py | 2 +- src/mistralai/models/jobmetadataout.py | 2 +- .../jobs_api_routes_batch_get_batch_jobsop.py | 2 +- ...utes_fine_tuning_get_fine_tuning_jobsop.py | 2 +- src/mistralai/models/jsonschema.py | 2 +- src/mistralai/models/legacyjobmetadataout.py | 2 +- src/mistralai/models/messageinputentry.py | 2 +- src/mistralai/models/messageoutputentry.py | 2 +- src/mistralai/models/messageoutputevent.py | 2 +- src/mistralai/models/metricout.py | 2 +- src/mistralai/models/modelconversation.py | 2 +- src/mistralai/models/ocrimageobject.py | 2 +- src/mistralai/models/ocrpageobject.py | 2 +- src/mistralai/models/ocrrequest.py | 2 +- src/mistralai/models/ocrresponse.py | 2 +- src/mistralai/models/ocrusageinfo.py | 2 +- src/mistralai/models/responseformat.py | 2 +- src/mistralai/models/retrievefileout.py | 2 +- src/mistralai/models/toolexecutionentry.py | 2 +- src/mistralai/models/toolfilechunk.py | 2 +- src/mistralai/models/toolmessage.py | 2 +- src/mistralai/models/toolreferencechunk.py | 2 +- src/mistralai/models/updateftmodelin.py | 2 +- src/mistralai/models/uploadfileout.py | 2 +- src/mistralai/models/usermessage.py | 2 +- src/mistralai/models/wandbintegration.py | 2 +- src/mistralai/models/wandbintegrationout.py | 2 +- src/mistralai/models_.py | 12 + src/mistralai/ocr.py | 2 + src/mistralai/sdk.py | 108 +- src/mistralai/sdkconfiguration.py | 7 - src/mistralai/types/basemodel.py | 6 +- src/mistralai/utils/__init__.py | 176 +- src/mistralai/utils/datetimes.py | 23 + src/mistralai/utils/enums.py | 94 +- src/mistralai/utils/forms.py | 77 +- src/mistralai/utils/serializers.py | 35 +- 176 files changed, 2385 insertions(+), 1469 deletions(-) create mode 100644 src/mistralai/utils/datetimes.py diff --git a/.gitignore b/.gitignore index ab3be6d0..954adb7c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +**/__pycache__/ +**/.speakeasy/temp/ +**/.speakeasy/logs/ .vscode/ .speakeasy/reports README-PYPI.md diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index c568d4f3..d5ae1e64 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -3,10 +3,10 @@ id: 2d045ec7-2ebb-4f4d-ad25-40953b132161 management: docChecksum: 9c8bd4d6bf675b159a80173b97c1265c docVersion: 1.0.0 - speakeasyVersion: 1.517.3 - generationVersion: 2.548.6 - releaseVersion: 1.8.2 - configChecksum: 5024c28578f991eabb85310ad8df96b7 + speakeasyVersion: 1.568.2 + generationVersion: 2.634.2 + releaseVersion: 1.9.0 + configChecksum: a67788bf50c3de92f0ef16f385b615b3 repoURL: https://github.com/mistralai/client-python.git installationURL: https://github.com/mistralai/client-python.git published: true @@ -14,7 +14,7 @@ features: python: additionalDependencies: 1.0.0 constsAndDefaults: 1.0.5 - core: 5.12.3 + core: 5.19.3 customCodeRegions: 0.1.1 defaultEnabledRetries: 0.2.0 downloadStreams: 1.0.1 @@ -26,15 +26,15 @@ features: globalSecurity: 3.0.3 globalSecurityCallbacks: 1.0.0 globalSecurityFlattening: 1.0.0 - globalServerURLs: 3.1.0 + globalServerURLs: 3.1.1 methodArguments: 1.0.2 multipartFileContentType: 1.0.0 nameOverrides: 3.0.1 nullables: 1.0.1 - openEnums: 1.0.0 + openEnums: 1.0.1 responseFormat: 1.0.1 retries: 3.0.2 - sdkHooks: 1.0.1 + sdkHooks: 1.1.0 serverEvents: 1.0.7 serverEventsSentinels: 0.1.0 serverIDs: 3.0.0 @@ -623,6 +623,7 @@ generatedFiles: - src/mistralai/types/basemodel.py - src/mistralai/utils/__init__.py - src/mistralai/utils/annotations.py + - src/mistralai/utils/datetimes.py - src/mistralai/utils/enums.py - src/mistralai/utils/eventstreaming.py - src/mistralai/utils/forms.py @@ -645,25 +646,27 @@ examples: "422": application/json: {} retrieve_model_v1_models__model_id__get: - "": + speakeasy-default-retrieve-model-v1-models-model-id-get: parameters: path: model_id: "ft:open-mistral-7b:587a6b29:20240514:7e773925" responses: "200": - application/json: {"id": "", "object": "model", "owned_by": "mistralai", "capabilities": {"completion_chat": true, "completion_fim": false, "function_calling": true, "fine_tuning": false, "vision": false}, "max_context_length": 32768} - "422": {} + application/json: {"id": "", "object": "model", "owned_by": "mistralai", "capabilities": {"completion_chat": true, "completion_fim": false, "function_calling": true, "fine_tuning": false, "vision": false}, "max_context_length": 32768, "type": "fine-tuned", "job": "Product Markets Facilitator", "root": "", "archived": false} + "422": + application/json: {} delete_model_v1_models__model_id__delete: - "": + speakeasy-default-delete-model-v1-models-model-id-delete: parameters: path: model_id: "ft:open-mistral-7b:587a6b29:20240514:7e773925" responses: "200": application/json: {"id": "ft:open-mistral-7b:587a6b29:20240514:7e773925", "object": "model", "deleted": true} - "422": {} + "422": + application/json: {} jobs_api_routes_fine_tuning_update_fine_tuned_model: - "": + speakeasy-default-jobs-api-routes-fine-tuning-update-fine-tuned-model: parameters: path: model_id: "ft:open-mistral-7b:587a6b29:20240514:7e773925" @@ -671,9 +674,9 @@ examples: application/json: {} responses: "200": - application/json: {"id": "", "object": "model", "created": 597129, "owned_by": "", "root": "", "archived": true, "capabilities": {"completion_chat": true, "completion_fim": false, "function_calling": false, "fine_tuning": false, "classification": false}, "max_context_length": 32768, "job": "fa7f0e74-32ce-447c-9b60-cc78135ddeb8", "model_type": "completion"} + application/json: {"id": "", "object": "model", "created": 124166, "owned_by": "", "root": "", "archived": true, "capabilities": {"completion_chat": true, "completion_fim": false, "function_calling": false, "fine_tuning": false, "classification": false}, "max_context_length": 32768, "job": "c4f8ef9a-6612-4f49-88fa-a80eb8116e46", "model_type": "completion"} jobs_api_routes_fine_tuning_archive_fine_tuned_model: - "": + speakeasy-default-jobs-api-routes-fine-tuning-archive-fine-tuned-model: parameters: path: model_id: "ft:open-mistral-7b:587a6b29:20240514:7e773925" @@ -681,20 +684,175 @@ examples: "200": application/json: {"id": "", "object": "model", "archived": true} jobs_api_routes_fine_tuning_unarchive_fine_tuned_model: - "": + speakeasy-default-jobs-api-routes-fine-tuning-unarchive-fine-tuned-model: parameters: path: model_id: "ft:open-mistral-7b:587a6b29:20240514:7e773925" responses: "200": application/json: {"id": "", "object": "model", "archived": false} + agents_api_v1_conversations_start: + speakeasy-default-agents-api-v1-conversations-start: + requestBody: + application/json: {"inputs": "", "stream": false} + responses: + "200": + application/json: {"object": "conversation.response", "conversation_id": "", "outputs": [{"object": "entry", "type": "agent.handoff", "previous_agent_id": "", "previous_agent_name": "", "next_agent_id": "", "next_agent_name": ""}], "usage": {"prompt_tokens": 0, "completion_tokens": 0, "total_tokens": 0}} + "422": + application/json: {} + agents_api_v1_conversations_list: + speakeasy-default-agents-api-v1-conversations-list: + parameters: + query: + page: 0 + page_size: 100 + responses: + "200": + application/json: [{"object": "conversation", "id": "", "created_at": "2025-11-20T22:30:47.754Z", "updated_at": "2025-08-05T08:36:20.296Z", "agent_id": ""}] + "422": + application/json: {} + agents_api_v1_conversations_get: + speakeasy-default-agents-api-v1-conversations-get: + parameters: + path: + conversation_id: "" + responses: + "200": + application/json: {"object": "conversation", "id": "", "created_at": "2023-06-02T14:00:42.201Z", "updated_at": "2024-10-06T17:16:50.325Z", "agent_id": ""} + "422": + application/json: {} + agents_api_v1_conversations_append: + speakeasy-default-agents-api-v1-conversations-append: + parameters: + path: + conversation_id: "" + requestBody: + application/json: {"inputs": [], "stream": false, "store": true, "handoff_execution": "server"} + responses: + "200": + application/json: {"object": "conversation.response", "conversation_id": "", "outputs": [], "usage": {"prompt_tokens": 0, "completion_tokens": 0, "total_tokens": 0}} + "422": + application/json: {} + agents_api_v1_conversations_history: + speakeasy-default-agents-api-v1-conversations-history: + parameters: + path: + conversation_id: "" + responses: + "200": + application/json: {"object": "conversation.history", "conversation_id": "", "entries": [{"object": "entry", "type": "tool.execution", "name": "code_interpreter"}]} + "422": + application/json: {} + agents_api_v1_conversations_messages: + speakeasy-default-agents-api-v1-conversations-messages: + parameters: + path: + conversation_id: "" + responses: + "200": + application/json: {"object": "conversation.messages", "conversation_id": "", "messages": []} + "422": + application/json: {} + agents_api_v1_conversations_restart: + speakeasy-default-agents-api-v1-conversations-restart: + parameters: + path: + conversation_id: "" + requestBody: + application/json: {"inputs": "", "stream": false, "store": true, "handoff_execution": "server", "from_entry_id": ""} + responses: + "200": + application/json: {"object": "conversation.response", "conversation_id": "", "outputs": [], "usage": {"prompt_tokens": 0, "completion_tokens": 0, "total_tokens": 0}} + "422": + application/json: {} + agents_api_v1_conversations_start_stream: + speakeasy-default-agents-api-v1-conversations-start-stream: + requestBody: + application/json: {"inputs": [{"object": "entry", "type": "function.result", "tool_call_id": "", "result": ""}], "stream": true} + responses: + "422": + application/json: {} + agents_api_v1_conversations_append_stream: + speakeasy-default-agents-api-v1-conversations-append-stream: + parameters: + path: + conversation_id: "" + requestBody: + application/json: {"inputs": "", "stream": true, "store": true, "handoff_execution": "server"} + responses: + "422": + application/json: {} + agents_api_v1_conversations_restart_stream: + speakeasy-default-agents-api-v1-conversations-restart-stream: + parameters: + path: + conversation_id: "" + requestBody: + application/json: {"inputs": [{"object": "entry", "type": "message.input", "role": "assistant", "content": ""}], "stream": true, "store": true, "handoff_execution": "server", "from_entry_id": ""} + responses: + "422": + application/json: {} + agents_api_v1_agents_create: + speakeasy-default-agents-api-v1-agents-create: + requestBody: + application/json: {"model": "LeBaron", "name": ""} + responses: + "200": + application/json: {"model": "Ranchero", "name": "", "object": "agent", "id": "", "version": 316961, "created_at": "2025-03-26T19:00:51.430Z", "updated_at": "2023-04-28T15:08:02.110Z"} + "422": + application/json: {} + agents_api_v1_agents_list: + speakeasy-default-agents-api-v1-agents-list: + parameters: + query: + page: 0 + page_size: 20 + responses: + "200": + application/json: [{"model": "Impala", "name": "", "object": "agent", "id": "", "version": 43153, "created_at": "2024-04-26T15:54:09.954Z", "updated_at": "2024-02-11T18:27:55.607Z"}] + "422": + application/json: {} + agents_api_v1_agents_get: + speakeasy-default-agents-api-v1-agents-get: + parameters: + path: + agent_id: "" + responses: + "200": + application/json: {"model": "Silverado", "name": "", "object": "agent", "id": "", "version": 845972, "created_at": "2025-08-21T03:10:48.135Z", "updated_at": "2024-11-11T17:15:57.309Z"} + "422": + application/json: {} + agents_api_v1_agents_update: + speakeasy-default-agents-api-v1-agents-update: + parameters: + path: + agent_id: "" + requestBody: + application/json: {} + responses: + "200": + application/json: {"model": "Model X", "name": "", "object": "agent", "id": "", "version": 799821, "created_at": "2025-10-20T17:35:08.067Z", "updated_at": "2023-11-16T08:47:13.265Z"} + "422": + application/json: {} + agents_api_v1_agents_update_version: + speakeasy-default-agents-api-v1-agents-update-version: + parameters: + path: + agent_id: "" + query: + version: 157995 + responses: + "200": + application/json: {"model": "XTS", "name": "", "object": "agent", "id": "", "version": 310764, "created_at": "2023-05-08T23:29:06.216Z", "updated_at": "2023-05-16T19:20:05.735Z"} + "422": + application/json: {} files_api_routes_upload_file: speakeasy-default-files-api-routes-upload-file: requestBody: - multipart/form-data: {"file": {}} + multipart/form-data: {"file": "x-file: example.file"} responses: "200": - application/json: {"id": "497f6eca-6276-4993-bfeb-53cbbbba6f09", "object": "file", "bytes": 13000, "created_at": 1716963433, "filename": "files_upload.jsonl", "purpose": "fine-tune", "sample_type": "batch_request", "source": "repository"} + application/json: {"id": "497f6eca-6276-4993-bfeb-53cbbbba6f09", "object": "file", "bytes": 13000, "created_at": 1716963433, "filename": "files_upload.jsonl", "purpose": "batch", "sample_type": "batch_result", "source": "upload"} files_api_routes_list_files: speakeasy-default-files-api-routes-list-files: parameters: @@ -703,20 +861,20 @@ examples: page_size: 100 responses: "200": - application/json: {"data": [{"id": "497f6eca-6276-4993-bfeb-53cbbbba6f09", "object": "file", "bytes": 13000, "created_at": 1716963433, "filename": "files_upload.jsonl", "purpose": "batch", "sample_type": "batch_result", "source": "upload"}, {"id": "497f6eca-6276-4993-bfeb-53cbbbba6f09", "object": "file", "bytes": 13000, "created_at": 1716963433, "filename": "files_upload.jsonl", "purpose": "fine-tune", "sample_type": "pretrain", "source": "repository"}, {"id": "497f6eca-6276-4993-bfeb-53cbbbba6f09", "object": "file", "bytes": 13000, "created_at": 1716963433, "filename": "files_upload.jsonl", "purpose": "batch", "sample_type": "pretrain", "source": "mistral"}], "object": "", "total": 86140} + application/json: {"data": [{"id": "497f6eca-6276-4993-bfeb-53cbbbba6f09", "object": "file", "bytes": 13000, "created_at": 1716963433, "filename": "files_upload.jsonl", "purpose": "fine-tune", "sample_type": "batch_error", "source": "upload"}], "object": "", "total": 999335} files_api_routes_retrieve_file: speakeasy-default-files-api-routes-retrieve-file: parameters: path: - file_id: "" + file_id: "f2a27685-ca4e-4dc2-9f2b-88c422c3e0f6" responses: "200": - application/json: {"id": "497f6eca-6276-4993-bfeb-53cbbbba6f09", "object": "file", "bytes": 13000, "created_at": 1716963433, "filename": "files_upload.jsonl", "purpose": "fine-tune", "sample_type": "batch_error", "source": "upload", "deleted": true} + application/json: {"id": "497f6eca-6276-4993-bfeb-53cbbbba6f09", "object": "file", "bytes": 13000, "created_at": 1716963433, "filename": "files_upload.jsonl", "purpose": "batch", "sample_type": "instruct", "source": "repository", "deleted": false} files_api_routes_delete_file: speakeasy-default-files-api-routes-delete-file: parameters: path: - file_id: "" + file_id: "3b6d45eb-e30b-416f-8019-f47e2e93d930" responses: "200": application/json: {"id": "497f6eca-6276-4993-bfeb-53cbbbba6f09", "object": "file", "deleted": false} @@ -724,7 +882,7 @@ examples: speakeasy-default-files-api-routes-download-file: parameters: path: - file_id: "" + file_id: "f8919994-a4a1-46b2-8b5b-06335a4300ce" responses: "200": application/octet-stream: "x-file: example.file" @@ -732,12 +890,12 @@ examples: speakeasy-default-files-api-routes-get-signed-url: parameters: path: - file_id: "" + file_id: "06a020ab-355c-49a6-b19d-304b7c01699f" query: expiry: 24 responses: "200": - application/json: {"url": "https://scornful-daughter.com/"} + application/json: {"url": "https://knotty-birdcage.net/"} jobs_api_routes_fine_tuning_get_fine_tuning_jobs: speakeasy-default-jobs-api-routes-fine-tuning-get-fine-tuning-jobs: parameters: @@ -747,11 +905,11 @@ examples: created_by_me: false responses: "200": - application/json: {"object": "list", "total": 768578} + application/json: {"object": "list", "total": 843585} jobs_api_routes_fine_tuning_create_fine_tuning_job: speakeasy-default-jobs-api-routes-fine-tuning-create-fine-tuning-job: requestBody: - application/json: {"model": "Fiesta", "invalid_sample_skip_percentage": 0, "hyperparameters": {"learning_rate": 0.0001}} + application/json: {"model": "Camaro", "invalid_sample_skip_percentage": 0, "hyperparameters": {"learning_rate": 0.0001}} responses: "200": application/json: {"expected_duration_seconds": 220, "cost": 10, "cost_currency": "EUR", "train_tokens_per_step": 131072, "train_tokens": 1310720, "data_tokens": 305375, "deprecated": true, "details": "", "epochs": 4.2922, "training_steps": 10, "object": "job.metadata"} @@ -759,26 +917,26 @@ examples: speakeasy-default-jobs-api-routes-fine-tuning-get-fine-tuning-job: parameters: path: - job_id: "b888f774-3e7c-4135-a18c-6b985523c4bc" + job_id: "c167a961-ffca-4bcf-93ac-6169468dd389" responses: "200": - application/json: {"id": "888f7743-e7c1-4351-b8c6-b985523c4bcb", "auto_start": true, "model": "2", "status": "CANCELLATION_REQUESTED", "created_at": 444836, "modified_at": 424256, "training_files": [], "object": "job", "job_type": "completion", "hyperparameters": {"learning_rate": 0.0001}, "checkpoints": [{"metrics": {}, "step_number": 550563, "created_at": 1716963433}]} + application/json: {"id": "babac92a-96fa-48c4-931c-f6f97e1bf24c", "auto_start": false, "model": "Spyder", "status": "FAILED", "created_at": 232438, "modified_at": 32259, "training_files": ["7a95c5a0-399d-4665-84c8-deab766d22dc"], "object": "job", "job_type": "classifier", "hyperparameters": {"learning_rate": 0.0001}, "classifier_targets": [{"name": "", "labels": [], "weight": 5651, "loss_function": "single_class"}]} jobs_api_routes_fine_tuning_cancel_fine_tuning_job: speakeasy-default-jobs-api-routes-fine-tuning-cancel-fine-tuning-job: parameters: path: - job_id: "0f713502-9233-41c6-9ebd-c570b7edb496" + job_id: "6188a2f6-7513-4e0f-89cc-3f8088523a49" responses: "200": - application/json: {"id": "f7135029-2331-4c6e-bbdc-570b7edb4966", "auto_start": true, "model": "A4", "status": "CANCELLATION_REQUESTED", "created_at": 703131, "modified_at": 929437, "training_files": ["e3e32613-5744-4d82-8f3f-d6b3c11eb45e"], "object": "job", "job_type": "classifier", "hyperparameters": {"learning_rate": 0.0001}, "checkpoints": [{"metrics": {}, "step_number": 466651, "created_at": 1716963433}], "classifier_targets": [{"name": "", "labels": ["", "", ""], "weight": 687.66, "loss_function": "single_class"}, {"name": "", "labels": ["", "", ""], "weight": 8470.22, "loss_function": "multi_class"}]} + application/json: {"id": "770b9cc0-1ab6-44de-a816-67010644e9fb", "auto_start": false, "model": "Volt", "status": "CANCELLATION_REQUESTED", "created_at": 546404, "modified_at": 180081, "training_files": ["45e621c6-ac30-4133-b6d1-fc0d1fe24c9f"], "object": "job", "job_type": "classifier", "hyperparameters": {"learning_rate": 0.0001}, "classifier_targets": [{"name": "", "labels": [""], "weight": 1298.58, "loss_function": "multi_class"}]} jobs_api_routes_fine_tuning_start_fine_tuning_job: speakeasy-default-jobs-api-routes-fine-tuning-start-fine-tuning-job: parameters: path: - job_id: "0bf0f9e6-c3e5-4d61-aac8-0e36dcac0dfc" + job_id: "56553e4d-0679-471e-b9ac-59a77d671103" responses: "200": - application/json: {"id": "bf0f9e6c-3e5d-461a-ac80-e36dcac0dfc8", "auto_start": true, "model": "Explorer", "status": "RUNNING", "created_at": 961967, "modified_at": 914446, "training_files": ["82c4783e-31ec-471d-bbed-4c90a1b0dd73"], "object": "job", "job_type": "classifier", "hyperparameters": {"learning_rate": 0.0001}, "checkpoints": [{"metrics": {}, "step_number": 590686, "created_at": 1716963433}], "classifier_targets": [{"name": "", "labels": [""], "weight": 5494.15, "loss_function": "single_class"}, {"name": "", "labels": ["", ""], "weight": 7945.15, "loss_function": "single_class"}]} + application/json: {"id": "68ad461a-676e-47fe-a07e-15e38f5082b5", "auto_start": false, "model": "Grand Cherokee", "status": "STARTED", "created_at": 134515, "modified_at": 192651, "training_files": ["39dabc3d-15eb-49ac-a549-69973f33acee"], "object": "job", "job_type": "completion", "hyperparameters": {"learning_rate": 0.0001}} jobs_api_routes_batch_get_batch_jobs: speakeasy-default-jobs-api-routes-batch-get-batch-jobs: parameters: @@ -788,37 +946,37 @@ examples: created_by_me: false responses: "200": - application/json: {"object": "list", "total": 768578} + application/json: {"object": "list", "total": 186589} jobs_api_routes_batch_create_batch_job: speakeasy-default-jobs-api-routes-batch-create-batch-job: requestBody: - application/json: {"input_files": ["a621cf02-1cd9-4cf5-8403-315211a509a3"], "endpoint": "/v1/fim/completions", "model": "2", "timeout_hours": 24} + application/json: {"input_files": ["fe3343a2-3b8d-404b-ba32-a78dede2614a"], "endpoint": "/v1/moderations", "model": "Altima", "timeout_hours": 24} responses: "200": - application/json: {"id": "", "object": "batch", "input_files": ["8e774c2b-ecc3-4769-b177-5e024985613d", "0ee803d5-6a1d-4f94-836b-fd39494798bc"], "endpoint": "", "model": "Impala", "errors": [{"message": "", "count": 1}, {"message": "", "count": 1}, {"message": "", "count": 1}], "status": "RUNNING", "created_at": 770370, "total_requests": 350586, "completed_requests": 95214, "succeeded_requests": 930830, "failed_requests": 617761} + application/json: {"id": "", "object": "batch", "input_files": ["7b2553d8-e17f-4df5-a862-a1678f6b5271", "8c618d9f-7d82-42ba-a284-d57d84f50a58", "c042f996-e842-441d-ae47-4e0850334e41"], "endpoint": "", "model": "Taurus", "errors": [{"message": "", "count": 1}], "status": "SUCCESS", "created_at": 395527, "total_requests": 166919, "completed_requests": 258552, "succeeded_requests": 480980, "failed_requests": 684176} jobs_api_routes_batch_get_batch_job: speakeasy-default-jobs-api-routes-batch-get-batch-job: parameters: path: - job_id: "b888f774-3e7c-4135-a18c-6b985523c4bc" + job_id: "4017dc9f-b629-42f4-9700-8c681b9e7f0f" responses: "200": - application/json: {"id": "", "object": "batch", "input_files": ["50f76228-1da8-44bc-b661-c8a99c6b71b6", "cd62b8f7-112a-4af0-bab4-e43b4cca3716", "620807aa-1f8c-4f05-ad89-d58ee381f6b4"], "endpoint": "", "model": "Golf", "errors": [{"message": "", "count": 1}, {"message": "", "count": 1}], "status": "SUCCESS", "created_at": 790898, "total_requests": 55097, "completed_requests": 578320, "succeeded_requests": 856562, "failed_requests": 328633} + application/json: {"id": "", "object": "batch", "input_files": ["11b83f16-f2f9-4de4-a81f-203fff419c99"], "endpoint": "", "model": "Accord", "errors": [], "status": "TIMEOUT_EXCEEDED", "created_at": 900958, "total_requests": 458292, "completed_requests": 184893, "succeeded_requests": 104800, "failed_requests": 836210} jobs_api_routes_batch_cancel_batch_job: speakeasy-default-jobs-api-routes-batch-cancel-batch-job: parameters: path: - job_id: "0f713502-9233-41c6-9ebd-c570b7edb496" + job_id: "4fb29d1c-535b-4f0a-a1cb-2167f86da569" responses: "200": - application/json: {"id": "", "object": "batch", "input_files": ["50fbe4e3-e326-4135-8744-d82f3fd6b3c1", "eb45e247-ac10-4cdc-8311-2f7cc9241230", "4afaa0f8-4bd4-4945-9116-89d07a64aa72"], "endpoint": "", "model": "Alpine", "errors": [{"message": "", "count": 1}, {"message": "", "count": 1}], "status": "QUEUED", "created_at": 709109, "total_requests": 275794, "completed_requests": 158938, "succeeded_requests": 12381, "failed_requests": 11864} + application/json: {"id": "", "object": "batch", "input_files": ["8fd9d88a-66be-43fd-a816-ba509ca3ca85"], "endpoint": "", "model": "PT Cruiser", "errors": [], "status": "TIMEOUT_EXCEEDED", "created_at": 608251, "total_requests": 12693, "completed_requests": 203340, "succeeded_requests": 189291, "failed_requests": 969057} chat_completion_v1_chat_completions_post: speakeasy-default-chat-completion-v1-chat-completions-post: requestBody: application/json: {"model": "mistral-small-latest", "stream": false, "messages": [{"content": "Who is the best French painter? Answer in one short sentence.", "role": "user"}]} responses: "200": - application/json: {"id": "cmpl-e5cc70bb28c444948073e77776eb30ef", "object": "chat.completion", "model": "mistral-small-latest", "usage": {"prompt_tokens": 16, "completion_tokens": 34, "total_tokens": 50}, "created": 1702256327, "choices": [{"index": 0, "message": {"prefix": false, "role": "assistant"}, "finish_reason": "stop"}, {"index": 0, "message": {"prefix": false, "role": "assistant"}, "finish_reason": "stop"}, {"index": 0, "message": {"prefix": false, "role": "assistant"}, "finish_reason": "stop"}]} + application/json: {"id": "cmpl-e5cc70bb28c444948073e77776eb30ef", "object": "chat.completion", "model": "mistral-small-latest", "usage": {"prompt_tokens": 16, "completion_tokens": 34, "total_tokens": 50}, "created": 1702256327, "choices": []} "422": application/json: {} stream_chat: @@ -828,14 +986,13 @@ examples: responses: "422": application/json: {} - "200": {} fim_completion_v1_fim_completions_post: speakeasy-default-fim-completion-v1-fim-completions-post: requestBody: application/json: {"model": "codestral-2405", "top_p": 1, "stream": false, "prompt": "def", "suffix": "return a+b"} responses: "200": - application/json: {"id": "cmpl-e5cc70bb28c444948073e77776eb30ef", "object": "chat.completion", "model": "codestral-latest", "usage": {"prompt_tokens": 16, "completion_tokens": 34, "total_tokens": 50}, "created": 1702256327, "choices": [{"index": 0, "message": {"prefix": false, "role": "assistant"}, "finish_reason": "stop"}, {"index": 0, "message": {"prefix": false, "role": "assistant"}, "finish_reason": "stop"}, {"index": 0, "message": {"prefix": false, "role": "assistant"}, "finish_reason": "stop"}]} + application/json: {"id": "cmpl-e5cc70bb28c444948073e77776eb30ef", "object": "chat.completion", "model": "codestral-latest", "usage": {"prompt_tokens": 16, "completion_tokens": 34, "total_tokens": 50}, "created": 1702256327, "choices": []} "422": application/json: {} stream_fim: @@ -845,14 +1002,13 @@ examples: responses: "422": application/json: {} - "200": {} agents_completion_v1_agents_completions_post: speakeasy-default-agents-completion-v1-agents-completions-post: requestBody: application/json: {"stream": false, "messages": [{"content": "Who is the best French painter? Answer in one short sentence.", "role": "user"}], "agent_id": ""} responses: "200": - application/json: {"id": "cmpl-e5cc70bb28c444948073e77776eb30ef", "object": "chat.completion", "model": "mistral-small-latest", "usage": {"prompt_tokens": 16, "completion_tokens": 34, "total_tokens": 50}, "created": 1702256327, "choices": [{"index": 0, "message": {"prefix": false, "role": "assistant"}, "finish_reason": "stop"}, {"index": 0, "message": {"prefix": false, "role": "assistant"}, "finish_reason": "stop"}, {"index": 0, "message": {"prefix": false, "role": "assistant"}, "finish_reason": "stop"}]} + application/json: {"id": "cmpl-e5cc70bb28c444948073e77776eb30ef", "object": "chat.completion", "model": "mistral-small-latest", "usage": {"prompt_tokens": 16, "completion_tokens": 34, "total_tokens": 50}, "created": 1702256327, "choices": []} "422": application/json: {} stream_agents: @@ -862,7 +1018,6 @@ examples: responses: "422": application/json: {} - "200": {} embeddings_v1_embeddings_post: speakeasy-default-embeddings-v1-embeddings-post: requestBody: @@ -875,214 +1030,47 @@ examples: moderations_v1_moderations_post: speakeasy-default-moderations-v1-moderations-post: requestBody: - application/json: {"model": "V90", "input": [""]} + application/json: {"model": "Durango", "input": ["", ""]} responses: "200": - application/json: {"id": "mod-e5cc70bb28c444948073e77776eb30ef", "model": "V90", "results": [{}]} - "422": - application/json: {} - moderations_chat_v1_chat_moderations_post: - speakeasy-default-moderations-chat-v1-chat-moderations-post: - requestBody: - application/json: {"model": "Roadster", "input": [[{"content": "", "role": "tool"}, {"content": "", "role": "tool"}, {"content": "", "role": "tool"}], [{"prefix": false, "role": "assistant"}, {"content": "", "role": "user"}, {"prefix": false, "role": "assistant"}]], "truncate_for_context_length": false} - responses: - "200": - application/json: {"id": "mod-e5cc70bb28c444948073e77776eb30ef"} - "422": - application/json: {} - ocr_v1_ocr_post: - speakeasy-default-ocr-v1-ocr-post: - requestBody: - application/json: {"model": "Focus", "document": {"document_url": "https://dutiful-horst.org", "type": "document_url"}} - responses: - "200": - application/json: {"pages": [], "model": "A4", "usage_info": {"pages_processed": 442675}} + application/json: {"id": "mod-e5cc70bb28c444948073e77776eb30ef", "model": "Corvette", "results": [{}]} "422": application/json: {} chat_moderations_v1_chat_moderations_post: speakeasy-default-chat-moderations-v1-chat-moderations-post: requestBody: - application/json: {"input": [[{"content": [], "role": "system"}, {"content": "", "role": "tool"}], [{"prefix": false, "role": "assistant"}, {"content": "", "role": "user"}, {"prefix": false, "role": "assistant"}], [{"content": "", "role": "system"}, {"content": [{"image_url": "https://fatherly-colon.name", "type": "image_url"}], "role": "user"}, {"content": "", "role": "user"}]], "model": "Model Y"} + application/json: {"input": [{"content": "", "role": "tool"}], "model": "LeBaron"} responses: "200": - application/json: {"id": "mod-e5cc70bb28c444948073e77776eb30ef", "model": "Model Y", "results": [{}, {}]} + application/json: {"id": "mod-e5cc70bb28c444948073e77776eb30ef", "model": "Explorer", "results": [{}]} "422": application/json: {} classifications_v1_classifications_post: speakeasy-default-classifications-v1-classifications-post: requestBody: - application/json: {"model": "Altima", "input": ""} + application/json: {"model": "Silverado", "input": [""]} responses: "200": - application/json: {"id": "mod-e5cc70bb28c444948073e77776eb30ef", "model": "Camaro", "results": [{"key": {"scores": {"key": 6063.42, "key1": 1739.44}}, "key1": {"scores": {}}}, {"key": {"scores": {"key": 2625.67}}, "key1": {"scores": {}}}]} + application/json: {"id": "mod-e5cc70bb28c444948073e77776eb30ef", "model": "ATS", "results": [{}, {"key": {"scores": {"key": 2080.19}}}]} "422": application/json: {} chat_classifications_v1_chat_classifications_post: speakeasy-default-chat-classifications-v1-chat-classifications-post: requestBody: - application/json: {"model": "Fortwo", "input": [{"messages": [{"content": "", "role": "tool"}]}, {"messages": []}]} - responses: - "200": - application/json: {"id": "mod-e5cc70bb28c444948073e77776eb30ef", "model": "CX-9", "results": [{"key": {"scores": {"key": 4386.53, "key1": 2974.85}}, "key1": {"scores": {"key": 7100.52, "key1": 480.47}}}]} - "422": - application/json: {} - agents_api_v1_conversations_start: - speakeasy-default-agents-api-v1-conversations-start: - requestBody: - application/json: {"inputs": "", "stream": false} - responses: - "200": - application/json: {"object": "conversation.response", "conversation_id": "", "outputs": [{"object": "entry", "type": "agent.handoff", "previous_agent_id": "", "previous_agent_name": "", "next_agent_id": "", "next_agent_name": ""}, {"object": "entry", "type": "message.output", "role": "assistant", "content": [{"type": "tool_reference", "tool": "web_search_premium", "title": ""}, {"document_url": "https://unrealistic-fund.org/", "type": "document_url"}]}], "usage": {"prompt_tokens": 0, "completion_tokens": 0, "total_tokens": 0}} - "422": - application/json: {} - agents_api_v1_conversations_list: - speakeasy-default-agents-api-v1-conversations-list: - parameters: - query: - page: 0 - page_size: 100 - responses: - "200": - application/json: [{"object": "conversation", "id": "", "created_at": "2025-01-13T10:26:00.433Z", "updated_at": "2023-07-14T18:23:27.528Z", "agent_id": ""}, {"object": "conversation", "id": "", "created_at": "2023-06-17T12:14:27.999Z", "updated_at": "2024-11-27T13:02:27.296Z", "model": "LeBaron"}, {"object": "conversation", "id": "", "created_at": "2025-02-26T06:14:46.641Z", "updated_at": "2023-04-05T09:49:38.010Z", "model": "A8"}] - "422": - application/json: {} - agents_api_v1_conversations_get: - speakeasy-default-agents-api-v1-conversations-get: - parameters: - path: - conversation_id: "" - responses: - "200": - application/json: {"object": "conversation", "id": "", "created_at": "2024-09-04T11:33:52.011Z", "updated_at": "2024-08-19T11:11:04.610Z", "agent_id": ""} - "422": - application/json: {} - agents_api_v1_conversations_append: - speakeasy-default-agents-api-v1-conversations-append: - parameters: - path: - conversation_id: "" - requestBody: - application/json: {"inputs": "", "stream": false, "store": true, "handoff_execution": "server"} - responses: - "200": - application/json: {"object": "conversation.response", "conversation_id": "", "outputs": [{"object": "entry", "type": "agent.handoff", "previous_agent_id": "", "previous_agent_name": "", "next_agent_id": "", "next_agent_name": ""}, {"object": "entry", "type": "function.call", "tool_call_id": "", "name": "", "arguments": ""}], "usage": {"prompt_tokens": 0, "completion_tokens": 0, "total_tokens": 0}} - "422": - application/json: {} - agents_api_v1_conversations_history: - speakeasy-default-agents-api-v1-conversations-history: - parameters: - path: - conversation_id: "" - responses: - "200": - application/json: {"object": "conversation.history", "conversation_id": "", "entries": [{"object": "entry", "type": "message.output", "role": "assistant", "content": [{"type": "tool_file", "tool": "web_search", "file_id": ""}]}]} - "422": - application/json: {} - agents_api_v1_conversations_messages: - speakeasy-default-agents-api-v1-conversations-messages: - parameters: - path: - conversation_id: "" - responses: - "200": - application/json: {"object": "conversation.messages", "conversation_id": "", "messages": [{"object": "entry", "type": "message.input", "role": "assistant", "content": ""}, {"object": "entry", "type": "message.input", "role": "assistant", "content": [{"document_url": "https://black-and-white-sauerkraut.biz", "type": "document_url"}, {"type": "tool_file", "tool": "code_interpreter", "file_id": ""}, {"image_url": "https://emotional-couch.org", "type": "image_url"}]}, {"object": "entry", "type": "message.input", "role": "assistant", "content": ""}]} - "422": - application/json: {} - agents_api_v1_conversations_restart: - speakeasy-default-agents-api-v1-conversations-restart: - parameters: - path: - conversation_id: "" - requestBody: - application/json: {"inputs": "", "stream": false, "store": true, "handoff_execution": "server", "from_entry_id": ""} - responses: - "200": - application/json: {"object": "conversation.response", "conversation_id": "", "outputs": [{"object": "entry", "type": "tool.execution", "name": "image_generation"}, {"object": "entry", "type": "tool.execution", "name": "web_search_premium"}], "usage": {"prompt_tokens": 0, "completion_tokens": 0, "total_tokens": 0}} - "422": - application/json: {} - agents_api_v1_conversations_start_stream: - speakeasy-default-agents-api-v1-conversations-start-stream: - requestBody: - application/json: {"inputs": "", "stream": true} - responses: - "422": - application/json: {} - "200": {} - agents_api_v1_conversations_append_stream: - speakeasy-default-agents-api-v1-conversations-append-stream: - parameters: - path: - conversation_id: "" - requestBody: - application/json: {"inputs": "", "stream": true, "store": true, "handoff_execution": "server"} - responses: - "422": - application/json: {} - "200": {} - agents_api_v1_conversations_restart_stream: - speakeasy-default-agents-api-v1-conversations-restart-stream: - parameters: - path: - conversation_id: "" - requestBody: - application/json: {"inputs": "", "stream": true, "store": true, "handoff_execution": "server", "from_entry_id": ""} - responses: - "422": - application/json: {} - "200": {} - agents_api_v1_agents_create: - speakeasy-default-agents-api-v1-agents-create: - requestBody: - application/json: {"model": "Fiesta", "name": ""} - responses: - "200": - application/json: {"model": "LeBaron", "name": "", "object": "agent", "id": "", "version": 417458, "created_at": "2023-05-28T06:20:22.766Z", "updated_at": "2023-03-17T15:39:20.911Z"} - "422": - application/json: {} - agents_api_v1_agents_list: - speakeasy-default-agents-api-v1-agents-list: - parameters: - query: - page: 0 - page_size: 20 - responses: - "200": - application/json: [{"model": "Golf", "name": "", "object": "agent", "id": "", "version": 678317, "created_at": "2023-07-14T18:23:27.528Z", "updated_at": "2023-09-09T18:28:08.953Z"}, {"model": "Aventador", "name": "", "object": "agent", "id": "", "version": 635532, "created_at": "2024-12-01T18:25:37.169Z", "updated_at": "2023-01-20T06:21:22.156Z"}, {"model": "Model T", "name": "", "object": "agent", "id": "", "version": 86140, "created_at": "2023-03-17T01:57:00.187Z", "updated_at": "2025-01-24T00:05:25.844Z"}] - "422": - application/json: {} - agents_api_v1_agents_get: - speakeasy-default-agents-api-v1-agents-get: - parameters: - path: - agent_id: "" + application/json: {"model": "Camry", "input": [{"messages": [{"content": "", "role": "system"}]}]} responses: "200": - application/json: {"model": "Model S", "name": "", "object": "agent", "id": "", "version": 558834, "created_at": "2024-08-19T11:11:04.610Z", "updated_at": "2024-07-25T06:33:15.810Z"} + application/json: {"id": "mod-e5cc70bb28c444948073e77776eb30ef", "model": "Altima", "results": [{}, {"key": {"scores": {"key": 1360.53, "key1": 5946.42}}}, {"key": {"scores": {"key": 1360.53, "key1": 5946.42}}}]} "422": application/json: {} - agents_api_v1_agents_update: - speakeasy-default-agents-api-v1-agents-update: - parameters: - path: - agent_id: "" + ocr_v1_ocr_post: + speakeasy-default-ocr-v1-ocr-post: requestBody: - application/json: {} - responses: - "200": - application/json: {"model": "Sentra", "name": "", "object": "agent", "id": "", "version": 597129, "created_at": "2024-01-13T16:52:57.274Z", "updated_at": "2025-12-22T15:27:45.882Z"} - "422": - application/json: {} - agents_api_v1_agents_update_version: - speakeasy-default-agents-api-v1-agents-update-version: - parameters: - path: - agent_id: "" - query: - version: 193920 + application/json: {"model": "CX-9", "document": {"image_url": {"url": "https://measly-scrap.com"}, "type": "image_url"}} responses: "200": - application/json: {"model": "Mercielago", "name": "", "object": "agent", "id": "", "version": 253661, "created_at": "2023-02-14T22:44:06.703Z", "updated_at": "2025-12-15T06:22:04.120Z"} + application/json: {"pages": [{"index": 944919, "markdown": "", "images": [], "dimensions": {"dpi": 984283, "height": 453411, "width": 398292}}], "model": "Wrangler", "usage_info": {"pages_processed": 47064}} "422": application/json: {} -examplesVersion: 1.0.0 +examplesVersion: 1.0.2 generatedTests: {} diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 77710816..2c46f3c0 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -4,6 +4,7 @@ generation: maintainOpenAPIOrder: true usageSnippets: optionalPropertyRendering: withExample + sdkInitStyle: constructor useClassNamesForArrayFields: true fixes: nameResolutionDec2023: true @@ -11,17 +12,23 @@ generation: parameterOrderingFeb2024: true requestResponseComponentNamesFeb2024: true securityFeb2025: false + sharedErrorComponentsApr2025: false auth: oAuth2ClientCredentialsEnabled: true oAuth2PasswordEnabled: false + tests: + generateTests: true + generateNewTests: false + skipResponseBodyAssertions: false python: - version: 1.8.2 + version: 1.9.0 additionalDependencies: dev: pytest: ^8.2.2 pytest-asyncio: ^0.23.7 authors: - Mistral + baseErrorName: MistralError clientServerStatusCodesAsErrors: true defaultErrorName: SDKError description: Python Client SDK for the Mistral AI API. @@ -44,8 +51,10 @@ python: inputModelSuffix: input maxMethodParams: 15 methodArguments: infer-optional-args + moduleName: "" outputModelSuffix: output packageName: mistralai + pytestFilterWarnings: [] pytestTimeout: 0 responseFormat: flat templateVersion: v2 diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index c618ac1d..12dfd152 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,4 +1,4 @@ -speakeasyVersion: 1.517.3 +speakeasyVersion: 1.568.2 sources: mistral-azure-source: sourceNamespace: mistral-openapi-azure @@ -18,7 +18,6 @@ sources: sourceBlobDigest: sha256:74aeb6a2e0d466c206f983ce79581cc72d205cc7866826282c181207ebe841a2 tags: - latest - - speakeasy-sdk-regen-1749573609 targets: mistralai-azure-sdk: source: mistral-azure-source @@ -40,20 +39,20 @@ targets: sourceRevisionDigest: sha256:21244d618cafcc163c3aa4acbc443ca16c63b8614632b65b87fbb2c4066987f3 sourceBlobDigest: sha256:74aeb6a2e0d466c206f983ce79581cc72d205cc7866826282c181207ebe841a2 codeSamplesNamespace: mistral-openapi-code-samples - codeSamplesRevisionDigest: sha256:dc4396ba994048a9f31c008dced1a46a9e54d89973e9608039a7bc37b1052957 + codeSamplesRevisionDigest: sha256:b631243aae349ddebec1b984874a8e1d5b40e67d6229a199a3d5e63ba69d1538 workflow: workflowVersion: 1.0.0 - speakeasyVersion: 1.517.3 + speakeasyVersion: 1.568.2 sources: mistral-azure-source: inputs: - - location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-azure:main + - location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-azure:sha256:c5931a7e0cc2db844149d71db57dfc2178665f0400bc26c90ee113795ea2872f mistral-google-cloud-source: inputs: - - location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-google-cloud:main + - location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-google-cloud:sha256:4a5343e63c6a78152e472b00ccc46d7bcb15594496bc94c8040039d3a9d4c5f8 mistral-openapi: inputs: - - location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi:main + - location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi:sha256:21244d618cafcc163c3aa4acbc443ca16c63b8614632b65b87fbb2c4066987f3 targets: mistralai-azure-sdk: target: python diff --git a/.speakeasy/workflow.yaml b/.speakeasy/workflow.yaml index d448108d..fa2f4815 100644 --- a/.speakeasy/workflow.yaml +++ b/.speakeasy/workflow.yaml @@ -1,15 +1,15 @@ workflowVersion: 1.0.0 -speakeasyVersion: 1.517.3 +speakeasyVersion: 1.568.2 sources: mistral-azure-source: inputs: - - location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-azure:main + - location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-azure:sha256:c5931a7e0cc2db844149d71db57dfc2178665f0400bc26c90ee113795ea2872f mistral-google-cloud-source: inputs: - - location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-google-cloud:main + - location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-google-cloud:sha256:4a5343e63c6a78152e472b00ccc46d7bcb15594496bc94c8040039d3a9d4c5f8 mistral-openapi: inputs: - - location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi:main + - location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi:sha256:21244d618cafcc163c3aa4acbc443ca16c63b8614632b65b87fbb2c4066987f3 targets: mistralai-azure-sdk: target: python diff --git a/README.md b/README.md index b8926d7b..ee0b1d08 100644 --- a/README.md +++ b/README.md @@ -142,7 +142,7 @@ with Mistral( "content": "Who is the best French painter? Answer in one short sentence.", "role": "user", }, - ]) + ], stream=False) # Handle response print(res) @@ -168,7 +168,7 @@ async def main(): "content": "Who is the best French painter? Answer in one short sentence.", "role": "user", }, - ]) + ], stream=False) # Handle response print(res) @@ -244,7 +244,7 @@ with Mistral( "content": "Who is the best French painter? Answer in one short sentence.", "role": "user", }, - ], agent_id="") + ], agent_id="", stream=False) # Handle response print(res) @@ -270,7 +270,7 @@ async def main(): "content": "Who is the best French painter? Answer in one short sentence.", "role": "user", }, - ], agent_id="") + ], agent_id="", stream=False) # Handle response print(res) @@ -547,7 +547,14 @@ with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: - res = mistral.beta.conversations.start_stream(inputs="") + res = mistral.beta.conversations.start_stream(inputs=[ + { + "object": "entry", + "type": "function.result", + "tool_call_id": "", + "result": "", + }, + ], stream=True) with res as event_stream: for event in event_stream: diff --git a/USAGE.md b/USAGE.md index fa3a77de..d2bba404 100644 --- a/USAGE.md +++ b/USAGE.md @@ -18,7 +18,7 @@ with Mistral( "content": "Who is the best French painter? Answer in one short sentence.", "role": "user", }, - ]) + ], stream=False) # Handle response print(res) @@ -44,7 +44,7 @@ async def main(): "content": "Who is the best French painter? Answer in one short sentence.", "role": "user", }, - ]) + ], stream=False) # Handle response print(res) @@ -120,7 +120,7 @@ with Mistral( "content": "Who is the best French painter? Answer in one short sentence.", "role": "user", }, - ], agent_id="") + ], agent_id="", stream=False) # Handle response print(res) @@ -146,7 +146,7 @@ async def main(): "content": "Who is the best French painter? Answer in one short sentence.", "role": "user", }, - ], agent_id="") + ], agent_id="", stream=False) # Handle response print(res) diff --git a/docs/models/agent.md b/docs/models/agent.md index 9a64fb68..686fae75 100644 --- a/docs/models/agent.md +++ b/docs/models/agent.md @@ -5,15 +5,15 @@ | Field | Type | Required | Description | | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | -| `model` | *str* | :heavy_check_mark: | N/A | -| `name` | *str* | :heavy_check_mark: | N/A | -| `id` | *str* | :heavy_check_mark: | N/A | -| `version` | *int* | :heavy_check_mark: | N/A | -| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | -| `updated_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | | `instructions` | *OptionalNullable[str]* | :heavy_minus_sign: | Instruction prompt the model will follow during the conversation. | | `tools` | List[[models.AgentTools](../models/agenttools.md)] | :heavy_minus_sign: | List of tools which are available to the model during the conversation. | | `completion_args` | [Optional[models.CompletionArgs]](../models/completionargs.md) | :heavy_minus_sign: | White-listed arguments from the completion API | +| `model` | *str* | :heavy_check_mark: | N/A | +| `name` | *str* | :heavy_check_mark: | N/A | | `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `handoffs` | List[*str*] | :heavy_minus_sign: | N/A | -| `object` | [Optional[models.AgentObject]](../models/agentobject.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `object` | [Optional[models.AgentObject]](../models/agentobject.md) | :heavy_minus_sign: | N/A | +| `id` | *str* | :heavy_check_mark: | N/A | +| `version` | *int* | :heavy_check_mark: | N/A | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | +| `updated_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/agentconversation.md b/docs/models/agentconversation.md index 93dde728..772cc80e 100644 --- a/docs/models/agentconversation.md +++ b/docs/models/agentconversation.md @@ -5,10 +5,10 @@ | Field | Type | Required | Description | | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name given to the conversation. | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | Description of the what the conversation is about. | +| `object` | [Optional[models.AgentConversationObject]](../models/agentconversationobject.md) | :heavy_minus_sign: | N/A | | `id` | *str* | :heavy_check_mark: | N/A | | `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | | `updated_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | -| `agent_id` | *str* | :heavy_check_mark: | N/A | -| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name given to the conversation. | -| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | Description of the what the conversation is about. | -| `object` | [Optional[models.AgentConversationObject]](../models/agentconversationobject.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `agent_id` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/agentcreationrequest.md b/docs/models/agentcreationrequest.md index 324ff25c..34060d9a 100644 --- a/docs/models/agentcreationrequest.md +++ b/docs/models/agentcreationrequest.md @@ -5,10 +5,10 @@ | Field | Type | Required | Description | | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -| `model` | *str* | :heavy_check_mark: | N/A | -| `name` | *str* | :heavy_check_mark: | N/A | | `instructions` | *OptionalNullable[str]* | :heavy_minus_sign: | Instruction prompt the model will follow during the conversation. | | `tools` | List[[models.AgentCreationRequestTools](../models/agentcreationrequesttools.md)] | :heavy_minus_sign: | List of tools which are available to the model during the conversation. | | `completion_args` | [Optional[models.CompletionArgs]](../models/completionargs.md) | :heavy_minus_sign: | White-listed arguments from the completion API | +| `model` | *str* | :heavy_check_mark: | N/A | +| `name` | *str* | :heavy_check_mark: | N/A | | `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `handoffs` | List[*str*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/agenthandoffdoneevent.md b/docs/models/agenthandoffdoneevent.md index a8a74ec0..c0039f41 100644 --- a/docs/models/agenthandoffdoneevent.md +++ b/docs/models/agenthandoffdoneevent.md @@ -5,9 +5,9 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | -| `id` | *str* | :heavy_check_mark: | N/A | -| `next_agent_id` | *str* | :heavy_check_mark: | N/A | -| `next_agent_name` | *str* | :heavy_check_mark: | N/A | | `type` | [Optional[models.AgentHandoffDoneEventType]](../models/agenthandoffdoneeventtype.md) | :heavy_minus_sign: | N/A | | `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | -| `output_index` | *Optional[int]* | :heavy_minus_sign: | N/A | \ No newline at end of file +| `output_index` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `id` | *str* | :heavy_check_mark: | N/A | +| `next_agent_id` | *str* | :heavy_check_mark: | N/A | +| `next_agent_name` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/agenthandoffentry.md b/docs/models/agenthandoffentry.md index 327f8048..8831b0eb 100644 --- a/docs/models/agenthandoffentry.md +++ b/docs/models/agenthandoffentry.md @@ -5,12 +5,12 @@ | Field | Type | Required | Description | | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -| `previous_agent_id` | *str* | :heavy_check_mark: | N/A | -| `previous_agent_name` | *str* | :heavy_check_mark: | N/A | -| `next_agent_id` | *str* | :heavy_check_mark: | N/A | -| `next_agent_name` | *str* | :heavy_check_mark: | N/A | | `object` | [Optional[models.AgentHandoffEntryObject]](../models/agenthandoffentryobject.md) | :heavy_minus_sign: | N/A | | `type` | [Optional[models.AgentHandoffEntryType]](../models/agenthandoffentrytype.md) | :heavy_minus_sign: | N/A | | `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | | `completed_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | -| `id` | *Optional[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file +| `id` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `previous_agent_id` | *str* | :heavy_check_mark: | N/A | +| `previous_agent_name` | *str* | :heavy_check_mark: | N/A | +| `next_agent_id` | *str* | :heavy_check_mark: | N/A | +| `next_agent_name` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/agenthandoffstartedevent.md b/docs/models/agenthandoffstartedevent.md index f99ed45d..035cd02a 100644 --- a/docs/models/agenthandoffstartedevent.md +++ b/docs/models/agenthandoffstartedevent.md @@ -5,9 +5,9 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | -| `id` | *str* | :heavy_check_mark: | N/A | -| `previous_agent_id` | *str* | :heavy_check_mark: | N/A | -| `previous_agent_name` | *str* | :heavy_check_mark: | N/A | | `type` | [Optional[models.AgentHandoffStartedEventType]](../models/agenthandoffstartedeventtype.md) | :heavy_minus_sign: | N/A | | `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | -| `output_index` | *Optional[int]* | :heavy_minus_sign: | N/A | \ No newline at end of file +| `output_index` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `id` | *str* | :heavy_check_mark: | N/A | +| `previous_agent_id` | *str* | :heavy_check_mark: | N/A | +| `previous_agent_name` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/agentscompletionrequest.md b/docs/models/agentscompletionrequest.md index 8ace69d9..e4a3f849 100644 --- a/docs/models/agentscompletionrequest.md +++ b/docs/models/agentscompletionrequest.md @@ -5,12 +5,11 @@ | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `messages` | List[[models.AgentsCompletionRequestMessages](../models/agentscompletionrequestmessages.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."
}
] | -| `agent_id` | *str* | :heavy_check_mark: | The ID of the agent to use for this completion. | | | `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: | Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. | | | `stop` | [Optional[models.AgentsCompletionRequestStop]](../models/agentscompletionrequeststop.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. | | +| `messages` | List[[models.AgentsCompletionRequestMessages](../models/agentscompletionrequestmessages.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: | N/A | | | `tools` | List[[models.Tool](../models/tool.md)] | :heavy_minus_sign: | N/A | | | `tool_choice` | [Optional[models.AgentsCompletionRequestToolChoice]](../models/agentscompletionrequesttoolchoice.md) | :heavy_minus_sign: | N/A | | @@ -19,4 +18,5 @@ | `n` | *OptionalNullable[int]* | :heavy_minus_sign: | Number of completions to return for each request, input tokens are only billed once. | | | `prediction` | [Optional[models.Prediction]](../models/prediction.md) | :heavy_minus_sign: | N/A | | | `parallel_tool_calls` | *Optional[bool]* | :heavy_minus_sign: | N/A | | -| `prompt_mode` | [OptionalNullable[models.MistralPromptMode]](../models/mistralpromptmode.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file +| `prompt_mode` | [OptionalNullable[models.MistralPromptMode]](../models/mistralpromptmode.md) | :heavy_minus_sign: | N/A | | +| `agent_id` | *str* | :heavy_check_mark: | The ID of the agent to use for this completion. | | \ No newline at end of file diff --git a/docs/models/agentscompletionstreamrequest.md b/docs/models/agentscompletionstreamrequest.md index 0bab012c..bd55190b 100644 --- a/docs/models/agentscompletionstreamrequest.md +++ b/docs/models/agentscompletionstreamrequest.md @@ -5,12 +5,11 @@ | Field | Type | Required | Description | Example | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `messages` | List[[models.AgentsCompletionStreamRequestMessages](../models/agentscompletionstreamrequestmessages.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."
}
] | -| `agent_id` | *str* | :heavy_check_mark: | The ID of the agent to use for this completion. | | | `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.AgentsCompletionStreamRequestStop]](../models/agentscompletionstreamrequeststop.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. | | +| `messages` | List[[models.AgentsCompletionStreamRequestMessages](../models/agentscompletionstreamrequestmessages.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: | N/A | | | `tools` | List[[models.Tool](../models/tool.md)] | :heavy_minus_sign: | N/A | | | `tool_choice` | [Optional[models.AgentsCompletionStreamRequestToolChoice]](../models/agentscompletionstreamrequesttoolchoice.md) | :heavy_minus_sign: | N/A | | @@ -19,4 +18,5 @@ | `n` | *OptionalNullable[int]* | :heavy_minus_sign: | Number of completions to return for each request, input tokens are only billed once. | | | `prediction` | [Optional[models.Prediction]](../models/prediction.md) | :heavy_minus_sign: | N/A | | | `parallel_tool_calls` | *Optional[bool]* | :heavy_minus_sign: | N/A | | -| `prompt_mode` | [OptionalNullable[models.MistralPromptMode]](../models/mistralpromptmode.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file +| `prompt_mode` | [OptionalNullable[models.MistralPromptMode]](../models/mistralpromptmode.md) | :heavy_minus_sign: | N/A | | +| `agent_id` | *str* | :heavy_check_mark: | The ID of the agent to use for this completion. | | \ No newline at end of file diff --git a/docs/models/basemodelcard.md b/docs/models/basemodelcard.md index 0bdbb65f..a2a19fcb 100644 --- a/docs/models/basemodelcard.md +++ b/docs/models/basemodelcard.md @@ -6,10 +6,10 @@ | Field | Type | Required | Description | | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | | `id` | *str* | :heavy_check_mark: | N/A | -| `capabilities` | [models.ModelCapabilities](../models/modelcapabilities.md) | :heavy_check_mark: | N/A | | `object` | *Optional[str]* | :heavy_minus_sign: | N/A | | `created` | *Optional[int]* | :heavy_minus_sign: | N/A | | `owned_by` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `capabilities` | [models.ModelCapabilities](../models/modelcapabilities.md) | :heavy_check_mark: | N/A | | `name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `max_context_length` | *Optional[int]* | :heavy_minus_sign: | N/A | diff --git a/docs/models/batchjobout.md b/docs/models/batchjobout.md index d79d9a27..16374467 100644 --- a/docs/models/batchjobout.md +++ b/docs/models/batchjobout.md @@ -6,9 +6,13 @@ | Field | Type | Required | Description | | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | | `id` | *str* | :heavy_check_mark: | N/A | +| `object` | [Optional[models.BatchJobOutObject]](../models/batchjoboutobject.md) | :heavy_minus_sign: | N/A | | `input_files` | List[*str*] | :heavy_check_mark: | N/A | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | | `endpoint` | *str* | :heavy_check_mark: | N/A | | `model` | *str* | :heavy_check_mark: | N/A | +| `output_file` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `error_file` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `errors` | List[[models.BatchError](../models/batcherror.md)] | :heavy_check_mark: | N/A | | `status` | [models.BatchJobStatus](../models/batchjobstatus.md) | :heavy_check_mark: | N/A | | `created_at` | *int* | :heavy_check_mark: | N/A | @@ -16,9 +20,5 @@ | `completed_requests` | *int* | :heavy_check_mark: | N/A | | `succeeded_requests` | *int* | :heavy_check_mark: | N/A | | `failed_requests` | *int* | :heavy_check_mark: | N/A | -| `object` | [Optional[models.BatchJobOutObject]](../models/batchjoboutobject.md) | :heavy_minus_sign: | N/A | -| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | -| `output_file` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `error_file` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `started_at` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | | `completed_at` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/batchjobsout.md b/docs/models/batchjobsout.md index 3104118c..a76cfdcc 100644 --- a/docs/models/batchjobsout.md +++ b/docs/models/batchjobsout.md @@ -5,6 +5,6 @@ | Field | Type | Required | Description | | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | -| `total` | *int* | :heavy_check_mark: | N/A | | `data` | List[[models.BatchJobOut](../models/batchjobout.md)] | :heavy_minus_sign: | N/A | -| `object` | [Optional[models.BatchJobsOutObject]](../models/batchjobsoutobject.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `object` | [Optional[models.BatchJobsOutObject]](../models/batchjobsoutobject.md) | :heavy_minus_sign: | N/A | +| `total` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/chatcompletionrequest.md b/docs/models/chatcompletionrequest.md index a850b5b8..ecbcad39 100644 --- a/docs/models/chatcompletionrequest.md +++ b/docs/models/chatcompletionrequest.md @@ -6,13 +6,13 @@ | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | *str* | :heavy_check_mark: | 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. | mistral-small-latest | -| `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."
}
] | | `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | 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. | | | `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: | Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. | | | `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 | | | `random_seed` | *OptionalNullable[int]* | :heavy_minus_sign: | The seed to use for random sampling. If set, different calls will generate deterministic results. | | +| `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."
}
] | | `response_format` | [Optional[models.ResponseFormat]](../models/responseformat.md) | :heavy_minus_sign: | N/A | | | `tools` | List[[models.Tool](../models/tool.md)] | :heavy_minus_sign: | N/A | | | `tool_choice` | [Optional[models.ChatCompletionRequestToolChoice]](../models/chatcompletionrequesttoolchoice.md) | :heavy_minus_sign: | N/A | | diff --git a/docs/models/chatcompletionstreamrequest.md b/docs/models/chatcompletionstreamrequest.md index cf286cda..7f73a269 100644 --- a/docs/models/chatcompletionstreamrequest.md +++ b/docs/models/chatcompletionstreamrequest.md @@ -6,13 +6,13 @@ | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | *str* | :heavy_check_mark: | 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. | mistral-small-latest | -| `messages` | List[[models.ChatCompletionStreamRequestMessages](../models/chatcompletionstreamrequestmessages.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."
}
] | | `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | 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. | | | `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.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. | | +| `messages` | List[[models.ChatCompletionStreamRequestMessages](../models/chatcompletionstreamrequestmessages.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: | N/A | | | `tools` | List[[models.Tool](../models/tool.md)] | :heavy_minus_sign: | N/A | | | `tool_choice` | [Optional[models.ChatCompletionStreamRequestToolChoice]](../models/chatcompletionstreamrequesttoolchoice.md) | :heavy_minus_sign: | N/A | | diff --git a/docs/models/classifierdetailedjobout.md b/docs/models/classifierdetailedjobout.md index 99227c01..ccc88f89 100644 --- a/docs/models/classifierdetailedjobout.md +++ b/docs/models/classifierdetailedjobout.md @@ -12,8 +12,6 @@ | `created_at` | *int* | :heavy_check_mark: | N/A | | `modified_at` | *int* | :heavy_check_mark: | N/A | | `training_files` | List[*str*] | :heavy_check_mark: | N/A | -| `hyperparameters` | [models.ClassifierTrainingParameters](../models/classifiertrainingparameters.md) | :heavy_check_mark: | N/A | -| `classifier_targets` | List[[models.ClassifierTargetOut](../models/classifiertargetout.md)] | :heavy_check_mark: | N/A | | `validation_files` | List[*str*] | :heavy_minus_sign: | N/A | | `object` | [Optional[models.ClassifierDetailedJobOutObject]](../models/classifierdetailedjoboutobject.md) | :heavy_minus_sign: | N/A | | `fine_tuned_model` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | @@ -22,5 +20,7 @@ | `trained_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | | `metadata` | [OptionalNullable[models.JobMetadataOut]](../models/jobmetadataout.md) | :heavy_minus_sign: | N/A | | `job_type` | [Optional[models.ClassifierDetailedJobOutJobType]](../models/classifierdetailedjoboutjobtype.md) | :heavy_minus_sign: | N/A | +| `hyperparameters` | [models.ClassifierTrainingParameters](../models/classifiertrainingparameters.md) | :heavy_check_mark: | N/A | | `events` | List[[models.EventOut](../models/eventout.md)] | :heavy_minus_sign: | Event items are created every time the status of a fine-tuning job changes. The timestamped list of all events is accessible here. | -| `checkpoints` | List[[models.CheckpointOut](../models/checkpointout.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file +| `checkpoints` | List[[models.CheckpointOut](../models/checkpointout.md)] | :heavy_minus_sign: | N/A | +| `classifier_targets` | List[[models.ClassifierTargetOut](../models/classifiertargetout.md)] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/classifierftmodelout.md b/docs/models/classifierftmodelout.md index 406102cf..506af14e 100644 --- a/docs/models/classifierftmodelout.md +++ b/docs/models/classifierftmodelout.md @@ -6,16 +6,16 @@ | Field | Type | Required | Description | | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | | `id` | *str* | :heavy_check_mark: | N/A | +| `object` | [Optional[models.ClassifierFTModelOutObject]](../models/classifierftmodeloutobject.md) | :heavy_minus_sign: | N/A | | `created` | *int* | :heavy_check_mark: | N/A | | `owned_by` | *str* | :heavy_check_mark: | N/A | | `root` | *str* | :heavy_check_mark: | N/A | | `archived` | *bool* | :heavy_check_mark: | N/A | -| `capabilities` | [models.FTModelCapabilitiesOut](../models/ftmodelcapabilitiesout.md) | :heavy_check_mark: | N/A | -| `job` | *str* | :heavy_check_mark: | N/A | -| `classifier_targets` | List[[models.ClassifierTargetOut](../models/classifiertargetout.md)] | :heavy_check_mark: | N/A | -| `object` | [Optional[models.ClassifierFTModelOutObject]](../models/classifierftmodeloutobject.md) | :heavy_minus_sign: | N/A | | `name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `capabilities` | [models.FTModelCapabilitiesOut](../models/ftmodelcapabilitiesout.md) | :heavy_check_mark: | N/A | | `max_context_length` | *Optional[int]* | :heavy_minus_sign: | N/A | | `aliases` | List[*str*] | :heavy_minus_sign: | N/A | +| `job` | *str* | :heavy_check_mark: | N/A | +| `classifier_targets` | List[[models.ClassifierTargetOut](../models/classifiertargetout.md)] | :heavy_check_mark: | N/A | | `model_type` | [Optional[models.ClassifierFTModelOutModelType]](../models/classifierftmodeloutmodeltype.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/classifierjobout.md b/docs/models/classifierjobout.md index 5fa290c1..aa1d3ca9 100644 --- a/docs/models/classifierjobout.md +++ b/docs/models/classifierjobout.md @@ -12,7 +12,6 @@ | `created_at` | *int* | :heavy_check_mark: | The UNIX timestamp (in seconds) for when the fine-tuning job was created. | | `modified_at` | *int* | :heavy_check_mark: | The UNIX timestamp (in seconds) for when the fine-tuning job was last modified. | | `training_files` | List[*str*] | :heavy_check_mark: | A list containing the IDs of uploaded files that contain training data. | -| `hyperparameters` | [models.ClassifierTrainingParameters](../models/classifiertrainingparameters.md) | :heavy_check_mark: | N/A | | `validation_files` | List[*str*] | :heavy_minus_sign: | A list containing the IDs of uploaded files that contain validation data. | | `object` | [Optional[models.ClassifierJobOutObject]](../models/classifierjoboutobject.md) | :heavy_minus_sign: | The object type of the fine-tuning job. | | `fine_tuned_model` | *OptionalNullable[str]* | :heavy_minus_sign: | The name of the fine-tuned model that is being created. The value will be `null` if the fine-tuning job is still running. | @@ -20,4 +19,5 @@ | `integrations` | List[[models.ClassifierJobOutIntegrations](../models/classifierjoboutintegrations.md)] | :heavy_minus_sign: | A list of integrations enabled for your fine-tuning job. | | `trained_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | Total number of tokens trained. | | `metadata` | [OptionalNullable[models.JobMetadataOut]](../models/jobmetadataout.md) | :heavy_minus_sign: | N/A | -| `job_type` | [Optional[models.ClassifierJobOutJobType]](../models/classifierjoboutjobtype.md) | :heavy_minus_sign: | The type of job (`FT` for fine-tuning). | \ No newline at end of file +| `job_type` | [Optional[models.ClassifierJobOutJobType]](../models/classifierjoboutjobtype.md) | :heavy_minus_sign: | The type of job (`FT` for fine-tuning). | +| `hyperparameters` | [models.ClassifierTrainingParameters](../models/classifiertrainingparameters.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/completionchunk.md b/docs/models/completionchunk.md index b8ae6a09..7f8ab5e6 100644 --- a/docs/models/completionchunk.md +++ b/docs/models/completionchunk.md @@ -6,8 +6,8 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | | `id` | *str* | :heavy_check_mark: | N/A | -| `model` | *str* | :heavy_check_mark: | N/A | -| `choices` | List[[models.CompletionResponseStreamChoice](../models/completionresponsestreamchoice.md)] | :heavy_check_mark: | N/A | | `object` | *Optional[str]* | :heavy_minus_sign: | N/A | | `created` | *Optional[int]* | :heavy_minus_sign: | N/A | -| `usage` | [Optional[models.UsageInfo]](../models/usageinfo.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `model` | *str* | :heavy_check_mark: | N/A | +| `usage` | [Optional[models.UsageInfo]](../models/usageinfo.md) | :heavy_minus_sign: | N/A | +| `choices` | List[[models.CompletionResponseStreamChoice](../models/completionresponsestreamchoice.md)] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/completiondetailedjobout.md b/docs/models/completiondetailedjobout.md index b42dd419..84613080 100644 --- a/docs/models/completiondetailedjobout.md +++ b/docs/models/completiondetailedjobout.md @@ -12,7 +12,6 @@ | `created_at` | *int* | :heavy_check_mark: | N/A | | `modified_at` | *int* | :heavy_check_mark: | N/A | | `training_files` | List[*str*] | :heavy_check_mark: | N/A | -| `hyperparameters` | [models.CompletionTrainingParameters](../models/completiontrainingparameters.md) | :heavy_check_mark: | N/A | | `validation_files` | List[*str*] | :heavy_minus_sign: | N/A | | `object` | [Optional[models.CompletionDetailedJobOutObject]](../models/completiondetailedjoboutobject.md) | :heavy_minus_sign: | N/A | | `fine_tuned_model` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | @@ -21,6 +20,7 @@ | `trained_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | | `metadata` | [OptionalNullable[models.JobMetadataOut]](../models/jobmetadataout.md) | :heavy_minus_sign: | N/A | | `job_type` | [Optional[models.CompletionDetailedJobOutJobType]](../models/completiondetailedjoboutjobtype.md) | :heavy_minus_sign: | N/A | +| `hyperparameters` | [models.CompletionTrainingParameters](../models/completiontrainingparameters.md) | :heavy_check_mark: | N/A | | `repositories` | List[[models.CompletionDetailedJobOutRepositories](../models/completiondetailedjoboutrepositories.md)] | :heavy_minus_sign: | N/A | | `events` | List[[models.EventOut](../models/eventout.md)] | :heavy_minus_sign: | Event items are created every time the status of a fine-tuning job changes. The timestamped list of all events is accessible here. | | `checkpoints` | List[[models.CheckpointOut](../models/checkpointout.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/completionftmodelout.md b/docs/models/completionftmodelout.md index ca1c5289..f1e22b88 100644 --- a/docs/models/completionftmodelout.md +++ b/docs/models/completionftmodelout.md @@ -6,15 +6,15 @@ | Field | Type | Required | Description | | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | | `id` | *str* | :heavy_check_mark: | N/A | +| `object` | [Optional[models.CompletionFTModelOutObject]](../models/completionftmodeloutobject.md) | :heavy_minus_sign: | N/A | | `created` | *int* | :heavy_check_mark: | N/A | | `owned_by` | *str* | :heavy_check_mark: | N/A | | `root` | *str* | :heavy_check_mark: | N/A | | `archived` | *bool* | :heavy_check_mark: | N/A | -| `capabilities` | [models.FTModelCapabilitiesOut](../models/ftmodelcapabilitiesout.md) | :heavy_check_mark: | N/A | -| `job` | *str* | :heavy_check_mark: | N/A | -| `object` | [Optional[models.CompletionFTModelOutObject]](../models/completionftmodeloutobject.md) | :heavy_minus_sign: | N/A | | `name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `capabilities` | [models.FTModelCapabilitiesOut](../models/ftmodelcapabilitiesout.md) | :heavy_check_mark: | N/A | | `max_context_length` | *Optional[int]* | :heavy_minus_sign: | N/A | | `aliases` | List[*str*] | :heavy_minus_sign: | N/A | +| `job` | *str* | :heavy_check_mark: | N/A | | `model_type` | [Optional[models.ModelType]](../models/modeltype.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/completionjobout.md b/docs/models/completionjobout.md index 7f30f58c..cb471746 100644 --- a/docs/models/completionjobout.md +++ b/docs/models/completionjobout.md @@ -12,7 +12,6 @@ | `created_at` | *int* | :heavy_check_mark: | The UNIX timestamp (in seconds) for when the fine-tuning job was created. | | `modified_at` | *int* | :heavy_check_mark: | The UNIX timestamp (in seconds) for when the fine-tuning job was last modified. | | `training_files` | List[*str*] | :heavy_check_mark: | A list containing the IDs of uploaded files that contain training data. | -| `hyperparameters` | [models.CompletionTrainingParameters](../models/completiontrainingparameters.md) | :heavy_check_mark: | N/A | | `validation_files` | List[*str*] | :heavy_minus_sign: | A list containing the IDs of uploaded files that contain validation data. | | `object` | [Optional[models.CompletionJobOutObject]](../models/completionjoboutobject.md) | :heavy_minus_sign: | The object type of the fine-tuning job. | | `fine_tuned_model` | *OptionalNullable[str]* | :heavy_minus_sign: | The name of the fine-tuned model that is being created. The value will be `null` if the fine-tuning job is still running. | @@ -21,4 +20,5 @@ | `trained_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | Total number of tokens trained. | | `metadata` | [OptionalNullable[models.JobMetadataOut]](../models/jobmetadataout.md) | :heavy_minus_sign: | N/A | | `job_type` | [Optional[models.JobType]](../models/jobtype.md) | :heavy_minus_sign: | The type of job (`FT` for fine-tuning). | +| `hyperparameters` | [models.CompletionTrainingParameters](../models/completiontrainingparameters.md) | :heavy_check_mark: | N/A | | `repositories` | List[[models.Repositories](../models/repositories.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/conversationhistory.md b/docs/models/conversationhistory.md index 8bcef1de..ebb1d513 100644 --- a/docs/models/conversationhistory.md +++ b/docs/models/conversationhistory.md @@ -7,6 +7,6 @@ Retrieve all entries in a conversation. | Field | Type | Required | Description | | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `object` | [Optional[models.ConversationHistoryObject]](../models/conversationhistoryobject.md) | :heavy_minus_sign: | N/A | | `conversation_id` | *str* | :heavy_check_mark: | N/A | -| `entries` | List[[models.Entries](../models/entries.md)] | :heavy_check_mark: | N/A | -| `object` | [Optional[models.ConversationHistoryObject]](../models/conversationhistoryobject.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `entries` | List[[models.Entries](../models/entries.md)] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/conversationmessages.md b/docs/models/conversationmessages.md index f6a5569f..c3f00979 100644 --- a/docs/models/conversationmessages.md +++ b/docs/models/conversationmessages.md @@ -7,6 +7,6 @@ Similar to the conversation history but only keep the messages | Field | Type | Required | Description | | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `object` | [Optional[models.ConversationMessagesObject]](../models/conversationmessagesobject.md) | :heavy_minus_sign: | N/A | | `conversation_id` | *str* | :heavy_check_mark: | N/A | -| `messages` | List[[models.MessageEntries](../models/messageentries.md)] | :heavy_check_mark: | N/A | -| `object` | [Optional[models.ConversationMessagesObject]](../models/conversationmessagesobject.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `messages` | List[[models.MessageEntries](../models/messageentries.md)] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/conversationresponse.md b/docs/models/conversationresponse.md index 3309a08b..38cdadd0 100644 --- a/docs/models/conversationresponse.md +++ b/docs/models/conversationresponse.md @@ -7,7 +7,7 @@ The response after appending new entries to the conversation. | Field | Type | Required | Description | | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `object` | [Optional[models.ConversationResponseObject]](../models/conversationresponseobject.md) | :heavy_minus_sign: | N/A | | `conversation_id` | *str* | :heavy_check_mark: | N/A | | `outputs` | List[[models.Outputs](../models/outputs.md)] | :heavy_check_mark: | N/A | -| `usage` | [models.ConversationUsageInfo](../models/conversationusageinfo.md) | :heavy_check_mark: | N/A | -| `object` | [Optional[models.ConversationResponseObject]](../models/conversationresponseobject.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `usage` | [models.ConversationUsageInfo](../models/conversationusageinfo.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/conversationrestartrequest.md b/docs/models/conversationrestartrequest.md index 15a6ead4..16786f6a 100644 --- a/docs/models/conversationrestartrequest.md +++ b/docs/models/conversationrestartrequest.md @@ -8,8 +8,8 @@ Request to restart a new conversation from a given entry in the conversation. | Field | Type | Required | Description | | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | | `inputs` | [models.ConversationInputs](../models/conversationinputs.md) | :heavy_check_mark: | N/A | -| `from_entry_id` | *str* | :heavy_check_mark: | N/A | | `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A | | `store` | *Optional[bool]* | :heavy_minus_sign: | Whether to store the results into our servers or not. | | `handoff_execution` | [Optional[models.ConversationRestartRequestHandoffExecution]](../models/conversationrestartrequesthandoffexecution.md) | :heavy_minus_sign: | N/A | +| `from_entry_id` | *str* | :heavy_check_mark: | N/A | | `completion_args` | [Optional[models.CompletionArgs]](../models/completionargs.md) | :heavy_minus_sign: | White-listed arguments from the completion API | \ No newline at end of file diff --git a/docs/models/conversationrestartstreamrequest.md b/docs/models/conversationrestartstreamrequest.md index 30f3767c..23bf9851 100644 --- a/docs/models/conversationrestartstreamrequest.md +++ b/docs/models/conversationrestartstreamrequest.md @@ -8,8 +8,8 @@ Request to restart a new conversation from a given entry in the conversation. | Field | Type | Required | Description | | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `inputs` | [models.ConversationInputs](../models/conversationinputs.md) | :heavy_check_mark: | N/A | -| `from_entry_id` | *str* | :heavy_check_mark: | N/A | | `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A | | `store` | *Optional[bool]* | :heavy_minus_sign: | Whether to store the results into our servers or not. | | `handoff_execution` | [Optional[models.ConversationRestartStreamRequestHandoffExecution]](../models/conversationrestartstreamrequesthandoffexecution.md) | :heavy_minus_sign: | N/A | +| `from_entry_id` | *str* | :heavy_check_mark: | N/A | | `completion_args` | [Optional[models.CompletionArgs]](../models/completionargs.md) | :heavy_minus_sign: | White-listed arguments from the completion API | \ No newline at end of file diff --git a/docs/models/documentlibrarytool.md b/docs/models/documentlibrarytool.md index bed4e2c5..82315f32 100644 --- a/docs/models/documentlibrarytool.md +++ b/docs/models/documentlibrarytool.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -| `library_ids` | List[*str*] | :heavy_check_mark: | Ids of the library in which to search. | -| `type` | [Optional[models.DocumentLibraryToolType]](../models/documentlibrarytooltype.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `type` | [Optional[models.DocumentLibraryToolType]](../models/documentlibrarytooltype.md) | :heavy_minus_sign: | N/A | +| `library_ids` | List[*str*] | :heavy_check_mark: | Ids of the library in which to search. | \ No newline at end of file diff --git a/docs/models/eventout.md b/docs/models/eventout.md index c6f69ada..d9202353 100644 --- a/docs/models/eventout.md +++ b/docs/models/eventout.md @@ -6,5 +6,5 @@ | Field | Type | Required | Description | | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | | `name` | *str* | :heavy_check_mark: | The name of the event. | -| `created_at` | *int* | :heavy_check_mark: | The UNIX timestamp (in seconds) of the event. | -| `data` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | \ No newline at end of file +| `data` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | +| `created_at` | *int* | :heavy_check_mark: | The UNIX timestamp (in seconds) of the event. | \ No newline at end of file diff --git a/docs/models/fileschema.md b/docs/models/fileschema.md index 4fbcd718..9746a995 100644 --- a/docs/models/fileschema.md +++ b/docs/models/fileschema.md @@ -12,5 +12,5 @@ | `filename` | *str* | :heavy_check_mark: | The name of the uploaded file. | files_upload.jsonl | | `purpose` | [models.FilePurpose](../models/filepurpose.md) | :heavy_check_mark: | N/A | | | `sample_type` | [models.SampleType](../models/sampletype.md) | :heavy_check_mark: | N/A | | -| `source` | [models.Source](../models/source.md) | :heavy_check_mark: | N/A | | -| `num_lines` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | | \ No newline at end of file +| `num_lines` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | | +| `source` | [models.Source](../models/source.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/fimcompletionrequest.md b/docs/models/fimcompletionrequest.md index 7507b90c..7b785cf0 100644 --- a/docs/models/fimcompletionrequest.md +++ b/docs/models/fimcompletionrequest.md @@ -6,12 +6,12 @@ | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | *str* | :heavy_check_mark: | ID of the model to use. Only compatible for now with:
- `codestral-2405`
- `codestral-latest` | codestral-2405 | -| `prompt` | *str* | :heavy_check_mark: | The text/code to complete. | def | | `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | 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. | | | `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: | Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. | | | `stop` | [Optional[models.FIMCompletionRequestStop]](../models/fimcompletionrequeststop.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. | | +| `prompt` | *str* | :heavy_check_mark: | The text/code to complete. | def | | `suffix` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional text/code that adds more context for the model. When given a `prompt` and a `suffix` the model will fill what is between them. When `suffix` is not provided, the model will simply execute completion starting with `prompt`. | return a+b | | `min_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The minimum number of tokens to generate in the completion. | | \ No newline at end of file diff --git a/docs/models/fimcompletionstreamrequest.md b/docs/models/fimcompletionstreamrequest.md index 6cc439c7..d49a6301 100644 --- a/docs/models/fimcompletionstreamrequest.md +++ b/docs/models/fimcompletionstreamrequest.md @@ -6,12 +6,12 @@ | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | *str* | :heavy_check_mark: | ID of the model to use. Only compatible for now with:
- `codestral-2405`
- `codestral-latest` | codestral-2405 | -| `prompt` | *str* | :heavy_check_mark: | The text/code to complete. | def | | `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | 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. | | | `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.FIMCompletionStreamRequestStop]](../models/fimcompletionstreamrequeststop.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. | | +| `prompt` | *str* | :heavy_check_mark: | The text/code to complete. | def | | `suffix` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional text/code that adds more context for the model. When given a `prompt` and a `suffix` the model will fill what is between them. When `suffix` is not provided, the model will simply execute completion starting with `prompt`. | return a+b | | `min_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The minimum number of tokens to generate in the completion. | | \ No newline at end of file diff --git a/docs/models/ftmodelcard.md b/docs/models/ftmodelcard.md index 1efeadb2..aaa5b401 100644 --- a/docs/models/ftmodelcard.md +++ b/docs/models/ftmodelcard.md @@ -8,12 +8,10 @@ Extra fields for fine-tuned models. | Field | Type | Required | Description | | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | | `id` | *str* | :heavy_check_mark: | N/A | -| `capabilities` | [models.ModelCapabilities](../models/modelcapabilities.md) | :heavy_check_mark: | N/A | -| `job` | *str* | :heavy_check_mark: | N/A | -| `root` | *str* | :heavy_check_mark: | N/A | | `object` | *Optional[str]* | :heavy_minus_sign: | N/A | | `created` | *Optional[int]* | :heavy_minus_sign: | N/A | | `owned_by` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `capabilities` | [models.ModelCapabilities](../models/modelcapabilities.md) | :heavy_check_mark: | N/A | | `name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `max_context_length` | *Optional[int]* | :heavy_minus_sign: | N/A | @@ -21,4 +19,6 @@ Extra fields for fine-tuned models. | `deprecation` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | | `default_model_temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | | `type` | [Optional[models.FTModelCardType]](../models/ftmodelcardtype.md) | :heavy_minus_sign: | N/A | +| `job` | *str* | :heavy_check_mark: | N/A | +| `root` | *str* | :heavy_check_mark: | N/A | | `archived` | *Optional[bool]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/function.md b/docs/models/function.md index a166b7bb..b2bdb3fe 100644 --- a/docs/models/function.md +++ b/docs/models/function.md @@ -6,6 +6,6 @@ | Field | Type | Required | Description | | ------------------ | ------------------ | ------------------ | ------------------ | | `name` | *str* | :heavy_check_mark: | N/A | -| `parameters` | Dict[str, *Any*] | :heavy_check_mark: | N/A | | `description` | *Optional[str]* | :heavy_minus_sign: | N/A | -| `strict` | *Optional[bool]* | :heavy_minus_sign: | N/A | \ No newline at end of file +| `strict` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `parameters` | Dict[str, *Any*] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/functioncallentry.md b/docs/models/functioncallentry.md index 55665bad..fd3aa5c5 100644 --- a/docs/models/functioncallentry.md +++ b/docs/models/functioncallentry.md @@ -5,11 +5,11 @@ | Field | Type | Required | Description | | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -| `tool_call_id` | *str* | :heavy_check_mark: | N/A | -| `name` | *str* | :heavy_check_mark: | N/A | -| `arguments` | [models.FunctionCallEntryArguments](../models/functioncallentryarguments.md) | :heavy_check_mark: | N/A | | `object` | [Optional[models.FunctionCallEntryObject]](../models/functioncallentryobject.md) | :heavy_minus_sign: | N/A | | `type` | [Optional[models.FunctionCallEntryType]](../models/functioncallentrytype.md) | :heavy_minus_sign: | N/A | | `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | | `completed_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | -| `id` | *Optional[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file +| `id` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `tool_call_id` | *str* | :heavy_check_mark: | N/A | +| `name` | *str* | :heavy_check_mark: | N/A | +| `arguments` | [models.FunctionCallEntryArguments](../models/functioncallentryarguments.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/functioncallevent.md b/docs/models/functioncallevent.md index a5162090..c25679a5 100644 --- a/docs/models/functioncallevent.md +++ b/docs/models/functioncallevent.md @@ -5,10 +5,10 @@ | Field | Type | Required | Description | | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `type` | [Optional[models.FunctionCallEventType]](../models/functioncalleventtype.md) | :heavy_minus_sign: | N/A | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | +| `output_index` | *Optional[int]* | :heavy_minus_sign: | N/A | | `id` | *str* | :heavy_check_mark: | N/A | | `name` | *str* | :heavy_check_mark: | N/A | | `tool_call_id` | *str* | :heavy_check_mark: | N/A | -| `arguments` | *str* | :heavy_check_mark: | N/A | -| `type` | [Optional[models.FunctionCallEventType]](../models/functioncalleventtype.md) | :heavy_minus_sign: | N/A | -| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | -| `output_index` | *Optional[int]* | :heavy_minus_sign: | N/A | \ No newline at end of file +| `arguments` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/functionresultentry.md b/docs/models/functionresultentry.md index 5cdcf3eb..6df54d3d 100644 --- a/docs/models/functionresultentry.md +++ b/docs/models/functionresultentry.md @@ -5,10 +5,10 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | -| `tool_call_id` | *str* | :heavy_check_mark: | N/A | -| `result` | *str* | :heavy_check_mark: | N/A | | `object` | [Optional[models.FunctionResultEntryObject]](../models/functionresultentryobject.md) | :heavy_minus_sign: | N/A | | `type` | [Optional[models.FunctionResultEntryType]](../models/functionresultentrytype.md) | :heavy_minus_sign: | N/A | | `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | | `completed_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | -| `id` | *Optional[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file +| `id` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `tool_call_id` | *str* | :heavy_check_mark: | N/A | +| `result` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/functiontool.md b/docs/models/functiontool.md index 1332febe..8c424593 100644 --- a/docs/models/functiontool.md +++ b/docs/models/functiontool.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `function` | [models.Function](../models/function.md) | :heavy_check_mark: | N/A | -| `type` | [Optional[models.FunctionToolType]](../models/functiontooltype.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `type` | [Optional[models.FunctionToolType]](../models/functiontooltype.md) | :heavy_minus_sign: | N/A | +| `function` | [models.Function](../models/function.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/githubrepositoryin.md b/docs/models/githubrepositoryin.md index 7ae2fb4f..1584152b 100644 --- a/docs/models/githubrepositoryin.md +++ b/docs/models/githubrepositoryin.md @@ -5,9 +5,9 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `type` | [Optional[models.GithubRepositoryInType]](../models/githubrepositoryintype.md) | :heavy_minus_sign: | N/A | | `name` | *str* | :heavy_check_mark: | N/A | | `owner` | *str* | :heavy_check_mark: | N/A | -| `token` | *str* | :heavy_check_mark: | N/A | -| `type` | [Optional[models.GithubRepositoryInType]](../models/githubrepositoryintype.md) | :heavy_minus_sign: | N/A | | `ref` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `weight` | *Optional[float]* | :heavy_minus_sign: | N/A | \ No newline at end of file +| `weight` | *Optional[float]* | :heavy_minus_sign: | N/A | +| `token` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/githubrepositoryout.md b/docs/models/githubrepositoryout.md index 0f96736f..03f0b266 100644 --- a/docs/models/githubrepositoryout.md +++ b/docs/models/githubrepositoryout.md @@ -5,9 +5,9 @@ | Field | Type | Required | Description | | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `type` | [Optional[models.GithubRepositoryOutType]](../models/githubrepositoryouttype.md) | :heavy_minus_sign: | N/A | | `name` | *str* | :heavy_check_mark: | N/A | | `owner` | *str* | :heavy_check_mark: | N/A | -| `commit_id` | *str* | :heavy_check_mark: | N/A | -| `type` | [Optional[models.GithubRepositoryOutType]](../models/githubrepositoryouttype.md) | :heavy_minus_sign: | N/A | | `ref` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `weight` | *Optional[float]* | :heavy_minus_sign: | N/A | \ No newline at end of file +| `weight` | *Optional[float]* | :heavy_minus_sign: | N/A | +| `commit_id` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/jobin.md b/docs/models/jobin.md index d6cbd27a..b9651770 100644 --- a/docs/models/jobin.md +++ b/docs/models/jobin.md @@ -6,7 +6,6 @@ | Field | Type | Required | Description | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | *str* | :heavy_check_mark: | The name of the model to fine-tune. | -| `hyperparameters` | [models.Hyperparameters](../models/hyperparameters.md) | :heavy_check_mark: | N/A | | `training_files` | List[[models.TrainingFile](../models/trainingfile.md)] | :heavy_minus_sign: | N/A | | `validation_files` | List[*str*] | :heavy_minus_sign: | A list containing the IDs of uploaded files that contain validation data. If you provide these files, the data is used to generate validation metrics periodically during fine-tuning. These metrics can be viewed in `checkpoints` when getting the status of a running fine-tuning job. The same data should not be present in both train and validation files. | | `suffix` | *OptionalNullable[str]* | :heavy_minus_sign: | A string that will be added to your fine-tuning model name. For example, a suffix of "my-great-model" would produce a model name like `ft:open-mistral-7b:my-great-model:xxx...` | @@ -14,5 +13,6 @@ | `auto_start` | *Optional[bool]* | :heavy_minus_sign: | This field will be required in a future release. | | `invalid_sample_skip_percentage` | *Optional[float]* | :heavy_minus_sign: | N/A | | `job_type` | [OptionalNullable[models.FineTuneableModelType]](../models/finetuneablemodeltype.md) | :heavy_minus_sign: | N/A | +| `hyperparameters` | [models.Hyperparameters](../models/hyperparameters.md) | :heavy_check_mark: | N/A | | `repositories` | List[[models.JobInRepositories](../models/jobinrepositories.md)] | :heavy_minus_sign: | N/A | | `classifier_targets` | List[[models.ClassifierTargetIn](../models/classifiertargetin.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/jobsout.md b/docs/models/jobsout.md index d71793ef..977013f7 100644 --- a/docs/models/jobsout.md +++ b/docs/models/jobsout.md @@ -5,6 +5,6 @@ | Field | Type | Required | Description | | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `total` | *int* | :heavy_check_mark: | N/A | | `data` | List[[models.JobsOutData](../models/jobsoutdata.md)] | :heavy_minus_sign: | N/A | -| `object` | [Optional[models.JobsOutObject]](../models/jobsoutobject.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `object` | [Optional[models.JobsOutObject]](../models/jobsoutobject.md) | :heavy_minus_sign: | N/A | +| `total` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/jsonschema.md b/docs/models/jsonschema.md index ae387867..7ff7c070 100644 --- a/docs/models/jsonschema.md +++ b/docs/models/jsonschema.md @@ -6,6 +6,6 @@ | Field | Type | Required | Description | | ----------------------- | ----------------------- | ----------------------- | ----------------------- | | `name` | *str* | :heavy_check_mark: | N/A | -| `schema_definition` | Dict[str, *Any*] | :heavy_check_mark: | N/A | | `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `schema_definition` | Dict[str, *Any*] | :heavy_check_mark: | N/A | | `strict` | *Optional[bool]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/legacyjobmetadataout.md b/docs/models/legacyjobmetadataout.md index 44d17e95..53a45485 100644 --- a/docs/models/legacyjobmetadataout.md +++ b/docs/models/legacyjobmetadataout.md @@ -5,7 +5,6 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `details` | *str* | :heavy_check_mark: | N/A | | | `expected_duration_seconds` | *OptionalNullable[int]* | :heavy_minus_sign: | The approximated time (in seconds) for the fine-tuning process to complete. | 220 | | `cost` | *OptionalNullable[float]* | :heavy_minus_sign: | The cost of the fine-tuning job. | 10 | | `cost_currency` | *OptionalNullable[str]* | :heavy_minus_sign: | The currency used for the fine-tuning job cost. | EUR | @@ -14,6 +13,7 @@ | `data_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The total number of tokens in the training dataset. | 305375 | | `estimated_start_time` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | | | `deprecated` | *Optional[bool]* | :heavy_minus_sign: | N/A | | +| `details` | *str* | :heavy_check_mark: | N/A | | | `epochs` | *OptionalNullable[float]* | :heavy_minus_sign: | The number of complete passes through the entire training dataset. | 4.2922 | | `training_steps` | *OptionalNullable[int]* | :heavy_minus_sign: | The number of training steps to perform. A training step refers to a single update of the model weights during the fine-tuning process. This update is typically calculated using a batch of samples from the training dataset. | 10 | | `object` | [Optional[models.LegacyJobMetadataOutObject]](../models/legacyjobmetadataoutobject.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/messageinputentry.md b/docs/models/messageinputentry.md index a1573ed5..f5bb6c25 100644 --- a/docs/models/messageinputentry.md +++ b/docs/models/messageinputentry.md @@ -7,10 +7,10 @@ Representation of an input message inside the conversation. | Field | Type | Required | Description | | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | -| `role` | [models.MessageInputEntryRole](../models/messageinputentryrole.md) | :heavy_check_mark: | N/A | -| `content` | [models.MessageInputEntryContent](../models/messageinputentrycontent.md) | :heavy_check_mark: | N/A | | `object` | [Optional[models.Object]](../models/object.md) | :heavy_minus_sign: | N/A | | `type` | [Optional[models.MessageInputEntryType]](../models/messageinputentrytype.md) | :heavy_minus_sign: | N/A | | `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | | `completed_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | -| `id` | *Optional[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file +| `id` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `role` | [models.MessageInputEntryRole](../models/messageinputentryrole.md) | :heavy_check_mark: | N/A | +| `content` | [models.MessageInputEntryContent](../models/messageinputentrycontent.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/messageoutputentry.md b/docs/models/messageoutputentry.md index 224d043d..5b42e20d 100644 --- a/docs/models/messageoutputentry.md +++ b/docs/models/messageoutputentry.md @@ -5,7 +5,6 @@ | Field | Type | Required | Description | | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | -| `content` | [models.MessageOutputEntryContent](../models/messageoutputentrycontent.md) | :heavy_check_mark: | N/A | | `object` | [Optional[models.MessageOutputEntryObject]](../models/messageoutputentryobject.md) | :heavy_minus_sign: | N/A | | `type` | [Optional[models.MessageOutputEntryType]](../models/messageoutputentrytype.md) | :heavy_minus_sign: | N/A | | `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | @@ -13,4 +12,5 @@ | `id` | *Optional[str]* | :heavy_minus_sign: | N/A | | `agent_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `model` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `role` | [Optional[models.MessageOutputEntryRole]](../models/messageoutputentryrole.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `role` | [Optional[models.MessageOutputEntryRole]](../models/messageoutputentryrole.md) | :heavy_minus_sign: | N/A | +| `content` | [models.MessageOutputEntryContent](../models/messageoutputentrycontent.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/messageoutputevent.md b/docs/models/messageoutputevent.md index 3fe8ac49..92c1c615 100644 --- a/docs/models/messageoutputevent.md +++ b/docs/models/messageoutputevent.md @@ -5,12 +5,12 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | -| `id` | *str* | :heavy_check_mark: | N/A | -| `content` | [models.MessageOutputEventContent](../models/messageoutputeventcontent.md) | :heavy_check_mark: | N/A | | `type` | [Optional[models.MessageOutputEventType]](../models/messageoutputeventtype.md) | :heavy_minus_sign: | N/A | | `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | | `output_index` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `id` | *str* | :heavy_check_mark: | N/A | | `content_index` | *Optional[int]* | :heavy_minus_sign: | N/A | | `model` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `agent_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `role` | [Optional[models.MessageOutputEventRole]](../models/messageoutputeventrole.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `role` | [Optional[models.MessageOutputEventRole]](../models/messageoutputeventrole.md) | :heavy_minus_sign: | N/A | +| `content` | [models.MessageOutputEventContent](../models/messageoutputeventcontent.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/modelconversation.md b/docs/models/modelconversation.md index ffedcc0f..f7f61a79 100644 --- a/docs/models/modelconversation.md +++ b/docs/models/modelconversation.md @@ -5,13 +5,13 @@ | Field | Type | Required | Description | | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | N/A | -| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | -| `updated_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | -| `model` | *str* | :heavy_check_mark: | N/A | | `instructions` | *OptionalNullable[str]* | :heavy_minus_sign: | Instruction prompt the model will follow during the conversation. | | `tools` | List[[models.ModelConversationTools](../models/modelconversationtools.md)] | :heavy_minus_sign: | List of tools which are available to the model during the conversation. | | `completion_args` | [Optional[models.CompletionArgs]](../models/completionargs.md) | :heavy_minus_sign: | White-listed arguments from the completion API | | `name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name given to the conversation. | | `description` | *OptionalNullable[str]* | :heavy_minus_sign: | Description of the what the conversation is about. | -| `object` | [Optional[models.ModelConversationObject]](../models/modelconversationobject.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `object` | [Optional[models.ModelConversationObject]](../models/modelconversationobject.md) | :heavy_minus_sign: | N/A | +| `id` | *str* | :heavy_check_mark: | N/A | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | +| `updated_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | +| `model` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/ocrrequest.md b/docs/models/ocrrequest.md index 0c8954a5..6a9c77ab 100644 --- a/docs/models/ocrrequest.md +++ b/docs/models/ocrrequest.md @@ -6,8 +6,8 @@ | Field | Type | Required | Description | | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | *Nullable[str]* | :heavy_check_mark: | N/A | -| `document` | [models.Document](../models/document.md) | :heavy_check_mark: | Document to run OCR on | | `id` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `document` | [models.Document](../models/document.md) | :heavy_check_mark: | Document to run OCR on | | `pages` | List[*int*] | :heavy_minus_sign: | Specific pages user wants to process in various formats: single number, range, or list of both. Starts from 0 | | `include_image_base64` | *OptionalNullable[bool]* | :heavy_minus_sign: | Include image URLs in response | | `image_limit` | *OptionalNullable[int]* | :heavy_minus_sign: | Max images to extract | diff --git a/docs/models/ocrresponse.md b/docs/models/ocrresponse.md index 7d6a58ae..0a309317 100644 --- a/docs/models/ocrresponse.md +++ b/docs/models/ocrresponse.md @@ -7,5 +7,5 @@ | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | | `pages` | List[[models.OCRPageObject](../models/ocrpageobject.md)] | :heavy_check_mark: | List of OCR info for pages. | | `model` | *str* | :heavy_check_mark: | The model used to generate the OCR. | -| `usage_info` | [models.OCRUsageInfo](../models/ocrusageinfo.md) | :heavy_check_mark: | N/A | -| `document_annotation` | *OptionalNullable[str]* | :heavy_minus_sign: | Formatted response in the request_format if provided in json str | \ No newline at end of file +| `document_annotation` | *OptionalNullable[str]* | :heavy_minus_sign: | Formatted response in the request_format if provided in json str | +| `usage_info` | [models.OCRUsageInfo](../models/ocrusageinfo.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/responsedoneevent.md b/docs/models/responsedoneevent.md index b33fa52c..ec25bd6d 100644 --- a/docs/models/responsedoneevent.md +++ b/docs/models/responsedoneevent.md @@ -5,6 +5,6 @@ | Field | Type | Required | Description | | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | -| `usage` | [models.ConversationUsageInfo](../models/conversationusageinfo.md) | :heavy_check_mark: | N/A | | `type` | [Optional[models.ResponseDoneEventType]](../models/responsedoneeventtype.md) | :heavy_minus_sign: | N/A | -| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | +| `usage` | [models.ConversationUsageInfo](../models/conversationusageinfo.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/responseerrorevent.md b/docs/models/responseerrorevent.md index e730b7c4..2ea6a2e0 100644 --- a/docs/models/responseerrorevent.md +++ b/docs/models/responseerrorevent.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | -| `message` | *str* | :heavy_check_mark: | N/A | -| `code` | *int* | :heavy_check_mark: | N/A | | `type` | [Optional[models.ResponseErrorEventType]](../models/responseerroreventtype.md) | :heavy_minus_sign: | N/A | -| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | +| `message` | *str* | :heavy_check_mark: | N/A | +| `code` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/responsestartedevent.md b/docs/models/responsestartedevent.md index 7bd02b3e..481bd5bb 100644 --- a/docs/models/responsestartedevent.md +++ b/docs/models/responsestartedevent.md @@ -5,6 +5,6 @@ | Field | Type | Required | Description | | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | -| `conversation_id` | *str* | :heavy_check_mark: | N/A | | `type` | [Optional[models.ResponseStartedEventType]](../models/responsestartedeventtype.md) | :heavy_minus_sign: | N/A | -| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | +| `conversation_id` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/retrievefileout.md b/docs/models/retrievefileout.md index 30861f5c..10f738b9 100644 --- a/docs/models/retrievefileout.md +++ b/docs/models/retrievefileout.md @@ -12,6 +12,6 @@ | `filename` | *str* | :heavy_check_mark: | The name of the uploaded file. | files_upload.jsonl | | `purpose` | [models.FilePurpose](../models/filepurpose.md) | :heavy_check_mark: | N/A | | | `sample_type` | [models.SampleType](../models/sampletype.md) | :heavy_check_mark: | N/A | | +| `num_lines` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | | | `source` | [models.Source](../models/source.md) | :heavy_check_mark: | N/A | | -| `deleted` | *bool* | :heavy_check_mark: | N/A | | -| `num_lines` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | | \ No newline at end of file +| `deleted` | *bool* | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/tool.md b/docs/models/tool.md index 822f86f8..fb661f72 100644 --- a/docs/models/tool.md +++ b/docs/models/tool.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `function` | [models.Function](../models/function.md) | :heavy_check_mark: | N/A | -| `type` | [Optional[models.ToolTypes]](../models/tooltypes.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `type` | [Optional[models.ToolTypes]](../models/tooltypes.md) | :heavy_minus_sign: | N/A | +| `function` | [models.Function](../models/function.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/toolcall.md b/docs/models/toolcall.md index 574be1ea..3819236b 100644 --- a/docs/models/toolcall.md +++ b/docs/models/toolcall.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `function` | [models.FunctionCall](../models/functioncall.md) | :heavy_check_mark: | N/A | | `id` | *Optional[str]* | :heavy_minus_sign: | N/A | | `type` | [Optional[models.ToolTypes]](../models/tooltypes.md) | :heavy_minus_sign: | N/A | +| `function` | [models.FunctionCall](../models/functioncall.md) | :heavy_check_mark: | N/A | | `index` | *Optional[int]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/toolchoice.md b/docs/models/toolchoice.md index 792ebcd6..373046bb 100644 --- a/docs/models/toolchoice.md +++ b/docs/models/toolchoice.md @@ -7,5 +7,5 @@ ToolChoice is either a ToolChoiceEnum or a ToolChoice | Field | Type | Required | Description | | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | -| `function` | [models.FunctionName](../models/functionname.md) | :heavy_check_mark: | this restriction of `Function` is used to select a specific function to call | -| `type` | [Optional[models.ToolTypes]](../models/tooltypes.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `type` | [Optional[models.ToolTypes]](../models/tooltypes.md) | :heavy_minus_sign: | N/A | +| `function` | [models.FunctionName](../models/functionname.md) | :heavy_check_mark: | this restriction of `Function` is used to select a specific function to call | \ No newline at end of file diff --git a/docs/models/toolexecutiondoneevent.md b/docs/models/toolexecutiondoneevent.md index d6d28ce2..aa28df59 100644 --- a/docs/models/toolexecutiondoneevent.md +++ b/docs/models/toolexecutiondoneevent.md @@ -5,9 +5,9 @@ | Field | Type | Required | Description | | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | N/A | -| `name` | [models.BuiltInConnectors](../models/builtinconnectors.md) | :heavy_check_mark: | N/A | | `type` | [Optional[models.ToolExecutionDoneEventType]](../models/toolexecutiondoneeventtype.md) | :heavy_minus_sign: | N/A | | `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | | `output_index` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `id` | *str* | :heavy_check_mark: | N/A | +| `name` | [models.BuiltInConnectors](../models/builtinconnectors.md) | :heavy_check_mark: | N/A | | `info` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/toolexecutionentry.md b/docs/models/toolexecutionentry.md index 8422a8fd..2e58b517 100644 --- a/docs/models/toolexecutionentry.md +++ b/docs/models/toolexecutionentry.md @@ -5,10 +5,10 @@ | Field | Type | Required | Description | | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | -| `name` | [models.BuiltInConnectors](../models/builtinconnectors.md) | :heavy_check_mark: | N/A | | `object` | [Optional[models.ToolExecutionEntryObject]](../models/toolexecutionentryobject.md) | :heavy_minus_sign: | N/A | | `type` | [Optional[models.ToolExecutionEntryType]](../models/toolexecutionentrytype.md) | :heavy_minus_sign: | N/A | | `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | | `completed_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | | `id` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `name` | [models.BuiltInConnectors](../models/builtinconnectors.md) | :heavy_check_mark: | N/A | | `info` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/toolexecutionstartedevent.md b/docs/models/toolexecutionstartedevent.md index 4b03f94c..8fc20194 100644 --- a/docs/models/toolexecutionstartedevent.md +++ b/docs/models/toolexecutionstartedevent.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | N/A | -| `name` | [models.BuiltInConnectors](../models/builtinconnectors.md) | :heavy_check_mark: | N/A | | `type` | [Optional[models.ToolExecutionStartedEventType]](../models/toolexecutionstartedeventtype.md) | :heavy_minus_sign: | N/A | | `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | -| `output_index` | *Optional[int]* | :heavy_minus_sign: | N/A | \ No newline at end of file +| `output_index` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `id` | *str* | :heavy_check_mark: | N/A | +| `name` | [models.BuiltInConnectors](../models/builtinconnectors.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/toolfilechunk.md b/docs/models/toolfilechunk.md index 236d2f41..f1b54c7c 100644 --- a/docs/models/toolfilechunk.md +++ b/docs/models/toolfilechunk.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `type` | [Optional[models.ToolFileChunkType]](../models/toolfilechunktype.md) | :heavy_minus_sign: | N/A | | `tool` | [models.BuiltInConnectors](../models/builtinconnectors.md) | :heavy_check_mark: | N/A | | `file_id` | *str* | :heavy_check_mark: | N/A | -| `type` | [Optional[models.ToolFileChunkType]](../models/toolfilechunktype.md) | :heavy_minus_sign: | N/A | | `file_name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `file_type` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/toolreferencechunk.md b/docs/models/toolreferencechunk.md index fb4b46a6..d8bea0da 100644 --- a/docs/models/toolreferencechunk.md +++ b/docs/models/toolreferencechunk.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `type` | [Optional[models.ToolReferenceChunkType]](../models/toolreferencechunktype.md) | :heavy_minus_sign: | N/A | | `tool` | [models.BuiltInConnectors](../models/builtinconnectors.md) | :heavy_check_mark: | N/A | | `title` | *str* | :heavy_check_mark: | N/A | -| `type` | [Optional[models.ToolReferenceChunkType]](../models/toolreferencechunktype.md) | :heavy_minus_sign: | N/A | | `url` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `source` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/uploadfileout.md b/docs/models/uploadfileout.md index cf3c5994..ef2ad212 100644 --- a/docs/models/uploadfileout.md +++ b/docs/models/uploadfileout.md @@ -12,5 +12,5 @@ | `filename` | *str* | :heavy_check_mark: | The name of the uploaded file. | files_upload.jsonl | | `purpose` | [models.FilePurpose](../models/filepurpose.md) | :heavy_check_mark: | N/A | | | `sample_type` | [models.SampleType](../models/sampletype.md) | :heavy_check_mark: | N/A | | -| `source` | [models.Source](../models/source.md) | :heavy_check_mark: | N/A | | -| `num_lines` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | | \ No newline at end of file +| `num_lines` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | | +| `source` | [models.Source](../models/source.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/wandbintegration.md b/docs/models/wandbintegration.md index c003a46e..199d2edd 100644 --- a/docs/models/wandbintegration.md +++ b/docs/models/wandbintegration.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | -| `project` | *str* | :heavy_check_mark: | The name of the project that the new run will be created under. | -| `api_key` | *str* | :heavy_check_mark: | The WandB API key to use for authentication. | | `type` | [Optional[models.WandbIntegrationType]](../models/wandbintegrationtype.md) | :heavy_minus_sign: | N/A | +| `project` | *str* | :heavy_check_mark: | The name of the project that the new run will be created under. | | `name` | *OptionalNullable[str]* | :heavy_minus_sign: | A display name to set for the run. If not set, will use the job ID as the name. | +| `api_key` | *str* | :heavy_check_mark: | The WandB API key to use for authentication. | | `run_name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/wandbintegrationout.md b/docs/models/wandbintegrationout.md index f924b636..cec02ed8 100644 --- a/docs/models/wandbintegrationout.md +++ b/docs/models/wandbintegrationout.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -| `project` | *str* | :heavy_check_mark: | The name of the project that the new run will be created under. | | `type` | [Optional[models.WandbIntegrationOutType]](../models/wandbintegrationouttype.md) | :heavy_minus_sign: | N/A | +| `project` | *str* | :heavy_check_mark: | The name of the project that the new run will be created under. | | `name` | *OptionalNullable[str]* | :heavy_minus_sign: | A display name to set for the run. If not set, will use the job ID as the name. | | `run_name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `url` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/sdks/agents/README.md b/docs/sdks/agents/README.md index c7fdb687..d5014a36 100644 --- a/docs/sdks/agents/README.md +++ b/docs/sdks/agents/README.md @@ -30,7 +30,7 @@ with Mistral( "content": "Who is the best French painter? Answer in one short sentence.", "role": "user", }, - ], agent_id="") + ], agent_id="", stream=False) # Handle response print(res) @@ -89,7 +89,7 @@ with Mistral( "content": "Who is the best French painter? Answer in one short sentence.", "role": "user", }, - ], agent_id="") + ], agent_id="", stream=True) with res as event_stream: for event in event_stream: diff --git a/docs/sdks/chat/README.md b/docs/sdks/chat/README.md index 3a8d57fa..f8aca31f 100644 --- a/docs/sdks/chat/README.md +++ b/docs/sdks/chat/README.md @@ -30,7 +30,7 @@ with Mistral( "content": "Who is the best French painter? Answer in one short sentence.", "role": "user", }, - ]) + ], stream=False) # Handle response print(res) @@ -92,7 +92,7 @@ with Mistral( "content": "Who is the best French painter? Answer in one short sentence.", "role": "user", }, - ]) + ], stream=True) with res as event_stream: for event in event_stream: diff --git a/docs/sdks/classifiers/README.md b/docs/sdks/classifiers/README.md index 19761046..3f9d3a3c 100644 --- a/docs/sdks/classifiers/README.md +++ b/docs/sdks/classifiers/README.md @@ -27,8 +27,9 @@ with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: - res = mistral.classifiers.moderate(model="V90", inputs=[ - "", + res = mistral.classifiers.moderate(model="Durango", inputs=[ + "", + "", ]) # Handle response @@ -71,52 +72,11 @@ with Mistral( ) as mistral: res = mistral.classifiers.moderate_chat(inputs=[ - [ - { - "content": [ - - ], - "role": "system", - }, - { - "content": "", - "role": "tool", - }, - ], - [ - { - "prefix": False, - "role": "assistant", - }, - { - "content": "", - "role": "user", - }, - { - "prefix": False, - "role": "assistant", - }, - ], - [ - { - "content": "", - "role": "system", - }, - { - "content": [ - { - "image_url": "https://fatherly-colon.name", - "type": "image_url", - }, - ], - "role": "user", - }, - { - "content": "", - "role": "user", - }, - ], - ], model="Model Y") + { + "content": "", + "role": "tool", + }, + ], model="LeBaron") # Handle response print(res) @@ -157,7 +117,9 @@ with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: - res = mistral.classifiers.classify(model="Altima", inputs="") + res = mistral.classifiers.classify(model="Silverado", inputs=[ + "", + ]) # Handle response print(res) @@ -198,20 +160,15 @@ with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: - res = mistral.classifiers.classify_chat(model="Fortwo", inputs=[ + res = mistral.classifiers.classify_chat(model="Camry", inputs=[ { "messages": [ { "content": "", - "role": "tool", + "role": "system", }, ], }, - { - "messages": [ - - ], - }, ]) # Handle response diff --git a/docs/sdks/conversations/README.md b/docs/sdks/conversations/README.md index 6d6aaa2c..25b1ab9c 100644 --- a/docs/sdks/conversations/README.md +++ b/docs/sdks/conversations/README.md @@ -33,7 +33,7 @@ with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: - res = mistral.beta.conversations.start(inputs="") + res = mistral.beta.conversations.start(inputs="", stream=False) # Handle response print(res) @@ -83,7 +83,7 @@ with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: - res = mistral.beta.conversations.list() + res = mistral.beta.conversations.list(page=0, page_size=100) # Handle response print(res) @@ -164,7 +164,7 @@ with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: - res = mistral.beta.conversations.append(conversation_id="", inputs="") + res = mistral.beta.conversations.append(conversation_id="", inputs=[], stream=False, store=True, handoff_execution="server") # Handle response print(res) @@ -289,7 +289,7 @@ with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: - res = mistral.beta.conversations.restart(conversation_id="", inputs="", from_entry_id="") + res = mistral.beta.conversations.restart(conversation_id="", inputs="", from_entry_id="", stream=False, store=True, handoff_execution="server") # Handle response print(res) @@ -335,7 +335,14 @@ with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: - res = mistral.beta.conversations.start_stream(inputs="") + res = mistral.beta.conversations.start_stream(inputs=[ + { + "object": "entry", + "type": "function.result", + "tool_call_id": "", + "result": "", + }, + ], stream=True) with res as event_stream: for event in event_stream: @@ -387,7 +394,7 @@ with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: - res = mistral.beta.conversations.append_stream(conversation_id="", inputs="") + res = mistral.beta.conversations.append_stream(conversation_id="", inputs="", stream=True, store=True, handoff_execution="server") with res as event_stream: for event in event_stream: @@ -434,7 +441,14 @@ with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: - res = mistral.beta.conversations.restart_stream(conversation_id="", inputs="", from_entry_id="") + res = mistral.beta.conversations.restart_stream(conversation_id="", inputs=[ + { + "object": "entry", + "type": "message.input", + "role": "assistant", + "content": "", + }, + ], from_entry_id="", stream=True, store=True, handoff_execution="server") with res as event_stream: for event in event_stream: diff --git a/docs/sdks/files/README.md b/docs/sdks/files/README.md index befa4d67..bc39f2e4 100644 --- a/docs/sdks/files/README.md +++ b/docs/sdks/files/README.md @@ -76,7 +76,7 @@ with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: - res = mistral.files.list() + res = mistral.files.list(page=0, page_size=100) # Handle response print(res) @@ -120,7 +120,7 @@ with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: - res = mistral.files.retrieve(file_id="") + res = mistral.files.retrieve(file_id="f2a27685-ca4e-4dc2-9f2b-88c422c3e0f6") # Handle response print(res) @@ -159,7 +159,7 @@ with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: - res = mistral.files.delete(file_id="") + res = mistral.files.delete(file_id="3b6d45eb-e30b-416f-8019-f47e2e93d930") # Handle response print(res) @@ -198,7 +198,7 @@ with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: - res = mistral.files.download(file_id="") + res = mistral.files.download(file_id="f8919994-a4a1-46b2-8b5b-06335a4300ce") # Handle response print(res) @@ -237,7 +237,7 @@ with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: - res = mistral.files.get_signed_url(file_id="") + res = mistral.files.get_signed_url(file_id="06a020ab-355c-49a6-b19d-304b7c01699f", expiry=24) # Handle response print(res) diff --git a/docs/sdks/fim/README.md b/docs/sdks/fim/README.md index c70b3da4..10e6255d 100644 --- a/docs/sdks/fim/README.md +++ b/docs/sdks/fim/README.md @@ -25,7 +25,7 @@ with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: - res = mistral.fim.complete(model="codestral-2405", prompt="def", suffix="return a+b") + res = mistral.fim.complete(model="codestral-2405", prompt="def", top_p=1, stream=False, suffix="return a+b") # Handle response print(res) @@ -74,7 +74,7 @@ with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: - res = mistral.fim.stream(model="codestral-2405", prompt="def", suffix="return a+b") + res = mistral.fim.stream(model="codestral-2405", prompt="def", top_p=1, stream=True, suffix="return a+b") with res as event_stream: for event in event_stream: diff --git a/docs/sdks/jobs/README.md b/docs/sdks/jobs/README.md index 75d3b57d..1e240c33 100644 --- a/docs/sdks/jobs/README.md +++ b/docs/sdks/jobs/README.md @@ -26,7 +26,7 @@ with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: - res = mistral.fine_tuning.jobs.list() + res = mistral.fine_tuning.jobs.list(page=0, page_size=100, created_by_me=False) # Handle response print(res) @@ -74,9 +74,9 @@ with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: - res = mistral.fine_tuning.jobs.create(model="Fiesta", hyperparameters={ + res = mistral.fine_tuning.jobs.create(model="Camaro", hyperparameters={ "learning_rate": 0.0001, - }) + }, invalid_sample_skip_percentage=0) # Handle response print(res) @@ -125,7 +125,7 @@ with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: - res = mistral.fine_tuning.jobs.get(job_id="b888f774-3e7c-4135-a18c-6b985523c4bc") + res = mistral.fine_tuning.jobs.get(job_id="c167a961-ffca-4bcf-93ac-6169468dd389") # Handle response print(res) @@ -164,7 +164,7 @@ with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: - res = mistral.fine_tuning.jobs.cancel(job_id="0f713502-9233-41c6-9ebd-c570b7edb496") + res = mistral.fine_tuning.jobs.cancel(job_id="6188a2f6-7513-4e0f-89cc-3f8088523a49") # Handle response print(res) @@ -203,7 +203,7 @@ with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: - res = mistral.fine_tuning.jobs.start(job_id="0bf0f9e6-c3e5-4d61-aac8-0e36dcac0dfc") + res = mistral.fine_tuning.jobs.start(job_id="56553e4d-0679-471e-b9ac-59a77d671103") # Handle response print(res) diff --git a/docs/sdks/mistralagents/README.md b/docs/sdks/mistralagents/README.md index 496016c3..58082d21 100644 --- a/docs/sdks/mistralagents/README.md +++ b/docs/sdks/mistralagents/README.md @@ -28,7 +28,7 @@ with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: - res = mistral.beta.agents.create(model="Fiesta", name="") + res = mistral.beta.agents.create(model="LeBaron", name="") # Handle response print(res) @@ -74,7 +74,7 @@ with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: - res = mistral.beta.agents.list() + res = mistral.beta.agents.list(page=0, page_size=20) # Handle response print(res) @@ -202,7 +202,7 @@ with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: - res = mistral.beta.agents.update_version(agent_id="", version=193920) + res = mistral.beta.agents.update_version(agent_id="", version=157995) # Handle response print(res) diff --git a/docs/sdks/mistraljobs/README.md b/docs/sdks/mistraljobs/README.md index e2dac8b4..0c0b5991 100644 --- a/docs/sdks/mistraljobs/README.md +++ b/docs/sdks/mistraljobs/README.md @@ -25,7 +25,7 @@ with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: - res = mistral.batch.jobs.list() + res = mistral.batch.jobs.list(page=0, page_size=100, created_by_me=False) # Handle response print(res) @@ -71,8 +71,8 @@ with Mistral( ) as mistral: res = mistral.batch.jobs.create(input_files=[ - "a621cf02-1cd9-4cf5-8403-315211a509a3", - ], endpoint="/v1/fim/completions", model="2") + "fe3343a2-3b8d-404b-ba32-a78dede2614a", + ], endpoint="/v1/moderations", model="Altima", timeout_hours=24) # Handle response print(res) @@ -115,7 +115,7 @@ with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: - res = mistral.batch.jobs.get(job_id="b888f774-3e7c-4135-a18c-6b985523c4bc") + res = mistral.batch.jobs.get(job_id="4017dc9f-b629-42f4-9700-8c681b9e7f0f") # Handle response print(res) @@ -154,7 +154,7 @@ with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: - res = mistral.batch.jobs.cancel(job_id="0f713502-9233-41c6-9ebd-c570b7edb496") + res = mistral.batch.jobs.cancel(job_id="4fb29d1c-535b-4f0a-a1cb-2167f86da569") # Handle response print(res) diff --git a/docs/sdks/ocr/README.md b/docs/sdks/ocr/README.md index 60d987b4..2188f378 100644 --- a/docs/sdks/ocr/README.md +++ b/docs/sdks/ocr/README.md @@ -24,9 +24,11 @@ with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: - res = mistral.ocr.process(model="Focus", document={ - "document_url": "https://dutiful-horst.org", - "type": "document_url", + res = mistral.ocr.process(model="CX-9", document={ + "image_url": { + "url": "https://measly-scrap.com", + }, + "type": "image_url", }) # Handle response diff --git a/pyproject.toml b/pyproject.toml index c7cb9095..f8cf20a9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "mistralai" -version = "1.8.2" +version = "1.9.0" description = "Python Client SDK for the Mistral AI API." authors = [{ name = "Mistral" },] readme = "README-PYPI.md" diff --git a/src/mistralai/_hooks/types.py b/src/mistralai/_hooks/types.py index ebc789ff..6d0f3e11 100644 --- a/src/mistralai/_hooks/types.py +++ b/src/mistralai/_hooks/types.py @@ -3,10 +3,12 @@ from abc import ABC, abstractmethod import httpx from mistralai.httpclient import HttpClient +from mistralai.sdkconfiguration import SDKConfiguration from typing import Any, Callable, List, Optional, Tuple, Union class HookContext: + config: SDKConfiguration base_url: str operation_id: str oauth2_scopes: Optional[List[str]] = None @@ -14,11 +16,13 @@ class HookContext: def __init__( self, + config: SDKConfiguration, base_url: str, operation_id: str, oauth2_scopes: Optional[List[str]], security_source: Optional[Union[Any, Callable[[], Any]]], ): + self.config = config self.base_url = base_url self.operation_id = operation_id self.oauth2_scopes = oauth2_scopes @@ -28,6 +32,7 @@ def __init__( class BeforeRequestContext(HookContext): def __init__(self, hook_ctx: HookContext): super().__init__( + hook_ctx.config, hook_ctx.base_url, hook_ctx.operation_id, hook_ctx.oauth2_scopes, @@ -38,6 +43,7 @@ def __init__(self, hook_ctx: HookContext): class AfterSuccessContext(HookContext): def __init__(self, hook_ctx: HookContext): super().__init__( + hook_ctx.config, hook_ctx.base_url, hook_ctx.operation_id, hook_ctx.oauth2_scopes, @@ -48,6 +54,7 @@ def __init__(self, hook_ctx: HookContext): class AfterErrorContext(HookContext): def __init__(self, hook_ctx: HookContext): super().__init__( + hook_ctx.config, hook_ctx.base_url, hook_ctx.operation_id, hook_ctx.oauth2_scopes, diff --git a/src/mistralai/_version.py b/src/mistralai/_version.py index fc416fd3..db4f08fe 100644 --- a/src/mistralai/_version.py +++ b/src/mistralai/_version.py @@ -3,10 +3,10 @@ import importlib.metadata __title__: str = "mistralai" -__version__: str = "1.8.2" +__version__: str = "1.9.0" __openapi_doc_version__: str = "1.0.0" -__gen_version__: str = "2.548.6" -__user_agent__: str = "speakeasy-sdk/python 1.8.2 2.548.6 1.0.0 mistralai" +__gen_version__: str = "2.634.2" +__user_agent__: str = "speakeasy-sdk/python 1.9.0 2.634.2 1.0.0 mistralai" try: if __package__ is not None: diff --git a/src/mistralai/agents.py b/src/mistralai/agents.py index 4fbb25dd..febc3383 100644 --- a/src/mistralai/agents.py +++ b/src/mistralai/agents.py @@ -140,6 +140,7 @@ def complete( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="agents_completion_v1_agents_completions_post", oauth2_scopes=[], @@ -309,6 +310,7 @@ async def complete_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="agents_completion_v1_agents_completions_post", oauth2_scopes=[], @@ -480,6 +482,7 @@ def stream( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="stream_agents", oauth2_scopes=[], @@ -657,6 +660,7 @@ async def stream_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="stream_agents", oauth2_scopes=[], diff --git a/src/mistralai/basesdk.py b/src/mistralai/basesdk.py index 512e3072..bb37a1ee 100644 --- a/src/mistralai/basesdk.py +++ b/src/mistralai/basesdk.py @@ -218,12 +218,12 @@ def do_request( client = self.sdk_configuration.client logger = self.sdk_configuration.debug_logger + hooks = self.sdk_configuration.__dict__["_hooks"] + def do(): http_res = None try: - req = self.sdk_configuration.get_hooks().before_request( - BeforeRequestContext(hook_ctx), request - ) + req = hooks.before_request(BeforeRequestContext(hook_ctx), request) logger.debug( "Request:\nMethod: %s\nURL: %s\nHeaders: %s\nBody: %s", req.method, @@ -237,9 +237,7 @@ def do(): http_res = client.send(req, stream=stream) except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error( - AfterErrorContext(hook_ctx), None, e - ) + _, e = hooks.after_error(AfterErrorContext(hook_ctx), None, e) if e is not None: logger.debug("Request Exception", exc_info=True) raise e @@ -257,7 +255,7 @@ def do(): ) if utils.match_status_codes(error_status_codes, http_res.status_code): - result, err = self.sdk_configuration.get_hooks().after_error( + result, err = hooks.after_error( AfterErrorContext(hook_ctx), http_res, None ) if err is not None: @@ -277,9 +275,7 @@ def do(): http_res = do() if not utils.match_status_codes(error_status_codes, http_res.status_code): - http_res = self.sdk_configuration.get_hooks().after_success( - AfterSuccessContext(hook_ctx), http_res - ) + http_res = hooks.after_success(AfterSuccessContext(hook_ctx), http_res) return http_res @@ -294,12 +290,12 @@ async def do_request_async( client = self.sdk_configuration.async_client logger = self.sdk_configuration.debug_logger + hooks = self.sdk_configuration.__dict__["_hooks"] + async def do(): http_res = None try: - req = self.sdk_configuration.get_hooks().before_request( - BeforeRequestContext(hook_ctx), request - ) + req = hooks.before_request(BeforeRequestContext(hook_ctx), request) logger.debug( "Request:\nMethod: %s\nURL: %s\nHeaders: %s\nBody: %s", req.method, @@ -313,9 +309,7 @@ async def do(): http_res = await client.send(req, stream=stream) except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error( - AfterErrorContext(hook_ctx), None, e - ) + _, e = hooks.after_error(AfterErrorContext(hook_ctx), None, e) if e is not None: logger.debug("Request Exception", exc_info=True) raise e @@ -333,7 +327,7 @@ async def do(): ) if utils.match_status_codes(error_status_codes, http_res.status_code): - result, err = self.sdk_configuration.get_hooks().after_error( + result, err = hooks.after_error( AfterErrorContext(hook_ctx), http_res, None ) if err is not None: @@ -355,8 +349,6 @@ async def do(): http_res = await do() if not utils.match_status_codes(error_status_codes, http_res.status_code): - http_res = self.sdk_configuration.get_hooks().after_success( - AfterSuccessContext(hook_ctx), http_res - ) + http_res = hooks.after_success(AfterSuccessContext(hook_ctx), http_res) return http_res diff --git a/src/mistralai/chat.py b/src/mistralai/chat.py index 96fcf65d..8556c5a0 100644 --- a/src/mistralai/chat.py +++ b/src/mistralai/chat.py @@ -221,6 +221,7 @@ def complete( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="chat_completion_v1_chat_completions_post", oauth2_scopes=[], @@ -389,6 +390,7 @@ async def complete_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="chat_completion_v1_chat_completions_post", oauth2_scopes=[], @@ -569,6 +571,7 @@ def stream( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="stream_chat", oauth2_scopes=[], @@ -755,6 +758,7 @@ async def stream_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="stream_chat", oauth2_scopes=[], diff --git a/src/mistralai/classifiers.py b/src/mistralai/classifiers.py index e5b46f5d..6ebf7834 100644 --- a/src/mistralai/classifiers.py +++ b/src/mistralai/classifiers.py @@ -77,6 +77,7 @@ def moderate( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="moderations_v1_moderations_post", oauth2_scopes=[], @@ -183,6 +184,7 @@ async def moderate_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="moderations_v1_moderations_post", oauth2_scopes=[], @@ -289,6 +291,7 @@ def moderate_chat( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="chat_moderations_v1_chat_moderations_post", oauth2_scopes=[], @@ -395,6 +398,7 @@ async def moderate_chat_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="chat_moderations_v1_chat_moderations_post", oauth2_scopes=[], @@ -501,6 +505,7 @@ def classify( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="classifications_v1_classifications_post", oauth2_scopes=[], @@ -607,6 +612,7 @@ async def classify_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="classifications_v1_classifications_post", oauth2_scopes=[], @@ -710,6 +716,7 @@ def classify_chat( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="chat_classifications_v1_chat_classifications_post", oauth2_scopes=[], @@ -813,6 +820,7 @@ async def classify_chat_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="chat_classifications_v1_chat_classifications_post", oauth2_scopes=[], diff --git a/src/mistralai/conversations.py b/src/mistralai/conversations.py index 6ef02edd..f8b6ec2c 100644 --- a/src/mistralai/conversations.py +++ b/src/mistralai/conversations.py @@ -313,6 +313,7 @@ def start( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="agents_api_v1_conversations_start", oauth2_scopes=[], @@ -451,6 +452,7 @@ async def start_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="agents_api_v1_conversations_start", oauth2_scopes=[], @@ -553,6 +555,7 @@ def list( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="agents_api_v1_conversations_list", oauth2_scopes=[], @@ -655,6 +658,7 @@ async def list_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="agents_api_v1_conversations_list", oauth2_scopes=[], @@ -754,6 +758,7 @@ def get( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="agents_api_v1_conversations_get", oauth2_scopes=[], @@ -856,6 +861,7 @@ async def get_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="agents_api_v1_conversations_get", oauth2_scopes=[], @@ -988,6 +994,7 @@ def append( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="agents_api_v1_conversations_append", oauth2_scopes=[], @@ -1117,6 +1124,7 @@ async def append_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="agents_api_v1_conversations_append", oauth2_scopes=[], @@ -1216,6 +1224,7 @@ def get_history( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="agents_api_v1_conversations_history", oauth2_scopes=[], @@ -1315,6 +1324,7 @@ async def get_history_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="agents_api_v1_conversations_history", oauth2_scopes=[], @@ -1414,6 +1424,7 @@ def get_messages( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="agents_api_v1_conversations_messages", oauth2_scopes=[], @@ -1513,6 +1524,7 @@ async def get_messages_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="agents_api_v1_conversations_messages", oauth2_scopes=[], @@ -1645,6 +1657,7 @@ def restart( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="agents_api_v1_conversations_restart", oauth2_scopes=[], @@ -1777,6 +1790,7 @@ async def restart_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="agents_api_v1_conversations_restart", oauth2_scopes=[], @@ -1922,6 +1936,7 @@ def start_stream( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="agents_api_v1_conversations_start_stream", oauth2_scopes=[], @@ -2072,6 +2087,7 @@ async def start_stream_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="agents_api_v1_conversations_start_stream", oauth2_scopes=[], @@ -2206,6 +2222,7 @@ def append_stream( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="agents_api_v1_conversations_append_stream", oauth2_scopes=[], @@ -2340,6 +2357,7 @@ async def append_stream_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="agents_api_v1_conversations_append_stream", oauth2_scopes=[], @@ -2477,6 +2495,7 @@ def restart_stream( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="agents_api_v1_conversations_restart_stream", oauth2_scopes=[], @@ -2614,6 +2633,7 @@ async def restart_stream_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="agents_api_v1_conversations_restart_stream", oauth2_scopes=[], diff --git a/src/mistralai/embeddings.py b/src/mistralai/embeddings.py index fee30251..ef0699d1 100644 --- a/src/mistralai/embeddings.py +++ b/src/mistralai/embeddings.py @@ -84,6 +84,7 @@ def create( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="embeddings_v1_embeddings_post", oauth2_scopes=[], @@ -197,6 +198,7 @@ async def create_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="embeddings_v1_embeddings_post", oauth2_scopes=[], diff --git a/src/mistralai/files.py b/src/mistralai/files.py index 0ffc4857..39f65dd4 100644 --- a/src/mistralai/files.py +++ b/src/mistralai/files.py @@ -85,6 +85,7 @@ def upload( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="files_api_routes_upload_file", oauth2_scopes=[], @@ -192,6 +193,7 @@ async def upload_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="files_api_routes_upload_file", oauth2_scopes=[], @@ -300,6 +302,7 @@ def list( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="files_api_routes_list_files", oauth2_scopes=[], @@ -408,6 +411,7 @@ async def list_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="files_api_routes_list_files", oauth2_scopes=[], @@ -501,6 +505,7 @@ def retrieve( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="files_api_routes_retrieve_file", oauth2_scopes=[], @@ -594,6 +599,7 @@ async def retrieve_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="files_api_routes_retrieve_file", oauth2_scopes=[], @@ -687,6 +693,7 @@ def delete( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="files_api_routes_delete_file", oauth2_scopes=[], @@ -780,6 +787,7 @@ async def delete_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="files_api_routes_delete_file", oauth2_scopes=[], @@ -873,6 +881,7 @@ def download( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="files_api_routes_download_file", oauth2_scopes=[], @@ -967,6 +976,7 @@ async def download_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="files_api_routes_download_file", oauth2_scopes=[], @@ -1062,6 +1072,7 @@ def get_signed_url( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="files_api_routes_get_signed_url", oauth2_scopes=[], @@ -1156,6 +1167,7 @@ async def get_signed_url_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="files_api_routes_get_signed_url", oauth2_scopes=[], diff --git a/src/mistralai/fim.py b/src/mistralai/fim.py index 032c722f..c57bc68e 100644 --- a/src/mistralai/fim.py +++ b/src/mistralai/fim.py @@ -105,6 +105,7 @@ def complete( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="fim_completion_v1_fim_completions_post", oauth2_scopes=[], @@ -239,6 +240,7 @@ async def complete_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="fim_completion_v1_fim_completions_post", oauth2_scopes=[], @@ -373,6 +375,7 @@ def stream( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="stream_fim", oauth2_scopes=[], @@ -513,6 +516,7 @@ async def stream_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="stream_fim", oauth2_scopes=[], diff --git a/src/mistralai/httpclient.py b/src/mistralai/httpclient.py index 1e426352..47b052cb 100644 --- a/src/mistralai/httpclient.py +++ b/src/mistralai/httpclient.py @@ -2,7 +2,6 @@ # pyright: reportReturnType = false import asyncio -from concurrent.futures import ThreadPoolExecutor from typing_extensions import Protocol, runtime_checkable import httpx from typing import Any, Optional, Union @@ -116,21 +115,12 @@ def close_clients( pass if async_client is not None and not async_client_supplied: - is_async = False try: - asyncio.get_running_loop() - is_async = True + loop = asyncio.get_running_loop() + asyncio.run_coroutine_threadsafe(async_client.aclose(), loop) except RuntimeError: - pass - - try: - # If this function is called in an async loop then start another - # loop in a separate thread to close the async http client. - if is_async: - with ThreadPoolExecutor(max_workers=1) as executor: - future = executor.submit(asyncio.run, async_client.aclose()) - future.result() - else: + try: asyncio.run(async_client.aclose()) - except Exception: - pass + except RuntimeError: + # best effort + pass diff --git a/src/mistralai/jobs.py b/src/mistralai/jobs.py index 76d9f41a..020c40f0 100644 --- a/src/mistralai/jobs.py +++ b/src/mistralai/jobs.py @@ -96,6 +96,7 @@ def list( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="jobs_api_routes_fine_tuning_get_fine_tuning_jobs", oauth2_scopes=[], @@ -216,6 +217,7 @@ async def list_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="jobs_api_routes_fine_tuning_get_fine_tuning_jobs", oauth2_scopes=[], @@ -367,6 +369,7 @@ def create( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="jobs_api_routes_fine_tuning_create_fine_tuning_job", oauth2_scopes=[], @@ -520,6 +523,7 @@ async def create_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="jobs_api_routes_fine_tuning_create_fine_tuning_job", oauth2_scopes=[], @@ -615,6 +619,7 @@ def get( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="jobs_api_routes_fine_tuning_get_fine_tuning_job", oauth2_scopes=[], @@ -710,6 +715,7 @@ async def get_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="jobs_api_routes_fine_tuning_get_fine_tuning_job", oauth2_scopes=[], @@ -805,6 +811,7 @@ def cancel( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="jobs_api_routes_fine_tuning_cancel_fine_tuning_job", oauth2_scopes=[], @@ -900,6 +907,7 @@ async def cancel_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="jobs_api_routes_fine_tuning_cancel_fine_tuning_job", oauth2_scopes=[], @@ -995,6 +1003,7 @@ def start( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="jobs_api_routes_fine_tuning_start_fine_tuning_job", oauth2_scopes=[], @@ -1090,6 +1099,7 @@ async def start_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="jobs_api_routes_fine_tuning_start_fine_tuning_job", oauth2_scopes=[], diff --git a/src/mistralai/mistral_agents.py b/src/mistralai/mistral_agents.py index a22ce41d..f0d4be01 100644 --- a/src/mistralai/mistral_agents.py +++ b/src/mistralai/mistral_agents.py @@ -102,6 +102,7 @@ def create( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="agents_api_v1_agents_create", oauth2_scopes=[], @@ -233,6 +234,7 @@ async def create_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="agents_api_v1_agents_create", oauth2_scopes=[], @@ -335,6 +337,7 @@ def list( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="agents_api_v1_agents_list", oauth2_scopes=[], @@ -437,6 +440,7 @@ async def list_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="agents_api_v1_agents_list", oauth2_scopes=[], @@ -536,6 +540,7 @@ def get( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="agents_api_v1_agents_get", oauth2_scopes=[], @@ -635,6 +640,7 @@ async def get_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="agents_api_v1_agents_get", oauth2_scopes=[], @@ -775,6 +781,7 @@ def update( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="agents_api_v1_agents_update", oauth2_scopes=[], @@ -915,6 +922,7 @@ async def update_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="agents_api_v1_agents_update", oauth2_scopes=[], @@ -1017,6 +1025,7 @@ def update_version( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="agents_api_v1_agents_update_version", oauth2_scopes=[], @@ -1119,6 +1128,7 @@ async def update_version_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="agents_api_v1_agents_update_version", oauth2_scopes=[], diff --git a/src/mistralai/mistral_jobs.py b/src/mistralai/mistral_jobs.py index 32a40aa7..b824508a 100644 --- a/src/mistralai/mistral_jobs.py +++ b/src/mistralai/mistral_jobs.py @@ -87,6 +87,7 @@ def list( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="jobs_api_routes_batch_get_batch_jobs", oauth2_scopes=[], @@ -198,6 +199,7 @@ async def list_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="jobs_api_routes_batch_get_batch_jobs", oauth2_scopes=[], @@ -306,6 +308,7 @@ def create( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="jobs_api_routes_batch_create_batch_job", oauth2_scopes=[], @@ -414,6 +417,7 @@ async def create_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="jobs_api_routes_batch_create_batch_job", oauth2_scopes=[], @@ -507,6 +511,7 @@ def get( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="jobs_api_routes_batch_get_batch_job", oauth2_scopes=[], @@ -600,6 +605,7 @@ async def get_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="jobs_api_routes_batch_get_batch_job", oauth2_scopes=[], @@ -693,6 +699,7 @@ def cancel( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="jobs_api_routes_batch_cancel_batch_job", oauth2_scopes=[], @@ -786,6 +793,7 @@ async def cancel_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="jobs_api_routes_batch_cancel_batch_job", oauth2_scopes=[], diff --git a/src/mistralai/models/__init__.py b/src/mistralai/models/__init__.py index e6493e90..1b7b9c6c 100644 --- a/src/mistralai/models/__init__.py +++ b/src/mistralai/models/__init__.py @@ -1,727 +1,754 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" -from .agent import Agent, AgentObject, AgentTools, AgentToolsTypedDict, AgentTypedDict -from .agentconversation import ( - AgentConversation, - AgentConversationObject, - AgentConversationTypedDict, -) -from .agentcreationrequest import ( - AgentCreationRequest, - AgentCreationRequestTools, - AgentCreationRequestToolsTypedDict, - AgentCreationRequestTypedDict, -) -from .agenthandoffdoneevent import ( - AgentHandoffDoneEvent, - AgentHandoffDoneEventType, - AgentHandoffDoneEventTypedDict, -) -from .agenthandoffentry import ( - AgentHandoffEntry, - AgentHandoffEntryObject, - AgentHandoffEntryType, - AgentHandoffEntryTypedDict, -) -from .agenthandoffstartedevent import ( - AgentHandoffStartedEvent, - AgentHandoffStartedEventType, - AgentHandoffStartedEventTypedDict, -) -from .agents_api_v1_agents_getop import ( - AgentsAPIV1AgentsGetRequest, - AgentsAPIV1AgentsGetRequestTypedDict, -) -from .agents_api_v1_agents_listop import ( - AgentsAPIV1AgentsListRequest, - AgentsAPIV1AgentsListRequestTypedDict, -) -from .agents_api_v1_agents_update_versionop import ( - AgentsAPIV1AgentsUpdateVersionRequest, - AgentsAPIV1AgentsUpdateVersionRequestTypedDict, -) -from .agents_api_v1_agents_updateop import ( - AgentsAPIV1AgentsUpdateRequest, - AgentsAPIV1AgentsUpdateRequestTypedDict, -) -from .agents_api_v1_conversations_append_streamop import ( - AgentsAPIV1ConversationsAppendStreamRequest, - AgentsAPIV1ConversationsAppendStreamRequestTypedDict, -) -from .agents_api_v1_conversations_appendop import ( - AgentsAPIV1ConversationsAppendRequest, - AgentsAPIV1ConversationsAppendRequestTypedDict, -) -from .agents_api_v1_conversations_getop import ( - AgentsAPIV1ConversationsGetRequest, - AgentsAPIV1ConversationsGetRequestTypedDict, - AgentsAPIV1ConversationsGetResponseV1ConversationsGet, - AgentsAPIV1ConversationsGetResponseV1ConversationsGetTypedDict, -) -from .agents_api_v1_conversations_historyop import ( - AgentsAPIV1ConversationsHistoryRequest, - AgentsAPIV1ConversationsHistoryRequestTypedDict, -) -from .agents_api_v1_conversations_listop import ( - AgentsAPIV1ConversationsListRequest, - AgentsAPIV1ConversationsListRequestTypedDict, - ResponseBody, - ResponseBodyTypedDict, -) -from .agents_api_v1_conversations_messagesop import ( - AgentsAPIV1ConversationsMessagesRequest, - AgentsAPIV1ConversationsMessagesRequestTypedDict, -) -from .agents_api_v1_conversations_restart_streamop import ( - AgentsAPIV1ConversationsRestartStreamRequest, - AgentsAPIV1ConversationsRestartStreamRequestTypedDict, -) -from .agents_api_v1_conversations_restartop import ( - AgentsAPIV1ConversationsRestartRequest, - AgentsAPIV1ConversationsRestartRequestTypedDict, -) -from .agentscompletionrequest import ( - AgentsCompletionRequest, - AgentsCompletionRequestMessages, - AgentsCompletionRequestMessagesTypedDict, - AgentsCompletionRequestStop, - AgentsCompletionRequestStopTypedDict, - AgentsCompletionRequestToolChoice, - AgentsCompletionRequestToolChoiceTypedDict, - AgentsCompletionRequestTypedDict, -) -from .agentscompletionstreamrequest import ( - AgentsCompletionStreamRequest, - AgentsCompletionStreamRequestMessages, - AgentsCompletionStreamRequestMessagesTypedDict, - AgentsCompletionStreamRequestStop, - AgentsCompletionStreamRequestStopTypedDict, - AgentsCompletionStreamRequestToolChoice, - AgentsCompletionStreamRequestToolChoiceTypedDict, - AgentsCompletionStreamRequestTypedDict, -) -from .agentupdaterequest import ( - AgentUpdateRequest, - AgentUpdateRequestTools, - AgentUpdateRequestToolsTypedDict, - AgentUpdateRequestTypedDict, -) -from .apiendpoint import APIEndpoint -from .archiveftmodelout import ( - ArchiveFTModelOut, - ArchiveFTModelOutObject, - ArchiveFTModelOutTypedDict, -) -from .assistantmessage import ( - AssistantMessage, - AssistantMessageContent, - AssistantMessageContentTypedDict, - AssistantMessageRole, - AssistantMessageTypedDict, -) -from .basemodelcard import BaseModelCard, BaseModelCardTypedDict, Type -from .batcherror import BatchError, BatchErrorTypedDict -from .batchjobin import BatchJobIn, BatchJobInTypedDict -from .batchjobout import BatchJobOut, BatchJobOutObject, BatchJobOutTypedDict -from .batchjobsout import BatchJobsOut, BatchJobsOutObject, BatchJobsOutTypedDict -from .batchjobstatus import BatchJobStatus -from .builtinconnectors import BuiltInConnectors -from .chatclassificationrequest import ( - ChatClassificationRequest, - ChatClassificationRequestTypedDict, -) -from .chatcompletionchoice import ( - ChatCompletionChoice, - ChatCompletionChoiceTypedDict, - FinishReason, -) -from .chatcompletionrequest import ( - ChatCompletionRequest, - ChatCompletionRequestToolChoice, - ChatCompletionRequestToolChoiceTypedDict, - ChatCompletionRequestTypedDict, - Messages, - MessagesTypedDict, - Stop, - StopTypedDict, -) -from .chatcompletionresponse import ( - ChatCompletionResponse, - ChatCompletionResponseTypedDict, -) -from .chatcompletionstreamrequest import ( - ChatCompletionStreamRequest, - ChatCompletionStreamRequestMessages, - ChatCompletionStreamRequestMessagesTypedDict, - ChatCompletionStreamRequestStop, - ChatCompletionStreamRequestStopTypedDict, - ChatCompletionStreamRequestToolChoice, - ChatCompletionStreamRequestToolChoiceTypedDict, - ChatCompletionStreamRequestTypedDict, -) -from .chatmoderationrequest import ( - ChatModerationRequest, - ChatModerationRequestInputs, - ChatModerationRequestInputsTypedDict, - ChatModerationRequestTypedDict, - One, - OneTypedDict, - Two, - TwoTypedDict, -) -from .checkpointout import CheckpointOut, CheckpointOutTypedDict -from .classificationrequest import ( - ClassificationRequest, - ClassificationRequestInputs, - ClassificationRequestInputsTypedDict, - ClassificationRequestTypedDict, -) -from .classificationresponse import ( - ClassificationResponse, - ClassificationResponseTypedDict, -) -from .classificationtargetresult import ( - ClassificationTargetResult, - ClassificationTargetResultTypedDict, -) -from .classifierdetailedjobout import ( - ClassifierDetailedJobOut, - ClassifierDetailedJobOutIntegrations, - ClassifierDetailedJobOutIntegrationsTypedDict, - ClassifierDetailedJobOutJobType, - ClassifierDetailedJobOutObject, - ClassifierDetailedJobOutStatus, - ClassifierDetailedJobOutTypedDict, -) -from .classifierftmodelout import ( - ClassifierFTModelOut, - ClassifierFTModelOutModelType, - ClassifierFTModelOutObject, - ClassifierFTModelOutTypedDict, -) -from .classifierjobout import ( - ClassifierJobOut, - ClassifierJobOutIntegrations, - ClassifierJobOutIntegrationsTypedDict, - ClassifierJobOutJobType, - ClassifierJobOutObject, - ClassifierJobOutStatus, - ClassifierJobOutTypedDict, -) -from .classifiertargetin import ClassifierTargetIn, ClassifierTargetInTypedDict -from .classifiertargetout import ClassifierTargetOut, ClassifierTargetOutTypedDict -from .classifiertrainingparameters import ( - ClassifierTrainingParameters, - ClassifierTrainingParametersTypedDict, -) -from .classifiertrainingparametersin import ( - ClassifierTrainingParametersIn, - ClassifierTrainingParametersInTypedDict, -) -from .codeinterpretertool import ( - CodeInterpreterTool, - CodeInterpreterToolType, - CodeInterpreterToolTypedDict, -) -from .completionargs import CompletionArgs, CompletionArgsTypedDict -from .completionargsstop import CompletionArgsStop, CompletionArgsStopTypedDict -from .completionchunk import CompletionChunk, CompletionChunkTypedDict -from .completiondetailedjobout import ( - CompletionDetailedJobOut, - CompletionDetailedJobOutIntegrations, - CompletionDetailedJobOutIntegrationsTypedDict, - CompletionDetailedJobOutJobType, - CompletionDetailedJobOutObject, - CompletionDetailedJobOutRepositories, - CompletionDetailedJobOutRepositoriesTypedDict, - CompletionDetailedJobOutStatus, - CompletionDetailedJobOutTypedDict, -) -from .completionevent import CompletionEvent, CompletionEventTypedDict -from .completionftmodelout import ( - CompletionFTModelOut, - CompletionFTModelOutObject, - CompletionFTModelOutTypedDict, - ModelType, -) -from .completionjobout import ( - CompletionJobOut, - CompletionJobOutObject, - CompletionJobOutTypedDict, - Integrations, - IntegrationsTypedDict, - JobType, - Repositories, - RepositoriesTypedDict, - Status, -) -from .completionresponsestreamchoice import ( - CompletionResponseStreamChoice, - CompletionResponseStreamChoiceFinishReason, - CompletionResponseStreamChoiceTypedDict, -) -from .completiontrainingparameters import ( - CompletionTrainingParameters, - CompletionTrainingParametersTypedDict, -) -from .completiontrainingparametersin import ( - CompletionTrainingParametersIn, - CompletionTrainingParametersInTypedDict, -) -from .contentchunk import ContentChunk, ContentChunkTypedDict -from .conversationappendrequest import ( - ConversationAppendRequest, - ConversationAppendRequestHandoffExecution, - ConversationAppendRequestTypedDict, -) -from .conversationappendstreamrequest import ( - ConversationAppendStreamRequest, - ConversationAppendStreamRequestHandoffExecution, - ConversationAppendStreamRequestTypedDict, -) -from .conversationevents import ( - ConversationEvents, - ConversationEventsData, - ConversationEventsDataTypedDict, - ConversationEventsTypedDict, -) -from .conversationhistory import ( - ConversationHistory, - ConversationHistoryObject, - ConversationHistoryTypedDict, - Entries, - EntriesTypedDict, -) -from .conversationinputs import ConversationInputs, ConversationInputsTypedDict -from .conversationmessages import ( - ConversationMessages, - ConversationMessagesObject, - ConversationMessagesTypedDict, -) -from .conversationrequest import ( - ConversationRequest, - ConversationRequestTypedDict, - HandoffExecution, - Tools, - ToolsTypedDict, -) -from .conversationresponse import ( - ConversationResponse, - ConversationResponseObject, - ConversationResponseTypedDict, - Outputs, - OutputsTypedDict, -) -from .conversationrestartrequest import ( - ConversationRestartRequest, - ConversationRestartRequestHandoffExecution, - ConversationRestartRequestTypedDict, -) -from .conversationrestartstreamrequest import ( - ConversationRestartStreamRequest, - ConversationRestartStreamRequestHandoffExecution, - ConversationRestartStreamRequestTypedDict, -) -from .conversationstreamrequest import ( - ConversationStreamRequest, - ConversationStreamRequestHandoffExecution, - ConversationStreamRequestTools, - ConversationStreamRequestToolsTypedDict, - ConversationStreamRequestTypedDict, -) -from .conversationusageinfo import ConversationUsageInfo, ConversationUsageInfoTypedDict -from .delete_model_v1_models_model_id_deleteop import ( - DeleteModelV1ModelsModelIDDeleteRequest, - DeleteModelV1ModelsModelIDDeleteRequestTypedDict, -) -from .deletefileout import DeleteFileOut, DeleteFileOutTypedDict -from .deletemodelout import DeleteModelOut, DeleteModelOutTypedDict -from .deltamessage import Content, ContentTypedDict, DeltaMessage, DeltaMessageTypedDict -from .documentlibrarytool import ( - DocumentLibraryTool, - DocumentLibraryToolType, - DocumentLibraryToolTypedDict, -) -from .documenturlchunk import ( - DocumentURLChunk, - DocumentURLChunkType, - DocumentURLChunkTypedDict, -) -from .embeddingdtype import EmbeddingDtype -from .embeddingrequest import ( - EmbeddingRequest, - EmbeddingRequestInputs, - EmbeddingRequestInputsTypedDict, - EmbeddingRequestTypedDict, -) -from .embeddingresponse import EmbeddingResponse, EmbeddingResponseTypedDict -from .embeddingresponsedata import EmbeddingResponseData, EmbeddingResponseDataTypedDict -from .eventout import EventOut, EventOutTypedDict -from .filepurpose import FilePurpose -from .files_api_routes_delete_fileop import ( - FilesAPIRoutesDeleteFileRequest, - FilesAPIRoutesDeleteFileRequestTypedDict, -) -from .files_api_routes_download_fileop import ( - FilesAPIRoutesDownloadFileRequest, - FilesAPIRoutesDownloadFileRequestTypedDict, -) -from .files_api_routes_get_signed_urlop import ( - FilesAPIRoutesGetSignedURLRequest, - FilesAPIRoutesGetSignedURLRequestTypedDict, -) -from .files_api_routes_list_filesop import ( - FilesAPIRoutesListFilesRequest, - FilesAPIRoutesListFilesRequestTypedDict, -) -from .files_api_routes_retrieve_fileop import ( - FilesAPIRoutesRetrieveFileRequest, - FilesAPIRoutesRetrieveFileRequestTypedDict, -) -from .files_api_routes_upload_fileop import ( - File, - FileTypedDict, - FilesAPIRoutesUploadFileMultiPartBodyParams, - FilesAPIRoutesUploadFileMultiPartBodyParamsTypedDict, -) -from .fileschema import FileSchema, FileSchemaTypedDict -from .filesignedurl import FileSignedURL, FileSignedURLTypedDict -from .fimcompletionrequest import ( - FIMCompletionRequest, - FIMCompletionRequestStop, - FIMCompletionRequestStopTypedDict, - FIMCompletionRequestTypedDict, -) -from .fimcompletionresponse import FIMCompletionResponse, FIMCompletionResponseTypedDict -from .fimcompletionstreamrequest import ( - FIMCompletionStreamRequest, - FIMCompletionStreamRequestStop, - FIMCompletionStreamRequestStopTypedDict, - FIMCompletionStreamRequestTypedDict, -) -from .finetuneablemodeltype import FineTuneableModelType -from .ftclassifierlossfunction import FTClassifierLossFunction -from .ftmodelcapabilitiesout import ( - FTModelCapabilitiesOut, - FTModelCapabilitiesOutTypedDict, -) -from .ftmodelcard import FTModelCard, FTModelCardType, FTModelCardTypedDict -from .function import Function, FunctionTypedDict -from .functioncall import ( - Arguments, - ArgumentsTypedDict, - FunctionCall, - FunctionCallTypedDict, -) -from .functioncallentry import ( - FunctionCallEntry, - FunctionCallEntryObject, - FunctionCallEntryType, - FunctionCallEntryTypedDict, -) -from .functioncallentryarguments import ( - FunctionCallEntryArguments, - FunctionCallEntryArgumentsTypedDict, -) -from .functioncallevent import ( - FunctionCallEvent, - FunctionCallEventType, - FunctionCallEventTypedDict, -) -from .functionname import FunctionName, FunctionNameTypedDict -from .functionresultentry import ( - FunctionResultEntry, - FunctionResultEntryObject, - FunctionResultEntryType, - FunctionResultEntryTypedDict, -) -from .functiontool import FunctionTool, FunctionToolType, FunctionToolTypedDict -from .githubrepositoryin import ( - GithubRepositoryIn, - GithubRepositoryInType, - GithubRepositoryInTypedDict, -) -from .githubrepositoryout import ( - GithubRepositoryOut, - GithubRepositoryOutType, - GithubRepositoryOutTypedDict, -) -from .httpvalidationerror import HTTPValidationError, HTTPValidationErrorData -from .imagegenerationtool import ( - ImageGenerationTool, - ImageGenerationToolType, - ImageGenerationToolTypedDict, -) -from .imageurl import ImageURL, ImageURLTypedDict -from .imageurlchunk import ( - ImageURLChunk, - ImageURLChunkImageURL, - ImageURLChunkImageURLTypedDict, - ImageURLChunkType, - ImageURLChunkTypedDict, -) -from .inputentries import InputEntries, InputEntriesTypedDict -from .inputs import ( - Inputs, - InputsTypedDict, - InstructRequestInputs, - InstructRequestInputsMessages, - InstructRequestInputsMessagesTypedDict, - InstructRequestInputsTypedDict, -) -from .instructrequest import ( - InstructRequest, - InstructRequestMessages, - InstructRequestMessagesTypedDict, - InstructRequestTypedDict, -) -from .jobin import ( - Hyperparameters, - HyperparametersTypedDict, - JobIn, - JobInIntegrations, - JobInIntegrationsTypedDict, - JobInRepositories, - JobInRepositoriesTypedDict, - JobInTypedDict, -) -from .jobmetadataout import JobMetadataOut, JobMetadataOutTypedDict -from .jobs_api_routes_batch_cancel_batch_jobop import ( - JobsAPIRoutesBatchCancelBatchJobRequest, - JobsAPIRoutesBatchCancelBatchJobRequestTypedDict, -) -from .jobs_api_routes_batch_get_batch_jobop import ( - JobsAPIRoutesBatchGetBatchJobRequest, - JobsAPIRoutesBatchGetBatchJobRequestTypedDict, -) -from .jobs_api_routes_batch_get_batch_jobsop import ( - JobsAPIRoutesBatchGetBatchJobsRequest, - JobsAPIRoutesBatchGetBatchJobsRequestTypedDict, -) -from .jobs_api_routes_fine_tuning_archive_fine_tuned_modelop import ( - JobsAPIRoutesFineTuningArchiveFineTunedModelRequest, - JobsAPIRoutesFineTuningArchiveFineTunedModelRequestTypedDict, -) -from .jobs_api_routes_fine_tuning_cancel_fine_tuning_jobop import ( - JobsAPIRoutesFineTuningCancelFineTuningJobRequest, - JobsAPIRoutesFineTuningCancelFineTuningJobRequestTypedDict, - JobsAPIRoutesFineTuningCancelFineTuningJobResponse, - JobsAPIRoutesFineTuningCancelFineTuningJobResponseTypedDict, -) -from .jobs_api_routes_fine_tuning_create_fine_tuning_jobop import ( - JobsAPIRoutesFineTuningCreateFineTuningJobResponse, - JobsAPIRoutesFineTuningCreateFineTuningJobResponseTypedDict, - Response1, - Response1TypedDict, -) -from .jobs_api_routes_fine_tuning_get_fine_tuning_jobop import ( - JobsAPIRoutesFineTuningGetFineTuningJobRequest, - JobsAPIRoutesFineTuningGetFineTuningJobRequestTypedDict, - JobsAPIRoutesFineTuningGetFineTuningJobResponse, - JobsAPIRoutesFineTuningGetFineTuningJobResponseTypedDict, -) -from .jobs_api_routes_fine_tuning_get_fine_tuning_jobsop import ( - JobsAPIRoutesFineTuningGetFineTuningJobsRequest, - JobsAPIRoutesFineTuningGetFineTuningJobsRequestTypedDict, - QueryParamStatus, -) -from .jobs_api_routes_fine_tuning_start_fine_tuning_jobop import ( - JobsAPIRoutesFineTuningStartFineTuningJobRequest, - JobsAPIRoutesFineTuningStartFineTuningJobRequestTypedDict, - JobsAPIRoutesFineTuningStartFineTuningJobResponse, - JobsAPIRoutesFineTuningStartFineTuningJobResponseTypedDict, -) -from .jobs_api_routes_fine_tuning_unarchive_fine_tuned_modelop import ( - JobsAPIRoutesFineTuningUnarchiveFineTunedModelRequest, - JobsAPIRoutesFineTuningUnarchiveFineTunedModelRequestTypedDict, -) -from .jobs_api_routes_fine_tuning_update_fine_tuned_modelop import ( - JobsAPIRoutesFineTuningUpdateFineTunedModelRequest, - JobsAPIRoutesFineTuningUpdateFineTunedModelRequestTypedDict, - JobsAPIRoutesFineTuningUpdateFineTunedModelResponse, - JobsAPIRoutesFineTuningUpdateFineTunedModelResponseTypedDict, -) -from .jobsout import ( - JobsOut, - JobsOutData, - JobsOutDataTypedDict, - JobsOutObject, - JobsOutTypedDict, -) -from .jsonschema import JSONSchema, JSONSchemaTypedDict -from .legacyjobmetadataout import ( - LegacyJobMetadataOut, - LegacyJobMetadataOutObject, - LegacyJobMetadataOutTypedDict, -) -from .listfilesout import ListFilesOut, ListFilesOutTypedDict -from .messageentries import MessageEntries, MessageEntriesTypedDict -from .messageinputcontentchunks import ( - MessageInputContentChunks, - MessageInputContentChunksTypedDict, -) -from .messageinputentry import ( - MessageInputEntry, - MessageInputEntryContent, - MessageInputEntryContentTypedDict, - MessageInputEntryRole, - MessageInputEntryType, - MessageInputEntryTypedDict, - Object, -) -from .messageoutputcontentchunks import ( - MessageOutputContentChunks, - MessageOutputContentChunksTypedDict, -) -from .messageoutputentry import ( - MessageOutputEntry, - MessageOutputEntryContent, - MessageOutputEntryContentTypedDict, - MessageOutputEntryObject, - MessageOutputEntryRole, - MessageOutputEntryType, - MessageOutputEntryTypedDict, -) -from .messageoutputevent import ( - MessageOutputEvent, - MessageOutputEventContent, - MessageOutputEventContentTypedDict, - MessageOutputEventRole, - MessageOutputEventType, - MessageOutputEventTypedDict, -) -from .metricout import MetricOut, MetricOutTypedDict -from .mistralpromptmode import MistralPromptMode -from .modelcapabilities import ModelCapabilities, ModelCapabilitiesTypedDict -from .modelconversation import ( - ModelConversation, - ModelConversationObject, - ModelConversationTools, - ModelConversationToolsTypedDict, - ModelConversationTypedDict, -) -from .modellist import Data, DataTypedDict, ModelList, ModelListTypedDict -from .moderationobject import ModerationObject, ModerationObjectTypedDict -from .moderationresponse import ModerationResponse, ModerationResponseTypedDict -from .ocrimageobject import OCRImageObject, OCRImageObjectTypedDict -from .ocrpagedimensions import OCRPageDimensions, OCRPageDimensionsTypedDict -from .ocrpageobject import OCRPageObject, OCRPageObjectTypedDict -from .ocrrequest import Document, DocumentTypedDict, OCRRequest, OCRRequestTypedDict -from .ocrresponse import OCRResponse, OCRResponseTypedDict -from .ocrusageinfo import OCRUsageInfo, OCRUsageInfoTypedDict -from .outputcontentchunks import OutputContentChunks, OutputContentChunksTypedDict -from .prediction import Prediction, PredictionTypedDict -from .referencechunk import ReferenceChunk, ReferenceChunkType, ReferenceChunkTypedDict -from .responsedoneevent import ( - ResponseDoneEvent, - ResponseDoneEventType, - ResponseDoneEventTypedDict, -) -from .responseerrorevent import ( - ResponseErrorEvent, - ResponseErrorEventType, - ResponseErrorEventTypedDict, -) -from .responseformat import ResponseFormat, ResponseFormatTypedDict -from .responseformats import ResponseFormats -from .responsestartedevent import ( - ResponseStartedEvent, - ResponseStartedEventType, - ResponseStartedEventTypedDict, -) -from .retrieve_model_v1_models_model_id_getop import ( - RetrieveModelV1ModelsModelIDGetRequest, - RetrieveModelV1ModelsModelIDGetRequestTypedDict, - RetrieveModelV1ModelsModelIDGetResponseRetrieveModelV1ModelsModelIDGet, - RetrieveModelV1ModelsModelIDGetResponseRetrieveModelV1ModelsModelIDGetTypedDict, -) -from .retrievefileout import RetrieveFileOut, RetrieveFileOutTypedDict -from .sampletype import SampleType -from .sdkerror import SDKError -from .security import Security, SecurityTypedDict -from .source import Source -from .ssetypes import SSETypes -from .systemmessage import ( - Role, - SystemMessage, - SystemMessageContent, - SystemMessageContentTypedDict, - SystemMessageTypedDict, -) -from .textchunk import TextChunk, TextChunkType, TextChunkTypedDict -from .tool import Tool, ToolTypedDict -from .toolcall import ToolCall, ToolCallTypedDict -from .toolchoice import ToolChoice, ToolChoiceTypedDict -from .toolchoiceenum import ToolChoiceEnum -from .toolexecutiondoneevent import ( - ToolExecutionDoneEvent, - ToolExecutionDoneEventType, - ToolExecutionDoneEventTypedDict, -) -from .toolexecutionentry import ( - ToolExecutionEntry, - ToolExecutionEntryObject, - ToolExecutionEntryType, - ToolExecutionEntryTypedDict, -) -from .toolexecutionstartedevent import ( - ToolExecutionStartedEvent, - ToolExecutionStartedEventType, - ToolExecutionStartedEventTypedDict, -) -from .toolfilechunk import ToolFileChunk, ToolFileChunkType, ToolFileChunkTypedDict -from .toolmessage import ( - ToolMessage, - ToolMessageContent, - ToolMessageContentTypedDict, - ToolMessageRole, - ToolMessageTypedDict, -) -from .toolreferencechunk import ( - ToolReferenceChunk, - ToolReferenceChunkType, - ToolReferenceChunkTypedDict, -) -from .tooltypes import ToolTypes -from .trainingfile import TrainingFile, TrainingFileTypedDict -from .unarchiveftmodelout import ( - UnarchiveFTModelOut, - UnarchiveFTModelOutObject, - UnarchiveFTModelOutTypedDict, -) -from .updateftmodelin import UpdateFTModelIn, UpdateFTModelInTypedDict -from .uploadfileout import UploadFileOut, UploadFileOutTypedDict -from .usageinfo import UsageInfo, UsageInfoTypedDict -from .usermessage import ( - UserMessage, - UserMessageContent, - UserMessageContentTypedDict, - UserMessageRole, - UserMessageTypedDict, -) -from .validationerror import ( - Loc, - LocTypedDict, - ValidationError, - ValidationErrorTypedDict, -) -from .wandbintegration import ( - WandbIntegration, - WandbIntegrationType, - WandbIntegrationTypedDict, -) -from .wandbintegrationout import ( - WandbIntegrationOut, - WandbIntegrationOutType, - WandbIntegrationOutTypedDict, -) -from .websearchpremiumtool import ( - WebSearchPremiumTool, - WebSearchPremiumToolType, - WebSearchPremiumToolTypedDict, -) -from .websearchtool import WebSearchTool, WebSearchToolType, WebSearchToolTypedDict +from typing import TYPE_CHECKING +from importlib import import_module +if TYPE_CHECKING: + from .agent import ( + Agent, + AgentObject, + AgentTools, + AgentToolsTypedDict, + AgentTypedDict, + ) + from .agentconversation import ( + AgentConversation, + AgentConversationObject, + AgentConversationTypedDict, + ) + from .agentcreationrequest import ( + AgentCreationRequest, + AgentCreationRequestTools, + AgentCreationRequestToolsTypedDict, + AgentCreationRequestTypedDict, + ) + from .agenthandoffdoneevent import ( + AgentHandoffDoneEvent, + AgentHandoffDoneEventType, + AgentHandoffDoneEventTypedDict, + ) + from .agenthandoffentry import ( + AgentHandoffEntry, + AgentHandoffEntryObject, + AgentHandoffEntryType, + AgentHandoffEntryTypedDict, + ) + from .agenthandoffstartedevent import ( + AgentHandoffStartedEvent, + AgentHandoffStartedEventType, + AgentHandoffStartedEventTypedDict, + ) + from .agents_api_v1_agents_getop import ( + AgentsAPIV1AgentsGetRequest, + AgentsAPIV1AgentsGetRequestTypedDict, + ) + from .agents_api_v1_agents_listop import ( + AgentsAPIV1AgentsListRequest, + AgentsAPIV1AgentsListRequestTypedDict, + ) + from .agents_api_v1_agents_update_versionop import ( + AgentsAPIV1AgentsUpdateVersionRequest, + AgentsAPIV1AgentsUpdateVersionRequestTypedDict, + ) + from .agents_api_v1_agents_updateop import ( + AgentsAPIV1AgentsUpdateRequest, + AgentsAPIV1AgentsUpdateRequestTypedDict, + ) + from .agents_api_v1_conversations_append_streamop import ( + AgentsAPIV1ConversationsAppendStreamRequest, + AgentsAPIV1ConversationsAppendStreamRequestTypedDict, + ) + from .agents_api_v1_conversations_appendop import ( + AgentsAPIV1ConversationsAppendRequest, + AgentsAPIV1ConversationsAppendRequestTypedDict, + ) + from .agents_api_v1_conversations_getop import ( + AgentsAPIV1ConversationsGetRequest, + AgentsAPIV1ConversationsGetRequestTypedDict, + AgentsAPIV1ConversationsGetResponseV1ConversationsGet, + AgentsAPIV1ConversationsGetResponseV1ConversationsGetTypedDict, + ) + from .agents_api_v1_conversations_historyop import ( + AgentsAPIV1ConversationsHistoryRequest, + AgentsAPIV1ConversationsHistoryRequestTypedDict, + ) + from .agents_api_v1_conversations_listop import ( + AgentsAPIV1ConversationsListRequest, + AgentsAPIV1ConversationsListRequestTypedDict, + ResponseBody, + ResponseBodyTypedDict, + ) + from .agents_api_v1_conversations_messagesop import ( + AgentsAPIV1ConversationsMessagesRequest, + AgentsAPIV1ConversationsMessagesRequestTypedDict, + ) + from .agents_api_v1_conversations_restart_streamop import ( + AgentsAPIV1ConversationsRestartStreamRequest, + AgentsAPIV1ConversationsRestartStreamRequestTypedDict, + ) + from .agents_api_v1_conversations_restartop import ( + AgentsAPIV1ConversationsRestartRequest, + AgentsAPIV1ConversationsRestartRequestTypedDict, + ) + from .agentscompletionrequest import ( + AgentsCompletionRequest, + AgentsCompletionRequestMessages, + AgentsCompletionRequestMessagesTypedDict, + AgentsCompletionRequestStop, + AgentsCompletionRequestStopTypedDict, + AgentsCompletionRequestToolChoice, + AgentsCompletionRequestToolChoiceTypedDict, + AgentsCompletionRequestTypedDict, + ) + from .agentscompletionstreamrequest import ( + AgentsCompletionStreamRequest, + AgentsCompletionStreamRequestMessages, + AgentsCompletionStreamRequestMessagesTypedDict, + AgentsCompletionStreamRequestStop, + AgentsCompletionStreamRequestStopTypedDict, + AgentsCompletionStreamRequestToolChoice, + AgentsCompletionStreamRequestToolChoiceTypedDict, + AgentsCompletionStreamRequestTypedDict, + ) + from .agentupdaterequest import ( + AgentUpdateRequest, + AgentUpdateRequestTools, + AgentUpdateRequestToolsTypedDict, + AgentUpdateRequestTypedDict, + ) + from .apiendpoint import APIEndpoint + from .archiveftmodelout import ( + ArchiveFTModelOut, + ArchiveFTModelOutObject, + ArchiveFTModelOutTypedDict, + ) + from .assistantmessage import ( + AssistantMessage, + AssistantMessageContent, + AssistantMessageContentTypedDict, + AssistantMessageRole, + AssistantMessageTypedDict, + ) + from .basemodelcard import BaseModelCard, BaseModelCardTypedDict, Type + from .batcherror import BatchError, BatchErrorTypedDict + from .batchjobin import BatchJobIn, BatchJobInTypedDict + from .batchjobout import BatchJobOut, BatchJobOutObject, BatchJobOutTypedDict + from .batchjobsout import BatchJobsOut, BatchJobsOutObject, BatchJobsOutTypedDict + from .batchjobstatus import BatchJobStatus + from .builtinconnectors import BuiltInConnectors + from .chatclassificationrequest import ( + ChatClassificationRequest, + ChatClassificationRequestTypedDict, + ) + from .chatcompletionchoice import ( + ChatCompletionChoice, + ChatCompletionChoiceTypedDict, + FinishReason, + ) + from .chatcompletionrequest import ( + ChatCompletionRequest, + ChatCompletionRequestToolChoice, + ChatCompletionRequestToolChoiceTypedDict, + ChatCompletionRequestTypedDict, + Messages, + MessagesTypedDict, + Stop, + StopTypedDict, + ) + from .chatcompletionresponse import ( + ChatCompletionResponse, + ChatCompletionResponseTypedDict, + ) + from .chatcompletionstreamrequest import ( + ChatCompletionStreamRequest, + ChatCompletionStreamRequestMessages, + ChatCompletionStreamRequestMessagesTypedDict, + ChatCompletionStreamRequestStop, + ChatCompletionStreamRequestStopTypedDict, + ChatCompletionStreamRequestToolChoice, + ChatCompletionStreamRequestToolChoiceTypedDict, + ChatCompletionStreamRequestTypedDict, + ) + from .chatmoderationrequest import ( + ChatModerationRequest, + ChatModerationRequestInputs, + ChatModerationRequestInputsTypedDict, + ChatModerationRequestTypedDict, + One, + OneTypedDict, + Two, + TwoTypedDict, + ) + from .checkpointout import CheckpointOut, CheckpointOutTypedDict + from .classificationrequest import ( + ClassificationRequest, + ClassificationRequestInputs, + ClassificationRequestInputsTypedDict, + ClassificationRequestTypedDict, + ) + from .classificationresponse import ( + ClassificationResponse, + ClassificationResponseTypedDict, + ) + from .classificationtargetresult import ( + ClassificationTargetResult, + ClassificationTargetResultTypedDict, + ) + from .classifierdetailedjobout import ( + ClassifierDetailedJobOut, + ClassifierDetailedJobOutIntegrations, + ClassifierDetailedJobOutIntegrationsTypedDict, + ClassifierDetailedJobOutJobType, + ClassifierDetailedJobOutObject, + ClassifierDetailedJobOutStatus, + ClassifierDetailedJobOutTypedDict, + ) + from .classifierftmodelout import ( + ClassifierFTModelOut, + ClassifierFTModelOutModelType, + ClassifierFTModelOutObject, + ClassifierFTModelOutTypedDict, + ) + from .classifierjobout import ( + ClassifierJobOut, + ClassifierJobOutIntegrations, + ClassifierJobOutIntegrationsTypedDict, + ClassifierJobOutJobType, + ClassifierJobOutObject, + ClassifierJobOutStatus, + ClassifierJobOutTypedDict, + ) + from .classifiertargetin import ClassifierTargetIn, ClassifierTargetInTypedDict + from .classifiertargetout import ClassifierTargetOut, ClassifierTargetOutTypedDict + from .classifiertrainingparameters import ( + ClassifierTrainingParameters, + ClassifierTrainingParametersTypedDict, + ) + from .classifiertrainingparametersin import ( + ClassifierTrainingParametersIn, + ClassifierTrainingParametersInTypedDict, + ) + from .codeinterpretertool import ( + CodeInterpreterTool, + CodeInterpreterToolType, + CodeInterpreterToolTypedDict, + ) + from .completionargs import CompletionArgs, CompletionArgsTypedDict + from .completionargsstop import CompletionArgsStop, CompletionArgsStopTypedDict + from .completionchunk import CompletionChunk, CompletionChunkTypedDict + from .completiondetailedjobout import ( + CompletionDetailedJobOut, + CompletionDetailedJobOutIntegrations, + CompletionDetailedJobOutIntegrationsTypedDict, + CompletionDetailedJobOutJobType, + CompletionDetailedJobOutObject, + CompletionDetailedJobOutRepositories, + CompletionDetailedJobOutRepositoriesTypedDict, + CompletionDetailedJobOutStatus, + CompletionDetailedJobOutTypedDict, + ) + from .completionevent import CompletionEvent, CompletionEventTypedDict + from .completionftmodelout import ( + CompletionFTModelOut, + CompletionFTModelOutObject, + CompletionFTModelOutTypedDict, + ModelType, + ) + from .completionjobout import ( + CompletionJobOut, + CompletionJobOutObject, + CompletionJobOutTypedDict, + Integrations, + IntegrationsTypedDict, + JobType, + Repositories, + RepositoriesTypedDict, + Status, + ) + from .completionresponsestreamchoice import ( + CompletionResponseStreamChoice, + CompletionResponseStreamChoiceFinishReason, + CompletionResponseStreamChoiceTypedDict, + ) + from .completiontrainingparameters import ( + CompletionTrainingParameters, + CompletionTrainingParametersTypedDict, + ) + from .completiontrainingparametersin import ( + CompletionTrainingParametersIn, + CompletionTrainingParametersInTypedDict, + ) + from .contentchunk import ContentChunk, ContentChunkTypedDict + from .conversationappendrequest import ( + ConversationAppendRequest, + ConversationAppendRequestHandoffExecution, + ConversationAppendRequestTypedDict, + ) + from .conversationappendstreamrequest import ( + ConversationAppendStreamRequest, + ConversationAppendStreamRequestHandoffExecution, + ConversationAppendStreamRequestTypedDict, + ) + from .conversationevents import ( + ConversationEvents, + ConversationEventsData, + ConversationEventsDataTypedDict, + ConversationEventsTypedDict, + ) + from .conversationhistory import ( + ConversationHistory, + ConversationHistoryObject, + ConversationHistoryTypedDict, + Entries, + EntriesTypedDict, + ) + from .conversationinputs import ConversationInputs, ConversationInputsTypedDict + from .conversationmessages import ( + ConversationMessages, + ConversationMessagesObject, + ConversationMessagesTypedDict, + ) + from .conversationrequest import ( + ConversationRequest, + ConversationRequestTypedDict, + HandoffExecution, + Tools, + ToolsTypedDict, + ) + from .conversationresponse import ( + ConversationResponse, + ConversationResponseObject, + ConversationResponseTypedDict, + Outputs, + OutputsTypedDict, + ) + from .conversationrestartrequest import ( + ConversationRestartRequest, + ConversationRestartRequestHandoffExecution, + ConversationRestartRequestTypedDict, + ) + from .conversationrestartstreamrequest import ( + ConversationRestartStreamRequest, + ConversationRestartStreamRequestHandoffExecution, + ConversationRestartStreamRequestTypedDict, + ) + from .conversationstreamrequest import ( + ConversationStreamRequest, + ConversationStreamRequestHandoffExecution, + ConversationStreamRequestTools, + ConversationStreamRequestToolsTypedDict, + ConversationStreamRequestTypedDict, + ) + from .conversationusageinfo import ( + ConversationUsageInfo, + ConversationUsageInfoTypedDict, + ) + from .delete_model_v1_models_model_id_deleteop import ( + DeleteModelV1ModelsModelIDDeleteRequest, + DeleteModelV1ModelsModelIDDeleteRequestTypedDict, + ) + from .deletefileout import DeleteFileOut, DeleteFileOutTypedDict + from .deletemodelout import DeleteModelOut, DeleteModelOutTypedDict + from .deltamessage import ( + Content, + ContentTypedDict, + DeltaMessage, + DeltaMessageTypedDict, + ) + from .documentlibrarytool import ( + DocumentLibraryTool, + DocumentLibraryToolType, + DocumentLibraryToolTypedDict, + ) + from .documenturlchunk import ( + DocumentURLChunk, + DocumentURLChunkType, + DocumentURLChunkTypedDict, + ) + from .embeddingdtype import EmbeddingDtype + from .embeddingrequest import ( + EmbeddingRequest, + EmbeddingRequestInputs, + EmbeddingRequestInputsTypedDict, + EmbeddingRequestTypedDict, + ) + from .embeddingresponse import EmbeddingResponse, EmbeddingResponseTypedDict + from .embeddingresponsedata import ( + EmbeddingResponseData, + EmbeddingResponseDataTypedDict, + ) + from .eventout import EventOut, EventOutTypedDict + from .filepurpose import FilePurpose + from .files_api_routes_delete_fileop import ( + FilesAPIRoutesDeleteFileRequest, + FilesAPIRoutesDeleteFileRequestTypedDict, + ) + from .files_api_routes_download_fileop import ( + FilesAPIRoutesDownloadFileRequest, + FilesAPIRoutesDownloadFileRequestTypedDict, + ) + from .files_api_routes_get_signed_urlop import ( + FilesAPIRoutesGetSignedURLRequest, + FilesAPIRoutesGetSignedURLRequestTypedDict, + ) + from .files_api_routes_list_filesop import ( + FilesAPIRoutesListFilesRequest, + FilesAPIRoutesListFilesRequestTypedDict, + ) + from .files_api_routes_retrieve_fileop import ( + FilesAPIRoutesRetrieveFileRequest, + FilesAPIRoutesRetrieveFileRequestTypedDict, + ) + from .files_api_routes_upload_fileop import ( + File, + FileTypedDict, + FilesAPIRoutesUploadFileMultiPartBodyParams, + FilesAPIRoutesUploadFileMultiPartBodyParamsTypedDict, + ) + from .fileschema import FileSchema, FileSchemaTypedDict + from .filesignedurl import FileSignedURL, FileSignedURLTypedDict + from .fimcompletionrequest import ( + FIMCompletionRequest, + FIMCompletionRequestStop, + FIMCompletionRequestStopTypedDict, + FIMCompletionRequestTypedDict, + ) + from .fimcompletionresponse import ( + FIMCompletionResponse, + FIMCompletionResponseTypedDict, + ) + from .fimcompletionstreamrequest import ( + FIMCompletionStreamRequest, + FIMCompletionStreamRequestStop, + FIMCompletionStreamRequestStopTypedDict, + FIMCompletionStreamRequestTypedDict, + ) + from .finetuneablemodeltype import FineTuneableModelType + from .ftclassifierlossfunction import FTClassifierLossFunction + from .ftmodelcapabilitiesout import ( + FTModelCapabilitiesOut, + FTModelCapabilitiesOutTypedDict, + ) + from .ftmodelcard import FTModelCard, FTModelCardType, FTModelCardTypedDict + from .function import Function, FunctionTypedDict + from .functioncall import ( + Arguments, + ArgumentsTypedDict, + FunctionCall, + FunctionCallTypedDict, + ) + from .functioncallentry import ( + FunctionCallEntry, + FunctionCallEntryObject, + FunctionCallEntryType, + FunctionCallEntryTypedDict, + ) + from .functioncallentryarguments import ( + FunctionCallEntryArguments, + FunctionCallEntryArgumentsTypedDict, + ) + from .functioncallevent import ( + FunctionCallEvent, + FunctionCallEventType, + FunctionCallEventTypedDict, + ) + from .functionname import FunctionName, FunctionNameTypedDict + from .functionresultentry import ( + FunctionResultEntry, + FunctionResultEntryObject, + FunctionResultEntryType, + FunctionResultEntryTypedDict, + ) + from .functiontool import FunctionTool, FunctionToolType, FunctionToolTypedDict + from .githubrepositoryin import ( + GithubRepositoryIn, + GithubRepositoryInType, + GithubRepositoryInTypedDict, + ) + from .githubrepositoryout import ( + GithubRepositoryOut, + GithubRepositoryOutType, + GithubRepositoryOutTypedDict, + ) + from .httpvalidationerror import HTTPValidationError, HTTPValidationErrorData + from .imagegenerationtool import ( + ImageGenerationTool, + ImageGenerationToolType, + ImageGenerationToolTypedDict, + ) + from .imageurl import ImageURL, ImageURLTypedDict + from .imageurlchunk import ( + ImageURLChunk, + ImageURLChunkImageURL, + ImageURLChunkImageURLTypedDict, + ImageURLChunkType, + ImageURLChunkTypedDict, + ) + from .inputentries import InputEntries, InputEntriesTypedDict + from .inputs import ( + Inputs, + InputsTypedDict, + InstructRequestInputs, + InstructRequestInputsMessages, + InstructRequestInputsMessagesTypedDict, + InstructRequestInputsTypedDict, + ) + from .instructrequest import ( + InstructRequest, + InstructRequestMessages, + InstructRequestMessagesTypedDict, + InstructRequestTypedDict, + ) + from .jobin import ( + Hyperparameters, + HyperparametersTypedDict, + JobIn, + JobInIntegrations, + JobInIntegrationsTypedDict, + JobInRepositories, + JobInRepositoriesTypedDict, + JobInTypedDict, + ) + from .jobmetadataout import JobMetadataOut, JobMetadataOutTypedDict + from .jobs_api_routes_batch_cancel_batch_jobop import ( + JobsAPIRoutesBatchCancelBatchJobRequest, + JobsAPIRoutesBatchCancelBatchJobRequestTypedDict, + ) + from .jobs_api_routes_batch_get_batch_jobop import ( + JobsAPIRoutesBatchGetBatchJobRequest, + JobsAPIRoutesBatchGetBatchJobRequestTypedDict, + ) + from .jobs_api_routes_batch_get_batch_jobsop import ( + JobsAPIRoutesBatchGetBatchJobsRequest, + JobsAPIRoutesBatchGetBatchJobsRequestTypedDict, + ) + from .jobs_api_routes_fine_tuning_archive_fine_tuned_modelop import ( + JobsAPIRoutesFineTuningArchiveFineTunedModelRequest, + JobsAPIRoutesFineTuningArchiveFineTunedModelRequestTypedDict, + ) + from .jobs_api_routes_fine_tuning_cancel_fine_tuning_jobop import ( + JobsAPIRoutesFineTuningCancelFineTuningJobRequest, + JobsAPIRoutesFineTuningCancelFineTuningJobRequestTypedDict, + JobsAPIRoutesFineTuningCancelFineTuningJobResponse, + JobsAPIRoutesFineTuningCancelFineTuningJobResponseTypedDict, + ) + from .jobs_api_routes_fine_tuning_create_fine_tuning_jobop import ( + JobsAPIRoutesFineTuningCreateFineTuningJobResponse, + JobsAPIRoutesFineTuningCreateFineTuningJobResponseTypedDict, + Response1, + Response1TypedDict, + ) + from .jobs_api_routes_fine_tuning_get_fine_tuning_jobop import ( + JobsAPIRoutesFineTuningGetFineTuningJobRequest, + JobsAPIRoutesFineTuningGetFineTuningJobRequestTypedDict, + JobsAPIRoutesFineTuningGetFineTuningJobResponse, + JobsAPIRoutesFineTuningGetFineTuningJobResponseTypedDict, + ) + from .jobs_api_routes_fine_tuning_get_fine_tuning_jobsop import ( + JobsAPIRoutesFineTuningGetFineTuningJobsRequest, + JobsAPIRoutesFineTuningGetFineTuningJobsRequestTypedDict, + QueryParamStatus, + ) + from .jobs_api_routes_fine_tuning_start_fine_tuning_jobop import ( + JobsAPIRoutesFineTuningStartFineTuningJobRequest, + JobsAPIRoutesFineTuningStartFineTuningJobRequestTypedDict, + JobsAPIRoutesFineTuningStartFineTuningJobResponse, + JobsAPIRoutesFineTuningStartFineTuningJobResponseTypedDict, + ) + from .jobs_api_routes_fine_tuning_unarchive_fine_tuned_modelop import ( + JobsAPIRoutesFineTuningUnarchiveFineTunedModelRequest, + JobsAPIRoutesFineTuningUnarchiveFineTunedModelRequestTypedDict, + ) + from .jobs_api_routes_fine_tuning_update_fine_tuned_modelop import ( + JobsAPIRoutesFineTuningUpdateFineTunedModelRequest, + JobsAPIRoutesFineTuningUpdateFineTunedModelRequestTypedDict, + JobsAPIRoutesFineTuningUpdateFineTunedModelResponse, + JobsAPIRoutesFineTuningUpdateFineTunedModelResponseTypedDict, + ) + from .jobsout import ( + JobsOut, + JobsOutData, + JobsOutDataTypedDict, + JobsOutObject, + JobsOutTypedDict, + ) + from .jsonschema import JSONSchema, JSONSchemaTypedDict + from .legacyjobmetadataout import ( + LegacyJobMetadataOut, + LegacyJobMetadataOutObject, + LegacyJobMetadataOutTypedDict, + ) + from .listfilesout import ListFilesOut, ListFilesOutTypedDict + from .messageentries import MessageEntries, MessageEntriesTypedDict + from .messageinputcontentchunks import ( + MessageInputContentChunks, + MessageInputContentChunksTypedDict, + ) + from .messageinputentry import ( + MessageInputEntry, + MessageInputEntryContent, + MessageInputEntryContentTypedDict, + MessageInputEntryRole, + MessageInputEntryType, + MessageInputEntryTypedDict, + Object, + ) + from .messageoutputcontentchunks import ( + MessageOutputContentChunks, + MessageOutputContentChunksTypedDict, + ) + from .messageoutputentry import ( + MessageOutputEntry, + MessageOutputEntryContent, + MessageOutputEntryContentTypedDict, + MessageOutputEntryObject, + MessageOutputEntryRole, + MessageOutputEntryType, + MessageOutputEntryTypedDict, + ) + from .messageoutputevent import ( + MessageOutputEvent, + MessageOutputEventContent, + MessageOutputEventContentTypedDict, + MessageOutputEventRole, + MessageOutputEventType, + MessageOutputEventTypedDict, + ) + from .metricout import MetricOut, MetricOutTypedDict + from .mistralpromptmode import MistralPromptMode + from .modelcapabilities import ModelCapabilities, ModelCapabilitiesTypedDict + from .modelconversation import ( + ModelConversation, + ModelConversationObject, + ModelConversationTools, + ModelConversationToolsTypedDict, + ModelConversationTypedDict, + ) + from .modellist import Data, DataTypedDict, ModelList, ModelListTypedDict + from .moderationobject import ModerationObject, ModerationObjectTypedDict + from .moderationresponse import ModerationResponse, ModerationResponseTypedDict + from .ocrimageobject import OCRImageObject, OCRImageObjectTypedDict + from .ocrpagedimensions import OCRPageDimensions, OCRPageDimensionsTypedDict + from .ocrpageobject import OCRPageObject, OCRPageObjectTypedDict + from .ocrrequest import Document, DocumentTypedDict, OCRRequest, OCRRequestTypedDict + from .ocrresponse import OCRResponse, OCRResponseTypedDict + from .ocrusageinfo import OCRUsageInfo, OCRUsageInfoTypedDict + from .outputcontentchunks import OutputContentChunks, OutputContentChunksTypedDict + from .prediction import Prediction, PredictionTypedDict + from .referencechunk import ( + ReferenceChunk, + ReferenceChunkType, + ReferenceChunkTypedDict, + ) + from .responsedoneevent import ( + ResponseDoneEvent, + ResponseDoneEventType, + ResponseDoneEventTypedDict, + ) + from .responseerrorevent import ( + ResponseErrorEvent, + ResponseErrorEventType, + ResponseErrorEventTypedDict, + ) + from .responseformat import ResponseFormat, ResponseFormatTypedDict + from .responseformats import ResponseFormats + from .responsestartedevent import ( + ResponseStartedEvent, + ResponseStartedEventType, + ResponseStartedEventTypedDict, + ) + from .retrieve_model_v1_models_model_id_getop import ( + RetrieveModelV1ModelsModelIDGetRequest, + RetrieveModelV1ModelsModelIDGetRequestTypedDict, + RetrieveModelV1ModelsModelIDGetResponseRetrieveModelV1ModelsModelIDGet, + RetrieveModelV1ModelsModelIDGetResponseRetrieveModelV1ModelsModelIDGetTypedDict, + ) + from .retrievefileout import RetrieveFileOut, RetrieveFileOutTypedDict + from .sampletype import SampleType + from .sdkerror import SDKError + from .security import Security, SecurityTypedDict + from .source import Source + from .ssetypes import SSETypes + from .systemmessage import ( + Role, + SystemMessage, + SystemMessageContent, + SystemMessageContentTypedDict, + SystemMessageTypedDict, + ) + from .textchunk import TextChunk, TextChunkType, TextChunkTypedDict + from .tool import Tool, ToolTypedDict + from .toolcall import ToolCall, ToolCallTypedDict + from .toolchoice import ToolChoice, ToolChoiceTypedDict + from .toolchoiceenum import ToolChoiceEnum + from .toolexecutiondoneevent import ( + ToolExecutionDoneEvent, + ToolExecutionDoneEventType, + ToolExecutionDoneEventTypedDict, + ) + from .toolexecutionentry import ( + ToolExecutionEntry, + ToolExecutionEntryObject, + ToolExecutionEntryType, + ToolExecutionEntryTypedDict, + ) + from .toolexecutionstartedevent import ( + ToolExecutionStartedEvent, + ToolExecutionStartedEventType, + ToolExecutionStartedEventTypedDict, + ) + from .toolfilechunk import ToolFileChunk, ToolFileChunkType, ToolFileChunkTypedDict + from .toolmessage import ( + ToolMessage, + ToolMessageContent, + ToolMessageContentTypedDict, + ToolMessageRole, + ToolMessageTypedDict, + ) + from .toolreferencechunk import ( + ToolReferenceChunk, + ToolReferenceChunkType, + ToolReferenceChunkTypedDict, + ) + from .tooltypes import ToolTypes + from .trainingfile import TrainingFile, TrainingFileTypedDict + from .unarchiveftmodelout import ( + UnarchiveFTModelOut, + UnarchiveFTModelOutObject, + UnarchiveFTModelOutTypedDict, + ) + from .updateftmodelin import UpdateFTModelIn, UpdateFTModelInTypedDict + from .uploadfileout import UploadFileOut, UploadFileOutTypedDict + from .usageinfo import UsageInfo, UsageInfoTypedDict + from .usermessage import ( + UserMessage, + UserMessageContent, + UserMessageContentTypedDict, + UserMessageRole, + UserMessageTypedDict, + ) + from .validationerror import ( + Loc, + LocTypedDict, + ValidationError, + ValidationErrorTypedDict, + ) + from .wandbintegration import ( + WandbIntegration, + WandbIntegrationType, + WandbIntegrationTypedDict, + ) + from .wandbintegrationout import ( + WandbIntegrationOut, + WandbIntegrationOutType, + WandbIntegrationOutTypedDict, + ) + from .websearchpremiumtool import ( + WebSearchPremiumTool, + WebSearchPremiumToolType, + WebSearchPremiumToolTypedDict, + ) + from .websearchtool import WebSearchTool, WebSearchToolType, WebSearchToolTypedDict __all__ = [ "APIEndpoint", @@ -1301,3 +1328,608 @@ "WebSearchToolType", "WebSearchToolTypedDict", ] + +_dynamic_imports: dict[str, str] = { + "Agent": ".agent", + "AgentObject": ".agent", + "AgentTools": ".agent", + "AgentToolsTypedDict": ".agent", + "AgentTypedDict": ".agent", + "AgentConversation": ".agentconversation", + "AgentConversationObject": ".agentconversation", + "AgentConversationTypedDict": ".agentconversation", + "AgentCreationRequest": ".agentcreationrequest", + "AgentCreationRequestTools": ".agentcreationrequest", + "AgentCreationRequestToolsTypedDict": ".agentcreationrequest", + "AgentCreationRequestTypedDict": ".agentcreationrequest", + "AgentHandoffDoneEvent": ".agenthandoffdoneevent", + "AgentHandoffDoneEventType": ".agenthandoffdoneevent", + "AgentHandoffDoneEventTypedDict": ".agenthandoffdoneevent", + "AgentHandoffEntry": ".agenthandoffentry", + "AgentHandoffEntryObject": ".agenthandoffentry", + "AgentHandoffEntryType": ".agenthandoffentry", + "AgentHandoffEntryTypedDict": ".agenthandoffentry", + "AgentHandoffStartedEvent": ".agenthandoffstartedevent", + "AgentHandoffStartedEventType": ".agenthandoffstartedevent", + "AgentHandoffStartedEventTypedDict": ".agenthandoffstartedevent", + "AgentsAPIV1AgentsGetRequest": ".agents_api_v1_agents_getop", + "AgentsAPIV1AgentsGetRequestTypedDict": ".agents_api_v1_agents_getop", + "AgentsAPIV1AgentsListRequest": ".agents_api_v1_agents_listop", + "AgentsAPIV1AgentsListRequestTypedDict": ".agents_api_v1_agents_listop", + "AgentsAPIV1AgentsUpdateVersionRequest": ".agents_api_v1_agents_update_versionop", + "AgentsAPIV1AgentsUpdateVersionRequestTypedDict": ".agents_api_v1_agents_update_versionop", + "AgentsAPIV1AgentsUpdateRequest": ".agents_api_v1_agents_updateop", + "AgentsAPIV1AgentsUpdateRequestTypedDict": ".agents_api_v1_agents_updateop", + "AgentsAPIV1ConversationsAppendStreamRequest": ".agents_api_v1_conversations_append_streamop", + "AgentsAPIV1ConversationsAppendStreamRequestTypedDict": ".agents_api_v1_conversations_append_streamop", + "AgentsAPIV1ConversationsAppendRequest": ".agents_api_v1_conversations_appendop", + "AgentsAPIV1ConversationsAppendRequestTypedDict": ".agents_api_v1_conversations_appendop", + "AgentsAPIV1ConversationsGetRequest": ".agents_api_v1_conversations_getop", + "AgentsAPIV1ConversationsGetRequestTypedDict": ".agents_api_v1_conversations_getop", + "AgentsAPIV1ConversationsGetResponseV1ConversationsGet": ".agents_api_v1_conversations_getop", + "AgentsAPIV1ConversationsGetResponseV1ConversationsGetTypedDict": ".agents_api_v1_conversations_getop", + "AgentsAPIV1ConversationsHistoryRequest": ".agents_api_v1_conversations_historyop", + "AgentsAPIV1ConversationsHistoryRequestTypedDict": ".agents_api_v1_conversations_historyop", + "AgentsAPIV1ConversationsListRequest": ".agents_api_v1_conversations_listop", + "AgentsAPIV1ConversationsListRequestTypedDict": ".agents_api_v1_conversations_listop", + "ResponseBody": ".agents_api_v1_conversations_listop", + "ResponseBodyTypedDict": ".agents_api_v1_conversations_listop", + "AgentsAPIV1ConversationsMessagesRequest": ".agents_api_v1_conversations_messagesop", + "AgentsAPIV1ConversationsMessagesRequestTypedDict": ".agents_api_v1_conversations_messagesop", + "AgentsAPIV1ConversationsRestartStreamRequest": ".agents_api_v1_conversations_restart_streamop", + "AgentsAPIV1ConversationsRestartStreamRequestTypedDict": ".agents_api_v1_conversations_restart_streamop", + "AgentsAPIV1ConversationsRestartRequest": ".agents_api_v1_conversations_restartop", + "AgentsAPIV1ConversationsRestartRequestTypedDict": ".agents_api_v1_conversations_restartop", + "AgentsCompletionRequest": ".agentscompletionrequest", + "AgentsCompletionRequestMessages": ".agentscompletionrequest", + "AgentsCompletionRequestMessagesTypedDict": ".agentscompletionrequest", + "AgentsCompletionRequestStop": ".agentscompletionrequest", + "AgentsCompletionRequestStopTypedDict": ".agentscompletionrequest", + "AgentsCompletionRequestToolChoice": ".agentscompletionrequest", + "AgentsCompletionRequestToolChoiceTypedDict": ".agentscompletionrequest", + "AgentsCompletionRequestTypedDict": ".agentscompletionrequest", + "AgentsCompletionStreamRequest": ".agentscompletionstreamrequest", + "AgentsCompletionStreamRequestMessages": ".agentscompletionstreamrequest", + "AgentsCompletionStreamRequestMessagesTypedDict": ".agentscompletionstreamrequest", + "AgentsCompletionStreamRequestStop": ".agentscompletionstreamrequest", + "AgentsCompletionStreamRequestStopTypedDict": ".agentscompletionstreamrequest", + "AgentsCompletionStreamRequestToolChoice": ".agentscompletionstreamrequest", + "AgentsCompletionStreamRequestToolChoiceTypedDict": ".agentscompletionstreamrequest", + "AgentsCompletionStreamRequestTypedDict": ".agentscompletionstreamrequest", + "AgentUpdateRequest": ".agentupdaterequest", + "AgentUpdateRequestTools": ".agentupdaterequest", + "AgentUpdateRequestToolsTypedDict": ".agentupdaterequest", + "AgentUpdateRequestTypedDict": ".agentupdaterequest", + "APIEndpoint": ".apiendpoint", + "ArchiveFTModelOut": ".archiveftmodelout", + "ArchiveFTModelOutObject": ".archiveftmodelout", + "ArchiveFTModelOutTypedDict": ".archiveftmodelout", + "AssistantMessage": ".assistantmessage", + "AssistantMessageContent": ".assistantmessage", + "AssistantMessageContentTypedDict": ".assistantmessage", + "AssistantMessageRole": ".assistantmessage", + "AssistantMessageTypedDict": ".assistantmessage", + "BaseModelCard": ".basemodelcard", + "BaseModelCardTypedDict": ".basemodelcard", + "Type": ".basemodelcard", + "BatchError": ".batcherror", + "BatchErrorTypedDict": ".batcherror", + "BatchJobIn": ".batchjobin", + "BatchJobInTypedDict": ".batchjobin", + "BatchJobOut": ".batchjobout", + "BatchJobOutObject": ".batchjobout", + "BatchJobOutTypedDict": ".batchjobout", + "BatchJobsOut": ".batchjobsout", + "BatchJobsOutObject": ".batchjobsout", + "BatchJobsOutTypedDict": ".batchjobsout", + "BatchJobStatus": ".batchjobstatus", + "BuiltInConnectors": ".builtinconnectors", + "ChatClassificationRequest": ".chatclassificationrequest", + "ChatClassificationRequestTypedDict": ".chatclassificationrequest", + "ChatCompletionChoice": ".chatcompletionchoice", + "ChatCompletionChoiceTypedDict": ".chatcompletionchoice", + "FinishReason": ".chatcompletionchoice", + "ChatCompletionRequest": ".chatcompletionrequest", + "ChatCompletionRequestToolChoice": ".chatcompletionrequest", + "ChatCompletionRequestToolChoiceTypedDict": ".chatcompletionrequest", + "ChatCompletionRequestTypedDict": ".chatcompletionrequest", + "Messages": ".chatcompletionrequest", + "MessagesTypedDict": ".chatcompletionrequest", + "Stop": ".chatcompletionrequest", + "StopTypedDict": ".chatcompletionrequest", + "ChatCompletionResponse": ".chatcompletionresponse", + "ChatCompletionResponseTypedDict": ".chatcompletionresponse", + "ChatCompletionStreamRequest": ".chatcompletionstreamrequest", + "ChatCompletionStreamRequestMessages": ".chatcompletionstreamrequest", + "ChatCompletionStreamRequestMessagesTypedDict": ".chatcompletionstreamrequest", + "ChatCompletionStreamRequestStop": ".chatcompletionstreamrequest", + "ChatCompletionStreamRequestStopTypedDict": ".chatcompletionstreamrequest", + "ChatCompletionStreamRequestToolChoice": ".chatcompletionstreamrequest", + "ChatCompletionStreamRequestToolChoiceTypedDict": ".chatcompletionstreamrequest", + "ChatCompletionStreamRequestTypedDict": ".chatcompletionstreamrequest", + "ChatModerationRequest": ".chatmoderationrequest", + "ChatModerationRequestInputs": ".chatmoderationrequest", + "ChatModerationRequestInputsTypedDict": ".chatmoderationrequest", + "ChatModerationRequestTypedDict": ".chatmoderationrequest", + "One": ".chatmoderationrequest", + "OneTypedDict": ".chatmoderationrequest", + "Two": ".chatmoderationrequest", + "TwoTypedDict": ".chatmoderationrequest", + "CheckpointOut": ".checkpointout", + "CheckpointOutTypedDict": ".checkpointout", + "ClassificationRequest": ".classificationrequest", + "ClassificationRequestInputs": ".classificationrequest", + "ClassificationRequestInputsTypedDict": ".classificationrequest", + "ClassificationRequestTypedDict": ".classificationrequest", + "ClassificationResponse": ".classificationresponse", + "ClassificationResponseTypedDict": ".classificationresponse", + "ClassificationTargetResult": ".classificationtargetresult", + "ClassificationTargetResultTypedDict": ".classificationtargetresult", + "ClassifierDetailedJobOut": ".classifierdetailedjobout", + "ClassifierDetailedJobOutIntegrations": ".classifierdetailedjobout", + "ClassifierDetailedJobOutIntegrationsTypedDict": ".classifierdetailedjobout", + "ClassifierDetailedJobOutJobType": ".classifierdetailedjobout", + "ClassifierDetailedJobOutObject": ".classifierdetailedjobout", + "ClassifierDetailedJobOutStatus": ".classifierdetailedjobout", + "ClassifierDetailedJobOutTypedDict": ".classifierdetailedjobout", + "ClassifierFTModelOut": ".classifierftmodelout", + "ClassifierFTModelOutModelType": ".classifierftmodelout", + "ClassifierFTModelOutObject": ".classifierftmodelout", + "ClassifierFTModelOutTypedDict": ".classifierftmodelout", + "ClassifierJobOut": ".classifierjobout", + "ClassifierJobOutIntegrations": ".classifierjobout", + "ClassifierJobOutIntegrationsTypedDict": ".classifierjobout", + "ClassifierJobOutJobType": ".classifierjobout", + "ClassifierJobOutObject": ".classifierjobout", + "ClassifierJobOutStatus": ".classifierjobout", + "ClassifierJobOutTypedDict": ".classifierjobout", + "ClassifierTargetIn": ".classifiertargetin", + "ClassifierTargetInTypedDict": ".classifiertargetin", + "ClassifierTargetOut": ".classifiertargetout", + "ClassifierTargetOutTypedDict": ".classifiertargetout", + "ClassifierTrainingParameters": ".classifiertrainingparameters", + "ClassifierTrainingParametersTypedDict": ".classifiertrainingparameters", + "ClassifierTrainingParametersIn": ".classifiertrainingparametersin", + "ClassifierTrainingParametersInTypedDict": ".classifiertrainingparametersin", + "CodeInterpreterTool": ".codeinterpretertool", + "CodeInterpreterToolType": ".codeinterpretertool", + "CodeInterpreterToolTypedDict": ".codeinterpretertool", + "CompletionArgs": ".completionargs", + "CompletionArgsTypedDict": ".completionargs", + "CompletionArgsStop": ".completionargsstop", + "CompletionArgsStopTypedDict": ".completionargsstop", + "CompletionChunk": ".completionchunk", + "CompletionChunkTypedDict": ".completionchunk", + "CompletionDetailedJobOut": ".completiondetailedjobout", + "CompletionDetailedJobOutIntegrations": ".completiondetailedjobout", + "CompletionDetailedJobOutIntegrationsTypedDict": ".completiondetailedjobout", + "CompletionDetailedJobOutJobType": ".completiondetailedjobout", + "CompletionDetailedJobOutObject": ".completiondetailedjobout", + "CompletionDetailedJobOutRepositories": ".completiondetailedjobout", + "CompletionDetailedJobOutRepositoriesTypedDict": ".completiondetailedjobout", + "CompletionDetailedJobOutStatus": ".completiondetailedjobout", + "CompletionDetailedJobOutTypedDict": ".completiondetailedjobout", + "CompletionEvent": ".completionevent", + "CompletionEventTypedDict": ".completionevent", + "CompletionFTModelOut": ".completionftmodelout", + "CompletionFTModelOutObject": ".completionftmodelout", + "CompletionFTModelOutTypedDict": ".completionftmodelout", + "ModelType": ".completionftmodelout", + "CompletionJobOut": ".completionjobout", + "CompletionJobOutObject": ".completionjobout", + "CompletionJobOutTypedDict": ".completionjobout", + "Integrations": ".completionjobout", + "IntegrationsTypedDict": ".completionjobout", + "JobType": ".completionjobout", + "Repositories": ".completionjobout", + "RepositoriesTypedDict": ".completionjobout", + "Status": ".completionjobout", + "CompletionResponseStreamChoice": ".completionresponsestreamchoice", + "CompletionResponseStreamChoiceFinishReason": ".completionresponsestreamchoice", + "CompletionResponseStreamChoiceTypedDict": ".completionresponsestreamchoice", + "CompletionTrainingParameters": ".completiontrainingparameters", + "CompletionTrainingParametersTypedDict": ".completiontrainingparameters", + "CompletionTrainingParametersIn": ".completiontrainingparametersin", + "CompletionTrainingParametersInTypedDict": ".completiontrainingparametersin", + "ContentChunk": ".contentchunk", + "ContentChunkTypedDict": ".contentchunk", + "ConversationAppendRequest": ".conversationappendrequest", + "ConversationAppendRequestHandoffExecution": ".conversationappendrequest", + "ConversationAppendRequestTypedDict": ".conversationappendrequest", + "ConversationAppendStreamRequest": ".conversationappendstreamrequest", + "ConversationAppendStreamRequestHandoffExecution": ".conversationappendstreamrequest", + "ConversationAppendStreamRequestTypedDict": ".conversationappendstreamrequest", + "ConversationEvents": ".conversationevents", + "ConversationEventsData": ".conversationevents", + "ConversationEventsDataTypedDict": ".conversationevents", + "ConversationEventsTypedDict": ".conversationevents", + "ConversationHistory": ".conversationhistory", + "ConversationHistoryObject": ".conversationhistory", + "ConversationHistoryTypedDict": ".conversationhistory", + "Entries": ".conversationhistory", + "EntriesTypedDict": ".conversationhistory", + "ConversationInputs": ".conversationinputs", + "ConversationInputsTypedDict": ".conversationinputs", + "ConversationMessages": ".conversationmessages", + "ConversationMessagesObject": ".conversationmessages", + "ConversationMessagesTypedDict": ".conversationmessages", + "ConversationRequest": ".conversationrequest", + "ConversationRequestTypedDict": ".conversationrequest", + "HandoffExecution": ".conversationrequest", + "Tools": ".conversationrequest", + "ToolsTypedDict": ".conversationrequest", + "ConversationResponse": ".conversationresponse", + "ConversationResponseObject": ".conversationresponse", + "ConversationResponseTypedDict": ".conversationresponse", + "Outputs": ".conversationresponse", + "OutputsTypedDict": ".conversationresponse", + "ConversationRestartRequest": ".conversationrestartrequest", + "ConversationRestartRequestHandoffExecution": ".conversationrestartrequest", + "ConversationRestartRequestTypedDict": ".conversationrestartrequest", + "ConversationRestartStreamRequest": ".conversationrestartstreamrequest", + "ConversationRestartStreamRequestHandoffExecution": ".conversationrestartstreamrequest", + "ConversationRestartStreamRequestTypedDict": ".conversationrestartstreamrequest", + "ConversationStreamRequest": ".conversationstreamrequest", + "ConversationStreamRequestHandoffExecution": ".conversationstreamrequest", + "ConversationStreamRequestTools": ".conversationstreamrequest", + "ConversationStreamRequestToolsTypedDict": ".conversationstreamrequest", + "ConversationStreamRequestTypedDict": ".conversationstreamrequest", + "ConversationUsageInfo": ".conversationusageinfo", + "ConversationUsageInfoTypedDict": ".conversationusageinfo", + "DeleteModelV1ModelsModelIDDeleteRequest": ".delete_model_v1_models_model_id_deleteop", + "DeleteModelV1ModelsModelIDDeleteRequestTypedDict": ".delete_model_v1_models_model_id_deleteop", + "DeleteFileOut": ".deletefileout", + "DeleteFileOutTypedDict": ".deletefileout", + "DeleteModelOut": ".deletemodelout", + "DeleteModelOutTypedDict": ".deletemodelout", + "Content": ".deltamessage", + "ContentTypedDict": ".deltamessage", + "DeltaMessage": ".deltamessage", + "DeltaMessageTypedDict": ".deltamessage", + "DocumentLibraryTool": ".documentlibrarytool", + "DocumentLibraryToolType": ".documentlibrarytool", + "DocumentLibraryToolTypedDict": ".documentlibrarytool", + "DocumentURLChunk": ".documenturlchunk", + "DocumentURLChunkType": ".documenturlchunk", + "DocumentURLChunkTypedDict": ".documenturlchunk", + "EmbeddingDtype": ".embeddingdtype", + "EmbeddingRequest": ".embeddingrequest", + "EmbeddingRequestInputs": ".embeddingrequest", + "EmbeddingRequestInputsTypedDict": ".embeddingrequest", + "EmbeddingRequestTypedDict": ".embeddingrequest", + "EmbeddingResponse": ".embeddingresponse", + "EmbeddingResponseTypedDict": ".embeddingresponse", + "EmbeddingResponseData": ".embeddingresponsedata", + "EmbeddingResponseDataTypedDict": ".embeddingresponsedata", + "EventOut": ".eventout", + "EventOutTypedDict": ".eventout", + "FilePurpose": ".filepurpose", + "FilesAPIRoutesDeleteFileRequest": ".files_api_routes_delete_fileop", + "FilesAPIRoutesDeleteFileRequestTypedDict": ".files_api_routes_delete_fileop", + "FilesAPIRoutesDownloadFileRequest": ".files_api_routes_download_fileop", + "FilesAPIRoutesDownloadFileRequestTypedDict": ".files_api_routes_download_fileop", + "FilesAPIRoutesGetSignedURLRequest": ".files_api_routes_get_signed_urlop", + "FilesAPIRoutesGetSignedURLRequestTypedDict": ".files_api_routes_get_signed_urlop", + "FilesAPIRoutesListFilesRequest": ".files_api_routes_list_filesop", + "FilesAPIRoutesListFilesRequestTypedDict": ".files_api_routes_list_filesop", + "FilesAPIRoutesRetrieveFileRequest": ".files_api_routes_retrieve_fileop", + "FilesAPIRoutesRetrieveFileRequestTypedDict": ".files_api_routes_retrieve_fileop", + "File": ".files_api_routes_upload_fileop", + "FileTypedDict": ".files_api_routes_upload_fileop", + "FilesAPIRoutesUploadFileMultiPartBodyParams": ".files_api_routes_upload_fileop", + "FilesAPIRoutesUploadFileMultiPartBodyParamsTypedDict": ".files_api_routes_upload_fileop", + "FileSchema": ".fileschema", + "FileSchemaTypedDict": ".fileschema", + "FileSignedURL": ".filesignedurl", + "FileSignedURLTypedDict": ".filesignedurl", + "FIMCompletionRequest": ".fimcompletionrequest", + "FIMCompletionRequestStop": ".fimcompletionrequest", + "FIMCompletionRequestStopTypedDict": ".fimcompletionrequest", + "FIMCompletionRequestTypedDict": ".fimcompletionrequest", + "FIMCompletionResponse": ".fimcompletionresponse", + "FIMCompletionResponseTypedDict": ".fimcompletionresponse", + "FIMCompletionStreamRequest": ".fimcompletionstreamrequest", + "FIMCompletionStreamRequestStop": ".fimcompletionstreamrequest", + "FIMCompletionStreamRequestStopTypedDict": ".fimcompletionstreamrequest", + "FIMCompletionStreamRequestTypedDict": ".fimcompletionstreamrequest", + "FineTuneableModelType": ".finetuneablemodeltype", + "FTClassifierLossFunction": ".ftclassifierlossfunction", + "FTModelCapabilitiesOut": ".ftmodelcapabilitiesout", + "FTModelCapabilitiesOutTypedDict": ".ftmodelcapabilitiesout", + "FTModelCard": ".ftmodelcard", + "FTModelCardType": ".ftmodelcard", + "FTModelCardTypedDict": ".ftmodelcard", + "Function": ".function", + "FunctionTypedDict": ".function", + "Arguments": ".functioncall", + "ArgumentsTypedDict": ".functioncall", + "FunctionCall": ".functioncall", + "FunctionCallTypedDict": ".functioncall", + "FunctionCallEntry": ".functioncallentry", + "FunctionCallEntryObject": ".functioncallentry", + "FunctionCallEntryType": ".functioncallentry", + "FunctionCallEntryTypedDict": ".functioncallentry", + "FunctionCallEntryArguments": ".functioncallentryarguments", + "FunctionCallEntryArgumentsTypedDict": ".functioncallentryarguments", + "FunctionCallEvent": ".functioncallevent", + "FunctionCallEventType": ".functioncallevent", + "FunctionCallEventTypedDict": ".functioncallevent", + "FunctionName": ".functionname", + "FunctionNameTypedDict": ".functionname", + "FunctionResultEntry": ".functionresultentry", + "FunctionResultEntryObject": ".functionresultentry", + "FunctionResultEntryType": ".functionresultentry", + "FunctionResultEntryTypedDict": ".functionresultentry", + "FunctionTool": ".functiontool", + "FunctionToolType": ".functiontool", + "FunctionToolTypedDict": ".functiontool", + "GithubRepositoryIn": ".githubrepositoryin", + "GithubRepositoryInType": ".githubrepositoryin", + "GithubRepositoryInTypedDict": ".githubrepositoryin", + "GithubRepositoryOut": ".githubrepositoryout", + "GithubRepositoryOutType": ".githubrepositoryout", + "GithubRepositoryOutTypedDict": ".githubrepositoryout", + "HTTPValidationError": ".httpvalidationerror", + "HTTPValidationErrorData": ".httpvalidationerror", + "ImageGenerationTool": ".imagegenerationtool", + "ImageGenerationToolType": ".imagegenerationtool", + "ImageGenerationToolTypedDict": ".imagegenerationtool", + "ImageURL": ".imageurl", + "ImageURLTypedDict": ".imageurl", + "ImageURLChunk": ".imageurlchunk", + "ImageURLChunkImageURL": ".imageurlchunk", + "ImageURLChunkImageURLTypedDict": ".imageurlchunk", + "ImageURLChunkType": ".imageurlchunk", + "ImageURLChunkTypedDict": ".imageurlchunk", + "InputEntries": ".inputentries", + "InputEntriesTypedDict": ".inputentries", + "Inputs": ".inputs", + "InputsTypedDict": ".inputs", + "InstructRequestInputs": ".inputs", + "InstructRequestInputsMessages": ".inputs", + "InstructRequestInputsMessagesTypedDict": ".inputs", + "InstructRequestInputsTypedDict": ".inputs", + "InstructRequest": ".instructrequest", + "InstructRequestMessages": ".instructrequest", + "InstructRequestMessagesTypedDict": ".instructrequest", + "InstructRequestTypedDict": ".instructrequest", + "Hyperparameters": ".jobin", + "HyperparametersTypedDict": ".jobin", + "JobIn": ".jobin", + "JobInIntegrations": ".jobin", + "JobInIntegrationsTypedDict": ".jobin", + "JobInRepositories": ".jobin", + "JobInRepositoriesTypedDict": ".jobin", + "JobInTypedDict": ".jobin", + "JobMetadataOut": ".jobmetadataout", + "JobMetadataOutTypedDict": ".jobmetadataout", + "JobsAPIRoutesBatchCancelBatchJobRequest": ".jobs_api_routes_batch_cancel_batch_jobop", + "JobsAPIRoutesBatchCancelBatchJobRequestTypedDict": ".jobs_api_routes_batch_cancel_batch_jobop", + "JobsAPIRoutesBatchGetBatchJobRequest": ".jobs_api_routes_batch_get_batch_jobop", + "JobsAPIRoutesBatchGetBatchJobRequestTypedDict": ".jobs_api_routes_batch_get_batch_jobop", + "JobsAPIRoutesBatchGetBatchJobsRequest": ".jobs_api_routes_batch_get_batch_jobsop", + "JobsAPIRoutesBatchGetBatchJobsRequestTypedDict": ".jobs_api_routes_batch_get_batch_jobsop", + "JobsAPIRoutesFineTuningArchiveFineTunedModelRequest": ".jobs_api_routes_fine_tuning_archive_fine_tuned_modelop", + "JobsAPIRoutesFineTuningArchiveFineTunedModelRequestTypedDict": ".jobs_api_routes_fine_tuning_archive_fine_tuned_modelop", + "JobsAPIRoutesFineTuningCancelFineTuningJobRequest": ".jobs_api_routes_fine_tuning_cancel_fine_tuning_jobop", + "JobsAPIRoutesFineTuningCancelFineTuningJobRequestTypedDict": ".jobs_api_routes_fine_tuning_cancel_fine_tuning_jobop", + "JobsAPIRoutesFineTuningCancelFineTuningJobResponse": ".jobs_api_routes_fine_tuning_cancel_fine_tuning_jobop", + "JobsAPIRoutesFineTuningCancelFineTuningJobResponseTypedDict": ".jobs_api_routes_fine_tuning_cancel_fine_tuning_jobop", + "JobsAPIRoutesFineTuningCreateFineTuningJobResponse": ".jobs_api_routes_fine_tuning_create_fine_tuning_jobop", + "JobsAPIRoutesFineTuningCreateFineTuningJobResponseTypedDict": ".jobs_api_routes_fine_tuning_create_fine_tuning_jobop", + "Response1": ".jobs_api_routes_fine_tuning_create_fine_tuning_jobop", + "Response1TypedDict": ".jobs_api_routes_fine_tuning_create_fine_tuning_jobop", + "JobsAPIRoutesFineTuningGetFineTuningJobRequest": ".jobs_api_routes_fine_tuning_get_fine_tuning_jobop", + "JobsAPIRoutesFineTuningGetFineTuningJobRequestTypedDict": ".jobs_api_routes_fine_tuning_get_fine_tuning_jobop", + "JobsAPIRoutesFineTuningGetFineTuningJobResponse": ".jobs_api_routes_fine_tuning_get_fine_tuning_jobop", + "JobsAPIRoutesFineTuningGetFineTuningJobResponseTypedDict": ".jobs_api_routes_fine_tuning_get_fine_tuning_jobop", + "JobsAPIRoutesFineTuningGetFineTuningJobsRequest": ".jobs_api_routes_fine_tuning_get_fine_tuning_jobsop", + "JobsAPIRoutesFineTuningGetFineTuningJobsRequestTypedDict": ".jobs_api_routes_fine_tuning_get_fine_tuning_jobsop", + "QueryParamStatus": ".jobs_api_routes_fine_tuning_get_fine_tuning_jobsop", + "JobsAPIRoutesFineTuningStartFineTuningJobRequest": ".jobs_api_routes_fine_tuning_start_fine_tuning_jobop", + "JobsAPIRoutesFineTuningStartFineTuningJobRequestTypedDict": ".jobs_api_routes_fine_tuning_start_fine_tuning_jobop", + "JobsAPIRoutesFineTuningStartFineTuningJobResponse": ".jobs_api_routes_fine_tuning_start_fine_tuning_jobop", + "JobsAPIRoutesFineTuningStartFineTuningJobResponseTypedDict": ".jobs_api_routes_fine_tuning_start_fine_tuning_jobop", + "JobsAPIRoutesFineTuningUnarchiveFineTunedModelRequest": ".jobs_api_routes_fine_tuning_unarchive_fine_tuned_modelop", + "JobsAPIRoutesFineTuningUnarchiveFineTunedModelRequestTypedDict": ".jobs_api_routes_fine_tuning_unarchive_fine_tuned_modelop", + "JobsAPIRoutesFineTuningUpdateFineTunedModelRequest": ".jobs_api_routes_fine_tuning_update_fine_tuned_modelop", + "JobsAPIRoutesFineTuningUpdateFineTunedModelRequestTypedDict": ".jobs_api_routes_fine_tuning_update_fine_tuned_modelop", + "JobsAPIRoutesFineTuningUpdateFineTunedModelResponse": ".jobs_api_routes_fine_tuning_update_fine_tuned_modelop", + "JobsAPIRoutesFineTuningUpdateFineTunedModelResponseTypedDict": ".jobs_api_routes_fine_tuning_update_fine_tuned_modelop", + "JobsOut": ".jobsout", + "JobsOutData": ".jobsout", + "JobsOutDataTypedDict": ".jobsout", + "JobsOutObject": ".jobsout", + "JobsOutTypedDict": ".jobsout", + "JSONSchema": ".jsonschema", + "JSONSchemaTypedDict": ".jsonschema", + "LegacyJobMetadataOut": ".legacyjobmetadataout", + "LegacyJobMetadataOutObject": ".legacyjobmetadataout", + "LegacyJobMetadataOutTypedDict": ".legacyjobmetadataout", + "ListFilesOut": ".listfilesout", + "ListFilesOutTypedDict": ".listfilesout", + "MessageEntries": ".messageentries", + "MessageEntriesTypedDict": ".messageentries", + "MessageInputContentChunks": ".messageinputcontentchunks", + "MessageInputContentChunksTypedDict": ".messageinputcontentchunks", + "MessageInputEntry": ".messageinputentry", + "MessageInputEntryContent": ".messageinputentry", + "MessageInputEntryContentTypedDict": ".messageinputentry", + "MessageInputEntryRole": ".messageinputentry", + "MessageInputEntryType": ".messageinputentry", + "MessageInputEntryTypedDict": ".messageinputentry", + "Object": ".messageinputentry", + "MessageOutputContentChunks": ".messageoutputcontentchunks", + "MessageOutputContentChunksTypedDict": ".messageoutputcontentchunks", + "MessageOutputEntry": ".messageoutputentry", + "MessageOutputEntryContent": ".messageoutputentry", + "MessageOutputEntryContentTypedDict": ".messageoutputentry", + "MessageOutputEntryObject": ".messageoutputentry", + "MessageOutputEntryRole": ".messageoutputentry", + "MessageOutputEntryType": ".messageoutputentry", + "MessageOutputEntryTypedDict": ".messageoutputentry", + "MessageOutputEvent": ".messageoutputevent", + "MessageOutputEventContent": ".messageoutputevent", + "MessageOutputEventContentTypedDict": ".messageoutputevent", + "MessageOutputEventRole": ".messageoutputevent", + "MessageOutputEventType": ".messageoutputevent", + "MessageOutputEventTypedDict": ".messageoutputevent", + "MetricOut": ".metricout", + "MetricOutTypedDict": ".metricout", + "MistralPromptMode": ".mistralpromptmode", + "ModelCapabilities": ".modelcapabilities", + "ModelCapabilitiesTypedDict": ".modelcapabilities", + "ModelConversation": ".modelconversation", + "ModelConversationObject": ".modelconversation", + "ModelConversationTools": ".modelconversation", + "ModelConversationToolsTypedDict": ".modelconversation", + "ModelConversationTypedDict": ".modelconversation", + "Data": ".modellist", + "DataTypedDict": ".modellist", + "ModelList": ".modellist", + "ModelListTypedDict": ".modellist", + "ModerationObject": ".moderationobject", + "ModerationObjectTypedDict": ".moderationobject", + "ModerationResponse": ".moderationresponse", + "ModerationResponseTypedDict": ".moderationresponse", + "OCRImageObject": ".ocrimageobject", + "OCRImageObjectTypedDict": ".ocrimageobject", + "OCRPageDimensions": ".ocrpagedimensions", + "OCRPageDimensionsTypedDict": ".ocrpagedimensions", + "OCRPageObject": ".ocrpageobject", + "OCRPageObjectTypedDict": ".ocrpageobject", + "Document": ".ocrrequest", + "DocumentTypedDict": ".ocrrequest", + "OCRRequest": ".ocrrequest", + "OCRRequestTypedDict": ".ocrrequest", + "OCRResponse": ".ocrresponse", + "OCRResponseTypedDict": ".ocrresponse", + "OCRUsageInfo": ".ocrusageinfo", + "OCRUsageInfoTypedDict": ".ocrusageinfo", + "OutputContentChunks": ".outputcontentchunks", + "OutputContentChunksTypedDict": ".outputcontentchunks", + "Prediction": ".prediction", + "PredictionTypedDict": ".prediction", + "ReferenceChunk": ".referencechunk", + "ReferenceChunkType": ".referencechunk", + "ReferenceChunkTypedDict": ".referencechunk", + "ResponseDoneEvent": ".responsedoneevent", + "ResponseDoneEventType": ".responsedoneevent", + "ResponseDoneEventTypedDict": ".responsedoneevent", + "ResponseErrorEvent": ".responseerrorevent", + "ResponseErrorEventType": ".responseerrorevent", + "ResponseErrorEventTypedDict": ".responseerrorevent", + "ResponseFormat": ".responseformat", + "ResponseFormatTypedDict": ".responseformat", + "ResponseFormats": ".responseformats", + "ResponseStartedEvent": ".responsestartedevent", + "ResponseStartedEventType": ".responsestartedevent", + "ResponseStartedEventTypedDict": ".responsestartedevent", + "RetrieveModelV1ModelsModelIDGetRequest": ".retrieve_model_v1_models_model_id_getop", + "RetrieveModelV1ModelsModelIDGetRequestTypedDict": ".retrieve_model_v1_models_model_id_getop", + "RetrieveModelV1ModelsModelIDGetResponseRetrieveModelV1ModelsModelIDGet": ".retrieve_model_v1_models_model_id_getop", + "RetrieveModelV1ModelsModelIDGetResponseRetrieveModelV1ModelsModelIDGetTypedDict": ".retrieve_model_v1_models_model_id_getop", + "RetrieveFileOut": ".retrievefileout", + "RetrieveFileOutTypedDict": ".retrievefileout", + "SampleType": ".sampletype", + "SDKError": ".sdkerror", + "Security": ".security", + "SecurityTypedDict": ".security", + "Source": ".source", + "SSETypes": ".ssetypes", + "Role": ".systemmessage", + "SystemMessage": ".systemmessage", + "SystemMessageContent": ".systemmessage", + "SystemMessageContentTypedDict": ".systemmessage", + "SystemMessageTypedDict": ".systemmessage", + "TextChunk": ".textchunk", + "TextChunkType": ".textchunk", + "TextChunkTypedDict": ".textchunk", + "Tool": ".tool", + "ToolTypedDict": ".tool", + "ToolCall": ".toolcall", + "ToolCallTypedDict": ".toolcall", + "ToolChoice": ".toolchoice", + "ToolChoiceTypedDict": ".toolchoice", + "ToolChoiceEnum": ".toolchoiceenum", + "ToolExecutionDoneEvent": ".toolexecutiondoneevent", + "ToolExecutionDoneEventType": ".toolexecutiondoneevent", + "ToolExecutionDoneEventTypedDict": ".toolexecutiondoneevent", + "ToolExecutionEntry": ".toolexecutionentry", + "ToolExecutionEntryObject": ".toolexecutionentry", + "ToolExecutionEntryType": ".toolexecutionentry", + "ToolExecutionEntryTypedDict": ".toolexecutionentry", + "ToolExecutionStartedEvent": ".toolexecutionstartedevent", + "ToolExecutionStartedEventType": ".toolexecutionstartedevent", + "ToolExecutionStartedEventTypedDict": ".toolexecutionstartedevent", + "ToolFileChunk": ".toolfilechunk", + "ToolFileChunkType": ".toolfilechunk", + "ToolFileChunkTypedDict": ".toolfilechunk", + "ToolMessage": ".toolmessage", + "ToolMessageContent": ".toolmessage", + "ToolMessageContentTypedDict": ".toolmessage", + "ToolMessageRole": ".toolmessage", + "ToolMessageTypedDict": ".toolmessage", + "ToolReferenceChunk": ".toolreferencechunk", + "ToolReferenceChunkType": ".toolreferencechunk", + "ToolReferenceChunkTypedDict": ".toolreferencechunk", + "ToolTypes": ".tooltypes", + "TrainingFile": ".trainingfile", + "TrainingFileTypedDict": ".trainingfile", + "UnarchiveFTModelOut": ".unarchiveftmodelout", + "UnarchiveFTModelOutObject": ".unarchiveftmodelout", + "UnarchiveFTModelOutTypedDict": ".unarchiveftmodelout", + "UpdateFTModelIn": ".updateftmodelin", + "UpdateFTModelInTypedDict": ".updateftmodelin", + "UploadFileOut": ".uploadfileout", + "UploadFileOutTypedDict": ".uploadfileout", + "UsageInfo": ".usageinfo", + "UsageInfoTypedDict": ".usageinfo", + "UserMessage": ".usermessage", + "UserMessageContent": ".usermessage", + "UserMessageContentTypedDict": ".usermessage", + "UserMessageRole": ".usermessage", + "UserMessageTypedDict": ".usermessage", + "Loc": ".validationerror", + "LocTypedDict": ".validationerror", + "ValidationError": ".validationerror", + "ValidationErrorTypedDict": ".validationerror", + "WandbIntegration": ".wandbintegration", + "WandbIntegrationType": ".wandbintegration", + "WandbIntegrationTypedDict": ".wandbintegration", + "WandbIntegrationOut": ".wandbintegrationout", + "WandbIntegrationOutType": ".wandbintegrationout", + "WandbIntegrationOutTypedDict": ".wandbintegrationout", + "WebSearchPremiumTool": ".websearchpremiumtool", + "WebSearchPremiumToolType": ".websearchpremiumtool", + "WebSearchPremiumToolTypedDict": ".websearchpremiumtool", + "WebSearchTool": ".websearchtool", + "WebSearchToolType": ".websearchtool", + "WebSearchToolTypedDict": ".websearchtool", +} + + +def __getattr__(attr_name: str) -> object: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError( + f"No {attr_name} found in _dynamic_imports for module name -> {__name__} " + ) + + try: + module = import_module(module_name, __package__) + result = getattr(module, attr_name) + return result + except ImportError as e: + raise ImportError( + f"Failed to import {attr_name} from {module_name}: {e}" + ) from e + except AttributeError as e: + raise AttributeError( + f"Failed to get {attr_name} from {module_name}: {e}" + ) from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) diff --git a/src/mistralai/models/agent.py b/src/mistralai/models/agent.py index ce750606..b6bf17ab 100644 --- a/src/mistralai/models/agent.py +++ b/src/mistralai/models/agent.py @@ -108,7 +108,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/agentconversation.py b/src/mistralai/models/agentconversation.py index 66d6d9f5..42ab84f5 100644 --- a/src/mistralai/models/agentconversation.py +++ b/src/mistralai/models/agentconversation.py @@ -50,7 +50,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/agentcreationrequest.py b/src/mistralai/models/agentcreationrequest.py index 7e0a1fa2..83a27028 100644 --- a/src/mistralai/models/agentcreationrequest.py +++ b/src/mistralai/models/agentcreationrequest.py @@ -88,7 +88,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/agenthandoffentry.py b/src/mistralai/models/agenthandoffentry.py index b8e356c9..44bfe0f2 100644 --- a/src/mistralai/models/agenthandoffentry.py +++ b/src/mistralai/models/agenthandoffentry.py @@ -54,7 +54,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/agentscompletionrequest.py b/src/mistralai/models/agentscompletionrequest.py index e99dcfc2..2e3c35f8 100644 --- a/src/mistralai/models/agentscompletionrequest.py +++ b/src/mistralai/models/agentscompletionrequest.py @@ -157,7 +157,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/agentscompletionstreamrequest.py b/src/mistralai/models/agentscompletionstreamrequest.py index b4b423f5..a74842f6 100644 --- a/src/mistralai/models/agentscompletionstreamrequest.py +++ b/src/mistralai/models/agentscompletionstreamrequest.py @@ -155,7 +155,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/agentupdaterequest.py b/src/mistralai/models/agentupdaterequest.py index ebb656d6..f6fcb27a 100644 --- a/src/mistralai/models/agentupdaterequest.py +++ b/src/mistralai/models/agentupdaterequest.py @@ -90,7 +90,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/assistantmessage.py b/src/mistralai/models/assistantmessage.py index fd540d99..18841a72 100644 --- a/src/mistralai/models/assistantmessage.py +++ b/src/mistralai/models/assistantmessage.py @@ -50,7 +50,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/basemodelcard.py b/src/mistralai/models/basemodelcard.py index edb81741..8a4e3710 100644 --- a/src/mistralai/models/basemodelcard.py +++ b/src/mistralai/models/basemodelcard.py @@ -84,7 +84,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/batchjobin.py b/src/mistralai/models/batchjobin.py index e249e526..6fcce0f0 100644 --- a/src/mistralai/models/batchjobin.py +++ b/src/mistralai/models/batchjobin.py @@ -39,7 +39,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/batchjobout.py b/src/mistralai/models/batchjobout.py index bf873f41..2b49057b 100644 --- a/src/mistralai/models/batchjobout.py +++ b/src/mistralai/models/batchjobout.py @@ -90,7 +90,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/chatcompletionrequest.py b/src/mistralai/models/chatcompletionrequest.py index 004cc011..ac90de32 100644 --- a/src/mistralai/models/chatcompletionrequest.py +++ b/src/mistralai/models/chatcompletionrequest.py @@ -178,7 +178,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/chatcompletionstreamrequest.py b/src/mistralai/models/chatcompletionstreamrequest.py index 78a85bef..00f57144 100644 --- a/src/mistralai/models/chatcompletionstreamrequest.py +++ b/src/mistralai/models/chatcompletionstreamrequest.py @@ -180,7 +180,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/classifierdetailedjobout.py b/src/mistralai/models/classifierdetailedjobout.py index 971d529f..da5bd281 100644 --- a/src/mistralai/models/classifierdetailedjobout.py +++ b/src/mistralai/models/classifierdetailedjobout.py @@ -135,7 +135,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/classifierftmodelout.py b/src/mistralai/models/classifierftmodelout.py index 846a20a2..4143d0e8 100644 --- a/src/mistralai/models/classifierftmodelout.py +++ b/src/mistralai/models/classifierftmodelout.py @@ -80,7 +80,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/classifierjobout.py b/src/mistralai/models/classifierjobout.py index 66011b4a..c8df6da3 100644 --- a/src/mistralai/models/classifierjobout.py +++ b/src/mistralai/models/classifierjobout.py @@ -144,7 +144,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/classifiertargetin.py b/src/mistralai/models/classifiertargetin.py index c9e4b406..d8a060e4 100644 --- a/src/mistralai/models/classifiertargetin.py +++ b/src/mistralai/models/classifiertargetin.py @@ -34,7 +34,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/classifiertrainingparameters.py b/src/mistralai/models/classifiertrainingparameters.py index f0908e81..718beeac 100644 --- a/src/mistralai/models/classifiertrainingparameters.py +++ b/src/mistralai/models/classifiertrainingparameters.py @@ -52,7 +52,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/classifiertrainingparametersin.py b/src/mistralai/models/classifiertrainingparametersin.py index f1f16cfb..9868843f 100644 --- a/src/mistralai/models/classifiertrainingparametersin.py +++ b/src/mistralai/models/classifiertrainingparametersin.py @@ -64,7 +64,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/completionargs.py b/src/mistralai/models/completionargs.py index 2c5cf213..04e032ac 100644 --- a/src/mistralai/models/completionargs.py +++ b/src/mistralai/models/completionargs.py @@ -79,7 +79,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/completiondetailedjobout.py b/src/mistralai/models/completiondetailedjobout.py index 598a5e20..8fb1b62a 100644 --- a/src/mistralai/models/completiondetailedjobout.py +++ b/src/mistralai/models/completiondetailedjobout.py @@ -141,7 +141,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/completionftmodelout.py b/src/mistralai/models/completionftmodelout.py index 71ab1a45..ad04d73e 100644 --- a/src/mistralai/models/completionftmodelout.py +++ b/src/mistralai/models/completionftmodelout.py @@ -76,7 +76,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/completionjobout.py b/src/mistralai/models/completionjobout.py index 3932dae3..bed67b50 100644 --- a/src/mistralai/models/completionjobout.py +++ b/src/mistralai/models/completionjobout.py @@ -154,7 +154,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/completionresponsestreamchoice.py b/src/mistralai/models/completionresponsestreamchoice.py index b3b2a287..2426148c 100644 --- a/src/mistralai/models/completionresponsestreamchoice.py +++ b/src/mistralai/models/completionresponsestreamchoice.py @@ -41,7 +41,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/completiontrainingparameters.py b/src/mistralai/models/completiontrainingparameters.py index 33b21ec9..0200e81c 100644 --- a/src/mistralai/models/completiontrainingparameters.py +++ b/src/mistralai/models/completiontrainingparameters.py @@ -57,7 +57,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/completiontrainingparametersin.py b/src/mistralai/models/completiontrainingparametersin.py index 92f8d99a..1f74bb9d 100644 --- a/src/mistralai/models/completiontrainingparametersin.py +++ b/src/mistralai/models/completiontrainingparametersin.py @@ -69,7 +69,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/conversationrequest.py b/src/mistralai/models/conversationrequest.py index 48cc6fe7..0fcca512 100644 --- a/src/mistralai/models/conversationrequest.py +++ b/src/mistralai/models/conversationrequest.py @@ -112,7 +112,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/conversationstreamrequest.py b/src/mistralai/models/conversationstreamrequest.py index a1c21d9a..0880727e 100644 --- a/src/mistralai/models/conversationstreamrequest.py +++ b/src/mistralai/models/conversationstreamrequest.py @@ -114,7 +114,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/conversationusageinfo.py b/src/mistralai/models/conversationusageinfo.py index 44ffd5e5..9ae6f4fb 100644 --- a/src/mistralai/models/conversationusageinfo.py +++ b/src/mistralai/models/conversationusageinfo.py @@ -42,7 +42,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/deltamessage.py b/src/mistralai/models/deltamessage.py index b46cf641..88aefe7f 100644 --- a/src/mistralai/models/deltamessage.py +++ b/src/mistralai/models/deltamessage.py @@ -40,7 +40,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/documenturlchunk.py b/src/mistralai/models/documenturlchunk.py index 29945102..33f29ba8 100644 --- a/src/mistralai/models/documenturlchunk.py +++ b/src/mistralai/models/documenturlchunk.py @@ -35,7 +35,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/embeddingrequest.py b/src/mistralai/models/embeddingrequest.py index 56cccc72..4b5db550 100644 --- a/src/mistralai/models/embeddingrequest.py +++ b/src/mistralai/models/embeddingrequest.py @@ -51,7 +51,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/eventout.py b/src/mistralai/models/eventout.py index a9f22874..32819034 100644 --- a/src/mistralai/models/eventout.py +++ b/src/mistralai/models/eventout.py @@ -34,7 +34,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/files_api_routes_list_filesop.py b/src/mistralai/models/files_api_routes_list_filesop.py index 03a33af7..5060c3b8 100644 --- a/src/mistralai/models/files_api_routes_list_filesop.py +++ b/src/mistralai/models/files_api_routes_list_filesop.py @@ -75,7 +75,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/fileschema.py b/src/mistralai/models/fileschema.py index 4cf51c02..d687f222 100644 --- a/src/mistralai/models/fileschema.py +++ b/src/mistralai/models/fileschema.py @@ -63,7 +63,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/fimcompletionrequest.py b/src/mistralai/models/fimcompletionrequest.py index 01f8b2d1..06210139 100644 --- a/src/mistralai/models/fimcompletionrequest.py +++ b/src/mistralai/models/fimcompletionrequest.py @@ -104,7 +104,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/fimcompletionstreamrequest.py b/src/mistralai/models/fimcompletionstreamrequest.py index cc4cf6e8..05cc345b 100644 --- a/src/mistralai/models/fimcompletionstreamrequest.py +++ b/src/mistralai/models/fimcompletionstreamrequest.py @@ -102,7 +102,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/ftmodelcard.py b/src/mistralai/models/ftmodelcard.py index 9a640a28..48937f48 100644 --- a/src/mistralai/models/ftmodelcard.py +++ b/src/mistralai/models/ftmodelcard.py @@ -100,7 +100,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/functioncallentry.py b/src/mistralai/models/functioncallentry.py index 821e7c14..1e47fda9 100644 --- a/src/mistralai/models/functioncallentry.py +++ b/src/mistralai/models/functioncallentry.py @@ -55,7 +55,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/functionresultentry.py b/src/mistralai/models/functionresultentry.py index 64040954..f09e11ae 100644 --- a/src/mistralai/models/functionresultentry.py +++ b/src/mistralai/models/functionresultentry.py @@ -48,7 +48,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/githubrepositoryin.py b/src/mistralai/models/githubrepositoryin.py index eda4ee0b..801c0540 100644 --- a/src/mistralai/models/githubrepositoryin.py +++ b/src/mistralai/models/githubrepositoryin.py @@ -42,7 +42,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/githubrepositoryout.py b/src/mistralai/models/githubrepositoryout.py index 72213b6f..0d74c17a 100644 --- a/src/mistralai/models/githubrepositoryout.py +++ b/src/mistralai/models/githubrepositoryout.py @@ -42,7 +42,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/imageurl.py b/src/mistralai/models/imageurl.py index 1e8276ad..6f077b69 100644 --- a/src/mistralai/models/imageurl.py +++ b/src/mistralai/models/imageurl.py @@ -26,7 +26,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/jobin.py b/src/mistralai/models/jobin.py index cb535e46..aa0cd06c 100644 --- a/src/mistralai/models/jobin.py +++ b/src/mistralai/models/jobin.py @@ -120,7 +120,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/jobmetadataout.py b/src/mistralai/models/jobmetadataout.py index d1eeb4f2..10ef781e 100644 --- a/src/mistralai/models/jobmetadataout.py +++ b/src/mistralai/models/jobmetadataout.py @@ -57,7 +57,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/jobs_api_routes_batch_get_batch_jobsop.py b/src/mistralai/models/jobs_api_routes_batch_get_batch_jobsop.py index fa2c6ed3..39261226 100644 --- a/src/mistralai/models/jobs_api_routes_batch_get_batch_jobsop.py +++ b/src/mistralai/models/jobs_api_routes_batch_get_batch_jobsop.py @@ -74,7 +74,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/jobs_api_routes_fine_tuning_get_fine_tuning_jobsop.py b/src/mistralai/models/jobs_api_routes_fine_tuning_get_fine_tuning_jobsop.py index 710436c9..9aec8eb2 100644 --- a/src/mistralai/models/jobs_api_routes_fine_tuning_get_fine_tuning_jobsop.py +++ b/src/mistralai/models/jobs_api_routes_fine_tuning_get_fine_tuning_jobsop.py @@ -135,7 +135,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/jsonschema.py b/src/mistralai/models/jsonschema.py index 5d96d1fd..e2b6a45e 100644 --- a/src/mistralai/models/jsonschema.py +++ b/src/mistralai/models/jsonschema.py @@ -34,7 +34,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/legacyjobmetadataout.py b/src/mistralai/models/legacyjobmetadataout.py index 1741570e..d878173b 100644 --- a/src/mistralai/models/legacyjobmetadataout.py +++ b/src/mistralai/models/legacyjobmetadataout.py @@ -98,7 +98,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/messageinputentry.py b/src/mistralai/models/messageinputentry.py index 3d642cdf..0ea6f24c 100644 --- a/src/mistralai/models/messageinputentry.py +++ b/src/mistralai/models/messageinputentry.py @@ -68,7 +68,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/messageoutputentry.py b/src/mistralai/models/messageoutputentry.py index abb361e7..1c2e4107 100644 --- a/src/mistralai/models/messageoutputentry.py +++ b/src/mistralai/models/messageoutputentry.py @@ -79,7 +79,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/messageoutputevent.py b/src/mistralai/models/messageoutputevent.py index 328874d6..474cb081 100644 --- a/src/mistralai/models/messageoutputevent.py +++ b/src/mistralai/models/messageoutputevent.py @@ -72,7 +72,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/metricout.py b/src/mistralai/models/metricout.py index 7583d927..930b5c21 100644 --- a/src/mistralai/models/metricout.py +++ b/src/mistralai/models/metricout.py @@ -33,7 +33,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/modelconversation.py b/src/mistralai/models/modelconversation.py index 3e927192..4ced79ea 100644 --- a/src/mistralai/models/modelconversation.py +++ b/src/mistralai/models/modelconversation.py @@ -106,7 +106,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/ocrimageobject.py b/src/mistralai/models/ocrimageobject.py index 78e37c1f..cec0acf4 100644 --- a/src/mistralai/models/ocrimageobject.py +++ b/src/mistralai/models/ocrimageobject.py @@ -62,7 +62,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/ocrpageobject.py b/src/mistralai/models/ocrpageobject.py index c3ef8916..94624a16 100644 --- a/src/mistralai/models/ocrpageobject.py +++ b/src/mistralai/models/ocrpageobject.py @@ -43,7 +43,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/ocrrequest.py b/src/mistralai/models/ocrrequest.py index 4f9dfd47..53ad6111 100644 --- a/src/mistralai/models/ocrrequest.py +++ b/src/mistralai/models/ocrrequest.py @@ -91,7 +91,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/ocrresponse.py b/src/mistralai/models/ocrresponse.py index df3b7d18..7b65bee7 100644 --- a/src/mistralai/models/ocrresponse.py +++ b/src/mistralai/models/ocrresponse.py @@ -41,7 +41,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/ocrusageinfo.py b/src/mistralai/models/ocrusageinfo.py index 9dced73b..36c9f826 100644 --- a/src/mistralai/models/ocrusageinfo.py +++ b/src/mistralai/models/ocrusageinfo.py @@ -30,7 +30,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/responseformat.py b/src/mistralai/models/responseformat.py index 17424afb..c9319989 100644 --- a/src/mistralai/models/responseformat.py +++ b/src/mistralai/models/responseformat.py @@ -31,7 +31,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/retrievefileout.py b/src/mistralai/models/retrievefileout.py index 70d688cc..e5f91449 100644 --- a/src/mistralai/models/retrievefileout.py +++ b/src/mistralai/models/retrievefileout.py @@ -66,7 +66,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/toolexecutionentry.py b/src/mistralai/models/toolexecutionentry.py index 20c9bf19..533752ad 100644 --- a/src/mistralai/models/toolexecutionentry.py +++ b/src/mistralai/models/toolexecutionentry.py @@ -49,7 +49,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/toolfilechunk.py b/src/mistralai/models/toolfilechunk.py index 1d28e2db..77c07d6d 100644 --- a/src/mistralai/models/toolfilechunk.py +++ b/src/mistralai/models/toolfilechunk.py @@ -40,7 +40,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/toolmessage.py b/src/mistralai/models/toolmessage.py index bee9c700..82f62e0f 100644 --- a/src/mistralai/models/toolmessage.py +++ b/src/mistralai/models/toolmessage.py @@ -45,7 +45,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/toolreferencechunk.py b/src/mistralai/models/toolreferencechunk.py index 84f72696..c052340d 100644 --- a/src/mistralai/models/toolreferencechunk.py +++ b/src/mistralai/models/toolreferencechunk.py @@ -40,7 +40,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/updateftmodelin.py b/src/mistralai/models/updateftmodelin.py index 603f031c..1bd0eaf2 100644 --- a/src/mistralai/models/updateftmodelin.py +++ b/src/mistralai/models/updateftmodelin.py @@ -26,7 +26,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/uploadfileout.py b/src/mistralai/models/uploadfileout.py index cf783862..3a8b7337 100644 --- a/src/mistralai/models/uploadfileout.py +++ b/src/mistralai/models/uploadfileout.py @@ -63,7 +63,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/usermessage.py b/src/mistralai/models/usermessage.py index dac2618a..049bc755 100644 --- a/src/mistralai/models/usermessage.py +++ b/src/mistralai/models/usermessage.py @@ -39,7 +39,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/wandbintegration.py b/src/mistralai/models/wandbintegration.py index 2bafc035..0789b648 100644 --- a/src/mistralai/models/wandbintegration.py +++ b/src/mistralai/models/wandbintegration.py @@ -45,7 +45,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models/wandbintegrationout.py b/src/mistralai/models/wandbintegrationout.py index bb624bd8..a1c2f570 100644 --- a/src/mistralai/models/wandbintegrationout.py +++ b/src/mistralai/models/wandbintegrationout.py @@ -43,7 +43,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/mistralai/models_.py b/src/mistralai/models_.py index 96aab468..86259e17 100644 --- a/src/mistralai/models_.py +++ b/src/mistralai/models_.py @@ -63,6 +63,7 @@ def list( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="list_models_v1_models_get", oauth2_scopes=[], @@ -155,6 +156,7 @@ async def list_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="list_models_v1_models_get", oauth2_scopes=[], @@ -254,6 +256,7 @@ def retrieve( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="retrieve_model_v1_models__model_id__get", oauth2_scopes=[], @@ -356,6 +359,7 @@ async def retrieve_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="retrieve_model_v1_models__model_id__get", oauth2_scopes=[], @@ -458,6 +462,7 @@ def delete( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="delete_model_v1_models__model_id__delete", oauth2_scopes=[], @@ -557,6 +562,7 @@ async def delete_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="delete_model_v1_models__model_id__delete", oauth2_scopes=[], @@ -667,6 +673,7 @@ def update( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="jobs_api_routes_fine_tuning_update_fine_tuned_model", oauth2_scopes=[], @@ -774,6 +781,7 @@ async def update_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="jobs_api_routes_fine_tuning_update_fine_tuned_model", oauth2_scopes=[], @@ -870,6 +878,7 @@ def archive( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="jobs_api_routes_fine_tuning_archive_fine_tuned_model", oauth2_scopes=[], @@ -963,6 +972,7 @@ async def archive_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="jobs_api_routes_fine_tuning_archive_fine_tuned_model", oauth2_scopes=[], @@ -1056,6 +1066,7 @@ def unarchive( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="jobs_api_routes_fine_tuning_unarchive_fine_tuned_model", oauth2_scopes=[], @@ -1149,6 +1160,7 @@ async def unarchive_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="jobs_api_routes_fine_tuning_unarchive_fine_tuned_model", oauth2_scopes=[], diff --git a/src/mistralai/ocr.py b/src/mistralai/ocr.py index cdc56ae8..a7b1d04a 100644 --- a/src/mistralai/ocr.py +++ b/src/mistralai/ocr.py @@ -103,6 +103,7 @@ def process( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="ocr_v1_ocr_post", oauth2_scopes=[], @@ -235,6 +236,7 @@ async def process_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, base_url=base_url or "", operation_id="ocr_v1_ocr_post", oauth2_scopes=[], diff --git a/src/mistralai/sdk.py b/src/mistralai/sdk.py index 5414436d..352c16a1 100644 --- a/src/mistralai/sdk.py +++ b/src/mistralai/sdk.py @@ -6,46 +6,62 @@ from .utils.logger import Logger, get_default_logger from .utils.retries import RetryConfig import httpx +import importlib from mistralai import models, utils from mistralai._hooks import SDKHooks -from mistralai.agents import Agents -from mistralai.batch import Batch -from mistralai.beta import Beta -from mistralai.chat import Chat -from mistralai.classifiers import Classifiers -from mistralai.embeddings import Embeddings -from mistralai.files import Files -from mistralai.fim import Fim -from mistralai.fine_tuning import FineTuning -from mistralai.models_ import Models -from mistralai.ocr import Ocr from mistralai.types import OptionalNullable, UNSET -from typing import Any, Callable, Dict, Optional, Union, cast +from typing import Any, Callable, Dict, Optional, TYPE_CHECKING, Union, cast import weakref +if TYPE_CHECKING: + from mistralai.agents import Agents + from mistralai.batch import Batch + from mistralai.beta import Beta + from mistralai.chat import Chat + from mistralai.classifiers import Classifiers + from mistralai.embeddings import Embeddings + from mistralai.files import Files + from mistralai.fim import Fim + from mistralai.fine_tuning import FineTuning + from mistralai.models_ import Models + from mistralai.ocr import Ocr + class Mistral(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.""" - models: Models + models: "Models" r"""Model Management API""" - beta: Beta - files: Files + beta: "Beta" + files: "Files" r"""Files API""" - fine_tuning: FineTuning - batch: Batch - chat: Chat + fine_tuning: "FineTuning" + batch: "Batch" + chat: "Chat" r"""Chat Completion API.""" - fim: Fim + fim: "Fim" r"""Fill-in-the-middle API.""" - agents: Agents + agents: "Agents" r"""Agents API.""" - embeddings: Embeddings + embeddings: "Embeddings" r"""Embeddings API.""" - classifiers: Classifiers + classifiers: "Classifiers" r"""Classifiers API.""" - ocr: Ocr + ocr: "Ocr" r"""OCR API""" + _sub_sdk_map = { + "models": ("mistralai.models_", "Models"), + "beta": ("mistralai.beta", "Beta"), + "files": ("mistralai.files", "Files"), + "fine_tuning": ("mistralai.fine_tuning", "FineTuning"), + "batch": ("mistralai.batch", "Batch"), + "chat": ("mistralai.chat", "Chat"), + "fim": ("mistralai.fim", "Fim"), + "agents": ("mistralai.agents", "Agents"), + "embeddings": ("mistralai.embeddings", "Embeddings"), + "classifiers": ("mistralai.classifiers", "Classifiers"), + "ocr": ("mistralai.ocr", "Ocr"), + } def __init__( self, @@ -120,6 +136,9 @@ def __init__( 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 @@ -127,9 +146,6 @@ def __init__( 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, @@ -140,20 +156,32 @@ def __init__( self.sdk_configuration.async_client_supplied, ) - self._init_sdks() - - def _init_sdks(self): - self.models = Models(self.sdk_configuration) - self.beta = Beta(self.sdk_configuration) - self.files = Files(self.sdk_configuration) - self.fine_tuning = FineTuning(self.sdk_configuration) - self.batch = Batch(self.sdk_configuration) - self.chat = Chat(self.sdk_configuration) - self.fim = Fim(self.sdk_configuration) - self.agents = Agents(self.sdk_configuration) - self.embeddings = Embeddings(self.sdk_configuration) - self.classifiers = Classifiers(self.sdk_configuration) - self.ocr = Ocr(self.sdk_configuration) + 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) + klass = getattr(module, class_name) + instance = klass(self.sdk_configuration) + 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 diff --git a/src/mistralai/sdkconfiguration.py b/src/mistralai/sdkconfiguration.py index 257ff01d..7e77925d 100644 --- a/src/mistralai/sdkconfiguration.py +++ b/src/mistralai/sdkconfiguration.py @@ -1,6 +1,5 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" -from ._hooks import SDKHooks from ._version import ( __gen_version__, __openapi_doc_version__, @@ -42,9 +41,6 @@ class SDKConfiguration: retry_config: OptionalNullable[RetryConfig] = Field(default_factory=lambda: UNSET) timeout_ms: Optional[int] = None - def __post_init__(self): - self._hooks = SDKHooks() - def get_server_details(self) -> Tuple[str, Dict[str, str]]: if self.server_url is not None and self.server_url: return remove_suffix(self.server_url, "/"), {} @@ -55,6 +51,3 @@ def get_server_details(self) -> Tuple[str, Dict[str, str]]: raise ValueError(f'Invalid server "{self.server}"') return SERVERS[self.server], {} - - def get_hooks(self) -> SDKHooks: - return self._hooks diff --git a/src/mistralai/types/basemodel.py b/src/mistralai/types/basemodel.py index a6187efa..231c2e37 100644 --- a/src/mistralai/types/basemodel.py +++ b/src/mistralai/types/basemodel.py @@ -2,7 +2,7 @@ from pydantic import ConfigDict, model_serializer from pydantic import BaseModel as PydanticBaseModel -from typing import TYPE_CHECKING, Literal, Optional, TypeVar, Union, NewType +from typing import TYPE_CHECKING, Literal, Optional, TypeVar, Union from typing_extensions import TypeAliasType, TypeAlias @@ -35,5 +35,5 @@ def __bool__(self) -> Literal[False]: "OptionalNullable", Union[Optional[Nullable[T]], Unset], type_params=(T,) ) -UnrecognizedInt = NewType("UnrecognizedInt", int) -UnrecognizedStr = NewType("UnrecognizedStr", str) +UnrecognizedInt: TypeAlias = int +UnrecognizedStr: TypeAlias = str diff --git a/src/mistralai/utils/__init__.py b/src/mistralai/utils/__init__.py index d8b21128..3d078198 100644 --- a/src/mistralai/utils/__init__.py +++ b/src/mistralai/utils/__init__.py @@ -1,51 +1,56 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" -from .annotations import get_discriminator -from .enums import OpenEnumMeta -from .headers import get_headers, get_response_headers -from .metadata import ( - FieldMetadata, - find_metadata, - FormMetadata, - HeaderMetadata, - MultipartFormMetadata, - PathParamMetadata, - QueryParamMetadata, - RequestMetadata, - SecurityMetadata, -) -from .queryparams import get_query_params -from .retries import BackoffStrategy, Retries, retry, retry_async, RetryConfig -from .requestbodies import serialize_request_body, SerializedRequestBody -from .security import get_security, get_security_from_env +from typing import TYPE_CHECKING +from importlib import import_module -from .serializers import ( - get_pydantic_model, - marshal_json, - unmarshal, - unmarshal_json, - serialize_decimal, - serialize_float, - serialize_int, - stream_to_text, - stream_to_text_async, - stream_to_bytes, - stream_to_bytes_async, - validate_const, - validate_decimal, - validate_float, - validate_int, - validate_open_enum, -) -from .url import generate_url, template_url, remove_suffix -from .values import ( - get_global_from_env, - match_content_type, - match_status_codes, - match_response, - cast_partial, -) -from .logger import Logger, get_body_content, get_default_logger +if TYPE_CHECKING: + from .annotations import get_discriminator + from .datetimes import parse_datetime + from .enums import OpenEnumMeta + from .headers import get_headers, get_response_headers + from .metadata import ( + FieldMetadata, + find_metadata, + FormMetadata, + HeaderMetadata, + MultipartFormMetadata, + PathParamMetadata, + QueryParamMetadata, + RequestMetadata, + SecurityMetadata, + ) + from .queryparams import get_query_params + from .retries import BackoffStrategy, Retries, retry, retry_async, RetryConfig + from .requestbodies import serialize_request_body, SerializedRequestBody + from .security import get_security, get_security_from_env + + from .serializers import ( + get_pydantic_model, + marshal_json, + unmarshal, + unmarshal_json, + serialize_decimal, + serialize_float, + serialize_int, + stream_to_text, + stream_to_text_async, + stream_to_bytes, + stream_to_bytes_async, + validate_const, + validate_decimal, + validate_float, + validate_int, + validate_open_enum, + ) + from .url import generate_url, template_url, remove_suffix + from .values import ( + get_global_from_env, + match_content_type, + match_status_codes, + match_response, + cast_partial, + ) + from .logger import Logger, get_body_content, get_default_logger __all__ = [ "BackoffStrategy", @@ -56,6 +61,7 @@ "get_body_content", "get_default_logger", "get_discriminator", + "parse_datetime", "get_global_from_env", "get_headers", "get_pydantic_model", @@ -99,3 +105,83 @@ "validate_open_enum", "cast_partial", ] + +_dynamic_imports: dict[str, str] = { + "BackoffStrategy": ".retries", + "FieldMetadata": ".metadata", + "find_metadata": ".metadata", + "FormMetadata": ".metadata", + "generate_url": ".url", + "get_body_content": ".logger", + "get_default_logger": ".logger", + "get_discriminator": ".annotations", + "parse_datetime": ".datetimes", + "get_global_from_env": ".values", + "get_headers": ".headers", + "get_pydantic_model": ".serializers", + "get_query_params": ".queryparams", + "get_response_headers": ".headers", + "get_security": ".security", + "get_security_from_env": ".security", + "HeaderMetadata": ".metadata", + "Logger": ".logger", + "marshal_json": ".serializers", + "match_content_type": ".values", + "match_status_codes": ".values", + "match_response": ".values", + "MultipartFormMetadata": ".metadata", + "OpenEnumMeta": ".enums", + "PathParamMetadata": ".metadata", + "QueryParamMetadata": ".metadata", + "remove_suffix": ".url", + "Retries": ".retries", + "retry": ".retries", + "retry_async": ".retries", + "RetryConfig": ".retries", + "RequestMetadata": ".metadata", + "SecurityMetadata": ".metadata", + "serialize_decimal": ".serializers", + "serialize_float": ".serializers", + "serialize_int": ".serializers", + "serialize_request_body": ".requestbodies", + "SerializedRequestBody": ".requestbodies", + "stream_to_text": ".serializers", + "stream_to_text_async": ".serializers", + "stream_to_bytes": ".serializers", + "stream_to_bytes_async": ".serializers", + "template_url": ".url", + "unmarshal": ".serializers", + "unmarshal_json": ".serializers", + "validate_decimal": ".serializers", + "validate_const": ".serializers", + "validate_float": ".serializers", + "validate_int": ".serializers", + "validate_open_enum": ".serializers", + "cast_partial": ".values", +} + + +def __getattr__(attr_name: str) -> object: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError( + f"no {attr_name} found in _dynamic_imports, module name -> {__name__} " + ) + + try: + module = import_module(module_name, __package__) + result = getattr(module, attr_name) + return result + except ImportError as e: + raise ImportError( + f"Failed to import {attr_name} from {module_name}: {e}" + ) from e + except AttributeError as e: + raise AttributeError( + f"Failed to get {attr_name} from {module_name}: {e}" + ) from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) diff --git a/src/mistralai/utils/datetimes.py b/src/mistralai/utils/datetimes.py new file mode 100644 index 00000000..a6c52cd6 --- /dev/null +++ b/src/mistralai/utils/datetimes.py @@ -0,0 +1,23 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from datetime import datetime +import sys + + +def parse_datetime(datetime_string: str) -> datetime: + """ + Convert a RFC 3339 / ISO 8601 formatted string into a datetime object. + Python versions 3.11 and later support parsing RFC 3339 directly with + datetime.fromisoformat(), but for earlier versions, this function + encapsulates the necessary extra logic. + """ + # Python 3.11 and later can parse RFC 3339 directly + if sys.version_info >= (3, 11): + return datetime.fromisoformat(datetime_string) + + # For Python 3.10 and earlier, a common ValueError is trailing 'Z' suffix, + # so fix that upfront. + if datetime_string.endswith("Z"): + datetime_string = datetime_string[:-1] + "+00:00" + + return datetime.fromisoformat(datetime_string) diff --git a/src/mistralai/utils/enums.py b/src/mistralai/utils/enums.py index c650b10c..c3bc13cf 100644 --- a/src/mistralai/utils/enums.py +++ b/src/mistralai/utils/enums.py @@ -1,34 +1,74 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" import enum - +import sys class OpenEnumMeta(enum.EnumMeta): - def __call__( - cls, value, names=None, *, module=None, qualname=None, type=None, start=1 - ): - # The `type` kwarg also happens to be a built-in that pylint flags as - # redeclared. Safe to ignore this lint rule with this scope. - # pylint: disable=redefined-builtin + # The __call__ method `boundary` kwarg was added in 3.11 and must be present + # for pyright. Refer also: https://github.com/pylint-dev/pylint/issues/9622 + # pylint: disable=unexpected-keyword-arg + # The __call__ method `values` varg must be named for pyright. + # pylint: disable=keyword-arg-before-vararg + + if sys.version_info >= (3, 11): + def __call__( + cls, value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None + ): + # The `type` kwarg also happens to be a built-in that pylint flags as + # redeclared. Safe to ignore this lint rule with this scope. + # pylint: disable=redefined-builtin + + if names is not None: + return super().__call__( + value, + names=names, + *values, + module=module, + qualname=qualname, + type=type, + start=start, + boundary=boundary, + ) + + try: + return super().__call__( + value, + names=names, # pyright: ignore[reportArgumentType] + *values, + module=module, + qualname=qualname, + type=type, + start=start, + boundary=boundary, + ) + except ValueError: + return value + else: + def __call__( + cls, value, names=None, *, module=None, qualname=None, type=None, start=1 + ): + # The `type` kwarg also happens to be a built-in that pylint flags as + # redeclared. Safe to ignore this lint rule with this scope. + # pylint: disable=redefined-builtin - if names is not None: - return super().__call__( - value, - names=names, - module=module, - qualname=qualname, - type=type, - start=start, - ) + if names is not None: + return super().__call__( + value, + names=names, + module=module, + qualname=qualname, + type=type, + start=start, + ) - try: - return super().__call__( - value, - names=names, # pyright: ignore[reportArgumentType] - module=module, - qualname=qualname, - type=type, - start=start, - ) - except ValueError: - return value + try: + return super().__call__( + value, + names=names, # pyright: ignore[reportArgumentType] + module=module, + qualname=qualname, + type=type, + start=start, + ) + except ValueError: + return value diff --git a/src/mistralai/utils/forms.py b/src/mistralai/utils/forms.py index 0472aba8..e873495f 100644 --- a/src/mistralai/utils/forms.py +++ b/src/mistralai/utils/forms.py @@ -86,11 +86,39 @@ def _populate_form( return form +def _extract_file_properties(file_obj: Any) -> Tuple[str, Any, Any]: + """Extract file name, content, and content type from a file object.""" + file_fields: Dict[str, FieldInfo] = file_obj.__class__.model_fields + + file_name = "" + content = None + content_type = None + + for file_field_name in file_fields: + file_field = file_fields[file_field_name] + + file_metadata = find_field_metadata(file_field, MultipartFormMetadata) + if file_metadata is None: + continue + + if file_metadata.content: + content = getattr(file_obj, file_field_name, None) + elif file_field_name == "content_type": + content_type = getattr(file_obj, file_field_name, None) + else: + file_name = getattr(file_obj, file_field_name) + + if file_name == "" or content is None: + raise ValueError("invalid multipart/form-data file") + + return file_name, content, content_type + + def serialize_multipart_form( media_type: str, request: Any -) -> Tuple[str, Dict[str, Any], Dict[str, Any]]: +) -> Tuple[str, Dict[str, Any], List[Tuple[str, Any]]]: form: Dict[str, Any] = {} - files: Dict[str, Any] = {} + files: List[Tuple[str, Any]] = [] if not isinstance(request, BaseModel): raise TypeError("invalid request body type") @@ -112,39 +140,32 @@ def serialize_multipart_form( f_name = field.alias if field.alias else name if field_metadata.file: - file_fields: Dict[str, FieldInfo] = val.__class__.model_fields - - file_name = "" - content = None - content_type = None - - for file_field_name in file_fields: - file_field = file_fields[file_field_name] + if isinstance(val, List): + # Handle array of files + for file_obj in val: + if not _is_set(file_obj): + continue + + file_name, content, content_type = _extract_file_properties(file_obj) - file_metadata = find_field_metadata(file_field, MultipartFormMetadata) - if file_metadata is None: - continue + if content_type is not None: + files.append((f_name + "[]", (file_name, content, content_type))) + else: + files.append((f_name + "[]", (file_name, content))) + else: + # Handle single file + file_name, content, content_type = _extract_file_properties(val) - if file_metadata.content: - content = getattr(val, file_field_name, None) - elif file_field_name == "content_type": - content_type = getattr(val, file_field_name, None) + if content_type is not None: + files.append((f_name, (file_name, content, content_type))) else: - file_name = getattr(val, file_field_name) - - if file_name == "" or content is None: - raise ValueError("invalid multipart/form-data file") - - if content_type is not None: - files[f_name] = (file_name, content, content_type) - else: - files[f_name] = (file_name, content) + files.append((f_name, (file_name, content))) elif field_metadata.json: - files[f_name] = ( + files.append((f_name, ( None, marshal_json(val, request_field_types[name]), "application/json", - ) + ))) else: if isinstance(val, List): values = [] diff --git a/src/mistralai/utils/serializers.py b/src/mistralai/utils/serializers.py index baa41fbd..76e44d71 100644 --- a/src/mistralai/utils/serializers.py +++ b/src/mistralai/utils/serializers.py @@ -1,13 +1,16 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from decimal import Decimal +import functools import json -from typing import Any, Dict, List, Union, get_args -import httpx +import typing +from typing import Any, Dict, List, Tuple, Union, get_args +import typing_extensions from typing_extensions import get_origin + +import httpx from pydantic import ConfigDict, create_model from pydantic_core import from_json -from typing_inspection.typing_objects import is_union from ..types.basemodel import BaseModel, Nullable, OptionalNullable, Unset @@ -185,6 +188,13 @@ def is_nullable(field): return False +def is_union(obj: object) -> bool: + """ + Returns True if the given object is a typing.Union or typing_extensions.Union. + """ + return any(obj is typing_obj for typing_obj in _get_typing_objects_by_name_of("Union")) + + def stream_to_text(stream: httpx.Response) -> str: return "".join(stream.iter_text()) @@ -217,3 +227,22 @@ def _contains_pydantic_model(data: Any) -> bool: return any(_contains_pydantic_model(value) for value in data.values()) return False + + +@functools.cache +def _get_typing_objects_by_name_of(name: str) -> Tuple[Any, ...]: + """ + Get typing objects by name from typing and typing_extensions. + Reference: https://typing-extensions.readthedocs.io/en/latest/#runtime-use-of-types + """ + result = tuple( + getattr(module, name) + for module in (typing, typing_extensions) + if hasattr(module, name) + ) + if not result: + raise ValueError( + f"Neither typing nor typing_extensions has an object called {name!r}" + ) + return result + From 61430493ad5407f610f0c553eb327bc518b63514 Mon Sep 17 00:00:00 2001 From: Alexandre Menasria Date: Fri, 27 Jun 2025 17:11:03 +0200 Subject: [PATCH 2/3] Fix formatting + repin on main --- .speakeasy/workflow.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.speakeasy/workflow.yaml b/.speakeasy/workflow.yaml index fa2f4815..8cc3f808 100644 --- a/.speakeasy/workflow.yaml +++ b/.speakeasy/workflow.yaml @@ -1,15 +1,15 @@ workflowVersion: 1.0.0 -speakeasyVersion: 1.568.2 +speakeasyVersion: 1.568.2 sources: mistral-azure-source: inputs: - - location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-azure:sha256:c5931a7e0cc2db844149d71db57dfc2178665f0400bc26c90ee113795ea2872f + - location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-azure:main mistral-google-cloud-source: inputs: - - location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-google-cloud:sha256:4a5343e63c6a78152e472b00ccc46d7bcb15594496bc94c8040039d3a9d4c5f8 + - location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-google-cloud:main mistral-openapi: inputs: - - location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi:sha256:21244d618cafcc163c3aa4acbc443ca16c63b8614632b65b87fbb2c4066987f3 + - location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi:main targets: mistralai-azure-sdk: target: python From 61084f6b893ff4221131dd59fc3ef4161c62b115 Mon Sep 17 00:00:00 2001 From: Alexandre Menasria Date: Fri, 27 Jun 2025 17:33:25 +0200 Subject: [PATCH 3/3] fix typo --- .speakeasy/workflow.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.speakeasy/workflow.yaml b/.speakeasy/workflow.yaml index 8cc3f808..fe32bb3f 100644 --- a/.speakeasy/workflow.yaml +++ b/.speakeasy/workflow.yaml @@ -3,13 +3,13 @@ speakeasyVersion: 1.568.2 sources: mistral-azure-source: inputs: - - location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-azure:main + - location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-azure:main mistral-google-cloud-source: inputs: - - location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-google-cloud:main + - location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-google-cloud:main mistral-openapi: inputs: - - location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi:main + - location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi:main targets: mistralai-azure-sdk: target: python