letta-client 0.1.4__py3-none-any.whl → 0.1.9__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.
- letta/__init__.py +44 -21
- letta/agents/__init__.py +71 -24
- letta/agents/archival_memory/client.py +17 -17
- letta/agents/client.py +424 -1700
- letta/agents/context/client.py +5 -5
- letta/agents/core_memory/client.py +1080 -0
- letta/agents/memory_variables/__init__.py +5 -0
- letta/agents/{memory → memory_variables}/client.py +41 -40
- letta/agents/memory_variables/types/__init__.py +5 -0
- letta/agents/{types/agents_get_agent_variables_response.py → memory_variables/types/memory_variables_get_response.py} +3 -3
- letta/agents/messages/__init__.py +36 -2
- letta/agents/messages/client.py +278 -17
- letta/agents/messages/types/__init__.py +37 -3
- letta/agents/messages/types/letta_streaming_response.py +139 -16
- letta/agents/messages/types/messages_list_response_item.py +121 -9
- letta/agents/recall_memory/client.py +5 -5
- letta/agents/sources/client.py +5 -5
- letta/agents/templates/__init__.py +5 -0
- letta/agents/templates/client.py +578 -0
- letta/agents/templates/types/__init__.py +5 -0
- letta/agents/templates/types/templates_migrate_response.py +19 -0
- letta/agents/tools/client.py +13 -13
- letta/agents/types/__init__.py +23 -29
- letta/agents/types/agents_search_request_combinator.py +5 -0
- letta/agents/types/agents_search_request_search_item.py +64 -0
- letta/agents/types/{agents_search_deployed_agents_request_search_item_zero.py → agents_search_request_search_item_name.py} +5 -4
- letta/agents/types/agents_search_request_search_item_name_operator.py +5 -0
- letta/agents/types/agents_search_request_search_item_order_by.py +22 -0
- letta/agents/types/agents_search_request_search_item_order_by_direction.py +5 -0
- letta/agents/types/agents_search_request_search_item_order_by_value.py +5 -0
- letta/agents/types/{agents_migrate_response.py → agents_search_request_search_item_version.py} +3 -3
- letta/blocks/client.py +25 -25
- letta/client.py +8 -4
- letta/core/__init__.py +4 -0
- letta/core/client_wrapper.py +7 -18
- letta/core/unchecked_base_model.py +305 -0
- letta/health/client.py +3 -3
- letta/jobs/client.py +17 -17
- letta/models/client.py +5 -5
- letta/providers/client.py +597 -0
- letta/sources/client.py +33 -33
- letta/sources/files/client.py +11 -11
- letta/sources/passages/client.py +5 -5
- letta/tools/client.py +77 -57
- letta/types/__init__.py +22 -0
- letta/types/action_model.py +2 -2
- letta/types/action_parameters_model.py +2 -2
- letta/types/action_response_model.py +2 -2
- letta/types/agent_environment_variable.py +63 -0
- letta/types/agent_state.py +19 -16
- letta/types/agent_type.py +1 -2
- letta/types/app_auth_scheme.py +2 -2
- letta/types/app_model.py +2 -2
- letta/types/archival_memory_summary.py +2 -2
- letta/types/assistant_file.py +2 -2
- letta/types/assistant_message_input.py +2 -2
- letta/types/assistant_message_output.py +3 -4
- letta/types/auth_request.py +2 -2
- letta/types/auth_response.py +2 -2
- letta/types/auth_scheme_field.py +2 -2
- letta/types/block.py +11 -16
- letta/types/block_update.py +2 -2
- letta/types/chat_completion_request.py +2 -2
- letta/types/chat_completion_response.py +2 -2
- letta/types/child_tool_rule.py +2 -2
- letta/types/choice.py +2 -2
- letta/types/conditional_tool_rule.py +2 -2
- letta/types/conflict_error_body.py +2 -2
- letta/types/context_window_overview.py +7 -2
- letta/types/create_assistant_file_request.py +2 -2
- letta/types/create_assistant_request.py +2 -2
- letta/types/create_block.py +2 -2
- letta/types/delete_assistant_file_response.py +2 -2
- letta/types/delete_assistant_response.py +2 -2
- letta/types/e_2_b_sandbox_config.py +2 -2
- letta/types/embedding_config.py +10 -10
- letta/types/file_metadata.py +2 -7
- letta/types/function_call_input.py +2 -2
- letta/types/function_call_output.py +2 -2
- letta/types/function_schema.py +2 -2
- letta/types/health.py +2 -2
- letta/types/http_validation_error.py +2 -2
- letta/types/init_tool_rule.py +2 -2
- letta/types/internal_server_error_body.py +2 -2
- letta/types/job.py +7 -12
- letta/types/letta_request.py +7 -2
- letta/types/letta_response.py +6 -5
- letta/types/letta_response_messages_item.py +125 -0
- letta/types/letta_schemas_letta_message_tool_call.py +2 -2
- letta/types/letta_schemas_message_message.py +12 -17
- letta/types/letta_schemas_openai_chat_completion_request_tool.py +2 -2
- letta/types/letta_schemas_openai_chat_completion_request_tool_call.py +2 -2
- letta/types/letta_schemas_openai_chat_completion_request_tool_call_function.py +2 -2
- letta/types/letta_schemas_openai_chat_completion_response_message.py +2 -2
- letta/types/letta_schemas_openai_chat_completion_response_tool_call.py +2 -2
- letta/types/letta_schemas_openai_chat_completions_tool_call_function.py +2 -2
- letta/types/letta_schemas_openai_chat_completions_tool_call_input.py +2 -2
- letta/types/letta_schemas_openai_chat_completions_tool_call_output.py +2 -2
- letta/types/letta_schemas_tool_tool.py +14 -13
- letta/types/letta_usage_statistics.py +6 -7
- letta/types/llm_config.py +9 -9
- letta/types/local_sandbox_config.py +2 -2
- letta/types/log_prob_token.py +2 -2
- letta/types/memory.py +2 -2
- letta/types/message_content_log_prob.py +2 -2
- letta/types/message_create.py +2 -2
- letta/types/not_found_error_body.py +2 -2
- letta/types/open_ai_assistant.py +2 -2
- letta/types/organization.py +2 -2
- letta/types/organization_create.py +2 -2
- letta/types/passage.py +10 -15
- letta/types/provider.py +38 -0
- letta/types/reasoning_message.py +6 -7
- letta/types/recall_memory_summary.py +2 -2
- letta/types/response_format.py +2 -2
- letta/types/sandbox_config.py +2 -7
- letta/types/sandbox_config_create.py +2 -2
- letta/types/sandbox_config_update.py +2 -2
- letta/types/sandbox_environment_variable.py +2 -7
- letta/types/sandbox_environment_variable_create.py +2 -2
- letta/types/sandbox_environment_variable_update.py +2 -6
- letta/types/source.py +8 -13
- letta/types/system_message_input.py +2 -2
- letta/types/system_message_output.py +6 -7
- letta/types/terminal_tool_rule.py +2 -2
- letta/types/tool_call_delta.py +2 -2
- letta/types/tool_call_function_output.py +2 -2
- letta/types/tool_call_message.py +6 -7
- letta/types/tool_create.py +2 -2
- letta/types/tool_function_choice.py +2 -2
- letta/types/tool_input.py +2 -2
- letta/types/tool_message.py +2 -2
- letta/types/tool_return_message.py +10 -11
- letta/types/tool_type.py +5 -0
- letta/types/usage_statistics.py +2 -2
- letta/types/user.py +5 -10
- letta/types/user_create.py +2 -7
- letta/types/user_message_input.py +2 -2
- letta/types/user_message_output.py +6 -7
- letta/types/user_update.py +2 -7
- letta/types/validation_error.py +2 -2
- {letta_client-0.1.4.dist-info → letta_client-0.1.9.dist-info}/METADATA +1 -1
- letta_client-0.1.9.dist-info/RECORD +200 -0
- 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/agents_search_deployed_agents_request_combinator.py +0 -5
- letta/agents/types/agents_search_deployed_agents_request_search_item.py +0 -16
- letta/agents/types/agents_search_deployed_agents_request_search_item_direction.py +0 -27
- letta/agents/types/agents_search_deployed_agents_request_search_item_direction_direction.py +0 -5
- letta/agents/types/agents_search_deployed_agents_request_search_item_direction_value.py +0 -7
- letta/agents/types/agents_search_deployed_agents_request_search_item_operator.py +0 -24
- letta/agents/types/agents_search_deployed_agents_request_search_item_operator_operator.py +0 -7
- letta_client-0.1.4.dist-info/RECORD +0 -191
- /letta/agents/{memory/messages → core_memory}/__init__.py +0 -0
- /letta/{agents/memory_blocks → providers}/__init__.py +0 -0
- {letta_client-0.1.4.dist-info → letta_client-0.1.9.dist-info}/WHEEL +0 -0
letta/agents/tools/client.py
CHANGED
|
@@ -5,7 +5,7 @@ import typing
|
|
|
5
5
|
from ...core.request_options import RequestOptions
|
|
6
6
|
from ...types.letta_schemas_tool_tool import LettaSchemasToolTool
|
|
7
7
|
from ...core.jsonable_encoder import jsonable_encoder
|
|
8
|
-
from ...core.
|
|
8
|
+
from ...core.unchecked_base_model import construct_type
|
|
9
9
|
from ...errors.unprocessable_entity_error import UnprocessableEntityError
|
|
10
10
|
from ...types.http_validation_error import HttpValidationError
|
|
11
11
|
from json.decoder import JSONDecodeError
|
|
@@ -56,7 +56,7 @@ class ToolsClient:
|
|
|
56
56
|
if 200 <= _response.status_code < 300:
|
|
57
57
|
return typing.cast(
|
|
58
58
|
typing.List[LettaSchemasToolTool],
|
|
59
|
-
|
|
59
|
+
construct_type(
|
|
60
60
|
type_=typing.List[LettaSchemasToolTool], # type: ignore
|
|
61
61
|
object_=_response.json(),
|
|
62
62
|
),
|
|
@@ -65,7 +65,7 @@ class ToolsClient:
|
|
|
65
65
|
raise UnprocessableEntityError(
|
|
66
66
|
typing.cast(
|
|
67
67
|
HttpValidationError,
|
|
68
|
-
|
|
68
|
+
construct_type(
|
|
69
69
|
type_=HttpValidationError, # type: ignore
|
|
70
70
|
object_=_response.json(),
|
|
71
71
|
),
|
|
@@ -117,7 +117,7 @@ class ToolsClient:
|
|
|
117
117
|
if 200 <= _response.status_code < 300:
|
|
118
118
|
return typing.cast(
|
|
119
119
|
AgentState,
|
|
120
|
-
|
|
120
|
+
construct_type(
|
|
121
121
|
type_=AgentState, # type: ignore
|
|
122
122
|
object_=_response.json(),
|
|
123
123
|
),
|
|
@@ -126,7 +126,7 @@ class ToolsClient:
|
|
|
126
126
|
raise UnprocessableEntityError(
|
|
127
127
|
typing.cast(
|
|
128
128
|
HttpValidationError,
|
|
129
|
-
|
|
129
|
+
construct_type(
|
|
130
130
|
type_=HttpValidationError, # type: ignore
|
|
131
131
|
object_=_response.json(),
|
|
132
132
|
),
|
|
@@ -178,7 +178,7 @@ class ToolsClient:
|
|
|
178
178
|
if 200 <= _response.status_code < 300:
|
|
179
179
|
return typing.cast(
|
|
180
180
|
AgentState,
|
|
181
|
-
|
|
181
|
+
construct_type(
|
|
182
182
|
type_=AgentState, # type: ignore
|
|
183
183
|
object_=_response.json(),
|
|
184
184
|
),
|
|
@@ -187,7 +187,7 @@ class ToolsClient:
|
|
|
187
187
|
raise UnprocessableEntityError(
|
|
188
188
|
typing.cast(
|
|
189
189
|
HttpValidationError,
|
|
190
|
-
|
|
190
|
+
construct_type(
|
|
191
191
|
type_=HttpValidationError, # type: ignore
|
|
192
192
|
object_=_response.json(),
|
|
193
193
|
),
|
|
@@ -249,7 +249,7 @@ class AsyncToolsClient:
|
|
|
249
249
|
if 200 <= _response.status_code < 300:
|
|
250
250
|
return typing.cast(
|
|
251
251
|
typing.List[LettaSchemasToolTool],
|
|
252
|
-
|
|
252
|
+
construct_type(
|
|
253
253
|
type_=typing.List[LettaSchemasToolTool], # type: ignore
|
|
254
254
|
object_=_response.json(),
|
|
255
255
|
),
|
|
@@ -258,7 +258,7 @@ class AsyncToolsClient:
|
|
|
258
258
|
raise UnprocessableEntityError(
|
|
259
259
|
typing.cast(
|
|
260
260
|
HttpValidationError,
|
|
261
|
-
|
|
261
|
+
construct_type(
|
|
262
262
|
type_=HttpValidationError, # type: ignore
|
|
263
263
|
object_=_response.json(),
|
|
264
264
|
),
|
|
@@ -318,7 +318,7 @@ class AsyncToolsClient:
|
|
|
318
318
|
if 200 <= _response.status_code < 300:
|
|
319
319
|
return typing.cast(
|
|
320
320
|
AgentState,
|
|
321
|
-
|
|
321
|
+
construct_type(
|
|
322
322
|
type_=AgentState, # type: ignore
|
|
323
323
|
object_=_response.json(),
|
|
324
324
|
),
|
|
@@ -327,7 +327,7 @@ class AsyncToolsClient:
|
|
|
327
327
|
raise UnprocessableEntityError(
|
|
328
328
|
typing.cast(
|
|
329
329
|
HttpValidationError,
|
|
330
|
-
|
|
330
|
+
construct_type(
|
|
331
331
|
type_=HttpValidationError, # type: ignore
|
|
332
332
|
object_=_response.json(),
|
|
333
333
|
),
|
|
@@ -387,7 +387,7 @@ class AsyncToolsClient:
|
|
|
387
387
|
if 200 <= _response.status_code < 300:
|
|
388
388
|
return typing.cast(
|
|
389
389
|
AgentState,
|
|
390
|
-
|
|
390
|
+
construct_type(
|
|
391
391
|
type_=AgentState, # type: ignore
|
|
392
392
|
object_=_response.json(),
|
|
393
393
|
),
|
|
@@ -396,7 +396,7 @@ class AsyncToolsClient:
|
|
|
396
396
|
raise UnprocessableEntityError(
|
|
397
397
|
typing.cast(
|
|
398
398
|
HttpValidationError,
|
|
399
|
-
|
|
399
|
+
construct_type(
|
|
400
400
|
type_=HttpValidationError, # type: ignore
|
|
401
401
|
object_=_response.json(),
|
|
402
402
|
),
|
letta/agents/types/__init__.py
CHANGED
|
@@ -1,39 +1,33 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
from .
|
|
4
|
-
from .
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
from .agents_search_request_combinator import AgentsSearchRequestCombinator
|
|
4
|
+
from .agents_search_request_search_item import (
|
|
5
|
+
AgentsSearchRequestSearchItem,
|
|
6
|
+
AgentsSearchRequestSearchItem_Name,
|
|
7
|
+
AgentsSearchRequestSearchItem_OrderBy,
|
|
8
|
+
AgentsSearchRequestSearchItem_Version,
|
|
9
9
|
)
|
|
10
|
-
from .
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
from .
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
from .agents_search_deployed_agents_request_search_item_operator import (
|
|
17
|
-
AgentsSearchDeployedAgentsRequestSearchItemOperator,
|
|
18
|
-
)
|
|
19
|
-
from .agents_search_deployed_agents_request_search_item_operator_operator import (
|
|
20
|
-
AgentsSearchDeployedAgentsRequestSearchItemOperatorOperator,
|
|
21
|
-
)
|
|
22
|
-
from .agents_search_deployed_agents_request_search_item_zero import AgentsSearchDeployedAgentsRequestSearchItemZero
|
|
10
|
+
from .agents_search_request_search_item_name import AgentsSearchRequestSearchItemName
|
|
11
|
+
from .agents_search_request_search_item_name_operator import AgentsSearchRequestSearchItemNameOperator
|
|
12
|
+
from .agents_search_request_search_item_order_by import AgentsSearchRequestSearchItemOrderBy
|
|
13
|
+
from .agents_search_request_search_item_order_by_direction import AgentsSearchRequestSearchItemOrderByDirection
|
|
14
|
+
from .agents_search_request_search_item_order_by_value import AgentsSearchRequestSearchItemOrderByValue
|
|
15
|
+
from .agents_search_request_search_item_version import AgentsSearchRequestSearchItemVersion
|
|
23
16
|
from .create_agent_request_tool_rules_item import CreateAgentRequestToolRulesItem
|
|
24
17
|
from .update_agent_tool_rules_item import UpdateAgentToolRulesItem
|
|
25
18
|
|
|
26
19
|
__all__ = [
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
20
|
+
"AgentsSearchRequestCombinator",
|
|
21
|
+
"AgentsSearchRequestSearchItem",
|
|
22
|
+
"AgentsSearchRequestSearchItemName",
|
|
23
|
+
"AgentsSearchRequestSearchItemNameOperator",
|
|
24
|
+
"AgentsSearchRequestSearchItemOrderBy",
|
|
25
|
+
"AgentsSearchRequestSearchItemOrderByDirection",
|
|
26
|
+
"AgentsSearchRequestSearchItemOrderByValue",
|
|
27
|
+
"AgentsSearchRequestSearchItemVersion",
|
|
28
|
+
"AgentsSearchRequestSearchItem_Name",
|
|
29
|
+
"AgentsSearchRequestSearchItem_OrderBy",
|
|
30
|
+
"AgentsSearchRequestSearchItem_Version",
|
|
37
31
|
"CreateAgentRequestToolRulesItem",
|
|
38
32
|
"UpdateAgentToolRulesItem",
|
|
39
33
|
]
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from ...core.unchecked_base_model import UncheckedBaseModel
|
|
5
|
+
import typing
|
|
6
|
+
from ...core.pydantic_utilities import IS_PYDANTIC_V2
|
|
7
|
+
import pydantic
|
|
8
|
+
from .agents_search_request_search_item_name_operator import AgentsSearchRequestSearchItemNameOperator
|
|
9
|
+
from .agents_search_request_search_item_order_by_value import AgentsSearchRequestSearchItemOrderByValue
|
|
10
|
+
from .agents_search_request_search_item_order_by_direction import AgentsSearchRequestSearchItemOrderByDirection
|
|
11
|
+
import typing_extensions
|
|
12
|
+
from ...core.unchecked_base_model import UnionMetadata
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class AgentsSearchRequestSearchItem_Version(UncheckedBaseModel):
|
|
16
|
+
field: typing.Literal["version"] = "version"
|
|
17
|
+
value: str
|
|
18
|
+
|
|
19
|
+
if IS_PYDANTIC_V2:
|
|
20
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
21
|
+
else:
|
|
22
|
+
|
|
23
|
+
class Config:
|
|
24
|
+
frozen = True
|
|
25
|
+
smart_union = True
|
|
26
|
+
extra = pydantic.Extra.allow
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class AgentsSearchRequestSearchItem_Name(UncheckedBaseModel):
|
|
30
|
+
field: typing.Literal["name"] = "name"
|
|
31
|
+
operator: AgentsSearchRequestSearchItemNameOperator
|
|
32
|
+
value: str
|
|
33
|
+
|
|
34
|
+
if IS_PYDANTIC_V2:
|
|
35
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
36
|
+
else:
|
|
37
|
+
|
|
38
|
+
class Config:
|
|
39
|
+
frozen = True
|
|
40
|
+
smart_union = True
|
|
41
|
+
extra = pydantic.Extra.allow
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
class AgentsSearchRequestSearchItem_OrderBy(UncheckedBaseModel):
|
|
45
|
+
field: typing.Literal["order_by"] = "order_by"
|
|
46
|
+
value: AgentsSearchRequestSearchItemOrderByValue
|
|
47
|
+
direction: AgentsSearchRequestSearchItemOrderByDirection
|
|
48
|
+
|
|
49
|
+
if IS_PYDANTIC_V2:
|
|
50
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
51
|
+
else:
|
|
52
|
+
|
|
53
|
+
class Config:
|
|
54
|
+
frozen = True
|
|
55
|
+
smart_union = True
|
|
56
|
+
extra = pydantic.Extra.allow
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
AgentsSearchRequestSearchItem = typing_extensions.Annotated[
|
|
60
|
+
typing.Union[
|
|
61
|
+
AgentsSearchRequestSearchItem_Version, AgentsSearchRequestSearchItem_Name, AgentsSearchRequestSearchItem_OrderBy
|
|
62
|
+
],
|
|
63
|
+
UnionMetadata(discriminant="field"),
|
|
64
|
+
]
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
from ...core.
|
|
4
|
-
import
|
|
3
|
+
from ...core.unchecked_base_model import UncheckedBaseModel
|
|
4
|
+
from .agents_search_request_search_item_name_operator import AgentsSearchRequestSearchItemNameOperator
|
|
5
5
|
from ...core.pydantic_utilities import IS_PYDANTIC_V2
|
|
6
|
+
import typing
|
|
6
7
|
import pydantic
|
|
7
8
|
|
|
8
9
|
|
|
9
|
-
class
|
|
10
|
-
|
|
10
|
+
class AgentsSearchRequestSearchItemName(UncheckedBaseModel):
|
|
11
|
+
operator: AgentsSearchRequestSearchItemNameOperator
|
|
11
12
|
value: str
|
|
12
13
|
|
|
13
14
|
if IS_PYDANTIC_V2:
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from ...core.unchecked_base_model import UncheckedBaseModel
|
|
4
|
+
from .agents_search_request_search_item_order_by_value import AgentsSearchRequestSearchItemOrderByValue
|
|
5
|
+
from .agents_search_request_search_item_order_by_direction import AgentsSearchRequestSearchItemOrderByDirection
|
|
6
|
+
from ...core.pydantic_utilities import IS_PYDANTIC_V2
|
|
7
|
+
import typing
|
|
8
|
+
import pydantic
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class AgentsSearchRequestSearchItemOrderBy(UncheckedBaseModel):
|
|
12
|
+
value: AgentsSearchRequestSearchItemOrderByValue
|
|
13
|
+
direction: AgentsSearchRequestSearchItemOrderByDirection
|
|
14
|
+
|
|
15
|
+
if IS_PYDANTIC_V2:
|
|
16
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
17
|
+
else:
|
|
18
|
+
|
|
19
|
+
class Config:
|
|
20
|
+
frozen = True
|
|
21
|
+
smart_union = True
|
|
22
|
+
extra = pydantic.Extra.allow
|
letta/agents/types/{agents_migrate_response.py → agents_search_request_search_item_version.py}
RENAMED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
from ...core.
|
|
3
|
+
from ...core.unchecked_base_model import UncheckedBaseModel
|
|
4
4
|
from ...core.pydantic_utilities import IS_PYDANTIC_V2
|
|
5
5
|
import typing
|
|
6
6
|
import pydantic
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
class
|
|
10
|
-
|
|
9
|
+
class AgentsSearchRequestSearchItemVersion(UncheckedBaseModel):
|
|
10
|
+
value: str
|
|
11
11
|
|
|
12
12
|
if IS_PYDANTIC_V2:
|
|
13
13
|
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
letta/blocks/client.py
CHANGED
|
@@ -4,7 +4,7 @@ import typing
|
|
|
4
4
|
from ..core.client_wrapper import SyncClientWrapper
|
|
5
5
|
from ..core.request_options import RequestOptions
|
|
6
6
|
from ..types.block import Block
|
|
7
|
-
from ..core.
|
|
7
|
+
from ..core.unchecked_base_model import construct_type
|
|
8
8
|
from ..errors.unprocessable_entity_error import UnprocessableEntityError
|
|
9
9
|
from ..types.http_validation_error import HttpValidationError
|
|
10
10
|
from json.decoder import JSONDecodeError
|
|
@@ -71,7 +71,7 @@ class BlocksClient:
|
|
|
71
71
|
if 200 <= _response.status_code < 300:
|
|
72
72
|
return typing.cast(
|
|
73
73
|
typing.List[Block],
|
|
74
|
-
|
|
74
|
+
construct_type(
|
|
75
75
|
type_=typing.List[Block], # type: ignore
|
|
76
76
|
object_=_response.json(),
|
|
77
77
|
),
|
|
@@ -80,7 +80,7 @@ class BlocksClient:
|
|
|
80
80
|
raise UnprocessableEntityError(
|
|
81
81
|
typing.cast(
|
|
82
82
|
HttpValidationError,
|
|
83
|
-
|
|
83
|
+
construct_type(
|
|
84
84
|
type_=HttpValidationError, # type: ignore
|
|
85
85
|
object_=_response.json(),
|
|
86
86
|
),
|
|
@@ -165,7 +165,7 @@ class BlocksClient:
|
|
|
165
165
|
if 200 <= _response.status_code < 300:
|
|
166
166
|
return typing.cast(
|
|
167
167
|
Block,
|
|
168
|
-
|
|
168
|
+
construct_type(
|
|
169
169
|
type_=Block, # type: ignore
|
|
170
170
|
object_=_response.json(),
|
|
171
171
|
),
|
|
@@ -174,7 +174,7 @@ class BlocksClient:
|
|
|
174
174
|
raise UnprocessableEntityError(
|
|
175
175
|
typing.cast(
|
|
176
176
|
HttpValidationError,
|
|
177
|
-
|
|
177
|
+
construct_type(
|
|
178
178
|
type_=HttpValidationError, # type: ignore
|
|
179
179
|
object_=_response.json(),
|
|
180
180
|
),
|
|
@@ -219,7 +219,7 @@ class BlocksClient:
|
|
|
219
219
|
if 200 <= _response.status_code < 300:
|
|
220
220
|
return typing.cast(
|
|
221
221
|
Block,
|
|
222
|
-
|
|
222
|
+
construct_type(
|
|
223
223
|
type_=Block, # type: ignore
|
|
224
224
|
object_=_response.json(),
|
|
225
225
|
),
|
|
@@ -228,7 +228,7 @@ class BlocksClient:
|
|
|
228
228
|
raise UnprocessableEntityError(
|
|
229
229
|
typing.cast(
|
|
230
230
|
HttpValidationError,
|
|
231
|
-
|
|
231
|
+
construct_type(
|
|
232
232
|
type_=HttpValidationError, # type: ignore
|
|
233
233
|
object_=_response.json(),
|
|
234
234
|
),
|
|
@@ -273,7 +273,7 @@ class BlocksClient:
|
|
|
273
273
|
if 200 <= _response.status_code < 300:
|
|
274
274
|
return typing.cast(
|
|
275
275
|
Block,
|
|
276
|
-
|
|
276
|
+
construct_type(
|
|
277
277
|
type_=Block, # type: ignore
|
|
278
278
|
object_=_response.json(),
|
|
279
279
|
),
|
|
@@ -282,7 +282,7 @@ class BlocksClient:
|
|
|
282
282
|
raise UnprocessableEntityError(
|
|
283
283
|
typing.cast(
|
|
284
284
|
HttpValidationError,
|
|
285
|
-
|
|
285
|
+
construct_type(
|
|
286
286
|
type_=HttpValidationError, # type: ignore
|
|
287
287
|
object_=_response.json(),
|
|
288
288
|
),
|
|
@@ -370,7 +370,7 @@ class BlocksClient:
|
|
|
370
370
|
if 200 <= _response.status_code < 300:
|
|
371
371
|
return typing.cast(
|
|
372
372
|
Block,
|
|
373
|
-
|
|
373
|
+
construct_type(
|
|
374
374
|
type_=Block, # type: ignore
|
|
375
375
|
object_=_response.json(),
|
|
376
376
|
),
|
|
@@ -379,7 +379,7 @@ class BlocksClient:
|
|
|
379
379
|
raise UnprocessableEntityError(
|
|
380
380
|
typing.cast(
|
|
381
381
|
HttpValidationError,
|
|
382
|
-
|
|
382
|
+
construct_type(
|
|
383
383
|
type_=HttpValidationError, # type: ignore
|
|
384
384
|
object_=_response.json(),
|
|
385
385
|
),
|
|
@@ -437,7 +437,7 @@ class BlocksClient:
|
|
|
437
437
|
raise UnprocessableEntityError(
|
|
438
438
|
typing.cast(
|
|
439
439
|
HttpValidationError,
|
|
440
|
-
|
|
440
|
+
construct_type(
|
|
441
441
|
type_=HttpValidationError, # type: ignore
|
|
442
442
|
object_=_response.json(),
|
|
443
443
|
),
|
|
@@ -495,7 +495,7 @@ class BlocksClient:
|
|
|
495
495
|
raise UnprocessableEntityError(
|
|
496
496
|
typing.cast(
|
|
497
497
|
HttpValidationError,
|
|
498
|
-
|
|
498
|
+
construct_type(
|
|
499
499
|
type_=HttpValidationError, # type: ignore
|
|
500
500
|
object_=_response.json(),
|
|
501
501
|
),
|
|
@@ -570,7 +570,7 @@ class AsyncBlocksClient:
|
|
|
570
570
|
if 200 <= _response.status_code < 300:
|
|
571
571
|
return typing.cast(
|
|
572
572
|
typing.List[Block],
|
|
573
|
-
|
|
573
|
+
construct_type(
|
|
574
574
|
type_=typing.List[Block], # type: ignore
|
|
575
575
|
object_=_response.json(),
|
|
576
576
|
),
|
|
@@ -579,7 +579,7 @@ class AsyncBlocksClient:
|
|
|
579
579
|
raise UnprocessableEntityError(
|
|
580
580
|
typing.cast(
|
|
581
581
|
HttpValidationError,
|
|
582
|
-
|
|
582
|
+
construct_type(
|
|
583
583
|
type_=HttpValidationError, # type: ignore
|
|
584
584
|
object_=_response.json(),
|
|
585
585
|
),
|
|
@@ -672,7 +672,7 @@ class AsyncBlocksClient:
|
|
|
672
672
|
if 200 <= _response.status_code < 300:
|
|
673
673
|
return typing.cast(
|
|
674
674
|
Block,
|
|
675
|
-
|
|
675
|
+
construct_type(
|
|
676
676
|
type_=Block, # type: ignore
|
|
677
677
|
object_=_response.json(),
|
|
678
678
|
),
|
|
@@ -681,7 +681,7 @@ class AsyncBlocksClient:
|
|
|
681
681
|
raise UnprocessableEntityError(
|
|
682
682
|
typing.cast(
|
|
683
683
|
HttpValidationError,
|
|
684
|
-
|
|
684
|
+
construct_type(
|
|
685
685
|
type_=HttpValidationError, # type: ignore
|
|
686
686
|
object_=_response.json(),
|
|
687
687
|
),
|
|
@@ -734,7 +734,7 @@ class AsyncBlocksClient:
|
|
|
734
734
|
if 200 <= _response.status_code < 300:
|
|
735
735
|
return typing.cast(
|
|
736
736
|
Block,
|
|
737
|
-
|
|
737
|
+
construct_type(
|
|
738
738
|
type_=Block, # type: ignore
|
|
739
739
|
object_=_response.json(),
|
|
740
740
|
),
|
|
@@ -743,7 +743,7 @@ class AsyncBlocksClient:
|
|
|
743
743
|
raise UnprocessableEntityError(
|
|
744
744
|
typing.cast(
|
|
745
745
|
HttpValidationError,
|
|
746
|
-
|
|
746
|
+
construct_type(
|
|
747
747
|
type_=HttpValidationError, # type: ignore
|
|
748
748
|
object_=_response.json(),
|
|
749
749
|
),
|
|
@@ -796,7 +796,7 @@ class AsyncBlocksClient:
|
|
|
796
796
|
if 200 <= _response.status_code < 300:
|
|
797
797
|
return typing.cast(
|
|
798
798
|
Block,
|
|
799
|
-
|
|
799
|
+
construct_type(
|
|
800
800
|
type_=Block, # type: ignore
|
|
801
801
|
object_=_response.json(),
|
|
802
802
|
),
|
|
@@ -805,7 +805,7 @@ class AsyncBlocksClient:
|
|
|
805
805
|
raise UnprocessableEntityError(
|
|
806
806
|
typing.cast(
|
|
807
807
|
HttpValidationError,
|
|
808
|
-
|
|
808
|
+
construct_type(
|
|
809
809
|
type_=HttpValidationError, # type: ignore
|
|
810
810
|
object_=_response.json(),
|
|
811
811
|
),
|
|
@@ -901,7 +901,7 @@ class AsyncBlocksClient:
|
|
|
901
901
|
if 200 <= _response.status_code < 300:
|
|
902
902
|
return typing.cast(
|
|
903
903
|
Block,
|
|
904
|
-
|
|
904
|
+
construct_type(
|
|
905
905
|
type_=Block, # type: ignore
|
|
906
906
|
object_=_response.json(),
|
|
907
907
|
),
|
|
@@ -910,7 +910,7 @@ class AsyncBlocksClient:
|
|
|
910
910
|
raise UnprocessableEntityError(
|
|
911
911
|
typing.cast(
|
|
912
912
|
HttpValidationError,
|
|
913
|
-
|
|
913
|
+
construct_type(
|
|
914
914
|
type_=HttpValidationError, # type: ignore
|
|
915
915
|
object_=_response.json(),
|
|
916
916
|
),
|
|
@@ -976,7 +976,7 @@ class AsyncBlocksClient:
|
|
|
976
976
|
raise UnprocessableEntityError(
|
|
977
977
|
typing.cast(
|
|
978
978
|
HttpValidationError,
|
|
979
|
-
|
|
979
|
+
construct_type(
|
|
980
980
|
type_=HttpValidationError, # type: ignore
|
|
981
981
|
object_=_response.json(),
|
|
982
982
|
),
|
|
@@ -1042,7 +1042,7 @@ class AsyncBlocksClient:
|
|
|
1042
1042
|
raise UnprocessableEntityError(
|
|
1043
1043
|
typing.cast(
|
|
1044
1044
|
HttpValidationError,
|
|
1045
|
-
|
|
1045
|
+
construct_type(
|
|
1046
1046
|
type_=HttpValidationError, # type: ignore
|
|
1047
1047
|
object_=_response.json(),
|
|
1048
1048
|
),
|
letta/client.py
CHANGED
|
@@ -11,6 +11,7 @@ from .models.client import ModelsClient
|
|
|
11
11
|
from .blocks.client import BlocksClient
|
|
12
12
|
from .jobs.client import JobsClient
|
|
13
13
|
from .health.client import HealthClient
|
|
14
|
+
from .providers.client import ProvidersClient
|
|
14
15
|
from .core.client_wrapper import AsyncClientWrapper
|
|
15
16
|
from .tools.client import AsyncToolsClient
|
|
16
17
|
from .sources.client import AsyncSourcesClient
|
|
@@ -19,6 +20,7 @@ from .models.client import AsyncModelsClient
|
|
|
19
20
|
from .blocks.client import AsyncBlocksClient
|
|
20
21
|
from .jobs.client import AsyncJobsClient
|
|
21
22
|
from .health.client import AsyncHealthClient
|
|
23
|
+
from .providers.client import AsyncProvidersClient
|
|
22
24
|
|
|
23
25
|
|
|
24
26
|
class Letta:
|
|
@@ -39,7 +41,7 @@ class Letta:
|
|
|
39
41
|
|
|
40
42
|
|
|
41
43
|
|
|
42
|
-
token : typing.
|
|
44
|
+
token : typing.Optional[str]
|
|
43
45
|
timeout : typing.Optional[float]
|
|
44
46
|
The timeout to be used, in seconds, for requests. By default the timeout is 60 seconds, unless a custom httpx client is used, in which case this default is not enforced.
|
|
45
47
|
|
|
@@ -63,7 +65,7 @@ class Letta:
|
|
|
63
65
|
*,
|
|
64
66
|
base_url: typing.Optional[str] = None,
|
|
65
67
|
environment: LettaEnvironment = LettaEnvironment.LETTA_CLOUD,
|
|
66
|
-
token: typing.
|
|
68
|
+
token: typing.Optional[str] = None,
|
|
67
69
|
timeout: typing.Optional[float] = None,
|
|
68
70
|
follow_redirects: typing.Optional[bool] = True,
|
|
69
71
|
httpx_client: typing.Optional[httpx.Client] = None,
|
|
@@ -86,6 +88,7 @@ class Letta:
|
|
|
86
88
|
self.blocks = BlocksClient(client_wrapper=self._client_wrapper)
|
|
87
89
|
self.jobs = JobsClient(client_wrapper=self._client_wrapper)
|
|
88
90
|
self.health = HealthClient(client_wrapper=self._client_wrapper)
|
|
91
|
+
self.providers = ProvidersClient(client_wrapper=self._client_wrapper)
|
|
89
92
|
|
|
90
93
|
|
|
91
94
|
class AsyncLetta:
|
|
@@ -106,7 +109,7 @@ class AsyncLetta:
|
|
|
106
109
|
|
|
107
110
|
|
|
108
111
|
|
|
109
|
-
token : typing.
|
|
112
|
+
token : typing.Optional[str]
|
|
110
113
|
timeout : typing.Optional[float]
|
|
111
114
|
The timeout to be used, in seconds, for requests. By default the timeout is 60 seconds, unless a custom httpx client is used, in which case this default is not enforced.
|
|
112
115
|
|
|
@@ -130,7 +133,7 @@ class AsyncLetta:
|
|
|
130
133
|
*,
|
|
131
134
|
base_url: typing.Optional[str] = None,
|
|
132
135
|
environment: LettaEnvironment = LettaEnvironment.LETTA_CLOUD,
|
|
133
|
-
token: typing.
|
|
136
|
+
token: typing.Optional[str] = None,
|
|
134
137
|
timeout: typing.Optional[float] = None,
|
|
135
138
|
follow_redirects: typing.Optional[bool] = True,
|
|
136
139
|
httpx_client: typing.Optional[httpx.AsyncClient] = None,
|
|
@@ -153,6 +156,7 @@ class AsyncLetta:
|
|
|
153
156
|
self.blocks = AsyncBlocksClient(client_wrapper=self._client_wrapper)
|
|
154
157
|
self.jobs = AsyncJobsClient(client_wrapper=self._client_wrapper)
|
|
155
158
|
self.health = AsyncHealthClient(client_wrapper=self._client_wrapper)
|
|
159
|
+
self.providers = AsyncProvidersClient(client_wrapper=self._client_wrapper)
|
|
156
160
|
|
|
157
161
|
|
|
158
162
|
def _get_base_url(*, base_url: typing.Optional[str] = None, environment: LettaEnvironment) -> str:
|
letta/core/__init__.py
CHANGED
|
@@ -19,6 +19,7 @@ from .query_encoder import encode_query
|
|
|
19
19
|
from .remove_none_from_dict import remove_none_from_dict
|
|
20
20
|
from .request_options import RequestOptions
|
|
21
21
|
from .serialization import FieldMetadata, convert_and_respect_annotation_metadata
|
|
22
|
+
from .unchecked_base_model import UncheckedBaseModel, UnionMetadata, construct_type
|
|
22
23
|
|
|
23
24
|
__all__ = [
|
|
24
25
|
"ApiError",
|
|
@@ -31,8 +32,11 @@ __all__ = [
|
|
|
31
32
|
"IS_PYDANTIC_V2",
|
|
32
33
|
"RequestOptions",
|
|
33
34
|
"SyncClientWrapper",
|
|
35
|
+
"UncheckedBaseModel",
|
|
36
|
+
"UnionMetadata",
|
|
34
37
|
"UniversalBaseModel",
|
|
35
38
|
"UniversalRootModel",
|
|
39
|
+
"construct_type",
|
|
36
40
|
"convert_and_respect_annotation_metadata",
|
|
37
41
|
"convert_file_dict_to_httpx_tuples",
|
|
38
42
|
"encode_query",
|