Skip to content

Commit 4a299c1

Browse files
committed
Release 0.1.5
1 parent fb6a500 commit 4a299c1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1093
-260
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "letta-client"
3-
version = "0.1.4"
3+
version = "0.1.5"
44
description = ""
55
readme = "README.md"
66
authors = []

reference.md

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1718,6 +1718,22 @@ client.agents.list()
17181718
<dl>
17191719
<dd>
17201720

1721+
**cursor:** `typing.Optional[int]` — Cursor for pagination
1722+
1723+
</dd>
1724+
</dl>
1725+
1726+
<dl>
1727+
<dd>
1728+
1729+
**limit:** `typing.Optional[int]` — Limit for pagination
1730+
1731+
</dd>
1732+
</dl>
1733+
1734+
<dl>
1735+
<dd>
1736+
17211737
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
17221738

17231739
</dd>
@@ -1961,6 +1977,14 @@ client.agents.create(
19611977
<dl>
19621978
<dd>
19631979

1980+
**tool_exec_environment_variables:** `typing.Optional[typing.Dict[str, typing.Optional[str]]]` — The environment variables for tool execution specific to this agent.
1981+
1982+
</dd>
1983+
</dl>
1984+
1985+
<dl>
1986+
<dd>
1987+
19641988
**user_id:** `typing.Optional[str]`
19651989

19661990
</dd>
@@ -2275,6 +2299,14 @@ client.agents.update(
22752299
<dl>
22762300
<dd>
22772301

2302+
**tool_exec_environment_variables:** `typing.Optional[typing.Dict[str, typing.Optional[str]]]` — The environment variables for tool execution specific to this agent.
2303+
2304+
</dd>
2305+
</dl>
2306+
2307+
<dl>
2308+
<dd>
2309+
22782310
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
22792311

22802312
</dd>
@@ -5441,6 +5473,118 @@ client.agents.messages.update(
54415473
</dl>
54425474

54435475

5476+
</dd>
5477+
</dl>
5478+
</details>
5479+
5480+
<details><summary><code>client.agents.messages.<a href="src/letta/agents/messages/client.py">stream</a>(...)</code></summary>
5481+
<dl>
5482+
<dd>
5483+
5484+
#### 📝 Description
5485+
5486+
<dl>
5487+
<dd>
5488+
5489+
<dl>
5490+
<dd>
5491+
5492+
Process a user message and return the agent's response.
5493+
This endpoint accepts a message from a user and processes it through the agent.
5494+
It will stream the steps of the response always, and stream the tokens if 'stream_tokens' is set to True.
5495+
</dd>
5496+
</dl>
5497+
</dd>
5498+
</dl>
5499+
5500+
#### 🔌 Usage
5501+
5502+
<dl>
5503+
<dd>
5504+
5505+
<dl>
5506+
<dd>
5507+
5508+
```python
5509+
from letta import Letta, MessageCreate
5510+
5511+
client = Letta(
5512+
token="YOUR_TOKEN",
5513+
)
5514+
response = client.agents.messages.stream(
5515+
agent_id="agent_id",
5516+
messages=[
5517+
MessageCreate(
5518+
role="user",
5519+
text="text",
5520+
)
5521+
],
5522+
)
5523+
for chunk in response:
5524+
yield chunk
5525+
5526+
```
5527+
</dd>
5528+
</dl>
5529+
</dd>
5530+
</dl>
5531+
5532+
#### ⚙️ Parameters
5533+
5534+
<dl>
5535+
<dd>
5536+
5537+
<dl>
5538+
<dd>
5539+
5540+
**agent_id:** `str`
5541+
5542+
</dd>
5543+
</dl>
5544+
5545+
<dl>
5546+
<dd>
5547+
5548+
**messages:** `typing.Sequence[MessageCreate]` — The messages to be sent to the agent.
5549+
5550+
</dd>
5551+
</dl>
5552+
5553+
<dl>
5554+
<dd>
5555+
5556+
**assistant_message_tool_name:** `typing.Optional[str]` — The name of the designated message tool.
5557+
5558+
</dd>
5559+
</dl>
5560+
5561+
<dl>
5562+
<dd>
5563+
5564+
**assistant_message_tool_kwarg:** `typing.Optional[str]` — The name of the message argument in the designated message tool.
5565+
5566+
</dd>
5567+
</dl>
5568+
5569+
<dl>
5570+
<dd>
5571+
5572+
**stream_tokens:** `typing.Optional[bool]` — Flag to determine if individual tokens should be streamed. Set to True for token streaming (requires stream_steps = True).
5573+
5574+
</dd>
5575+
</dl>
5576+
5577+
<dl>
5578+
<dd>
5579+
5580+
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
5581+
5582+
</dd>
5583+
</dl>
5584+
</dd>
5585+
</dl>
5586+
5587+
54445588
</dd>
54455589
</dl>
54465590
</details>

src/letta/__init__.py

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
ActionModel,
55
ActionParametersModel,
66
ActionResponseModel,
7+
AgentEnvironmentVariable,
78
AgentState,
89
AgentStateToolRulesItem,
910
AgentType,
@@ -50,6 +51,13 @@
5051
JobStatus,
5152
LettaRequest,
5253
LettaResponse,
54+
LettaResponseMessagesItem,
55+
LettaResponseMessagesItem_AssistantMessage,
56+
LettaResponseMessagesItem_ReasoningMessage,
57+
LettaResponseMessagesItem_SystemMessage,
58+
LettaResponseMessagesItem_ToolCallMessage,
59+
LettaResponseMessagesItem_ToolReturnMessage,
60+
LettaResponseMessagesItem_UserMessage,
5361
LettaSchemasLettaMessageToolCall,
5462
LettaSchemasMessageMessage,
5563
LettaSchemasOpenaiChatCompletionRequestTool,
@@ -121,12 +129,15 @@
121129
AgentsMigrateResponse,
122130
AgentsSearchDeployedAgentsRequestCombinator,
123131
AgentsSearchDeployedAgentsRequestSearchItem,
124-
AgentsSearchDeployedAgentsRequestSearchItemDirection,
125-
AgentsSearchDeployedAgentsRequestSearchItemDirectionDirection,
126-
AgentsSearchDeployedAgentsRequestSearchItemDirectionValue,
127-
AgentsSearchDeployedAgentsRequestSearchItemOperator,
128-
AgentsSearchDeployedAgentsRequestSearchItemOperatorOperator,
129-
AgentsSearchDeployedAgentsRequestSearchItemZero,
132+
AgentsSearchDeployedAgentsRequestSearchItemName,
133+
AgentsSearchDeployedAgentsRequestSearchItemNameOperator,
134+
AgentsSearchDeployedAgentsRequestSearchItemOrderBy,
135+
AgentsSearchDeployedAgentsRequestSearchItemOrderByDirection,
136+
AgentsSearchDeployedAgentsRequestSearchItemOrderByValue,
137+
AgentsSearchDeployedAgentsRequestSearchItemVersion,
138+
AgentsSearchDeployedAgentsRequestSearchItem_Name,
139+
AgentsSearchDeployedAgentsRequestSearchItem_OrderBy,
140+
AgentsSearchDeployedAgentsRequestSearchItem_Version,
130141
CreateAgentRequestToolRulesItem,
131142
UpdateAgentToolRulesItem,
132143
)
@@ -138,19 +149,23 @@
138149
"ActionModel",
139150
"ActionParametersModel",
140151
"ActionResponseModel",
152+
"AgentEnvironmentVariable",
141153
"AgentState",
142154
"AgentStateToolRulesItem",
143155
"AgentType",
144156
"AgentsGetAgentVariablesResponse",
145157
"AgentsMigrateResponse",
146158
"AgentsSearchDeployedAgentsRequestCombinator",
147159
"AgentsSearchDeployedAgentsRequestSearchItem",
148-
"AgentsSearchDeployedAgentsRequestSearchItemDirection",
149-
"AgentsSearchDeployedAgentsRequestSearchItemDirectionDirection",
150-
"AgentsSearchDeployedAgentsRequestSearchItemDirectionValue",
151-
"AgentsSearchDeployedAgentsRequestSearchItemOperator",
152-
"AgentsSearchDeployedAgentsRequestSearchItemOperatorOperator",
153-
"AgentsSearchDeployedAgentsRequestSearchItemZero",
160+
"AgentsSearchDeployedAgentsRequestSearchItemName",
161+
"AgentsSearchDeployedAgentsRequestSearchItemNameOperator",
162+
"AgentsSearchDeployedAgentsRequestSearchItemOrderBy",
163+
"AgentsSearchDeployedAgentsRequestSearchItemOrderByDirection",
164+
"AgentsSearchDeployedAgentsRequestSearchItemOrderByValue",
165+
"AgentsSearchDeployedAgentsRequestSearchItemVersion",
166+
"AgentsSearchDeployedAgentsRequestSearchItem_Name",
167+
"AgentsSearchDeployedAgentsRequestSearchItem_OrderBy",
168+
"AgentsSearchDeployedAgentsRequestSearchItem_Version",
154169
"AppAuthScheme",
155170
"AppAuthSchemeAuthMode",
156171
"AppModel",
@@ -200,6 +215,13 @@
200215
"LettaEnvironment",
201216
"LettaRequest",
202217
"LettaResponse",
218+
"LettaResponseMessagesItem",
219+
"LettaResponseMessagesItem_AssistantMessage",
220+
"LettaResponseMessagesItem_ReasoningMessage",
221+
"LettaResponseMessagesItem_SystemMessage",
222+
"LettaResponseMessagesItem_ToolCallMessage",
223+
"LettaResponseMessagesItem_ToolReturnMessage",
224+
"LettaResponseMessagesItem_UserMessage",
203225
"LettaSchemasLettaMessageToolCall",
204226
"LettaSchemasMessageMessage",
205227
"LettaSchemasOpenaiChatCompletionRequestTool",

src/letta/agents/__init__.py

Lines changed: 49 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,69 @@
55
AgentsMigrateResponse,
66
AgentsSearchDeployedAgentsRequestCombinator,
77
AgentsSearchDeployedAgentsRequestSearchItem,
8-
AgentsSearchDeployedAgentsRequestSearchItemDirection,
9-
AgentsSearchDeployedAgentsRequestSearchItemDirectionDirection,
10-
AgentsSearchDeployedAgentsRequestSearchItemDirectionValue,
11-
AgentsSearchDeployedAgentsRequestSearchItemOperator,
12-
AgentsSearchDeployedAgentsRequestSearchItemOperatorOperator,
13-
AgentsSearchDeployedAgentsRequestSearchItemZero,
8+
AgentsSearchDeployedAgentsRequestSearchItemName,
9+
AgentsSearchDeployedAgentsRequestSearchItemNameOperator,
10+
AgentsSearchDeployedAgentsRequestSearchItemOrderBy,
11+
AgentsSearchDeployedAgentsRequestSearchItemOrderByDirection,
12+
AgentsSearchDeployedAgentsRequestSearchItemOrderByValue,
13+
AgentsSearchDeployedAgentsRequestSearchItemVersion,
14+
AgentsSearchDeployedAgentsRequestSearchItem_Name,
15+
AgentsSearchDeployedAgentsRequestSearchItem_OrderBy,
16+
AgentsSearchDeployedAgentsRequestSearchItem_Version,
1417
CreateAgentRequestToolRulesItem,
1518
UpdateAgentToolRulesItem,
1619
)
1720
from . import archival_memory, context, memory, memory_blocks, messages, recall_memory, sources, tools
18-
from .messages import LettaStreamingResponse, MessagesListResponse, MessagesListResponseItem
21+
from .messages import (
22+
LettaStreamingResponse,
23+
LettaStreamingResponse_AssistantMessage,
24+
LettaStreamingResponse_ReasoningMessage,
25+
LettaStreamingResponse_SystemMessage,
26+
LettaStreamingResponse_ToolCallMessage,
27+
LettaStreamingResponse_ToolReturnMessage,
28+
LettaStreamingResponse_UsageStatistics,
29+
LettaStreamingResponse_UserMessage,
30+
MessagesListResponse,
31+
MessagesListResponseItem,
32+
MessagesListResponseItem_AssistantMessage,
33+
MessagesListResponseItem_ReasoningMessage,
34+
MessagesListResponseItem_SystemMessage,
35+
MessagesListResponseItem_ToolCallMessage,
36+
MessagesListResponseItem_ToolReturnMessage,
37+
MessagesListResponseItem_UserMessage,
38+
)
1939

2040
__all__ = [
2141
"AgentsGetAgentVariablesResponse",
2242
"AgentsMigrateResponse",
2343
"AgentsSearchDeployedAgentsRequestCombinator",
2444
"AgentsSearchDeployedAgentsRequestSearchItem",
25-
"AgentsSearchDeployedAgentsRequestSearchItemDirection",
26-
"AgentsSearchDeployedAgentsRequestSearchItemDirectionDirection",
27-
"AgentsSearchDeployedAgentsRequestSearchItemDirectionValue",
28-
"AgentsSearchDeployedAgentsRequestSearchItemOperator",
29-
"AgentsSearchDeployedAgentsRequestSearchItemOperatorOperator",
30-
"AgentsSearchDeployedAgentsRequestSearchItemZero",
45+
"AgentsSearchDeployedAgentsRequestSearchItemName",
46+
"AgentsSearchDeployedAgentsRequestSearchItemNameOperator",
47+
"AgentsSearchDeployedAgentsRequestSearchItemOrderBy",
48+
"AgentsSearchDeployedAgentsRequestSearchItemOrderByDirection",
49+
"AgentsSearchDeployedAgentsRequestSearchItemOrderByValue",
50+
"AgentsSearchDeployedAgentsRequestSearchItemVersion",
51+
"AgentsSearchDeployedAgentsRequestSearchItem_Name",
52+
"AgentsSearchDeployedAgentsRequestSearchItem_OrderBy",
53+
"AgentsSearchDeployedAgentsRequestSearchItem_Version",
3154
"CreateAgentRequestToolRulesItem",
3255
"LettaStreamingResponse",
56+
"LettaStreamingResponse_AssistantMessage",
57+
"LettaStreamingResponse_ReasoningMessage",
58+
"LettaStreamingResponse_SystemMessage",
59+
"LettaStreamingResponse_ToolCallMessage",
60+
"LettaStreamingResponse_ToolReturnMessage",
61+
"LettaStreamingResponse_UsageStatistics",
62+
"LettaStreamingResponse_UserMessage",
3363
"MessagesListResponse",
3464
"MessagesListResponseItem",
65+
"MessagesListResponseItem_AssistantMessage",
66+
"MessagesListResponseItem_ReasoningMessage",
67+
"MessagesListResponseItem_SystemMessage",
68+
"MessagesListResponseItem_ToolCallMessage",
69+
"MessagesListResponseItem_ToolReturnMessage",
70+
"MessagesListResponseItem_UserMessage",
3571
"UpdateAgentToolRulesItem",
3672
"archival_memory",
3773
"context",

0 commit comments

Comments
 (0)