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.
Files changed (36) hide show
  1. mistralai/_version.py +2 -2
  2. mistralai/audio.py +18 -0
  3. mistralai/mistral_jobs.py +14 -2
  4. mistralai/models/__init__.py +130 -3
  5. mistralai/models/audiochunk.py +20 -0
  6. mistralai/models/audiotranscriptionrequest.py +97 -0
  7. mistralai/models/audiotranscriptionrequeststream.py +97 -0
  8. mistralai/models/basemodelcard.py +3 -3
  9. mistralai/models/batchjobin.py +7 -4
  10. mistralai/models/batchjobout.py +10 -3
  11. mistralai/models/classifierftmodelout.py +6 -0
  12. mistralai/models/completionargs.py +3 -2
  13. mistralai/models/completionftmodelout.py +6 -0
  14. mistralai/models/contentchunk.py +6 -0
  15. mistralai/models/fileschema.py +8 -2
  16. mistralai/models/jobs_api_routes_batch_get_batch_jobsop.py +8 -1
  17. mistralai/models/retrievefileout.py +8 -2
  18. mistralai/models/thinkchunk.py +35 -0
  19. mistralai/models/timestampgranularity.py +7 -0
  20. mistralai/models/toolcall.py +43 -1
  21. mistralai/models/transcriptionresponse.py +79 -0
  22. mistralai/models/transcriptionsegmentchunk.py +41 -0
  23. mistralai/models/transcriptionstreamdone.py +85 -0
  24. mistralai/models/transcriptionstreamevents.py +58 -0
  25. mistralai/models/transcriptionstreameventtypes.py +12 -0
  26. mistralai/models/transcriptionstreamlanguage.py +35 -0
  27. mistralai/models/transcriptionstreamsegmentdelta.py +41 -0
  28. mistralai/models/transcriptionstreamtextdelta.py +35 -0
  29. mistralai/models/uploadfileout.py +8 -2
  30. mistralai/models/usageinfo.py +65 -8
  31. mistralai/sdk.py +3 -0
  32. mistralai/transcriptions.py +480 -0
  33. {mistralai-1.9.2.dist-info → mistralai-1.9.3.dist-info}/METADATA +9 -1
  34. {mistralai-1.9.2.dist-info → mistralai-1.9.3.dist-info}/RECORD +36 -21
  35. {mistralai-1.9.2.dist-info → mistralai-1.9.3.dist-info}/LICENSE +0 -0
  36. {mistralai-1.9.2.dist-info → mistralai-1.9.3.dist-info}/WHEEL +0 -0
@@ -17,7 +17,7 @@ class CompletionArgsTypedDict(TypedDict):
17
17
  stop: NotRequired[Nullable[CompletionArgsStopTypedDict]]
18
18
  presence_penalty: NotRequired[Nullable[float]]
19
19
  frequency_penalty: NotRequired[Nullable[float]]
20
- temperature: NotRequired[float]
20
+ temperature: NotRequired[Nullable[float]]
21
21
  top_p: NotRequired[Nullable[float]]
22
22
  max_tokens: NotRequired[Nullable[int]]
23
23
  random_seed: NotRequired[Nullable[int]]
@@ -35,7 +35,7 @@ class CompletionArgs(BaseModel):
35
35
 
36
36
  frequency_penalty: OptionalNullable[float] = UNSET
37
37
 
38
- temperature: Optional[float] = 0.3
38
+ temperature: OptionalNullable[float] = UNSET
39
39
 
40
40
  top_p: OptionalNullable[float] = UNSET
41
41
 
@@ -67,6 +67,7 @@ class CompletionArgs(BaseModel):
67
67
  "stop",
68
68
  "presence_penalty",
69
69
  "frequency_penalty",
70
+ "temperature",
70
71
  "top_p",
71
72
  "max_tokens",
72
73
  "random_seed",
@@ -20,7 +20,9 @@ class CompletionFTModelOutTypedDict(TypedDict):
20
20
  id: str
21
21
  created: int
22
22
  owned_by: str
23
+ workspace_id: str
23
24
  root: str
25
+ root_version: str
24
26
  archived: bool
25
27
  capabilities: FTModelCapabilitiesOutTypedDict
26
28
  job: str
@@ -39,8 +41,12 @@ class CompletionFTModelOut(BaseModel):
39
41
 
40
42
  owned_by: str
41
43
 
44
+ workspace_id: str
45
+
42
46
  root: str
43
47
 
48
+ root_version: str
49
+
44
50
  archived: bool
45
51
 
46
52
  capabilities: FTModelCapabilitiesOut
@@ -1,11 +1,13 @@
1
1
  """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
2
 
3
3
  from __future__ import annotations
4
+ from .audiochunk import AudioChunk, AudioChunkTypedDict
4
5
  from .documenturlchunk import DocumentURLChunk, DocumentURLChunkTypedDict
5
6
  from .filechunk import FileChunk, FileChunkTypedDict
6
7
  from .imageurlchunk import ImageURLChunk, ImageURLChunkTypedDict
7
8
  from .referencechunk import ReferenceChunk, ReferenceChunkTypedDict
8
9
  from .textchunk import TextChunk, TextChunkTypedDict
10
+ from .thinkchunk import ThinkChunk, ThinkChunkTypedDict
9
11
  from mistralai.utils import get_discriminator
10
12
  from pydantic import Discriminator, Tag
11
13
  from typing import Union
@@ -19,7 +21,9 @@ ContentChunkTypedDict = TypeAliasType(
19
21
  ImageURLChunkTypedDict,
20
22
  ReferenceChunkTypedDict,
21
23
  FileChunkTypedDict,
24
+ AudioChunkTypedDict,
22
25
  DocumentURLChunkTypedDict,
26
+ ThinkChunkTypedDict,
23
27
  ],
24
28
  )
25
29
 
@@ -31,6 +35,8 @@ ContentChunk = Annotated[
31
35
  Annotated[TextChunk, Tag("text")],
32
36
  Annotated[ReferenceChunk, Tag("reference")],
33
37
  Annotated[FileChunk, Tag("file")],
38
+ Annotated[ThinkChunk, Tag("thinking")],
39
+ Annotated[AudioChunk, Tag("input_audio")],
34
40
  ],
35
41
  Discriminator(lambda m: get_discriminator(m, "type", "type")),
36
42
  ]
@@ -27,6 +27,8 @@ class FileSchemaTypedDict(TypedDict):
27
27
  sample_type: SampleType
28
28
  source: Source
29
29
  num_lines: NotRequired[Nullable[int]]
30
+ mimetype: NotRequired[Nullable[str]]
31
+ signature: NotRequired[Nullable[str]]
30
32
 
31
33
 
32
34
  class FileSchema(BaseModel):
@@ -53,10 +55,14 @@ class FileSchema(BaseModel):
53
55
 
54
56
  num_lines: OptionalNullable[int] = UNSET
55
57
 
58
+ mimetype: OptionalNullable[str] = UNSET
59
+
60
+ signature: OptionalNullable[str] = UNSET
61
+
56
62
  @model_serializer(mode="wrap")
57
63
  def serialize_model(self, handler):
58
- optional_fields = ["num_lines"]
59
- nullable_fields = ["num_lines"]
64
+ optional_fields = ["num_lines", "mimetype", "signature"]
65
+ nullable_fields = ["num_lines", "mimetype", "signature"]
60
66
  null_default_fields = []
61
67
 
62
68
  serialized = handler(self)
@@ -14,6 +14,7 @@ class JobsAPIRoutesBatchGetBatchJobsRequestTypedDict(TypedDict):
14
14
  page: NotRequired[int]
15
15
  page_size: NotRequired[int]
16
16
  model: NotRequired[Nullable[str]]
17
+ agent_id: NotRequired[Nullable[str]]
17
18
  metadata: NotRequired[Nullable[Dict[str, Any]]]
18
19
  created_after: NotRequired[Nullable[datetime]]
19
20
  created_by_me: NotRequired[bool]
@@ -36,6 +37,11 @@ class JobsAPIRoutesBatchGetBatchJobsRequest(BaseModel):
36
37
  FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
37
38
  ] = UNSET
38
39
 
40
+ agent_id: Annotated[
41
+ OptionalNullable[str],
42
+ FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
43
+ ] = UNSET
44
+
39
45
  metadata: Annotated[
40
46
  OptionalNullable[Dict[str, Any]],
41
47
  FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
@@ -62,12 +68,13 @@ class JobsAPIRoutesBatchGetBatchJobsRequest(BaseModel):
62
68
  "page",
63
69
  "page_size",
64
70
  "model",
71
+ "agent_id",
65
72
  "metadata",
66
73
  "created_after",
67
74
  "created_by_me",
68
75
  "status",
69
76
  ]
70
- nullable_fields = ["model", "metadata", "created_after", "status"]
77
+ nullable_fields = ["model", "agent_id", "metadata", "created_after", "status"]
71
78
  null_default_fields = []
72
79
 
73
80
  serialized = handler(self)
@@ -28,6 +28,8 @@ class RetrieveFileOutTypedDict(TypedDict):
28
28
  source: Source
29
29
  deleted: bool
30
30
  num_lines: NotRequired[Nullable[int]]
31
+ mimetype: NotRequired[Nullable[str]]
32
+ signature: NotRequired[Nullable[str]]
31
33
 
32
34
 
33
35
  class RetrieveFileOut(BaseModel):
@@ -56,10 +58,14 @@ class RetrieveFileOut(BaseModel):
56
58
 
57
59
  num_lines: OptionalNullable[int] = UNSET
58
60
 
61
+ mimetype: OptionalNullable[str] = UNSET
62
+
63
+ signature: OptionalNullable[str] = UNSET
64
+
59
65
  @model_serializer(mode="wrap")
60
66
  def serialize_model(self, handler):
61
- optional_fields = ["num_lines"]
62
- nullable_fields = ["num_lines"]
67
+ optional_fields = ["num_lines", "mimetype", "signature"]
68
+ nullable_fields = ["num_lines", "mimetype", "signature"]
63
69
  null_default_fields = []
64
70
 
65
71
  serialized = handler(self)
@@ -0,0 +1,35 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from .referencechunk import ReferenceChunk, ReferenceChunkTypedDict
5
+ from .textchunk import TextChunk, TextChunkTypedDict
6
+ from mistralai.types import BaseModel
7
+ from typing import List, Literal, Optional, Union
8
+ from typing_extensions import NotRequired, TypeAliasType, TypedDict
9
+
10
+
11
+ ThinkingTypedDict = TypeAliasType(
12
+ "ThinkingTypedDict", Union[ReferenceChunkTypedDict, TextChunkTypedDict]
13
+ )
14
+
15
+
16
+ Thinking = TypeAliasType("Thinking", Union[ReferenceChunk, TextChunk])
17
+
18
+
19
+ ThinkChunkType = Literal["thinking"]
20
+
21
+
22
+ class ThinkChunkTypedDict(TypedDict):
23
+ thinking: List[ThinkingTypedDict]
24
+ closed: NotRequired[bool]
25
+ r"""Whether the thinking chunk is closed or not. Currently only used for prefixing."""
26
+ type: NotRequired[ThinkChunkType]
27
+
28
+
29
+ class ThinkChunk(BaseModel):
30
+ thinking: List[Thinking]
31
+
32
+ closed: Optional[bool] = None
33
+ r"""Whether the thinking chunk is closed or not. Currently only used for prefixing."""
34
+
35
+ type: Optional[ThinkChunkType] = "thinking"
@@ -0,0 +1,7 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from typing import Literal
5
+
6
+
7
+ TimestampGranularity = Literal["segment"]
@@ -3,18 +3,28 @@
3
3
  from __future__ import annotations
4
4
  from .functioncall import FunctionCall, FunctionCallTypedDict
5
5
  from .tooltypes import ToolTypes
6
- from mistralai.types import BaseModel
6
+ from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
7
7
  from mistralai.utils import validate_open_enum
8
+ from pydantic import model_serializer
8
9
  from pydantic.functional_validators import PlainValidator
9
10
  from typing import Optional
10
11
  from typing_extensions import Annotated, NotRequired, TypedDict
11
12
 
12
13
 
14
+ class MetadataTypedDict(TypedDict):
15
+ pass
16
+
17
+
18
+ class Metadata(BaseModel):
19
+ pass
20
+
21
+
13
22
  class ToolCallTypedDict(TypedDict):
14
23
  function: FunctionCallTypedDict
15
24
  id: NotRequired[str]
16
25
  type: NotRequired[ToolTypes]
17
26
  index: NotRequired[int]
27
+ metadata: NotRequired[Nullable[MetadataTypedDict]]
18
28
 
19
29
 
20
30
  class ToolCall(BaseModel):
@@ -27,3 +37,35 @@ class ToolCall(BaseModel):
27
37
  )
28
38
 
29
39
  index: Optional[int] = 0
40
+
41
+ metadata: OptionalNullable[Metadata] = UNSET
42
+
43
+ @model_serializer(mode="wrap")
44
+ def serialize_model(self, handler):
45
+ optional_fields = ["id", "type", "index", "metadata"]
46
+ nullable_fields = ["metadata"]
47
+ null_default_fields = []
48
+
49
+ serialized = handler(self)
50
+
51
+ m = {}
52
+
53
+ for n, f in type(self).model_fields.items():
54
+ k = f.alias or n
55
+ val = serialized.get(k)
56
+ serialized.pop(k, None)
57
+
58
+ optional_nullable = k in optional_fields and k in nullable_fields
59
+ is_set = (
60
+ self.__pydantic_fields_set__.intersection({n})
61
+ or k in null_default_fields
62
+ ) # pylint: disable=no-member
63
+
64
+ if val is not None and val != UNSET_SENTINEL:
65
+ m[k] = val
66
+ elif val != UNSET_SENTINEL and (
67
+ not k in optional_fields or (optional_nullable and is_set)
68
+ ):
69
+ m[k] = val
70
+
71
+ return m
@@ -0,0 +1,79 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from .transcriptionsegmentchunk import (
5
+ TranscriptionSegmentChunk,
6
+ TranscriptionSegmentChunkTypedDict,
7
+ )
8
+ from .usageinfo import UsageInfo, UsageInfoTypedDict
9
+ from mistralai.types import BaseModel, Nullable, UNSET_SENTINEL
10
+ import pydantic
11
+ from pydantic import ConfigDict, model_serializer
12
+ from typing import Any, Dict, List, Optional
13
+ from typing_extensions import NotRequired, TypedDict
14
+
15
+
16
+ class TranscriptionResponseTypedDict(TypedDict):
17
+ model: str
18
+ text: str
19
+ usage: UsageInfoTypedDict
20
+ language: Nullable[str]
21
+ segments: NotRequired[List[TranscriptionSegmentChunkTypedDict]]
22
+
23
+
24
+ class TranscriptionResponse(BaseModel):
25
+ model_config = ConfigDict(
26
+ populate_by_name=True, arbitrary_types_allowed=True, extra="allow"
27
+ )
28
+ __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False)
29
+
30
+ model: str
31
+
32
+ text: str
33
+
34
+ usage: UsageInfo
35
+
36
+ language: Nullable[str]
37
+
38
+ segments: Optional[List[TranscriptionSegmentChunk]] = None
39
+
40
+ @property
41
+ def additional_properties(self):
42
+ return self.__pydantic_extra__
43
+
44
+ @additional_properties.setter
45
+ def additional_properties(self, value):
46
+ self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride]
47
+
48
+ @model_serializer(mode="wrap")
49
+ def serialize_model(self, handler):
50
+ optional_fields = ["segments"]
51
+ nullable_fields = ["language"]
52
+ null_default_fields = []
53
+
54
+ serialized = handler(self)
55
+
56
+ m = {}
57
+
58
+ for n, f in type(self).model_fields.items():
59
+ k = f.alias or n
60
+ val = serialized.get(k)
61
+ serialized.pop(k, None)
62
+
63
+ optional_nullable = k in optional_fields and k in nullable_fields
64
+ is_set = (
65
+ self.__pydantic_fields_set__.intersection({n})
66
+ or k in null_default_fields
67
+ ) # pylint: disable=no-member
68
+
69
+ if val is not None and val != UNSET_SENTINEL:
70
+ m[k] = val
71
+ elif val != UNSET_SENTINEL and (
72
+ not k in optional_fields or (optional_nullable and is_set)
73
+ ):
74
+ m[k] = val
75
+
76
+ for k, v in serialized.items():
77
+ m[k] = v
78
+
79
+ return m
@@ -0,0 +1,41 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from mistralai.types import BaseModel
5
+ import pydantic
6
+ from pydantic import ConfigDict
7
+ from typing import Any, Dict, Literal, Optional
8
+ from typing_extensions import NotRequired, TypedDict
9
+
10
+
11
+ Type = Literal["transcription_segment"]
12
+
13
+
14
+ class TranscriptionSegmentChunkTypedDict(TypedDict):
15
+ text: str
16
+ start: float
17
+ end: float
18
+ type: NotRequired[Type]
19
+
20
+
21
+ class TranscriptionSegmentChunk(BaseModel):
22
+ model_config = ConfigDict(
23
+ populate_by_name=True, arbitrary_types_allowed=True, extra="allow"
24
+ )
25
+ __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False)
26
+
27
+ text: str
28
+
29
+ start: float
30
+
31
+ end: float
32
+
33
+ type: Optional[Type] = "transcription_segment"
34
+
35
+ @property
36
+ def additional_properties(self):
37
+ return self.__pydantic_extra__
38
+
39
+ @additional_properties.setter
40
+ def additional_properties(self, value):
41
+ self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride]
@@ -0,0 +1,85 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from .transcriptionsegmentchunk import (
5
+ TranscriptionSegmentChunk,
6
+ TranscriptionSegmentChunkTypedDict,
7
+ )
8
+ from .usageinfo import UsageInfo, UsageInfoTypedDict
9
+ from mistralai.types import BaseModel, Nullable, UNSET_SENTINEL
10
+ import pydantic
11
+ from pydantic import ConfigDict, model_serializer
12
+ from typing import Any, Dict, List, Literal, Optional
13
+ from typing_extensions import NotRequired, TypedDict
14
+
15
+
16
+ TranscriptionStreamDoneType = Literal["transcription.done"]
17
+
18
+
19
+ class TranscriptionStreamDoneTypedDict(TypedDict):
20
+ model: str
21
+ text: str
22
+ usage: UsageInfoTypedDict
23
+ language: Nullable[str]
24
+ segments: NotRequired[List[TranscriptionSegmentChunkTypedDict]]
25
+ type: NotRequired[TranscriptionStreamDoneType]
26
+
27
+
28
+ class TranscriptionStreamDone(BaseModel):
29
+ model_config = ConfigDict(
30
+ populate_by_name=True, arbitrary_types_allowed=True, extra="allow"
31
+ )
32
+ __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False)
33
+
34
+ model: str
35
+
36
+ text: str
37
+
38
+ usage: UsageInfo
39
+
40
+ language: Nullable[str]
41
+
42
+ segments: Optional[List[TranscriptionSegmentChunk]] = None
43
+
44
+ type: Optional[TranscriptionStreamDoneType] = "transcription.done"
45
+
46
+ @property
47
+ def additional_properties(self):
48
+ return self.__pydantic_extra__
49
+
50
+ @additional_properties.setter
51
+ def additional_properties(self, value):
52
+ self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride]
53
+
54
+ @model_serializer(mode="wrap")
55
+ def serialize_model(self, handler):
56
+ optional_fields = ["segments", "type"]
57
+ nullable_fields = ["language"]
58
+ null_default_fields = []
59
+
60
+ serialized = handler(self)
61
+
62
+ m = {}
63
+
64
+ for n, f in type(self).model_fields.items():
65
+ k = f.alias or n
66
+ val = serialized.get(k)
67
+ serialized.pop(k, None)
68
+
69
+ optional_nullable = k in optional_fields and k in nullable_fields
70
+ is_set = (
71
+ self.__pydantic_fields_set__.intersection({n})
72
+ or k in null_default_fields
73
+ ) # pylint: disable=no-member
74
+
75
+ if val is not None and val != UNSET_SENTINEL:
76
+ m[k] = val
77
+ elif val != UNSET_SENTINEL and (
78
+ not k in optional_fields or (optional_nullable and is_set)
79
+ ):
80
+ m[k] = val
81
+
82
+ for k, v in serialized.items():
83
+ m[k] = v
84
+
85
+ return m
@@ -0,0 +1,58 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from .transcriptionstreamdone import (
5
+ TranscriptionStreamDone,
6
+ TranscriptionStreamDoneTypedDict,
7
+ )
8
+ from .transcriptionstreameventtypes import TranscriptionStreamEventTypes
9
+ from .transcriptionstreamlanguage import (
10
+ TranscriptionStreamLanguage,
11
+ TranscriptionStreamLanguageTypedDict,
12
+ )
13
+ from .transcriptionstreamsegmentdelta import (
14
+ TranscriptionStreamSegmentDelta,
15
+ TranscriptionStreamSegmentDeltaTypedDict,
16
+ )
17
+ from .transcriptionstreamtextdelta import (
18
+ TranscriptionStreamTextDelta,
19
+ TranscriptionStreamTextDeltaTypedDict,
20
+ )
21
+ from mistralai.types import BaseModel
22
+ from mistralai.utils import get_discriminator
23
+ from pydantic import Discriminator, Tag
24
+ from typing import Union
25
+ from typing_extensions import Annotated, TypeAliasType, TypedDict
26
+
27
+
28
+ TranscriptionStreamEventsDataTypedDict = TypeAliasType(
29
+ "TranscriptionStreamEventsDataTypedDict",
30
+ Union[
31
+ TranscriptionStreamTextDeltaTypedDict,
32
+ TranscriptionStreamLanguageTypedDict,
33
+ TranscriptionStreamSegmentDeltaTypedDict,
34
+ TranscriptionStreamDoneTypedDict,
35
+ ],
36
+ )
37
+
38
+
39
+ TranscriptionStreamEventsData = Annotated[
40
+ Union[
41
+ Annotated[TranscriptionStreamDone, Tag("transcription.done")],
42
+ Annotated[TranscriptionStreamLanguage, Tag("transcription.language")],
43
+ Annotated[TranscriptionStreamSegmentDelta, Tag("transcription.segment")],
44
+ Annotated[TranscriptionStreamTextDelta, Tag("transcription.text.delta")],
45
+ ],
46
+ Discriminator(lambda m: get_discriminator(m, "type", "type")),
47
+ ]
48
+
49
+
50
+ class TranscriptionStreamEventsTypedDict(TypedDict):
51
+ event: TranscriptionStreamEventTypes
52
+ data: TranscriptionStreamEventsDataTypedDict
53
+
54
+
55
+ class TranscriptionStreamEvents(BaseModel):
56
+ event: TranscriptionStreamEventTypes
57
+
58
+ data: TranscriptionStreamEventsData
@@ -0,0 +1,12 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from typing import Literal
5
+
6
+
7
+ TranscriptionStreamEventTypes = Literal[
8
+ "transcription.language",
9
+ "transcription.segment",
10
+ "transcription.text.delta",
11
+ "transcription.done",
12
+ ]
@@ -0,0 +1,35 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from mistralai.types import BaseModel
5
+ import pydantic
6
+ from pydantic import ConfigDict
7
+ from typing import Any, Dict, Literal, Optional
8
+ from typing_extensions import NotRequired, TypedDict
9
+
10
+
11
+ TranscriptionStreamLanguageType = Literal["transcription.language"]
12
+
13
+
14
+ class TranscriptionStreamLanguageTypedDict(TypedDict):
15
+ audio_language: str
16
+ type: NotRequired[TranscriptionStreamLanguageType]
17
+
18
+
19
+ class TranscriptionStreamLanguage(BaseModel):
20
+ model_config = ConfigDict(
21
+ populate_by_name=True, arbitrary_types_allowed=True, extra="allow"
22
+ )
23
+ __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False)
24
+
25
+ audio_language: str
26
+
27
+ type: Optional[TranscriptionStreamLanguageType] = "transcription.language"
28
+
29
+ @property
30
+ def additional_properties(self):
31
+ return self.__pydantic_extra__
32
+
33
+ @additional_properties.setter
34
+ def additional_properties(self, value):
35
+ self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride]
@@ -0,0 +1,41 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from mistralai.types import BaseModel
5
+ import pydantic
6
+ from pydantic import ConfigDict
7
+ from typing import Any, Dict, Literal, Optional
8
+ from typing_extensions import NotRequired, TypedDict
9
+
10
+
11
+ TranscriptionStreamSegmentDeltaType = Literal["transcription.segment"]
12
+
13
+
14
+ class TranscriptionStreamSegmentDeltaTypedDict(TypedDict):
15
+ text: str
16
+ start: float
17
+ end: float
18
+ type: NotRequired[TranscriptionStreamSegmentDeltaType]
19
+
20
+
21
+ class TranscriptionStreamSegmentDelta(BaseModel):
22
+ model_config = ConfigDict(
23
+ populate_by_name=True, arbitrary_types_allowed=True, extra="allow"
24
+ )
25
+ __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False)
26
+
27
+ text: str
28
+
29
+ start: float
30
+
31
+ end: float
32
+
33
+ type: Optional[TranscriptionStreamSegmentDeltaType] = "transcription.segment"
34
+
35
+ @property
36
+ def additional_properties(self):
37
+ return self.__pydantic_extra__
38
+
39
+ @additional_properties.setter
40
+ def additional_properties(self, value):
41
+ self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride]
@@ -0,0 +1,35 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from mistralai.types import BaseModel
5
+ import pydantic
6
+ from pydantic import ConfigDict
7
+ from typing import Any, Dict, Literal, Optional
8
+ from typing_extensions import NotRequired, TypedDict
9
+
10
+
11
+ TranscriptionStreamTextDeltaType = Literal["transcription.text.delta"]
12
+
13
+
14
+ class TranscriptionStreamTextDeltaTypedDict(TypedDict):
15
+ text: str
16
+ type: NotRequired[TranscriptionStreamTextDeltaType]
17
+
18
+
19
+ class TranscriptionStreamTextDelta(BaseModel):
20
+ model_config = ConfigDict(
21
+ populate_by_name=True, arbitrary_types_allowed=True, extra="allow"
22
+ )
23
+ __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False)
24
+
25
+ text: str
26
+
27
+ type: Optional[TranscriptionStreamTextDeltaType] = "transcription.text.delta"
28
+
29
+ @property
30
+ def additional_properties(self):
31
+ return self.__pydantic_extra__
32
+
33
+ @additional_properties.setter
34
+ def additional_properties(self, value):
35
+ self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride]