letta-client 0.1.6__py3-none-any.whl → 0.1.10__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.
- {letta → letta_client}/__init__.py +33 -27
- {letta → letta_client}/agents/__init__.py +40 -29
- {letta → letta_client}/agents/archival_memory/client.py +25 -25
- letta_client/agents/client.py +1328 -0
- {letta → letta_client}/agents/context/client.py +7 -7
- letta_client/agents/core_memory/client.py +1080 -0
- letta_client/agents/memory_variables/__init__.py +5 -0
- {letta/agents/memory → letta_client/agents/memory_variables}/client.py +43 -42
- letta_client/agents/memory_variables/types/__init__.py +5 -0
- letta/agents/types/agents_get_agent_variables_response.py → letta_client/agents/memory_variables/types/memory_variables_get_response.py +3 -3
- {letta → letta_client}/agents/messages/client.py +240 -25
- {letta → letta_client}/agents/messages/types/letta_streaming_response.py +21 -16
- {letta → letta_client}/agents/messages/types/messages_list_response_item.py +19 -14
- {letta → letta_client}/agents/recall_memory/client.py +7 -7
- {letta → letta_client}/agents/sources/client.py +7 -7
- letta_client/agents/templates/__init__.py +5 -0
- letta_client/agents/templates/client.py +578 -0
- letta_client/agents/templates/types/__init__.py +5 -0
- letta/agents/types/agents_migrate_response.py → letta_client/agents/templates/types/templates_migrate_response.py +3 -3
- {letta → letta_client}/agents/tools/client.py +19 -19
- letta_client/agents/types/__init__.py +33 -0
- letta_client/agents/types/agents_search_request_combinator.py +5 -0
- letta/agents/types/agents_search_deployed_agents_request_search_item.py → letta_client/agents/types/agents_search_request_search_item.py +17 -20
- letta/agents/types/agents_search_deployed_agents_request_search_item_name.py → letta_client/agents/types/agents_search_request_search_item_name.py +4 -6
- letta_client/agents/types/agents_search_request_search_item_name_operator.py +5 -0
- letta_client/agents/types/agents_search_request_search_item_order_by.py +22 -0
- letta_client/agents/types/agents_search_request_search_item_order_by_direction.py +5 -0
- letta_client/agents/types/agents_search_request_search_item_order_by_value.py +5 -0
- letta/agents/types/agents_search_deployed_agents_request_search_item_version.py → letta_client/agents/types/agents_search_request_search_item_version.py +2 -2
- {letta → letta_client}/blocks/client.py +39 -39
- {letta → letta_client}/client.py +10 -2
- {letta → letta_client}/core/__init__.py +4 -0
- {letta → letta_client}/core/client_wrapper.py +1 -1
- letta_client/core/unchecked_base_model.py +305 -0
- {letta → letta_client}/health/client.py +5 -5
- {letta → letta_client}/jobs/client.py +25 -25
- {letta → letta_client}/models/client.py +9 -9
- letta_client/providers/client.py +597 -0
- letta_client/runs/client.py +876 -0
- {letta → letta_client}/sources/client.py +49 -49
- {letta → letta_client}/sources/files/client.py +17 -17
- {letta → letta_client}/sources/passages/client.py +7 -7
- letta_client/tools/__init__.py +2 -0
- {letta → letta_client}/tools/client.py +101 -81
- {letta → letta_client}/types/__init__.py +8 -0
- {letta → letta_client}/types/action_model.py +2 -2
- {letta → letta_client}/types/action_parameters_model.py +2 -2
- {letta → letta_client}/types/action_response_model.py +2 -2
- {letta → letta_client}/types/agent_environment_variable.py +2 -7
- {letta → letta_client}/types/agent_state.py +5 -8
- letta_client/types/agent_type.py +7 -0
- {letta → letta_client}/types/app_auth_scheme.py +2 -2
- {letta → letta_client}/types/app_model.py +2 -2
- {letta → letta_client}/types/archival_memory_summary.py +2 -2
- {letta → letta_client}/types/assistant_file.py +2 -2
- {letta → letta_client}/types/assistant_message_input.py +2 -2
- {letta → letta_client}/types/assistant_message_output.py +2 -2
- {letta → letta_client}/types/auth_request.py +2 -2
- {letta → letta_client}/types/auth_response.py +2 -2
- {letta → letta_client}/types/auth_scheme_field.py +2 -2
- {letta → letta_client}/types/block.py +2 -7
- {letta → letta_client}/types/block_update.py +2 -2
- {letta → letta_client}/types/chat_completion_request.py +2 -2
- {letta → letta_client}/types/chat_completion_response.py +2 -2
- {letta → letta_client}/types/child_tool_rule.py +2 -2
- {letta → letta_client}/types/choice.py +2 -2
- {letta → letta_client}/types/conditional_tool_rule.py +2 -2
- {letta → letta_client}/types/conflict_error_body.py +2 -2
- {letta → letta_client}/types/context_window_overview.py +2 -2
- {letta → letta_client}/types/create_assistant_file_request.py +2 -2
- {letta → letta_client}/types/create_assistant_request.py +2 -2
- {letta → letta_client}/types/create_block.py +2 -2
- {letta → letta_client}/types/delete_assistant_file_response.py +2 -2
- {letta → letta_client}/types/delete_assistant_response.py +2 -2
- {letta → letta_client}/types/e_2_b_sandbox_config.py +2 -2
- {letta → letta_client}/types/embedding_config.py +2 -2
- {letta → letta_client}/types/file_metadata.py +2 -7
- {letta → letta_client}/types/function_call_input.py +2 -2
- {letta → letta_client}/types/function_call_output.py +2 -2
- {letta → letta_client}/types/function_schema.py +2 -2
- {letta → letta_client}/types/health.py +2 -2
- {letta → letta_client}/types/http_validation_error.py +2 -2
- {letta → letta_client}/types/init_tool_rule.py +2 -2
- {letta → letta_client}/types/internal_server_error_body.py +2 -2
- {letta → letta_client}/types/job.py +7 -6
- letta_client/types/job_type.py +5 -0
- {letta → letta_client}/types/letta_request.py +7 -2
- {letta → letta_client}/types/letta_response.py +2 -2
- {letta → letta_client}/types/letta_response_messages_item.py +19 -14
- {letta → letta_client}/types/letta_schemas_letta_message_tool_call.py +2 -2
- {letta → letta_client}/types/letta_schemas_message_message.py +2 -7
- {letta → letta_client}/types/letta_schemas_openai_chat_completion_request_tool.py +2 -2
- {letta → letta_client}/types/letta_schemas_openai_chat_completion_request_tool_call.py +2 -2
- {letta → letta_client}/types/letta_schemas_openai_chat_completion_request_tool_call_function.py +2 -2
- {letta → letta_client}/types/letta_schemas_openai_chat_completion_response_message.py +2 -2
- {letta → letta_client}/types/letta_schemas_openai_chat_completion_response_tool_call.py +2 -2
- {letta → letta_client}/types/letta_schemas_openai_chat_completions_tool_call_function.py +2 -2
- {letta → letta_client}/types/letta_schemas_openai_chat_completions_tool_call_input.py +2 -2
- {letta → letta_client}/types/letta_schemas_openai_chat_completions_tool_call_output.py +2 -2
- {letta → letta_client}/types/letta_schemas_tool_tool.py +9 -8
- {letta → letta_client}/types/letta_usage_statistics.py +2 -2
- {letta → letta_client}/types/llm_config.py +2 -2
- {letta → letta_client}/types/local_sandbox_config.py +2 -2
- {letta → letta_client}/types/log_prob_token.py +2 -2
- {letta → letta_client}/types/memory.py +2 -2
- {letta → letta_client}/types/message_content_log_prob.py +2 -2
- {letta → letta_client}/types/message_create.py +2 -2
- {letta → letta_client}/types/not_found_error_body.py +2 -2
- {letta → letta_client}/types/open_ai_assistant.py +2 -2
- {letta → letta_client}/types/organization.py +2 -2
- {letta → letta_client}/types/organization_create.py +2 -2
- {letta → letta_client}/types/passage.py +2 -7
- letta_client/types/provider.py +38 -0
- {letta → letta_client}/types/reasoning_message.py +2 -2
- {letta → letta_client}/types/recall_memory_summary.py +2 -2
- {letta → letta_client}/types/response_format.py +2 -2
- letta_client/types/run.py +77 -0
- {letta → letta_client}/types/sandbox_config.py +2 -7
- {letta → letta_client}/types/sandbox_config_create.py +2 -2
- {letta → letta_client}/types/sandbox_config_update.py +2 -2
- {letta → letta_client}/types/sandbox_environment_variable.py +2 -7
- {letta → letta_client}/types/sandbox_environment_variable_create.py +2 -2
- {letta → letta_client}/types/sandbox_environment_variable_update.py +2 -2
- {letta → letta_client}/types/source.py +2 -7
- {letta → letta_client}/types/system_message_input.py +2 -2
- {letta → letta_client}/types/system_message_output.py +2 -2
- {letta → letta_client}/types/terminal_tool_rule.py +2 -2
- {letta → letta_client}/types/tool_call_delta.py +2 -2
- {letta → letta_client}/types/tool_call_function_output.py +2 -2
- {letta → letta_client}/types/tool_call_message.py +2 -2
- {letta → letta_client}/types/tool_create.py +2 -2
- {letta → letta_client}/types/tool_function_choice.py +2 -2
- {letta → letta_client}/types/tool_input.py +2 -2
- {letta → letta_client}/types/tool_message.py +2 -2
- {letta → letta_client}/types/tool_return_message.py +2 -2
- letta_client/types/tool_type.py +5 -0
- {letta → letta_client}/types/usage_statistics.py +2 -2
- {letta → letta_client}/types/user.py +2 -7
- {letta → letta_client}/types/user_create.py +2 -7
- {letta → letta_client}/types/user_message_input.py +2 -2
- {letta → letta_client}/types/user_message_output.py +2 -2
- {letta → letta_client}/types/user_update.py +2 -7
- {letta → letta_client}/types/validation_error.py +2 -2
- {letta_client-0.1.6.dist-info → letta_client-0.1.10.dist-info}/METADATA +7 -7
- letta_client-0.1.10.dist-info/RECORD +204 -0
- letta/agents/client.py +0 -2644
- letta/agents/memory/__init__.py +0 -5
- letta/agents/memory/messages/client.py +0 -147
- letta/agents/memory_blocks/client.py +0 -364
- letta/agents/types/__init__.py +0 -47
- letta/agents/types/agents_search_deployed_agents_request_combinator.py +0 -5
- letta/agents/types/agents_search_deployed_agents_request_search_item_name_operator.py +0 -7
- letta/agents/types/agents_search_deployed_agents_request_search_item_order_by.py +0 -26
- letta/agents/types/agents_search_deployed_agents_request_search_item_order_by_direction.py +0 -5
- letta/agents/types/agents_search_deployed_agents_request_search_item_order_by_value.py +0 -7
- letta/types/agent_type.py +0 -8
- letta_client-0.1.6.dist-info/RECORD +0 -193
- {letta → letta_client}/agents/archival_memory/__init__.py +0 -0
- {letta → letta_client}/agents/context/__init__.py +0 -0
- {letta/agents/memory/messages → letta_client/agents/core_memory}/__init__.py +0 -0
- {letta → letta_client}/agents/messages/__init__.py +0 -0
- {letta → letta_client}/agents/messages/types/__init__.py +0 -0
- {letta → letta_client}/agents/messages/types/messages_list_response.py +0 -0
- {letta/agents/memory_blocks → letta_client/agents/recall_memory}/__init__.py +0 -0
- {letta/agents/recall_memory → letta_client/agents/sources}/__init__.py +0 -0
- {letta/agents/sources → letta_client/agents/tools}/__init__.py +0 -0
- {letta → letta_client}/agents/types/create_agent_request_tool_rules_item.py +0 -0
- {letta → letta_client}/agents/types/update_agent_tool_rules_item.py +0 -0
- {letta/agents/tools → letta_client/blocks}/__init__.py +0 -0
- {letta → letta_client}/core/api_error.py +0 -0
- {letta → letta_client}/core/datetime_utils.py +0 -0
- {letta → letta_client}/core/file.py +0 -0
- {letta → letta_client}/core/http_client.py +0 -0
- {letta → letta_client}/core/jsonable_encoder.py +0 -0
- {letta → letta_client}/core/pydantic_utilities.py +0 -0
- {letta → letta_client}/core/query_encoder.py +0 -0
- {letta → letta_client}/core/remove_none_from_dict.py +0 -0
- {letta → letta_client}/core/request_options.py +0 -0
- {letta → letta_client}/core/serialization.py +0 -0
- {letta → letta_client}/environment.py +0 -0
- {letta → letta_client}/errors/__init__.py +0 -0
- {letta → letta_client}/errors/conflict_error.py +0 -0
- {letta → letta_client}/errors/internal_server_error.py +0 -0
- {letta → letta_client}/errors/not_found_error.py +0 -0
- {letta → letta_client}/errors/unprocessable_entity_error.py +0 -0
- {letta/blocks → letta_client/health}/__init__.py +0 -0
- {letta/health → letta_client/jobs}/__init__.py +0 -0
- {letta/jobs → letta_client/models}/__init__.py +0 -0
- {letta/models → letta_client/providers}/__init__.py +0 -0
- {letta → letta_client}/py.typed +0 -0
- {letta/sources/files → letta_client/runs}/__init__.py +0 -0
- {letta → letta_client}/sources/__init__.py +0 -0
- {letta/sources/passages → letta_client/sources/files}/__init__.py +0 -0
- {letta/tools → letta_client/sources/passages}/__init__.py +0 -0
- {letta → letta_client}/types/agent_state_tool_rules_item.py +0 -0
- {letta → letta_client}/types/app_auth_scheme_auth_mode.py +0 -0
- {letta → letta_client}/types/chat_completion_request_function_call.py +0 -0
- {letta → letta_client}/types/chat_completion_request_messages_item.py +0 -0
- {letta → letta_client}/types/chat_completion_request_stop.py +0 -0
- {letta → letta_client}/types/chat_completion_request_tool_choice.py +0 -0
- {letta → letta_client}/types/embedding_config_embedding_endpoint_type.py +0 -0
- {letta → letta_client}/types/job_status.py +0 -0
- {letta → letta_client}/types/llm_config_model_endpoint_type.py +0 -0
- {letta → letta_client}/types/message_create_role.py +0 -0
- {letta → letta_client}/types/message_role.py +0 -0
- {letta → letta_client}/types/not_found_error_body_message.py +0 -0
- {letta → letta_client}/types/sandbox_config_create_config.py +0 -0
- {letta → letta_client}/types/sandbox_config_update_config.py +0 -0
- {letta → letta_client}/types/sandbox_type.py +0 -0
- {letta → letta_client}/types/tool_call_message_tool_call.py +0 -0
- {letta → letta_client}/types/tool_return_message_status.py +0 -0
- {letta → letta_client}/types/tool_rule_type.py +0 -0
- {letta → letta_client}/types/user_message_input_content.py +0 -0
- {letta → letta_client}/types/validation_error_loc_item.py +0 -0
- {letta → letta_client}/version.py +0 -0
- {letta_client-0.1.6.dist-info → letta_client-0.1.10.dist-info}/WHEEL +0 -0
|
@@ -1,29 +1,28 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
3
|
from ...core.client_wrapper import SyncClientWrapper
|
|
4
|
-
from .messages.client import MessagesClient
|
|
5
4
|
import typing
|
|
6
5
|
from ...core.request_options import RequestOptions
|
|
7
|
-
from
|
|
6
|
+
from .types.memory_variables_get_response import MemoryVariablesGetResponse
|
|
8
7
|
from ...core.jsonable_encoder import jsonable_encoder
|
|
9
|
-
from ...core.
|
|
10
|
-
from ...errors.
|
|
11
|
-
from ...types.http_validation_error import HttpValidationError
|
|
8
|
+
from ...core.unchecked_base_model import construct_type
|
|
9
|
+
from ...errors.not_found_error import NotFoundError
|
|
12
10
|
from json.decoder import JSONDecodeError
|
|
13
11
|
from ...core.api_error import ApiError
|
|
14
12
|
from ...core.client_wrapper import AsyncClientWrapper
|
|
15
|
-
from .messages.client import AsyncMessagesClient
|
|
16
13
|
|
|
17
14
|
|
|
18
|
-
class
|
|
15
|
+
class MemoryVariablesClient:
|
|
19
16
|
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
20
17
|
self._client_wrapper = client_wrapper
|
|
21
|
-
self.messages = MessagesClient(client_wrapper=self._client_wrapper)
|
|
22
18
|
|
|
23
|
-
def get(
|
|
19
|
+
def get(
|
|
20
|
+
self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
21
|
+
) -> MemoryVariablesGetResponse:
|
|
24
22
|
"""
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
<Note>This endpoint is only available on Letta Cloud.</Note>
|
|
24
|
+
|
|
25
|
+
Returns the memory variables associated with an agent.
|
|
27
26
|
|
|
28
27
|
Parameters
|
|
29
28
|
----------
|
|
@@ -34,40 +33,40 @@ class MemoryClient:
|
|
|
34
33
|
|
|
35
34
|
Returns
|
|
36
35
|
-------
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
MemoryVariablesGetResponse
|
|
37
|
+
200
|
|
39
38
|
|
|
40
39
|
Examples
|
|
41
40
|
--------
|
|
42
|
-
from
|
|
41
|
+
from letta_client import Letta
|
|
43
42
|
|
|
44
43
|
client = Letta(
|
|
45
44
|
token="YOUR_TOKEN",
|
|
46
45
|
)
|
|
47
|
-
client.agents.
|
|
46
|
+
client.agents.memory_variables.get(
|
|
48
47
|
agent_id="agent_id",
|
|
49
48
|
)
|
|
50
49
|
"""
|
|
51
50
|
_response = self._client_wrapper.httpx_client.request(
|
|
52
|
-
f"v1/agents/{jsonable_encoder(agent_id)}/
|
|
51
|
+
f"v1/agents/{jsonable_encoder(agent_id)}/variables",
|
|
53
52
|
method="GET",
|
|
54
53
|
request_options=request_options,
|
|
55
54
|
)
|
|
56
55
|
try:
|
|
57
56
|
if 200 <= _response.status_code < 300:
|
|
58
57
|
return typing.cast(
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
type_=
|
|
58
|
+
MemoryVariablesGetResponse,
|
|
59
|
+
construct_type(
|
|
60
|
+
type_=MemoryVariablesGetResponse, # type: ignore
|
|
62
61
|
object_=_response.json(),
|
|
63
62
|
),
|
|
64
63
|
)
|
|
65
|
-
if _response.status_code ==
|
|
66
|
-
raise
|
|
64
|
+
if _response.status_code == 404:
|
|
65
|
+
raise NotFoundError(
|
|
67
66
|
typing.cast(
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
type_=
|
|
67
|
+
typing.Optional[typing.Any],
|
|
68
|
+
construct_type(
|
|
69
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
71
70
|
object_=_response.json(),
|
|
72
71
|
),
|
|
73
72
|
)
|
|
@@ -78,15 +77,17 @@ class MemoryClient:
|
|
|
78
77
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
79
78
|
|
|
80
79
|
|
|
81
|
-
class
|
|
80
|
+
class AsyncMemoryVariablesClient:
|
|
82
81
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
83
82
|
self._client_wrapper = client_wrapper
|
|
84
|
-
self.messages = AsyncMessagesClient(client_wrapper=self._client_wrapper)
|
|
85
83
|
|
|
86
|
-
async def get(
|
|
84
|
+
async def get(
|
|
85
|
+
self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
86
|
+
) -> MemoryVariablesGetResponse:
|
|
87
87
|
"""
|
|
88
|
-
|
|
89
|
-
|
|
88
|
+
<Note>This endpoint is only available on Letta Cloud.</Note>
|
|
89
|
+
|
|
90
|
+
Returns the memory variables associated with an agent.
|
|
90
91
|
|
|
91
92
|
Parameters
|
|
92
93
|
----------
|
|
@@ -97,14 +98,14 @@ class AsyncMemoryClient:
|
|
|
97
98
|
|
|
98
99
|
Returns
|
|
99
100
|
-------
|
|
100
|
-
|
|
101
|
-
|
|
101
|
+
MemoryVariablesGetResponse
|
|
102
|
+
200
|
|
102
103
|
|
|
103
104
|
Examples
|
|
104
105
|
--------
|
|
105
106
|
import asyncio
|
|
106
107
|
|
|
107
|
-
from
|
|
108
|
+
from letta_client import AsyncLetta
|
|
108
109
|
|
|
109
110
|
client = AsyncLetta(
|
|
110
111
|
token="YOUR_TOKEN",
|
|
@@ -112,7 +113,7 @@ class AsyncMemoryClient:
|
|
|
112
113
|
|
|
113
114
|
|
|
114
115
|
async def main() -> None:
|
|
115
|
-
await client.agents.
|
|
116
|
+
await client.agents.memory_variables.get(
|
|
116
117
|
agent_id="agent_id",
|
|
117
118
|
)
|
|
118
119
|
|
|
@@ -120,25 +121,25 @@ class AsyncMemoryClient:
|
|
|
120
121
|
asyncio.run(main())
|
|
121
122
|
"""
|
|
122
123
|
_response = await self._client_wrapper.httpx_client.request(
|
|
123
|
-
f"v1/agents/{jsonable_encoder(agent_id)}/
|
|
124
|
+
f"v1/agents/{jsonable_encoder(agent_id)}/variables",
|
|
124
125
|
method="GET",
|
|
125
126
|
request_options=request_options,
|
|
126
127
|
)
|
|
127
128
|
try:
|
|
128
129
|
if 200 <= _response.status_code < 300:
|
|
129
130
|
return typing.cast(
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
type_=
|
|
131
|
+
MemoryVariablesGetResponse,
|
|
132
|
+
construct_type(
|
|
133
|
+
type_=MemoryVariablesGetResponse, # type: ignore
|
|
133
134
|
object_=_response.json(),
|
|
134
135
|
),
|
|
135
136
|
)
|
|
136
|
-
if _response.status_code ==
|
|
137
|
-
raise
|
|
137
|
+
if _response.status_code == 404:
|
|
138
|
+
raise NotFoundError(
|
|
138
139
|
typing.cast(
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
type_=
|
|
140
|
+
typing.Optional[typing.Any],
|
|
141
|
+
construct_type(
|
|
142
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
142
143
|
object_=_response.json(),
|
|
143
144
|
),
|
|
144
145
|
)
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
from
|
|
3
|
+
from ....core.unchecked_base_model import UncheckedBaseModel
|
|
4
4
|
import typing
|
|
5
|
-
from
|
|
5
|
+
from ....core.pydantic_utilities import IS_PYDANTIC_V2
|
|
6
6
|
import pydantic
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
class
|
|
9
|
+
class MemoryVariablesGetResponse(UncheckedBaseModel):
|
|
10
10
|
variables: typing.Dict[str, str]
|
|
11
11
|
|
|
12
12
|
if IS_PYDANTIC_V2:
|