letta-client 1.0.0a6__py3-none-any.whl → 1.0.0a8__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_sdk → letta_client}/__init__.py +8 -8
- {letta_sdk → letta_client}/_base_client.py +1 -1
- {letta_sdk → letta_client}/_client.py +124 -171
- {letta_sdk → letta_client}/_exceptions.py +2 -2
- {letta_sdk → letta_client}/_resource.py +5 -5
- {letta_sdk → letta_client}/_response.py +8 -6
- {letta_sdk → letta_client}/_streaming.py +3 -3
- {letta_sdk → letta_client}/_types.py +1 -1
- {letta_sdk → letta_client}/_utils/_logs.py +3 -3
- {letta_sdk → letta_client}/_utils/_resources_proxy.py +4 -4
- {letta_sdk → letta_client}/_version.py +2 -2
- letta_client/pagination.py +107 -0
- {letta_sdk → letta_client}/resources/__init__.py +14 -154
- {letta_sdk → letta_client}/resources/agents/__init__.py +28 -42
- {letta_sdk → letta_client}/resources/agents/agents.py +228 -744
- {letta_sdk/resources/agents/core_memory → letta_client/resources/agents}/blocks.py +112 -19
- {letta_sdk → letta_client}/resources/agents/files.py +71 -8
- {letta_sdk → letta_client}/resources/agents/folders.py +101 -11
- letta_client/resources/agents/groups.py +245 -0
- {letta_sdk → letta_client}/resources/agents/messages.py +265 -490
- {letta_sdk → letta_client}/resources/agents/tools.py +147 -31
- letta_sdk/resources/jobs.py → letta_client/resources/archives.py +268 -280
- {letta_sdk/resources/messages → letta_client/resources/batches}/batches.py +46 -161
- letta_client/resources/batches/messages.py +238 -0
- {letta_sdk/resources/agents/core_memory → letta_client/resources/blocks}/__init__.py +14 -14
- letta_client/resources/blocks/agents.py +287 -0
- {letta_sdk/resources → letta_client/resources/blocks}/blocks.py +64 -175
- letta_client/resources/folders/__init__.py +47 -0
- letta_client/resources/folders/agents.py +237 -0
- letta_client/resources/folders/files.py +472 -0
- letta_sdk/resources/providers.py → letta_client/resources/folders/folders.py +298 -313
- {letta_sdk → letta_client}/resources/groups/groups.py +24 -88
- {letta_sdk → letta_client}/resources/groups/messages.py +178 -37
- letta_client/resources/identities/__init__.py +61 -0
- letta_client/resources/identities/agents.py +269 -0
- letta_client/resources/identities/blocks.py +237 -0
- {letta_sdk/resources → letta_client/resources/identities}/identities.py +277 -533
- letta_client/resources/identities/properties.py +174 -0
- letta_client/resources/models/__init__.py +33 -0
- {letta_sdk/resources → letta_client/resources/models}/embeddings.py +26 -49
- {letta_sdk/resources → letta_client/resources/models}/models.py +42 -117
- letta_client/resources/runs/__init__.py +61 -0
- letta_sdk/resources/archives.py → letta_client/resources/runs/messages.py +189 -157
- letta_client/resources/runs/runs.py +462 -0
- letta_client/resources/runs/steps.py +229 -0
- letta_sdk/resources/voice_beta/chat.py → letta_client/resources/runs/usage.py +50 -57
- letta_client/resources/steps/__init__.py +75 -0
- letta_client/resources/steps/feedback.py +198 -0
- letta_client/resources/steps/messages.py +237 -0
- letta_client/resources/steps/metrics.py +167 -0
- letta_client/resources/steps/steps.py +513 -0
- letta_sdk/resources/telemetry.py → letta_client/resources/steps/trace.py +45 -56
- {letta_sdk → letta_client}/resources/tags.py +13 -10
- letta_client/resources/templates/__init__.py +33 -0
- letta_client/resources/templates/agents.py +236 -0
- letta_client/resources/templates/templates.py +102 -0
- {letta_sdk/resources/tools → letta_client/resources}/tools.py +249 -433
- letta_client/types/__init__.py +111 -0
- {letta_sdk → letta_client}/types/agent_create_params.py +5 -2
- {letta_sdk → letta_client}/types/agent_environment_variable.py +3 -0
- letta_client/types/agent_export_file_params.py +18 -0
- letta_sdk/types/agent_export_response.py → letta_client/types/agent_export_file_response.py +2 -2
- letta_sdk/types/agent_import_params.py → letta_client/types/agent_import_file_params.py +5 -2
- letta_sdk/types/agent_import_response.py → letta_client/types/agent_import_file_response.py +2 -2
- {letta_sdk → letta_client}/types/agent_list_params.py +19 -2
- {letta_sdk → letta_client}/types/agent_retrieve_params.py +20 -3
- {letta_sdk → letta_client}/types/agent_state.py +131 -3
- {letta_sdk → letta_client}/types/agent_type.py +1 -0
- {letta_sdk → letta_client}/types/agent_update_params.py +12 -0
- {letta_sdk → letta_client}/types/agents/__init__.py +10 -21
- letta_client/types/agents/approval_create_param.py +44 -0
- {letta_sdk → letta_client}/types/agents/approval_request_message.py +10 -2
- letta_client/types/agents/approval_response_message.py +63 -0
- {letta_sdk/types/agents/core_memory → letta_client/types/agents}/block.py +1 -1
- letta_sdk/types/identity_list_blocks_params.py → letta_client/types/agents/block_list_params.py +2 -2
- {letta_sdk/types/agents/core_memory → letta_client/types/agents}/block_update_params.py +1 -0
- letta_client/types/agents/file_list_params.py +40 -0
- letta_client/types/agents/folder_list_params.py +34 -0
- letta_sdk/types/source.py → letta_client/types/agents/folder_list_response.py +5 -5
- letta_client/types/agents/group_list_params.py +37 -0
- {letta_sdk → letta_client}/types/agents/letta_assistant_message_content_union.py +3 -0
- {letta_sdk → letta_client}/types/agents/letta_assistant_message_content_union_param.py +4 -0
- {letta_sdk → letta_client}/types/agents/letta_response.py +0 -4
- {letta_sdk → letta_client}/types/agents/message.py +93 -2
- {letta_sdk → letta_client}/types/agents/message_list_params.py +20 -5
- letta_sdk/types/agent_reset_messages_params.py → letta_client/types/agents/message_reset_params.py +2 -2
- {letta_sdk → letta_client}/types/agents/message_send_async_params.py +12 -3
- {letta_sdk → letta_client}/types/agents/message_send_params.py +12 -3
- letta_sdk/types/agents/message_send_stream_params.py → letta_client/types/agents/message_stream_params.py +14 -5
- {letta_sdk → letta_client}/types/agents/message_update_params.py +4 -0
- {letta_sdk → letta_client}/types/agents/omitted_reasoning_content.py +3 -0
- {letta_sdk → letta_client}/types/agents/omitted_reasoning_content_param.py +4 -0
- {letta_sdk → letta_client}/types/agents/run.py +16 -19
- {letta_sdk → letta_client}/types/agents/text_content.py +3 -0
- {letta_sdk → letta_client}/types/agents/text_content_param.py +4 -0
- {letta_sdk → letta_client}/types/agents/tool_call_content.py +3 -0
- {letta_sdk → letta_client}/types/agents/tool_call_content_param.py +4 -1
- {letta_sdk → letta_client}/types/agents/tool_call_message.py +6 -2
- letta_client/types/agents/tool_list_params.py +34 -0
- {letta_sdk → letta_client}/types/agents/tool_return.py +7 -3
- letta_client/types/agents/tool_return_param.py +25 -0
- letta_client/types/agents/tool_update_approval_params.py +21 -0
- {letta_sdk → letta_client}/types/archive.py +4 -0
- letta_client/types/archive_create_params.py +19 -0
- letta_sdk/types/archive_retrieve_params.py → letta_client/types/archive_list_params.py +2 -2
- letta_sdk/types/archive_retrieve_response.py → letta_client/types/archive_list_response.py +2 -2
- {letta_sdk → letta_client}/types/archive_update_params.py +3 -3
- {letta_sdk/types/messages → letta_client/types}/batch_create_params.py +15 -6
- letta_sdk/types/job.py → letta_client/types/batch_job.py +8 -3
- letta_client/types/batches/__init__.py +6 -0
- letta_sdk/types/messages/batch_list_messages_params.py → letta_client/types/batches/message_list_params.py +2 -2
- letta_sdk/types/messages/batch_list_messages_response.py → letta_client/types/batches/message_list_response.py +2 -2
- {letta_sdk/types/tools → letta_client/types/blocks}/__init__.py +2 -0
- letta_sdk/types/block_list_agents_params.py → letta_client/types/blocks/agent_list_params.py +22 -5
- letta_client/types/child_tool_rule.py +40 -0
- letta_client/types/child_tool_rule_param.py +42 -0
- letta_client/types/folders/__init__.py +10 -0
- letta_sdk/types/folder_list_agents_params.py → letta_client/types/folders/agent_list_params.py +2 -2
- letta_client/types/folders/agent_list_response.py +7 -0
- letta_sdk/types/folder_list_files_params.py → letta_client/types/folders/file_list_params.py +2 -2
- letta_sdk/types/file_metadata.py → letta_client/types/folders/file_list_response.py +5 -5
- letta_sdk/types/source_upload_file_params.py → letta_client/types/folders/file_upload_params.py +5 -6
- letta_client/types/folders/file_upload_response.py +65 -0
- {letta_sdk → letta_client}/types/groups/__init__.py +1 -2
- {letta_sdk → letta_client}/types/groups/message_send_params.py +12 -3
- letta_sdk/types/groups/message_send_stream_params.py → letta_client/types/groups/message_stream_params.py +14 -5
- {letta_sdk → letta_client}/types/groups/message_update_params.py +4 -0
- letta_sdk/types/health_check_response.py → letta_client/types/health_response.py +2 -2
- letta_client/types/identities/__init__.py +7 -0
- letta_sdk/types/identity_list_agents_params.py → letta_client/types/identities/agent_list_params.py +19 -3
- letta_client/types/identities/block_list_params.py +34 -0
- letta_sdk/types/identity_upsert_properties_params.py → letta_client/types/identities/property_upsert_params.py +3 -3
- letta_sdk/types/identity_modify_params.py → letta_client/types/identity_update_params.py +2 -2
- {letta_sdk → letta_client}/types/init_tool_rule.py +10 -1
- {letta_sdk → letta_client}/types/init_tool_rule_param.py +10 -1
- {letta_sdk → letta_client}/types/llm_config.py +6 -0
- {letta_sdk → letta_client}/types/llm_config_param.py +6 -0
- {letta_sdk/types/voice_beta → letta_client/types/models}/__init__.py +1 -1
- letta_sdk/types/agents/archival_memory_create_response.py → letta_client/types/models/embedding_list_response.py +3 -3
- {letta_sdk → letta_client}/types/run_list_params.py +29 -5
- letta_client/types/runs/__init__.py +8 -0
- letta_sdk/types/run_list_messages_params.py → letta_client/types/runs/message_list_params.py +5 -2
- letta_sdk/types/run_retrieve_stream_params.py → letta_client/types/runs/message_stream_params.py +2 -2
- letta_sdk/types/run_list_steps_params.py → letta_client/types/runs/step_list_params.py +9 -6
- letta_sdk/types/run_retrieve_usage_response.py → letta_client/types/runs/usage_retrieve_response.py +3 -3
- {letta_sdk → letta_client}/types/step.py +6 -6
- letta_client/types/steps/__init__.py +8 -0
- letta_sdk/types/step_update_feedback_params.py → letta_client/types/steps/feedback_create_params.py +3 -3
- letta_sdk/types/step_list_messages_params.py → letta_client/types/steps/message_list_params.py +2 -2
- letta_client/types/steps/message_list_response.py +32 -0
- letta_sdk/types/step_retrieve_metrics_response.py → letta_client/types/steps/metric_retrieve_response.py +6 -6
- {letta_sdk → letta_client}/types/tag_list_response.py +1 -2
- letta_client/types/templates/__init__.py +5 -0
- letta_sdk/types/template_create_agents_params.py → letta_client/types/templates/agent_create_params.py +4 -4
- {letta_sdk → letta_client}/types/tool.py +6 -0
- {letta_sdk → letta_client}/types/tool_create_params.py +6 -0
- {letta_sdk → letta_client}/types/tool_return_message.py +3 -0
- letta_sdk/types/tool_modify_params.py → letta_client/types/tool_update_params.py +8 -2
- letta_sdk/types/tool_list_response.py → letta_client/types/tool_upsert_base_tools_response.py +2 -2
- {letta_sdk → letta_client}/types/tool_upsert_params.py +6 -0
- {letta_client-1.0.0a6.dist-info → letta_client-1.0.0a8.dist-info}/METADATA +110 -70
- letta_client-1.0.0a8.dist-info/RECORD +289 -0
- {letta_client-1.0.0a6.dist-info → letta_client-1.0.0a8.dist-info}/licenses/LICENSE +1 -1
- letta_client-1.0.0a6.dist-info/RECORD +0 -420
- letta_sdk/resources/_internal_templates/__init__.py +0 -33
- letta_sdk/resources/_internal_templates/_internal_templates.py +0 -961
- letta_sdk/resources/_internal_templates/deployment.py +0 -268
- letta_sdk/resources/agents/archival_memory.py +0 -581
- letta_sdk/resources/agents/core_memory/core_memory.py +0 -278
- letta_sdk/resources/agents/sources.py +0 -332
- letta_sdk/resources/client_side_access_tokens.py +0 -402
- letta_sdk/resources/folders.py +0 -1562
- letta_sdk/resources/health.py +0 -135
- letta_sdk/resources/messages/messages.py +0 -102
- letta_sdk/resources/projects.py +0 -189
- letta_sdk/resources/runs.py +0 -1016
- letta_sdk/resources/sources/__init__.py +0 -33
- letta_sdk/resources/sources/files.py +0 -341
- letta_sdk/resources/sources/sources.py +0 -1371
- letta_sdk/resources/steps.py +0 -784
- letta_sdk/resources/templates.py +0 -1310
- letta_sdk/resources/tools/__init__.py +0 -47
- letta_sdk/resources/tools/composio/__init__.py +0 -33
- letta_sdk/resources/tools/composio/apps.py +0 -214
- letta_sdk/resources/tools/composio/composio.py +0 -201
- letta_sdk/resources/tools/mcp/__init__.py +0 -47
- letta_sdk/resources/tools/mcp/mcp.py +0 -134
- letta_sdk/resources/tools/mcp/oauth.py +0 -214
- letta_sdk/resources/tools/mcp/servers/__init__.py +0 -33
- letta_sdk/resources/tools/mcp/servers/servers.py +0 -1785
- letta_sdk/resources/tools/mcp/servers/tools.py +0 -263
- letta_sdk/resources/voice_beta/__init__.py +0 -33
- letta_sdk/resources/voice_beta/voice_beta.py +0 -102
- letta_sdk/types/__init__.py +0 -226
- letta_sdk/types/_internal_templates/__init__.py +0 -7
- letta_sdk/types/_internal_templates/deployment_delete_response.py +0 -17
- letta_sdk/types/_internal_templates/deployment_list_entities_params.py +0 -15
- letta_sdk/types/_internal_templates/deployment_list_entities_response.py +0 -31
- letta_sdk/types/agent_export_params.py +0 -17
- letta_sdk/types/agent_list_groups_params.py +0 -13
- letta_sdk/types/agent_list_groups_response.py +0 -10
- letta_sdk/types/agent_list_response.py +0 -10
- letta_sdk/types/agent_migrate_params.py +0 -19
- letta_sdk/types/agent_migrate_response.py +0 -11
- letta_sdk/types/agent_retrieve_context_response.py +0 -110
- letta_sdk/types/agent_search_params.py +0 -78
- letta_sdk/types/agent_search_response.py +0 -16
- letta_sdk/types/agent_summarize_params.py +0 -12
- letta_sdk/types/agents/approval_create_param.py +0 -22
- letta_sdk/types/agents/approval_response_message.py +0 -41
- letta_sdk/types/agents/archival_memory_create_params.py +0 -23
- letta_sdk/types/agents/archival_memory_list_params.py +0 -28
- letta_sdk/types/agents/archival_memory_list_response.py +0 -10
- letta_sdk/types/agents/archival_memory_search_params.py +0 -35
- letta_sdk/types/agents/archival_memory_search_response.py +0 -26
- letta_sdk/types/agents/core_memory/__init__.py +0 -7
- letta_sdk/types/agents/core_memory/block_list_response.py +0 -10
- letta_sdk/types/agents/core_memory_retrieve_variables_response.py +0 -11
- letta_sdk/types/agents/file_list_params.py +0 -19
- letta_sdk/types/agents/folder_list_response.py +0 -10
- letta_sdk/types/agents/letta_request_param.py +0 -45
- letta_sdk/types/agents/letta_streaming_request_param.py +0 -60
- letta_sdk/types/agents/memory.py +0 -92
- letta_sdk/types/agents/message_list_response.py +0 -10
- letta_sdk/types/agents/message_preview_raw_payload_params.py +0 -103
- letta_sdk/types/agents/message_preview_raw_payload_response.py +0 -8
- letta_sdk/types/agents/message_search_params.py +0 -38
- letta_sdk/types/agents/message_search_response.py +0 -29
- letta_sdk/types/agents/source_list_response.py +0 -10
- letta_sdk/types/agents/tool_list_response.py +0 -10
- letta_sdk/types/agents/tool_modify_approval_params.py +0 -13
- letta_sdk/types/block_list_agents_response.py +0 -10
- letta_sdk/types/block_list_response.py +0 -10
- letta_sdk/types/child_tool_rule.py +0 -21
- letta_sdk/types/child_tool_rule_param.py +0 -23
- letta_sdk/types/client_side_access_token_create_params.py +0 -32
- letta_sdk/types/client_side_access_token_create_response.py +0 -34
- letta_sdk/types/client_side_access_token_delete_params.py +0 -11
- letta_sdk/types/client_side_access_token_list_params.py +0 -23
- letta_sdk/types/client_side_access_token_list_response.py +0 -40
- letta_sdk/types/duplicate_file_handling.py +0 -7
- letta_sdk/types/embedding_get_total_storage_size_response.py +0 -7
- letta_sdk/types/file_processing_status.py +0 -7
- letta_sdk/types/folder_get_by_name_response.py +0 -7
- letta_sdk/types/folder_list_agents_response.py +0 -8
- letta_sdk/types/folder_list_files_response.py +0 -10
- letta_sdk/types/folder_list_passages_params.py +0 -34
- letta_sdk/types/folder_list_passages_response.py +0 -10
- letta_sdk/types/folder_list_response.py +0 -10
- letta_sdk/types/folder_retrieve_metadata_params.py +0 -11
- letta_sdk/types/folder_upload_file_params.py +0 -21
- letta_sdk/types/group_list_response.py +0 -10
- letta_sdk/types/groups/message_list_response.py +0 -10
- letta_sdk/types/identity_list_agents_response.py +0 -10
- letta_sdk/types/identity_list_blocks_response.py +0 -10
- letta_sdk/types/identity_list_response.py +0 -10
- letta_sdk/types/internal_template_create_agent_params.py +0 -217
- letta_sdk/types/internal_template_create_block_params.py +0 -54
- letta_sdk/types/internal_template_create_group_params.py +0 -49
- letta_sdk/types/job_list_active_params.py +0 -28
- letta_sdk/types/job_list_active_response.py +0 -10
- letta_sdk/types/job_list_params.py +0 -31
- letta_sdk/types/job_list_response.py +0 -10
- letta_sdk/types/messages/__init__.py +0 -10
- letta_sdk/types/messages/batch_job.py +0 -60
- letta_sdk/types/messages/batch_list_response.py +0 -10
- letta_sdk/types/model_list_embedding_response.py +0 -10
- letta_sdk/types/organization_sources_stats.py +0 -49
- letta_sdk/types/passage.py +0 -56
- letta_sdk/types/project_list_params.py +0 -16
- letta_sdk/types/project_list_response.py +0 -23
- letta_sdk/types/provider.py +0 -42
- letta_sdk/types/provider_check_params.py +0 -30
- letta_sdk/types/provider_create_params.py +0 -33
- letta_sdk/types/provider_list_params.py +0 -42
- letta_sdk/types/provider_list_response.py +0 -10
- letta_sdk/types/provider_update_params.py +0 -25
- letta_sdk/types/run_list_active_params.py +0 -18
- letta_sdk/types/run_list_active_response.py +0 -10
- letta_sdk/types/run_list_messages_response.py +0 -10
- letta_sdk/types/run_list_response.py +0 -10
- letta_sdk/types/run_list_steps_response.py +0 -10
- letta_sdk/types/source_count_response.py +0 -7
- letta_sdk/types/source_create_params.py +0 -33
- letta_sdk/types/source_get_agents_response.py +0 -8
- letta_sdk/types/source_get_by_name_response.py +0 -7
- letta_sdk/types/source_get_metadata_params.py +0 -11
- letta_sdk/types/source_list_passages_params.py +0 -19
- letta_sdk/types/source_list_passages_response.py +0 -10
- letta_sdk/types/source_list_response.py +0 -10
- letta_sdk/types/source_update_params.py +0 -27
- letta_sdk/types/sources/__init__.py +0 -7
- letta_sdk/types/sources/file_list_params.py +0 -26
- letta_sdk/types/sources/file_list_response.py +0 -10
- letta_sdk/types/sources/file_retrieve_params.py +0 -14
- letta_sdk/types/step_list_messages_response.py +0 -34
- letta_sdk/types/step_list_response.py +0 -10
- letta_sdk/types/template_create_agents_response.py +0 -12
- letta_sdk/types/template_create_params.py +0 -40
- letta_sdk/types/template_create_response.py +0 -29
- letta_sdk/types/template_delete_response.py +0 -9
- letta_sdk/types/template_fork_params.py +0 -17
- letta_sdk/types/template_fork_response.py +0 -29
- letta_sdk/types/template_get_snapshot_response.py +0 -258
- letta_sdk/types/template_list_params.py +0 -34
- letta_sdk/types/template_list_response.py +0 -35
- letta_sdk/types/template_list_versions_params.py +0 -16
- letta_sdk/types/template_list_versions_response.py +0 -29
- letta_sdk/types/template_rename_params.py +0 -14
- letta_sdk/types/template_rename_response.py +0 -9
- letta_sdk/types/template_save_version_params.py +0 -32
- letta_sdk/types/template_save_version_response.py +0 -29
- letta_sdk/types/template_update_description_params.py +0 -14
- letta_sdk/types/template_update_description_response.py +0 -9
- letta_sdk/types/tool_run_params.py +0 -43
- letta_sdk/types/tool_upsert_base_response.py +0 -10
- letta_sdk/types/tools/composio/__init__.py +0 -6
- letta_sdk/types/tools/composio/app_list_actions_response.py +0 -70
- letta_sdk/types/tools/composio/app_list_response.py +0 -103
- letta_sdk/types/tools/mcp/__init__.py +0 -21
- letta_sdk/types/tools/mcp/mcp_server_type.py +0 -7
- letta_sdk/types/tools/mcp/oauth_callback_params.py +0 -22
- letta_sdk/types/tools/mcp/server_add_params.py +0 -68
- letta_sdk/types/tools/mcp/server_add_response.py +0 -14
- letta_sdk/types/tools/mcp/server_connect_params.py +0 -68
- letta_sdk/types/tools/mcp/server_delete_response.py +0 -14
- letta_sdk/types/tools/mcp/server_list_response.py +0 -14
- letta_sdk/types/tools/mcp/server_resync_params.py +0 -12
- letta_sdk/types/tools/mcp/server_test_params.py +0 -68
- letta_sdk/types/tools/mcp/server_update_params.py +0 -43
- letta_sdk/types/tools/mcp/server_update_response.py +0 -12
- letta_sdk/types/tools/mcp/servers/__init__.py +0 -6
- letta_sdk/types/tools/mcp/servers/tool_execute_params.py +0 -15
- letta_sdk/types/tools/mcp/servers/tool_list_response.py +0 -85
- letta_sdk/types/tools/mcp/sse_server_config.py +0 -27
- letta_sdk/types/tools/mcp/sse_server_config_param.py +0 -29
- letta_sdk/types/tools/mcp/stdio_server_config.py +0 -24
- letta_sdk/types/tools/mcp/stdio_server_config_param.py +0 -27
- letta_sdk/types/tools/mcp/streamable_http_server_config.py +0 -27
- letta_sdk/types/tools/mcp/streamable_http_server_config_param.py +0 -29
- letta_sdk/types/voice_beta/chat_create_completion_params.py +0 -12
- {letta_sdk → letta_client}/_compat.py +0 -0
- {letta_sdk → letta_client}/_constants.py +0 -0
- {letta_sdk → letta_client}/_files.py +0 -0
- {letta_sdk → letta_client}/_models.py +0 -0
- {letta_sdk → letta_client}/_qs.py +0 -0
- {letta_sdk → letta_client}/_utils/__init__.py +0 -0
- {letta_sdk → letta_client}/_utils/_compat.py +0 -0
- {letta_sdk → letta_client}/_utils/_datetime_parse.py +0 -0
- {letta_sdk → letta_client}/_utils/_proxy.py +0 -0
- {letta_sdk → letta_client}/_utils/_reflection.py +0 -0
- {letta_sdk → letta_client}/_utils/_streams.py +0 -0
- {letta_sdk → letta_client}/_utils/_sync.py +0 -0
- {letta_sdk → letta_client}/_utils/_transform.py +0 -0
- {letta_sdk → letta_client}/_utils/_typing.py +0 -0
- {letta_sdk → letta_client}/_utils/_utils.py +0 -0
- {letta_sdk → letta_client}/lib/.keep +0 -0
- {letta_sdk → letta_client}/py.typed +0 -0
- {letta_sdk/resources/messages → letta_client/resources/batches}/__init__.py +6 -6
- {letta_sdk → letta_client}/resources/groups/__init__.py +0 -0
- {letta_sdk → letta_client}/types/agent_count_response.py +0 -0
- {letta_sdk → letta_client}/types/agents/assistant_message.py +0 -0
- {letta_sdk → letta_client}/types/agents/file_close_all_response.py +0 -0
- {letta_sdk → letta_client}/types/agents/file_list_response.py +0 -0
- {letta_sdk → letta_client}/types/agents/file_open_response.py +0 -0
- {letta_sdk → letta_client}/types/agents/hidden_reasoning_message.py +0 -0
- {letta_sdk → letta_client}/types/agents/image_content.py +0 -0
- {letta_sdk → letta_client}/types/agents/image_content_param.py +0 -0
- {letta_sdk → letta_client}/types/agents/job_status.py +0 -0
- {letta_sdk → letta_client}/types/agents/job_type.py +0 -0
- {letta_sdk → letta_client}/types/agents/letta_message_union.py +0 -0
- {letta_sdk → letta_client}/types/agents/letta_user_message_content_union.py +0 -0
- {letta_sdk → letta_client}/types/agents/letta_user_message_content_union_param.py +0 -0
- {letta_sdk → letta_client}/types/agents/message_cancel_params.py +0 -0
- {letta_sdk → letta_client}/types/agents/message_cancel_response.py +0 -0
- {letta_sdk → letta_client}/types/agents/message_role.py +0 -0
- {letta_sdk → letta_client}/types/agents/message_type.py +0 -0
- {letta_sdk → letta_client}/types/agents/message_update_response.py +0 -0
- {letta_sdk → letta_client}/types/agents/reasoning_content.py +0 -0
- {letta_sdk → letta_client}/types/agents/reasoning_content_param.py +0 -0
- {letta_sdk → letta_client}/types/agents/reasoning_message.py +0 -0
- {letta_sdk → letta_client}/types/agents/redacted_reasoning_content.py +0 -0
- {letta_sdk → letta_client}/types/agents/redacted_reasoning_content_param.py +0 -0
- {letta_sdk → letta_client}/types/agents/system_message.py +0 -0
- {letta_sdk → letta_client}/types/agents/tool_call.py +0 -0
- {letta_sdk → letta_client}/types/agents/tool_call_delta.py +0 -0
- {letta_sdk → letta_client}/types/agents/tool_return_content.py +0 -0
- {letta_sdk → letta_client}/types/agents/tool_return_content_param.py +0 -0
- {letta_sdk → letta_client}/types/agents/update_assistant_message_param.py +0 -0
- {letta_sdk → letta_client}/types/agents/update_reasoning_message_param.py +0 -0
- {letta_sdk → letta_client}/types/agents/update_system_message_param.py +0 -0
- {letta_sdk → letta_client}/types/agents/update_user_message_param.py +0 -0
- {letta_sdk → letta_client}/types/agents/user_message.py +0 -0
- {letta_sdk/types/messages → letta_client/types}/batch_list_params.py +0 -0
- {letta_sdk → letta_client}/types/block_count_response.py +0 -0
- {letta_sdk → letta_client}/types/block_create_params.py +0 -0
- {letta_sdk → letta_client}/types/block_list_params.py +0 -0
- {letta_sdk → letta_client}/types/block_update_params.py +0 -0
- {letta_sdk → letta_client}/types/conditional_tool_rule.py +0 -0
- {letta_sdk → letta_client}/types/conditional_tool_rule_param.py +0 -0
- {letta_sdk → letta_client}/types/continue_tool_rule.py +0 -0
- {letta_sdk → letta_client}/types/continue_tool_rule_param.py +0 -0
- {letta_sdk → letta_client}/types/create_block_param.py +0 -0
- {letta_sdk → letta_client}/types/dynamic_manager_param.py +0 -0
- {letta_sdk → letta_client}/types/embedding_config.py +0 -0
- {letta_sdk → letta_client}/types/embedding_config_param.py +0 -0
- {letta_sdk → letta_client}/types/folder.py +0 -0
- {letta_sdk → letta_client}/types/folder_count_response.py +0 -0
- {letta_sdk → letta_client}/types/folder_create_params.py +0 -0
- {letta_sdk → letta_client}/types/folder_list_params.py +0 -0
- {letta_sdk → letta_client}/types/folder_update_params.py +0 -0
- {letta_sdk → letta_client}/types/group.py +0 -0
- {letta_sdk → letta_client}/types/group_count_response.py +0 -0
- {letta_sdk → letta_client}/types/group_create_params.py +0 -0
- {letta_sdk → letta_client}/types/group_list_params.py +0 -0
- {letta_sdk → letta_client}/types/group_update_params.py +0 -0
- {letta_sdk → letta_client}/types/groups/message_list_params.py +0 -0
- {letta_sdk → letta_client}/types/groups/message_update_response.py +0 -0
- {letta_sdk → letta_client}/types/identity.py +0 -0
- {letta_sdk → letta_client}/types/identity_count_response.py +0 -0
- {letta_sdk → letta_client}/types/identity_create_params.py +0 -0
- {letta_sdk → letta_client}/types/identity_list_params.py +0 -0
- {letta_sdk → letta_client}/types/identity_property.py +0 -0
- {letta_sdk → letta_client}/types/identity_property_param.py +0 -0
- {letta_sdk → letta_client}/types/identity_type.py +0 -0
- {letta_sdk → letta_client}/types/identity_upsert_params.py +0 -0
- {letta_sdk → letta_client}/types/json_object_response_format.py +0 -0
- {letta_sdk → letta_client}/types/json_object_response_format_param.py +0 -0
- {letta_sdk → letta_client}/types/json_schema_response_format.py +0 -0
- {letta_sdk → letta_client}/types/json_schema_response_format_param.py +0 -0
- {letta_sdk → letta_client}/types/letta_message_content_union_param.py +0 -0
- {letta_sdk → letta_client}/types/manager_type.py +0 -0
- {letta_sdk → letta_client}/types/max_count_per_step_tool_rule.py +0 -0
- {letta_sdk → letta_client}/types/max_count_per_step_tool_rule_param.py +0 -0
- {letta_sdk → letta_client}/types/message_create_param.py +0 -0
- {letta_sdk → letta_client}/types/model_list_params.py +0 -0
- {letta_sdk → letta_client}/types/model_list_response.py +0 -0
- {letta_sdk → letta_client}/types/npm_requirement.py +0 -0
- {letta_sdk → letta_client}/types/npm_requirement_param.py +0 -0
- {letta_sdk → letta_client}/types/parent_tool_rule.py +0 -0
- {letta_sdk → letta_client}/types/parent_tool_rule_param.py +0 -0
- {letta_sdk → letta_client}/types/pip_requirement.py +0 -0
- {letta_sdk → letta_client}/types/pip_requirement_param.py +0 -0
- {letta_sdk → letta_client}/types/provider_category.py +0 -0
- {letta_sdk → letta_client}/types/provider_trace.py +0 -0
- {letta_sdk → letta_client}/types/provider_type.py +0 -0
- {letta_sdk → letta_client}/types/required_before_exit_tool_rule.py +0 -0
- {letta_sdk → letta_client}/types/required_before_exit_tool_rule_param.py +0 -0
- {letta_sdk → letta_client}/types/requires_approval_tool_rule.py +0 -0
- {letta_sdk → letta_client}/types/requires_approval_tool_rule_param.py +0 -0
- {letta_sdk → letta_client}/types/round_robin_manager_param.py +0 -0
- {letta_sdk → letta_client}/types/sleeptime_manager_param.py +0 -0
- {letta_sdk → letta_client}/types/step_list_params.py +0 -0
- {letta_sdk → letta_client}/types/stop_reason_type.py +0 -0
- {letta_sdk → letta_client}/types/supervisor_manager_param.py +0 -0
- {letta_sdk → letta_client}/types/tag_list_params.py +0 -0
- {letta_sdk → letta_client}/types/terminal_tool_rule.py +0 -0
- {letta_sdk → letta_client}/types/terminal_tool_rule_param.py +0 -0
- {letta_sdk → letta_client}/types/text_response_format.py +0 -0
- {letta_sdk → letta_client}/types/text_response_format_param.py +0 -0
- {letta_sdk → letta_client}/types/tool_count_params.py +0 -0
- {letta_sdk → letta_client}/types/tool_count_response.py +0 -0
- {letta_sdk → letta_client}/types/tool_list_params.py +0 -0
- {letta_sdk → letta_client}/types/tool_type.py +1 -1
- {letta_sdk → letta_client}/types/vector_db_provider.py +0 -0
- {letta_sdk → letta_client}/types/voice_sleeptime_manager_param.py +0 -0
- {letta_client-1.0.0a6.dist-info → letta_client-1.0.0a8.dist-info}/WHEEL +0 -0
letta_sdk/types/step_list_messages_params.py → letta_client/types/steps/message_list_params.py
RENAMED
|
@@ -5,10 +5,10 @@ from __future__ import annotations
|
|
|
5
5
|
from typing import Optional
|
|
6
6
|
from typing_extensions import Literal, TypedDict
|
|
7
7
|
|
|
8
|
-
__all__ = ["
|
|
8
|
+
__all__ = ["MessageListParams"]
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
class
|
|
11
|
+
class MessageListParams(TypedDict, total=False):
|
|
12
12
|
after: Optional[str]
|
|
13
13
|
"""Message ID cursor for pagination.
|
|
14
14
|
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import Union
|
|
4
|
+
from typing_extensions import Annotated, TypeAlias
|
|
5
|
+
|
|
6
|
+
from ..._utils import PropertyInfo
|
|
7
|
+
from ..agents.user_message import UserMessage
|
|
8
|
+
from ..tool_return_message import ToolReturnMessage
|
|
9
|
+
from ..agents.system_message import SystemMessage
|
|
10
|
+
from ..agents.assistant_message import AssistantMessage
|
|
11
|
+
from ..agents.reasoning_message import ReasoningMessage
|
|
12
|
+
from ..agents.tool_call_message import ToolCallMessage
|
|
13
|
+
from ..agents.approval_request_message import ApprovalRequestMessage
|
|
14
|
+
from ..agents.hidden_reasoning_message import HiddenReasoningMessage
|
|
15
|
+
from ..agents.approval_response_message import ApprovalResponseMessage
|
|
16
|
+
|
|
17
|
+
__all__ = ["MessageListResponse"]
|
|
18
|
+
|
|
19
|
+
MessageListResponse: TypeAlias = Annotated[
|
|
20
|
+
Union[
|
|
21
|
+
SystemMessage,
|
|
22
|
+
UserMessage,
|
|
23
|
+
ReasoningMessage,
|
|
24
|
+
HiddenReasoningMessage,
|
|
25
|
+
ToolCallMessage,
|
|
26
|
+
ToolReturnMessage,
|
|
27
|
+
AssistantMessage,
|
|
28
|
+
ApprovalRequestMessage,
|
|
29
|
+
ApprovalResponseMessage,
|
|
30
|
+
],
|
|
31
|
+
PropertyInfo(discriminator="message_type"),
|
|
32
|
+
]
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
from typing import Optional
|
|
4
4
|
|
|
5
|
-
from
|
|
5
|
+
from ..._models import BaseModel
|
|
6
6
|
|
|
7
|
-
__all__ = ["
|
|
7
|
+
__all__ = ["MetricRetrieveResponse"]
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
class
|
|
10
|
+
class MetricRetrieveResponse(BaseModel):
|
|
11
11
|
id: str
|
|
12
12
|
"""The id of the step this metric belongs to (matches steps.id)."""
|
|
13
13
|
|
|
@@ -17,9 +17,6 @@ class StepRetrieveMetricsResponse(BaseModel):
|
|
|
17
17
|
base_template_id: Optional[str] = None
|
|
18
18
|
"""The base template ID that the step belongs to (cloud only)."""
|
|
19
19
|
|
|
20
|
-
job_id: Optional[str] = None
|
|
21
|
-
"""The unique identifier of the job."""
|
|
22
|
-
|
|
23
20
|
llm_request_ns: Optional[int] = None
|
|
24
21
|
"""Time spent on LLM requests in nanoseconds."""
|
|
25
22
|
|
|
@@ -32,6 +29,9 @@ class StepRetrieveMetricsResponse(BaseModel):
|
|
|
32
29
|
provider_id: Optional[str] = None
|
|
33
30
|
"""The unique identifier of the provider."""
|
|
34
31
|
|
|
32
|
+
run_id: Optional[str] = None
|
|
33
|
+
"""The unique identifier of the run."""
|
|
34
|
+
|
|
35
35
|
step_ns: Optional[int] = None
|
|
36
36
|
"""Total time for the step in nanoseconds."""
|
|
37
37
|
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
from typing import List
|
|
4
3
|
from typing_extensions import TypeAlias
|
|
5
4
|
|
|
6
5
|
__all__ = ["TagListResponse"]
|
|
7
6
|
|
|
8
|
-
TagListResponse: TypeAlias =
|
|
7
|
+
TagListResponse: TypeAlias = str
|
|
@@ -5,13 +5,13 @@ from __future__ import annotations
|
|
|
5
5
|
from typing import Dict, Iterable, Optional
|
|
6
6
|
from typing_extensions import Literal, Required, TypedDict
|
|
7
7
|
|
|
8
|
-
from
|
|
8
|
+
from ..._types import SequenceNotStr
|
|
9
9
|
|
|
10
|
-
__all__ = ["
|
|
10
|
+
__all__ = ["AgentCreateParams", "InitialMessageSequence"]
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
class
|
|
14
|
-
|
|
13
|
+
class AgentCreateParams(TypedDict, total=False):
|
|
14
|
+
project_id: Required[str]
|
|
15
15
|
|
|
16
16
|
agent_name: str
|
|
17
17
|
"""The name of the agent, optional otherwise a random one will be assigned"""
|
|
@@ -28,6 +28,12 @@ class Tool(BaseModel):
|
|
|
28
28
|
description: Optional[str] = None
|
|
29
29
|
"""The description of the tool."""
|
|
30
30
|
|
|
31
|
+
enable_parallel_execution: Optional[bool] = None
|
|
32
|
+
"""
|
|
33
|
+
If set to True, then this tool will potentially be executed concurrently with
|
|
34
|
+
other tools. Default False.
|
|
35
|
+
"""
|
|
36
|
+
|
|
31
37
|
json_schema: Optional[Dict[str, object]] = None
|
|
32
38
|
"""The JSON schema of the function."""
|
|
33
39
|
|
|
@@ -25,6 +25,12 @@ class ToolCreateParams(TypedDict, total=False):
|
|
|
25
25
|
description: Optional[str]
|
|
26
26
|
"""The description of the tool."""
|
|
27
27
|
|
|
28
|
+
enable_parallel_execution: Optional[bool]
|
|
29
|
+
"""
|
|
30
|
+
If set to True, then this tool will potentially be executed concurrently with
|
|
31
|
+
other tools. Default False.
|
|
32
|
+
"""
|
|
33
|
+
|
|
28
34
|
json_schema: Optional[Dict[str, object]]
|
|
29
35
|
"""
|
|
30
36
|
The JSON schema of the function (auto-generated from source_code if not
|
|
@@ -5,6 +5,7 @@ from datetime import datetime
|
|
|
5
5
|
from typing_extensions import Literal
|
|
6
6
|
|
|
7
7
|
from .._models import BaseModel
|
|
8
|
+
from .agents.tool_return import ToolReturn
|
|
8
9
|
|
|
9
10
|
__all__ = ["ToolReturnMessage"]
|
|
10
11
|
|
|
@@ -40,3 +41,5 @@ class ToolReturnMessage(BaseModel):
|
|
|
40
41
|
stdout: Optional[List[str]] = None
|
|
41
42
|
|
|
42
43
|
step_id: Optional[str] = None
|
|
44
|
+
|
|
45
|
+
tool_returns: Optional[List[ToolReturn]] = None
|
|
@@ -10,10 +10,10 @@ from .._utils import PropertyInfo
|
|
|
10
10
|
from .npm_requirement_param import NpmRequirementParam
|
|
11
11
|
from .pip_requirement_param import PipRequirementParam
|
|
12
12
|
|
|
13
|
-
__all__ = ["
|
|
13
|
+
__all__ = ["ToolUpdateParams"]
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
class
|
|
16
|
+
class ToolUpdateParams(TypedDict, total=False):
|
|
17
17
|
args_json_schema: Optional[Dict[str, object]]
|
|
18
18
|
"""The args JSON schema of the function."""
|
|
19
19
|
|
|
@@ -23,6 +23,12 @@ class ToolModifyParams(TypedDict, total=False):
|
|
|
23
23
|
description: Optional[str]
|
|
24
24
|
"""The description of the tool."""
|
|
25
25
|
|
|
26
|
+
enable_parallel_execution: Optional[bool]
|
|
27
|
+
"""
|
|
28
|
+
If set to True, then this tool will potentially be executed concurrently with
|
|
29
|
+
other tools. Default False.
|
|
30
|
+
"""
|
|
31
|
+
|
|
26
32
|
json_schema: Optional[Dict[str, object]]
|
|
27
33
|
"""
|
|
28
34
|
The JSON schema of the function (auto-generated from source_code if not
|
|
@@ -25,6 +25,12 @@ class ToolUpsertParams(TypedDict, total=False):
|
|
|
25
25
|
description: Optional[str]
|
|
26
26
|
"""The description of the tool."""
|
|
27
27
|
|
|
28
|
+
enable_parallel_execution: Optional[bool]
|
|
29
|
+
"""
|
|
30
|
+
If set to True, then this tool will potentially be executed concurrently with
|
|
31
|
+
other tools. Default False.
|
|
32
|
+
"""
|
|
33
|
+
|
|
28
34
|
json_schema: Optional[Dict[str, object]]
|
|
29
35
|
"""
|
|
30
36
|
The JSON schema of the function (auto-generated from source_code if not
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: letta-client
|
|
3
|
-
Version: 1.0.
|
|
4
|
-
Summary: The official Python library for the letta
|
|
3
|
+
Version: 1.0.0a8
|
|
4
|
+
Summary: The official Python library for the letta API
|
|
5
5
|
Project-URL: Homepage, https://github.com/letta-ai/letta-python
|
|
6
6
|
Project-URL: Repository, https://github.com/letta-ai/letta-python
|
|
7
|
-
Author: Letta
|
|
7
|
+
Author: Letta
|
|
8
8
|
License: Apache-2.0
|
|
9
9
|
Classifier: Intended Audience :: Developers
|
|
10
10
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
@@ -33,12 +33,12 @@ Requires-Dist: aiohttp; extra == 'aiohttp'
|
|
|
33
33
|
Requires-Dist: httpx-aiohttp>=0.1.9; extra == 'aiohttp'
|
|
34
34
|
Description-Content-Type: text/markdown
|
|
35
35
|
|
|
36
|
-
# Letta
|
|
36
|
+
# Letta Python API library
|
|
37
37
|
|
|
38
38
|
<!-- prettier-ignore -->
|
|
39
39
|
[)](https://pypi.org/project/letta-client/)
|
|
40
40
|
|
|
41
|
-
The Letta
|
|
41
|
+
The Letta Python library provides convenient access to the Letta REST API from any Python 3.8+
|
|
42
42
|
application. The library includes type definitions for all request params and response fields,
|
|
43
43
|
and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).
|
|
44
44
|
|
|
@@ -61,15 +61,20 @@ The full API of this library can be found in [api.md](https://github.com/letta-a
|
|
|
61
61
|
|
|
62
62
|
```python
|
|
63
63
|
import os
|
|
64
|
-
from
|
|
64
|
+
from letta_client import Letta
|
|
65
65
|
|
|
66
|
-
client =
|
|
67
|
-
api_key=os.environ.get("
|
|
68
|
-
# defaults to "
|
|
69
|
-
environment="
|
|
66
|
+
client = Letta(
|
|
67
|
+
api_key=os.environ.get("LETTA_API_KEY"), # This is the default and can be omitted
|
|
68
|
+
# defaults to "cloud".
|
|
69
|
+
environment="local",
|
|
70
70
|
)
|
|
71
71
|
|
|
72
|
-
archive = client.archives.
|
|
72
|
+
archive = client.archives.create(
|
|
73
|
+
embedding_config={
|
|
74
|
+
"embedding_dim": 0,
|
|
75
|
+
"embedding_endpoint_type": "openai",
|
|
76
|
+
"embedding_model": "embedding_model",
|
|
77
|
+
},
|
|
73
78
|
name="name",
|
|
74
79
|
)
|
|
75
80
|
print(archive.id)
|
|
@@ -77,27 +82,32 @@ print(archive.id)
|
|
|
77
82
|
|
|
78
83
|
While you can provide an `api_key` keyword argument,
|
|
79
84
|
we recommend using [python-dotenv](https://pypi.org/project/python-dotenv/)
|
|
80
|
-
to add `
|
|
85
|
+
to add `LETTA_API_KEY="My API Key"` to your `.env` file
|
|
81
86
|
so that your API Key is not stored in source control.
|
|
82
87
|
|
|
83
88
|
## Async usage
|
|
84
89
|
|
|
85
|
-
Simply import `
|
|
90
|
+
Simply import `AsyncLetta` instead of `Letta` and use `await` with each API call:
|
|
86
91
|
|
|
87
92
|
```python
|
|
88
93
|
import os
|
|
89
94
|
import asyncio
|
|
90
|
-
from
|
|
95
|
+
from letta_client import AsyncLetta
|
|
91
96
|
|
|
92
|
-
client =
|
|
93
|
-
api_key=os.environ.get("
|
|
94
|
-
# defaults to "
|
|
95
|
-
environment="
|
|
97
|
+
client = AsyncLetta(
|
|
98
|
+
api_key=os.environ.get("LETTA_API_KEY"), # This is the default and can be omitted
|
|
99
|
+
# defaults to "cloud".
|
|
100
|
+
environment="local",
|
|
96
101
|
)
|
|
97
102
|
|
|
98
103
|
|
|
99
104
|
async def main() -> None:
|
|
100
|
-
archive = await client.archives.
|
|
105
|
+
archive = await client.archives.create(
|
|
106
|
+
embedding_config={
|
|
107
|
+
"embedding_dim": 0,
|
|
108
|
+
"embedding_endpoint_type": "openai",
|
|
109
|
+
"embedding_model": "embedding_model",
|
|
110
|
+
},
|
|
101
111
|
name="name",
|
|
102
112
|
)
|
|
103
113
|
print(archive.id)
|
|
@@ -123,16 +133,21 @@ Then you can enable it by instantiating the client with `http_client=DefaultAioH
|
|
|
123
133
|
|
|
124
134
|
```python
|
|
125
135
|
import asyncio
|
|
126
|
-
from
|
|
127
|
-
from
|
|
136
|
+
from letta_client import DefaultAioHttpClient
|
|
137
|
+
from letta_client import AsyncLetta
|
|
128
138
|
|
|
129
139
|
|
|
130
140
|
async def main() -> None:
|
|
131
|
-
async with
|
|
141
|
+
async with AsyncLetta(
|
|
132
142
|
api_key="My API Key",
|
|
133
143
|
http_client=DefaultAioHttpClient(),
|
|
134
144
|
) as client:
|
|
135
|
-
archive = await client.archives.
|
|
145
|
+
archive = await client.archives.create(
|
|
146
|
+
embedding_config={
|
|
147
|
+
"embedding_dim": 0,
|
|
148
|
+
"embedding_endpoint_type": "openai",
|
|
149
|
+
"embedding_model": "embedding_model",
|
|
150
|
+
},
|
|
136
151
|
name="name",
|
|
137
152
|
)
|
|
138
153
|
print(archive.id)
|
|
@@ -155,19 +170,19 @@ Typed requests and responses provide autocomplete and documentation within your
|
|
|
155
170
|
Nested parameters are dictionaries, typed using `TypedDict`, for example:
|
|
156
171
|
|
|
157
172
|
```python
|
|
158
|
-
from
|
|
173
|
+
from letta_client import Letta
|
|
159
174
|
|
|
160
|
-
client =
|
|
175
|
+
client = Letta()
|
|
161
176
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
"
|
|
166
|
-
"
|
|
167
|
-
"server_name": "server_name",
|
|
177
|
+
archive = client.archives.create(
|
|
178
|
+
embedding_config={
|
|
179
|
+
"embedding_dim": 0,
|
|
180
|
+
"embedding_endpoint_type": "openai",
|
|
181
|
+
"embedding_model": "embedding_model",
|
|
168
182
|
},
|
|
183
|
+
name="name",
|
|
169
184
|
)
|
|
170
|
-
print(
|
|
185
|
+
print(archive.embedding_config)
|
|
171
186
|
```
|
|
172
187
|
|
|
173
188
|
## File uploads
|
|
@@ -176,12 +191,12 @@ Request parameters that correspond to file uploads can be passed as `bytes`, or
|
|
|
176
191
|
|
|
177
192
|
```python
|
|
178
193
|
from pathlib import Path
|
|
179
|
-
from
|
|
194
|
+
from letta_client import Letta
|
|
180
195
|
|
|
181
|
-
client =
|
|
196
|
+
client = Letta()
|
|
182
197
|
|
|
183
|
-
client.
|
|
184
|
-
|
|
198
|
+
client.folders.files.upload(
|
|
199
|
+
folder_id="source-123e4567-e89b-42d3-8456-426614174000",
|
|
185
200
|
file=Path("/path/to/file"),
|
|
186
201
|
)
|
|
187
202
|
```
|
|
@@ -190,29 +205,34 @@ The async client uses the exact same interface. If you pass a [`PathLike`](https
|
|
|
190
205
|
|
|
191
206
|
## Handling errors
|
|
192
207
|
|
|
193
|
-
When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `
|
|
208
|
+
When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `letta_client.APIConnectionError` is raised.
|
|
194
209
|
|
|
195
210
|
When the API returns a non-success status code (that is, 4xx or 5xx
|
|
196
|
-
response), a subclass of `
|
|
211
|
+
response), a subclass of `letta_client.APIStatusError` is raised, containing `status_code` and `response` properties.
|
|
197
212
|
|
|
198
|
-
All errors inherit from `
|
|
213
|
+
All errors inherit from `letta_client.APIError`.
|
|
199
214
|
|
|
200
215
|
```python
|
|
201
|
-
import
|
|
202
|
-
from
|
|
216
|
+
import letta_client
|
|
217
|
+
from letta_client import Letta
|
|
203
218
|
|
|
204
|
-
client =
|
|
219
|
+
client = Letta()
|
|
205
220
|
|
|
206
221
|
try:
|
|
207
|
-
client.archives.
|
|
222
|
+
client.archives.create(
|
|
223
|
+
embedding_config={
|
|
224
|
+
"embedding_dim": 0,
|
|
225
|
+
"embedding_endpoint_type": "openai",
|
|
226
|
+
"embedding_model": "embedding_model",
|
|
227
|
+
},
|
|
208
228
|
name="name",
|
|
209
229
|
)
|
|
210
|
-
except
|
|
230
|
+
except letta_client.APIConnectionError as e:
|
|
211
231
|
print("The server could not be reached")
|
|
212
232
|
print(e.__cause__) # an underlying Exception, likely raised within httpx.
|
|
213
|
-
except
|
|
233
|
+
except letta_client.RateLimitError as e:
|
|
214
234
|
print("A 429 status code was received; we should back off a bit.")
|
|
215
|
-
except
|
|
235
|
+
except letta_client.APIStatusError as e:
|
|
216
236
|
print("Another non-200-range status code was received")
|
|
217
237
|
print(e.status_code)
|
|
218
238
|
print(e.response)
|
|
@@ -240,16 +260,21 @@ Connection errors (for example, due to a network connectivity problem), 408 Requ
|
|
|
240
260
|
You can use the `max_retries` option to configure or disable retry settings:
|
|
241
261
|
|
|
242
262
|
```python
|
|
243
|
-
from
|
|
263
|
+
from letta_client import Letta
|
|
244
264
|
|
|
245
265
|
# Configure the default for all requests:
|
|
246
|
-
client =
|
|
266
|
+
client = Letta(
|
|
247
267
|
# default is 2
|
|
248
268
|
max_retries=0,
|
|
249
269
|
)
|
|
250
270
|
|
|
251
271
|
# Or, configure per-request:
|
|
252
|
-
client.with_options(max_retries=5).archives.
|
|
272
|
+
client.with_options(max_retries=5).archives.create(
|
|
273
|
+
embedding_config={
|
|
274
|
+
"embedding_dim": 0,
|
|
275
|
+
"embedding_endpoint_type": "openai",
|
|
276
|
+
"embedding_model": "embedding_model",
|
|
277
|
+
},
|
|
253
278
|
name="name",
|
|
254
279
|
)
|
|
255
280
|
```
|
|
@@ -260,21 +285,26 @@ By default requests time out after 1 minute. You can configure this with a `time
|
|
|
260
285
|
which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object:
|
|
261
286
|
|
|
262
287
|
```python
|
|
263
|
-
from
|
|
288
|
+
from letta_client import Letta
|
|
264
289
|
|
|
265
290
|
# Configure the default for all requests:
|
|
266
|
-
client =
|
|
291
|
+
client = Letta(
|
|
267
292
|
# 20 seconds (default is 1 minute)
|
|
268
293
|
timeout=20.0,
|
|
269
294
|
)
|
|
270
295
|
|
|
271
296
|
# More granular control:
|
|
272
|
-
client =
|
|
297
|
+
client = Letta(
|
|
273
298
|
timeout=httpx.Timeout(60.0, read=5.0, write=10.0, connect=2.0),
|
|
274
299
|
)
|
|
275
300
|
|
|
276
301
|
# Override per-request:
|
|
277
|
-
client.with_options(timeout=5.0).archives.
|
|
302
|
+
client.with_options(timeout=5.0).archives.create(
|
|
303
|
+
embedding_config={
|
|
304
|
+
"embedding_dim": 0,
|
|
305
|
+
"embedding_endpoint_type": "openai",
|
|
306
|
+
"embedding_model": "embedding_model",
|
|
307
|
+
},
|
|
278
308
|
name="name",
|
|
279
309
|
)
|
|
280
310
|
```
|
|
@@ -289,10 +319,10 @@ Note that requests that time out are [retried twice by default](https://github.c
|
|
|
289
319
|
|
|
290
320
|
We use the standard library [`logging`](https://docs.python.org/3/library/logging.html) module.
|
|
291
321
|
|
|
292
|
-
You can enable logging by setting the environment variable `
|
|
322
|
+
You can enable logging by setting the environment variable `LETTA_LOG` to `info`.
|
|
293
323
|
|
|
294
324
|
```shell
|
|
295
|
-
$ export
|
|
325
|
+
$ export LETTA_LOG=info
|
|
296
326
|
```
|
|
297
327
|
|
|
298
328
|
Or to `debug` for more verbose logging.
|
|
@@ -314,21 +344,26 @@ if response.my_field is None:
|
|
|
314
344
|
The "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g.,
|
|
315
345
|
|
|
316
346
|
```py
|
|
317
|
-
from
|
|
318
|
-
|
|
319
|
-
client =
|
|
320
|
-
response = client.archives.with_raw_response.
|
|
347
|
+
from letta_client import Letta
|
|
348
|
+
|
|
349
|
+
client = Letta()
|
|
350
|
+
response = client.archives.with_raw_response.create(
|
|
351
|
+
embedding_config={
|
|
352
|
+
"embedding_dim": 0,
|
|
353
|
+
"embedding_endpoint_type": "openai",
|
|
354
|
+
"embedding_model": "embedding_model",
|
|
355
|
+
},
|
|
321
356
|
name="name",
|
|
322
357
|
)
|
|
323
358
|
print(response.headers.get('X-My-Header'))
|
|
324
359
|
|
|
325
|
-
archive = response.parse() # get the object that `archives.
|
|
360
|
+
archive = response.parse() # get the object that `archives.create()` would have returned
|
|
326
361
|
print(archive.id)
|
|
327
362
|
```
|
|
328
363
|
|
|
329
|
-
These methods return an [`APIResponse`](https://github.com/letta-ai/letta-python/tree/1.0-release/src/
|
|
364
|
+
These methods return an [`APIResponse`](https://github.com/letta-ai/letta-python/tree/1.0-release/src/letta_client/_response.py) object.
|
|
330
365
|
|
|
331
|
-
The async client returns an [`AsyncAPIResponse`](https://github.com/letta-ai/letta-python/tree/1.0-release/src/
|
|
366
|
+
The async client returns an [`AsyncAPIResponse`](https://github.com/letta-ai/letta-python/tree/1.0-release/src/letta_client/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.
|
|
332
367
|
|
|
333
368
|
#### `.with_streaming_response`
|
|
334
369
|
|
|
@@ -337,7 +372,12 @@ The above interface eagerly reads the full response body when you make the reque
|
|
|
337
372
|
To stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.
|
|
338
373
|
|
|
339
374
|
```python
|
|
340
|
-
with client.archives.with_streaming_response.
|
|
375
|
+
with client.archives.with_streaming_response.create(
|
|
376
|
+
embedding_config={
|
|
377
|
+
"embedding_dim": 0,
|
|
378
|
+
"embedding_endpoint_type": "openai",
|
|
379
|
+
"embedding_model": "embedding_model",
|
|
380
|
+
},
|
|
341
381
|
name="name",
|
|
342
382
|
) as response:
|
|
343
383
|
print(response.headers.get("X-My-Header"))
|
|
@@ -392,10 +432,10 @@ You can directly override the [httpx client](https://www.python-httpx.org/api/#c
|
|
|
392
432
|
|
|
393
433
|
```python
|
|
394
434
|
import httpx
|
|
395
|
-
from
|
|
435
|
+
from letta_client import Letta, DefaultHttpxClient
|
|
396
436
|
|
|
397
|
-
client =
|
|
398
|
-
# Or use the `
|
|
437
|
+
client = Letta(
|
|
438
|
+
# Or use the `LETTA_BASE_URL` env var
|
|
399
439
|
base_url="http://my.test.server.example.com:8083",
|
|
400
440
|
http_client=DefaultHttpxClient(
|
|
401
441
|
proxy="http://my.test.proxy.example.com",
|
|
@@ -415,9 +455,9 @@ client.with_options(http_client=DefaultHttpxClient(...))
|
|
|
415
455
|
By default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.
|
|
416
456
|
|
|
417
457
|
```py
|
|
418
|
-
from
|
|
458
|
+
from letta_client import Letta
|
|
419
459
|
|
|
420
|
-
with
|
|
460
|
+
with Letta() as client:
|
|
421
461
|
# make requests here
|
|
422
462
|
...
|
|
423
463
|
|
|
@@ -443,8 +483,8 @@ If you've upgraded to the latest version but aren't seeing any new features you
|
|
|
443
483
|
You can determine the version that is being used at runtime with:
|
|
444
484
|
|
|
445
485
|
```py
|
|
446
|
-
import
|
|
447
|
-
print(
|
|
486
|
+
import letta_client
|
|
487
|
+
print(letta_client.__version__)
|
|
448
488
|
```
|
|
449
489
|
|
|
450
490
|
## Requirements
|