mistralai 1.9.2__py3-none-any.whl → 1.9.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mistralai/_version.py +2 -2
- mistralai/audio.py +18 -0
- mistralai/mistral_jobs.py +14 -2
- mistralai/models/__init__.py +130 -3
- mistralai/models/audiochunk.py +20 -0
- mistralai/models/audiotranscriptionrequest.py +97 -0
- mistralai/models/audiotranscriptionrequeststream.py +97 -0
- mistralai/models/basemodelcard.py +3 -3
- mistralai/models/batchjobin.py +7 -4
- mistralai/models/batchjobout.py +10 -3
- mistralai/models/classifierftmodelout.py +6 -0
- mistralai/models/completionargs.py +3 -2
- mistralai/models/completionftmodelout.py +6 -0
- mistralai/models/contentchunk.py +6 -0
- mistralai/models/fileschema.py +8 -2
- mistralai/models/jobs_api_routes_batch_get_batch_jobsop.py +8 -1
- mistralai/models/retrievefileout.py +8 -2
- mistralai/models/thinkchunk.py +35 -0
- mistralai/models/timestampgranularity.py +7 -0
- mistralai/models/toolcall.py +43 -1
- mistralai/models/transcriptionresponse.py +79 -0
- mistralai/models/transcriptionsegmentchunk.py +41 -0
- mistralai/models/transcriptionstreamdone.py +85 -0
- mistralai/models/transcriptionstreamevents.py +58 -0
- mistralai/models/transcriptionstreameventtypes.py +12 -0
- mistralai/models/transcriptionstreamlanguage.py +35 -0
- mistralai/models/transcriptionstreamsegmentdelta.py +41 -0
- mistralai/models/transcriptionstreamtextdelta.py +35 -0
- mistralai/models/uploadfileout.py +8 -2
- mistralai/models/usageinfo.py +65 -8
- mistralai/sdk.py +3 -0
- mistralai/transcriptions.py +480 -0
- {mistralai-1.9.2.dist-info → mistralai-1.9.3.dist-info}/METADATA +9 -1
- {mistralai-1.9.2.dist-info → mistralai-1.9.3.dist-info}/RECORD +36 -21
- {mistralai-1.9.2.dist-info → mistralai-1.9.3.dist-info}/LICENSE +0 -0
- {mistralai-1.9.2.dist-info → mistralai-1.9.3.dist-info}/WHEEL +0 -0
mistralai/_version.py
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
import importlib.metadata
|
|
4
4
|
|
|
5
5
|
__title__: str = "mistralai"
|
|
6
|
-
__version__: str = "1.9.
|
|
6
|
+
__version__: str = "1.9.3"
|
|
7
7
|
__openapi_doc_version__: str = "1.0.0"
|
|
8
8
|
__gen_version__: str = "2.634.2"
|
|
9
|
-
__user_agent__: str = "speakeasy-sdk/python 1.9.
|
|
9
|
+
__user_agent__: str = "speakeasy-sdk/python 1.9.3 2.634.2 1.0.0 mistralai"
|
|
10
10
|
|
|
11
11
|
try:
|
|
12
12
|
if __package__ is not None:
|
mistralai/audio.py
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from .basesdk import BaseSDK
|
|
4
|
+
from .sdkconfiguration import SDKConfiguration
|
|
5
|
+
from mistralai.transcriptions import Transcriptions
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class Audio(BaseSDK):
|
|
9
|
+
transcriptions: Transcriptions
|
|
10
|
+
r"""API for audio transcription."""
|
|
11
|
+
|
|
12
|
+
def __init__(self, sdk_config: SDKConfiguration) -> None:
|
|
13
|
+
BaseSDK.__init__(self, sdk_config)
|
|
14
|
+
self.sdk_configuration = sdk_config
|
|
15
|
+
self._init_sdks()
|
|
16
|
+
|
|
17
|
+
def _init_sdks(self):
|
|
18
|
+
self.transcriptions = Transcriptions(self.sdk_configuration)
|
mistralai/mistral_jobs.py
CHANGED
|
@@ -16,6 +16,7 @@ class MistralJobs(BaseSDK):
|
|
|
16
16
|
page: Optional[int] = 0,
|
|
17
17
|
page_size: Optional[int] = 100,
|
|
18
18
|
model: OptionalNullable[str] = UNSET,
|
|
19
|
+
agent_id: OptionalNullable[str] = UNSET,
|
|
19
20
|
metadata: OptionalNullable[Dict[str, Any]] = UNSET,
|
|
20
21
|
created_after: OptionalNullable[datetime] = UNSET,
|
|
21
22
|
created_by_me: Optional[bool] = False,
|
|
@@ -32,6 +33,7 @@ class MistralJobs(BaseSDK):
|
|
|
32
33
|
:param page:
|
|
33
34
|
:param page_size:
|
|
34
35
|
:param model:
|
|
36
|
+
:param agent_id:
|
|
35
37
|
:param metadata:
|
|
36
38
|
:param created_after:
|
|
37
39
|
:param created_by_me:
|
|
@@ -55,6 +57,7 @@ class MistralJobs(BaseSDK):
|
|
|
55
57
|
page=page,
|
|
56
58
|
page_size=page_size,
|
|
57
59
|
model=model,
|
|
60
|
+
agent_id=agent_id,
|
|
58
61
|
metadata=metadata,
|
|
59
62
|
created_after=created_after,
|
|
60
63
|
created_by_me=created_by_me,
|
|
@@ -128,6 +131,7 @@ class MistralJobs(BaseSDK):
|
|
|
128
131
|
page: Optional[int] = 0,
|
|
129
132
|
page_size: Optional[int] = 100,
|
|
130
133
|
model: OptionalNullable[str] = UNSET,
|
|
134
|
+
agent_id: OptionalNullable[str] = UNSET,
|
|
131
135
|
metadata: OptionalNullable[Dict[str, Any]] = UNSET,
|
|
132
136
|
created_after: OptionalNullable[datetime] = UNSET,
|
|
133
137
|
created_by_me: Optional[bool] = False,
|
|
@@ -144,6 +148,7 @@ class MistralJobs(BaseSDK):
|
|
|
144
148
|
:param page:
|
|
145
149
|
:param page_size:
|
|
146
150
|
:param model:
|
|
151
|
+
:param agent_id:
|
|
147
152
|
:param metadata:
|
|
148
153
|
:param created_after:
|
|
149
154
|
:param created_by_me:
|
|
@@ -167,6 +172,7 @@ class MistralJobs(BaseSDK):
|
|
|
167
172
|
page=page,
|
|
168
173
|
page_size=page_size,
|
|
169
174
|
model=model,
|
|
175
|
+
agent_id=agent_id,
|
|
170
176
|
metadata=metadata,
|
|
171
177
|
created_after=created_after,
|
|
172
178
|
created_by_me=created_by_me,
|
|
@@ -239,7 +245,8 @@ class MistralJobs(BaseSDK):
|
|
|
239
245
|
*,
|
|
240
246
|
input_files: List[str],
|
|
241
247
|
endpoint: models.APIEndpoint,
|
|
242
|
-
model: str,
|
|
248
|
+
model: OptionalNullable[str] = UNSET,
|
|
249
|
+
agent_id: OptionalNullable[str] = UNSET,
|
|
243
250
|
metadata: OptionalNullable[Dict[str, str]] = UNSET,
|
|
244
251
|
timeout_hours: Optional[int] = 24,
|
|
245
252
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
@@ -254,6 +261,7 @@ class MistralJobs(BaseSDK):
|
|
|
254
261
|
:param input_files:
|
|
255
262
|
:param endpoint:
|
|
256
263
|
:param model:
|
|
264
|
+
:param agent_id:
|
|
257
265
|
:param metadata:
|
|
258
266
|
:param timeout_hours:
|
|
259
267
|
:param retries: Override the default retry configuration for this method
|
|
@@ -275,6 +283,7 @@ class MistralJobs(BaseSDK):
|
|
|
275
283
|
input_files=input_files,
|
|
276
284
|
endpoint=endpoint,
|
|
277
285
|
model=model,
|
|
286
|
+
agent_id=agent_id,
|
|
278
287
|
metadata=metadata,
|
|
279
288
|
timeout_hours=timeout_hours,
|
|
280
289
|
)
|
|
@@ -348,7 +357,8 @@ class MistralJobs(BaseSDK):
|
|
|
348
357
|
*,
|
|
349
358
|
input_files: List[str],
|
|
350
359
|
endpoint: models.APIEndpoint,
|
|
351
|
-
model: str,
|
|
360
|
+
model: OptionalNullable[str] = UNSET,
|
|
361
|
+
agent_id: OptionalNullable[str] = UNSET,
|
|
352
362
|
metadata: OptionalNullable[Dict[str, str]] = UNSET,
|
|
353
363
|
timeout_hours: Optional[int] = 24,
|
|
354
364
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
@@ -363,6 +373,7 @@ class MistralJobs(BaseSDK):
|
|
|
363
373
|
:param input_files:
|
|
364
374
|
:param endpoint:
|
|
365
375
|
:param model:
|
|
376
|
+
:param agent_id:
|
|
366
377
|
:param metadata:
|
|
367
378
|
:param timeout_hours:
|
|
368
379
|
:param retries: Override the default retry configuration for this method
|
|
@@ -384,6 +395,7 @@ class MistralJobs(BaseSDK):
|
|
|
384
395
|
input_files=input_files,
|
|
385
396
|
endpoint=endpoint,
|
|
386
397
|
model=model,
|
|
398
|
+
agent_id=agent_id,
|
|
387
399
|
metadata=metadata,
|
|
388
400
|
timeout_hours=timeout_hours,
|
|
389
401
|
)
|
mistralai/models/__init__.py
CHANGED
|
@@ -129,7 +129,16 @@ if TYPE_CHECKING:
|
|
|
129
129
|
AssistantMessageRole,
|
|
130
130
|
AssistantMessageTypedDict,
|
|
131
131
|
)
|
|
132
|
-
from .
|
|
132
|
+
from .audiochunk import AudioChunk, AudioChunkType, AudioChunkTypedDict
|
|
133
|
+
from .audiotranscriptionrequest import (
|
|
134
|
+
AudioTranscriptionRequest,
|
|
135
|
+
AudioTranscriptionRequestTypedDict,
|
|
136
|
+
)
|
|
137
|
+
from .audiotranscriptionrequeststream import (
|
|
138
|
+
AudioTranscriptionRequestStream,
|
|
139
|
+
AudioTranscriptionRequestStreamTypedDict,
|
|
140
|
+
)
|
|
141
|
+
from .basemodelcard import BaseModelCard, BaseModelCardType, BaseModelCardTypedDict
|
|
133
142
|
from .batcherror import BatchError, BatchErrorTypedDict
|
|
134
143
|
from .batchjobin import BatchJobIn, BatchJobInTypedDict
|
|
135
144
|
from .batchjobout import BatchJobOut, BatchJobOutObject, BatchJobOutTypedDict
|
|
@@ -759,8 +768,16 @@ if TYPE_CHECKING:
|
|
|
759
768
|
SystemMessageTypedDict,
|
|
760
769
|
)
|
|
761
770
|
from .textchunk import TextChunk, TextChunkType, TextChunkTypedDict
|
|
771
|
+
from .thinkchunk import (
|
|
772
|
+
ThinkChunk,
|
|
773
|
+
ThinkChunkType,
|
|
774
|
+
ThinkChunkTypedDict,
|
|
775
|
+
Thinking,
|
|
776
|
+
ThinkingTypedDict,
|
|
777
|
+
)
|
|
778
|
+
from .timestampgranularity import TimestampGranularity
|
|
762
779
|
from .tool import Tool, ToolTypedDict
|
|
763
|
-
from .toolcall import ToolCall, ToolCallTypedDict
|
|
780
|
+
from .toolcall import Metadata, MetadataTypedDict, ToolCall, ToolCallTypedDict
|
|
764
781
|
from .toolchoice import ToolChoice, ToolChoiceTypedDict
|
|
765
782
|
from .toolchoiceenum import ToolChoiceEnum
|
|
766
783
|
from .toolexecutiondeltaevent import (
|
|
@@ -799,6 +816,42 @@ if TYPE_CHECKING:
|
|
|
799
816
|
)
|
|
800
817
|
from .tooltypes import ToolTypes
|
|
801
818
|
from .trainingfile import TrainingFile, TrainingFileTypedDict
|
|
819
|
+
from .transcriptionresponse import (
|
|
820
|
+
TranscriptionResponse,
|
|
821
|
+
TranscriptionResponseTypedDict,
|
|
822
|
+
)
|
|
823
|
+
from .transcriptionsegmentchunk import (
|
|
824
|
+
TranscriptionSegmentChunk,
|
|
825
|
+
TranscriptionSegmentChunkTypedDict,
|
|
826
|
+
Type,
|
|
827
|
+
)
|
|
828
|
+
from .transcriptionstreamdone import (
|
|
829
|
+
TranscriptionStreamDone,
|
|
830
|
+
TranscriptionStreamDoneType,
|
|
831
|
+
TranscriptionStreamDoneTypedDict,
|
|
832
|
+
)
|
|
833
|
+
from .transcriptionstreamevents import (
|
|
834
|
+
TranscriptionStreamEvents,
|
|
835
|
+
TranscriptionStreamEventsData,
|
|
836
|
+
TranscriptionStreamEventsDataTypedDict,
|
|
837
|
+
TranscriptionStreamEventsTypedDict,
|
|
838
|
+
)
|
|
839
|
+
from .transcriptionstreameventtypes import TranscriptionStreamEventTypes
|
|
840
|
+
from .transcriptionstreamlanguage import (
|
|
841
|
+
TranscriptionStreamLanguage,
|
|
842
|
+
TranscriptionStreamLanguageType,
|
|
843
|
+
TranscriptionStreamLanguageTypedDict,
|
|
844
|
+
)
|
|
845
|
+
from .transcriptionstreamsegmentdelta import (
|
|
846
|
+
TranscriptionStreamSegmentDelta,
|
|
847
|
+
TranscriptionStreamSegmentDeltaType,
|
|
848
|
+
TranscriptionStreamSegmentDeltaTypedDict,
|
|
849
|
+
)
|
|
850
|
+
from .transcriptionstreamtextdelta import (
|
|
851
|
+
TranscriptionStreamTextDelta,
|
|
852
|
+
TranscriptionStreamTextDeltaType,
|
|
853
|
+
TranscriptionStreamTextDeltaTypedDict,
|
|
854
|
+
)
|
|
802
855
|
from .unarchiveftmodelout import (
|
|
803
856
|
UnarchiveFTModelOut,
|
|
804
857
|
UnarchiveFTModelOutObject,
|
|
@@ -917,7 +970,15 @@ __all__ = [
|
|
|
917
970
|
"AssistantMessageContentTypedDict",
|
|
918
971
|
"AssistantMessageRole",
|
|
919
972
|
"AssistantMessageTypedDict",
|
|
973
|
+
"AudioChunk",
|
|
974
|
+
"AudioChunkType",
|
|
975
|
+
"AudioChunkTypedDict",
|
|
976
|
+
"AudioTranscriptionRequest",
|
|
977
|
+
"AudioTranscriptionRequestStream",
|
|
978
|
+
"AudioTranscriptionRequestStreamTypedDict",
|
|
979
|
+
"AudioTranscriptionRequestTypedDict",
|
|
920
980
|
"BaseModelCard",
|
|
981
|
+
"BaseModelCardType",
|
|
921
982
|
"BaseModelCardTypedDict",
|
|
922
983
|
"BatchError",
|
|
923
984
|
"BatchErrorTypedDict",
|
|
@@ -1322,6 +1383,8 @@ __all__ = [
|
|
|
1322
1383
|
"MessageOutputEventTypedDict",
|
|
1323
1384
|
"Messages",
|
|
1324
1385
|
"MessagesTypedDict",
|
|
1386
|
+
"Metadata",
|
|
1387
|
+
"MetadataTypedDict",
|
|
1325
1388
|
"MetricOut",
|
|
1326
1389
|
"MetricOutTypedDict",
|
|
1327
1390
|
"MistralPromptMode",
|
|
@@ -1416,6 +1479,12 @@ __all__ = [
|
|
|
1416
1479
|
"TextChunk",
|
|
1417
1480
|
"TextChunkType",
|
|
1418
1481
|
"TextChunkTypedDict",
|
|
1482
|
+
"ThinkChunk",
|
|
1483
|
+
"ThinkChunkType",
|
|
1484
|
+
"ThinkChunkTypedDict",
|
|
1485
|
+
"Thinking",
|
|
1486
|
+
"ThinkingTypedDict",
|
|
1487
|
+
"TimestampGranularity",
|
|
1419
1488
|
"Tool",
|
|
1420
1489
|
"ToolCall",
|
|
1421
1490
|
"ToolCallTypedDict",
|
|
@@ -1452,6 +1521,27 @@ __all__ = [
|
|
|
1452
1521
|
"ToolsTypedDict",
|
|
1453
1522
|
"TrainingFile",
|
|
1454
1523
|
"TrainingFileTypedDict",
|
|
1524
|
+
"TranscriptionResponse",
|
|
1525
|
+
"TranscriptionResponseTypedDict",
|
|
1526
|
+
"TranscriptionSegmentChunk",
|
|
1527
|
+
"TranscriptionSegmentChunkTypedDict",
|
|
1528
|
+
"TranscriptionStreamDone",
|
|
1529
|
+
"TranscriptionStreamDoneType",
|
|
1530
|
+
"TranscriptionStreamDoneTypedDict",
|
|
1531
|
+
"TranscriptionStreamEventTypes",
|
|
1532
|
+
"TranscriptionStreamEvents",
|
|
1533
|
+
"TranscriptionStreamEventsData",
|
|
1534
|
+
"TranscriptionStreamEventsDataTypedDict",
|
|
1535
|
+
"TranscriptionStreamEventsTypedDict",
|
|
1536
|
+
"TranscriptionStreamLanguage",
|
|
1537
|
+
"TranscriptionStreamLanguageType",
|
|
1538
|
+
"TranscriptionStreamLanguageTypedDict",
|
|
1539
|
+
"TranscriptionStreamSegmentDelta",
|
|
1540
|
+
"TranscriptionStreamSegmentDeltaType",
|
|
1541
|
+
"TranscriptionStreamSegmentDeltaTypedDict",
|
|
1542
|
+
"TranscriptionStreamTextDelta",
|
|
1543
|
+
"TranscriptionStreamTextDeltaType",
|
|
1544
|
+
"TranscriptionStreamTextDeltaTypedDict",
|
|
1455
1545
|
"Two",
|
|
1456
1546
|
"TwoTypedDict",
|
|
1457
1547
|
"Type",
|
|
@@ -1565,9 +1655,16 @@ _dynamic_imports: dict[str, str] = {
|
|
|
1565
1655
|
"AssistantMessageContentTypedDict": ".assistantmessage",
|
|
1566
1656
|
"AssistantMessageRole": ".assistantmessage",
|
|
1567
1657
|
"AssistantMessageTypedDict": ".assistantmessage",
|
|
1658
|
+
"AudioChunk": ".audiochunk",
|
|
1659
|
+
"AudioChunkType": ".audiochunk",
|
|
1660
|
+
"AudioChunkTypedDict": ".audiochunk",
|
|
1661
|
+
"AudioTranscriptionRequest": ".audiotranscriptionrequest",
|
|
1662
|
+
"AudioTranscriptionRequestTypedDict": ".audiotranscriptionrequest",
|
|
1663
|
+
"AudioTranscriptionRequestStream": ".audiotranscriptionrequeststream",
|
|
1664
|
+
"AudioTranscriptionRequestStreamTypedDict": ".audiotranscriptionrequeststream",
|
|
1568
1665
|
"BaseModelCard": ".basemodelcard",
|
|
1666
|
+
"BaseModelCardType": ".basemodelcard",
|
|
1569
1667
|
"BaseModelCardTypedDict": ".basemodelcard",
|
|
1570
|
-
"Type": ".basemodelcard",
|
|
1571
1668
|
"BatchError": ".batcherror",
|
|
1572
1669
|
"BatchErrorTypedDict": ".batcherror",
|
|
1573
1670
|
"BatchJobIn": ".batchjobin",
|
|
@@ -2067,8 +2164,16 @@ _dynamic_imports: dict[str, str] = {
|
|
|
2067
2164
|
"TextChunk": ".textchunk",
|
|
2068
2165
|
"TextChunkType": ".textchunk",
|
|
2069
2166
|
"TextChunkTypedDict": ".textchunk",
|
|
2167
|
+
"ThinkChunk": ".thinkchunk",
|
|
2168
|
+
"ThinkChunkType": ".thinkchunk",
|
|
2169
|
+
"ThinkChunkTypedDict": ".thinkchunk",
|
|
2170
|
+
"Thinking": ".thinkchunk",
|
|
2171
|
+
"ThinkingTypedDict": ".thinkchunk",
|
|
2172
|
+
"TimestampGranularity": ".timestampgranularity",
|
|
2070
2173
|
"Tool": ".tool",
|
|
2071
2174
|
"ToolTypedDict": ".tool",
|
|
2175
|
+
"Metadata": ".toolcall",
|
|
2176
|
+
"MetadataTypedDict": ".toolcall",
|
|
2072
2177
|
"ToolCall": ".toolcall",
|
|
2073
2178
|
"ToolCallTypedDict": ".toolcall",
|
|
2074
2179
|
"ToolChoice": ".toolchoice",
|
|
@@ -2101,6 +2206,28 @@ _dynamic_imports: dict[str, str] = {
|
|
|
2101
2206
|
"ToolTypes": ".tooltypes",
|
|
2102
2207
|
"TrainingFile": ".trainingfile",
|
|
2103
2208
|
"TrainingFileTypedDict": ".trainingfile",
|
|
2209
|
+
"TranscriptionResponse": ".transcriptionresponse",
|
|
2210
|
+
"TranscriptionResponseTypedDict": ".transcriptionresponse",
|
|
2211
|
+
"TranscriptionSegmentChunk": ".transcriptionsegmentchunk",
|
|
2212
|
+
"TranscriptionSegmentChunkTypedDict": ".transcriptionsegmentchunk",
|
|
2213
|
+
"Type": ".transcriptionsegmentchunk",
|
|
2214
|
+
"TranscriptionStreamDone": ".transcriptionstreamdone",
|
|
2215
|
+
"TranscriptionStreamDoneType": ".transcriptionstreamdone",
|
|
2216
|
+
"TranscriptionStreamDoneTypedDict": ".transcriptionstreamdone",
|
|
2217
|
+
"TranscriptionStreamEvents": ".transcriptionstreamevents",
|
|
2218
|
+
"TranscriptionStreamEventsData": ".transcriptionstreamevents",
|
|
2219
|
+
"TranscriptionStreamEventsDataTypedDict": ".transcriptionstreamevents",
|
|
2220
|
+
"TranscriptionStreamEventsTypedDict": ".transcriptionstreamevents",
|
|
2221
|
+
"TranscriptionStreamEventTypes": ".transcriptionstreameventtypes",
|
|
2222
|
+
"TranscriptionStreamLanguage": ".transcriptionstreamlanguage",
|
|
2223
|
+
"TranscriptionStreamLanguageType": ".transcriptionstreamlanguage",
|
|
2224
|
+
"TranscriptionStreamLanguageTypedDict": ".transcriptionstreamlanguage",
|
|
2225
|
+
"TranscriptionStreamSegmentDelta": ".transcriptionstreamsegmentdelta",
|
|
2226
|
+
"TranscriptionStreamSegmentDeltaType": ".transcriptionstreamsegmentdelta",
|
|
2227
|
+
"TranscriptionStreamSegmentDeltaTypedDict": ".transcriptionstreamsegmentdelta",
|
|
2228
|
+
"TranscriptionStreamTextDelta": ".transcriptionstreamtextdelta",
|
|
2229
|
+
"TranscriptionStreamTextDeltaType": ".transcriptionstreamtextdelta",
|
|
2230
|
+
"TranscriptionStreamTextDeltaTypedDict": ".transcriptionstreamtextdelta",
|
|
2104
2231
|
"UnarchiveFTModelOut": ".unarchiveftmodelout",
|
|
2105
2232
|
"UnarchiveFTModelOutObject": ".unarchiveftmodelout",
|
|
2106
2233
|
"UnarchiveFTModelOutTypedDict": ".unarchiveftmodelout",
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from mistralai.types import BaseModel
|
|
5
|
+
from typing import Literal, Optional
|
|
6
|
+
from typing_extensions import NotRequired, TypedDict
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
AudioChunkType = Literal["input_audio"]
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class AudioChunkTypedDict(TypedDict):
|
|
13
|
+
input_audio: str
|
|
14
|
+
type: NotRequired[AudioChunkType]
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class AudioChunk(BaseModel):
|
|
18
|
+
input_audio: str
|
|
19
|
+
|
|
20
|
+
type: Optional[AudioChunkType] = "input_audio"
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from .file import File, FileTypedDict
|
|
5
|
+
from .timestampgranularity import TimestampGranularity
|
|
6
|
+
from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
|
|
7
|
+
from mistralai.utils import FieldMetadata, MultipartFormMetadata, validate_const
|
|
8
|
+
import pydantic
|
|
9
|
+
from pydantic import model_serializer
|
|
10
|
+
from pydantic.functional_validators import AfterValidator
|
|
11
|
+
from typing import List, Literal, Optional
|
|
12
|
+
from typing_extensions import Annotated, NotRequired, TypedDict
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class AudioTranscriptionRequestTypedDict(TypedDict):
|
|
16
|
+
model: str
|
|
17
|
+
file: NotRequired[FileTypedDict]
|
|
18
|
+
file_url: NotRequired[Nullable[str]]
|
|
19
|
+
r"""Url of a file to be transcribed"""
|
|
20
|
+
file_id: NotRequired[Nullable[str]]
|
|
21
|
+
r"""ID of a file uploaded to /v1/files"""
|
|
22
|
+
language: NotRequired[Nullable[str]]
|
|
23
|
+
r"""Language of the audio, e.g. 'en'. Providing the language can boost accuracy."""
|
|
24
|
+
temperature: NotRequired[Nullable[float]]
|
|
25
|
+
stream: Literal[False]
|
|
26
|
+
timestamp_granularities: NotRequired[List[TimestampGranularity]]
|
|
27
|
+
r"""Granularities of timestamps to include in the response."""
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class AudioTranscriptionRequest(BaseModel):
|
|
31
|
+
model: Annotated[str, FieldMetadata(multipart=True)]
|
|
32
|
+
|
|
33
|
+
file: Annotated[
|
|
34
|
+
Optional[File], FieldMetadata(multipart=MultipartFormMetadata(file=True))
|
|
35
|
+
] = None
|
|
36
|
+
|
|
37
|
+
file_url: Annotated[OptionalNullable[str], FieldMetadata(multipart=True)] = UNSET
|
|
38
|
+
r"""Url of a file to be transcribed"""
|
|
39
|
+
|
|
40
|
+
file_id: Annotated[OptionalNullable[str], FieldMetadata(multipart=True)] = UNSET
|
|
41
|
+
r"""ID of a file uploaded to /v1/files"""
|
|
42
|
+
|
|
43
|
+
language: Annotated[OptionalNullable[str], FieldMetadata(multipart=True)] = UNSET
|
|
44
|
+
r"""Language of the audio, e.g. 'en'. Providing the language can boost accuracy."""
|
|
45
|
+
|
|
46
|
+
temperature: Annotated[OptionalNullable[float], FieldMetadata(multipart=True)] = (
|
|
47
|
+
UNSET
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
STREAM: Annotated[
|
|
51
|
+
Annotated[Optional[Literal[False]], AfterValidator(validate_const(False))],
|
|
52
|
+
pydantic.Field(alias="stream"),
|
|
53
|
+
FieldMetadata(multipart=True),
|
|
54
|
+
] = False
|
|
55
|
+
|
|
56
|
+
timestamp_granularities: Annotated[
|
|
57
|
+
Optional[List[TimestampGranularity]], FieldMetadata(multipart=True)
|
|
58
|
+
] = None
|
|
59
|
+
r"""Granularities of timestamps to include in the response."""
|
|
60
|
+
|
|
61
|
+
@model_serializer(mode="wrap")
|
|
62
|
+
def serialize_model(self, handler):
|
|
63
|
+
optional_fields = [
|
|
64
|
+
"file",
|
|
65
|
+
"file_url",
|
|
66
|
+
"file_id",
|
|
67
|
+
"language",
|
|
68
|
+
"temperature",
|
|
69
|
+
"stream",
|
|
70
|
+
"timestamp_granularities",
|
|
71
|
+
]
|
|
72
|
+
nullable_fields = ["file_url", "file_id", "language", "temperature"]
|
|
73
|
+
null_default_fields = []
|
|
74
|
+
|
|
75
|
+
serialized = handler(self)
|
|
76
|
+
|
|
77
|
+
m = {}
|
|
78
|
+
|
|
79
|
+
for n, f in type(self).model_fields.items():
|
|
80
|
+
k = f.alias or n
|
|
81
|
+
val = serialized.get(k)
|
|
82
|
+
serialized.pop(k, None)
|
|
83
|
+
|
|
84
|
+
optional_nullable = k in optional_fields and k in nullable_fields
|
|
85
|
+
is_set = (
|
|
86
|
+
self.__pydantic_fields_set__.intersection({n})
|
|
87
|
+
or k in null_default_fields
|
|
88
|
+
) # pylint: disable=no-member
|
|
89
|
+
|
|
90
|
+
if val is not None and val != UNSET_SENTINEL:
|
|
91
|
+
m[k] = val
|
|
92
|
+
elif val != UNSET_SENTINEL and (
|
|
93
|
+
not k in optional_fields or (optional_nullable and is_set)
|
|
94
|
+
):
|
|
95
|
+
m[k] = val
|
|
96
|
+
|
|
97
|
+
return m
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from .file import File, FileTypedDict
|
|
5
|
+
from .timestampgranularity import TimestampGranularity
|
|
6
|
+
from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
|
|
7
|
+
from mistralai.utils import FieldMetadata, MultipartFormMetadata, validate_const
|
|
8
|
+
import pydantic
|
|
9
|
+
from pydantic import model_serializer
|
|
10
|
+
from pydantic.functional_validators import AfterValidator
|
|
11
|
+
from typing import List, Literal, Optional
|
|
12
|
+
from typing_extensions import Annotated, NotRequired, TypedDict
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class AudioTranscriptionRequestStreamTypedDict(TypedDict):
|
|
16
|
+
model: str
|
|
17
|
+
file: NotRequired[FileTypedDict]
|
|
18
|
+
file_url: NotRequired[Nullable[str]]
|
|
19
|
+
r"""Url of a file to be transcribed"""
|
|
20
|
+
file_id: NotRequired[Nullable[str]]
|
|
21
|
+
r"""ID of a file uploaded to /v1/files"""
|
|
22
|
+
language: NotRequired[Nullable[str]]
|
|
23
|
+
r"""Language of the audio, e.g. 'en'. Providing the language can boost accuracy."""
|
|
24
|
+
temperature: NotRequired[Nullable[float]]
|
|
25
|
+
stream: Literal[True]
|
|
26
|
+
timestamp_granularities: NotRequired[List[TimestampGranularity]]
|
|
27
|
+
r"""Granularities of timestamps to include in the response."""
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class AudioTranscriptionRequestStream(BaseModel):
|
|
31
|
+
model: Annotated[str, FieldMetadata(multipart=True)]
|
|
32
|
+
|
|
33
|
+
file: Annotated[
|
|
34
|
+
Optional[File], FieldMetadata(multipart=MultipartFormMetadata(file=True))
|
|
35
|
+
] = None
|
|
36
|
+
|
|
37
|
+
file_url: Annotated[OptionalNullable[str], FieldMetadata(multipart=True)] = UNSET
|
|
38
|
+
r"""Url of a file to be transcribed"""
|
|
39
|
+
|
|
40
|
+
file_id: Annotated[OptionalNullable[str], FieldMetadata(multipart=True)] = UNSET
|
|
41
|
+
r"""ID of a file uploaded to /v1/files"""
|
|
42
|
+
|
|
43
|
+
language: Annotated[OptionalNullable[str], FieldMetadata(multipart=True)] = UNSET
|
|
44
|
+
r"""Language of the audio, e.g. 'en'. Providing the language can boost accuracy."""
|
|
45
|
+
|
|
46
|
+
temperature: Annotated[OptionalNullable[float], FieldMetadata(multipart=True)] = (
|
|
47
|
+
UNSET
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
STREAM: Annotated[
|
|
51
|
+
Annotated[Optional[Literal[True]], AfterValidator(validate_const(True))],
|
|
52
|
+
pydantic.Field(alias="stream"),
|
|
53
|
+
FieldMetadata(multipart=True),
|
|
54
|
+
] = True
|
|
55
|
+
|
|
56
|
+
timestamp_granularities: Annotated[
|
|
57
|
+
Optional[List[TimestampGranularity]], FieldMetadata(multipart=True)
|
|
58
|
+
] = None
|
|
59
|
+
r"""Granularities of timestamps to include in the response."""
|
|
60
|
+
|
|
61
|
+
@model_serializer(mode="wrap")
|
|
62
|
+
def serialize_model(self, handler):
|
|
63
|
+
optional_fields = [
|
|
64
|
+
"file",
|
|
65
|
+
"file_url",
|
|
66
|
+
"file_id",
|
|
67
|
+
"language",
|
|
68
|
+
"temperature",
|
|
69
|
+
"stream",
|
|
70
|
+
"timestamp_granularities",
|
|
71
|
+
]
|
|
72
|
+
nullable_fields = ["file_url", "file_id", "language", "temperature"]
|
|
73
|
+
null_default_fields = []
|
|
74
|
+
|
|
75
|
+
serialized = handler(self)
|
|
76
|
+
|
|
77
|
+
m = {}
|
|
78
|
+
|
|
79
|
+
for n, f in type(self).model_fields.items():
|
|
80
|
+
k = f.alias or n
|
|
81
|
+
val = serialized.get(k)
|
|
82
|
+
serialized.pop(k, None)
|
|
83
|
+
|
|
84
|
+
optional_nullable = k in optional_fields and k in nullable_fields
|
|
85
|
+
is_set = (
|
|
86
|
+
self.__pydantic_fields_set__.intersection({n})
|
|
87
|
+
or k in null_default_fields
|
|
88
|
+
) # pylint: disable=no-member
|
|
89
|
+
|
|
90
|
+
if val is not None and val != UNSET_SENTINEL:
|
|
91
|
+
m[k] = val
|
|
92
|
+
elif val != UNSET_SENTINEL and (
|
|
93
|
+
not k in optional_fields or (optional_nullable and is_set)
|
|
94
|
+
):
|
|
95
|
+
m[k] = val
|
|
96
|
+
|
|
97
|
+
return m
|
|
@@ -12,7 +12,7 @@ from typing import List, Literal, Optional
|
|
|
12
12
|
from typing_extensions import Annotated, NotRequired, TypedDict
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
BaseModelCardType = Literal["base"]
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
class BaseModelCardTypedDict(TypedDict):
|
|
@@ -28,7 +28,7 @@ class BaseModelCardTypedDict(TypedDict):
|
|
|
28
28
|
deprecation: NotRequired[Nullable[datetime]]
|
|
29
29
|
deprecation_replacement_model: NotRequired[Nullable[str]]
|
|
30
30
|
default_model_temperature: NotRequired[Nullable[float]]
|
|
31
|
-
type:
|
|
31
|
+
type: BaseModelCardType
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
class BaseModelCard(BaseModel):
|
|
@@ -57,7 +57,7 @@ class BaseModelCard(BaseModel):
|
|
|
57
57
|
default_model_temperature: OptionalNullable[float] = UNSET
|
|
58
58
|
|
|
59
59
|
TYPE: Annotated[
|
|
60
|
-
Annotated[Optional[
|
|
60
|
+
Annotated[Optional[BaseModelCardType], AfterValidator(validate_const("base"))],
|
|
61
61
|
pydantic.Field(alias="type"),
|
|
62
62
|
] = "base"
|
|
63
63
|
|
mistralai/models/batchjobin.py
CHANGED
|
@@ -13,7 +13,8 @@ from typing_extensions import Annotated, NotRequired, TypedDict
|
|
|
13
13
|
class BatchJobInTypedDict(TypedDict):
|
|
14
14
|
input_files: List[str]
|
|
15
15
|
endpoint: APIEndpoint
|
|
16
|
-
model: str
|
|
16
|
+
model: NotRequired[Nullable[str]]
|
|
17
|
+
agent_id: NotRequired[Nullable[str]]
|
|
17
18
|
metadata: NotRequired[Nullable[Dict[str, str]]]
|
|
18
19
|
timeout_hours: NotRequired[int]
|
|
19
20
|
|
|
@@ -23,7 +24,9 @@ class BatchJobIn(BaseModel):
|
|
|
23
24
|
|
|
24
25
|
endpoint: Annotated[APIEndpoint, PlainValidator(validate_open_enum(False))]
|
|
25
26
|
|
|
26
|
-
model: str
|
|
27
|
+
model: OptionalNullable[str] = UNSET
|
|
28
|
+
|
|
29
|
+
agent_id: OptionalNullable[str] = UNSET
|
|
27
30
|
|
|
28
31
|
metadata: OptionalNullable[Dict[str, str]] = UNSET
|
|
29
32
|
|
|
@@ -31,8 +34,8 @@ class BatchJobIn(BaseModel):
|
|
|
31
34
|
|
|
32
35
|
@model_serializer(mode="wrap")
|
|
33
36
|
def serialize_model(self, handler):
|
|
34
|
-
optional_fields = ["metadata", "timeout_hours"]
|
|
35
|
-
nullable_fields = ["metadata"]
|
|
37
|
+
optional_fields = ["model", "agent_id", "metadata", "timeout_hours"]
|
|
38
|
+
nullable_fields = ["model", "agent_id", "metadata"]
|
|
36
39
|
null_default_fields = []
|
|
37
40
|
|
|
38
41
|
serialized = handler(self)
|
mistralai/models/batchjobout.py
CHANGED
|
@@ -16,7 +16,6 @@ class BatchJobOutTypedDict(TypedDict):
|
|
|
16
16
|
id: str
|
|
17
17
|
input_files: List[str]
|
|
18
18
|
endpoint: str
|
|
19
|
-
model: str
|
|
20
19
|
errors: List[BatchErrorTypedDict]
|
|
21
20
|
status: BatchJobStatus
|
|
22
21
|
created_at: int
|
|
@@ -26,6 +25,8 @@ class BatchJobOutTypedDict(TypedDict):
|
|
|
26
25
|
failed_requests: int
|
|
27
26
|
object: NotRequired[BatchJobOutObject]
|
|
28
27
|
metadata: NotRequired[Nullable[Dict[str, Any]]]
|
|
28
|
+
model: NotRequired[Nullable[str]]
|
|
29
|
+
agent_id: NotRequired[Nullable[str]]
|
|
29
30
|
output_file: NotRequired[Nullable[str]]
|
|
30
31
|
error_file: NotRequired[Nullable[str]]
|
|
31
32
|
started_at: NotRequired[Nullable[int]]
|
|
@@ -39,8 +40,6 @@ class BatchJobOut(BaseModel):
|
|
|
39
40
|
|
|
40
41
|
endpoint: str
|
|
41
42
|
|
|
42
|
-
model: str
|
|
43
|
-
|
|
44
43
|
errors: List[BatchError]
|
|
45
44
|
|
|
46
45
|
status: BatchJobStatus
|
|
@@ -59,6 +58,10 @@ class BatchJobOut(BaseModel):
|
|
|
59
58
|
|
|
60
59
|
metadata: OptionalNullable[Dict[str, Any]] = UNSET
|
|
61
60
|
|
|
61
|
+
model: OptionalNullable[str] = UNSET
|
|
62
|
+
|
|
63
|
+
agent_id: OptionalNullable[str] = UNSET
|
|
64
|
+
|
|
62
65
|
output_file: OptionalNullable[str] = UNSET
|
|
63
66
|
|
|
64
67
|
error_file: OptionalNullable[str] = UNSET
|
|
@@ -72,6 +75,8 @@ class BatchJobOut(BaseModel):
|
|
|
72
75
|
optional_fields = [
|
|
73
76
|
"object",
|
|
74
77
|
"metadata",
|
|
78
|
+
"model",
|
|
79
|
+
"agent_id",
|
|
75
80
|
"output_file",
|
|
76
81
|
"error_file",
|
|
77
82
|
"started_at",
|
|
@@ -79,6 +84,8 @@ class BatchJobOut(BaseModel):
|
|
|
79
84
|
]
|
|
80
85
|
nullable_fields = [
|
|
81
86
|
"metadata",
|
|
87
|
+
"model",
|
|
88
|
+
"agent_id",
|
|
82
89
|
"output_file",
|
|
83
90
|
"error_file",
|
|
84
91
|
"started_at",
|
|
@@ -21,7 +21,9 @@ class ClassifierFTModelOutTypedDict(TypedDict):
|
|
|
21
21
|
id: str
|
|
22
22
|
created: int
|
|
23
23
|
owned_by: str
|
|
24
|
+
workspace_id: str
|
|
24
25
|
root: str
|
|
26
|
+
root_version: str
|
|
25
27
|
archived: bool
|
|
26
28
|
capabilities: FTModelCapabilitiesOutTypedDict
|
|
27
29
|
job: str
|
|
@@ -41,8 +43,12 @@ class ClassifierFTModelOut(BaseModel):
|
|
|
41
43
|
|
|
42
44
|
owned_by: str
|
|
43
45
|
|
|
46
|
+
workspace_id: str
|
|
47
|
+
|
|
44
48
|
root: str
|
|
45
49
|
|
|
50
|
+
root_version: str
|
|
51
|
+
|
|
46
52
|
archived: bool
|
|
47
53
|
|
|
48
54
|
capabilities: FTModelCapabilitiesOut
|