letta-client 1.0.0a13__py3-none-any.whl → 1.0.0a15__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.

Potentially problematic release.


This version of letta-client might be problematic. Click here for more details.

Files changed (27) hide show
  1. letta_client/_client.py +16 -2
  2. letta_client/_utils/_utils.py +1 -1
  3. letta_client/_version.py +1 -1
  4. letta_client/pagination.py +9 -9
  5. letta_client/resources/agents/files.py +13 -10
  6. letta_client/resources/agents/messages.py +60 -24
  7. letta_client/resources/groups/messages.py +40 -16
  8. letta_client/resources/templates/agents.py +2 -8
  9. letta_client/types/agents/__init__.py +2 -0
  10. letta_client/types/agents/event_message.py +35 -0
  11. letta_client/types/agents/file_list_response.py +3 -14
  12. letta_client/types/agents/letta_message_union.py +4 -0
  13. letta_client/types/agents/message_modify_response.py +4 -0
  14. letta_client/types/agents/message_send_async_params.py +57 -5
  15. letta_client/types/agents/message_send_params.py +57 -5
  16. letta_client/types/agents/message_stream_params.py +57 -5
  17. letta_client/types/agents/summary_message.py +33 -0
  18. letta_client/types/batch_create_params.py +59 -6
  19. letta_client/types/groups/message_modify_response.py +4 -0
  20. letta_client/types/groups/message_send_params.py +57 -5
  21. letta_client/types/groups/message_stream_params.py +57 -5
  22. letta_client/types/steps/message_list_response.py +4 -0
  23. letta_client/types/templates/agent_create_params.py +0 -2
  24. {letta_client-1.0.0a13.dist-info → letta_client-1.0.0a15.dist-info}/METADATA +1 -1
  25. {letta_client-1.0.0a13.dist-info → letta_client-1.0.0a15.dist-info}/RECORD +27 -25
  26. {letta_client-1.0.0a13.dist-info → letta_client-1.0.0a15.dist-info}/WHEEL +0 -0
  27. {letta_client-1.0.0a13.dist-info → letta_client-1.0.0a15.dist-info}/licenses/LICENSE +0 -0
@@ -356,12 +356,13 @@ class MessagesResource(SyncAPIResource):
356
356
  self,
357
357
  group_id: str,
358
358
  *,
359
- messages: Iterable[message_send_params.Message],
360
359
  assistant_message_tool_kwarg: str | Omit = omit,
361
360
  assistant_message_tool_name: str | Omit = omit,
362
361
  enable_thinking: str | Omit = omit,
363
362
  include_return_message_types: Optional[List[MessageType]] | Omit = omit,
363
+ input: Union[str, Iterable[message_send_params.InputUnionMember1], None] | Omit = omit,
364
364
  max_steps: int | Omit = omit,
365
+ messages: Optional[Iterable[message_send_params.Message]] | Omit = omit,
365
366
  use_assistant_message: bool | Omit = omit,
366
367
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
367
368
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -379,8 +380,6 @@ class MessagesResource(SyncAPIResource):
379
380
  Args:
380
381
  group_id: The ID of the group in the format 'group-<uuid4>'
381
382
 
382
- messages: The messages to be sent to the agent.
383
-
384
383
  assistant_message_tool_kwarg: The name of the message argument in the designated message tool. Still supported
385
384
  for legacy agent types, but deprecated for letta_v1_agent onward.
386
385
 
@@ -392,8 +391,14 @@ class MessagesResource(SyncAPIResource):
392
391
  include_return_message_types: Only return specified message types in the response. If `None` (default) returns
393
392
  all messages.
394
393
 
394
+ input:
395
+ Syntactic sugar for a single user message. Equivalent to messages=[{'role':
396
+ 'user', 'content': input}].
397
+
395
398
  max_steps: Maximum number of steps the agent should take to process the request.
396
399
 
400
+ messages: The messages to be sent to the agent.
401
+
397
402
  use_assistant_message: Whether the server should parse specific tool call arguments (default
398
403
  `send_message`) as `AssistantMessage` objects. Still supported for legacy agent
399
404
  types, but deprecated for letta_v1_agent onward.
@@ -412,12 +417,13 @@ class MessagesResource(SyncAPIResource):
412
417
  f"/v1/groups/{group_id}/messages",
413
418
  body=maybe_transform(
414
419
  {
415
- "messages": messages,
416
420
  "assistant_message_tool_kwarg": assistant_message_tool_kwarg,
417
421
  "assistant_message_tool_name": assistant_message_tool_name,
418
422
  "enable_thinking": enable_thinking,
419
423
  "include_return_message_types": include_return_message_types,
424
+ "input": input,
420
425
  "max_steps": max_steps,
426
+ "messages": messages,
421
427
  "use_assistant_message": use_assistant_message,
422
428
  },
423
429
  message_send_params.MessageSendParams,
@@ -432,14 +438,15 @@ class MessagesResource(SyncAPIResource):
432
438
  self,
433
439
  group_id: str,
434
440
  *,
435
- messages: Iterable[message_stream_params.Message],
436
441
  assistant_message_tool_kwarg: str | Omit = omit,
437
442
  assistant_message_tool_name: str | Omit = omit,
438
443
  background: bool | Omit = omit,
439
444
  enable_thinking: str | Omit = omit,
440
445
  include_pings: bool | Omit = omit,
441
446
  include_return_message_types: Optional[List[MessageType]] | Omit = omit,
447
+ input: Union[str, Iterable[message_stream_params.InputUnionMember1], None] | Omit = omit,
442
448
  max_steps: int | Omit = omit,
449
+ messages: Optional[Iterable[message_stream_params.Message]] | Omit = omit,
443
450
  stream_tokens: bool | Omit = omit,
444
451
  use_assistant_message: bool | Omit = omit,
445
452
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -459,8 +466,6 @@ class MessagesResource(SyncAPIResource):
459
466
  Args:
460
467
  group_id: The ID of the group in the format 'group-<uuid4>'
461
468
 
462
- messages: The messages to be sent to the agent.
463
-
464
469
  assistant_message_tool_kwarg: The name of the message argument in the designated message tool. Still supported
465
470
  for legacy agent types, but deprecated for letta_v1_agent onward.
466
471
 
@@ -477,8 +482,14 @@ class MessagesResource(SyncAPIResource):
477
482
  include_return_message_types: Only return specified message types in the response. If `None` (default) returns
478
483
  all messages.
479
484
 
485
+ input:
486
+ Syntactic sugar for a single user message. Equivalent to messages=[{'role':
487
+ 'user', 'content': input}].
488
+
480
489
  max_steps: Maximum number of steps the agent should take to process the request.
481
490
 
491
+ messages: The messages to be sent to the agent.
492
+
482
493
  stream_tokens: Flag to determine if individual tokens should be streamed, rather than streaming
483
494
  per step.
484
495
 
@@ -500,14 +511,15 @@ class MessagesResource(SyncAPIResource):
500
511
  f"/v1/groups/{group_id}/messages/stream",
501
512
  body=maybe_transform(
502
513
  {
503
- "messages": messages,
504
514
  "assistant_message_tool_kwarg": assistant_message_tool_kwarg,
505
515
  "assistant_message_tool_name": assistant_message_tool_name,
506
516
  "background": background,
507
517
  "enable_thinking": enable_thinking,
508
518
  "include_pings": include_pings,
509
519
  "include_return_message_types": include_return_message_types,
520
+ "input": input,
510
521
  "max_steps": max_steps,
522
+ "messages": messages,
511
523
  "stream_tokens": stream_tokens,
512
524
  "use_assistant_message": use_assistant_message,
513
525
  },
@@ -846,12 +858,13 @@ class AsyncMessagesResource(AsyncAPIResource):
846
858
  self,
847
859
  group_id: str,
848
860
  *,
849
- messages: Iterable[message_send_params.Message],
850
861
  assistant_message_tool_kwarg: str | Omit = omit,
851
862
  assistant_message_tool_name: str | Omit = omit,
852
863
  enable_thinking: str | Omit = omit,
853
864
  include_return_message_types: Optional[List[MessageType]] | Omit = omit,
865
+ input: Union[str, Iterable[message_send_params.InputUnionMember1], None] | Omit = omit,
854
866
  max_steps: int | Omit = omit,
867
+ messages: Optional[Iterable[message_send_params.Message]] | Omit = omit,
855
868
  use_assistant_message: bool | Omit = omit,
856
869
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
857
870
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -869,8 +882,6 @@ class AsyncMessagesResource(AsyncAPIResource):
869
882
  Args:
870
883
  group_id: The ID of the group in the format 'group-<uuid4>'
871
884
 
872
- messages: The messages to be sent to the agent.
873
-
874
885
  assistant_message_tool_kwarg: The name of the message argument in the designated message tool. Still supported
875
886
  for legacy agent types, but deprecated for letta_v1_agent onward.
876
887
 
@@ -882,8 +893,14 @@ class AsyncMessagesResource(AsyncAPIResource):
882
893
  include_return_message_types: Only return specified message types in the response. If `None` (default) returns
883
894
  all messages.
884
895
 
896
+ input:
897
+ Syntactic sugar for a single user message. Equivalent to messages=[{'role':
898
+ 'user', 'content': input}].
899
+
885
900
  max_steps: Maximum number of steps the agent should take to process the request.
886
901
 
902
+ messages: The messages to be sent to the agent.
903
+
887
904
  use_assistant_message: Whether the server should parse specific tool call arguments (default
888
905
  `send_message`) as `AssistantMessage` objects. Still supported for legacy agent
889
906
  types, but deprecated for letta_v1_agent onward.
@@ -902,12 +919,13 @@ class AsyncMessagesResource(AsyncAPIResource):
902
919
  f"/v1/groups/{group_id}/messages",
903
920
  body=await async_maybe_transform(
904
921
  {
905
- "messages": messages,
906
922
  "assistant_message_tool_kwarg": assistant_message_tool_kwarg,
907
923
  "assistant_message_tool_name": assistant_message_tool_name,
908
924
  "enable_thinking": enable_thinking,
909
925
  "include_return_message_types": include_return_message_types,
926
+ "input": input,
910
927
  "max_steps": max_steps,
928
+ "messages": messages,
911
929
  "use_assistant_message": use_assistant_message,
912
930
  },
913
931
  message_send_params.MessageSendParams,
@@ -922,14 +940,15 @@ class AsyncMessagesResource(AsyncAPIResource):
922
940
  self,
923
941
  group_id: str,
924
942
  *,
925
- messages: Iterable[message_stream_params.Message],
926
943
  assistant_message_tool_kwarg: str | Omit = omit,
927
944
  assistant_message_tool_name: str | Omit = omit,
928
945
  background: bool | Omit = omit,
929
946
  enable_thinking: str | Omit = omit,
930
947
  include_pings: bool | Omit = omit,
931
948
  include_return_message_types: Optional[List[MessageType]] | Omit = omit,
949
+ input: Union[str, Iterable[message_stream_params.InputUnionMember1], None] | Omit = omit,
932
950
  max_steps: int | Omit = omit,
951
+ messages: Optional[Iterable[message_stream_params.Message]] | Omit = omit,
933
952
  stream_tokens: bool | Omit = omit,
934
953
  use_assistant_message: bool | Omit = omit,
935
954
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -949,8 +968,6 @@ class AsyncMessagesResource(AsyncAPIResource):
949
968
  Args:
950
969
  group_id: The ID of the group in the format 'group-<uuid4>'
951
970
 
952
- messages: The messages to be sent to the agent.
953
-
954
971
  assistant_message_tool_kwarg: The name of the message argument in the designated message tool. Still supported
955
972
  for legacy agent types, but deprecated for letta_v1_agent onward.
956
973
 
@@ -967,8 +984,14 @@ class AsyncMessagesResource(AsyncAPIResource):
967
984
  include_return_message_types: Only return specified message types in the response. If `None` (default) returns
968
985
  all messages.
969
986
 
987
+ input:
988
+ Syntactic sugar for a single user message. Equivalent to messages=[{'role':
989
+ 'user', 'content': input}].
990
+
970
991
  max_steps: Maximum number of steps the agent should take to process the request.
971
992
 
993
+ messages: The messages to be sent to the agent.
994
+
972
995
  stream_tokens: Flag to determine if individual tokens should be streamed, rather than streaming
973
996
  per step.
974
997
 
@@ -990,14 +1013,15 @@ class AsyncMessagesResource(AsyncAPIResource):
990
1013
  f"/v1/groups/{group_id}/messages/stream",
991
1014
  body=await async_maybe_transform(
992
1015
  {
993
- "messages": messages,
994
1016
  "assistant_message_tool_kwarg": assistant_message_tool_kwarg,
995
1017
  "assistant_message_tool_name": assistant_message_tool_name,
996
1018
  "background": background,
997
1019
  "enable_thinking": enable_thinking,
998
1020
  "include_pings": include_pings,
999
1021
  "include_return_message_types": include_return_message_types,
1022
+ "input": input,
1000
1023
  "max_steps": max_steps,
1024
+ "messages": messages,
1001
1025
  "stream_tokens": stream_tokens,
1002
1026
  "use_assistant_message": use_assistant_message,
1003
1027
  },
@@ -46,7 +46,6 @@ class AgentsResource(SyncAPIResource):
46
46
  self,
47
47
  template_version: str,
48
48
  *,
49
- project_id: str,
50
49
  agent_name: str | Omit = omit,
51
50
  identity_ids: SequenceNotStr[str] | Omit = omit,
52
51
  initial_message_sequence: Iterable[agent_create_params.InitialMessageSequence] | Omit = omit,
@@ -86,13 +85,11 @@ class AgentsResource(SyncAPIResource):
86
85
 
87
86
  timeout: Override the client-level default timeout for this request, in seconds
88
87
  """
89
- if not project_id:
90
- raise ValueError(f"Expected a non-empty value for `project_id` but received {project_id!r}")
91
88
  if not template_version:
92
89
  raise ValueError(f"Expected a non-empty value for `template_version` but received {template_version!r}")
93
90
  extra_headers = {"Accept": "*/*", **(extra_headers or {})}
94
91
  return self._post(
95
- f"/v1/templates/{project_id}/{template_version}/agents",
92
+ f"/v1/templates/{template_version}/agents",
96
93
  body=maybe_transform(
97
94
  {
98
95
  "agent_name": agent_name,
@@ -135,7 +132,6 @@ class AsyncAgentsResource(AsyncAPIResource):
135
132
  self,
136
133
  template_version: str,
137
134
  *,
138
- project_id: str,
139
135
  agent_name: str | Omit = omit,
140
136
  identity_ids: SequenceNotStr[str] | Omit = omit,
141
137
  initial_message_sequence: Iterable[agent_create_params.InitialMessageSequence] | Omit = omit,
@@ -175,13 +171,11 @@ class AsyncAgentsResource(AsyncAPIResource):
175
171
 
176
172
  timeout: Override the client-level default timeout for this request, in seconds
177
173
  """
178
- if not project_id:
179
- raise ValueError(f"Expected a non-empty value for `project_id` but received {project_id!r}")
180
174
  if not template_version:
181
175
  raise ValueError(f"Expected a non-empty value for `template_version` but received {template_version!r}")
182
176
  extra_headers = {"Accept": "*/*", **(extra_headers or {})}
183
177
  return await self._post(
184
- f"/v1/templates/{project_id}/{template_version}/agents",
178
+ f"/v1/templates/{template_version}/agents",
185
179
  body=await async_maybe_transform(
186
180
  {
187
181
  "agent_name": agent_name,
@@ -13,9 +13,11 @@ from .message_role import MessageRole as MessageRole
13
13
  from .message_type import MessageType as MessageType
14
14
  from .text_content import TextContent as TextContent
15
15
  from .user_message import UserMessage as UserMessage
16
+ from .event_message import EventMessage as EventMessage
16
17
  from .image_content import ImageContent as ImageContent
17
18
  from .letta_response import LettaResponse as LettaResponse
18
19
  from .system_message import SystemMessage as SystemMessage
20
+ from .summary_message import SummaryMessage as SummaryMessage
19
21
  from .tool_call_delta import ToolCallDelta as ToolCallDelta
20
22
  from .file_list_params import FileListParams as FileListParams
21
23
  from .tool_list_params import ToolListParams as ToolListParams
@@ -0,0 +1,35 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import Dict, Optional
4
+ from datetime import datetime
5
+ from typing_extensions import Literal
6
+
7
+ from ..._models import BaseModel
8
+
9
+ __all__ = ["EventMessage"]
10
+
11
+
12
+ class EventMessage(BaseModel):
13
+ id: str
14
+
15
+ date: datetime
16
+
17
+ event_data: Dict[str, object]
18
+
19
+ event_type: Literal["compaction"]
20
+
21
+ is_err: Optional[bool] = None
22
+
23
+ message_type: Optional[Literal["event"]] = None
24
+
25
+ name: Optional[str] = None
26
+
27
+ otid: Optional[str] = None
28
+
29
+ run_id: Optional[str] = None
30
+
31
+ sender_id: Optional[str] = None
32
+
33
+ seq_id: Optional[int] = None
34
+
35
+ step_id: Optional[str] = None
@@ -1,14 +1,14 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- from typing import List, Optional
3
+ from typing import Optional
4
4
  from datetime import datetime
5
5
 
6
6
  from ..._models import BaseModel
7
7
 
8
- __all__ = ["FileListResponse", "File"]
8
+ __all__ = ["FileListResponse"]
9
9
 
10
10
 
11
- class File(BaseModel):
11
+ class FileListResponse(BaseModel):
12
12
  id: str
13
13
  """Unique identifier of the file-agent relationship"""
14
14
 
@@ -38,14 +38,3 @@ class File(BaseModel):
38
38
 
39
39
  visible_content: Optional[str] = None
40
40
  """Portion of the file visible to the agent if open"""
41
-
42
-
43
- class FileListResponse(BaseModel):
44
- files: List[File]
45
- """List of file attachments for the agent"""
46
-
47
- has_more: bool
48
- """Whether more results exist after this page"""
49
-
50
- next_cursor: Optional[str] = None
51
- """Cursor for fetching the next page (file-agent relationship ID)"""
@@ -5,7 +5,9 @@ from typing_extensions import Annotated, TypeAlias
5
5
 
6
6
  from ..._utils import PropertyInfo
7
7
  from .user_message import UserMessage
8
+ from .event_message import EventMessage
8
9
  from .system_message import SystemMessage
10
+ from .summary_message import SummaryMessage
9
11
  from .assistant_message import AssistantMessage
10
12
  from .reasoning_message import ReasoningMessage
11
13
  from .tool_call_message import ToolCallMessage
@@ -27,6 +29,8 @@ LettaMessageUnion: TypeAlias = Annotated[
27
29
  AssistantMessage,
28
30
  ApprovalRequestMessage,
29
31
  ApprovalResponseMessage,
32
+ SummaryMessage,
33
+ EventMessage,
30
34
  ],
31
35
  PropertyInfo(discriminator="message_type"),
32
36
  ]
@@ -5,7 +5,9 @@ from typing_extensions import Annotated, TypeAlias
5
5
 
6
6
  from ..._utils import PropertyInfo
7
7
  from .user_message import UserMessage
8
+ from .event_message import EventMessage
8
9
  from .system_message import SystemMessage
10
+ from .summary_message import SummaryMessage
9
11
  from .assistant_message import AssistantMessage
10
12
  from .reasoning_message import ReasoningMessage
11
13
  from .tool_call_message import ToolCallMessage
@@ -27,6 +29,8 @@ MessageModifyResponse: TypeAlias = Annotated[
27
29
  AssistantMessage,
28
30
  ApprovalRequestMessage,
29
31
  ApprovalResponseMessage,
32
+ SummaryMessage,
33
+ EventMessage,
30
34
  ],
31
35
  PropertyInfo(discriminator="message_type"),
32
36
  ]
@@ -3,19 +3,29 @@
3
3
  from __future__ import annotations
4
4
 
5
5
  from typing import List, Union, Iterable, Optional
6
- from typing_extensions import Required, TypeAlias, TypedDict
6
+ from typing_extensions import Literal, Required, TypeAlias, TypedDict
7
7
 
8
8
  from .message_type import MessageType
9
+ from .text_content_param import TextContentParam
10
+ from .image_content_param import ImageContentParam
9
11
  from ..message_create_param import MessageCreateParam
10
12
  from .approval_create_param import ApprovalCreateParam
13
+ from .reasoning_content_param import ReasoningContentParam
14
+ from .tool_call_content_param import ToolCallContentParam
15
+ from .tool_return_content_param import ToolReturnContentParam
16
+ from .omitted_reasoning_content_param import OmittedReasoningContentParam
17
+ from .redacted_reasoning_content_param import RedactedReasoningContentParam
11
18
 
12
- __all__ = ["MessageSendAsyncParams", "Message"]
19
+ __all__ = [
20
+ "MessageSendAsyncParams",
21
+ "InputUnionMember1",
22
+ "InputUnionMember1SummarizedReasoningContent",
23
+ "InputUnionMember1SummarizedReasoningContentSummary",
24
+ "Message",
25
+ ]
13
26
 
14
27
 
15
28
  class MessageSendAsyncParams(TypedDict, total=False):
16
- messages: Required[Iterable[Message]]
17
- """The messages to be sent to the agent."""
18
-
19
29
  assistant_message_tool_kwarg: str
20
30
  """The name of the message argument in the designated message tool.
21
31
 
@@ -44,9 +54,18 @@ class MessageSendAsyncParams(TypedDict, total=False):
44
54
  If `None` (default) returns all messages.
45
55
  """
46
56
 
57
+ input: Union[str, Iterable[InputUnionMember1], None]
58
+ """Syntactic sugar for a single user message.
59
+
60
+ Equivalent to messages=[{'role': 'user', 'content': input}].
61
+ """
62
+
47
63
  max_steps: int
48
64
  """Maximum number of steps the agent should take to process the request."""
49
65
 
66
+ messages: Optional[Iterable[Message]]
67
+ """The messages to be sent to the agent."""
68
+
50
69
  use_assistant_message: bool
51
70
  """
52
71
  Whether the server should parse specific tool call arguments (default
@@ -55,4 +74,37 @@ class MessageSendAsyncParams(TypedDict, total=False):
55
74
  """
56
75
 
57
76
 
77
+ class InputUnionMember1SummarizedReasoningContentSummary(TypedDict, total=False):
78
+ index: Required[int]
79
+ """The index of the summary part."""
80
+
81
+ text: Required[str]
82
+ """The text of the summary part."""
83
+
84
+
85
+ class InputUnionMember1SummarizedReasoningContent(TypedDict, total=False):
86
+ id: Required[str]
87
+ """The unique identifier for this reasoning step."""
88
+
89
+ summary: Required[Iterable[InputUnionMember1SummarizedReasoningContentSummary]]
90
+ """Summaries of the reasoning content."""
91
+
92
+ encrypted_content: str
93
+ """The encrypted reasoning content."""
94
+
95
+ type: Literal["summarized_reasoning"]
96
+ """Indicates this is a summarized reasoning step."""
97
+
98
+
99
+ InputUnionMember1: TypeAlias = Union[
100
+ TextContentParam,
101
+ ImageContentParam,
102
+ ToolCallContentParam,
103
+ ToolReturnContentParam,
104
+ ReasoningContentParam,
105
+ RedactedReasoningContentParam,
106
+ OmittedReasoningContentParam,
107
+ InputUnionMember1SummarizedReasoningContent,
108
+ ]
109
+
58
110
  Message: TypeAlias = Union[MessageCreateParam, ApprovalCreateParam]
@@ -3,19 +3,29 @@
3
3
  from __future__ import annotations
4
4
 
5
5
  from typing import List, Union, Iterable, Optional
6
- from typing_extensions import Required, TypeAlias, TypedDict
6
+ from typing_extensions import Literal, Required, TypeAlias, TypedDict
7
7
 
8
8
  from .message_type import MessageType
9
+ from .text_content_param import TextContentParam
10
+ from .image_content_param import ImageContentParam
9
11
  from ..message_create_param import MessageCreateParam
10
12
  from .approval_create_param import ApprovalCreateParam
13
+ from .reasoning_content_param import ReasoningContentParam
14
+ from .tool_call_content_param import ToolCallContentParam
15
+ from .tool_return_content_param import ToolReturnContentParam
16
+ from .omitted_reasoning_content_param import OmittedReasoningContentParam
17
+ from .redacted_reasoning_content_param import RedactedReasoningContentParam
11
18
 
12
- __all__ = ["MessageSendParams", "Message"]
19
+ __all__ = [
20
+ "MessageSendParams",
21
+ "InputUnionMember1",
22
+ "InputUnionMember1SummarizedReasoningContent",
23
+ "InputUnionMember1SummarizedReasoningContentSummary",
24
+ "Message",
25
+ ]
13
26
 
14
27
 
15
28
  class MessageSendParams(TypedDict, total=False):
16
- messages: Required[Iterable[Message]]
17
- """The messages to be sent to the agent."""
18
-
19
29
  assistant_message_tool_kwarg: str
20
30
  """The name of the message argument in the designated message tool.
21
31
 
@@ -41,9 +51,18 @@ class MessageSendParams(TypedDict, total=False):
41
51
  If `None` (default) returns all messages.
42
52
  """
43
53
 
54
+ input: Union[str, Iterable[InputUnionMember1], None]
55
+ """Syntactic sugar for a single user message.
56
+
57
+ Equivalent to messages=[{'role': 'user', 'content': input}].
58
+ """
59
+
44
60
  max_steps: int
45
61
  """Maximum number of steps the agent should take to process the request."""
46
62
 
63
+ messages: Optional[Iterable[Message]]
64
+ """The messages to be sent to the agent."""
65
+
47
66
  use_assistant_message: bool
48
67
  """
49
68
  Whether the server should parse specific tool call arguments (default
@@ -52,4 +71,37 @@ class MessageSendParams(TypedDict, total=False):
52
71
  """
53
72
 
54
73
 
74
+ class InputUnionMember1SummarizedReasoningContentSummary(TypedDict, total=False):
75
+ index: Required[int]
76
+ """The index of the summary part."""
77
+
78
+ text: Required[str]
79
+ """The text of the summary part."""
80
+
81
+
82
+ class InputUnionMember1SummarizedReasoningContent(TypedDict, total=False):
83
+ id: Required[str]
84
+ """The unique identifier for this reasoning step."""
85
+
86
+ summary: Required[Iterable[InputUnionMember1SummarizedReasoningContentSummary]]
87
+ """Summaries of the reasoning content."""
88
+
89
+ encrypted_content: str
90
+ """The encrypted reasoning content."""
91
+
92
+ type: Literal["summarized_reasoning"]
93
+ """Indicates this is a summarized reasoning step."""
94
+
95
+
96
+ InputUnionMember1: TypeAlias = Union[
97
+ TextContentParam,
98
+ ImageContentParam,
99
+ ToolCallContentParam,
100
+ ToolReturnContentParam,
101
+ ReasoningContentParam,
102
+ RedactedReasoningContentParam,
103
+ OmittedReasoningContentParam,
104
+ InputUnionMember1SummarizedReasoningContent,
105
+ ]
106
+
55
107
  Message: TypeAlias = Union[MessageCreateParam, ApprovalCreateParam]
@@ -3,19 +3,29 @@
3
3
  from __future__ import annotations
4
4
 
5
5
  from typing import List, Union, Iterable, Optional
6
- from typing_extensions import Required, TypeAlias, TypedDict
6
+ from typing_extensions import Literal, Required, TypeAlias, TypedDict
7
7
 
8
8
  from .message_type import MessageType
9
+ from .text_content_param import TextContentParam
10
+ from .image_content_param import ImageContentParam
9
11
  from ..message_create_param import MessageCreateParam
10
12
  from .approval_create_param import ApprovalCreateParam
13
+ from .reasoning_content_param import ReasoningContentParam
14
+ from .tool_call_content_param import ToolCallContentParam
15
+ from .tool_return_content_param import ToolReturnContentParam
16
+ from .omitted_reasoning_content_param import OmittedReasoningContentParam
17
+ from .redacted_reasoning_content_param import RedactedReasoningContentParam
11
18
 
12
- __all__ = ["MessageStreamParams", "Message"]
19
+ __all__ = [
20
+ "MessageStreamParams",
21
+ "InputUnionMember1",
22
+ "InputUnionMember1SummarizedReasoningContent",
23
+ "InputUnionMember1SummarizedReasoningContentSummary",
24
+ "Message",
25
+ ]
13
26
 
14
27
 
15
28
  class MessageStreamParams(TypedDict, total=False):
16
- messages: Required[Iterable[Message]]
17
- """The messages to be sent to the agent."""
18
-
19
29
  assistant_message_tool_kwarg: str
20
30
  """The name of the message argument in the designated message tool.
21
31
 
@@ -50,9 +60,18 @@ class MessageStreamParams(TypedDict, total=False):
50
60
  If `None` (default) returns all messages.
51
61
  """
52
62
 
63
+ input: Union[str, Iterable[InputUnionMember1], None]
64
+ """Syntactic sugar for a single user message.
65
+
66
+ Equivalent to messages=[{'role': 'user', 'content': input}].
67
+ """
68
+
53
69
  max_steps: int
54
70
  """Maximum number of steps the agent should take to process the request."""
55
71
 
72
+ messages: Optional[Iterable[Message]]
73
+ """The messages to be sent to the agent."""
74
+
56
75
  stream_tokens: bool
57
76
  """
58
77
  Flag to determine if individual tokens should be streamed, rather than streaming
@@ -67,4 +86,37 @@ class MessageStreamParams(TypedDict, total=False):
67
86
  """
68
87
 
69
88
 
89
+ class InputUnionMember1SummarizedReasoningContentSummary(TypedDict, total=False):
90
+ index: Required[int]
91
+ """The index of the summary part."""
92
+
93
+ text: Required[str]
94
+ """The text of the summary part."""
95
+
96
+
97
+ class InputUnionMember1SummarizedReasoningContent(TypedDict, total=False):
98
+ id: Required[str]
99
+ """The unique identifier for this reasoning step."""
100
+
101
+ summary: Required[Iterable[InputUnionMember1SummarizedReasoningContentSummary]]
102
+ """Summaries of the reasoning content."""
103
+
104
+ encrypted_content: str
105
+ """The encrypted reasoning content."""
106
+
107
+ type: Literal["summarized_reasoning"]
108
+ """Indicates this is a summarized reasoning step."""
109
+
110
+
111
+ InputUnionMember1: TypeAlias = Union[
112
+ TextContentParam,
113
+ ImageContentParam,
114
+ ToolCallContentParam,
115
+ ToolReturnContentParam,
116
+ ReasoningContentParam,
117
+ RedactedReasoningContentParam,
118
+ OmittedReasoningContentParam,
119
+ InputUnionMember1SummarizedReasoningContent,
120
+ ]
121
+
70
122
  Message: TypeAlias = Union[MessageCreateParam, ApprovalCreateParam]