mistralai 1.9.1__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 (85) hide show
  1. mistralai/_version.py +2 -2
  2. mistralai/accesses.py +672 -0
  3. mistralai/audio.py +18 -0
  4. mistralai/beta.py +4 -0
  5. mistralai/documents.py +2136 -0
  6. mistralai/files.py +2 -2
  7. mistralai/libraries.py +1041 -0
  8. mistralai/mistral_jobs.py +14 -2
  9. mistralai/models/__init__.py +360 -9
  10. mistralai/models/audiochunk.py +20 -0
  11. mistralai/models/audiotranscriptionrequest.py +97 -0
  12. mistralai/models/audiotranscriptionrequeststream.py +97 -0
  13. mistralai/models/basemodelcard.py +5 -2
  14. mistralai/models/batchjobin.py +7 -4
  15. mistralai/models/batchjobout.py +10 -3
  16. mistralai/models/classifierftmodelout.py +6 -0
  17. mistralai/models/completionargs.py +3 -2
  18. mistralai/models/completionftmodelout.py +6 -0
  19. mistralai/models/contentchunk.py +6 -0
  20. mistralai/models/conversationevents.py +6 -0
  21. mistralai/models/conversationhistory.py +4 -4
  22. mistralai/models/documentout.py +105 -0
  23. mistralai/models/documenttextcontent.py +13 -0
  24. mistralai/models/documentupdatein.py +44 -0
  25. mistralai/models/entitytype.py +9 -0
  26. mistralai/models/file.py +33 -0
  27. mistralai/models/files_api_routes_upload_fileop.py +2 -27
  28. mistralai/models/fileschema.py +8 -2
  29. mistralai/models/ftmodelcard.py +5 -3
  30. mistralai/models/inputentries.py +4 -4
  31. mistralai/models/jobs_api_routes_batch_get_batch_jobsop.py +8 -1
  32. mistralai/models/libraries_delete_v1op.py +16 -0
  33. mistralai/models/libraries_documents_delete_v1op.py +21 -0
  34. mistralai/models/libraries_documents_get_extracted_text_signed_url_v1op.py +21 -0
  35. mistralai/models/libraries_documents_get_signed_url_v1op.py +21 -0
  36. mistralai/models/libraries_documents_get_status_v1op.py +21 -0
  37. mistralai/models/libraries_documents_get_text_content_v1op.py +21 -0
  38. mistralai/models/libraries_documents_get_v1op.py +21 -0
  39. mistralai/models/libraries_documents_list_v1op.py +78 -0
  40. mistralai/models/libraries_documents_reprocess_v1op.py +21 -0
  41. mistralai/models/libraries_documents_update_v1op.py +28 -0
  42. mistralai/models/libraries_documents_upload_v1op.py +56 -0
  43. mistralai/models/libraries_get_v1op.py +16 -0
  44. mistralai/models/libraries_share_create_v1op.py +22 -0
  45. mistralai/models/libraries_share_delete_v1op.py +23 -0
  46. mistralai/models/libraries_share_list_v1op.py +16 -0
  47. mistralai/models/libraries_update_v1op.py +23 -0
  48. mistralai/models/libraryin.py +50 -0
  49. mistralai/models/libraryinupdate.py +47 -0
  50. mistralai/models/libraryout.py +107 -0
  51. mistralai/models/listdocumentout.py +19 -0
  52. mistralai/models/listlibraryout.py +15 -0
  53. mistralai/models/listsharingout.py +15 -0
  54. mistralai/models/messageinputentry.py +14 -4
  55. mistralai/models/paginationinfo.py +25 -0
  56. mistralai/models/processingstatusout.py +16 -0
  57. mistralai/models/retrievefileout.py +8 -2
  58. mistralai/models/shareenum.py +8 -0
  59. mistralai/models/sharingdelete.py +26 -0
  60. mistralai/models/sharingin.py +30 -0
  61. mistralai/models/sharingout.py +59 -0
  62. mistralai/models/ssetypes.py +1 -0
  63. mistralai/models/thinkchunk.py +35 -0
  64. mistralai/models/timestampgranularity.py +7 -0
  65. mistralai/models/toolcall.py +43 -1
  66. mistralai/models/toolexecutiondeltaevent.py +34 -0
  67. mistralai/models/toolexecutionentry.py +3 -0
  68. mistralai/models/toolexecutionstartedevent.py +3 -0
  69. mistralai/models/toolreferencechunk.py +7 -4
  70. mistralai/models/transcriptionresponse.py +79 -0
  71. mistralai/models/transcriptionsegmentchunk.py +41 -0
  72. mistralai/models/transcriptionstreamdone.py +85 -0
  73. mistralai/models/transcriptionstreamevents.py +58 -0
  74. mistralai/models/transcriptionstreameventtypes.py +12 -0
  75. mistralai/models/transcriptionstreamlanguage.py +35 -0
  76. mistralai/models/transcriptionstreamsegmentdelta.py +41 -0
  77. mistralai/models/transcriptionstreamtextdelta.py +35 -0
  78. mistralai/models/uploadfileout.py +8 -2
  79. mistralai/models/usageinfo.py +65 -8
  80. mistralai/sdk.py +3 -0
  81. mistralai/transcriptions.py +480 -0
  82. {mistralai-1.9.1.dist-info → mistralai-1.9.3.dist-info}/METADATA +37 -2
  83. {mistralai-1.9.1.dist-info → mistralai-1.9.3.dist-info}/RECORD +85 -33
  84. {mistralai-1.9.1.dist-info → mistralai-1.9.3.dist-info}/LICENSE +0 -0
  85. {mistralai-1.9.1.dist-info → mistralai-1.9.3.dist-info}/WHEEL +0 -0
@@ -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,6 +12,9 @@ from typing import List, Literal, Optional
12
12
  from typing_extensions import Annotated, NotRequired, TypedDict
13
13
 
14
14
 
15
+ BaseModelCardType = Literal["base"]
16
+
17
+
15
18
  class BaseModelCardTypedDict(TypedDict):
16
19
  id: str
17
20
  capabilities: ModelCapabilitiesTypedDict
@@ -25,7 +28,7 @@ class BaseModelCardTypedDict(TypedDict):
25
28
  deprecation: NotRequired[Nullable[datetime]]
26
29
  deprecation_replacement_model: NotRequired[Nullable[str]]
27
30
  default_model_temperature: NotRequired[Nullable[float]]
28
- type: Literal["base"]
31
+ type: BaseModelCardType
29
32
 
30
33
 
31
34
  class BaseModelCard(BaseModel):
@@ -54,7 +57,7 @@ class BaseModelCard(BaseModel):
54
57
  default_model_temperature: OptionalNullable[float] = UNSET
55
58
 
56
59
  TYPE: Annotated[
57
- Annotated[Optional[Literal["base"]], AfterValidator(validate_const("base"))],
60
+ Annotated[Optional[BaseModelCardType], AfterValidator(validate_const("base"))],
58
61
  pydantic.Field(alias="type"),
59
62
  ] = "base"
60
63
 
@@ -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)
@@ -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
@@ -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
  ]
@@ -12,6 +12,10 @@ from .responsedoneevent import ResponseDoneEvent, ResponseDoneEventTypedDict
12
12
  from .responseerrorevent import ResponseErrorEvent, ResponseErrorEventTypedDict
13
13
  from .responsestartedevent import ResponseStartedEvent, ResponseStartedEventTypedDict
14
14
  from .ssetypes import SSETypes
15
+ from .toolexecutiondeltaevent import (
16
+ ToolExecutionDeltaEvent,
17
+ ToolExecutionDeltaEventTypedDict,
18
+ )
15
19
  from .toolexecutiondoneevent import (
16
20
  ToolExecutionDoneEvent,
17
21
  ToolExecutionDoneEventTypedDict,
@@ -34,6 +38,7 @@ ConversationEventsDataTypedDict = TypeAliasType(
34
38
  ResponseDoneEventTypedDict,
35
39
  ResponseErrorEventTypedDict,
36
40
  ToolExecutionStartedEventTypedDict,
41
+ ToolExecutionDeltaEventTypedDict,
37
42
  ToolExecutionDoneEventTypedDict,
38
43
  AgentHandoffStartedEventTypedDict,
39
44
  AgentHandoffDoneEventTypedDict,
@@ -52,6 +57,7 @@ ConversationEventsData = Annotated[
52
57
  Annotated[ResponseStartedEvent, Tag("conversation.response.started")],
53
58
  Annotated[FunctionCallEvent, Tag("function.call.delta")],
54
59
  Annotated[MessageOutputEvent, Tag("message.output.delta")],
60
+ Annotated[ToolExecutionDeltaEvent, Tag("tool.execution.delta")],
55
61
  Annotated[ToolExecutionDoneEvent, Tag("tool.execution.done")],
56
62
  Annotated[ToolExecutionStartedEvent, Tag("tool.execution.started")],
57
63
  ],
@@ -17,10 +17,10 @@ ConversationHistoryObject = Literal["conversation.history"]
17
17
  EntriesTypedDict = TypeAliasType(
18
18
  "EntriesTypedDict",
19
19
  Union[
20
- MessageInputEntryTypedDict,
21
20
  FunctionResultEntryTypedDict,
22
- ToolExecutionEntryTypedDict,
21
+ MessageInputEntryTypedDict,
23
22
  FunctionCallEntryTypedDict,
23
+ ToolExecutionEntryTypedDict,
24
24
  MessageOutputEntryTypedDict,
25
25
  AgentHandoffEntryTypedDict,
26
26
  ],
@@ -30,10 +30,10 @@ EntriesTypedDict = TypeAliasType(
30
30
  Entries = TypeAliasType(
31
31
  "Entries",
32
32
  Union[
33
- MessageInputEntry,
34
33
  FunctionResultEntry,
35
- ToolExecutionEntry,
34
+ MessageInputEntry,
36
35
  FunctionCallEntry,
36
+ ToolExecutionEntry,
37
37
  MessageOutputEntry,
38
38
  AgentHandoffEntry,
39
39
  ],
@@ -0,0 +1,105 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from datetime import datetime
5
+ from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
6
+ from pydantic import model_serializer
7
+ from typing_extensions import NotRequired, TypedDict
8
+
9
+
10
+ class DocumentOutTypedDict(TypedDict):
11
+ id: str
12
+ library_id: str
13
+ hash: str
14
+ mime_type: str
15
+ extension: str
16
+ size: int
17
+ name: str
18
+ created_at: datetime
19
+ processing_status: str
20
+ uploaded_by_id: str
21
+ uploaded_by_type: str
22
+ tokens_processing_total: int
23
+ summary: NotRequired[Nullable[str]]
24
+ last_processed_at: NotRequired[Nullable[datetime]]
25
+ number_of_pages: NotRequired[Nullable[int]]
26
+ tokens_processing_main_content: NotRequired[Nullable[int]]
27
+ tokens_processing_summary: NotRequired[Nullable[int]]
28
+
29
+
30
+ class DocumentOut(BaseModel):
31
+ id: str
32
+
33
+ library_id: str
34
+
35
+ hash: str
36
+
37
+ mime_type: str
38
+
39
+ extension: str
40
+
41
+ size: int
42
+
43
+ name: str
44
+
45
+ created_at: datetime
46
+
47
+ processing_status: str
48
+
49
+ uploaded_by_id: str
50
+
51
+ uploaded_by_type: str
52
+
53
+ tokens_processing_total: int
54
+
55
+ summary: OptionalNullable[str] = UNSET
56
+
57
+ last_processed_at: OptionalNullable[datetime] = UNSET
58
+
59
+ number_of_pages: OptionalNullable[int] = UNSET
60
+
61
+ tokens_processing_main_content: OptionalNullable[int] = UNSET
62
+
63
+ tokens_processing_summary: OptionalNullable[int] = UNSET
64
+
65
+ @model_serializer(mode="wrap")
66
+ def serialize_model(self, handler):
67
+ optional_fields = [
68
+ "summary",
69
+ "last_processed_at",
70
+ "number_of_pages",
71
+ "tokens_processing_main_content",
72
+ "tokens_processing_summary",
73
+ ]
74
+ nullable_fields = [
75
+ "summary",
76
+ "last_processed_at",
77
+ "number_of_pages",
78
+ "tokens_processing_main_content",
79
+ "tokens_processing_summary",
80
+ ]
81
+ null_default_fields = []
82
+
83
+ serialized = handler(self)
84
+
85
+ m = {}
86
+
87
+ for n, f in type(self).model_fields.items():
88
+ k = f.alias or n
89
+ val = serialized.get(k)
90
+ serialized.pop(k, None)
91
+
92
+ optional_nullable = k in optional_fields and k in nullable_fields
93
+ is_set = (
94
+ self.__pydantic_fields_set__.intersection({n})
95
+ or k in null_default_fields
96
+ ) # pylint: disable=no-member
97
+
98
+ if val is not None and val != UNSET_SENTINEL:
99
+ m[k] = val
100
+ elif val != UNSET_SENTINEL and (
101
+ not k in optional_fields or (optional_nullable and is_set)
102
+ ):
103
+ m[k] = val
104
+
105
+ return m
@@ -0,0 +1,13 @@
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_extensions import TypedDict
6
+
7
+
8
+ class DocumentTextContentTypedDict(TypedDict):
9
+ text: str
10
+
11
+
12
+ class DocumentTextContent(BaseModel):
13
+ text: str
@@ -0,0 +1,44 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
5
+ from pydantic import model_serializer
6
+ from typing_extensions import NotRequired, TypedDict
7
+
8
+
9
+ class DocumentUpdateInTypedDict(TypedDict):
10
+ name: NotRequired[Nullable[str]]
11
+
12
+
13
+ class DocumentUpdateIn(BaseModel):
14
+ name: OptionalNullable[str] = UNSET
15
+
16
+ @model_serializer(mode="wrap")
17
+ def serialize_model(self, handler):
18
+ optional_fields = ["name"]
19
+ nullable_fields = ["name"]
20
+ null_default_fields = []
21
+
22
+ serialized = handler(self)
23
+
24
+ m = {}
25
+
26
+ for n, f in type(self).model_fields.items():
27
+ k = f.alias or n
28
+ val = serialized.get(k)
29
+ serialized.pop(k, None)
30
+
31
+ optional_nullable = k in optional_fields and k in nullable_fields
32
+ is_set = (
33
+ self.__pydantic_fields_set__.intersection({n})
34
+ or k in null_default_fields
35
+ ) # pylint: disable=no-member
36
+
37
+ if val is not None and val != UNSET_SENTINEL:
38
+ m[k] = val
39
+ elif val != UNSET_SENTINEL and (
40
+ not k in optional_fields or (optional_nullable and is_set)
41
+ ):
42
+ m[k] = val
43
+
44
+ return m
@@ -0,0 +1,9 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from mistralai.types import UnrecognizedStr
5
+ from typing import Literal, Union
6
+
7
+
8
+ EntityType = Union[Literal["User", "Workspace", "Org"], UnrecognizedStr]
9
+ r"""The type of entity, used to share a library."""
@@ -0,0 +1,33 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ import io
5
+ from mistralai.types import BaseModel
6
+ from mistralai.utils import FieldMetadata, MultipartFormMetadata
7
+ import pydantic
8
+ from typing import IO, Optional, Union
9
+ from typing_extensions import Annotated, NotRequired, TypedDict
10
+
11
+
12
+ class FileTypedDict(TypedDict):
13
+ file_name: str
14
+ content: Union[bytes, IO[bytes], io.BufferedReader]
15
+ content_type: NotRequired[str]
16
+
17
+
18
+ class File(BaseModel):
19
+ file_name: Annotated[
20
+ str, pydantic.Field(alias="fileName"), FieldMetadata(multipart=True)
21
+ ]
22
+
23
+ content: Annotated[
24
+ Union[bytes, IO[bytes], io.BufferedReader],
25
+ pydantic.Field(alias=""),
26
+ FieldMetadata(multipart=MultipartFormMetadata(content=True)),
27
+ ]
28
+
29
+ content_type: Annotated[
30
+ Optional[str],
31
+ pydantic.Field(alias="Content-Type"),
32
+ FieldMetadata(multipart=True),
33
+ ] = None