letta-client 0.1.9__py3-none-any.whl → 0.1.11__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 +6 -1
- {letta → letta_client}/agents/archival_memory/client.py +8 -8
- {letta → letta_client}/agents/client.py +164 -20
- {letta → letta_client}/agents/context/client.py +2 -2
- {letta → letta_client}/agents/core_memory/client.py +14 -14
- {letta → letta_client}/agents/memory_variables/client.py +2 -2
- {letta → letta_client}/agents/messages/client.py +19 -19
- {letta → letta_client}/agents/recall_memory/client.py +2 -2
- {letta → letta_client}/agents/sources/client.py +2 -2
- {letta → letta_client}/agents/templates/client.py +12 -12
- {letta → letta_client}/agents/tools/client.py +6 -6
- {letta → letta_client}/blocks/client.py +14 -14
- {letta → letta_client}/client.py +6 -2
- {letta → letta_client}/core/client_wrapper.py +1 -1
- {letta → letta_client}/health/client.py +2 -2
- {letta → letta_client}/jobs/client.py +8 -8
- {letta → letta_client}/models/client.py +4 -4
- {letta → letta_client}/providers/client.py +8 -8
- letta_client/runs/client.py +876 -0
- {letta → letta_client}/sources/client.py +16 -16
- {letta → letta_client}/sources/files/client.py +6 -6
- {letta → letta_client}/sources/passages/client.py +2 -2
- letta_client/tools/__init__.py +2 -0
- {letta → letta_client}/tools/client.py +28 -58
- {letta → letta_client}/types/__init__.py +4 -0
- {letta → letta_client}/types/job.py +6 -0
- letta_client/types/job_type.py +5 -0
- {letta → letta_client}/types/letta_schemas_tool_tool.py +0 -5
- letta_client/types/run.py +77 -0
- {letta → letta_client}/types/tool_create.py +0 -5
- {letta_client-0.1.9.dist-info → letta_client-0.1.11.dist-info}/METADATA +7 -7
- letta_client-0.1.11.dist-info/RECORD +204 -0
- letta_client-0.1.9.dist-info/RECORD +0 -200
- {letta → letta_client}/agents/__init__.py +0 -0
- {letta → letta_client}/agents/archival_memory/__init__.py +0 -0
- {letta → letta_client}/agents/context/__init__.py +0 -0
- {letta → letta_client}/agents/core_memory/__init__.py +0 -0
- {letta → letta_client}/agents/memory_variables/__init__.py +0 -0
- {letta → letta_client}/agents/memory_variables/types/__init__.py +0 -0
- {letta → letta_client}/agents/memory_variables/types/memory_variables_get_response.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/letta_streaming_response.py +0 -0
- {letta → letta_client}/agents/messages/types/messages_list_response.py +0 -0
- {letta → letta_client}/agents/messages/types/messages_list_response_item.py +0 -0
- {letta → letta_client}/agents/recall_memory/__init__.py +0 -0
- {letta → letta_client}/agents/sources/__init__.py +0 -0
- {letta → letta_client}/agents/templates/__init__.py +0 -0
- {letta → letta_client}/agents/templates/types/__init__.py +0 -0
- {letta → letta_client}/agents/templates/types/templates_migrate_response.py +0 -0
- {letta → letta_client}/agents/tools/__init__.py +0 -0
- {letta → letta_client}/agents/types/__init__.py +0 -0
- {letta → letta_client}/agents/types/agents_search_request_combinator.py +0 -0
- {letta → letta_client}/agents/types/agents_search_request_search_item.py +0 -0
- {letta → letta_client}/agents/types/agents_search_request_search_item_name.py +0 -0
- {letta → letta_client}/agents/types/agents_search_request_search_item_name_operator.py +0 -0
- {letta → letta_client}/agents/types/agents_search_request_search_item_order_by.py +0 -0
- {letta → letta_client}/agents/types/agents_search_request_search_item_order_by_direction.py +0 -0
- {letta → letta_client}/agents/types/agents_search_request_search_item_order_by_value.py +0 -0
- {letta → letta_client}/agents/types/agents_search_request_search_item_version.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 → letta_client}/blocks/__init__.py +0 -0
- {letta → letta_client}/core/__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}/core/unchecked_base_model.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 → letta_client}/health/__init__.py +0 -0
- {letta → letta_client}/jobs/__init__.py +0 -0
- {letta → letta_client}/models/__init__.py +0 -0
- {letta → 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/action_model.py +0 -0
- {letta → letta_client}/types/action_parameters_model.py +0 -0
- {letta → letta_client}/types/action_response_model.py +0 -0
- {letta → letta_client}/types/agent_environment_variable.py +0 -0
- {letta → letta_client}/types/agent_state.py +0 -0
- {letta → letta_client}/types/agent_state_tool_rules_item.py +0 -0
- {letta → letta_client}/types/agent_type.py +0 -0
- {letta → letta_client}/types/app_auth_scheme.py +0 -0
- {letta → letta_client}/types/app_auth_scheme_auth_mode.py +0 -0
- {letta → letta_client}/types/app_model.py +0 -0
- {letta → letta_client}/types/archival_memory_summary.py +0 -0
- {letta → letta_client}/types/assistant_file.py +0 -0
- {letta → letta_client}/types/assistant_message_input.py +0 -0
- {letta → letta_client}/types/assistant_message_output.py +0 -0
- {letta → letta_client}/types/auth_request.py +0 -0
- {letta → letta_client}/types/auth_response.py +0 -0
- {letta → letta_client}/types/auth_scheme_field.py +0 -0
- {letta → letta_client}/types/block.py +0 -0
- {letta → letta_client}/types/block_update.py +0 -0
- {letta → letta_client}/types/chat_completion_request.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/chat_completion_response.py +0 -0
- {letta → letta_client}/types/child_tool_rule.py +0 -0
- {letta → letta_client}/types/choice.py +0 -0
- {letta → letta_client}/types/conditional_tool_rule.py +0 -0
- {letta → letta_client}/types/conflict_error_body.py +0 -0
- {letta → letta_client}/types/context_window_overview.py +0 -0
- {letta → letta_client}/types/create_assistant_file_request.py +0 -0
- {letta → letta_client}/types/create_assistant_request.py +0 -0
- {letta → letta_client}/types/create_block.py +0 -0
- {letta → letta_client}/types/delete_assistant_file_response.py +0 -0
- {letta → letta_client}/types/delete_assistant_response.py +0 -0
- {letta → letta_client}/types/e_2_b_sandbox_config.py +0 -0
- {letta → letta_client}/types/embedding_config.py +0 -0
- {letta → letta_client}/types/embedding_config_embedding_endpoint_type.py +0 -0
- {letta → letta_client}/types/file_metadata.py +0 -0
- {letta → letta_client}/types/function_call_input.py +0 -0
- {letta → letta_client}/types/function_call_output.py +0 -0
- {letta → letta_client}/types/function_schema.py +0 -0
- {letta → letta_client}/types/health.py +0 -0
- {letta → letta_client}/types/http_validation_error.py +0 -0
- {letta → letta_client}/types/init_tool_rule.py +0 -0
- {letta → letta_client}/types/internal_server_error_body.py +0 -0
- {letta → letta_client}/types/job_status.py +0 -0
- {letta → letta_client}/types/letta_request.py +0 -0
- {letta → letta_client}/types/letta_response.py +0 -0
- {letta → letta_client}/types/letta_response_messages_item.py +0 -0
- {letta → letta_client}/types/letta_schemas_letta_message_tool_call.py +0 -0
- {letta → letta_client}/types/letta_schemas_message_message.py +0 -0
- {letta → letta_client}/types/letta_schemas_openai_chat_completion_request_tool.py +0 -0
- {letta → letta_client}/types/letta_schemas_openai_chat_completion_request_tool_call.py +0 -0
- {letta → letta_client}/types/letta_schemas_openai_chat_completion_request_tool_call_function.py +0 -0
- {letta → letta_client}/types/letta_schemas_openai_chat_completion_response_message.py +0 -0
- {letta → letta_client}/types/letta_schemas_openai_chat_completion_response_tool_call.py +0 -0
- {letta → letta_client}/types/letta_schemas_openai_chat_completions_tool_call_function.py +0 -0
- {letta → letta_client}/types/letta_schemas_openai_chat_completions_tool_call_input.py +0 -0
- {letta → letta_client}/types/letta_schemas_openai_chat_completions_tool_call_output.py +0 -0
- {letta → letta_client}/types/letta_usage_statistics.py +0 -0
- {letta → letta_client}/types/llm_config.py +0 -0
- {letta → letta_client}/types/llm_config_model_endpoint_type.py +0 -0
- {letta → letta_client}/types/local_sandbox_config.py +0 -0
- {letta → letta_client}/types/log_prob_token.py +0 -0
- {letta → letta_client}/types/memory.py +0 -0
- {letta → letta_client}/types/message_content_log_prob.py +0 -0
- {letta → letta_client}/types/message_create.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.py +0 -0
- {letta → letta_client}/types/not_found_error_body_message.py +0 -0
- {letta → letta_client}/types/open_ai_assistant.py +0 -0
- {letta → letta_client}/types/organization.py +0 -0
- {letta → letta_client}/types/organization_create.py +0 -0
- {letta → letta_client}/types/passage.py +0 -0
- {letta → letta_client}/types/provider.py +0 -0
- {letta → letta_client}/types/reasoning_message.py +0 -0
- {letta → letta_client}/types/recall_memory_summary.py +0 -0
- {letta → letta_client}/types/response_format.py +0 -0
- {letta → letta_client}/types/sandbox_config.py +0 -0
- {letta → letta_client}/types/sandbox_config_create.py +0 -0
- {letta → letta_client}/types/sandbox_config_create_config.py +0 -0
- {letta → letta_client}/types/sandbox_config_update.py +0 -0
- {letta → letta_client}/types/sandbox_config_update_config.py +0 -0
- {letta → letta_client}/types/sandbox_environment_variable.py +0 -0
- {letta → letta_client}/types/sandbox_environment_variable_create.py +0 -0
- {letta → letta_client}/types/sandbox_environment_variable_update.py +0 -0
- {letta → letta_client}/types/sandbox_type.py +0 -0
- {letta → letta_client}/types/source.py +0 -0
- {letta → letta_client}/types/system_message_input.py +0 -0
- {letta → letta_client}/types/system_message_output.py +0 -0
- {letta → letta_client}/types/terminal_tool_rule.py +0 -0
- {letta → letta_client}/types/tool_call_delta.py +0 -0
- {letta → letta_client}/types/tool_call_function_output.py +0 -0
- {letta → letta_client}/types/tool_call_message.py +0 -0
- {letta → letta_client}/types/tool_call_message_tool_call.py +0 -0
- {letta → letta_client}/types/tool_function_choice.py +0 -0
- {letta → letta_client}/types/tool_input.py +0 -0
- {letta → letta_client}/types/tool_message.py +0 -0
- {letta → letta_client}/types/tool_return_message.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/tool_type.py +0 -0
- {letta → letta_client}/types/usage_statistics.py +0 -0
- {letta → letta_client}/types/user.py +0 -0
- {letta → letta_client}/types/user_create.py +0 -0
- {letta → letta_client}/types/user_message_input.py +0 -0
- {letta → letta_client}/types/user_message_input_content.py +0 -0
- {letta → letta_client}/types/user_message_output.py +0 -0
- {letta → letta_client}/types/user_update.py +0 -0
- {letta → letta_client}/types/validation_error.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.9.dist-info → letta_client-0.1.11.dist-info}/WHEEL +0 -0
|
@@ -49,6 +49,7 @@ from .types import (
|
|
|
49
49
|
InternalServerErrorBody,
|
|
50
50
|
Job,
|
|
51
51
|
JobStatus,
|
|
52
|
+
JobType,
|
|
52
53
|
LettaRequest,
|
|
53
54
|
LettaResponse,
|
|
54
55
|
LettaResponseMessagesItem,
|
|
@@ -89,6 +90,7 @@ from .types import (
|
|
|
89
90
|
ReasoningMessage,
|
|
90
91
|
RecallMemorySummary,
|
|
91
92
|
ResponseFormat,
|
|
93
|
+
Run,
|
|
92
94
|
SandboxConfig,
|
|
93
95
|
SandboxConfigCreate,
|
|
94
96
|
SandboxConfigCreateConfig,
|
|
@@ -125,7 +127,7 @@ from .types import (
|
|
|
125
127
|
ValidationErrorLocItem,
|
|
126
128
|
)
|
|
127
129
|
from .errors import ConflictError, InternalServerError, NotFoundError, UnprocessableEntityError
|
|
128
|
-
from . import agents, blocks, health, jobs, models, providers, sources, tools
|
|
130
|
+
from . import agents, blocks, health, jobs, models, providers, runs, sources, tools
|
|
129
131
|
from .agents import (
|
|
130
132
|
AgentsSearchRequestCombinator,
|
|
131
133
|
AgentsSearchRequestSearchItem,
|
|
@@ -209,6 +211,7 @@ __all__ = [
|
|
|
209
211
|
"InternalServerErrorBody",
|
|
210
212
|
"Job",
|
|
211
213
|
"JobStatus",
|
|
214
|
+
"JobType",
|
|
212
215
|
"Letta",
|
|
213
216
|
"LettaEnvironment",
|
|
214
217
|
"LettaRequest",
|
|
@@ -252,6 +255,7 @@ __all__ = [
|
|
|
252
255
|
"ReasoningMessage",
|
|
253
256
|
"RecallMemorySummary",
|
|
254
257
|
"ResponseFormat",
|
|
258
|
+
"Run",
|
|
255
259
|
"SandboxConfig",
|
|
256
260
|
"SandboxConfigCreate",
|
|
257
261
|
"SandboxConfigCreateConfig",
|
|
@@ -295,6 +299,7 @@ __all__ = [
|
|
|
295
299
|
"jobs",
|
|
296
300
|
"models",
|
|
297
301
|
"providers",
|
|
302
|
+
"runs",
|
|
298
303
|
"sources",
|
|
299
304
|
"tools",
|
|
300
305
|
]
|
|
@@ -41,7 +41,7 @@ class ArchivalMemoryClient:
|
|
|
41
41
|
|
|
42
42
|
Examples
|
|
43
43
|
--------
|
|
44
|
-
from
|
|
44
|
+
from letta_client import Letta
|
|
45
45
|
|
|
46
46
|
client = Letta(
|
|
47
47
|
token="YOUR_TOKEN",
|
|
@@ -114,7 +114,7 @@ class ArchivalMemoryClient:
|
|
|
114
114
|
|
|
115
115
|
Examples
|
|
116
116
|
--------
|
|
117
|
-
from
|
|
117
|
+
from letta_client import Letta
|
|
118
118
|
|
|
119
119
|
client = Letta(
|
|
120
120
|
token="YOUR_TOKEN",
|
|
@@ -180,7 +180,7 @@ class ArchivalMemoryClient:
|
|
|
180
180
|
|
|
181
181
|
Examples
|
|
182
182
|
--------
|
|
183
|
-
from
|
|
183
|
+
from letta_client import Letta
|
|
184
184
|
|
|
185
185
|
client = Letta(
|
|
186
186
|
token="YOUR_TOKEN",
|
|
@@ -248,7 +248,7 @@ class ArchivalMemoryClient:
|
|
|
248
248
|
|
|
249
249
|
Examples
|
|
250
250
|
--------
|
|
251
|
-
from
|
|
251
|
+
from letta_client import Letta
|
|
252
252
|
|
|
253
253
|
client = Letta(
|
|
254
254
|
token="YOUR_TOKEN",
|
|
@@ -314,7 +314,7 @@ class AsyncArchivalMemoryClient:
|
|
|
314
314
|
--------
|
|
315
315
|
import asyncio
|
|
316
316
|
|
|
317
|
-
from
|
|
317
|
+
from letta_client import AsyncLetta
|
|
318
318
|
|
|
319
319
|
client = AsyncLetta(
|
|
320
320
|
token="YOUR_TOKEN",
|
|
@@ -395,7 +395,7 @@ class AsyncArchivalMemoryClient:
|
|
|
395
395
|
--------
|
|
396
396
|
import asyncio
|
|
397
397
|
|
|
398
|
-
from
|
|
398
|
+
from letta_client import AsyncLetta
|
|
399
399
|
|
|
400
400
|
client = AsyncLetta(
|
|
401
401
|
token="YOUR_TOKEN",
|
|
@@ -469,7 +469,7 @@ class AsyncArchivalMemoryClient:
|
|
|
469
469
|
--------
|
|
470
470
|
import asyncio
|
|
471
471
|
|
|
472
|
-
from
|
|
472
|
+
from letta_client import AsyncLetta
|
|
473
473
|
|
|
474
474
|
client = AsyncLetta(
|
|
475
475
|
token="YOUR_TOKEN",
|
|
@@ -545,7 +545,7 @@ class AsyncArchivalMemoryClient:
|
|
|
545
545
|
--------
|
|
546
546
|
import asyncio
|
|
547
547
|
|
|
548
|
-
from
|
|
548
|
+
from letta_client import AsyncLetta
|
|
549
549
|
|
|
550
550
|
client = AsyncLetta(
|
|
551
551
|
token="YOUR_TOKEN",
|
|
@@ -98,7 +98,7 @@ class AgentsClient:
|
|
|
98
98
|
|
|
99
99
|
Examples
|
|
100
100
|
--------
|
|
101
|
-
from
|
|
101
|
+
from letta_client import Letta
|
|
102
102
|
|
|
103
103
|
client = Letta(
|
|
104
104
|
token="YOUR_TOKEN",
|
|
@@ -165,7 +165,7 @@ class AgentsClient:
|
|
|
165
165
|
context_window_limit: typing.Optional[int] = OMIT,
|
|
166
166
|
embedding_chunk_size: typing.Optional[int] = OMIT,
|
|
167
167
|
from_template: typing.Optional[str] = OMIT,
|
|
168
|
-
|
|
168
|
+
project: typing.Optional[str] = OMIT,
|
|
169
169
|
tool_exec_environment_variables: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT,
|
|
170
170
|
variables: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT,
|
|
171
171
|
request_options: typing.Optional[RequestOptions] = None,
|
|
@@ -238,8 +238,8 @@ class AgentsClient:
|
|
|
238
238
|
from_template : typing.Optional[str]
|
|
239
239
|
The template id used to configure the agent
|
|
240
240
|
|
|
241
|
-
|
|
242
|
-
The project
|
|
241
|
+
project : typing.Optional[str]
|
|
242
|
+
The project slug that the agent will be associated with.
|
|
243
243
|
|
|
244
244
|
tool_exec_environment_variables : typing.Optional[typing.Dict[str, typing.Optional[str]]]
|
|
245
245
|
The environment variables for tool execution specific to this agent.
|
|
@@ -257,7 +257,7 @@ class AgentsClient:
|
|
|
257
257
|
|
|
258
258
|
Examples
|
|
259
259
|
--------
|
|
260
|
-
from
|
|
260
|
+
from letta_client import CreateBlock, Letta
|
|
261
261
|
|
|
262
262
|
client = Letta(
|
|
263
263
|
token="YOUR_TOKEN",
|
|
@@ -306,7 +306,7 @@ class AgentsClient:
|
|
|
306
306
|
"context_window_limit": context_window_limit,
|
|
307
307
|
"embedding_chunk_size": embedding_chunk_size,
|
|
308
308
|
"from_template": from_template,
|
|
309
|
-
"
|
|
309
|
+
"project": project,
|
|
310
310
|
"tool_exec_environment_variables": tool_exec_environment_variables,
|
|
311
311
|
"variables": variables,
|
|
312
312
|
},
|
|
@@ -358,7 +358,7 @@ class AgentsClient:
|
|
|
358
358
|
|
|
359
359
|
Examples
|
|
360
360
|
--------
|
|
361
|
-
from
|
|
361
|
+
from letta_client import Letta
|
|
362
362
|
|
|
363
363
|
client = Letta(
|
|
364
364
|
token="YOUR_TOKEN",
|
|
@@ -416,7 +416,7 @@ class AgentsClient:
|
|
|
416
416
|
|
|
417
417
|
Examples
|
|
418
418
|
--------
|
|
419
|
-
from
|
|
419
|
+
from letta_client import Letta
|
|
420
420
|
|
|
421
421
|
client = Letta(
|
|
422
422
|
token="YOUR_TOKEN",
|
|
@@ -529,7 +529,7 @@ class AgentsClient:
|
|
|
529
529
|
|
|
530
530
|
Examples
|
|
531
531
|
--------
|
|
532
|
-
from
|
|
532
|
+
from letta_client import Letta
|
|
533
533
|
|
|
534
534
|
client = Letta(
|
|
535
535
|
token="YOUR_TOKEN",
|
|
@@ -592,6 +592,74 @@ class AgentsClient:
|
|
|
592
592
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
593
593
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
594
594
|
|
|
595
|
+
def reset_messages(
|
|
596
|
+
self,
|
|
597
|
+
agent_id: str,
|
|
598
|
+
*,
|
|
599
|
+
add_default_initial_messages: typing.Optional[bool] = None,
|
|
600
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
601
|
+
) -> AgentState:
|
|
602
|
+
"""
|
|
603
|
+
Resets the messages for an agent
|
|
604
|
+
|
|
605
|
+
Parameters
|
|
606
|
+
----------
|
|
607
|
+
agent_id : str
|
|
608
|
+
|
|
609
|
+
add_default_initial_messages : typing.Optional[bool]
|
|
610
|
+
If true, adds the default initial messages after resetting.
|
|
611
|
+
|
|
612
|
+
request_options : typing.Optional[RequestOptions]
|
|
613
|
+
Request-specific configuration.
|
|
614
|
+
|
|
615
|
+
Returns
|
|
616
|
+
-------
|
|
617
|
+
AgentState
|
|
618
|
+
Successful Response
|
|
619
|
+
|
|
620
|
+
Examples
|
|
621
|
+
--------
|
|
622
|
+
from letta_client import Letta
|
|
623
|
+
|
|
624
|
+
client = Letta(
|
|
625
|
+
token="YOUR_TOKEN",
|
|
626
|
+
)
|
|
627
|
+
client.agents.reset_messages(
|
|
628
|
+
agent_id="agent_id",
|
|
629
|
+
)
|
|
630
|
+
"""
|
|
631
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
632
|
+
f"v1/agents/{jsonable_encoder(agent_id)}/reset-messages",
|
|
633
|
+
method="PATCH",
|
|
634
|
+
params={
|
|
635
|
+
"add_default_initial_messages": add_default_initial_messages,
|
|
636
|
+
},
|
|
637
|
+
request_options=request_options,
|
|
638
|
+
)
|
|
639
|
+
try:
|
|
640
|
+
if 200 <= _response.status_code < 300:
|
|
641
|
+
return typing.cast(
|
|
642
|
+
AgentState,
|
|
643
|
+
construct_type(
|
|
644
|
+
type_=AgentState, # type: ignore
|
|
645
|
+
object_=_response.json(),
|
|
646
|
+
),
|
|
647
|
+
)
|
|
648
|
+
if _response.status_code == 422:
|
|
649
|
+
raise UnprocessableEntityError(
|
|
650
|
+
typing.cast(
|
|
651
|
+
HttpValidationError,
|
|
652
|
+
construct_type(
|
|
653
|
+
type_=HttpValidationError, # type: ignore
|
|
654
|
+
object_=_response.json(),
|
|
655
|
+
),
|
|
656
|
+
)
|
|
657
|
+
)
|
|
658
|
+
_response_json = _response.json()
|
|
659
|
+
except JSONDecodeError:
|
|
660
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
661
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
662
|
+
|
|
595
663
|
def search(
|
|
596
664
|
self,
|
|
597
665
|
*,
|
|
@@ -628,7 +696,7 @@ class AgentsClient:
|
|
|
628
696
|
|
|
629
697
|
Examples
|
|
630
698
|
--------
|
|
631
|
-
from
|
|
699
|
+
from letta_client import Letta
|
|
632
700
|
|
|
633
701
|
client = Letta(
|
|
634
702
|
token="YOUR_TOKEN",
|
|
@@ -718,7 +786,7 @@ class AsyncAgentsClient:
|
|
|
718
786
|
--------
|
|
719
787
|
import asyncio
|
|
720
788
|
|
|
721
|
-
from
|
|
789
|
+
from letta_client import AsyncLetta
|
|
722
790
|
|
|
723
791
|
client = AsyncLetta(
|
|
724
792
|
token="YOUR_TOKEN",
|
|
@@ -791,7 +859,7 @@ class AsyncAgentsClient:
|
|
|
791
859
|
context_window_limit: typing.Optional[int] = OMIT,
|
|
792
860
|
embedding_chunk_size: typing.Optional[int] = OMIT,
|
|
793
861
|
from_template: typing.Optional[str] = OMIT,
|
|
794
|
-
|
|
862
|
+
project: typing.Optional[str] = OMIT,
|
|
795
863
|
tool_exec_environment_variables: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT,
|
|
796
864
|
variables: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT,
|
|
797
865
|
request_options: typing.Optional[RequestOptions] = None,
|
|
@@ -864,8 +932,8 @@ class AsyncAgentsClient:
|
|
|
864
932
|
from_template : typing.Optional[str]
|
|
865
933
|
The template id used to configure the agent
|
|
866
934
|
|
|
867
|
-
|
|
868
|
-
The project
|
|
935
|
+
project : typing.Optional[str]
|
|
936
|
+
The project slug that the agent will be associated with.
|
|
869
937
|
|
|
870
938
|
tool_exec_environment_variables : typing.Optional[typing.Dict[str, typing.Optional[str]]]
|
|
871
939
|
The environment variables for tool execution specific to this agent.
|
|
@@ -885,7 +953,7 @@ class AsyncAgentsClient:
|
|
|
885
953
|
--------
|
|
886
954
|
import asyncio
|
|
887
955
|
|
|
888
|
-
from
|
|
956
|
+
from letta_client import AsyncLetta, CreateBlock
|
|
889
957
|
|
|
890
958
|
client = AsyncLetta(
|
|
891
959
|
token="YOUR_TOKEN",
|
|
@@ -940,7 +1008,7 @@ class AsyncAgentsClient:
|
|
|
940
1008
|
"context_window_limit": context_window_limit,
|
|
941
1009
|
"embedding_chunk_size": embedding_chunk_size,
|
|
942
1010
|
"from_template": from_template,
|
|
943
|
-
"
|
|
1011
|
+
"project": project,
|
|
944
1012
|
"tool_exec_environment_variables": tool_exec_environment_variables,
|
|
945
1013
|
"variables": variables,
|
|
946
1014
|
},
|
|
@@ -994,7 +1062,7 @@ class AsyncAgentsClient:
|
|
|
994
1062
|
--------
|
|
995
1063
|
import asyncio
|
|
996
1064
|
|
|
997
|
-
from
|
|
1065
|
+
from letta_client import AsyncLetta
|
|
998
1066
|
|
|
999
1067
|
client = AsyncLetta(
|
|
1000
1068
|
token="YOUR_TOKEN",
|
|
@@ -1060,7 +1128,7 @@ class AsyncAgentsClient:
|
|
|
1060
1128
|
--------
|
|
1061
1129
|
import asyncio
|
|
1062
1130
|
|
|
1063
|
-
from
|
|
1131
|
+
from letta_client import AsyncLetta
|
|
1064
1132
|
|
|
1065
1133
|
client = AsyncLetta(
|
|
1066
1134
|
token="YOUR_TOKEN",
|
|
@@ -1181,7 +1249,7 @@ class AsyncAgentsClient:
|
|
|
1181
1249
|
--------
|
|
1182
1250
|
import asyncio
|
|
1183
1251
|
|
|
1184
|
-
from
|
|
1252
|
+
from letta_client import AsyncLetta
|
|
1185
1253
|
|
|
1186
1254
|
client = AsyncLetta(
|
|
1187
1255
|
token="YOUR_TOKEN",
|
|
@@ -1250,6 +1318,82 @@ class AsyncAgentsClient:
|
|
|
1250
1318
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
1251
1319
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
1252
1320
|
|
|
1321
|
+
async def reset_messages(
|
|
1322
|
+
self,
|
|
1323
|
+
agent_id: str,
|
|
1324
|
+
*,
|
|
1325
|
+
add_default_initial_messages: typing.Optional[bool] = None,
|
|
1326
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
1327
|
+
) -> AgentState:
|
|
1328
|
+
"""
|
|
1329
|
+
Resets the messages for an agent
|
|
1330
|
+
|
|
1331
|
+
Parameters
|
|
1332
|
+
----------
|
|
1333
|
+
agent_id : str
|
|
1334
|
+
|
|
1335
|
+
add_default_initial_messages : typing.Optional[bool]
|
|
1336
|
+
If true, adds the default initial messages after resetting.
|
|
1337
|
+
|
|
1338
|
+
request_options : typing.Optional[RequestOptions]
|
|
1339
|
+
Request-specific configuration.
|
|
1340
|
+
|
|
1341
|
+
Returns
|
|
1342
|
+
-------
|
|
1343
|
+
AgentState
|
|
1344
|
+
Successful Response
|
|
1345
|
+
|
|
1346
|
+
Examples
|
|
1347
|
+
--------
|
|
1348
|
+
import asyncio
|
|
1349
|
+
|
|
1350
|
+
from letta_client import AsyncLetta
|
|
1351
|
+
|
|
1352
|
+
client = AsyncLetta(
|
|
1353
|
+
token="YOUR_TOKEN",
|
|
1354
|
+
)
|
|
1355
|
+
|
|
1356
|
+
|
|
1357
|
+
async def main() -> None:
|
|
1358
|
+
await client.agents.reset_messages(
|
|
1359
|
+
agent_id="agent_id",
|
|
1360
|
+
)
|
|
1361
|
+
|
|
1362
|
+
|
|
1363
|
+
asyncio.run(main())
|
|
1364
|
+
"""
|
|
1365
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
1366
|
+
f"v1/agents/{jsonable_encoder(agent_id)}/reset-messages",
|
|
1367
|
+
method="PATCH",
|
|
1368
|
+
params={
|
|
1369
|
+
"add_default_initial_messages": add_default_initial_messages,
|
|
1370
|
+
},
|
|
1371
|
+
request_options=request_options,
|
|
1372
|
+
)
|
|
1373
|
+
try:
|
|
1374
|
+
if 200 <= _response.status_code < 300:
|
|
1375
|
+
return typing.cast(
|
|
1376
|
+
AgentState,
|
|
1377
|
+
construct_type(
|
|
1378
|
+
type_=AgentState, # type: ignore
|
|
1379
|
+
object_=_response.json(),
|
|
1380
|
+
),
|
|
1381
|
+
)
|
|
1382
|
+
if _response.status_code == 422:
|
|
1383
|
+
raise UnprocessableEntityError(
|
|
1384
|
+
typing.cast(
|
|
1385
|
+
HttpValidationError,
|
|
1386
|
+
construct_type(
|
|
1387
|
+
type_=HttpValidationError, # type: ignore
|
|
1388
|
+
object_=_response.json(),
|
|
1389
|
+
),
|
|
1390
|
+
)
|
|
1391
|
+
)
|
|
1392
|
+
_response_json = _response.json()
|
|
1393
|
+
except JSONDecodeError:
|
|
1394
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
1395
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
1396
|
+
|
|
1253
1397
|
async def search(
|
|
1254
1398
|
self,
|
|
1255
1399
|
*,
|
|
@@ -1288,7 +1432,7 @@ class AsyncAgentsClient:
|
|
|
1288
1432
|
--------
|
|
1289
1433
|
import asyncio
|
|
1290
1434
|
|
|
1291
|
-
from
|
|
1435
|
+
from letta_client import AsyncLetta
|
|
1292
1436
|
|
|
1293
1437
|
client = AsyncLetta(
|
|
1294
1438
|
token="YOUR_TOKEN",
|
|
@@ -35,7 +35,7 @@ class ContextClient:
|
|
|
35
35
|
|
|
36
36
|
Examples
|
|
37
37
|
--------
|
|
38
|
-
from
|
|
38
|
+
from letta_client import Letta
|
|
39
39
|
|
|
40
40
|
client = Letta(
|
|
41
41
|
token="YOUR_TOKEN",
|
|
@@ -100,7 +100,7 @@ class AsyncContextClient:
|
|
|
100
100
|
--------
|
|
101
101
|
import asyncio
|
|
102
102
|
|
|
103
|
-
from
|
|
103
|
+
from letta_client import AsyncLetta
|
|
104
104
|
|
|
105
105
|
client = AsyncLetta(
|
|
106
106
|
token="YOUR_TOKEN",
|
|
@@ -42,7 +42,7 @@ class CoreMemoryClient:
|
|
|
42
42
|
|
|
43
43
|
Examples
|
|
44
44
|
--------
|
|
45
|
-
from
|
|
45
|
+
from letta_client import Letta
|
|
46
46
|
|
|
47
47
|
client = Letta(
|
|
48
48
|
token="YOUR_TOKEN",
|
|
@@ -99,7 +99,7 @@ class CoreMemoryClient:
|
|
|
99
99
|
|
|
100
100
|
Examples
|
|
101
101
|
--------
|
|
102
|
-
from
|
|
102
|
+
from letta_client import Letta
|
|
103
103
|
|
|
104
104
|
client = Letta(
|
|
105
105
|
token="YOUR_TOKEN",
|
|
@@ -159,7 +159,7 @@ class CoreMemoryClient:
|
|
|
159
159
|
|
|
160
160
|
Examples
|
|
161
161
|
--------
|
|
162
|
-
from
|
|
162
|
+
from letta_client import Letta
|
|
163
163
|
|
|
164
164
|
client = Letta(
|
|
165
165
|
token="YOUR_TOKEN",
|
|
@@ -220,7 +220,7 @@ class CoreMemoryClient:
|
|
|
220
220
|
|
|
221
221
|
Examples
|
|
222
222
|
--------
|
|
223
|
-
from
|
|
223
|
+
from letta_client import Letta
|
|
224
224
|
|
|
225
225
|
client = Letta(
|
|
226
226
|
token="YOUR_TOKEN",
|
|
@@ -313,7 +313,7 @@ class CoreMemoryClient:
|
|
|
313
313
|
|
|
314
314
|
Examples
|
|
315
315
|
--------
|
|
316
|
-
from
|
|
316
|
+
from letta_client import Letta
|
|
317
317
|
|
|
318
318
|
client = Letta(
|
|
319
319
|
token="YOUR_TOKEN",
|
|
@@ -382,7 +382,7 @@ class CoreMemoryClient:
|
|
|
382
382
|
|
|
383
383
|
Examples
|
|
384
384
|
--------
|
|
385
|
-
from
|
|
385
|
+
from letta_client import Letta
|
|
386
386
|
|
|
387
387
|
client = Letta(
|
|
388
388
|
token="YOUR_TOKEN",
|
|
@@ -470,7 +470,7 @@ class CoreMemoryClient:
|
|
|
470
470
|
|
|
471
471
|
Examples
|
|
472
472
|
--------
|
|
473
|
-
from
|
|
473
|
+
from letta_client import Letta
|
|
474
474
|
|
|
475
475
|
client = Letta(
|
|
476
476
|
token="YOUR_TOKEN",
|
|
@@ -547,7 +547,7 @@ class AsyncCoreMemoryClient:
|
|
|
547
547
|
--------
|
|
548
548
|
import asyncio
|
|
549
549
|
|
|
550
|
-
from
|
|
550
|
+
from letta_client import AsyncLetta
|
|
551
551
|
|
|
552
552
|
client = AsyncLetta(
|
|
553
553
|
token="YOUR_TOKEN",
|
|
@@ -612,7 +612,7 @@ class AsyncCoreMemoryClient:
|
|
|
612
612
|
--------
|
|
613
613
|
import asyncio
|
|
614
614
|
|
|
615
|
-
from
|
|
615
|
+
from letta_client import AsyncLetta
|
|
616
616
|
|
|
617
617
|
client = AsyncLetta(
|
|
618
618
|
token="YOUR_TOKEN",
|
|
@@ -680,7 +680,7 @@ class AsyncCoreMemoryClient:
|
|
|
680
680
|
--------
|
|
681
681
|
import asyncio
|
|
682
682
|
|
|
683
|
-
from
|
|
683
|
+
from letta_client import AsyncLetta
|
|
684
684
|
|
|
685
685
|
client = AsyncLetta(
|
|
686
686
|
token="YOUR_TOKEN",
|
|
@@ -749,7 +749,7 @@ class AsyncCoreMemoryClient:
|
|
|
749
749
|
--------
|
|
750
750
|
import asyncio
|
|
751
751
|
|
|
752
|
-
from
|
|
752
|
+
from letta_client import AsyncLetta
|
|
753
753
|
|
|
754
754
|
client = AsyncLetta(
|
|
755
755
|
token="YOUR_TOKEN",
|
|
@@ -850,7 +850,7 @@ class AsyncCoreMemoryClient:
|
|
|
850
850
|
--------
|
|
851
851
|
import asyncio
|
|
852
852
|
|
|
853
|
-
from
|
|
853
|
+
from letta_client import AsyncLetta
|
|
854
854
|
|
|
855
855
|
client = AsyncLetta(
|
|
856
856
|
token="YOUR_TOKEN",
|
|
@@ -927,7 +927,7 @@ class AsyncCoreMemoryClient:
|
|
|
927
927
|
--------
|
|
928
928
|
import asyncio
|
|
929
929
|
|
|
930
|
-
from
|
|
930
|
+
from letta_client import AsyncLetta
|
|
931
931
|
|
|
932
932
|
client = AsyncLetta(
|
|
933
933
|
token="YOUR_TOKEN",
|
|
@@ -1023,7 +1023,7 @@ class AsyncCoreMemoryClient:
|
|
|
1023
1023
|
--------
|
|
1024
1024
|
import asyncio
|
|
1025
1025
|
|
|
1026
|
-
from
|
|
1026
|
+
from letta_client import AsyncLetta
|
|
1027
1027
|
|
|
1028
1028
|
client = AsyncLetta(
|
|
1029
1029
|
token="YOUR_TOKEN",
|
|
@@ -38,7 +38,7 @@ class MemoryVariablesClient:
|
|
|
38
38
|
|
|
39
39
|
Examples
|
|
40
40
|
--------
|
|
41
|
-
from
|
|
41
|
+
from letta_client import Letta
|
|
42
42
|
|
|
43
43
|
client = Letta(
|
|
44
44
|
token="YOUR_TOKEN",
|
|
@@ -105,7 +105,7 @@ class AsyncMemoryVariablesClient:
|
|
|
105
105
|
--------
|
|
106
106
|
import asyncio
|
|
107
107
|
|
|
108
|
-
from
|
|
108
|
+
from letta_client import AsyncLetta
|
|
109
109
|
|
|
110
110
|
client = AsyncLetta(
|
|
111
111
|
token="YOUR_TOKEN",
|