letta-client 0.1.226__py3-none-any.whl → 1.7.2__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_client/__init__.py +91 -672
- letta_client/_base_client.py +2125 -0
- letta_client/_client.py +1136 -0
- letta_client/_compat.py +219 -0
- letta_client/_constants.py +14 -0
- letta_client/_exceptions.py +108 -0
- letta_client/_files.py +123 -0
- letta_client/_models.py +872 -0
- letta_client/_qs.py +150 -0
- letta_client/_resource.py +43 -0
- letta_client/_response.py +832 -0
- letta_client/_streaming.py +371 -0
- letta_client/_types.py +270 -0
- letta_client/_utils/__init__.py +64 -0
- letta_client/_utils/_compat.py +45 -0
- letta_client/_utils/_datetime_parse.py +136 -0
- letta_client/_utils/_logs.py +25 -0
- letta_client/_utils/_proxy.py +65 -0
- letta_client/_utils/_reflection.py +42 -0
- letta_client/_utils/_resources_proxy.py +24 -0
- letta_client/_utils/_streams.py +12 -0
- letta_client/_utils/_sync.py +58 -0
- letta_client/_utils/_transform.py +457 -0
- letta_client/_utils/_typing.py +156 -0
- letta_client/_utils/_utils.py +421 -0
- letta_client/_version.py +4 -0
- letta_client/lib/.keep +4 -0
- letta_client/pagination.py +280 -0
- letta_client/resources/__init__.py +215 -0
- letta_client/resources/access_tokens.py +396 -0
- letta_client/resources/agents/__init__.py +131 -0
- letta_client/resources/agents/agents.py +2148 -0
- letta_client/resources/agents/archives.py +260 -0
- letta_client/resources/agents/blocks.py +736 -0
- letta_client/resources/agents/files.py +541 -0
- letta_client/resources/agents/folders.py +422 -0
- letta_client/resources/agents/identities.py +260 -0
- letta_client/resources/agents/messages.py +1800 -0
- letta_client/resources/agents/passages.py +638 -0
- letta_client/resources/agents/tools.py +651 -0
- letta_client/resources/archives/__init__.py +33 -0
- letta_client/resources/archives/archives.py +650 -0
- letta_client/resources/archives/passages.py +309 -0
- letta_client/resources/blocks/__init__.py +33 -0
- letta_client/resources/blocks/agents.py +289 -0
- letta_client/resources/blocks/blocks.py +977 -0
- letta_client/resources/conversations/__init__.py +33 -0
- letta_client/resources/conversations/conversations.py +611 -0
- letta_client/resources/conversations/messages.py +650 -0
- letta_client/resources/folders/__init__.py +47 -0
- letta_client/resources/folders/agents.py +234 -0
- letta_client/resources/folders/files.py +581 -0
- letta_client/resources/folders/folders.py +734 -0
- letta_client/resources/mcp_servers/__init__.py +33 -0
- letta_client/resources/mcp_servers/mcp_servers.py +670 -0
- letta_client/resources/mcp_servers/tools.py +351 -0
- letta_client/resources/messages.py +455 -0
- letta_client/resources/models/__init__.py +33 -0
- letta_client/resources/models/embeddings.py +149 -0
- letta_client/resources/models/models.py +233 -0
- letta_client/resources/passages.py +259 -0
- letta_client/resources/runs/__init__.py +75 -0
- letta_client/resources/runs/messages.py +363 -0
- letta_client/resources/runs/runs.py +502 -0
- letta_client/resources/runs/steps.py +229 -0
- letta_client/resources/runs/trace.py +197 -0
- letta_client/resources/runs/usage.py +163 -0
- 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 +505 -0
- letta_client/resources/steps/trace.py +169 -0
- letta_client/resources/tags.py +240 -0
- letta_client/resources/templates/__init__.py +33 -0
- letta_client/resources/templates/agents.py +229 -0
- letta_client/resources/templates/templates.py +540 -0
- letta_client/resources/tools.py +1721 -0
- letta_client/types/__init__.py +148 -530
- letta_client/types/access_token_create_params.py +32 -0
- letta_client/types/access_token_create_response.py +34 -0
- letta_client/types/access_token_delete_params.py +11 -0
- letta_client/types/access_token_list_params.py +23 -0
- letta_client/types/access_token_list_response.py +40 -0
- letta_client/types/agent_create_params.py +444 -0
- letta_client/types/agent_environment_variable.py +40 -63
- letta_client/types/agent_export_file_params.py +26 -0
- letta_client/types/agent_export_file_response.py +7 -0
- letta_client/types/agent_import_file_params.py +57 -0
- letta_client/types/agent_import_file_response.py +14 -0
- letta_client/types/agent_list_params.py +100 -0
- letta_client/types/agent_retrieve_params.py +37 -0
- letta_client/types/agent_state.py +651 -138
- letta_client/types/agent_type.py +14 -14
- letta_client/types/agent_update_params.py +386 -0
- letta_client/types/agents/__init__.py +76 -0
- letta_client/types/agents/approval_create_param.py +35 -0
- letta_client/types/agents/approval_request_message.py +57 -0
- letta_client/types/agents/approval_response_message.py +61 -0
- letta_client/types/agents/approval_return.py +22 -0
- letta_client/types/agents/approval_return_param.py +22 -0
- letta_client/types/agents/assistant_message.py +48 -0
- letta_client/types/agents/block.py +68 -0
- letta_client/types/agents/block_list_params.py +34 -0
- letta_client/types/agents/block_update_params.py +63 -0
- letta_client/types/agents/event_message.py +40 -0
- letta_client/types/agents/file_close_all_response.py +8 -0
- letta_client/types/agents/file_list_params.py +40 -0
- letta_client/types/agents/file_list_response.py +42 -0
- letta_client/types/agents/file_open_response.py +8 -0
- letta_client/types/agents/folder_list_params.py +34 -0
- letta_client/types/agents/folder_list_response.py +49 -0
- letta_client/types/agents/hidden_reasoning_message.py +49 -0
- letta_client/types/agents/image_content.py +67 -0
- letta_client/types/agents/image_content_param.py +64 -0
- letta_client/types/agents/internal_message.py +271 -0
- letta_client/types/agents/job_status.py +7 -0
- letta_client/types/agents/job_type.py +7 -0
- letta_client/types/agents/letta_assistant_message_content_union.py +19 -0
- letta_client/types/agents/letta_response.py +76 -0
- letta_client/types/agents/letta_streaming_response.py +155 -0
- letta_client/types/agents/letta_user_message_content_union.py +14 -0
- letta_client/types/agents/message.py +36 -0
- letta_client/types/agents/message_cancel_params.py +15 -0
- letta_client/types/agents/message_cancel_response.py +8 -0
- letta_client/types/agents/message_compact_params.py +145 -0
- letta_client/types/agents/message_compact_response.py +13 -0
- letta_client/types/agents/message_create_async_params.py +145 -0
- letta_client/types/agents/message_create_params.py +181 -0
- letta_client/types/agents/message_list_params.py +55 -0
- letta_client/types/agents/message_reset_params.py +12 -0
- letta_client/types/agents/message_role.py +7 -0
- letta_client/types/agents/message_stream_params.py +166 -0
- letta_client/types/agents/message_type.py +17 -0
- letta_client/types/agents/omitted_reasoning_content.py +20 -0
- letta_client/types/agents/omitted_reasoning_content_param.py +20 -0
- letta_client/types/agents/passage_create_params.py +23 -0
- letta_client/types/agents/passage_create_response.py +10 -0
- letta_client/types/agents/passage_list_params.py +28 -0
- letta_client/types/agents/passage_list_response.py +10 -0
- letta_client/types/agents/passage_search_params.py +35 -0
- letta_client/types/agents/passage_search_response.py +29 -0
- letta_client/types/agents/reasoning_content.py +27 -0
- letta_client/types/agents/reasoning_content_param.py +27 -0
- letta_client/types/agents/reasoning_message.py +50 -0
- letta_client/types/agents/redacted_reasoning_content.py +18 -0
- letta_client/types/agents/redacted_reasoning_content_param.py +17 -0
- letta_client/types/agents/run.py +91 -0
- letta_client/types/agents/summary_message.py +38 -0
- letta_client/types/agents/system_message.py +46 -0
- letta_client/types/agents/text_content.py +19 -0
- letta_client/types/agents/text_content_param.py +19 -0
- letta_client/types/agents/tool_call.py +13 -0
- letta_client/types/agents/tool_call_content.py +28 -0
- letta_client/types/agents/tool_call_content_param.py +28 -0
- letta_client/types/agents/tool_call_delta.py +15 -0
- letta_client/types/agents/tool_call_message.py +52 -0
- letta_client/types/agents/tool_execution_result.py +33 -0
- letta_client/types/agents/tool_list_params.py +34 -0
- letta_client/types/agents/tool_return.py +29 -0
- letta_client/types/agents/tool_return_content.py +22 -0
- letta_client/types/agents/tool_return_content_param.py +21 -0
- letta_client/types/agents/tool_return_param.py +30 -0
- letta_client/types/agents/tool_run_params.py +16 -0
- letta_client/types/agents/tool_update_approval_params.py +21 -0
- letta_client/types/agents/user_message.py +50 -0
- letta_client/types/anthropic_model_settings.py +62 -0
- letta_client/types/anthropic_model_settings_param.py +59 -0
- letta_client/types/archive.py +46 -0
- letta_client/types/archive_create_params.py +22 -0
- letta_client/types/archive_list_params.py +40 -0
- letta_client/types/archive_update_params.py +14 -0
- letta_client/types/archives/__init__.py +5 -0
- letta_client/types/archives/passage_create_params.py +21 -0
- letta_client/types/azure_model_settings.py +36 -0
- letta_client/types/azure_model_settings_param.py +33 -0
- letta_client/types/bedrock_model_settings.py +36 -0
- letta_client/types/bedrock_model_settings_param.py +33 -0
- letta_client/types/block_create_params.py +59 -0
- letta_client/types/block_list_params.py +102 -0
- letta_client/types/block_response.py +66 -0
- letta_client/types/block_update_params.py +60 -0
- letta_client/types/blocks/__init__.py +5 -0
- letta_client/types/blocks/agent_list_params.py +61 -0
- letta_client/types/child_tool_rule.py +37 -26
- letta_client/types/child_tool_rule_param.py +50 -0
- letta_client/types/conditional_tool_rule.py +19 -35
- letta_client/types/conditional_tool_rule_param.py +31 -0
- letta_client/types/continue_tool_rule.py +13 -23
- letta_client/types/continue_tool_rule_param.py +22 -0
- letta_client/types/conversation.py +42 -0
- letta_client/types/conversation_cancel_response.py +8 -0
- letta_client/types/conversation_create_params.py +25 -0
- letta_client/types/conversation_list_params.py +19 -0
- letta_client/types/conversation_list_response.py +10 -0
- letta_client/types/conversation_update_params.py +13 -0
- letta_client/types/conversations/__init__.py +7 -0
- letta_client/types/conversations/message_create_params.py +166 -0
- letta_client/types/conversations/message_list_params.py +43 -0
- letta_client/types/conversations/message_stream_params.py +28 -0
- letta_client/types/create_block_param.py +61 -0
- letta_client/types/create_sse_mcp_server_param.py +26 -0
- letta_client/types/create_stdio_mcp_server_param.py +25 -0
- letta_client/types/create_streamable_http_mcp_server_param.py +26 -0
- letta_client/types/deepseek_model_settings.py +36 -0
- letta_client/types/deepseek_model_settings_param.py +33 -0
- letta_client/types/embedding_config.py +47 -67
- letta_client/types/embedding_config_param.py +64 -0
- letta_client/types/embedding_model.py +81 -0
- letta_client/types/folder.py +28 -66
- letta_client/types/folder_create_params.py +33 -0
- letta_client/types/folder_list_params.py +37 -0
- letta_client/types/folder_update_params.py +27 -0
- letta_client/types/folders/__init__.py +12 -0
- letta_client/types/folders/agent_list_params.py +34 -0
- letta_client/types/folders/agent_list_response.py +8 -0
- letta_client/types/folders/file_list_params.py +37 -0
- letta_client/types/folders/file_list_response.py +70 -0
- letta_client/types/folders/file_retrieve_params.py +15 -0
- letta_client/types/folders/file_retrieve_response.py +70 -0
- letta_client/types/folders/file_upload_params.py +20 -0
- letta_client/types/folders/file_upload_response.py +70 -0
- letta_client/types/google_ai_model_settings.py +47 -0
- letta_client/types/google_ai_model_settings_param.py +44 -0
- letta_client/types/google_vertex_model_settings.py +47 -0
- letta_client/types/google_vertex_model_settings_param.py +44 -0
- letta_client/types/groq_model_settings.py +36 -0
- letta_client/types/groq_model_settings_param.py +33 -0
- letta_client/types/health_response.py +13 -0
- letta_client/types/init_tool_rule.py +24 -24
- letta_client/types/init_tool_rule_param.py +32 -0
- letta_client/types/json_object_response_format.py +9 -17
- letta_client/types/json_object_response_format_param.py +14 -0
- letta_client/types/json_schema_response_format.py +12 -21
- letta_client/types/json_schema_response_format_param.py +18 -0
- letta_client/types/letta_message_content_union_param.py +26 -0
- letta_client/types/llm_config.py +124 -75
- letta_client/types/llm_config_param.py +155 -0
- letta_client/types/max_count_per_step_tool_rule.py +16 -25
- letta_client/types/max_count_per_step_tool_rule_param.py +28 -0
- letta_client/types/mcp_server_create_params.py +23 -0
- letta_client/types/mcp_server_create_response.py +12 -0
- letta_client/types/mcp_server_list_response.py +14 -0
- letta_client/types/mcp_server_refresh_params.py +12 -0
- letta_client/types/mcp_server_retrieve_response.py +12 -0
- letta_client/types/mcp_server_update_params.py +23 -0
- letta_client/types/mcp_server_update_response.py +12 -0
- letta_client/types/mcp_servers/__init__.py +6 -0
- letta_client/types/mcp_servers/tool_list_response.py +10 -0
- letta_client/types/mcp_servers/tool_run_params.py +15 -0
- letta_client/types/message_create_param.py +38 -0
- letta_client/types/message_list_params.py +34 -0
- letta_client/types/message_list_response.py +10 -0
- letta_client/types/message_retrieve_response.py +10 -0
- letta_client/types/message_search_params.py +34 -0
- letta_client/types/message_search_response.py +124 -0
- letta_client/types/model.py +148 -0
- letta_client/types/model_list_params.py +19 -0
- letta_client/types/model_list_response.py +10 -0
- letta_client/types/models/__init__.py +5 -0
- letta_client/types/models/embedding_list_response.py +10 -0
- letta_client/types/npm_requirement.py +15 -0
- letta_client/types/npm_requirement_param.py +16 -0
- letta_client/types/openai_model_settings.py +51 -0
- letta_client/types/openai_model_settings_param.py +48 -0
- letta_client/types/parent_tool_rule.py +15 -27
- letta_client/types/parent_tool_rule_param.py +27 -0
- letta_client/types/passage.py +56 -101
- letta_client/types/passage_search_params.py +41 -0
- letta_client/types/passage_search_response.py +25 -0
- letta_client/types/pip_requirement.py +9 -21
- letta_client/types/pip_requirement_param.py +16 -0
- letta_client/types/provider_category.py +5 -3
- letta_client/types/provider_trace.py +43 -48
- letta_client/types/provider_type.py +25 -23
- letta_client/types/required_before_exit_tool_rule.py +13 -23
- letta_client/types/required_before_exit_tool_rule_param.py +22 -0
- letta_client/types/requires_approval_tool_rule.py +25 -0
- letta_client/types/requires_approval_tool_rule_param.py +25 -0
- letta_client/types/run_list_params.py +67 -0
- letta_client/types/runs/__init__.py +10 -0
- letta_client/types/runs/message_list_params.py +34 -0
- letta_client/types/runs/message_stream_params.py +28 -0
- letta_client/types/runs/step_list_params.py +28 -0
- letta_client/types/runs/trace_retrieve_params.py +12 -0
- letta_client/types/runs/trace_retrieve_response.py +8 -0
- letta_client/types/runs/usage_retrieve_response.py +31 -0
- letta_client/types/sse_mcp_server.py +32 -0
- letta_client/types/stdio_mcp_server.py +29 -0
- letta_client/types/step.py +71 -97
- letta_client/types/step_list_params.py +57 -0
- letta_client/types/steps/__init__.py +8 -0
- letta_client/types/steps/feedback_create_params.py +18 -0
- letta_client/types/steps/message_list_params.py +34 -0
- letta_client/types/steps/message_list_response.py +36 -0
- letta_client/types/steps/metric_retrieve_response.py +45 -0
- letta_client/types/stop_reason_type.py +17 -5
- letta_client/types/streamable_http_mcp_server.py +32 -0
- letta_client/types/tag_list_params.py +40 -0
- letta_client/types/tag_list_response.py +8 -0
- letta_client/types/template_create_params.py +46 -0
- letta_client/types/template_create_response.py +29 -0
- letta_client/types/template_delete_response.py +9 -0
- letta_client/types/template_update_params.py +25 -0
- letta_client/types/template_update_response.py +13 -0
- letta_client/types/templates/__init__.py +6 -0
- letta_client/types/templates/agent_create_params.py +50 -0
- letta_client/types/templates/agent_create_response.py +20 -0
- letta_client/types/terminal_tool_rule.py +13 -23
- letta_client/types/terminal_tool_rule_param.py +22 -0
- letta_client/types/text_response_format.py +9 -17
- letta_client/types/text_response_format_param.py +14 -0
- letta_client/types/together_model_settings.py +36 -0
- letta_client/types/together_model_settings_param.py +33 -0
- letta_client/types/tool.py +154 -81
- letta_client/types/tool_create_params.py +53 -0
- letta_client/types/tool_list_params.py +57 -0
- letta_client/types/tool_return_message.py +44 -31
- letta_client/types/tool_search_params.py +27 -0
- letta_client/types/tool_search_response.py +10 -0
- letta_client/types/tool_search_result.py +27 -0
- letta_client/types/tool_type.py +16 -17
- letta_client/types/tool_update_params.py +57 -0
- letta_client/types/tool_upsert_params.py +53 -0
- letta_client/types/update_sse_mcp_server_param.py +26 -0
- letta_client/types/update_stdio_mcp_server_param.py +25 -0
- letta_client/types/update_streamable_http_mcp_server_param.py +26 -0
- letta_client/types/vector_db_provider.py +7 -0
- letta_client/types/xai_model_settings.py +36 -0
- letta_client/types/xai_model_settings_param.py +33 -0
- letta_client-1.7.2.dist-info/METADATA +436 -0
- letta_client-1.7.2.dist-info/RECORD +335 -0
- {letta_client-0.1.226.dist-info → letta_client-1.7.2.dist-info}/WHEEL +1 -1
- letta_client-1.7.2.dist-info/licenses/LICENSE +201 -0
- letta_client/agents/__init__.py +0 -77
- letta_client/agents/blocks/__init__.py +0 -2
- letta_client/agents/blocks/client.py +0 -793
- letta_client/agents/client.py +0 -2371
- letta_client/agents/context/__init__.py +0 -2
- letta_client/agents/context/client.py +0 -149
- letta_client/agents/core_memory/__init__.py +0 -2
- letta_client/agents/core_memory/client.py +0 -147
- letta_client/agents/files/__init__.py +0 -2
- letta_client/agents/files/client.py +0 -430
- letta_client/agents/folders/__init__.py +0 -2
- letta_client/agents/folders/client.py +0 -412
- letta_client/agents/groups/__init__.py +0 -2
- letta_client/agents/groups/client.py +0 -169
- letta_client/agents/memory_variables/__init__.py +0 -5
- letta_client/agents/memory_variables/client.py +0 -152
- letta_client/agents/memory_variables/types/__init__.py +0 -5
- letta_client/agents/memory_variables/types/memory_variables_list_response.py +0 -19
- letta_client/agents/messages/__init__.py +0 -15
- letta_client/agents/messages/client.py +0 -1638
- letta_client/agents/messages/types/__init__.py +0 -13
- letta_client/agents/messages/types/letta_streaming_response.py +0 -22
- letta_client/agents/messages/types/messages_modify_request.py +0 -11
- letta_client/agents/messages/types/messages_modify_response.py +0 -20
- letta_client/agents/messages/types/messages_preview_raw_payload_request.py +0 -7
- letta_client/agents/passages/__init__.py +0 -2
- letta_client/agents/passages/client.py +0 -793
- letta_client/agents/sources/__init__.py +0 -2
- letta_client/agents/sources/client.py +0 -412
- letta_client/agents/templates/__init__.py +0 -5
- letta_client/agents/templates/client.py +0 -588
- letta_client/agents/templates/types/__init__.py +0 -7
- letta_client/agents/templates/types/templates_create_response.py +0 -22
- letta_client/agents/templates/types/templates_create_version_request_return_agent_state.py +0 -5
- letta_client/agents/templates/types/templates_migrate_response.py +0 -19
- letta_client/agents/tools/__init__.py +0 -2
- letta_client/agents/tools/client.py +0 -412
- letta_client/agents/types/__init__.py +0 -33
- letta_client/agents/types/agents_search_request_search_item.py +0 -16
- letta_client/agents/types/agents_search_request_search_item_field.py +0 -22
- letta_client/agents/types/agents_search_request_search_item_field_operator.py +0 -5
- letta_client/agents/types/agents_search_request_search_item_one.py +0 -22
- letta_client/agents/types/agents_search_request_search_item_one_operator.py +0 -5
- letta_client/agents/types/agents_search_request_search_item_three.py +0 -21
- letta_client/agents/types/agents_search_request_search_item_two.py +0 -21
- letta_client/agents/types/agents_search_request_search_item_zero.py +0 -20
- letta_client/agents/types/agents_search_request_sort_by.py +0 -5
- letta_client/agents/types/agents_search_response.py +0 -23
- letta_client/agents/types/create_agent_request_response_format.py +0 -8
- letta_client/agents/types/create_agent_request_tool_rules_item.py +0 -22
- letta_client/agents/types/update_agent_response_format.py +0 -8
- letta_client/agents/types/update_agent_tool_rules_item.py +0 -22
- letta_client/base_client.py +0 -232
- letta_client/batches/__init__.py +0 -2
- letta_client/batches/client.py +0 -587
- letta_client/blocks/__init__.py +0 -5
- letta_client/blocks/agents/__init__.py +0 -2
- letta_client/blocks/agents/client.py +0 -171
- letta_client/blocks/client.py +0 -1038
- letta_client/client.py +0 -661
- letta_client/client_side_access_tokens/__init__.py +0 -29
- letta_client/client_side_access_tokens/client.py +0 -524
- letta_client/client_side_access_tokens/types/__init__.py +0 -43
- letta_client/client_side_access_tokens/types/client_side_access_tokens_create_request_policy_item.py +0 -24
- letta_client/client_side_access_tokens/types/client_side_access_tokens_create_request_policy_item_access_item.py +0 -7
- letta_client/client_side_access_tokens/types/client_side_access_tokens_create_response.py +0 -25
- letta_client/client_side_access_tokens/types/client_side_access_tokens_create_response_policy.py +0 -23
- letta_client/client_side_access_tokens/types/client_side_access_tokens_create_response_policy_data_item.py +0 -24
- letta_client/client_side_access_tokens/types/client_side_access_tokens_create_response_policy_data_item_access_item.py +0 -7
- letta_client/client_side_access_tokens/types/client_side_access_tokens_list_client_side_access_tokens_response.py +0 -25
- letta_client/client_side_access_tokens/types/client_side_access_tokens_list_client_side_access_tokens_response_tokens_item.py +0 -27
- letta_client/client_side_access_tokens/types/client_side_access_tokens_list_client_side_access_tokens_response_tokens_item_policy.py +0 -23
- letta_client/client_side_access_tokens/types/client_side_access_tokens_list_client_side_access_tokens_response_tokens_item_policy_data_item.py +0 -24
- letta_client/client_side_access_tokens/types/client_side_access_tokens_list_client_side_access_tokens_response_tokens_item_policy_data_item_access_item.py +0 -7
- letta_client/core/__init__.py +0 -51
- letta_client/core/api_error.py +0 -15
- letta_client/core/client_wrapper.py +0 -77
- letta_client/core/datetime_utils.py +0 -28
- letta_client/core/file.py +0 -67
- letta_client/core/http_client.py +0 -499
- letta_client/core/jsonable_encoder.py +0 -101
- letta_client/core/pydantic_utilities.py +0 -296
- letta_client/core/query_encoder.py +0 -58
- letta_client/core/remove_none_from_dict.py +0 -11
- letta_client/core/request_options.py +0 -35
- letta_client/core/serialization.py +0 -272
- letta_client/core/unchecked_base_model.py +0 -305
- letta_client/embedding_models/__init__.py +0 -2
- letta_client/embedding_models/client.py +0 -136
- letta_client/environment.py +0 -8
- letta_client/errors/__init__.py +0 -17
- letta_client/errors/bad_request_error.py +0 -9
- letta_client/errors/conflict_error.py +0 -9
- letta_client/errors/internal_server_error.py +0 -9
- letta_client/errors/not_found_error.py +0 -9
- letta_client/errors/payment_required_error.py +0 -9
- letta_client/errors/unprocessable_entity_error.py +0 -9
- letta_client/folders/__init__.py +0 -5
- letta_client/folders/client.py +0 -1307
- letta_client/folders/files/__init__.py +0 -2
- letta_client/folders/files/client.py +0 -474
- letta_client/folders/passages/__init__.py +0 -2
- letta_client/folders/passages/client.py +0 -189
- letta_client/groups/__init__.py +0 -14
- letta_client/groups/client.py +0 -964
- letta_client/groups/messages/__init__.py +0 -5
- letta_client/groups/messages/client.py +0 -1015
- letta_client/groups/messages/types/__init__.py +0 -7
- letta_client/groups/messages/types/letta_streaming_response.py +0 -20
- letta_client/groups/messages/types/messages_modify_request.py +0 -11
- letta_client/groups/messages/types/messages_modify_response.py +0 -20
- letta_client/groups/types/__init__.py +0 -6
- letta_client/groups/types/group_create_manager_config.py +0 -12
- letta_client/groups/types/group_update_manager_config.py +0 -16
- letta_client/health/__init__.py +0 -2
- letta_client/health/client.py +0 -110
- letta_client/identities/__init__.py +0 -5
- letta_client/identities/client.py +0 -1201
- letta_client/identities/properties/__init__.py +0 -2
- letta_client/identities/properties/client.py +0 -183
- letta_client/jobs/__init__.py +0 -2
- letta_client/jobs/client.py +0 -749
- letta_client/messages/__init__.py +0 -2
- letta_client/messages/client.py +0 -213
- letta_client/models/__init__.py +0 -2
- letta_client/models/client.py +0 -174
- letta_client/projects/__init__.py +0 -5
- letta_client/projects/client.py +0 -150
- letta_client/projects/types/__init__.py +0 -6
- letta_client/projects/types/projects_list_response.py +0 -23
- letta_client/projects/types/projects_list_response_projects_item.py +0 -21
- letta_client/providers/__init__.py +0 -2
- letta_client/providers/client.py +0 -789
- letta_client/runs/__init__.py +0 -5
- letta_client/runs/client.py +0 -551
- letta_client/runs/messages/__init__.py +0 -2
- letta_client/runs/messages/client.py +0 -236
- letta_client/runs/steps/__init__.py +0 -2
- letta_client/runs/steps/client.py +0 -219
- letta_client/runs/usage/__init__.py +0 -2
- letta_client/runs/usage/client.py +0 -147
- letta_client/sources/__init__.py +0 -5
- letta_client/sources/client.py +0 -1462
- letta_client/sources/files/__init__.py +0 -2
- letta_client/sources/files/client.py +0 -474
- letta_client/sources/passages/__init__.py +0 -2
- letta_client/sources/passages/client.py +0 -189
- letta_client/steps/__init__.py +0 -6
- letta_client/steps/client.py +0 -408
- letta_client/steps/feedback/__init__.py +0 -2
- letta_client/steps/feedback/client.py +0 -168
- letta_client/steps/types/__init__.py +0 -5
- letta_client/steps/types/steps_list_request_feedback.py +0 -5
- letta_client/tags/__init__.py +0 -2
- letta_client/tags/client.py +0 -171
- letta_client/telemetry/__init__.py +0 -2
- letta_client/telemetry/client.py +0 -145
- letta_client/templates/__init__.py +0 -18
- letta_client/templates/agents/__init__.py +0 -13
- letta_client/templates/agents/client.py +0 -256
- letta_client/templates/agents/types/__init__.py +0 -11
- letta_client/templates/agents/types/agents_create_request_initial_message_sequence_item.py +0 -26
- letta_client/templates/agents/types/agents_create_request_initial_message_sequence_item_role.py +0 -7
- letta_client/templates/agents/types/agents_create_response.py +0 -20
- letta_client/templates/client.py +0 -162
- letta_client/templates/types/__init__.py +0 -6
- letta_client/templates/types/templates_list_response.py +0 -23
- letta_client/templates/types/templates_list_response_templates_item.py +0 -20
- letta_client/tools/__init__.py +0 -27
- letta_client/tools/client.py +0 -3063
- letta_client/tools/types/__init__.py +0 -25
- letta_client/tools/types/add_mcp_server_request.py +0 -8
- letta_client/tools/types/add_mcp_server_response_item.py +0 -8
- letta_client/tools/types/connect_mcp_server_request.py +0 -8
- letta_client/tools/types/connect_mcp_server_response_event.py +0 -8
- letta_client/tools/types/delete_mcp_server_response_item.py +0 -8
- letta_client/tools/types/list_mcp_servers_response_value.py +0 -8
- letta_client/tools/types/streaming_response.py +0 -23
- letta_client/tools/types/test_mcp_server_request.py +0 -8
- letta_client/tools/types/update_mcp_server_request.py +0 -8
- letta_client/tools/types/update_mcp_server_response.py +0 -8
- letta_client/types/action_model.py +0 -38
- letta_client/types/action_parameters_model.py +0 -27
- letta_client/types/action_response_model.py +0 -27
- letta_client/types/agent_schema.py +0 -49
- letta_client/types/agent_schema_tool_rules_item.py +0 -11
- letta_client/types/agent_state_response_format.py +0 -8
- letta_client/types/agent_state_tool_rules_item.py +0 -22
- letta_client/types/app_auth_scheme.py +0 -34
- letta_client/types/app_auth_scheme_auth_mode.py +0 -19
- letta_client/types/app_model.py +0 -44
- letta_client/types/assistant_message.py +0 -42
- letta_client/types/assistant_message_content.py +0 -6
- letta_client/types/audio.py +0 -19
- letta_client/types/auth_request.py +0 -22
- letta_client/types/auth_response.py +0 -29
- letta_client/types/auth_scheme_field.py +0 -30
- letta_client/types/bad_request_error_body.py +0 -19
- letta_client/types/base_64_image.py +0 -33
- letta_client/types/base_tool_rule_schema.py +0 -20
- letta_client/types/batch_job.py +0 -81
- letta_client/types/block.py +0 -97
- letta_client/types/block_update.py +0 -71
- letta_client/types/chat_completion_assistant_message_param.py +0 -29
- letta_client/types/chat_completion_assistant_message_param_content.py +0 -8
- letta_client/types/chat_completion_assistant_message_param_content_item.py +0 -9
- letta_client/types/chat_completion_audio_param.py +0 -22
- letta_client/types/chat_completion_audio_param_format.py +0 -5
- letta_client/types/chat_completion_audio_param_voice.py +0 -18
- letta_client/types/chat_completion_content_part_image_param.py +0 -21
- letta_client/types/chat_completion_content_part_input_audio_param.py +0 -21
- letta_client/types/chat_completion_content_part_refusal_param.py +0 -20
- letta_client/types/chat_completion_content_part_text_param.py +0 -20
- letta_client/types/chat_completion_developer_message_param.py +0 -22
- letta_client/types/chat_completion_developer_message_param_content.py +0 -6
- letta_client/types/chat_completion_function_call_option_param.py +0 -19
- letta_client/types/chat_completion_function_message_param.py +0 -21
- letta_client/types/chat_completion_message_tool_call.py +0 -22
- letta_client/types/chat_completion_message_tool_call_param.py +0 -24
- letta_client/types/chat_completion_named_tool_choice_param.py +0 -23
- letta_client/types/chat_completion_prediction_content_param.py +0 -21
- letta_client/types/chat_completion_prediction_content_param_content.py +0 -6
- letta_client/types/chat_completion_stream_options_param.py +0 -19
- letta_client/types/chat_completion_system_message_param.py +0 -22
- letta_client/types/chat_completion_system_message_param_content.py +0 -6
- letta_client/types/chat_completion_tool_message_param.py +0 -22
- letta_client/types/chat_completion_tool_message_param_content.py +0 -6
- letta_client/types/chat_completion_tool_param.py +0 -21
- letta_client/types/chat_completion_user_message_param.py +0 -22
- letta_client/types/chat_completion_user_message_param_content.py +0 -6
- letta_client/types/chat_completion_user_message_param_content_item.py +0 -14
- letta_client/types/child_tool_rule_schema.py +0 -21
- letta_client/types/code_input.py +0 -22
- letta_client/types/completion_create_params_non_streaming.py +0 -64
- letta_client/types/completion_create_params_non_streaming_function_call.py +0 -8
- letta_client/types/completion_create_params_non_streaming_messages_item.py +0 -18
- letta_client/types/completion_create_params_non_streaming_modalities_item.py +0 -5
- letta_client/types/completion_create_params_non_streaming_model.py +0 -62
- letta_client/types/completion_create_params_non_streaming_reasoning_effort.py +0 -5
- letta_client/types/completion_create_params_non_streaming_response_format.py +0 -10
- letta_client/types/completion_create_params_non_streaming_service_tier.py +0 -7
- letta_client/types/completion_create_params_non_streaming_stop.py +0 -5
- letta_client/types/completion_create_params_non_streaming_tool_choice.py +0 -8
- letta_client/types/completion_create_params_streaming.py +0 -64
- letta_client/types/completion_create_params_streaming_function_call.py +0 -8
- letta_client/types/completion_create_params_streaming_messages_item.py +0 -18
- letta_client/types/completion_create_params_streaming_modalities_item.py +0 -5
- letta_client/types/completion_create_params_streaming_model.py +0 -62
- letta_client/types/completion_create_params_streaming_reasoning_effort.py +0 -5
- letta_client/types/completion_create_params_streaming_response_format.py +0 -10
- letta_client/types/completion_create_params_streaming_service_tier.py +0 -7
- letta_client/types/completion_create_params_streaming_stop.py +0 -5
- letta_client/types/completion_create_params_streaming_tool_choice.py +0 -8
- letta_client/types/components_schemas_text_content.py +0 -5
- letta_client/types/conditional_tool_rule_schema.py +0 -23
- letta_client/types/conflict_error_body.py +0 -21
- letta_client/types/context_window_overview.py +0 -108
- letta_client/types/core_memory_block_schema.py +0 -31
- letta_client/types/create_block.py +0 -67
- letta_client/types/duplicate_file_handling.py +0 -5
- letta_client/types/dynamic_manager.py +0 -33
- letta_client/types/dynamic_manager_update.py +0 -33
- letta_client/types/e_2_b_sandbox_config.py +0 -32
- letta_client/types/embedding_config_embedding_endpoint_type.py +0 -29
- letta_client/types/feedback_type.py +0 -5
- letta_client/types/file.py +0 -21
- letta_client/types/file_block.py +0 -103
- letta_client/types/file_file.py +0 -21
- letta_client/types/file_metadata.py +0 -108
- letta_client/types/file_processing_status.py +0 -5
- letta_client/types/file_stats.py +0 -36
- letta_client/types/function_call.py +0 -20
- letta_client/types/function_definition_input.py +0 -22
- letta_client/types/function_definition_output.py +0 -22
- letta_client/types/function_output.py +0 -20
- letta_client/types/function_tool.py +0 -21
- letta_client/types/generate_tool_input.py +0 -42
- letta_client/types/generate_tool_output.py +0 -33
- letta_client/types/group.py +0 -88
- letta_client/types/health.py +0 -24
- letta_client/types/hidden_reasoning_message.py +0 -43
- letta_client/types/hidden_reasoning_message_state.py +0 -5
- letta_client/types/http_validation_error.py +0 -20
- letta_client/types/identity.py +0 -59
- letta_client/types/identity_property.py +0 -38
- letta_client/types/identity_property_type.py +0 -5
- letta_client/types/identity_property_value.py +0 -5
- letta_client/types/identity_type.py +0 -5
- letta_client/types/image_content.py +0 -24
- letta_client/types/image_content_source.py +0 -8
- letta_client/types/image_url.py +0 -21
- letta_client/types/image_url_detail.py +0 -5
- letta_client/types/input_audio.py +0 -21
- letta_client/types/input_audio_format.py +0 -5
- letta_client/types/internal_server_error_body.py +0 -19
- letta_client/types/job.py +0 -96
- letta_client/types/job_status.py +0 -7
- letta_client/types/job_type.py +0 -5
- letta_client/types/json_schema.py +0 -26
- letta_client/types/letta_batch_messages.py +0 -20
- letta_client/types/letta_batch_request.py +0 -59
- letta_client/types/letta_image.py +0 -38
- letta_client/types/letta_message_content_union.py +0 -13
- letta_client/types/letta_message_union.py +0 -20
- letta_client/types/letta_request.py +0 -54
- letta_client/types/letta_request_config.py +0 -38
- letta_client/types/letta_response.py +0 -40
- letta_client/types/letta_stop_reason.py +0 -32
- letta_client/types/letta_streaming_request.py +0 -59
- letta_client/types/letta_usage_statistics.py +0 -59
- letta_client/types/letta_user_message_content_union.py +0 -7
- letta_client/types/llm_config_model_endpoint_type.py +0 -31
- letta_client/types/llm_config_reasoning_effort.py +0 -5
- letta_client/types/local_sandbox_config.py +0 -38
- letta_client/types/manager_type.py +0 -7
- letta_client/types/max_count_per_step_tool_rule_schema.py +0 -21
- letta_client/types/mcp_server_type.py +0 -5
- letta_client/types/mcp_tool.py +0 -38
- letta_client/types/memory.py +0 -38
- letta_client/types/message.py +0 -139
- letta_client/types/message_content_item.py +0 -20
- letta_client/types/message_create.py +0 -58
- letta_client/types/message_create_content.py +0 -6
- letta_client/types/message_create_role.py +0 -5
- letta_client/types/message_role.py +0 -5
- letta_client/types/message_schema.py +0 -29
- letta_client/types/message_type.py +0 -16
- letta_client/types/not_found_error_body.py +0 -19
- letta_client/types/not_found_error_body_message.py +0 -11
- letta_client/types/omitted_reasoning_content.py +0 -19
- letta_client/types/openai_types_chat_chat_completion_message_tool_call_param_function.py +0 -20
- letta_client/types/openai_types_chat_chat_completion_named_tool_choice_param_function.py +0 -19
- letta_client/types/openai_types_chat_completion_create_params_function.py +0 -21
- letta_client/types/organization.py +0 -38
- letta_client/types/organization_create.py +0 -27
- letta_client/types/organization_sources_stats.py +0 -42
- letta_client/types/organization_update.py +0 -27
- letta_client/types/parameter_properties.py +0 -20
- letta_client/types/parameters_schema.py +0 -22
- letta_client/types/payment_required_error_body.py +0 -20
- letta_client/types/provider.py +0 -65
- letta_client/types/provider_check.py +0 -38
- letta_client/types/reasoning_content.py +0 -33
- letta_client/types/reasoning_message.py +0 -44
- letta_client/types/reasoning_message_source.py +0 -5
- letta_client/types/redacted_reasoning_content.py +0 -23
- letta_client/types/response_format_json_object.py +0 -19
- letta_client/types/response_format_json_schema.py +0 -21
- letta_client/types/response_format_text.py +0 -19
- letta_client/types/round_robin_manager.py +0 -23
- letta_client/types/round_robin_manager_update.py +0 -23
- letta_client/types/run.py +0 -99
- letta_client/types/sandbox_config.py +0 -54
- letta_client/types/sandbox_config_create.py +0 -23
- letta_client/types/sandbox_config_create_config.py +0 -7
- letta_client/types/sandbox_config_update.py +0 -27
- letta_client/types/sandbox_config_update_config.py +0 -7
- letta_client/types/sandbox_environment_variable.py +0 -63
- letta_client/types/sandbox_environment_variable_create.py +0 -32
- letta_client/types/sandbox_environment_variable_update.py +0 -32
- letta_client/types/sandbox_type.py +0 -5
- letta_client/types/sleeptime_manager.py +0 -28
- letta_client/types/sleeptime_manager_update.py +0 -28
- letta_client/types/source.py +0 -81
- letta_client/types/source_create.py +0 -57
- letta_client/types/source_stats.py +0 -47
- letta_client/types/source_update.py +0 -47
- letta_client/types/sse_server_config.py +0 -55
- letta_client/types/stdio_server_config.py +0 -39
- letta_client/types/step_feedback.py +0 -5
- letta_client/types/streamable_http_server_config.py +0 -55
- letta_client/types/supervisor_manager.py +0 -23
- letta_client/types/supervisor_manager_update.py +0 -23
- letta_client/types/system_message.py +0 -41
- letta_client/types/tag_schema.py +0 -19
- letta_client/types/text_content.py +0 -23
- letta_client/types/tool_annotations.py +0 -36
- letta_client/types/tool_call.py +0 -21
- letta_client/types/tool_call_content.py +0 -33
- letta_client/types/tool_call_delta.py +0 -21
- letta_client/types/tool_call_message.py +0 -39
- letta_client/types/tool_call_message_tool_call.py +0 -7
- letta_client/types/tool_create.py +0 -58
- letta_client/types/tool_env_var_schema.py +0 -23
- letta_client/types/tool_json_schema.py +0 -24
- letta_client/types/tool_return.py +0 -33
- letta_client/types/tool_return_content.py +0 -33
- letta_client/types/tool_return_message_status.py +0 -5
- letta_client/types/tool_return_status.py +0 -5
- letta_client/types/tool_schema.py +0 -35
- letta_client/types/update_assistant_message.py +0 -24
- letta_client/types/update_assistant_message_content.py +0 -6
- letta_client/types/update_reasoning_message.py +0 -20
- letta_client/types/update_ssemcp_server.py +0 -41
- letta_client/types/update_stdio_mcp_server.py +0 -32
- letta_client/types/update_streamable_httpmcp_server.py +0 -46
- letta_client/types/update_system_message.py +0 -23
- letta_client/types/update_user_message.py +0 -24
- letta_client/types/update_user_message_content.py +0 -6
- letta_client/types/url_image.py +0 -23
- letta_client/types/usage_statistics.py +0 -25
- letta_client/types/usage_statistics_completion_token_details.py +0 -19
- letta_client/types/usage_statistics_prompt_token_details.py +0 -19
- letta_client/types/user.py +0 -52
- letta_client/types/user_create.py +0 -22
- letta_client/types/user_message.py +0 -42
- letta_client/types/user_message_content.py +0 -6
- letta_client/types/user_update.py +0 -27
- letta_client/types/validation_error.py +0 -22
- letta_client/types/validation_error_loc_item.py +0 -5
- letta_client/types/voice_sleeptime_manager.py +0 -33
- letta_client/types/voice_sleeptime_manager_update.py +0 -33
- letta_client/types/web_search_options.py +0 -22
- letta_client/types/web_search_options_search_context_size.py +0 -5
- letta_client/types/web_search_options_user_location.py +0 -21
- letta_client/types/web_search_options_user_location_approximate.py +0 -22
- letta_client/version.py +0 -3
- letta_client/voice/__init__.py +0 -2
- letta_client/voice/client.py +0 -177
- letta_client-0.1.226.dist-info/METADATA +0 -190
- letta_client-0.1.226.dist-info/RECORD +0 -452
|
@@ -0,0 +1,650 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Any, List, Union, Iterable, Optional, cast
|
|
6
|
+
from typing_extensions import Literal
|
|
7
|
+
|
|
8
|
+
import httpx
|
|
9
|
+
|
|
10
|
+
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
|
|
11
|
+
from ..._utils import maybe_transform, async_maybe_transform
|
|
12
|
+
from ..._compat import cached_property
|
|
13
|
+
from ..._resource import SyncAPIResource, AsyncAPIResource
|
|
14
|
+
from ..._response import (
|
|
15
|
+
to_raw_response_wrapper,
|
|
16
|
+
to_streamed_response_wrapper,
|
|
17
|
+
async_to_raw_response_wrapper,
|
|
18
|
+
async_to_streamed_response_wrapper,
|
|
19
|
+
)
|
|
20
|
+
from ..._streaming import Stream, AsyncStream
|
|
21
|
+
from ...pagination import SyncArrayPage, AsyncArrayPage
|
|
22
|
+
from ..._base_client import AsyncPaginator, make_request_options
|
|
23
|
+
from ...types.conversations import message_list_params, message_create_params, message_stream_params
|
|
24
|
+
from ...types.agents.message import Message
|
|
25
|
+
from ...types.agents.message_type import MessageType
|
|
26
|
+
from ...types.agents.letta_streaming_response import LettaStreamingResponse
|
|
27
|
+
|
|
28
|
+
__all__ = ["MessagesResource", "AsyncMessagesResource"]
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class MessagesResource(SyncAPIResource):
|
|
32
|
+
@cached_property
|
|
33
|
+
def with_raw_response(self) -> MessagesResourceWithRawResponse:
|
|
34
|
+
"""
|
|
35
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
36
|
+
the raw response object instead of the parsed content.
|
|
37
|
+
|
|
38
|
+
For more information, see https://www.github.com/letta-ai/letta-python#accessing-raw-response-data-eg-headers
|
|
39
|
+
"""
|
|
40
|
+
return MessagesResourceWithRawResponse(self)
|
|
41
|
+
|
|
42
|
+
@cached_property
|
|
43
|
+
def with_streaming_response(self) -> MessagesResourceWithStreamingResponse:
|
|
44
|
+
"""
|
|
45
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
46
|
+
|
|
47
|
+
For more information, see https://www.github.com/letta-ai/letta-python#with_streaming_response
|
|
48
|
+
"""
|
|
49
|
+
return MessagesResourceWithStreamingResponse(self)
|
|
50
|
+
|
|
51
|
+
def create(
|
|
52
|
+
self,
|
|
53
|
+
conversation_id: str,
|
|
54
|
+
*,
|
|
55
|
+
assistant_message_tool_kwarg: str | Omit = omit,
|
|
56
|
+
assistant_message_tool_name: str | Omit = omit,
|
|
57
|
+
background: bool | Omit = omit,
|
|
58
|
+
client_tools: Optional[Iterable[message_create_params.ClientTool]] | Omit = omit,
|
|
59
|
+
enable_thinking: str | Omit = omit,
|
|
60
|
+
include_pings: bool | Omit = omit,
|
|
61
|
+
include_return_message_types: Optional[List[MessageType]] | Omit = omit,
|
|
62
|
+
input: Union[str, Iterable[message_create_params.InputUnionMember1], None] | Omit = omit,
|
|
63
|
+
max_steps: int | Omit = omit,
|
|
64
|
+
messages: Optional[Iterable[message_create_params.Message]] | Omit = omit,
|
|
65
|
+
override_model: Optional[str] | Omit = omit,
|
|
66
|
+
stream_tokens: bool | Omit = omit,
|
|
67
|
+
streaming: bool | Omit = omit,
|
|
68
|
+
use_assistant_message: bool | Omit = omit,
|
|
69
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
70
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
71
|
+
extra_headers: Headers | None = None,
|
|
72
|
+
extra_query: Query | None = None,
|
|
73
|
+
extra_body: Body | None = None,
|
|
74
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
75
|
+
) -> Stream[LettaStreamingResponse]:
|
|
76
|
+
"""
|
|
77
|
+
Send a message to a conversation and get a streaming response.
|
|
78
|
+
|
|
79
|
+
This endpoint sends a message to an existing conversation and streams the
|
|
80
|
+
agent's response back.
|
|
81
|
+
|
|
82
|
+
Args:
|
|
83
|
+
conversation_id: The ID of the conv in the format 'conv-<uuid4>'
|
|
84
|
+
|
|
85
|
+
assistant_message_tool_kwarg: The name of the message argument in the designated message tool. Still supported
|
|
86
|
+
for legacy agent types, but deprecated for letta_v1_agent onward.
|
|
87
|
+
|
|
88
|
+
assistant_message_tool_name: The name of the designated message tool. Still supported for legacy agent types,
|
|
89
|
+
but deprecated for letta_v1_agent onward.
|
|
90
|
+
|
|
91
|
+
background: Whether to process the request in the background (only used when
|
|
92
|
+
streaming=true).
|
|
93
|
+
|
|
94
|
+
client_tools: Client-side tools that the agent can call. When the agent calls a client-side
|
|
95
|
+
tool, execution pauses and returns control to the client to execute the tool and
|
|
96
|
+
provide the result via a ToolReturn.
|
|
97
|
+
|
|
98
|
+
enable_thinking: If set to True, enables reasoning before responses or tool calls from the agent.
|
|
99
|
+
|
|
100
|
+
include_pings: Whether to include periodic keepalive ping messages in the stream to prevent
|
|
101
|
+
connection timeouts (only used when streaming=true).
|
|
102
|
+
|
|
103
|
+
include_return_message_types: Only return specified message types in the response. If `None` (default) returns
|
|
104
|
+
all messages.
|
|
105
|
+
|
|
106
|
+
input:
|
|
107
|
+
Syntactic sugar for a single user message. Equivalent to messages=[{'role':
|
|
108
|
+
'user', 'content': input}].
|
|
109
|
+
|
|
110
|
+
max_steps: Maximum number of steps the agent should take to process the request.
|
|
111
|
+
|
|
112
|
+
messages: The messages to be sent to the agent.
|
|
113
|
+
|
|
114
|
+
override_model: Model handle to use for this request instead of the agent's default model. This
|
|
115
|
+
allows sending a message to a different model without changing the agent's
|
|
116
|
+
configuration.
|
|
117
|
+
|
|
118
|
+
stream_tokens: Flag to determine if individual tokens should be streamed, rather than streaming
|
|
119
|
+
per step (only used when streaming=true).
|
|
120
|
+
|
|
121
|
+
streaming: If True, returns a streaming response (Server-Sent Events). If False (default),
|
|
122
|
+
returns a complete response.
|
|
123
|
+
|
|
124
|
+
use_assistant_message: Whether the server should parse specific tool call arguments (default
|
|
125
|
+
`send_message`) as `AssistantMessage` objects. Still supported for legacy agent
|
|
126
|
+
types, but deprecated for letta_v1_agent onward.
|
|
127
|
+
|
|
128
|
+
extra_headers: Send extra headers
|
|
129
|
+
|
|
130
|
+
extra_query: Add additional query parameters to the request
|
|
131
|
+
|
|
132
|
+
extra_body: Add additional JSON properties to the request
|
|
133
|
+
|
|
134
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
135
|
+
"""
|
|
136
|
+
if not conversation_id:
|
|
137
|
+
raise ValueError(f"Expected a non-empty value for `conversation_id` but received {conversation_id!r}")
|
|
138
|
+
return self._post(
|
|
139
|
+
f"/v1/conversations/{conversation_id}/messages",
|
|
140
|
+
body=maybe_transform(
|
|
141
|
+
{
|
|
142
|
+
"assistant_message_tool_kwarg": assistant_message_tool_kwarg,
|
|
143
|
+
"assistant_message_tool_name": assistant_message_tool_name,
|
|
144
|
+
"background": background,
|
|
145
|
+
"client_tools": client_tools,
|
|
146
|
+
"enable_thinking": enable_thinking,
|
|
147
|
+
"include_pings": include_pings,
|
|
148
|
+
"include_return_message_types": include_return_message_types,
|
|
149
|
+
"input": input,
|
|
150
|
+
"max_steps": max_steps,
|
|
151
|
+
"messages": messages,
|
|
152
|
+
"override_model": override_model,
|
|
153
|
+
"stream_tokens": stream_tokens,
|
|
154
|
+
"streaming": streaming,
|
|
155
|
+
"use_assistant_message": use_assistant_message,
|
|
156
|
+
},
|
|
157
|
+
message_create_params.MessageCreateParams,
|
|
158
|
+
),
|
|
159
|
+
options=make_request_options(
|
|
160
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
161
|
+
),
|
|
162
|
+
cast_to=cast(
|
|
163
|
+
Any, LettaStreamingResponse
|
|
164
|
+
), # Union types cannot be passed in as arguments in the type system
|
|
165
|
+
stream=True,
|
|
166
|
+
stream_cls=Stream[LettaStreamingResponse],
|
|
167
|
+
)
|
|
168
|
+
|
|
169
|
+
def list(
|
|
170
|
+
self,
|
|
171
|
+
conversation_id: str,
|
|
172
|
+
*,
|
|
173
|
+
after: Optional[str] | Omit = omit,
|
|
174
|
+
before: Optional[str] | Omit = omit,
|
|
175
|
+
group_id: Optional[str] | Omit = omit,
|
|
176
|
+
include_err: Optional[bool] | Omit = omit,
|
|
177
|
+
limit: Optional[int] | Omit = omit,
|
|
178
|
+
order: Literal["asc", "desc"] | Omit = omit,
|
|
179
|
+
order_by: Literal["created_at"] | Omit = omit,
|
|
180
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
181
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
182
|
+
extra_headers: Headers | None = None,
|
|
183
|
+
extra_query: Query | None = None,
|
|
184
|
+
extra_body: Body | None = None,
|
|
185
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
186
|
+
) -> SyncArrayPage[Message]:
|
|
187
|
+
"""
|
|
188
|
+
List all messages in a conversation.
|
|
189
|
+
|
|
190
|
+
Returns LettaMessage objects (UserMessage, AssistantMessage, etc.) for all
|
|
191
|
+
messages in the conversation, with support for cursor-based pagination.
|
|
192
|
+
|
|
193
|
+
Args:
|
|
194
|
+
conversation_id: The ID of the conv in the format 'conv-<uuid4>'
|
|
195
|
+
|
|
196
|
+
after: Message ID cursor for pagination. Returns messages that come after this message
|
|
197
|
+
ID in the specified sort order
|
|
198
|
+
|
|
199
|
+
before: Message ID cursor for pagination. Returns messages that come before this message
|
|
200
|
+
ID in the specified sort order
|
|
201
|
+
|
|
202
|
+
group_id: Group ID to filter messages by.
|
|
203
|
+
|
|
204
|
+
include_err: Whether to include error messages and error statuses. For debugging purposes
|
|
205
|
+
only.
|
|
206
|
+
|
|
207
|
+
limit: Maximum number of messages to return
|
|
208
|
+
|
|
209
|
+
order: Sort order for messages by creation time. 'asc' for oldest first, 'desc' for
|
|
210
|
+
newest first
|
|
211
|
+
|
|
212
|
+
order_by: Field to sort by
|
|
213
|
+
|
|
214
|
+
extra_headers: Send extra headers
|
|
215
|
+
|
|
216
|
+
extra_query: Add additional query parameters to the request
|
|
217
|
+
|
|
218
|
+
extra_body: Add additional JSON properties to the request
|
|
219
|
+
|
|
220
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
221
|
+
"""
|
|
222
|
+
if not conversation_id:
|
|
223
|
+
raise ValueError(f"Expected a non-empty value for `conversation_id` but received {conversation_id!r}")
|
|
224
|
+
return self._get_api_list(
|
|
225
|
+
f"/v1/conversations/{conversation_id}/messages",
|
|
226
|
+
page=SyncArrayPage[Message],
|
|
227
|
+
options=make_request_options(
|
|
228
|
+
extra_headers=extra_headers,
|
|
229
|
+
extra_query=extra_query,
|
|
230
|
+
extra_body=extra_body,
|
|
231
|
+
timeout=timeout,
|
|
232
|
+
query=maybe_transform(
|
|
233
|
+
{
|
|
234
|
+
"after": after,
|
|
235
|
+
"before": before,
|
|
236
|
+
"group_id": group_id,
|
|
237
|
+
"include_err": include_err,
|
|
238
|
+
"limit": limit,
|
|
239
|
+
"order": order,
|
|
240
|
+
"order_by": order_by,
|
|
241
|
+
},
|
|
242
|
+
message_list_params.MessageListParams,
|
|
243
|
+
),
|
|
244
|
+
),
|
|
245
|
+
model=cast(Any, Message), # Union types cannot be passed in as arguments in the type system
|
|
246
|
+
)
|
|
247
|
+
|
|
248
|
+
def stream(
|
|
249
|
+
self,
|
|
250
|
+
conversation_id: str,
|
|
251
|
+
*,
|
|
252
|
+
batch_size: Optional[int] | Omit = omit,
|
|
253
|
+
include_pings: Optional[bool] | Omit = omit,
|
|
254
|
+
poll_interval: Optional[float] | Omit = omit,
|
|
255
|
+
starting_after: int | Omit = omit,
|
|
256
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
257
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
258
|
+
extra_headers: Headers | None = None,
|
|
259
|
+
extra_query: Query | None = None,
|
|
260
|
+
extra_body: Body | None = None,
|
|
261
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
262
|
+
) -> Stream[LettaStreamingResponse]:
|
|
263
|
+
"""
|
|
264
|
+
Resume the stream for the most recent active run in a conversation.
|
|
265
|
+
|
|
266
|
+
This endpoint allows you to reconnect to an active background stream for a
|
|
267
|
+
conversation, enabling recovery from network interruptions.
|
|
268
|
+
|
|
269
|
+
Args:
|
|
270
|
+
conversation_id: The ID of the conv in the format 'conv-<uuid4>'
|
|
271
|
+
|
|
272
|
+
batch_size: Number of entries to read per batch.
|
|
273
|
+
|
|
274
|
+
include_pings: Whether to include periodic keepalive ping messages in the stream to prevent
|
|
275
|
+
connection timeouts.
|
|
276
|
+
|
|
277
|
+
poll_interval: Seconds to wait between polls when no new data.
|
|
278
|
+
|
|
279
|
+
starting_after: Sequence id to use as a cursor for pagination. Response will start streaming
|
|
280
|
+
after this chunk sequence id
|
|
281
|
+
|
|
282
|
+
extra_headers: Send extra headers
|
|
283
|
+
|
|
284
|
+
extra_query: Add additional query parameters to the request
|
|
285
|
+
|
|
286
|
+
extra_body: Add additional JSON properties to the request
|
|
287
|
+
|
|
288
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
289
|
+
"""
|
|
290
|
+
if not conversation_id:
|
|
291
|
+
raise ValueError(f"Expected a non-empty value for `conversation_id` but received {conversation_id!r}")
|
|
292
|
+
return self._post(
|
|
293
|
+
f"/v1/conversations/{conversation_id}/stream",
|
|
294
|
+
body=maybe_transform(
|
|
295
|
+
{
|
|
296
|
+
"batch_size": batch_size,
|
|
297
|
+
"include_pings": include_pings,
|
|
298
|
+
"poll_interval": poll_interval,
|
|
299
|
+
"starting_after": starting_after,
|
|
300
|
+
},
|
|
301
|
+
message_stream_params.MessageStreamParams,
|
|
302
|
+
),
|
|
303
|
+
options=make_request_options(
|
|
304
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
305
|
+
),
|
|
306
|
+
cast_to=object,
|
|
307
|
+
stream=True,
|
|
308
|
+
stream_cls=Stream[LettaStreamingResponse],
|
|
309
|
+
)
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
class AsyncMessagesResource(AsyncAPIResource):
|
|
313
|
+
@cached_property
|
|
314
|
+
def with_raw_response(self) -> AsyncMessagesResourceWithRawResponse:
|
|
315
|
+
"""
|
|
316
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
317
|
+
the raw response object instead of the parsed content.
|
|
318
|
+
|
|
319
|
+
For more information, see https://www.github.com/letta-ai/letta-python#accessing-raw-response-data-eg-headers
|
|
320
|
+
"""
|
|
321
|
+
return AsyncMessagesResourceWithRawResponse(self)
|
|
322
|
+
|
|
323
|
+
@cached_property
|
|
324
|
+
def with_streaming_response(self) -> AsyncMessagesResourceWithStreamingResponse:
|
|
325
|
+
"""
|
|
326
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
327
|
+
|
|
328
|
+
For more information, see https://www.github.com/letta-ai/letta-python#with_streaming_response
|
|
329
|
+
"""
|
|
330
|
+
return AsyncMessagesResourceWithStreamingResponse(self)
|
|
331
|
+
|
|
332
|
+
async def create(
|
|
333
|
+
self,
|
|
334
|
+
conversation_id: str,
|
|
335
|
+
*,
|
|
336
|
+
assistant_message_tool_kwarg: str | Omit = omit,
|
|
337
|
+
assistant_message_tool_name: str | Omit = omit,
|
|
338
|
+
background: bool | Omit = omit,
|
|
339
|
+
client_tools: Optional[Iterable[message_create_params.ClientTool]] | Omit = omit,
|
|
340
|
+
enable_thinking: str | Omit = omit,
|
|
341
|
+
include_pings: bool | Omit = omit,
|
|
342
|
+
include_return_message_types: Optional[List[MessageType]] | Omit = omit,
|
|
343
|
+
input: Union[str, Iterable[message_create_params.InputUnionMember1], None] | Omit = omit,
|
|
344
|
+
max_steps: int | Omit = omit,
|
|
345
|
+
messages: Optional[Iterable[message_create_params.Message]] | Omit = omit,
|
|
346
|
+
override_model: Optional[str] | Omit = omit,
|
|
347
|
+
stream_tokens: bool | Omit = omit,
|
|
348
|
+
streaming: bool | Omit = omit,
|
|
349
|
+
use_assistant_message: bool | Omit = omit,
|
|
350
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
351
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
352
|
+
extra_headers: Headers | None = None,
|
|
353
|
+
extra_query: Query | None = None,
|
|
354
|
+
extra_body: Body | None = None,
|
|
355
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
356
|
+
) -> AsyncStream[LettaStreamingResponse]:
|
|
357
|
+
"""
|
|
358
|
+
Send a message to a conversation and get a streaming response.
|
|
359
|
+
|
|
360
|
+
This endpoint sends a message to an existing conversation and streams the
|
|
361
|
+
agent's response back.
|
|
362
|
+
|
|
363
|
+
Args:
|
|
364
|
+
conversation_id: The ID of the conv in the format 'conv-<uuid4>'
|
|
365
|
+
|
|
366
|
+
assistant_message_tool_kwarg: The name of the message argument in the designated message tool. Still supported
|
|
367
|
+
for legacy agent types, but deprecated for letta_v1_agent onward.
|
|
368
|
+
|
|
369
|
+
assistant_message_tool_name: The name of the designated message tool. Still supported for legacy agent types,
|
|
370
|
+
but deprecated for letta_v1_agent onward.
|
|
371
|
+
|
|
372
|
+
background: Whether to process the request in the background (only used when
|
|
373
|
+
streaming=true).
|
|
374
|
+
|
|
375
|
+
client_tools: Client-side tools that the agent can call. When the agent calls a client-side
|
|
376
|
+
tool, execution pauses and returns control to the client to execute the tool and
|
|
377
|
+
provide the result via a ToolReturn.
|
|
378
|
+
|
|
379
|
+
enable_thinking: If set to True, enables reasoning before responses or tool calls from the agent.
|
|
380
|
+
|
|
381
|
+
include_pings: Whether to include periodic keepalive ping messages in the stream to prevent
|
|
382
|
+
connection timeouts (only used when streaming=true).
|
|
383
|
+
|
|
384
|
+
include_return_message_types: Only return specified message types in the response. If `None` (default) returns
|
|
385
|
+
all messages.
|
|
386
|
+
|
|
387
|
+
input:
|
|
388
|
+
Syntactic sugar for a single user message. Equivalent to messages=[{'role':
|
|
389
|
+
'user', 'content': input}].
|
|
390
|
+
|
|
391
|
+
max_steps: Maximum number of steps the agent should take to process the request.
|
|
392
|
+
|
|
393
|
+
messages: The messages to be sent to the agent.
|
|
394
|
+
|
|
395
|
+
override_model: Model handle to use for this request instead of the agent's default model. This
|
|
396
|
+
allows sending a message to a different model without changing the agent's
|
|
397
|
+
configuration.
|
|
398
|
+
|
|
399
|
+
stream_tokens: Flag to determine if individual tokens should be streamed, rather than streaming
|
|
400
|
+
per step (only used when streaming=true).
|
|
401
|
+
|
|
402
|
+
streaming: If True, returns a streaming response (Server-Sent Events). If False (default),
|
|
403
|
+
returns a complete response.
|
|
404
|
+
|
|
405
|
+
use_assistant_message: Whether the server should parse specific tool call arguments (default
|
|
406
|
+
`send_message`) as `AssistantMessage` objects. Still supported for legacy agent
|
|
407
|
+
types, but deprecated for letta_v1_agent onward.
|
|
408
|
+
|
|
409
|
+
extra_headers: Send extra headers
|
|
410
|
+
|
|
411
|
+
extra_query: Add additional query parameters to the request
|
|
412
|
+
|
|
413
|
+
extra_body: Add additional JSON properties to the request
|
|
414
|
+
|
|
415
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
416
|
+
"""
|
|
417
|
+
if not conversation_id:
|
|
418
|
+
raise ValueError(f"Expected a non-empty value for `conversation_id` but received {conversation_id!r}")
|
|
419
|
+
return await self._post(
|
|
420
|
+
f"/v1/conversations/{conversation_id}/messages",
|
|
421
|
+
body=await async_maybe_transform(
|
|
422
|
+
{
|
|
423
|
+
"assistant_message_tool_kwarg": assistant_message_tool_kwarg,
|
|
424
|
+
"assistant_message_tool_name": assistant_message_tool_name,
|
|
425
|
+
"background": background,
|
|
426
|
+
"client_tools": client_tools,
|
|
427
|
+
"enable_thinking": enable_thinking,
|
|
428
|
+
"include_pings": include_pings,
|
|
429
|
+
"include_return_message_types": include_return_message_types,
|
|
430
|
+
"input": input,
|
|
431
|
+
"max_steps": max_steps,
|
|
432
|
+
"messages": messages,
|
|
433
|
+
"override_model": override_model,
|
|
434
|
+
"stream_tokens": stream_tokens,
|
|
435
|
+
"streaming": streaming,
|
|
436
|
+
"use_assistant_message": use_assistant_message,
|
|
437
|
+
},
|
|
438
|
+
message_create_params.MessageCreateParams,
|
|
439
|
+
),
|
|
440
|
+
options=make_request_options(
|
|
441
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
442
|
+
),
|
|
443
|
+
cast_to=cast(
|
|
444
|
+
Any, LettaStreamingResponse
|
|
445
|
+
), # Union types cannot be passed in as arguments in the type system
|
|
446
|
+
stream=True,
|
|
447
|
+
stream_cls=AsyncStream[LettaStreamingResponse],
|
|
448
|
+
)
|
|
449
|
+
|
|
450
|
+
def list(
|
|
451
|
+
self,
|
|
452
|
+
conversation_id: str,
|
|
453
|
+
*,
|
|
454
|
+
after: Optional[str] | Omit = omit,
|
|
455
|
+
before: Optional[str] | Omit = omit,
|
|
456
|
+
group_id: Optional[str] | Omit = omit,
|
|
457
|
+
include_err: Optional[bool] | Omit = omit,
|
|
458
|
+
limit: Optional[int] | Omit = omit,
|
|
459
|
+
order: Literal["asc", "desc"] | Omit = omit,
|
|
460
|
+
order_by: Literal["created_at"] | Omit = omit,
|
|
461
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
462
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
463
|
+
extra_headers: Headers | None = None,
|
|
464
|
+
extra_query: Query | None = None,
|
|
465
|
+
extra_body: Body | None = None,
|
|
466
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
467
|
+
) -> AsyncPaginator[Message, AsyncArrayPage[Message]]:
|
|
468
|
+
"""
|
|
469
|
+
List all messages in a conversation.
|
|
470
|
+
|
|
471
|
+
Returns LettaMessage objects (UserMessage, AssistantMessage, etc.) for all
|
|
472
|
+
messages in the conversation, with support for cursor-based pagination.
|
|
473
|
+
|
|
474
|
+
Args:
|
|
475
|
+
conversation_id: The ID of the conv in the format 'conv-<uuid4>'
|
|
476
|
+
|
|
477
|
+
after: Message ID cursor for pagination. Returns messages that come after this message
|
|
478
|
+
ID in the specified sort order
|
|
479
|
+
|
|
480
|
+
before: Message ID cursor for pagination. Returns messages that come before this message
|
|
481
|
+
ID in the specified sort order
|
|
482
|
+
|
|
483
|
+
group_id: Group ID to filter messages by.
|
|
484
|
+
|
|
485
|
+
include_err: Whether to include error messages and error statuses. For debugging purposes
|
|
486
|
+
only.
|
|
487
|
+
|
|
488
|
+
limit: Maximum number of messages to return
|
|
489
|
+
|
|
490
|
+
order: Sort order for messages by creation time. 'asc' for oldest first, 'desc' for
|
|
491
|
+
newest first
|
|
492
|
+
|
|
493
|
+
order_by: Field to sort by
|
|
494
|
+
|
|
495
|
+
extra_headers: Send extra headers
|
|
496
|
+
|
|
497
|
+
extra_query: Add additional query parameters to the request
|
|
498
|
+
|
|
499
|
+
extra_body: Add additional JSON properties to the request
|
|
500
|
+
|
|
501
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
502
|
+
"""
|
|
503
|
+
if not conversation_id:
|
|
504
|
+
raise ValueError(f"Expected a non-empty value for `conversation_id` but received {conversation_id!r}")
|
|
505
|
+
return self._get_api_list(
|
|
506
|
+
f"/v1/conversations/{conversation_id}/messages",
|
|
507
|
+
page=AsyncArrayPage[Message],
|
|
508
|
+
options=make_request_options(
|
|
509
|
+
extra_headers=extra_headers,
|
|
510
|
+
extra_query=extra_query,
|
|
511
|
+
extra_body=extra_body,
|
|
512
|
+
timeout=timeout,
|
|
513
|
+
query=maybe_transform(
|
|
514
|
+
{
|
|
515
|
+
"after": after,
|
|
516
|
+
"before": before,
|
|
517
|
+
"group_id": group_id,
|
|
518
|
+
"include_err": include_err,
|
|
519
|
+
"limit": limit,
|
|
520
|
+
"order": order,
|
|
521
|
+
"order_by": order_by,
|
|
522
|
+
},
|
|
523
|
+
message_list_params.MessageListParams,
|
|
524
|
+
),
|
|
525
|
+
),
|
|
526
|
+
model=cast(Any, Message), # Union types cannot be passed in as arguments in the type system
|
|
527
|
+
)
|
|
528
|
+
|
|
529
|
+
async def stream(
|
|
530
|
+
self,
|
|
531
|
+
conversation_id: str,
|
|
532
|
+
*,
|
|
533
|
+
batch_size: Optional[int] | Omit = omit,
|
|
534
|
+
include_pings: Optional[bool] | Omit = omit,
|
|
535
|
+
poll_interval: Optional[float] | Omit = omit,
|
|
536
|
+
starting_after: int | Omit = omit,
|
|
537
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
538
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
539
|
+
extra_headers: Headers | None = None,
|
|
540
|
+
extra_query: Query | None = None,
|
|
541
|
+
extra_body: Body | None = None,
|
|
542
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
543
|
+
) -> AsyncStream[LettaStreamingResponse]:
|
|
544
|
+
"""
|
|
545
|
+
Resume the stream for the most recent active run in a conversation.
|
|
546
|
+
|
|
547
|
+
This endpoint allows you to reconnect to an active background stream for a
|
|
548
|
+
conversation, enabling recovery from network interruptions.
|
|
549
|
+
|
|
550
|
+
Args:
|
|
551
|
+
conversation_id: The ID of the conv in the format 'conv-<uuid4>'
|
|
552
|
+
|
|
553
|
+
batch_size: Number of entries to read per batch.
|
|
554
|
+
|
|
555
|
+
include_pings: Whether to include periodic keepalive ping messages in the stream to prevent
|
|
556
|
+
connection timeouts.
|
|
557
|
+
|
|
558
|
+
poll_interval: Seconds to wait between polls when no new data.
|
|
559
|
+
|
|
560
|
+
starting_after: Sequence id to use as a cursor for pagination. Response will start streaming
|
|
561
|
+
after this chunk sequence id
|
|
562
|
+
|
|
563
|
+
extra_headers: Send extra headers
|
|
564
|
+
|
|
565
|
+
extra_query: Add additional query parameters to the request
|
|
566
|
+
|
|
567
|
+
extra_body: Add additional JSON properties to the request
|
|
568
|
+
|
|
569
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
570
|
+
"""
|
|
571
|
+
if not conversation_id:
|
|
572
|
+
raise ValueError(f"Expected a non-empty value for `conversation_id` but received {conversation_id!r}")
|
|
573
|
+
return await self._post(
|
|
574
|
+
f"/v1/conversations/{conversation_id}/stream",
|
|
575
|
+
body=await async_maybe_transform(
|
|
576
|
+
{
|
|
577
|
+
"batch_size": batch_size,
|
|
578
|
+
"include_pings": include_pings,
|
|
579
|
+
"poll_interval": poll_interval,
|
|
580
|
+
"starting_after": starting_after,
|
|
581
|
+
},
|
|
582
|
+
message_stream_params.MessageStreamParams,
|
|
583
|
+
),
|
|
584
|
+
options=make_request_options(
|
|
585
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
586
|
+
),
|
|
587
|
+
cast_to=object,
|
|
588
|
+
stream=True,
|
|
589
|
+
stream_cls=AsyncStream[LettaStreamingResponse],
|
|
590
|
+
)
|
|
591
|
+
|
|
592
|
+
|
|
593
|
+
class MessagesResourceWithRawResponse:
|
|
594
|
+
def __init__(self, messages: MessagesResource) -> None:
|
|
595
|
+
self._messages = messages
|
|
596
|
+
|
|
597
|
+
self.create = to_raw_response_wrapper(
|
|
598
|
+
messages.create,
|
|
599
|
+
)
|
|
600
|
+
self.list = to_raw_response_wrapper(
|
|
601
|
+
messages.list,
|
|
602
|
+
)
|
|
603
|
+
self.stream = to_raw_response_wrapper(
|
|
604
|
+
messages.stream,
|
|
605
|
+
)
|
|
606
|
+
|
|
607
|
+
|
|
608
|
+
class AsyncMessagesResourceWithRawResponse:
|
|
609
|
+
def __init__(self, messages: AsyncMessagesResource) -> None:
|
|
610
|
+
self._messages = messages
|
|
611
|
+
|
|
612
|
+
self.create = async_to_raw_response_wrapper(
|
|
613
|
+
messages.create,
|
|
614
|
+
)
|
|
615
|
+
self.list = async_to_raw_response_wrapper(
|
|
616
|
+
messages.list,
|
|
617
|
+
)
|
|
618
|
+
self.stream = async_to_raw_response_wrapper(
|
|
619
|
+
messages.stream,
|
|
620
|
+
)
|
|
621
|
+
|
|
622
|
+
|
|
623
|
+
class MessagesResourceWithStreamingResponse:
|
|
624
|
+
def __init__(self, messages: MessagesResource) -> None:
|
|
625
|
+
self._messages = messages
|
|
626
|
+
|
|
627
|
+
self.create = to_streamed_response_wrapper(
|
|
628
|
+
messages.create,
|
|
629
|
+
)
|
|
630
|
+
self.list = to_streamed_response_wrapper(
|
|
631
|
+
messages.list,
|
|
632
|
+
)
|
|
633
|
+
self.stream = to_streamed_response_wrapper(
|
|
634
|
+
messages.stream,
|
|
635
|
+
)
|
|
636
|
+
|
|
637
|
+
|
|
638
|
+
class AsyncMessagesResourceWithStreamingResponse:
|
|
639
|
+
def __init__(self, messages: AsyncMessagesResource) -> None:
|
|
640
|
+
self._messages = messages
|
|
641
|
+
|
|
642
|
+
self.create = async_to_streamed_response_wrapper(
|
|
643
|
+
messages.create,
|
|
644
|
+
)
|
|
645
|
+
self.list = async_to_streamed_response_wrapper(
|
|
646
|
+
messages.list,
|
|
647
|
+
)
|
|
648
|
+
self.stream = async_to_streamed_response_wrapper(
|
|
649
|
+
messages.stream,
|
|
650
|
+
)
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from .files import (
|
|
4
|
+
FilesResource,
|
|
5
|
+
AsyncFilesResource,
|
|
6
|
+
FilesResourceWithRawResponse,
|
|
7
|
+
AsyncFilesResourceWithRawResponse,
|
|
8
|
+
FilesResourceWithStreamingResponse,
|
|
9
|
+
AsyncFilesResourceWithStreamingResponse,
|
|
10
|
+
)
|
|
11
|
+
from .agents import (
|
|
12
|
+
AgentsResource,
|
|
13
|
+
AsyncAgentsResource,
|
|
14
|
+
AgentsResourceWithRawResponse,
|
|
15
|
+
AsyncAgentsResourceWithRawResponse,
|
|
16
|
+
AgentsResourceWithStreamingResponse,
|
|
17
|
+
AsyncAgentsResourceWithStreamingResponse,
|
|
18
|
+
)
|
|
19
|
+
from .folders import (
|
|
20
|
+
FoldersResource,
|
|
21
|
+
AsyncFoldersResource,
|
|
22
|
+
FoldersResourceWithRawResponse,
|
|
23
|
+
AsyncFoldersResourceWithRawResponse,
|
|
24
|
+
FoldersResourceWithStreamingResponse,
|
|
25
|
+
AsyncFoldersResourceWithStreamingResponse,
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
__all__ = [
|
|
29
|
+
"FilesResource",
|
|
30
|
+
"AsyncFilesResource",
|
|
31
|
+
"FilesResourceWithRawResponse",
|
|
32
|
+
"AsyncFilesResourceWithRawResponse",
|
|
33
|
+
"FilesResourceWithStreamingResponse",
|
|
34
|
+
"AsyncFilesResourceWithStreamingResponse",
|
|
35
|
+
"AgentsResource",
|
|
36
|
+
"AsyncAgentsResource",
|
|
37
|
+
"AgentsResourceWithRawResponse",
|
|
38
|
+
"AsyncAgentsResourceWithRawResponse",
|
|
39
|
+
"AgentsResourceWithStreamingResponse",
|
|
40
|
+
"AsyncAgentsResourceWithStreamingResponse",
|
|
41
|
+
"FoldersResource",
|
|
42
|
+
"AsyncFoldersResource",
|
|
43
|
+
"FoldersResourceWithRawResponse",
|
|
44
|
+
"AsyncFoldersResourceWithRawResponse",
|
|
45
|
+
"FoldersResourceWithStreamingResponse",
|
|
46
|
+
"AsyncFoldersResourceWithStreamingResponse",
|
|
47
|
+
]
|