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,977 @@
|
|
|
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 Dict, Iterable, Optional
|
|
6
|
+
from typing_extensions import Literal
|
|
7
|
+
|
|
8
|
+
import httpx
|
|
9
|
+
|
|
10
|
+
from .agents import (
|
|
11
|
+
AgentsResource,
|
|
12
|
+
AsyncAgentsResource,
|
|
13
|
+
AgentsResourceWithRawResponse,
|
|
14
|
+
AsyncAgentsResourceWithRawResponse,
|
|
15
|
+
AgentsResourceWithStreamingResponse,
|
|
16
|
+
AsyncAgentsResourceWithStreamingResponse,
|
|
17
|
+
)
|
|
18
|
+
from ...types import block_list_params, block_create_params, block_update_params
|
|
19
|
+
from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
|
|
20
|
+
from ..._utils import maybe_transform, async_maybe_transform
|
|
21
|
+
from ..._compat import cached_property
|
|
22
|
+
from ..._resource import SyncAPIResource, AsyncAPIResource
|
|
23
|
+
from ..._response import (
|
|
24
|
+
to_raw_response_wrapper,
|
|
25
|
+
to_streamed_response_wrapper,
|
|
26
|
+
async_to_raw_response_wrapper,
|
|
27
|
+
async_to_streamed_response_wrapper,
|
|
28
|
+
)
|
|
29
|
+
from ...pagination import SyncArrayPage, AsyncArrayPage
|
|
30
|
+
from ..._base_client import AsyncPaginator, make_request_options
|
|
31
|
+
from ...types.block_response import BlockResponse
|
|
32
|
+
|
|
33
|
+
__all__ = ["BlocksResource", "AsyncBlocksResource"]
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class BlocksResource(SyncAPIResource):
|
|
37
|
+
@cached_property
|
|
38
|
+
def agents(self) -> AgentsResource:
|
|
39
|
+
return AgentsResource(self._client)
|
|
40
|
+
|
|
41
|
+
@cached_property
|
|
42
|
+
def with_raw_response(self) -> BlocksResourceWithRawResponse:
|
|
43
|
+
"""
|
|
44
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
45
|
+
the raw response object instead of the parsed content.
|
|
46
|
+
|
|
47
|
+
For more information, see https://www.github.com/letta-ai/letta-python#accessing-raw-response-data-eg-headers
|
|
48
|
+
"""
|
|
49
|
+
return BlocksResourceWithRawResponse(self)
|
|
50
|
+
|
|
51
|
+
@cached_property
|
|
52
|
+
def with_streaming_response(self) -> BlocksResourceWithStreamingResponse:
|
|
53
|
+
"""
|
|
54
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
55
|
+
|
|
56
|
+
For more information, see https://www.github.com/letta-ai/letta-python#with_streaming_response
|
|
57
|
+
"""
|
|
58
|
+
return BlocksResourceWithStreamingResponse(self)
|
|
59
|
+
|
|
60
|
+
def create(
|
|
61
|
+
self,
|
|
62
|
+
*,
|
|
63
|
+
label: str,
|
|
64
|
+
value: str,
|
|
65
|
+
base_template_id: Optional[str] | Omit = omit,
|
|
66
|
+
deployment_id: Optional[str] | Omit = omit,
|
|
67
|
+
description: Optional[str] | Omit = omit,
|
|
68
|
+
entity_id: Optional[str] | Omit = omit,
|
|
69
|
+
hidden: Optional[bool] | Omit = omit,
|
|
70
|
+
is_template: bool | Omit = omit,
|
|
71
|
+
limit: int | Omit = omit,
|
|
72
|
+
metadata: Optional[Dict[str, object]] | Omit = omit,
|
|
73
|
+
preserve_on_migration: Optional[bool] | Omit = omit,
|
|
74
|
+
project_id: Optional[str] | Omit = omit,
|
|
75
|
+
read_only: bool | Omit = omit,
|
|
76
|
+
tags: Optional[SequenceNotStr[str]] | Omit = omit,
|
|
77
|
+
template_id: Optional[str] | Omit = omit,
|
|
78
|
+
template_name: Optional[str] | Omit = omit,
|
|
79
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
80
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
81
|
+
extra_headers: Headers | None = None,
|
|
82
|
+
extra_query: Query | None = None,
|
|
83
|
+
extra_body: Body | None = None,
|
|
84
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
85
|
+
) -> BlockResponse:
|
|
86
|
+
"""
|
|
87
|
+
Create Block
|
|
88
|
+
|
|
89
|
+
Args:
|
|
90
|
+
label: Label of the block.
|
|
91
|
+
|
|
92
|
+
value: Value of the block.
|
|
93
|
+
|
|
94
|
+
base_template_id: The base template id of the block.
|
|
95
|
+
|
|
96
|
+
deployment_id: The id of the deployment.
|
|
97
|
+
|
|
98
|
+
description: Description of the block.
|
|
99
|
+
|
|
100
|
+
entity_id: The id of the entity within the template.
|
|
101
|
+
|
|
102
|
+
hidden: If set to True, the block will be hidden.
|
|
103
|
+
|
|
104
|
+
limit: Character limit of the block.
|
|
105
|
+
|
|
106
|
+
metadata: Metadata of the block.
|
|
107
|
+
|
|
108
|
+
preserve_on_migration: Preserve the block on template migration.
|
|
109
|
+
|
|
110
|
+
project_id: The associated project id.
|
|
111
|
+
|
|
112
|
+
read_only: Whether the agent has read-only access to the block.
|
|
113
|
+
|
|
114
|
+
tags: The tags to associate with the block.
|
|
115
|
+
|
|
116
|
+
template_id: The id of the template.
|
|
117
|
+
|
|
118
|
+
template_name: Name of the block if it is a template.
|
|
119
|
+
|
|
120
|
+
extra_headers: Send extra headers
|
|
121
|
+
|
|
122
|
+
extra_query: Add additional query parameters to the request
|
|
123
|
+
|
|
124
|
+
extra_body: Add additional JSON properties to the request
|
|
125
|
+
|
|
126
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
127
|
+
"""
|
|
128
|
+
return self._post(
|
|
129
|
+
"/v1/blocks/",
|
|
130
|
+
body=maybe_transform(
|
|
131
|
+
{
|
|
132
|
+
"label": label,
|
|
133
|
+
"value": value,
|
|
134
|
+
"base_template_id": base_template_id,
|
|
135
|
+
"deployment_id": deployment_id,
|
|
136
|
+
"description": description,
|
|
137
|
+
"entity_id": entity_id,
|
|
138
|
+
"hidden": hidden,
|
|
139
|
+
"is_template": is_template,
|
|
140
|
+
"limit": limit,
|
|
141
|
+
"metadata": metadata,
|
|
142
|
+
"preserve_on_migration": preserve_on_migration,
|
|
143
|
+
"project_id": project_id,
|
|
144
|
+
"read_only": read_only,
|
|
145
|
+
"tags": tags,
|
|
146
|
+
"template_id": template_id,
|
|
147
|
+
"template_name": template_name,
|
|
148
|
+
},
|
|
149
|
+
block_create_params.BlockCreateParams,
|
|
150
|
+
),
|
|
151
|
+
options=make_request_options(
|
|
152
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
153
|
+
),
|
|
154
|
+
cast_to=BlockResponse,
|
|
155
|
+
)
|
|
156
|
+
|
|
157
|
+
def retrieve(
|
|
158
|
+
self,
|
|
159
|
+
block_id: str,
|
|
160
|
+
*,
|
|
161
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
162
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
163
|
+
extra_headers: Headers | None = None,
|
|
164
|
+
extra_query: Query | None = None,
|
|
165
|
+
extra_body: Body | None = None,
|
|
166
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
167
|
+
) -> BlockResponse:
|
|
168
|
+
"""
|
|
169
|
+
Retrieve Block
|
|
170
|
+
|
|
171
|
+
Args:
|
|
172
|
+
block_id: The ID of the block in the format 'block-<uuid4>'
|
|
173
|
+
|
|
174
|
+
extra_headers: Send extra headers
|
|
175
|
+
|
|
176
|
+
extra_query: Add additional query parameters to the request
|
|
177
|
+
|
|
178
|
+
extra_body: Add additional JSON properties to the request
|
|
179
|
+
|
|
180
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
181
|
+
"""
|
|
182
|
+
if not block_id:
|
|
183
|
+
raise ValueError(f"Expected a non-empty value for `block_id` but received {block_id!r}")
|
|
184
|
+
return self._get(
|
|
185
|
+
f"/v1/blocks/{block_id}",
|
|
186
|
+
options=make_request_options(
|
|
187
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
188
|
+
),
|
|
189
|
+
cast_to=BlockResponse,
|
|
190
|
+
)
|
|
191
|
+
|
|
192
|
+
def update(
|
|
193
|
+
self,
|
|
194
|
+
block_id: str,
|
|
195
|
+
*,
|
|
196
|
+
base_template_id: Optional[str] | Omit = omit,
|
|
197
|
+
deployment_id: Optional[str] | Omit = omit,
|
|
198
|
+
description: Optional[str] | Omit = omit,
|
|
199
|
+
entity_id: Optional[str] | Omit = omit,
|
|
200
|
+
hidden: Optional[bool] | Omit = omit,
|
|
201
|
+
is_template: bool | Omit = omit,
|
|
202
|
+
label: Optional[str] | Omit = omit,
|
|
203
|
+
limit: Optional[int] | Omit = omit,
|
|
204
|
+
metadata: Optional[Dict[str, object]] | Omit = omit,
|
|
205
|
+
preserve_on_migration: Optional[bool] | Omit = omit,
|
|
206
|
+
project_id: Optional[str] | Omit = omit,
|
|
207
|
+
read_only: bool | Omit = omit,
|
|
208
|
+
tags: Optional[SequenceNotStr[str]] | Omit = omit,
|
|
209
|
+
template_id: Optional[str] | Omit = omit,
|
|
210
|
+
template_name: Optional[str] | Omit = omit,
|
|
211
|
+
value: Optional[str] | Omit = omit,
|
|
212
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
213
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
214
|
+
extra_headers: Headers | None = None,
|
|
215
|
+
extra_query: Query | None = None,
|
|
216
|
+
extra_body: Body | None = None,
|
|
217
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
218
|
+
) -> BlockResponse:
|
|
219
|
+
"""
|
|
220
|
+
Update Block
|
|
221
|
+
|
|
222
|
+
Args:
|
|
223
|
+
block_id: The ID of the block in the format 'block-<uuid4>'
|
|
224
|
+
|
|
225
|
+
base_template_id: The base template id of the block.
|
|
226
|
+
|
|
227
|
+
deployment_id: The id of the deployment.
|
|
228
|
+
|
|
229
|
+
description: Description of the block.
|
|
230
|
+
|
|
231
|
+
entity_id: The id of the entity within the template.
|
|
232
|
+
|
|
233
|
+
hidden: If set to True, the block will be hidden.
|
|
234
|
+
|
|
235
|
+
is_template: Whether the block is a template (e.g. saved human/persona options).
|
|
236
|
+
|
|
237
|
+
label: Label of the block (e.g. 'human', 'persona') in the context window.
|
|
238
|
+
|
|
239
|
+
limit: Character limit of the block.
|
|
240
|
+
|
|
241
|
+
metadata: Metadata of the block.
|
|
242
|
+
|
|
243
|
+
preserve_on_migration: Preserve the block on template migration.
|
|
244
|
+
|
|
245
|
+
project_id: The associated project id.
|
|
246
|
+
|
|
247
|
+
read_only: Whether the agent has read-only access to the block.
|
|
248
|
+
|
|
249
|
+
tags: The tags to associate with the block.
|
|
250
|
+
|
|
251
|
+
template_id: The id of the template.
|
|
252
|
+
|
|
253
|
+
template_name: Name of the block if it is a template.
|
|
254
|
+
|
|
255
|
+
value: Value of the block.
|
|
256
|
+
|
|
257
|
+
extra_headers: Send extra headers
|
|
258
|
+
|
|
259
|
+
extra_query: Add additional query parameters to the request
|
|
260
|
+
|
|
261
|
+
extra_body: Add additional JSON properties to the request
|
|
262
|
+
|
|
263
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
264
|
+
"""
|
|
265
|
+
if not block_id:
|
|
266
|
+
raise ValueError(f"Expected a non-empty value for `block_id` but received {block_id!r}")
|
|
267
|
+
return self._patch(
|
|
268
|
+
f"/v1/blocks/{block_id}",
|
|
269
|
+
body=maybe_transform(
|
|
270
|
+
{
|
|
271
|
+
"base_template_id": base_template_id,
|
|
272
|
+
"deployment_id": deployment_id,
|
|
273
|
+
"description": description,
|
|
274
|
+
"entity_id": entity_id,
|
|
275
|
+
"hidden": hidden,
|
|
276
|
+
"is_template": is_template,
|
|
277
|
+
"label": label,
|
|
278
|
+
"limit": limit,
|
|
279
|
+
"metadata": metadata,
|
|
280
|
+
"preserve_on_migration": preserve_on_migration,
|
|
281
|
+
"project_id": project_id,
|
|
282
|
+
"read_only": read_only,
|
|
283
|
+
"tags": tags,
|
|
284
|
+
"template_id": template_id,
|
|
285
|
+
"template_name": template_name,
|
|
286
|
+
"value": value,
|
|
287
|
+
},
|
|
288
|
+
block_update_params.BlockUpdateParams,
|
|
289
|
+
),
|
|
290
|
+
options=make_request_options(
|
|
291
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
292
|
+
),
|
|
293
|
+
cast_to=BlockResponse,
|
|
294
|
+
)
|
|
295
|
+
|
|
296
|
+
def list(
|
|
297
|
+
self,
|
|
298
|
+
*,
|
|
299
|
+
after: Optional[str] | Omit = omit,
|
|
300
|
+
before: Optional[str] | Omit = omit,
|
|
301
|
+
connected_to_agents_count_eq: Optional[Iterable[int]] | Omit = omit,
|
|
302
|
+
connected_to_agents_count_gt: Optional[int] | Omit = omit,
|
|
303
|
+
connected_to_agents_count_lt: Optional[int] | Omit = omit,
|
|
304
|
+
description_search: Optional[str] | Omit = omit,
|
|
305
|
+
identifier_keys: Optional[SequenceNotStr[str]] | Omit = omit,
|
|
306
|
+
identity_id: Optional[str] | Omit = omit,
|
|
307
|
+
label: Optional[str] | Omit = omit,
|
|
308
|
+
label_search: Optional[str] | Omit = omit,
|
|
309
|
+
limit: Optional[int] | Omit = omit,
|
|
310
|
+
match_all_tags: bool | Omit = omit,
|
|
311
|
+
name: Optional[str] | Omit = omit,
|
|
312
|
+
order: Literal["asc", "desc"] | Omit = omit,
|
|
313
|
+
order_by: Literal["created_at"] | Omit = omit,
|
|
314
|
+
project_id: Optional[str] | Omit = omit,
|
|
315
|
+
tags: Optional[SequenceNotStr[str]] | Omit = omit,
|
|
316
|
+
templates_only: bool | Omit = omit,
|
|
317
|
+
value_search: Optional[str] | Omit = omit,
|
|
318
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
319
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
320
|
+
extra_headers: Headers | None = None,
|
|
321
|
+
extra_query: Query | None = None,
|
|
322
|
+
extra_body: Body | None = None,
|
|
323
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
324
|
+
) -> SyncArrayPage[BlockResponse]:
|
|
325
|
+
"""List Blocks
|
|
326
|
+
|
|
327
|
+
Args:
|
|
328
|
+
after: Block ID cursor for pagination.
|
|
329
|
+
|
|
330
|
+
Returns blocks that come after this block ID in
|
|
331
|
+
the specified sort order
|
|
332
|
+
|
|
333
|
+
before: Block ID cursor for pagination. Returns blocks that come before this block ID in
|
|
334
|
+
the specified sort order
|
|
335
|
+
|
|
336
|
+
connected_to_agents_count_eq: Filter blocks by the exact number of connected agents. If provided, returns
|
|
337
|
+
blocks that have exactly this number of connected agents.
|
|
338
|
+
|
|
339
|
+
connected_to_agents_count_gt: Filter blocks by the number of connected agents. If provided, returns blocks
|
|
340
|
+
that have more than this number of connected agents.
|
|
341
|
+
|
|
342
|
+
connected_to_agents_count_lt: Filter blocks by the number of connected agents. If provided, returns blocks
|
|
343
|
+
that have less than this number of connected agents.
|
|
344
|
+
|
|
345
|
+
description_search: Search blocks by description. If provided, returns blocks whose description
|
|
346
|
+
matches the search query. This is a full-text search on block descriptions.
|
|
347
|
+
|
|
348
|
+
identifier_keys: Search agents by identifier keys
|
|
349
|
+
|
|
350
|
+
identity_id: The ID of the identity in the format 'identity-<uuid4>'
|
|
351
|
+
|
|
352
|
+
label: Label to include (alphanumeric, hyphens, underscores, forward slashes)
|
|
353
|
+
|
|
354
|
+
label_search: Search blocks by label. If provided, returns blocks whose label matches the
|
|
355
|
+
search query. This is a full-text search on block labels.
|
|
356
|
+
|
|
357
|
+
limit: Number of blocks to return
|
|
358
|
+
|
|
359
|
+
match_all_tags: If True, only returns blocks that match ALL given tags. Otherwise, return blocks
|
|
360
|
+
that have ANY of the passed-in tags.
|
|
361
|
+
|
|
362
|
+
name: Name filter (alphanumeric, spaces, hyphens, underscores)
|
|
363
|
+
|
|
364
|
+
order: Sort order for blocks by creation time. 'asc' for oldest first, 'desc' for
|
|
365
|
+
newest first
|
|
366
|
+
|
|
367
|
+
order_by: Field to sort by
|
|
368
|
+
|
|
369
|
+
project_id: Search blocks by project id
|
|
370
|
+
|
|
371
|
+
tags: List of tags to filter blocks by
|
|
372
|
+
|
|
373
|
+
templates_only: Whether to include only templates
|
|
374
|
+
|
|
375
|
+
value_search: Search blocks by value. If provided, returns blocks whose value matches the
|
|
376
|
+
search query. This is a full-text search on block values.
|
|
377
|
+
|
|
378
|
+
extra_headers: Send extra headers
|
|
379
|
+
|
|
380
|
+
extra_query: Add additional query parameters to the request
|
|
381
|
+
|
|
382
|
+
extra_body: Add additional JSON properties to the request
|
|
383
|
+
|
|
384
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
385
|
+
"""
|
|
386
|
+
return self._get_api_list(
|
|
387
|
+
"/v1/blocks/",
|
|
388
|
+
page=SyncArrayPage[BlockResponse],
|
|
389
|
+
options=make_request_options(
|
|
390
|
+
extra_headers=extra_headers,
|
|
391
|
+
extra_query=extra_query,
|
|
392
|
+
extra_body=extra_body,
|
|
393
|
+
timeout=timeout,
|
|
394
|
+
query=maybe_transform(
|
|
395
|
+
{
|
|
396
|
+
"after": after,
|
|
397
|
+
"before": before,
|
|
398
|
+
"connected_to_agents_count_eq": connected_to_agents_count_eq,
|
|
399
|
+
"connected_to_agents_count_gt": connected_to_agents_count_gt,
|
|
400
|
+
"connected_to_agents_count_lt": connected_to_agents_count_lt,
|
|
401
|
+
"description_search": description_search,
|
|
402
|
+
"identifier_keys": identifier_keys,
|
|
403
|
+
"identity_id": identity_id,
|
|
404
|
+
"label": label,
|
|
405
|
+
"label_search": label_search,
|
|
406
|
+
"limit": limit,
|
|
407
|
+
"match_all_tags": match_all_tags,
|
|
408
|
+
"name": name,
|
|
409
|
+
"order": order,
|
|
410
|
+
"order_by": order_by,
|
|
411
|
+
"project_id": project_id,
|
|
412
|
+
"tags": tags,
|
|
413
|
+
"templates_only": templates_only,
|
|
414
|
+
"value_search": value_search,
|
|
415
|
+
},
|
|
416
|
+
block_list_params.BlockListParams,
|
|
417
|
+
),
|
|
418
|
+
),
|
|
419
|
+
model=BlockResponse,
|
|
420
|
+
)
|
|
421
|
+
|
|
422
|
+
def delete(
|
|
423
|
+
self,
|
|
424
|
+
block_id: str,
|
|
425
|
+
*,
|
|
426
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
427
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
428
|
+
extra_headers: Headers | None = None,
|
|
429
|
+
extra_query: Query | None = None,
|
|
430
|
+
extra_body: Body | None = None,
|
|
431
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
432
|
+
) -> object:
|
|
433
|
+
"""
|
|
434
|
+
Delete Block
|
|
435
|
+
|
|
436
|
+
Args:
|
|
437
|
+
block_id: The ID of the block in the format 'block-<uuid4>'
|
|
438
|
+
|
|
439
|
+
extra_headers: Send extra headers
|
|
440
|
+
|
|
441
|
+
extra_query: Add additional query parameters to the request
|
|
442
|
+
|
|
443
|
+
extra_body: Add additional JSON properties to the request
|
|
444
|
+
|
|
445
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
446
|
+
"""
|
|
447
|
+
if not block_id:
|
|
448
|
+
raise ValueError(f"Expected a non-empty value for `block_id` but received {block_id!r}")
|
|
449
|
+
return self._delete(
|
|
450
|
+
f"/v1/blocks/{block_id}",
|
|
451
|
+
options=make_request_options(
|
|
452
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
453
|
+
),
|
|
454
|
+
cast_to=object,
|
|
455
|
+
)
|
|
456
|
+
|
|
457
|
+
|
|
458
|
+
class AsyncBlocksResource(AsyncAPIResource):
|
|
459
|
+
@cached_property
|
|
460
|
+
def agents(self) -> AsyncAgentsResource:
|
|
461
|
+
return AsyncAgentsResource(self._client)
|
|
462
|
+
|
|
463
|
+
@cached_property
|
|
464
|
+
def with_raw_response(self) -> AsyncBlocksResourceWithRawResponse:
|
|
465
|
+
"""
|
|
466
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
467
|
+
the raw response object instead of the parsed content.
|
|
468
|
+
|
|
469
|
+
For more information, see https://www.github.com/letta-ai/letta-python#accessing-raw-response-data-eg-headers
|
|
470
|
+
"""
|
|
471
|
+
return AsyncBlocksResourceWithRawResponse(self)
|
|
472
|
+
|
|
473
|
+
@cached_property
|
|
474
|
+
def with_streaming_response(self) -> AsyncBlocksResourceWithStreamingResponse:
|
|
475
|
+
"""
|
|
476
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
477
|
+
|
|
478
|
+
For more information, see https://www.github.com/letta-ai/letta-python#with_streaming_response
|
|
479
|
+
"""
|
|
480
|
+
return AsyncBlocksResourceWithStreamingResponse(self)
|
|
481
|
+
|
|
482
|
+
async def create(
|
|
483
|
+
self,
|
|
484
|
+
*,
|
|
485
|
+
label: str,
|
|
486
|
+
value: str,
|
|
487
|
+
base_template_id: Optional[str] | Omit = omit,
|
|
488
|
+
deployment_id: Optional[str] | Omit = omit,
|
|
489
|
+
description: Optional[str] | Omit = omit,
|
|
490
|
+
entity_id: Optional[str] | Omit = omit,
|
|
491
|
+
hidden: Optional[bool] | Omit = omit,
|
|
492
|
+
is_template: bool | Omit = omit,
|
|
493
|
+
limit: int | Omit = omit,
|
|
494
|
+
metadata: Optional[Dict[str, object]] | Omit = omit,
|
|
495
|
+
preserve_on_migration: Optional[bool] | Omit = omit,
|
|
496
|
+
project_id: Optional[str] | Omit = omit,
|
|
497
|
+
read_only: bool | Omit = omit,
|
|
498
|
+
tags: Optional[SequenceNotStr[str]] | Omit = omit,
|
|
499
|
+
template_id: Optional[str] | Omit = omit,
|
|
500
|
+
template_name: Optional[str] | Omit = omit,
|
|
501
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
502
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
503
|
+
extra_headers: Headers | None = None,
|
|
504
|
+
extra_query: Query | None = None,
|
|
505
|
+
extra_body: Body | None = None,
|
|
506
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
507
|
+
) -> BlockResponse:
|
|
508
|
+
"""
|
|
509
|
+
Create Block
|
|
510
|
+
|
|
511
|
+
Args:
|
|
512
|
+
label: Label of the block.
|
|
513
|
+
|
|
514
|
+
value: Value of the block.
|
|
515
|
+
|
|
516
|
+
base_template_id: The base template id of the block.
|
|
517
|
+
|
|
518
|
+
deployment_id: The id of the deployment.
|
|
519
|
+
|
|
520
|
+
description: Description of the block.
|
|
521
|
+
|
|
522
|
+
entity_id: The id of the entity within the template.
|
|
523
|
+
|
|
524
|
+
hidden: If set to True, the block will be hidden.
|
|
525
|
+
|
|
526
|
+
limit: Character limit of the block.
|
|
527
|
+
|
|
528
|
+
metadata: Metadata of the block.
|
|
529
|
+
|
|
530
|
+
preserve_on_migration: Preserve the block on template migration.
|
|
531
|
+
|
|
532
|
+
project_id: The associated project id.
|
|
533
|
+
|
|
534
|
+
read_only: Whether the agent has read-only access to the block.
|
|
535
|
+
|
|
536
|
+
tags: The tags to associate with the block.
|
|
537
|
+
|
|
538
|
+
template_id: The id of the template.
|
|
539
|
+
|
|
540
|
+
template_name: Name of the block if it is a template.
|
|
541
|
+
|
|
542
|
+
extra_headers: Send extra headers
|
|
543
|
+
|
|
544
|
+
extra_query: Add additional query parameters to the request
|
|
545
|
+
|
|
546
|
+
extra_body: Add additional JSON properties to the request
|
|
547
|
+
|
|
548
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
549
|
+
"""
|
|
550
|
+
return await self._post(
|
|
551
|
+
"/v1/blocks/",
|
|
552
|
+
body=await async_maybe_transform(
|
|
553
|
+
{
|
|
554
|
+
"label": label,
|
|
555
|
+
"value": value,
|
|
556
|
+
"base_template_id": base_template_id,
|
|
557
|
+
"deployment_id": deployment_id,
|
|
558
|
+
"description": description,
|
|
559
|
+
"entity_id": entity_id,
|
|
560
|
+
"hidden": hidden,
|
|
561
|
+
"is_template": is_template,
|
|
562
|
+
"limit": limit,
|
|
563
|
+
"metadata": metadata,
|
|
564
|
+
"preserve_on_migration": preserve_on_migration,
|
|
565
|
+
"project_id": project_id,
|
|
566
|
+
"read_only": read_only,
|
|
567
|
+
"tags": tags,
|
|
568
|
+
"template_id": template_id,
|
|
569
|
+
"template_name": template_name,
|
|
570
|
+
},
|
|
571
|
+
block_create_params.BlockCreateParams,
|
|
572
|
+
),
|
|
573
|
+
options=make_request_options(
|
|
574
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
575
|
+
),
|
|
576
|
+
cast_to=BlockResponse,
|
|
577
|
+
)
|
|
578
|
+
|
|
579
|
+
async def retrieve(
|
|
580
|
+
self,
|
|
581
|
+
block_id: str,
|
|
582
|
+
*,
|
|
583
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
584
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
585
|
+
extra_headers: Headers | None = None,
|
|
586
|
+
extra_query: Query | None = None,
|
|
587
|
+
extra_body: Body | None = None,
|
|
588
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
589
|
+
) -> BlockResponse:
|
|
590
|
+
"""
|
|
591
|
+
Retrieve Block
|
|
592
|
+
|
|
593
|
+
Args:
|
|
594
|
+
block_id: The ID of the block in the format 'block-<uuid4>'
|
|
595
|
+
|
|
596
|
+
extra_headers: Send extra headers
|
|
597
|
+
|
|
598
|
+
extra_query: Add additional query parameters to the request
|
|
599
|
+
|
|
600
|
+
extra_body: Add additional JSON properties to the request
|
|
601
|
+
|
|
602
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
603
|
+
"""
|
|
604
|
+
if not block_id:
|
|
605
|
+
raise ValueError(f"Expected a non-empty value for `block_id` but received {block_id!r}")
|
|
606
|
+
return await self._get(
|
|
607
|
+
f"/v1/blocks/{block_id}",
|
|
608
|
+
options=make_request_options(
|
|
609
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
610
|
+
),
|
|
611
|
+
cast_to=BlockResponse,
|
|
612
|
+
)
|
|
613
|
+
|
|
614
|
+
async def update(
|
|
615
|
+
self,
|
|
616
|
+
block_id: str,
|
|
617
|
+
*,
|
|
618
|
+
base_template_id: Optional[str] | Omit = omit,
|
|
619
|
+
deployment_id: Optional[str] | Omit = omit,
|
|
620
|
+
description: Optional[str] | Omit = omit,
|
|
621
|
+
entity_id: Optional[str] | Omit = omit,
|
|
622
|
+
hidden: Optional[bool] | Omit = omit,
|
|
623
|
+
is_template: bool | Omit = omit,
|
|
624
|
+
label: Optional[str] | Omit = omit,
|
|
625
|
+
limit: Optional[int] | Omit = omit,
|
|
626
|
+
metadata: Optional[Dict[str, object]] | Omit = omit,
|
|
627
|
+
preserve_on_migration: Optional[bool] | Omit = omit,
|
|
628
|
+
project_id: Optional[str] | Omit = omit,
|
|
629
|
+
read_only: bool | Omit = omit,
|
|
630
|
+
tags: Optional[SequenceNotStr[str]] | Omit = omit,
|
|
631
|
+
template_id: Optional[str] | Omit = omit,
|
|
632
|
+
template_name: Optional[str] | Omit = omit,
|
|
633
|
+
value: Optional[str] | Omit = omit,
|
|
634
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
635
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
636
|
+
extra_headers: Headers | None = None,
|
|
637
|
+
extra_query: Query | None = None,
|
|
638
|
+
extra_body: Body | None = None,
|
|
639
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
640
|
+
) -> BlockResponse:
|
|
641
|
+
"""
|
|
642
|
+
Update Block
|
|
643
|
+
|
|
644
|
+
Args:
|
|
645
|
+
block_id: The ID of the block in the format 'block-<uuid4>'
|
|
646
|
+
|
|
647
|
+
base_template_id: The base template id of the block.
|
|
648
|
+
|
|
649
|
+
deployment_id: The id of the deployment.
|
|
650
|
+
|
|
651
|
+
description: Description of the block.
|
|
652
|
+
|
|
653
|
+
entity_id: The id of the entity within the template.
|
|
654
|
+
|
|
655
|
+
hidden: If set to True, the block will be hidden.
|
|
656
|
+
|
|
657
|
+
is_template: Whether the block is a template (e.g. saved human/persona options).
|
|
658
|
+
|
|
659
|
+
label: Label of the block (e.g. 'human', 'persona') in the context window.
|
|
660
|
+
|
|
661
|
+
limit: Character limit of the block.
|
|
662
|
+
|
|
663
|
+
metadata: Metadata of the block.
|
|
664
|
+
|
|
665
|
+
preserve_on_migration: Preserve the block on template migration.
|
|
666
|
+
|
|
667
|
+
project_id: The associated project id.
|
|
668
|
+
|
|
669
|
+
read_only: Whether the agent has read-only access to the block.
|
|
670
|
+
|
|
671
|
+
tags: The tags to associate with the block.
|
|
672
|
+
|
|
673
|
+
template_id: The id of the template.
|
|
674
|
+
|
|
675
|
+
template_name: Name of the block if it is a template.
|
|
676
|
+
|
|
677
|
+
value: Value of the block.
|
|
678
|
+
|
|
679
|
+
extra_headers: Send extra headers
|
|
680
|
+
|
|
681
|
+
extra_query: Add additional query parameters to the request
|
|
682
|
+
|
|
683
|
+
extra_body: Add additional JSON properties to the request
|
|
684
|
+
|
|
685
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
686
|
+
"""
|
|
687
|
+
if not block_id:
|
|
688
|
+
raise ValueError(f"Expected a non-empty value for `block_id` but received {block_id!r}")
|
|
689
|
+
return await self._patch(
|
|
690
|
+
f"/v1/blocks/{block_id}",
|
|
691
|
+
body=await async_maybe_transform(
|
|
692
|
+
{
|
|
693
|
+
"base_template_id": base_template_id,
|
|
694
|
+
"deployment_id": deployment_id,
|
|
695
|
+
"description": description,
|
|
696
|
+
"entity_id": entity_id,
|
|
697
|
+
"hidden": hidden,
|
|
698
|
+
"is_template": is_template,
|
|
699
|
+
"label": label,
|
|
700
|
+
"limit": limit,
|
|
701
|
+
"metadata": metadata,
|
|
702
|
+
"preserve_on_migration": preserve_on_migration,
|
|
703
|
+
"project_id": project_id,
|
|
704
|
+
"read_only": read_only,
|
|
705
|
+
"tags": tags,
|
|
706
|
+
"template_id": template_id,
|
|
707
|
+
"template_name": template_name,
|
|
708
|
+
"value": value,
|
|
709
|
+
},
|
|
710
|
+
block_update_params.BlockUpdateParams,
|
|
711
|
+
),
|
|
712
|
+
options=make_request_options(
|
|
713
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
714
|
+
),
|
|
715
|
+
cast_to=BlockResponse,
|
|
716
|
+
)
|
|
717
|
+
|
|
718
|
+
def list(
|
|
719
|
+
self,
|
|
720
|
+
*,
|
|
721
|
+
after: Optional[str] | Omit = omit,
|
|
722
|
+
before: Optional[str] | Omit = omit,
|
|
723
|
+
connected_to_agents_count_eq: Optional[Iterable[int]] | Omit = omit,
|
|
724
|
+
connected_to_agents_count_gt: Optional[int] | Omit = omit,
|
|
725
|
+
connected_to_agents_count_lt: Optional[int] | Omit = omit,
|
|
726
|
+
description_search: Optional[str] | Omit = omit,
|
|
727
|
+
identifier_keys: Optional[SequenceNotStr[str]] | Omit = omit,
|
|
728
|
+
identity_id: Optional[str] | Omit = omit,
|
|
729
|
+
label: Optional[str] | Omit = omit,
|
|
730
|
+
label_search: Optional[str] | Omit = omit,
|
|
731
|
+
limit: Optional[int] | Omit = omit,
|
|
732
|
+
match_all_tags: bool | Omit = omit,
|
|
733
|
+
name: Optional[str] | Omit = omit,
|
|
734
|
+
order: Literal["asc", "desc"] | Omit = omit,
|
|
735
|
+
order_by: Literal["created_at"] | Omit = omit,
|
|
736
|
+
project_id: Optional[str] | Omit = omit,
|
|
737
|
+
tags: Optional[SequenceNotStr[str]] | Omit = omit,
|
|
738
|
+
templates_only: bool | Omit = omit,
|
|
739
|
+
value_search: Optional[str] | Omit = omit,
|
|
740
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
741
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
742
|
+
extra_headers: Headers | None = None,
|
|
743
|
+
extra_query: Query | None = None,
|
|
744
|
+
extra_body: Body | None = None,
|
|
745
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
746
|
+
) -> AsyncPaginator[BlockResponse, AsyncArrayPage[BlockResponse]]:
|
|
747
|
+
"""List Blocks
|
|
748
|
+
|
|
749
|
+
Args:
|
|
750
|
+
after: Block ID cursor for pagination.
|
|
751
|
+
|
|
752
|
+
Returns blocks that come after this block ID in
|
|
753
|
+
the specified sort order
|
|
754
|
+
|
|
755
|
+
before: Block ID cursor for pagination. Returns blocks that come before this block ID in
|
|
756
|
+
the specified sort order
|
|
757
|
+
|
|
758
|
+
connected_to_agents_count_eq: Filter blocks by the exact number of connected agents. If provided, returns
|
|
759
|
+
blocks that have exactly this number of connected agents.
|
|
760
|
+
|
|
761
|
+
connected_to_agents_count_gt: Filter blocks by the number of connected agents. If provided, returns blocks
|
|
762
|
+
that have more than this number of connected agents.
|
|
763
|
+
|
|
764
|
+
connected_to_agents_count_lt: Filter blocks by the number of connected agents. If provided, returns blocks
|
|
765
|
+
that have less than this number of connected agents.
|
|
766
|
+
|
|
767
|
+
description_search: Search blocks by description. If provided, returns blocks whose description
|
|
768
|
+
matches the search query. This is a full-text search on block descriptions.
|
|
769
|
+
|
|
770
|
+
identifier_keys: Search agents by identifier keys
|
|
771
|
+
|
|
772
|
+
identity_id: The ID of the identity in the format 'identity-<uuid4>'
|
|
773
|
+
|
|
774
|
+
label: Label to include (alphanumeric, hyphens, underscores, forward slashes)
|
|
775
|
+
|
|
776
|
+
label_search: Search blocks by label. If provided, returns blocks whose label matches the
|
|
777
|
+
search query. This is a full-text search on block labels.
|
|
778
|
+
|
|
779
|
+
limit: Number of blocks to return
|
|
780
|
+
|
|
781
|
+
match_all_tags: If True, only returns blocks that match ALL given tags. Otherwise, return blocks
|
|
782
|
+
that have ANY of the passed-in tags.
|
|
783
|
+
|
|
784
|
+
name: Name filter (alphanumeric, spaces, hyphens, underscores)
|
|
785
|
+
|
|
786
|
+
order: Sort order for blocks by creation time. 'asc' for oldest first, 'desc' for
|
|
787
|
+
newest first
|
|
788
|
+
|
|
789
|
+
order_by: Field to sort by
|
|
790
|
+
|
|
791
|
+
project_id: Search blocks by project id
|
|
792
|
+
|
|
793
|
+
tags: List of tags to filter blocks by
|
|
794
|
+
|
|
795
|
+
templates_only: Whether to include only templates
|
|
796
|
+
|
|
797
|
+
value_search: Search blocks by value. If provided, returns blocks whose value matches the
|
|
798
|
+
search query. This is a full-text search on block values.
|
|
799
|
+
|
|
800
|
+
extra_headers: Send extra headers
|
|
801
|
+
|
|
802
|
+
extra_query: Add additional query parameters to the request
|
|
803
|
+
|
|
804
|
+
extra_body: Add additional JSON properties to the request
|
|
805
|
+
|
|
806
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
807
|
+
"""
|
|
808
|
+
return self._get_api_list(
|
|
809
|
+
"/v1/blocks/",
|
|
810
|
+
page=AsyncArrayPage[BlockResponse],
|
|
811
|
+
options=make_request_options(
|
|
812
|
+
extra_headers=extra_headers,
|
|
813
|
+
extra_query=extra_query,
|
|
814
|
+
extra_body=extra_body,
|
|
815
|
+
timeout=timeout,
|
|
816
|
+
query=maybe_transform(
|
|
817
|
+
{
|
|
818
|
+
"after": after,
|
|
819
|
+
"before": before,
|
|
820
|
+
"connected_to_agents_count_eq": connected_to_agents_count_eq,
|
|
821
|
+
"connected_to_agents_count_gt": connected_to_agents_count_gt,
|
|
822
|
+
"connected_to_agents_count_lt": connected_to_agents_count_lt,
|
|
823
|
+
"description_search": description_search,
|
|
824
|
+
"identifier_keys": identifier_keys,
|
|
825
|
+
"identity_id": identity_id,
|
|
826
|
+
"label": label,
|
|
827
|
+
"label_search": label_search,
|
|
828
|
+
"limit": limit,
|
|
829
|
+
"match_all_tags": match_all_tags,
|
|
830
|
+
"name": name,
|
|
831
|
+
"order": order,
|
|
832
|
+
"order_by": order_by,
|
|
833
|
+
"project_id": project_id,
|
|
834
|
+
"tags": tags,
|
|
835
|
+
"templates_only": templates_only,
|
|
836
|
+
"value_search": value_search,
|
|
837
|
+
},
|
|
838
|
+
block_list_params.BlockListParams,
|
|
839
|
+
),
|
|
840
|
+
),
|
|
841
|
+
model=BlockResponse,
|
|
842
|
+
)
|
|
843
|
+
|
|
844
|
+
async def delete(
|
|
845
|
+
self,
|
|
846
|
+
block_id: str,
|
|
847
|
+
*,
|
|
848
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
849
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
850
|
+
extra_headers: Headers | None = None,
|
|
851
|
+
extra_query: Query | None = None,
|
|
852
|
+
extra_body: Body | None = None,
|
|
853
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
854
|
+
) -> object:
|
|
855
|
+
"""
|
|
856
|
+
Delete Block
|
|
857
|
+
|
|
858
|
+
Args:
|
|
859
|
+
block_id: The ID of the block in the format 'block-<uuid4>'
|
|
860
|
+
|
|
861
|
+
extra_headers: Send extra headers
|
|
862
|
+
|
|
863
|
+
extra_query: Add additional query parameters to the request
|
|
864
|
+
|
|
865
|
+
extra_body: Add additional JSON properties to the request
|
|
866
|
+
|
|
867
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
868
|
+
"""
|
|
869
|
+
if not block_id:
|
|
870
|
+
raise ValueError(f"Expected a non-empty value for `block_id` but received {block_id!r}")
|
|
871
|
+
return await self._delete(
|
|
872
|
+
f"/v1/blocks/{block_id}",
|
|
873
|
+
options=make_request_options(
|
|
874
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
875
|
+
),
|
|
876
|
+
cast_to=object,
|
|
877
|
+
)
|
|
878
|
+
|
|
879
|
+
|
|
880
|
+
class BlocksResourceWithRawResponse:
|
|
881
|
+
def __init__(self, blocks: BlocksResource) -> None:
|
|
882
|
+
self._blocks = blocks
|
|
883
|
+
|
|
884
|
+
self.create = to_raw_response_wrapper(
|
|
885
|
+
blocks.create,
|
|
886
|
+
)
|
|
887
|
+
self.retrieve = to_raw_response_wrapper(
|
|
888
|
+
blocks.retrieve,
|
|
889
|
+
)
|
|
890
|
+
self.update = to_raw_response_wrapper(
|
|
891
|
+
blocks.update,
|
|
892
|
+
)
|
|
893
|
+
self.list = to_raw_response_wrapper(
|
|
894
|
+
blocks.list,
|
|
895
|
+
)
|
|
896
|
+
self.delete = to_raw_response_wrapper(
|
|
897
|
+
blocks.delete,
|
|
898
|
+
)
|
|
899
|
+
|
|
900
|
+
@cached_property
|
|
901
|
+
def agents(self) -> AgentsResourceWithRawResponse:
|
|
902
|
+
return AgentsResourceWithRawResponse(self._blocks.agents)
|
|
903
|
+
|
|
904
|
+
|
|
905
|
+
class AsyncBlocksResourceWithRawResponse:
|
|
906
|
+
def __init__(self, blocks: AsyncBlocksResource) -> None:
|
|
907
|
+
self._blocks = blocks
|
|
908
|
+
|
|
909
|
+
self.create = async_to_raw_response_wrapper(
|
|
910
|
+
blocks.create,
|
|
911
|
+
)
|
|
912
|
+
self.retrieve = async_to_raw_response_wrapper(
|
|
913
|
+
blocks.retrieve,
|
|
914
|
+
)
|
|
915
|
+
self.update = async_to_raw_response_wrapper(
|
|
916
|
+
blocks.update,
|
|
917
|
+
)
|
|
918
|
+
self.list = async_to_raw_response_wrapper(
|
|
919
|
+
blocks.list,
|
|
920
|
+
)
|
|
921
|
+
self.delete = async_to_raw_response_wrapper(
|
|
922
|
+
blocks.delete,
|
|
923
|
+
)
|
|
924
|
+
|
|
925
|
+
@cached_property
|
|
926
|
+
def agents(self) -> AsyncAgentsResourceWithRawResponse:
|
|
927
|
+
return AsyncAgentsResourceWithRawResponse(self._blocks.agents)
|
|
928
|
+
|
|
929
|
+
|
|
930
|
+
class BlocksResourceWithStreamingResponse:
|
|
931
|
+
def __init__(self, blocks: BlocksResource) -> None:
|
|
932
|
+
self._blocks = blocks
|
|
933
|
+
|
|
934
|
+
self.create = to_streamed_response_wrapper(
|
|
935
|
+
blocks.create,
|
|
936
|
+
)
|
|
937
|
+
self.retrieve = to_streamed_response_wrapper(
|
|
938
|
+
blocks.retrieve,
|
|
939
|
+
)
|
|
940
|
+
self.update = to_streamed_response_wrapper(
|
|
941
|
+
blocks.update,
|
|
942
|
+
)
|
|
943
|
+
self.list = to_streamed_response_wrapper(
|
|
944
|
+
blocks.list,
|
|
945
|
+
)
|
|
946
|
+
self.delete = to_streamed_response_wrapper(
|
|
947
|
+
blocks.delete,
|
|
948
|
+
)
|
|
949
|
+
|
|
950
|
+
@cached_property
|
|
951
|
+
def agents(self) -> AgentsResourceWithStreamingResponse:
|
|
952
|
+
return AgentsResourceWithStreamingResponse(self._blocks.agents)
|
|
953
|
+
|
|
954
|
+
|
|
955
|
+
class AsyncBlocksResourceWithStreamingResponse:
|
|
956
|
+
def __init__(self, blocks: AsyncBlocksResource) -> None:
|
|
957
|
+
self._blocks = blocks
|
|
958
|
+
|
|
959
|
+
self.create = async_to_streamed_response_wrapper(
|
|
960
|
+
blocks.create,
|
|
961
|
+
)
|
|
962
|
+
self.retrieve = async_to_streamed_response_wrapper(
|
|
963
|
+
blocks.retrieve,
|
|
964
|
+
)
|
|
965
|
+
self.update = async_to_streamed_response_wrapper(
|
|
966
|
+
blocks.update,
|
|
967
|
+
)
|
|
968
|
+
self.list = async_to_streamed_response_wrapper(
|
|
969
|
+
blocks.list,
|
|
970
|
+
)
|
|
971
|
+
self.delete = async_to_streamed_response_wrapper(
|
|
972
|
+
blocks.delete,
|
|
973
|
+
)
|
|
974
|
+
|
|
975
|
+
@cached_property
|
|
976
|
+
def agents(self) -> AsyncAgentsResourceWithStreamingResponse:
|
|
977
|
+
return AsyncAgentsResourceWithStreamingResponse(self._blocks.agents)
|