mistralai 1.9.2__py3-none-any.whl → 1.9.6__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/accesses.py +2 -0
- mistralai/audio.py +18 -0
- mistralai/beta.py +1 -1
- mistralai/conversations.py +2 -2
- mistralai/documents.py +2 -0
- mistralai/libraries.py +3 -1
- mistralai/mistral_jobs.py +14 -2
- mistralai/models/__init__.py +125 -2
- 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/messageoutputcontentchunks.py +8 -1
- mistralai/models/outputcontentchunks.py +8 -1
- mistralai/models/retrievefileout.py +8 -2
- mistralai/models/thinkchunk.py +35 -0
- mistralai/models/timestampgranularity.py +7 -0
- 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.6.dist-info}/METADATA +11 -1
- {mistralai-1.9.2.dist-info → mistralai-1.9.6.dist-info}/RECORD +42 -28
- mistralai/version.py +0 -7
- {mistralai-1.9.2.dist-info → mistralai-1.9.6.dist-info}/LICENSE +0 -0
- {mistralai-1.9.2.dist-info → mistralai-1.9.6.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.6"
|
|
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.6 2.634.2 1.0.0 mistralai"
|
|
10
10
|
|
|
11
11
|
try:
|
|
12
12
|
if __package__ is not None:
|
mistralai/accesses.py
CHANGED
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/beta.py
CHANGED
|
@@ -13,7 +13,7 @@ class Beta(BaseSDK):
|
|
|
13
13
|
agents: MistralAgents
|
|
14
14
|
r"""(beta) Agents API"""
|
|
15
15
|
libraries: Libraries
|
|
16
|
-
r"""(beta) Libraries API
|
|
16
|
+
r"""(beta) Libraries API to create and manage libraries - index your documents to enhance agent capabilities."""
|
|
17
17
|
|
|
18
18
|
def __init__(self, sdk_config: SDKConfiguration) -> None:
|
|
19
19
|
BaseSDK.__init__(self, sdk_config)
|
mistralai/conversations.py
CHANGED
|
@@ -85,7 +85,7 @@ class Conversations(BaseSDK):
|
|
|
85
85
|
retries=retries,
|
|
86
86
|
server_url=server_url,
|
|
87
87
|
timeout_ms=timeout_ms,
|
|
88
|
-
**req,
|
|
88
|
+
**req, # type: ignore
|
|
89
89
|
)
|
|
90
90
|
run_result.conversation_id = res.conversation_id
|
|
91
91
|
run_ctx.conversation_id = res.conversation_id
|
|
@@ -164,7 +164,7 @@ class Conversations(BaseSDK):
|
|
|
164
164
|
retries=retries,
|
|
165
165
|
server_url=server_url,
|
|
166
166
|
timeout_ms=timeout_ms,
|
|
167
|
-
**req,
|
|
167
|
+
**req, # type: ignore
|
|
168
168
|
)
|
|
169
169
|
else:
|
|
170
170
|
res = await self.append_stream_async(
|
mistralai/documents.py
CHANGED
mistralai/libraries.py
CHANGED
|
@@ -12,10 +12,12 @@ from typing import Any, Mapping, Optional
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
class Libraries(BaseSDK):
|
|
15
|
-
r"""(beta) Libraries API
|
|
15
|
+
r"""(beta) Libraries API to create and manage libraries - index your documents to enhance agent capabilities."""
|
|
16
16
|
|
|
17
17
|
documents: Documents
|
|
18
|
+
r"""(beta) Libraries API - manage documents in a library."""
|
|
18
19
|
accesses: Accesses
|
|
20
|
+
r"""(beta) Libraries API - manage access to a library."""
|
|
19
21
|
|
|
20
22
|
def __init__(self, sdk_config: SDKConfiguration) -> None:
|
|
21
23
|
BaseSDK.__init__(self, sdk_config)
|
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,6 +768,14 @@ 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
780
|
from .toolcall import ToolCall, ToolCallTypedDict
|
|
764
781
|
from .toolchoice import ToolChoice, ToolChoiceTypedDict
|
|
@@ -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",
|
|
@@ -1416,6 +1477,12 @@ __all__ = [
|
|
|
1416
1477
|
"TextChunk",
|
|
1417
1478
|
"TextChunkType",
|
|
1418
1479
|
"TextChunkTypedDict",
|
|
1480
|
+
"ThinkChunk",
|
|
1481
|
+
"ThinkChunkType",
|
|
1482
|
+
"ThinkChunkTypedDict",
|
|
1483
|
+
"Thinking",
|
|
1484
|
+
"ThinkingTypedDict",
|
|
1485
|
+
"TimestampGranularity",
|
|
1419
1486
|
"Tool",
|
|
1420
1487
|
"ToolCall",
|
|
1421
1488
|
"ToolCallTypedDict",
|
|
@@ -1452,6 +1519,27 @@ __all__ = [
|
|
|
1452
1519
|
"ToolsTypedDict",
|
|
1453
1520
|
"TrainingFile",
|
|
1454
1521
|
"TrainingFileTypedDict",
|
|
1522
|
+
"TranscriptionResponse",
|
|
1523
|
+
"TranscriptionResponseTypedDict",
|
|
1524
|
+
"TranscriptionSegmentChunk",
|
|
1525
|
+
"TranscriptionSegmentChunkTypedDict",
|
|
1526
|
+
"TranscriptionStreamDone",
|
|
1527
|
+
"TranscriptionStreamDoneType",
|
|
1528
|
+
"TranscriptionStreamDoneTypedDict",
|
|
1529
|
+
"TranscriptionStreamEventTypes",
|
|
1530
|
+
"TranscriptionStreamEvents",
|
|
1531
|
+
"TranscriptionStreamEventsData",
|
|
1532
|
+
"TranscriptionStreamEventsDataTypedDict",
|
|
1533
|
+
"TranscriptionStreamEventsTypedDict",
|
|
1534
|
+
"TranscriptionStreamLanguage",
|
|
1535
|
+
"TranscriptionStreamLanguageType",
|
|
1536
|
+
"TranscriptionStreamLanguageTypedDict",
|
|
1537
|
+
"TranscriptionStreamSegmentDelta",
|
|
1538
|
+
"TranscriptionStreamSegmentDeltaType",
|
|
1539
|
+
"TranscriptionStreamSegmentDeltaTypedDict",
|
|
1540
|
+
"TranscriptionStreamTextDelta",
|
|
1541
|
+
"TranscriptionStreamTextDeltaType",
|
|
1542
|
+
"TranscriptionStreamTextDeltaTypedDict",
|
|
1455
1543
|
"Two",
|
|
1456
1544
|
"TwoTypedDict",
|
|
1457
1545
|
"Type",
|
|
@@ -1565,9 +1653,16 @@ _dynamic_imports: dict[str, str] = {
|
|
|
1565
1653
|
"AssistantMessageContentTypedDict": ".assistantmessage",
|
|
1566
1654
|
"AssistantMessageRole": ".assistantmessage",
|
|
1567
1655
|
"AssistantMessageTypedDict": ".assistantmessage",
|
|
1656
|
+
"AudioChunk": ".audiochunk",
|
|
1657
|
+
"AudioChunkType": ".audiochunk",
|
|
1658
|
+
"AudioChunkTypedDict": ".audiochunk",
|
|
1659
|
+
"AudioTranscriptionRequest": ".audiotranscriptionrequest",
|
|
1660
|
+
"AudioTranscriptionRequestTypedDict": ".audiotranscriptionrequest",
|
|
1661
|
+
"AudioTranscriptionRequestStream": ".audiotranscriptionrequeststream",
|
|
1662
|
+
"AudioTranscriptionRequestStreamTypedDict": ".audiotranscriptionrequeststream",
|
|
1568
1663
|
"BaseModelCard": ".basemodelcard",
|
|
1664
|
+
"BaseModelCardType": ".basemodelcard",
|
|
1569
1665
|
"BaseModelCardTypedDict": ".basemodelcard",
|
|
1570
|
-
"Type": ".basemodelcard",
|
|
1571
1666
|
"BatchError": ".batcherror",
|
|
1572
1667
|
"BatchErrorTypedDict": ".batcherror",
|
|
1573
1668
|
"BatchJobIn": ".batchjobin",
|
|
@@ -2067,6 +2162,12 @@ _dynamic_imports: dict[str, str] = {
|
|
|
2067
2162
|
"TextChunk": ".textchunk",
|
|
2068
2163
|
"TextChunkType": ".textchunk",
|
|
2069
2164
|
"TextChunkTypedDict": ".textchunk",
|
|
2165
|
+
"ThinkChunk": ".thinkchunk",
|
|
2166
|
+
"ThinkChunkType": ".thinkchunk",
|
|
2167
|
+
"ThinkChunkTypedDict": ".thinkchunk",
|
|
2168
|
+
"Thinking": ".thinkchunk",
|
|
2169
|
+
"ThinkingTypedDict": ".thinkchunk",
|
|
2170
|
+
"TimestampGranularity": ".timestampgranularity",
|
|
2070
2171
|
"Tool": ".tool",
|
|
2071
2172
|
"ToolTypedDict": ".tool",
|
|
2072
2173
|
"ToolCall": ".toolcall",
|
|
@@ -2101,6 +2202,28 @@ _dynamic_imports: dict[str, str] = {
|
|
|
2101
2202
|
"ToolTypes": ".tooltypes",
|
|
2102
2203
|
"TrainingFile": ".trainingfile",
|
|
2103
2204
|
"TrainingFileTypedDict": ".trainingfile",
|
|
2205
|
+
"TranscriptionResponse": ".transcriptionresponse",
|
|
2206
|
+
"TranscriptionResponseTypedDict": ".transcriptionresponse",
|
|
2207
|
+
"TranscriptionSegmentChunk": ".transcriptionsegmentchunk",
|
|
2208
|
+
"TranscriptionSegmentChunkTypedDict": ".transcriptionsegmentchunk",
|
|
2209
|
+
"Type": ".transcriptionsegmentchunk",
|
|
2210
|
+
"TranscriptionStreamDone": ".transcriptionstreamdone",
|
|
2211
|
+
"TranscriptionStreamDoneType": ".transcriptionstreamdone",
|
|
2212
|
+
"TranscriptionStreamDoneTypedDict": ".transcriptionstreamdone",
|
|
2213
|
+
"TranscriptionStreamEvents": ".transcriptionstreamevents",
|
|
2214
|
+
"TranscriptionStreamEventsData": ".transcriptionstreamevents",
|
|
2215
|
+
"TranscriptionStreamEventsDataTypedDict": ".transcriptionstreamevents",
|
|
2216
|
+
"TranscriptionStreamEventsTypedDict": ".transcriptionstreamevents",
|
|
2217
|
+
"TranscriptionStreamEventTypes": ".transcriptionstreameventtypes",
|
|
2218
|
+
"TranscriptionStreamLanguage": ".transcriptionstreamlanguage",
|
|
2219
|
+
"TranscriptionStreamLanguageType": ".transcriptionstreamlanguage",
|
|
2220
|
+
"TranscriptionStreamLanguageTypedDict": ".transcriptionstreamlanguage",
|
|
2221
|
+
"TranscriptionStreamSegmentDelta": ".transcriptionstreamsegmentdelta",
|
|
2222
|
+
"TranscriptionStreamSegmentDeltaType": ".transcriptionstreamsegmentdelta",
|
|
2223
|
+
"TranscriptionStreamSegmentDeltaTypedDict": ".transcriptionstreamsegmentdelta",
|
|
2224
|
+
"TranscriptionStreamTextDelta": ".transcriptionstreamtextdelta",
|
|
2225
|
+
"TranscriptionStreamTextDeltaType": ".transcriptionstreamtextdelta",
|
|
2226
|
+
"TranscriptionStreamTextDeltaTypedDict": ".transcriptionstreamtextdelta",
|
|
2104
2227
|
"UnarchiveFTModelOut": ".unarchiveftmodelout",
|
|
2105
2228
|
"UnarchiveFTModelOutObject": ".unarchiveftmodelout",
|
|
2106
2229
|
"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)
|