mistralai 1.7.1__py3-none-any.whl → 1.8.1__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/beta.py +22 -0
- mistralai/conversations.py +2660 -0
- mistralai/embeddings.py +12 -0
- mistralai/extra/__init__.py +10 -2
- mistralai/extra/exceptions.py +14 -0
- mistralai/extra/mcp/__init__.py +0 -0
- mistralai/extra/mcp/auth.py +166 -0
- mistralai/extra/mcp/base.py +155 -0
- mistralai/extra/mcp/sse.py +165 -0
- mistralai/extra/mcp/stdio.py +22 -0
- mistralai/extra/run/__init__.py +0 -0
- mistralai/extra/run/context.py +295 -0
- mistralai/extra/run/result.py +212 -0
- mistralai/extra/run/tools.py +225 -0
- mistralai/extra/run/utils.py +36 -0
- mistralai/extra/tests/test_struct_chat.py +1 -1
- mistralai/mistral_agents.py +1160 -0
- mistralai/models/__init__.py +472 -1
- mistralai/models/agent.py +129 -0
- mistralai/models/agentconversation.py +71 -0
- mistralai/models/agentcreationrequest.py +109 -0
- mistralai/models/agenthandoffdoneevent.py +33 -0
- mistralai/models/agenthandoffentry.py +75 -0
- mistralai/models/agenthandoffstartedevent.py +33 -0
- mistralai/models/agents_api_v1_agents_getop.py +16 -0
- mistralai/models/agents_api_v1_agents_listop.py +24 -0
- mistralai/models/agents_api_v1_agents_update_versionop.py +21 -0
- mistralai/models/agents_api_v1_agents_updateop.py +23 -0
- mistralai/models/agents_api_v1_conversations_append_streamop.py +28 -0
- mistralai/models/agents_api_v1_conversations_appendop.py +28 -0
- mistralai/models/agents_api_v1_conversations_getop.py +33 -0
- mistralai/models/agents_api_v1_conversations_historyop.py +16 -0
- mistralai/models/agents_api_v1_conversations_listop.py +37 -0
- mistralai/models/agents_api_v1_conversations_messagesop.py +16 -0
- mistralai/models/agents_api_v1_conversations_restart_streamop.py +26 -0
- mistralai/models/agents_api_v1_conversations_restartop.py +26 -0
- mistralai/models/agentupdaterequest.py +111 -0
- mistralai/models/builtinconnectors.py +13 -0
- mistralai/models/chatcompletionresponse.py +6 -6
- mistralai/models/codeinterpretertool.py +17 -0
- mistralai/models/completionargs.py +100 -0
- mistralai/models/completionargsstop.py +13 -0
- mistralai/models/completionjobout.py +3 -3
- mistralai/models/conversationappendrequest.py +35 -0
- mistralai/models/conversationappendstreamrequest.py +37 -0
- mistralai/models/conversationevents.py +72 -0
- mistralai/models/conversationhistory.py +58 -0
- mistralai/models/conversationinputs.py +14 -0
- mistralai/models/conversationmessages.py +28 -0
- mistralai/models/conversationrequest.py +133 -0
- mistralai/models/conversationresponse.py +51 -0
- mistralai/models/conversationrestartrequest.py +42 -0
- mistralai/models/conversationrestartstreamrequest.py +44 -0
- mistralai/models/conversationstreamrequest.py +135 -0
- mistralai/models/conversationusageinfo.py +63 -0
- mistralai/models/documentlibrarytool.py +22 -0
- mistralai/models/embeddingdtype.py +7 -0
- mistralai/models/embeddingrequest.py +43 -3
- mistralai/models/fimcompletionresponse.py +6 -6
- mistralai/models/functioncallentry.py +76 -0
- mistralai/models/functioncallentryarguments.py +15 -0
- mistralai/models/functioncallevent.py +36 -0
- mistralai/models/functionresultentry.py +69 -0
- mistralai/models/functiontool.py +21 -0
- mistralai/models/imagegenerationtool.py +17 -0
- mistralai/models/inputentries.py +18 -0
- mistralai/models/messageentries.py +18 -0
- mistralai/models/messageinputcontentchunks.py +26 -0
- mistralai/models/messageinputentry.py +89 -0
- mistralai/models/messageoutputcontentchunks.py +30 -0
- mistralai/models/messageoutputentry.py +100 -0
- mistralai/models/messageoutputevent.py +93 -0
- mistralai/models/modelconversation.py +127 -0
- mistralai/models/outputcontentchunks.py +30 -0
- mistralai/models/responsedoneevent.py +25 -0
- mistralai/models/responseerrorevent.py +27 -0
- mistralai/models/responsestartedevent.py +24 -0
- mistralai/models/ssetypes.py +18 -0
- mistralai/models/toolexecutiondoneevent.py +34 -0
- mistralai/models/toolexecutionentry.py +70 -0
- mistralai/models/toolexecutionstartedevent.py +31 -0
- mistralai/models/toolfilechunk.py +61 -0
- mistralai/models/toolreferencechunk.py +61 -0
- mistralai/models/websearchpremiumtool.py +17 -0
- mistralai/models/websearchtool.py +17 -0
- mistralai/sdk.py +3 -0
- {mistralai-1.7.1.dist-info → mistralai-1.8.1.dist-info}/METADATA +42 -7
- {mistralai-1.7.1.dist-info → mistralai-1.8.1.dist-info}/RECORD +91 -14
- {mistralai-1.7.1.dist-info → mistralai-1.8.1.dist-info}/LICENSE +0 -0
- {mistralai-1.7.1.dist-info → mistralai-1.8.1.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from .codeinterpretertool import CodeInterpreterTool, CodeInterpreterToolTypedDict
|
|
5
|
+
from .completionargs import CompletionArgs, CompletionArgsTypedDict
|
|
6
|
+
from .documentlibrarytool import DocumentLibraryTool, DocumentLibraryToolTypedDict
|
|
7
|
+
from .functiontool import FunctionTool, FunctionToolTypedDict
|
|
8
|
+
from .imagegenerationtool import ImageGenerationTool, ImageGenerationToolTypedDict
|
|
9
|
+
from .websearchpremiumtool import WebSearchPremiumTool, WebSearchPremiumToolTypedDict
|
|
10
|
+
from .websearchtool import WebSearchTool, WebSearchToolTypedDict
|
|
11
|
+
from datetime import datetime
|
|
12
|
+
from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
|
|
13
|
+
from mistralai.utils import get_discriminator
|
|
14
|
+
from pydantic import Discriminator, Tag, model_serializer
|
|
15
|
+
from typing import List, Literal, Optional, Union
|
|
16
|
+
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
AgentToolsTypedDict = TypeAliasType(
|
|
20
|
+
"AgentToolsTypedDict",
|
|
21
|
+
Union[
|
|
22
|
+
WebSearchToolTypedDict,
|
|
23
|
+
WebSearchPremiumToolTypedDict,
|
|
24
|
+
CodeInterpreterToolTypedDict,
|
|
25
|
+
ImageGenerationToolTypedDict,
|
|
26
|
+
FunctionToolTypedDict,
|
|
27
|
+
DocumentLibraryToolTypedDict,
|
|
28
|
+
],
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
AgentTools = Annotated[
|
|
33
|
+
Union[
|
|
34
|
+
Annotated[CodeInterpreterTool, Tag("code_interpreter")],
|
|
35
|
+
Annotated[DocumentLibraryTool, Tag("document_library")],
|
|
36
|
+
Annotated[FunctionTool, Tag("function")],
|
|
37
|
+
Annotated[ImageGenerationTool, Tag("image_generation")],
|
|
38
|
+
Annotated[WebSearchTool, Tag("web_search")],
|
|
39
|
+
Annotated[WebSearchPremiumTool, Tag("web_search_premium")],
|
|
40
|
+
],
|
|
41
|
+
Discriminator(lambda m: get_discriminator(m, "type", "type")),
|
|
42
|
+
]
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
AgentObject = Literal["agent"]
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
class AgentTypedDict(TypedDict):
|
|
49
|
+
model: str
|
|
50
|
+
name: str
|
|
51
|
+
id: str
|
|
52
|
+
version: int
|
|
53
|
+
created_at: datetime
|
|
54
|
+
updated_at: datetime
|
|
55
|
+
instructions: NotRequired[Nullable[str]]
|
|
56
|
+
r"""Instruction prompt the model will follow during the conversation."""
|
|
57
|
+
tools: NotRequired[List[AgentToolsTypedDict]]
|
|
58
|
+
r"""List of tools which are available to the model during the conversation."""
|
|
59
|
+
completion_args: NotRequired[CompletionArgsTypedDict]
|
|
60
|
+
r"""White-listed arguments from the completion API"""
|
|
61
|
+
description: NotRequired[Nullable[str]]
|
|
62
|
+
handoffs: NotRequired[Nullable[List[str]]]
|
|
63
|
+
object: NotRequired[AgentObject]
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
class Agent(BaseModel):
|
|
67
|
+
model: str
|
|
68
|
+
|
|
69
|
+
name: str
|
|
70
|
+
|
|
71
|
+
id: str
|
|
72
|
+
|
|
73
|
+
version: int
|
|
74
|
+
|
|
75
|
+
created_at: datetime
|
|
76
|
+
|
|
77
|
+
updated_at: datetime
|
|
78
|
+
|
|
79
|
+
instructions: OptionalNullable[str] = UNSET
|
|
80
|
+
r"""Instruction prompt the model will follow during the conversation."""
|
|
81
|
+
|
|
82
|
+
tools: Optional[List[AgentTools]] = None
|
|
83
|
+
r"""List of tools which are available to the model during the conversation."""
|
|
84
|
+
|
|
85
|
+
completion_args: Optional[CompletionArgs] = None
|
|
86
|
+
r"""White-listed arguments from the completion API"""
|
|
87
|
+
|
|
88
|
+
description: OptionalNullable[str] = UNSET
|
|
89
|
+
|
|
90
|
+
handoffs: OptionalNullable[List[str]] = UNSET
|
|
91
|
+
|
|
92
|
+
object: Optional[AgentObject] = "agent"
|
|
93
|
+
|
|
94
|
+
@model_serializer(mode="wrap")
|
|
95
|
+
def serialize_model(self, handler):
|
|
96
|
+
optional_fields = [
|
|
97
|
+
"instructions",
|
|
98
|
+
"tools",
|
|
99
|
+
"completion_args",
|
|
100
|
+
"description",
|
|
101
|
+
"handoffs",
|
|
102
|
+
"object",
|
|
103
|
+
]
|
|
104
|
+
nullable_fields = ["instructions", "description", "handoffs"]
|
|
105
|
+
null_default_fields = []
|
|
106
|
+
|
|
107
|
+
serialized = handler(self)
|
|
108
|
+
|
|
109
|
+
m = {}
|
|
110
|
+
|
|
111
|
+
for n, f in self.model_fields.items():
|
|
112
|
+
k = f.alias or n
|
|
113
|
+
val = serialized.get(k)
|
|
114
|
+
serialized.pop(k, None)
|
|
115
|
+
|
|
116
|
+
optional_nullable = k in optional_fields and k in nullable_fields
|
|
117
|
+
is_set = (
|
|
118
|
+
self.__pydantic_fields_set__.intersection({n})
|
|
119
|
+
or k in null_default_fields
|
|
120
|
+
) # pylint: disable=no-member
|
|
121
|
+
|
|
122
|
+
if val is not None and val != UNSET_SENTINEL:
|
|
123
|
+
m[k] = val
|
|
124
|
+
elif val != UNSET_SENTINEL and (
|
|
125
|
+
not k in optional_fields or (optional_nullable and is_set)
|
|
126
|
+
):
|
|
127
|
+
m[k] = val
|
|
128
|
+
|
|
129
|
+
return m
|
|
@@ -0,0 +1,71 @@
|
|
|
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 import Literal, Optional
|
|
8
|
+
from typing_extensions import NotRequired, TypedDict
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
AgentConversationObject = Literal["conversation"]
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class AgentConversationTypedDict(TypedDict):
|
|
15
|
+
id: str
|
|
16
|
+
created_at: datetime
|
|
17
|
+
updated_at: datetime
|
|
18
|
+
agent_id: str
|
|
19
|
+
name: NotRequired[Nullable[str]]
|
|
20
|
+
r"""Name given to the conversation."""
|
|
21
|
+
description: NotRequired[Nullable[str]]
|
|
22
|
+
r"""Description of the what the conversation is about."""
|
|
23
|
+
object: NotRequired[AgentConversationObject]
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class AgentConversation(BaseModel):
|
|
27
|
+
id: str
|
|
28
|
+
|
|
29
|
+
created_at: datetime
|
|
30
|
+
|
|
31
|
+
updated_at: datetime
|
|
32
|
+
|
|
33
|
+
agent_id: str
|
|
34
|
+
|
|
35
|
+
name: OptionalNullable[str] = UNSET
|
|
36
|
+
r"""Name given to the conversation."""
|
|
37
|
+
|
|
38
|
+
description: OptionalNullable[str] = UNSET
|
|
39
|
+
r"""Description of the what the conversation is about."""
|
|
40
|
+
|
|
41
|
+
object: Optional[AgentConversationObject] = "conversation"
|
|
42
|
+
|
|
43
|
+
@model_serializer(mode="wrap")
|
|
44
|
+
def serialize_model(self, handler):
|
|
45
|
+
optional_fields = ["name", "description", "object"]
|
|
46
|
+
nullable_fields = ["name", "description"]
|
|
47
|
+
null_default_fields = []
|
|
48
|
+
|
|
49
|
+
serialized = handler(self)
|
|
50
|
+
|
|
51
|
+
m = {}
|
|
52
|
+
|
|
53
|
+
for n, f in 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,109 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from .codeinterpretertool import CodeInterpreterTool, CodeInterpreterToolTypedDict
|
|
5
|
+
from .completionargs import CompletionArgs, CompletionArgsTypedDict
|
|
6
|
+
from .documentlibrarytool import DocumentLibraryTool, DocumentLibraryToolTypedDict
|
|
7
|
+
from .functiontool import FunctionTool, FunctionToolTypedDict
|
|
8
|
+
from .imagegenerationtool import ImageGenerationTool, ImageGenerationToolTypedDict
|
|
9
|
+
from .websearchpremiumtool import WebSearchPremiumTool, WebSearchPremiumToolTypedDict
|
|
10
|
+
from .websearchtool import WebSearchTool, WebSearchToolTypedDict
|
|
11
|
+
from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
|
|
12
|
+
from mistralai.utils import get_discriminator
|
|
13
|
+
from pydantic import Discriminator, Tag, model_serializer
|
|
14
|
+
from typing import List, Optional, Union
|
|
15
|
+
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
AgentCreationRequestToolsTypedDict = TypeAliasType(
|
|
19
|
+
"AgentCreationRequestToolsTypedDict",
|
|
20
|
+
Union[
|
|
21
|
+
WebSearchToolTypedDict,
|
|
22
|
+
WebSearchPremiumToolTypedDict,
|
|
23
|
+
CodeInterpreterToolTypedDict,
|
|
24
|
+
ImageGenerationToolTypedDict,
|
|
25
|
+
FunctionToolTypedDict,
|
|
26
|
+
DocumentLibraryToolTypedDict,
|
|
27
|
+
],
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
AgentCreationRequestTools = Annotated[
|
|
32
|
+
Union[
|
|
33
|
+
Annotated[CodeInterpreterTool, Tag("code_interpreter")],
|
|
34
|
+
Annotated[DocumentLibraryTool, Tag("document_library")],
|
|
35
|
+
Annotated[FunctionTool, Tag("function")],
|
|
36
|
+
Annotated[ImageGenerationTool, Tag("image_generation")],
|
|
37
|
+
Annotated[WebSearchTool, Tag("web_search")],
|
|
38
|
+
Annotated[WebSearchPremiumTool, Tag("web_search_premium")],
|
|
39
|
+
],
|
|
40
|
+
Discriminator(lambda m: get_discriminator(m, "type", "type")),
|
|
41
|
+
]
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
class AgentCreationRequestTypedDict(TypedDict):
|
|
45
|
+
model: str
|
|
46
|
+
name: str
|
|
47
|
+
instructions: NotRequired[Nullable[str]]
|
|
48
|
+
r"""Instruction prompt the model will follow during the conversation."""
|
|
49
|
+
tools: NotRequired[List[AgentCreationRequestToolsTypedDict]]
|
|
50
|
+
r"""List of tools which are available to the model during the conversation."""
|
|
51
|
+
completion_args: NotRequired[CompletionArgsTypedDict]
|
|
52
|
+
r"""White-listed arguments from the completion API"""
|
|
53
|
+
description: NotRequired[Nullable[str]]
|
|
54
|
+
handoffs: NotRequired[Nullable[List[str]]]
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
class AgentCreationRequest(BaseModel):
|
|
58
|
+
model: str
|
|
59
|
+
|
|
60
|
+
name: str
|
|
61
|
+
|
|
62
|
+
instructions: OptionalNullable[str] = UNSET
|
|
63
|
+
r"""Instruction prompt the model will follow during the conversation."""
|
|
64
|
+
|
|
65
|
+
tools: Optional[List[AgentCreationRequestTools]] = None
|
|
66
|
+
r"""List of tools which are available to the model during the conversation."""
|
|
67
|
+
|
|
68
|
+
completion_args: Optional[CompletionArgs] = None
|
|
69
|
+
r"""White-listed arguments from the completion API"""
|
|
70
|
+
|
|
71
|
+
description: OptionalNullable[str] = UNSET
|
|
72
|
+
|
|
73
|
+
handoffs: OptionalNullable[List[str]] = UNSET
|
|
74
|
+
|
|
75
|
+
@model_serializer(mode="wrap")
|
|
76
|
+
def serialize_model(self, handler):
|
|
77
|
+
optional_fields = [
|
|
78
|
+
"instructions",
|
|
79
|
+
"tools",
|
|
80
|
+
"completion_args",
|
|
81
|
+
"description",
|
|
82
|
+
"handoffs",
|
|
83
|
+
]
|
|
84
|
+
nullable_fields = ["instructions", "description", "handoffs"]
|
|
85
|
+
null_default_fields = []
|
|
86
|
+
|
|
87
|
+
serialized = handler(self)
|
|
88
|
+
|
|
89
|
+
m = {}
|
|
90
|
+
|
|
91
|
+
for n, f in self.model_fields.items():
|
|
92
|
+
k = f.alias or n
|
|
93
|
+
val = serialized.get(k)
|
|
94
|
+
serialized.pop(k, None)
|
|
95
|
+
|
|
96
|
+
optional_nullable = k in optional_fields and k in nullable_fields
|
|
97
|
+
is_set = (
|
|
98
|
+
self.__pydantic_fields_set__.intersection({n})
|
|
99
|
+
or k in null_default_fields
|
|
100
|
+
) # pylint: disable=no-member
|
|
101
|
+
|
|
102
|
+
if val is not None and val != UNSET_SENTINEL:
|
|
103
|
+
m[k] = val
|
|
104
|
+
elif val != UNSET_SENTINEL and (
|
|
105
|
+
not k in optional_fields or (optional_nullable and is_set)
|
|
106
|
+
):
|
|
107
|
+
m[k] = val
|
|
108
|
+
|
|
109
|
+
return m
|
|
@@ -0,0 +1,33 @@
|
|
|
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
|
|
6
|
+
from typing import Literal, Optional
|
|
7
|
+
from typing_extensions import NotRequired, TypedDict
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
AgentHandoffDoneEventType = Literal["agent.handoff.done"]
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class AgentHandoffDoneEventTypedDict(TypedDict):
|
|
14
|
+
id: str
|
|
15
|
+
next_agent_id: str
|
|
16
|
+
next_agent_name: str
|
|
17
|
+
type: NotRequired[AgentHandoffDoneEventType]
|
|
18
|
+
created_at: NotRequired[datetime]
|
|
19
|
+
output_index: NotRequired[int]
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class AgentHandoffDoneEvent(BaseModel):
|
|
23
|
+
id: str
|
|
24
|
+
|
|
25
|
+
next_agent_id: str
|
|
26
|
+
|
|
27
|
+
next_agent_name: str
|
|
28
|
+
|
|
29
|
+
type: Optional[AgentHandoffDoneEventType] = "agent.handoff.done"
|
|
30
|
+
|
|
31
|
+
created_at: Optional[datetime] = None
|
|
32
|
+
|
|
33
|
+
output_index: Optional[int] = 0
|
|
@@ -0,0 +1,75 @@
|
|
|
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 import Literal, Optional
|
|
8
|
+
from typing_extensions import NotRequired, TypedDict
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
AgentHandoffEntryObject = Literal["entry"]
|
|
12
|
+
|
|
13
|
+
AgentHandoffEntryType = Literal["agent.handoff"]
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class AgentHandoffEntryTypedDict(TypedDict):
|
|
17
|
+
previous_agent_id: str
|
|
18
|
+
previous_agent_name: str
|
|
19
|
+
next_agent_id: str
|
|
20
|
+
next_agent_name: str
|
|
21
|
+
object: NotRequired[AgentHandoffEntryObject]
|
|
22
|
+
type: NotRequired[AgentHandoffEntryType]
|
|
23
|
+
created_at: NotRequired[datetime]
|
|
24
|
+
completed_at: NotRequired[Nullable[datetime]]
|
|
25
|
+
id: NotRequired[str]
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class AgentHandoffEntry(BaseModel):
|
|
29
|
+
previous_agent_id: str
|
|
30
|
+
|
|
31
|
+
previous_agent_name: str
|
|
32
|
+
|
|
33
|
+
next_agent_id: str
|
|
34
|
+
|
|
35
|
+
next_agent_name: str
|
|
36
|
+
|
|
37
|
+
object: Optional[AgentHandoffEntryObject] = "entry"
|
|
38
|
+
|
|
39
|
+
type: Optional[AgentHandoffEntryType] = "agent.handoff"
|
|
40
|
+
|
|
41
|
+
created_at: Optional[datetime] = None
|
|
42
|
+
|
|
43
|
+
completed_at: OptionalNullable[datetime] = UNSET
|
|
44
|
+
|
|
45
|
+
id: Optional[str] = None
|
|
46
|
+
|
|
47
|
+
@model_serializer(mode="wrap")
|
|
48
|
+
def serialize_model(self, handler):
|
|
49
|
+
optional_fields = ["object", "type", "created_at", "completed_at", "id"]
|
|
50
|
+
nullable_fields = ["completed_at"]
|
|
51
|
+
null_default_fields = []
|
|
52
|
+
|
|
53
|
+
serialized = handler(self)
|
|
54
|
+
|
|
55
|
+
m = {}
|
|
56
|
+
|
|
57
|
+
for n, f in self.model_fields.items():
|
|
58
|
+
k = f.alias or n
|
|
59
|
+
val = serialized.get(k)
|
|
60
|
+
serialized.pop(k, None)
|
|
61
|
+
|
|
62
|
+
optional_nullable = k in optional_fields and k in nullable_fields
|
|
63
|
+
is_set = (
|
|
64
|
+
self.__pydantic_fields_set__.intersection({n})
|
|
65
|
+
or k in null_default_fields
|
|
66
|
+
) # pylint: disable=no-member
|
|
67
|
+
|
|
68
|
+
if val is not None and val != UNSET_SENTINEL:
|
|
69
|
+
m[k] = val
|
|
70
|
+
elif val != UNSET_SENTINEL and (
|
|
71
|
+
not k in optional_fields or (optional_nullable and is_set)
|
|
72
|
+
):
|
|
73
|
+
m[k] = val
|
|
74
|
+
|
|
75
|
+
return m
|
|
@@ -0,0 +1,33 @@
|
|
|
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
|
|
6
|
+
from typing import Literal, Optional
|
|
7
|
+
from typing_extensions import NotRequired, TypedDict
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
AgentHandoffStartedEventType = Literal["agent.handoff.started"]
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class AgentHandoffStartedEventTypedDict(TypedDict):
|
|
14
|
+
id: str
|
|
15
|
+
previous_agent_id: str
|
|
16
|
+
previous_agent_name: str
|
|
17
|
+
type: NotRequired[AgentHandoffStartedEventType]
|
|
18
|
+
created_at: NotRequired[datetime]
|
|
19
|
+
output_index: NotRequired[int]
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class AgentHandoffStartedEvent(BaseModel):
|
|
23
|
+
id: str
|
|
24
|
+
|
|
25
|
+
previous_agent_id: str
|
|
26
|
+
|
|
27
|
+
previous_agent_name: str
|
|
28
|
+
|
|
29
|
+
type: Optional[AgentHandoffStartedEventType] = "agent.handoff.started"
|
|
30
|
+
|
|
31
|
+
created_at: Optional[datetime] = None
|
|
32
|
+
|
|
33
|
+
output_index: Optional[int] = 0
|
|
@@ -0,0 +1,16 @@
|
|
|
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 mistralai.utils import FieldMetadata, PathParamMetadata
|
|
6
|
+
from typing_extensions import Annotated, TypedDict
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class AgentsAPIV1AgentsGetRequestTypedDict(TypedDict):
|
|
10
|
+
agent_id: str
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class AgentsAPIV1AgentsGetRequest(BaseModel):
|
|
14
|
+
agent_id: Annotated[
|
|
15
|
+
str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
|
|
16
|
+
]
|
|
@@ -0,0 +1,24 @@
|
|
|
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 mistralai.utils import FieldMetadata, QueryParamMetadata
|
|
6
|
+
from typing import Optional
|
|
7
|
+
from typing_extensions import Annotated, NotRequired, TypedDict
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class AgentsAPIV1AgentsListRequestTypedDict(TypedDict):
|
|
11
|
+
page: NotRequired[int]
|
|
12
|
+
page_size: NotRequired[int]
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class AgentsAPIV1AgentsListRequest(BaseModel):
|
|
16
|
+
page: Annotated[
|
|
17
|
+
Optional[int],
|
|
18
|
+
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
|
19
|
+
] = 0
|
|
20
|
+
|
|
21
|
+
page_size: Annotated[
|
|
22
|
+
Optional[int],
|
|
23
|
+
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
|
24
|
+
] = 20
|
|
@@ -0,0 +1,21 @@
|
|
|
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 mistralai.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata
|
|
6
|
+
from typing_extensions import Annotated, TypedDict
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class AgentsAPIV1AgentsUpdateVersionRequestTypedDict(TypedDict):
|
|
10
|
+
agent_id: str
|
|
11
|
+
version: int
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class AgentsAPIV1AgentsUpdateVersionRequest(BaseModel):
|
|
15
|
+
agent_id: Annotated[
|
|
16
|
+
str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
|
|
17
|
+
]
|
|
18
|
+
|
|
19
|
+
version: Annotated[
|
|
20
|
+
int, FieldMetadata(query=QueryParamMetadata(style="form", explode=True))
|
|
21
|
+
]
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from .agentupdaterequest import AgentUpdateRequest, AgentUpdateRequestTypedDict
|
|
5
|
+
from mistralai.types import BaseModel
|
|
6
|
+
from mistralai.utils import FieldMetadata, PathParamMetadata, RequestMetadata
|
|
7
|
+
from typing_extensions import Annotated, TypedDict
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class AgentsAPIV1AgentsUpdateRequestTypedDict(TypedDict):
|
|
11
|
+
agent_id: str
|
|
12
|
+
agent_update_request: AgentUpdateRequestTypedDict
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class AgentsAPIV1AgentsUpdateRequest(BaseModel):
|
|
16
|
+
agent_id: Annotated[
|
|
17
|
+
str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
|
|
18
|
+
]
|
|
19
|
+
|
|
20
|
+
agent_update_request: Annotated[
|
|
21
|
+
AgentUpdateRequest,
|
|
22
|
+
FieldMetadata(request=RequestMetadata(media_type="application/json")),
|
|
23
|
+
]
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from .conversationappendstreamrequest import (
|
|
5
|
+
ConversationAppendStreamRequest,
|
|
6
|
+
ConversationAppendStreamRequestTypedDict,
|
|
7
|
+
)
|
|
8
|
+
from mistralai.types import BaseModel
|
|
9
|
+
from mistralai.utils import FieldMetadata, PathParamMetadata, RequestMetadata
|
|
10
|
+
from typing_extensions import Annotated, TypedDict
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class AgentsAPIV1ConversationsAppendStreamRequestTypedDict(TypedDict):
|
|
14
|
+
conversation_id: str
|
|
15
|
+
r"""ID of the conversation to which we append entries."""
|
|
16
|
+
conversation_append_stream_request: ConversationAppendStreamRequestTypedDict
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class AgentsAPIV1ConversationsAppendStreamRequest(BaseModel):
|
|
20
|
+
conversation_id: Annotated[
|
|
21
|
+
str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
|
|
22
|
+
]
|
|
23
|
+
r"""ID of the conversation to which we append entries."""
|
|
24
|
+
|
|
25
|
+
conversation_append_stream_request: Annotated[
|
|
26
|
+
ConversationAppendStreamRequest,
|
|
27
|
+
FieldMetadata(request=RequestMetadata(media_type="application/json")),
|
|
28
|
+
]
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from .conversationappendrequest import (
|
|
5
|
+
ConversationAppendRequest,
|
|
6
|
+
ConversationAppendRequestTypedDict,
|
|
7
|
+
)
|
|
8
|
+
from mistralai.types import BaseModel
|
|
9
|
+
from mistralai.utils import FieldMetadata, PathParamMetadata, RequestMetadata
|
|
10
|
+
from typing_extensions import Annotated, TypedDict
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class AgentsAPIV1ConversationsAppendRequestTypedDict(TypedDict):
|
|
14
|
+
conversation_id: str
|
|
15
|
+
r"""ID of the conversation to which we append entries."""
|
|
16
|
+
conversation_append_request: ConversationAppendRequestTypedDict
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class AgentsAPIV1ConversationsAppendRequest(BaseModel):
|
|
20
|
+
conversation_id: Annotated[
|
|
21
|
+
str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
|
|
22
|
+
]
|
|
23
|
+
r"""ID of the conversation to which we append entries."""
|
|
24
|
+
|
|
25
|
+
conversation_append_request: Annotated[
|
|
26
|
+
ConversationAppendRequest,
|
|
27
|
+
FieldMetadata(request=RequestMetadata(media_type="application/json")),
|
|
28
|
+
]
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from .agentconversation import AgentConversation, AgentConversationTypedDict
|
|
5
|
+
from .modelconversation import ModelConversation, ModelConversationTypedDict
|
|
6
|
+
from mistralai.types import BaseModel
|
|
7
|
+
from mistralai.utils import FieldMetadata, PathParamMetadata
|
|
8
|
+
from typing import Union
|
|
9
|
+
from typing_extensions import Annotated, TypeAliasType, TypedDict
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class AgentsAPIV1ConversationsGetRequestTypedDict(TypedDict):
|
|
13
|
+
conversation_id: str
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class AgentsAPIV1ConversationsGetRequest(BaseModel):
|
|
17
|
+
conversation_id: Annotated[
|
|
18
|
+
str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
AgentsAPIV1ConversationsGetResponseV1ConversationsGetTypedDict = TypeAliasType(
|
|
23
|
+
"AgentsAPIV1ConversationsGetResponseV1ConversationsGetTypedDict",
|
|
24
|
+
Union[AgentConversationTypedDict, ModelConversationTypedDict],
|
|
25
|
+
)
|
|
26
|
+
r"""Successful Response"""
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
AgentsAPIV1ConversationsGetResponseV1ConversationsGet = TypeAliasType(
|
|
30
|
+
"AgentsAPIV1ConversationsGetResponseV1ConversationsGet",
|
|
31
|
+
Union[AgentConversation, ModelConversation],
|
|
32
|
+
)
|
|
33
|
+
r"""Successful Response"""
|
|
@@ -0,0 +1,16 @@
|
|
|
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 mistralai.utils import FieldMetadata, PathParamMetadata
|
|
6
|
+
from typing_extensions import Annotated, TypedDict
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class AgentsAPIV1ConversationsHistoryRequestTypedDict(TypedDict):
|
|
10
|
+
conversation_id: str
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class AgentsAPIV1ConversationsHistoryRequest(BaseModel):
|
|
14
|
+
conversation_id: Annotated[
|
|
15
|
+
str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
|
|
16
|
+
]
|