letta-client 1.0.0a6__py3-none-any.whl → 1.0.0a7__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of letta-client might be problematic. Click here for more details.
- {letta_sdk → letta_client}/__init__.py +8 -8
- {letta_sdk → letta_client}/_base_client.py +1 -1
- {letta_sdk → letta_client}/_client.py +124 -171
- {letta_sdk → letta_client}/_exceptions.py +2 -2
- {letta_sdk → letta_client}/_resource.py +5 -5
- {letta_sdk → letta_client}/_response.py +8 -6
- {letta_sdk → letta_client}/_streaming.py +3 -3
- {letta_sdk → letta_client}/_types.py +1 -1
- {letta_sdk → letta_client}/_utils/_logs.py +3 -3
- {letta_sdk → letta_client}/_utils/_resources_proxy.py +4 -4
- {letta_sdk → letta_client}/_version.py +2 -2
- {letta_sdk → letta_client}/resources/__init__.py +14 -154
- {letta_sdk → letta_client}/resources/agents/__init__.py +28 -42
- {letta_sdk → letta_client}/resources/agents/agents.py +216 -734
- {letta_sdk/resources/agents/core_memory → letta_client/resources/agents}/blocks.py +103 -12
- {letta_sdk → letta_client}/resources/agents/files.py +71 -8
- {letta_sdk → letta_client}/resources/agents/folders.py +90 -3
- letta_client/resources/agents/groups.py +242 -0
- {letta_sdk → letta_client}/resources/agents/messages.py +252 -480
- {letta_sdk → letta_client}/resources/agents/tools.py +135 -22
- letta_sdk/resources/jobs.py → letta_client/resources/archives.py +268 -280
- {letta_sdk/resources/messages → letta_client/resources/batches}/batches.py +35 -152
- letta_client/resources/batches/messages.py +238 -0
- {letta_sdk/resources/agents/core_memory → letta_client/resources/blocks}/__init__.py +14 -14
- letta_client/resources/blocks/agents.py +284 -0
- {letta_sdk/resources → letta_client/resources/blocks}/blocks.py +54 -167
- letta_client/resources/folders/__init__.py +47 -0
- letta_client/resources/folders/agents.py +234 -0
- letta_client/resources/folders/files.py +469 -0
- letta_sdk/resources/providers.py → letta_client/resources/folders/folders.py +292 -309
- {letta_sdk → letta_client}/resources/groups/groups.py +12 -78
- {letta_sdk → letta_client}/resources/groups/messages.py +165 -27
- letta_client/resources/identities/__init__.py +61 -0
- letta_client/resources/identities/agents.py +266 -0
- letta_client/resources/identities/blocks.py +234 -0
- {letta_sdk/resources → letta_client/resources/identities}/identities.py +267 -525
- letta_client/resources/identities/properties.py +174 -0
- letta_client/resources/models/__init__.py +33 -0
- {letta_sdk/resources → letta_client/resources/models}/embeddings.py +26 -49
- {letta_sdk/resources → letta_client/resources/models}/models.py +42 -117
- letta_client/resources/runs/__init__.py +61 -0
- letta_sdk/resources/archives.py → letta_client/resources/runs/messages.py +182 -153
- letta_client/resources/runs/runs.py +460 -0
- letta_sdk/resources/projects.py → letta_client/resources/runs/steps.py +93 -56
- letta_sdk/resources/voice_beta/chat.py → letta_client/resources/runs/usage.py +50 -57
- letta_client/resources/steps/__init__.py +75 -0
- letta_client/resources/steps/feedback.py +198 -0
- letta_client/resources/steps/messages.py +234 -0
- letta_client/resources/steps/metrics.py +167 -0
- letta_client/resources/steps/steps.py +511 -0
- letta_sdk/resources/telemetry.py → letta_client/resources/steps/trace.py +45 -56
- letta_client/resources/templates/__init__.py +33 -0
- letta_client/resources/templates/agents.py +236 -0
- letta_client/resources/templates/templates.py +102 -0
- {letta_sdk/resources/tools → letta_client/resources}/tools.py +239 -425
- letta_client/types/__init__.py +120 -0
- {letta_sdk → letta_client}/types/agent_create_params.py +5 -2
- {letta_sdk → letta_client}/types/agent_environment_variable.py +3 -0
- letta_client/types/agent_export_file_params.py +18 -0
- letta_sdk/types/agent_export_response.py → letta_client/types/agent_export_file_response.py +2 -2
- letta_sdk/types/agent_import_params.py → letta_client/types/agent_import_file_params.py +5 -2
- letta_sdk/types/agent_import_response.py → letta_client/types/agent_import_file_response.py +2 -2
- {letta_sdk → letta_client}/types/agent_list_params.py +19 -2
- {letta_sdk → letta_client}/types/agent_retrieve_params.py +20 -3
- {letta_sdk → letta_client}/types/agent_state.py +131 -3
- {letta_sdk → letta_client}/types/agent_type.py +1 -0
- {letta_sdk → letta_client}/types/agent_update_params.py +12 -0
- {letta_sdk → letta_client}/types/agents/__init__.py +12 -19
- letta_client/types/agents/approval_create_param.py +44 -0
- {letta_sdk → letta_client}/types/agents/approval_request_message.py +10 -2
- letta_client/types/agents/approval_response_message.py +63 -0
- {letta_sdk/types/agents/core_memory → letta_client/types/agents}/block.py +1 -1
- letta_sdk/types/identity_list_blocks_params.py → letta_client/types/agents/block_list_params.py +2 -2
- {letta_sdk/types/agents/core_memory → letta_client/types/agents}/block_update_params.py +1 -0
- letta_client/types/agents/file_list_params.py +40 -0
- letta_client/types/agents/folder_list_params.py +34 -0
- letta_sdk/types/source.py → letta_client/types/agents/folder_list_response.py +10 -6
- letta_client/types/agents/group_list_params.py +37 -0
- letta_client/types/agents/group_list_response.py +10 -0
- {letta_sdk → letta_client}/types/agents/letta_assistant_message_content_union.py +3 -0
- {letta_sdk → letta_client}/types/agents/letta_assistant_message_content_union_param.py +4 -0
- {letta_sdk → letta_client}/types/agents/letta_response.py +0 -4
- {letta_sdk → letta_client}/types/agents/message.py +93 -2
- {letta_sdk → letta_client}/types/agents/message_list_params.py +20 -5
- letta_sdk/types/agent_reset_messages_params.py → letta_client/types/agents/message_reset_params.py +2 -2
- {letta_sdk → letta_client}/types/agents/message_send_async_params.py +12 -3
- {letta_sdk → letta_client}/types/agents/message_send_params.py +12 -3
- letta_sdk/types/agents/message_send_stream_params.py → letta_client/types/agents/message_stream_params.py +14 -5
- {letta_sdk → letta_client}/types/agents/message_update_params.py +4 -0
- {letta_sdk → letta_client}/types/agents/omitted_reasoning_content.py +3 -0
- {letta_sdk → letta_client}/types/agents/omitted_reasoning_content_param.py +4 -0
- {letta_sdk → letta_client}/types/agents/run.py +16 -19
- {letta_sdk → letta_client}/types/agents/text_content.py +3 -0
- {letta_sdk → letta_client}/types/agents/text_content_param.py +4 -0
- {letta_sdk → letta_client}/types/agents/tool_call_content.py +3 -0
- {letta_sdk → letta_client}/types/agents/tool_call_content_param.py +4 -1
- {letta_sdk → letta_client}/types/agents/tool_call_message.py +6 -2
- letta_client/types/agents/tool_list_params.py +34 -0
- {letta_sdk → letta_client}/types/agents/tool_return.py +7 -3
- letta_client/types/agents/tool_return_param.py +25 -0
- letta_client/types/agents/tool_update_approval_params.py +21 -0
- {letta_sdk → letta_client}/types/archive.py +4 -0
- letta_client/types/archive_create_params.py +19 -0
- letta_sdk/types/archive_retrieve_params.py → letta_client/types/archive_list_params.py +2 -2
- letta_sdk/types/archive_retrieve_response.py → letta_client/types/archive_list_response.py +2 -2
- {letta_sdk → letta_client}/types/archive_update_params.py +3 -3
- {letta_sdk/types/messages → letta_client/types}/batch_create_params.py +15 -6
- letta_sdk/types/job.py → letta_client/types/batch_job.py +8 -3
- letta_client/types/batches/__init__.py +6 -0
- letta_sdk/types/messages/batch_list_messages_params.py → letta_client/types/batches/message_list_params.py +2 -2
- letta_sdk/types/messages/batch_list_messages_response.py → letta_client/types/batches/message_list_response.py +2 -2
- {letta_sdk → letta_client}/types/block_list_response.py +1 -1
- letta_client/types/blocks/__init__.py +6 -0
- letta_sdk/types/block_list_agents_params.py → letta_client/types/blocks/agent_list_params.py +22 -5
- letta_sdk/types/agent_list_groups_response.py → letta_client/types/blocks/agent_list_response.py +3 -3
- letta_client/types/child_tool_rule.py +40 -0
- letta_client/types/child_tool_rule_param.py +42 -0
- letta_client/types/folders/__init__.py +10 -0
- letta_sdk/types/folder_list_agents_params.py → letta_client/types/folders/agent_list_params.py +2 -2
- letta_sdk/types/run_list_active_response.py → letta_client/types/folders/agent_list_response.py +2 -4
- letta_sdk/types/folder_list_files_params.py → letta_client/types/folders/file_list_params.py +2 -2
- letta_client/types/folders/file_list_response.py +68 -0
- letta_sdk/types/source_upload_file_params.py → letta_client/types/folders/file_upload_params.py +5 -6
- letta_sdk/types/file_metadata.py → letta_client/types/folders/file_upload_response.py +5 -5
- {letta_sdk → letta_client}/types/groups/__init__.py +1 -1
- {letta_sdk → letta_client}/types/groups/message_send_params.py +12 -3
- letta_sdk/types/groups/message_send_stream_params.py → letta_client/types/groups/message_stream_params.py +14 -5
- {letta_sdk → letta_client}/types/groups/message_update_params.py +4 -0
- letta_sdk/types/health_check_response.py → letta_client/types/health_response.py +2 -2
- letta_client/types/identities/__init__.py +9 -0
- letta_sdk/types/identity_list_agents_params.py → letta_client/types/identities/agent_list_params.py +19 -3
- letta_client/types/identities/agent_list_response.py +10 -0
- letta_client/types/identities/block_list_params.py +34 -0
- letta_sdk/types/agents/folder_list_response.py → letta_client/types/identities/block_list_response.py +3 -3
- letta_sdk/types/identity_upsert_properties_params.py → letta_client/types/identities/property_upsert_params.py +3 -3
- letta_sdk/types/identity_modify_params.py → letta_client/types/identity_update_params.py +2 -2
- {letta_sdk → letta_client}/types/init_tool_rule.py +10 -1
- {letta_sdk → letta_client}/types/init_tool_rule_param.py +10 -1
- {letta_sdk → letta_client}/types/llm_config.py +6 -0
- {letta_sdk → letta_client}/types/llm_config_param.py +6 -0
- {letta_sdk/types/voice_beta → letta_client/types/models}/__init__.py +1 -1
- letta_sdk/types/agents/archival_memory_create_response.py → letta_client/types/models/embedding_list_response.py +3 -3
- {letta_sdk → letta_client}/types/run_list_params.py +29 -5
- letta_client/types/runs/__init__.py +10 -0
- letta_sdk/types/run_list_messages_params.py → letta_client/types/runs/message_list_params.py +5 -2
- letta_client/types/runs/message_list_response.py +10 -0
- letta_sdk/types/run_retrieve_stream_params.py → letta_client/types/runs/message_stream_params.py +2 -2
- letta_sdk/types/run_list_steps_params.py → letta_client/types/runs/step_list_params.py +9 -6
- letta_sdk/types/job_list_response.py → letta_client/types/runs/step_list_response.py +3 -3
- letta_sdk/types/run_retrieve_usage_response.py → letta_client/types/runs/usage_retrieve_response.py +3 -3
- {letta_sdk → letta_client}/types/step.py +6 -6
- letta_client/types/steps/__init__.py +8 -0
- letta_sdk/types/step_update_feedback_params.py → letta_client/types/steps/feedback_create_params.py +3 -3
- letta_sdk/types/step_list_messages_params.py → letta_client/types/steps/message_list_params.py +2 -2
- letta_client/types/steps/message_list_response.py +34 -0
- letta_sdk/types/step_retrieve_metrics_response.py → letta_client/types/steps/metric_retrieve_response.py +6 -6
- {letta_sdk/types/tools → letta_client/types/templates}/__init__.py +2 -0
- letta_sdk/types/template_create_agents_params.py → letta_client/types/templates/agent_create_params.py +4 -4
- {letta_sdk → letta_client}/types/tool.py +6 -0
- {letta_sdk → letta_client}/types/tool_create_params.py +6 -0
- {letta_sdk → letta_client}/types/tool_return_message.py +3 -0
- letta_sdk/types/tool_modify_params.py → letta_client/types/tool_update_params.py +8 -2
- letta_sdk/types/tool_upsert_base_response.py → letta_client/types/tool_upsert_base_tools_response.py +2 -2
- {letta_sdk → letta_client}/types/tool_upsert_params.py +6 -0
- {letta_client-1.0.0a6.dist-info → letta_client-1.0.0a7.dist-info}/METADATA +110 -70
- letta_client-1.0.0a7.dist-info/RECORD +307 -0
- {letta_client-1.0.0a6.dist-info → letta_client-1.0.0a7.dist-info}/licenses/LICENSE +1 -1
- letta_client-1.0.0a6.dist-info/RECORD +0 -420
- letta_sdk/resources/_internal_templates/__init__.py +0 -33
- letta_sdk/resources/_internal_templates/_internal_templates.py +0 -961
- letta_sdk/resources/_internal_templates/deployment.py +0 -268
- letta_sdk/resources/agents/archival_memory.py +0 -581
- letta_sdk/resources/agents/core_memory/core_memory.py +0 -278
- letta_sdk/resources/agents/sources.py +0 -332
- letta_sdk/resources/client_side_access_tokens.py +0 -402
- letta_sdk/resources/folders.py +0 -1562
- letta_sdk/resources/health.py +0 -135
- letta_sdk/resources/messages/messages.py +0 -102
- letta_sdk/resources/runs.py +0 -1016
- letta_sdk/resources/sources/__init__.py +0 -33
- letta_sdk/resources/sources/files.py +0 -341
- letta_sdk/resources/sources/sources.py +0 -1371
- letta_sdk/resources/steps.py +0 -784
- letta_sdk/resources/templates.py +0 -1310
- letta_sdk/resources/tools/__init__.py +0 -47
- letta_sdk/resources/tools/composio/__init__.py +0 -33
- letta_sdk/resources/tools/composio/apps.py +0 -214
- letta_sdk/resources/tools/composio/composio.py +0 -201
- letta_sdk/resources/tools/mcp/__init__.py +0 -47
- letta_sdk/resources/tools/mcp/mcp.py +0 -134
- letta_sdk/resources/tools/mcp/oauth.py +0 -214
- letta_sdk/resources/tools/mcp/servers/__init__.py +0 -33
- letta_sdk/resources/tools/mcp/servers/servers.py +0 -1785
- letta_sdk/resources/tools/mcp/servers/tools.py +0 -263
- letta_sdk/resources/voice_beta/__init__.py +0 -33
- letta_sdk/resources/voice_beta/voice_beta.py +0 -102
- letta_sdk/types/__init__.py +0 -226
- letta_sdk/types/_internal_templates/__init__.py +0 -7
- letta_sdk/types/_internal_templates/deployment_delete_response.py +0 -17
- letta_sdk/types/_internal_templates/deployment_list_entities_params.py +0 -15
- letta_sdk/types/_internal_templates/deployment_list_entities_response.py +0 -31
- letta_sdk/types/agent_export_params.py +0 -17
- letta_sdk/types/agent_list_groups_params.py +0 -13
- letta_sdk/types/agent_migrate_params.py +0 -19
- letta_sdk/types/agent_migrate_response.py +0 -11
- letta_sdk/types/agent_retrieve_context_response.py +0 -110
- letta_sdk/types/agent_search_params.py +0 -78
- letta_sdk/types/agent_search_response.py +0 -16
- letta_sdk/types/agent_summarize_params.py +0 -12
- letta_sdk/types/agents/approval_create_param.py +0 -22
- letta_sdk/types/agents/approval_response_message.py +0 -41
- letta_sdk/types/agents/archival_memory_create_params.py +0 -23
- letta_sdk/types/agents/archival_memory_list_params.py +0 -28
- letta_sdk/types/agents/archival_memory_list_response.py +0 -10
- letta_sdk/types/agents/archival_memory_search_params.py +0 -35
- letta_sdk/types/agents/archival_memory_search_response.py +0 -26
- letta_sdk/types/agents/core_memory/__init__.py +0 -7
- letta_sdk/types/agents/core_memory_retrieve_variables_response.py +0 -11
- letta_sdk/types/agents/file_list_params.py +0 -19
- letta_sdk/types/agents/letta_request_param.py +0 -45
- letta_sdk/types/agents/letta_streaming_request_param.py +0 -60
- letta_sdk/types/agents/memory.py +0 -92
- letta_sdk/types/agents/message_preview_raw_payload_params.py +0 -103
- letta_sdk/types/agents/message_preview_raw_payload_response.py +0 -8
- letta_sdk/types/agents/message_search_params.py +0 -38
- letta_sdk/types/agents/message_search_response.py +0 -29
- letta_sdk/types/agents/source_list_response.py +0 -10
- letta_sdk/types/agents/tool_modify_approval_params.py +0 -13
- letta_sdk/types/block_list_agents_response.py +0 -10
- letta_sdk/types/child_tool_rule.py +0 -21
- letta_sdk/types/child_tool_rule_param.py +0 -23
- letta_sdk/types/client_side_access_token_create_params.py +0 -32
- letta_sdk/types/client_side_access_token_create_response.py +0 -34
- letta_sdk/types/client_side_access_token_delete_params.py +0 -11
- letta_sdk/types/client_side_access_token_list_params.py +0 -23
- letta_sdk/types/client_side_access_token_list_response.py +0 -40
- letta_sdk/types/duplicate_file_handling.py +0 -7
- letta_sdk/types/embedding_get_total_storage_size_response.py +0 -7
- letta_sdk/types/file_processing_status.py +0 -7
- letta_sdk/types/folder_get_by_name_response.py +0 -7
- letta_sdk/types/folder_list_agents_response.py +0 -8
- letta_sdk/types/folder_list_files_response.py +0 -10
- letta_sdk/types/folder_list_passages_params.py +0 -34
- letta_sdk/types/folder_list_passages_response.py +0 -10
- letta_sdk/types/folder_retrieve_metadata_params.py +0 -11
- letta_sdk/types/folder_upload_file_params.py +0 -21
- letta_sdk/types/identity_list_agents_response.py +0 -10
- letta_sdk/types/identity_list_blocks_response.py +0 -10
- letta_sdk/types/internal_template_create_agent_params.py +0 -217
- letta_sdk/types/internal_template_create_block_params.py +0 -54
- letta_sdk/types/internal_template_create_group_params.py +0 -49
- letta_sdk/types/job_list_active_params.py +0 -28
- letta_sdk/types/job_list_active_response.py +0 -10
- letta_sdk/types/job_list_params.py +0 -31
- letta_sdk/types/messages/__init__.py +0 -10
- letta_sdk/types/messages/batch_job.py +0 -60
- letta_sdk/types/model_list_embedding_response.py +0 -10
- letta_sdk/types/organization_sources_stats.py +0 -49
- letta_sdk/types/passage.py +0 -56
- letta_sdk/types/project_list_params.py +0 -16
- letta_sdk/types/project_list_response.py +0 -23
- letta_sdk/types/provider.py +0 -42
- letta_sdk/types/provider_check_params.py +0 -30
- letta_sdk/types/provider_create_params.py +0 -33
- letta_sdk/types/provider_list_params.py +0 -42
- letta_sdk/types/provider_list_response.py +0 -10
- letta_sdk/types/provider_update_params.py +0 -25
- letta_sdk/types/run_list_active_params.py +0 -18
- letta_sdk/types/run_list_messages_response.py +0 -10
- letta_sdk/types/run_list_steps_response.py +0 -10
- letta_sdk/types/source_count_response.py +0 -7
- letta_sdk/types/source_create_params.py +0 -33
- letta_sdk/types/source_get_agents_response.py +0 -8
- letta_sdk/types/source_get_by_name_response.py +0 -7
- letta_sdk/types/source_get_metadata_params.py +0 -11
- letta_sdk/types/source_list_passages_params.py +0 -19
- letta_sdk/types/source_list_passages_response.py +0 -10
- letta_sdk/types/source_list_response.py +0 -10
- letta_sdk/types/source_update_params.py +0 -27
- letta_sdk/types/sources/__init__.py +0 -7
- letta_sdk/types/sources/file_list_params.py +0 -26
- letta_sdk/types/sources/file_list_response.py +0 -10
- letta_sdk/types/sources/file_retrieve_params.py +0 -14
- letta_sdk/types/step_list_messages_response.py +0 -34
- letta_sdk/types/template_create_agents_response.py +0 -12
- letta_sdk/types/template_create_params.py +0 -40
- letta_sdk/types/template_create_response.py +0 -29
- letta_sdk/types/template_delete_response.py +0 -9
- letta_sdk/types/template_fork_params.py +0 -17
- letta_sdk/types/template_fork_response.py +0 -29
- letta_sdk/types/template_get_snapshot_response.py +0 -258
- letta_sdk/types/template_list_params.py +0 -34
- letta_sdk/types/template_list_response.py +0 -35
- letta_sdk/types/template_list_versions_params.py +0 -16
- letta_sdk/types/template_list_versions_response.py +0 -29
- letta_sdk/types/template_rename_params.py +0 -14
- letta_sdk/types/template_rename_response.py +0 -9
- letta_sdk/types/template_save_version_params.py +0 -32
- letta_sdk/types/template_save_version_response.py +0 -29
- letta_sdk/types/template_update_description_params.py +0 -14
- letta_sdk/types/template_update_description_response.py +0 -9
- letta_sdk/types/tool_run_params.py +0 -43
- letta_sdk/types/tools/composio/__init__.py +0 -6
- letta_sdk/types/tools/composio/app_list_actions_response.py +0 -70
- letta_sdk/types/tools/composio/app_list_response.py +0 -103
- letta_sdk/types/tools/mcp/__init__.py +0 -21
- letta_sdk/types/tools/mcp/mcp_server_type.py +0 -7
- letta_sdk/types/tools/mcp/oauth_callback_params.py +0 -22
- letta_sdk/types/tools/mcp/server_add_params.py +0 -68
- letta_sdk/types/tools/mcp/server_add_response.py +0 -14
- letta_sdk/types/tools/mcp/server_connect_params.py +0 -68
- letta_sdk/types/tools/mcp/server_delete_response.py +0 -14
- letta_sdk/types/tools/mcp/server_list_response.py +0 -14
- letta_sdk/types/tools/mcp/server_resync_params.py +0 -12
- letta_sdk/types/tools/mcp/server_test_params.py +0 -68
- letta_sdk/types/tools/mcp/server_update_params.py +0 -43
- letta_sdk/types/tools/mcp/server_update_response.py +0 -12
- letta_sdk/types/tools/mcp/servers/__init__.py +0 -6
- letta_sdk/types/tools/mcp/servers/tool_execute_params.py +0 -15
- letta_sdk/types/tools/mcp/servers/tool_list_response.py +0 -85
- letta_sdk/types/tools/mcp/sse_server_config.py +0 -27
- letta_sdk/types/tools/mcp/sse_server_config_param.py +0 -29
- letta_sdk/types/tools/mcp/stdio_server_config.py +0 -24
- letta_sdk/types/tools/mcp/stdio_server_config_param.py +0 -27
- letta_sdk/types/tools/mcp/streamable_http_server_config.py +0 -27
- letta_sdk/types/tools/mcp/streamable_http_server_config_param.py +0 -29
- letta_sdk/types/voice_beta/chat_create_completion_params.py +0 -12
- {letta_sdk → letta_client}/_compat.py +0 -0
- {letta_sdk → letta_client}/_constants.py +0 -0
- {letta_sdk → letta_client}/_files.py +0 -0
- {letta_sdk → letta_client}/_models.py +0 -0
- {letta_sdk → letta_client}/_qs.py +0 -0
- {letta_sdk → letta_client}/_utils/__init__.py +0 -0
- {letta_sdk → letta_client}/_utils/_compat.py +0 -0
- {letta_sdk → letta_client}/_utils/_datetime_parse.py +0 -0
- {letta_sdk → letta_client}/_utils/_proxy.py +0 -0
- {letta_sdk → letta_client}/_utils/_reflection.py +0 -0
- {letta_sdk → letta_client}/_utils/_streams.py +0 -0
- {letta_sdk → letta_client}/_utils/_sync.py +0 -0
- {letta_sdk → letta_client}/_utils/_transform.py +0 -0
- {letta_sdk → letta_client}/_utils/_typing.py +0 -0
- {letta_sdk → letta_client}/_utils/_utils.py +0 -0
- {letta_sdk → letta_client}/lib/.keep +0 -0
- {letta_sdk → letta_client}/py.typed +0 -0
- {letta_sdk/resources/messages → letta_client/resources/batches}/__init__.py +6 -6
- {letta_sdk → letta_client}/resources/groups/__init__.py +0 -0
- {letta_sdk → letta_client}/resources/tags.py +0 -0
- {letta_sdk → letta_client}/types/agent_count_response.py +0 -0
- {letta_sdk → letta_client}/types/agent_list_response.py +0 -0
- {letta_sdk → letta_client}/types/agents/assistant_message.py +0 -0
- {letta_sdk/types/agents/core_memory → letta_client/types/agents}/block_list_response.py +0 -0
- {letta_sdk → letta_client}/types/agents/file_close_all_response.py +0 -0
- {letta_sdk → letta_client}/types/agents/file_list_response.py +0 -0
- {letta_sdk → letta_client}/types/agents/file_open_response.py +0 -0
- {letta_sdk → letta_client}/types/agents/hidden_reasoning_message.py +0 -0
- {letta_sdk → letta_client}/types/agents/image_content.py +0 -0
- {letta_sdk → letta_client}/types/agents/image_content_param.py +0 -0
- {letta_sdk → letta_client}/types/agents/job_status.py +0 -0
- {letta_sdk → letta_client}/types/agents/job_type.py +0 -0
- {letta_sdk → letta_client}/types/agents/letta_message_union.py +0 -0
- {letta_sdk → letta_client}/types/agents/letta_user_message_content_union.py +0 -0
- {letta_sdk → letta_client}/types/agents/letta_user_message_content_union_param.py +0 -0
- {letta_sdk → letta_client}/types/agents/message_cancel_params.py +0 -0
- {letta_sdk → letta_client}/types/agents/message_cancel_response.py +0 -0
- {letta_sdk → letta_client}/types/agents/message_list_response.py +0 -0
- {letta_sdk → letta_client}/types/agents/message_role.py +0 -0
- {letta_sdk → letta_client}/types/agents/message_type.py +0 -0
- {letta_sdk → letta_client}/types/agents/message_update_response.py +0 -0
- {letta_sdk → letta_client}/types/agents/reasoning_content.py +0 -0
- {letta_sdk → letta_client}/types/agents/reasoning_content_param.py +0 -0
- {letta_sdk → letta_client}/types/agents/reasoning_message.py +0 -0
- {letta_sdk → letta_client}/types/agents/redacted_reasoning_content.py +0 -0
- {letta_sdk → letta_client}/types/agents/redacted_reasoning_content_param.py +0 -0
- {letta_sdk → letta_client}/types/agents/system_message.py +0 -0
- {letta_sdk → letta_client}/types/agents/tool_call.py +0 -0
- {letta_sdk → letta_client}/types/agents/tool_call_delta.py +0 -0
- {letta_sdk → letta_client}/types/agents/tool_list_response.py +0 -0
- {letta_sdk → letta_client}/types/agents/tool_return_content.py +0 -0
- {letta_sdk → letta_client}/types/agents/tool_return_content_param.py +0 -0
- {letta_sdk → letta_client}/types/agents/update_assistant_message_param.py +0 -0
- {letta_sdk → letta_client}/types/agents/update_reasoning_message_param.py +0 -0
- {letta_sdk → letta_client}/types/agents/update_system_message_param.py +0 -0
- {letta_sdk → letta_client}/types/agents/update_user_message_param.py +0 -0
- {letta_sdk → letta_client}/types/agents/user_message.py +0 -0
- {letta_sdk/types/messages → letta_client/types}/batch_list_params.py +0 -0
- {letta_sdk/types/messages → letta_client/types}/batch_list_response.py +0 -0
- {letta_sdk → letta_client}/types/block_count_response.py +0 -0
- {letta_sdk → letta_client}/types/block_create_params.py +0 -0
- {letta_sdk → letta_client}/types/block_list_params.py +0 -0
- {letta_sdk → letta_client}/types/block_update_params.py +0 -0
- {letta_sdk → letta_client}/types/conditional_tool_rule.py +0 -0
- {letta_sdk → letta_client}/types/conditional_tool_rule_param.py +0 -0
- {letta_sdk → letta_client}/types/continue_tool_rule.py +0 -0
- {letta_sdk → letta_client}/types/continue_tool_rule_param.py +0 -0
- {letta_sdk → letta_client}/types/create_block_param.py +0 -0
- {letta_sdk → letta_client}/types/dynamic_manager_param.py +0 -0
- {letta_sdk → letta_client}/types/embedding_config.py +0 -0
- {letta_sdk → letta_client}/types/embedding_config_param.py +0 -0
- {letta_sdk → letta_client}/types/folder.py +0 -0
- {letta_sdk → letta_client}/types/folder_count_response.py +0 -0
- {letta_sdk → letta_client}/types/folder_create_params.py +0 -0
- {letta_sdk → letta_client}/types/folder_list_params.py +0 -0
- {letta_sdk → letta_client}/types/folder_list_response.py +0 -0
- {letta_sdk → letta_client}/types/folder_update_params.py +0 -0
- {letta_sdk → letta_client}/types/group.py +0 -0
- {letta_sdk → letta_client}/types/group_count_response.py +0 -0
- {letta_sdk → letta_client}/types/group_create_params.py +0 -0
- {letta_sdk → letta_client}/types/group_list_params.py +0 -0
- {letta_sdk → letta_client}/types/group_list_response.py +0 -0
- {letta_sdk → letta_client}/types/group_update_params.py +0 -0
- {letta_sdk → letta_client}/types/groups/message_list_params.py +0 -0
- {letta_sdk → letta_client}/types/groups/message_list_response.py +0 -0
- {letta_sdk → letta_client}/types/groups/message_update_response.py +0 -0
- {letta_sdk → letta_client}/types/identity.py +0 -0
- {letta_sdk → letta_client}/types/identity_count_response.py +0 -0
- {letta_sdk → letta_client}/types/identity_create_params.py +0 -0
- {letta_sdk → letta_client}/types/identity_list_params.py +0 -0
- {letta_sdk → letta_client}/types/identity_list_response.py +0 -0
- {letta_sdk → letta_client}/types/identity_property.py +0 -0
- {letta_sdk → letta_client}/types/identity_property_param.py +0 -0
- {letta_sdk → letta_client}/types/identity_type.py +0 -0
- {letta_sdk → letta_client}/types/identity_upsert_params.py +0 -0
- {letta_sdk → letta_client}/types/json_object_response_format.py +0 -0
- {letta_sdk → letta_client}/types/json_object_response_format_param.py +0 -0
- {letta_sdk → letta_client}/types/json_schema_response_format.py +0 -0
- {letta_sdk → letta_client}/types/json_schema_response_format_param.py +0 -0
- {letta_sdk → letta_client}/types/letta_message_content_union_param.py +0 -0
- {letta_sdk → letta_client}/types/manager_type.py +0 -0
- {letta_sdk → letta_client}/types/max_count_per_step_tool_rule.py +0 -0
- {letta_sdk → letta_client}/types/max_count_per_step_tool_rule_param.py +0 -0
- {letta_sdk → letta_client}/types/message_create_param.py +0 -0
- {letta_sdk → letta_client}/types/model_list_params.py +0 -0
- {letta_sdk → letta_client}/types/model_list_response.py +0 -0
- {letta_sdk → letta_client}/types/npm_requirement.py +0 -0
- {letta_sdk → letta_client}/types/npm_requirement_param.py +0 -0
- {letta_sdk → letta_client}/types/parent_tool_rule.py +0 -0
- {letta_sdk → letta_client}/types/parent_tool_rule_param.py +0 -0
- {letta_sdk → letta_client}/types/pip_requirement.py +0 -0
- {letta_sdk → letta_client}/types/pip_requirement_param.py +0 -0
- {letta_sdk → letta_client}/types/provider_category.py +0 -0
- {letta_sdk → letta_client}/types/provider_trace.py +0 -0
- {letta_sdk → letta_client}/types/provider_type.py +0 -0
- {letta_sdk → letta_client}/types/required_before_exit_tool_rule.py +0 -0
- {letta_sdk → letta_client}/types/required_before_exit_tool_rule_param.py +0 -0
- {letta_sdk → letta_client}/types/requires_approval_tool_rule.py +0 -0
- {letta_sdk → letta_client}/types/requires_approval_tool_rule_param.py +0 -0
- {letta_sdk → letta_client}/types/round_robin_manager_param.py +0 -0
- {letta_sdk → letta_client}/types/run_list_response.py +0 -0
- {letta_sdk → letta_client}/types/sleeptime_manager_param.py +0 -0
- {letta_sdk → letta_client}/types/step_list_params.py +0 -0
- {letta_sdk → letta_client}/types/step_list_response.py +0 -0
- {letta_sdk → letta_client}/types/stop_reason_type.py +0 -0
- {letta_sdk → letta_client}/types/supervisor_manager_param.py +0 -0
- {letta_sdk → letta_client}/types/tag_list_params.py +0 -0
- {letta_sdk → letta_client}/types/tag_list_response.py +0 -0
- {letta_sdk → letta_client}/types/terminal_tool_rule.py +0 -0
- {letta_sdk → letta_client}/types/terminal_tool_rule_param.py +0 -0
- {letta_sdk → letta_client}/types/text_response_format.py +0 -0
- {letta_sdk → letta_client}/types/text_response_format_param.py +0 -0
- {letta_sdk → letta_client}/types/tool_count_params.py +0 -0
- {letta_sdk → letta_client}/types/tool_count_response.py +0 -0
- {letta_sdk → letta_client}/types/tool_list_params.py +0 -0
- {letta_sdk → letta_client}/types/tool_list_response.py +0 -0
- {letta_sdk → letta_client}/types/tool_type.py +1 -1
- {letta_sdk → letta_client}/types/vector_db_provider.py +0 -0
- {letta_sdk → letta_client}/types/voice_sleeptime_manager_param.py +0 -0
- {letta_client-1.0.0a6.dist-info → letta_client-1.0.0a7.dist-info}/WHEEL +0 -0
letta_sdk/resources/folders.py
DELETED
|
@@ -1,1562 +0,0 @@
|
|
|
1
|
-
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
|
|
3
|
-
from __future__ import annotations
|
|
4
|
-
|
|
5
|
-
import typing_extensions
|
|
6
|
-
from typing import Dict, Mapping, Optional, cast
|
|
7
|
-
from typing_extensions import Literal
|
|
8
|
-
|
|
9
|
-
import httpx
|
|
10
|
-
|
|
11
|
-
from ..types import (
|
|
12
|
-
DuplicateFileHandling,
|
|
13
|
-
folder_list_params,
|
|
14
|
-
folder_create_params,
|
|
15
|
-
folder_update_params,
|
|
16
|
-
folder_list_files_params,
|
|
17
|
-
folder_list_agents_params,
|
|
18
|
-
folder_upload_file_params,
|
|
19
|
-
folder_list_passages_params,
|
|
20
|
-
folder_retrieve_metadata_params,
|
|
21
|
-
)
|
|
22
|
-
from .._types import Body, Omit, Query, Headers, NoneType, NotGiven, FileTypes, omit, not_given
|
|
23
|
-
from .._utils import extract_files, maybe_transform, deepcopy_minimal, async_maybe_transform
|
|
24
|
-
from .._compat import cached_property
|
|
25
|
-
from .._resource import SyncAPIResource, AsyncAPIResource
|
|
26
|
-
from .._response import (
|
|
27
|
-
to_raw_response_wrapper,
|
|
28
|
-
to_streamed_response_wrapper,
|
|
29
|
-
async_to_raw_response_wrapper,
|
|
30
|
-
async_to_streamed_response_wrapper,
|
|
31
|
-
)
|
|
32
|
-
from .._base_client import make_request_options
|
|
33
|
-
from ..types.folder import Folder
|
|
34
|
-
from ..types.file_metadata import FileMetadata
|
|
35
|
-
from ..types.folder_list_response import FolderListResponse
|
|
36
|
-
from ..types.folder_count_response import FolderCountResponse
|
|
37
|
-
from ..types.embedding_config_param import EmbeddingConfigParam
|
|
38
|
-
from ..types.duplicate_file_handling import DuplicateFileHandling
|
|
39
|
-
from ..types.folder_list_files_response import FolderListFilesResponse
|
|
40
|
-
from ..types.organization_sources_stats import OrganizationSourcesStats
|
|
41
|
-
from ..types.folder_list_agents_response import FolderListAgentsResponse
|
|
42
|
-
from ..types.folder_list_passages_response import FolderListPassagesResponse
|
|
43
|
-
|
|
44
|
-
__all__ = ["FoldersResource", "AsyncFoldersResource"]
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
class FoldersResource(SyncAPIResource):
|
|
48
|
-
@cached_property
|
|
49
|
-
def with_raw_response(self) -> FoldersResourceWithRawResponse:
|
|
50
|
-
"""
|
|
51
|
-
This property can be used as a prefix for any HTTP method call to return
|
|
52
|
-
the raw response object instead of the parsed content.
|
|
53
|
-
|
|
54
|
-
For more information, see https://www.github.com/letta-ai/letta-python#accessing-raw-response-data-eg-headers
|
|
55
|
-
"""
|
|
56
|
-
return FoldersResourceWithRawResponse(self)
|
|
57
|
-
|
|
58
|
-
@cached_property
|
|
59
|
-
def with_streaming_response(self) -> FoldersResourceWithStreamingResponse:
|
|
60
|
-
"""
|
|
61
|
-
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
62
|
-
|
|
63
|
-
For more information, see https://www.github.com/letta-ai/letta-python#with_streaming_response
|
|
64
|
-
"""
|
|
65
|
-
return FoldersResourceWithStreamingResponse(self)
|
|
66
|
-
|
|
67
|
-
def create(
|
|
68
|
-
self,
|
|
69
|
-
*,
|
|
70
|
-
name: str,
|
|
71
|
-
description: Optional[str] | Omit = omit,
|
|
72
|
-
embedding: Optional[str] | Omit = omit,
|
|
73
|
-
embedding_chunk_size: Optional[int] | Omit = omit,
|
|
74
|
-
embedding_config: Optional[EmbeddingConfigParam] | Omit = omit,
|
|
75
|
-
instructions: Optional[str] | Omit = omit,
|
|
76
|
-
metadata: Optional[Dict[str, object]] | Omit = omit,
|
|
77
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
78
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
79
|
-
extra_headers: Headers | None = None,
|
|
80
|
-
extra_query: Query | None = None,
|
|
81
|
-
extra_body: Body | None = None,
|
|
82
|
-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
83
|
-
) -> Folder:
|
|
84
|
-
"""
|
|
85
|
-
Create a new data folder.
|
|
86
|
-
|
|
87
|
-
Args:
|
|
88
|
-
name: The name of the source.
|
|
89
|
-
|
|
90
|
-
description: The description of the source.
|
|
91
|
-
|
|
92
|
-
embedding: The handle for the embedding config used by the source.
|
|
93
|
-
|
|
94
|
-
embedding_chunk_size: The chunk size of the embedding.
|
|
95
|
-
|
|
96
|
-
embedding_config: Configuration for embedding model connection and processing parameters.
|
|
97
|
-
|
|
98
|
-
instructions: Instructions for how to use the source.
|
|
99
|
-
|
|
100
|
-
metadata: Metadata associated with the source.
|
|
101
|
-
|
|
102
|
-
extra_headers: Send extra headers
|
|
103
|
-
|
|
104
|
-
extra_query: Add additional query parameters to the request
|
|
105
|
-
|
|
106
|
-
extra_body: Add additional JSON properties to the request
|
|
107
|
-
|
|
108
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
109
|
-
"""
|
|
110
|
-
return self._post(
|
|
111
|
-
"/v1/folders/",
|
|
112
|
-
body=maybe_transform(
|
|
113
|
-
{
|
|
114
|
-
"name": name,
|
|
115
|
-
"description": description,
|
|
116
|
-
"embedding": embedding,
|
|
117
|
-
"embedding_chunk_size": embedding_chunk_size,
|
|
118
|
-
"embedding_config": embedding_config,
|
|
119
|
-
"instructions": instructions,
|
|
120
|
-
"metadata": metadata,
|
|
121
|
-
},
|
|
122
|
-
folder_create_params.FolderCreateParams,
|
|
123
|
-
),
|
|
124
|
-
options=make_request_options(
|
|
125
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
126
|
-
),
|
|
127
|
-
cast_to=Folder,
|
|
128
|
-
)
|
|
129
|
-
|
|
130
|
-
def retrieve(
|
|
131
|
-
self,
|
|
132
|
-
folder_id: str,
|
|
133
|
-
*,
|
|
134
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
135
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
136
|
-
extra_headers: Headers | None = None,
|
|
137
|
-
extra_query: Query | None = None,
|
|
138
|
-
extra_body: Body | None = None,
|
|
139
|
-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
140
|
-
) -> Folder:
|
|
141
|
-
"""
|
|
142
|
-
Get a folder by ID
|
|
143
|
-
|
|
144
|
-
Args:
|
|
145
|
-
extra_headers: Send extra headers
|
|
146
|
-
|
|
147
|
-
extra_query: Add additional query parameters to the request
|
|
148
|
-
|
|
149
|
-
extra_body: Add additional JSON properties to the request
|
|
150
|
-
|
|
151
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
152
|
-
"""
|
|
153
|
-
if not folder_id:
|
|
154
|
-
raise ValueError(f"Expected a non-empty value for `folder_id` but received {folder_id!r}")
|
|
155
|
-
return self._get(
|
|
156
|
-
f"/v1/folders/{folder_id}",
|
|
157
|
-
options=make_request_options(
|
|
158
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
159
|
-
),
|
|
160
|
-
cast_to=Folder,
|
|
161
|
-
)
|
|
162
|
-
|
|
163
|
-
def update(
|
|
164
|
-
self,
|
|
165
|
-
folder_id: str,
|
|
166
|
-
*,
|
|
167
|
-
description: Optional[str] | Omit = omit,
|
|
168
|
-
embedding_config: Optional[EmbeddingConfigParam] | Omit = omit,
|
|
169
|
-
instructions: Optional[str] | Omit = omit,
|
|
170
|
-
metadata: Optional[Dict[str, object]] | Omit = omit,
|
|
171
|
-
name: Optional[str] | Omit = omit,
|
|
172
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
173
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
174
|
-
extra_headers: Headers | None = None,
|
|
175
|
-
extra_query: Query | None = None,
|
|
176
|
-
extra_body: Body | None = None,
|
|
177
|
-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
178
|
-
) -> Folder:
|
|
179
|
-
"""
|
|
180
|
-
Update the name or documentation of an existing data folder.
|
|
181
|
-
|
|
182
|
-
Args:
|
|
183
|
-
description: The description of the source.
|
|
184
|
-
|
|
185
|
-
embedding_config: Configuration for embedding model connection and processing parameters.
|
|
186
|
-
|
|
187
|
-
instructions: Instructions for how to use the source.
|
|
188
|
-
|
|
189
|
-
metadata: Metadata associated with the source.
|
|
190
|
-
|
|
191
|
-
name: The name of the source.
|
|
192
|
-
|
|
193
|
-
extra_headers: Send extra headers
|
|
194
|
-
|
|
195
|
-
extra_query: Add additional query parameters to the request
|
|
196
|
-
|
|
197
|
-
extra_body: Add additional JSON properties to the request
|
|
198
|
-
|
|
199
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
200
|
-
"""
|
|
201
|
-
if not folder_id:
|
|
202
|
-
raise ValueError(f"Expected a non-empty value for `folder_id` but received {folder_id!r}")
|
|
203
|
-
return self._patch(
|
|
204
|
-
f"/v1/folders/{folder_id}",
|
|
205
|
-
body=maybe_transform(
|
|
206
|
-
{
|
|
207
|
-
"description": description,
|
|
208
|
-
"embedding_config": embedding_config,
|
|
209
|
-
"instructions": instructions,
|
|
210
|
-
"metadata": metadata,
|
|
211
|
-
"name": name,
|
|
212
|
-
},
|
|
213
|
-
folder_update_params.FolderUpdateParams,
|
|
214
|
-
),
|
|
215
|
-
options=make_request_options(
|
|
216
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
217
|
-
),
|
|
218
|
-
cast_to=Folder,
|
|
219
|
-
)
|
|
220
|
-
|
|
221
|
-
def list(
|
|
222
|
-
self,
|
|
223
|
-
*,
|
|
224
|
-
after: Optional[str] | Omit = omit,
|
|
225
|
-
before: Optional[str] | Omit = omit,
|
|
226
|
-
limit: Optional[int] | Omit = omit,
|
|
227
|
-
name: Optional[str] | Omit = omit,
|
|
228
|
-
order: Literal["asc", "desc"] | Omit = omit,
|
|
229
|
-
order_by: Literal["created_at"] | Omit = omit,
|
|
230
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
231
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
232
|
-
extra_headers: Headers | None = None,
|
|
233
|
-
extra_query: Query | None = None,
|
|
234
|
-
extra_body: Body | None = None,
|
|
235
|
-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
236
|
-
) -> FolderListResponse:
|
|
237
|
-
"""
|
|
238
|
-
List all data folders created by a user.
|
|
239
|
-
|
|
240
|
-
Args:
|
|
241
|
-
after: Folder ID cursor for pagination. Returns folders that come after this folder ID
|
|
242
|
-
in the specified sort order
|
|
243
|
-
|
|
244
|
-
before: Folder ID cursor for pagination. Returns folders that come before this folder ID
|
|
245
|
-
in the specified sort order
|
|
246
|
-
|
|
247
|
-
limit: Maximum number of folders to return
|
|
248
|
-
|
|
249
|
-
name: Folder name to filter by
|
|
250
|
-
|
|
251
|
-
order: Sort order for folders by creation time. 'asc' for oldest first, 'desc' for
|
|
252
|
-
newest first
|
|
253
|
-
|
|
254
|
-
order_by: Field to sort by
|
|
255
|
-
|
|
256
|
-
extra_headers: Send extra headers
|
|
257
|
-
|
|
258
|
-
extra_query: Add additional query parameters to the request
|
|
259
|
-
|
|
260
|
-
extra_body: Add additional JSON properties to the request
|
|
261
|
-
|
|
262
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
263
|
-
"""
|
|
264
|
-
return self._get(
|
|
265
|
-
"/v1/folders/",
|
|
266
|
-
options=make_request_options(
|
|
267
|
-
extra_headers=extra_headers,
|
|
268
|
-
extra_query=extra_query,
|
|
269
|
-
extra_body=extra_body,
|
|
270
|
-
timeout=timeout,
|
|
271
|
-
query=maybe_transform(
|
|
272
|
-
{
|
|
273
|
-
"after": after,
|
|
274
|
-
"before": before,
|
|
275
|
-
"limit": limit,
|
|
276
|
-
"name": name,
|
|
277
|
-
"order": order,
|
|
278
|
-
"order_by": order_by,
|
|
279
|
-
},
|
|
280
|
-
folder_list_params.FolderListParams,
|
|
281
|
-
),
|
|
282
|
-
),
|
|
283
|
-
cast_to=FolderListResponse,
|
|
284
|
-
)
|
|
285
|
-
|
|
286
|
-
def delete(
|
|
287
|
-
self,
|
|
288
|
-
folder_id: str,
|
|
289
|
-
*,
|
|
290
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
291
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
292
|
-
extra_headers: Headers | None = None,
|
|
293
|
-
extra_query: Query | None = None,
|
|
294
|
-
extra_body: Body | None = None,
|
|
295
|
-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
296
|
-
) -> object:
|
|
297
|
-
"""
|
|
298
|
-
Delete a data folder.
|
|
299
|
-
|
|
300
|
-
Args:
|
|
301
|
-
extra_headers: Send extra headers
|
|
302
|
-
|
|
303
|
-
extra_query: Add additional query parameters to the request
|
|
304
|
-
|
|
305
|
-
extra_body: Add additional JSON properties to the request
|
|
306
|
-
|
|
307
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
308
|
-
"""
|
|
309
|
-
if not folder_id:
|
|
310
|
-
raise ValueError(f"Expected a non-empty value for `folder_id` but received {folder_id!r}")
|
|
311
|
-
return self._delete(
|
|
312
|
-
f"/v1/folders/{folder_id}",
|
|
313
|
-
options=make_request_options(
|
|
314
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
315
|
-
),
|
|
316
|
-
cast_to=object,
|
|
317
|
-
)
|
|
318
|
-
|
|
319
|
-
def count(
|
|
320
|
-
self,
|
|
321
|
-
*,
|
|
322
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
323
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
324
|
-
extra_headers: Headers | None = None,
|
|
325
|
-
extra_query: Query | None = None,
|
|
326
|
-
extra_body: Body | None = None,
|
|
327
|
-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
328
|
-
) -> FolderCountResponse:
|
|
329
|
-
"""Count all data folders created by a user."""
|
|
330
|
-
return self._get(
|
|
331
|
-
"/v1/folders/count",
|
|
332
|
-
options=make_request_options(
|
|
333
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
334
|
-
),
|
|
335
|
-
cast_to=int,
|
|
336
|
-
)
|
|
337
|
-
|
|
338
|
-
def delete_file(
|
|
339
|
-
self,
|
|
340
|
-
file_id: str,
|
|
341
|
-
*,
|
|
342
|
-
folder_id: str,
|
|
343
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
344
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
345
|
-
extra_headers: Headers | None = None,
|
|
346
|
-
extra_query: Query | None = None,
|
|
347
|
-
extra_body: Body | None = None,
|
|
348
|
-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
349
|
-
) -> None:
|
|
350
|
-
"""
|
|
351
|
-
Delete a file from a folder.
|
|
352
|
-
|
|
353
|
-
Args:
|
|
354
|
-
extra_headers: Send extra headers
|
|
355
|
-
|
|
356
|
-
extra_query: Add additional query parameters to the request
|
|
357
|
-
|
|
358
|
-
extra_body: Add additional JSON properties to the request
|
|
359
|
-
|
|
360
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
361
|
-
"""
|
|
362
|
-
if not folder_id:
|
|
363
|
-
raise ValueError(f"Expected a non-empty value for `folder_id` but received {folder_id!r}")
|
|
364
|
-
if not file_id:
|
|
365
|
-
raise ValueError(f"Expected a non-empty value for `file_id` but received {file_id!r}")
|
|
366
|
-
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
367
|
-
return self._delete(
|
|
368
|
-
f"/v1/folders/{folder_id}/{file_id}",
|
|
369
|
-
options=make_request_options(
|
|
370
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
371
|
-
),
|
|
372
|
-
cast_to=NoneType,
|
|
373
|
-
)
|
|
374
|
-
|
|
375
|
-
@typing_extensions.deprecated("deprecated")
|
|
376
|
-
def get_by_name(
|
|
377
|
-
self,
|
|
378
|
-
folder_name: str,
|
|
379
|
-
*,
|
|
380
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
381
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
382
|
-
extra_headers: Headers | None = None,
|
|
383
|
-
extra_query: Query | None = None,
|
|
384
|
-
extra_body: Body | None = None,
|
|
385
|
-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
386
|
-
) -> str:
|
|
387
|
-
"""
|
|
388
|
-
**Deprecated**: Please use the list endpoint `GET /v1/folders?name=` instead.
|
|
389
|
-
|
|
390
|
-
Get a folder by name.
|
|
391
|
-
|
|
392
|
-
Args:
|
|
393
|
-
extra_headers: Send extra headers
|
|
394
|
-
|
|
395
|
-
extra_query: Add additional query parameters to the request
|
|
396
|
-
|
|
397
|
-
extra_body: Add additional JSON properties to the request
|
|
398
|
-
|
|
399
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
400
|
-
"""
|
|
401
|
-
if not folder_name:
|
|
402
|
-
raise ValueError(f"Expected a non-empty value for `folder_name` but received {folder_name!r}")
|
|
403
|
-
return self._get(
|
|
404
|
-
f"/v1/folders/name/{folder_name}",
|
|
405
|
-
options=make_request_options(
|
|
406
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
407
|
-
),
|
|
408
|
-
cast_to=str,
|
|
409
|
-
)
|
|
410
|
-
|
|
411
|
-
def list_agents(
|
|
412
|
-
self,
|
|
413
|
-
folder_id: str,
|
|
414
|
-
*,
|
|
415
|
-
after: Optional[str] | Omit = omit,
|
|
416
|
-
before: Optional[str] | Omit = omit,
|
|
417
|
-
limit: Optional[int] | Omit = omit,
|
|
418
|
-
order: Literal["asc", "desc"] | Omit = omit,
|
|
419
|
-
order_by: Literal["created_at"] | Omit = omit,
|
|
420
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
421
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
422
|
-
extra_headers: Headers | None = None,
|
|
423
|
-
extra_query: Query | None = None,
|
|
424
|
-
extra_body: Body | None = None,
|
|
425
|
-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
426
|
-
) -> FolderListAgentsResponse:
|
|
427
|
-
"""
|
|
428
|
-
Get all agent IDs that have the specified folder attached.
|
|
429
|
-
|
|
430
|
-
Args:
|
|
431
|
-
after: Agent ID cursor for pagination. Returns agents that come after this agent ID in
|
|
432
|
-
the specified sort order
|
|
433
|
-
|
|
434
|
-
before: Agent ID cursor for pagination. Returns agents that come before this agent ID in
|
|
435
|
-
the specified sort order
|
|
436
|
-
|
|
437
|
-
limit: Maximum number of agents to return
|
|
438
|
-
|
|
439
|
-
order: Sort order for agents by creation time. 'asc' for oldest first, 'desc' for
|
|
440
|
-
newest first
|
|
441
|
-
|
|
442
|
-
order_by: Field to sort by
|
|
443
|
-
|
|
444
|
-
extra_headers: Send extra headers
|
|
445
|
-
|
|
446
|
-
extra_query: Add additional query parameters to the request
|
|
447
|
-
|
|
448
|
-
extra_body: Add additional JSON properties to the request
|
|
449
|
-
|
|
450
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
451
|
-
"""
|
|
452
|
-
if not folder_id:
|
|
453
|
-
raise ValueError(f"Expected a non-empty value for `folder_id` but received {folder_id!r}")
|
|
454
|
-
return self._get(
|
|
455
|
-
f"/v1/folders/{folder_id}/agents",
|
|
456
|
-
options=make_request_options(
|
|
457
|
-
extra_headers=extra_headers,
|
|
458
|
-
extra_query=extra_query,
|
|
459
|
-
extra_body=extra_body,
|
|
460
|
-
timeout=timeout,
|
|
461
|
-
query=maybe_transform(
|
|
462
|
-
{
|
|
463
|
-
"after": after,
|
|
464
|
-
"before": before,
|
|
465
|
-
"limit": limit,
|
|
466
|
-
"order": order,
|
|
467
|
-
"order_by": order_by,
|
|
468
|
-
},
|
|
469
|
-
folder_list_agents_params.FolderListAgentsParams,
|
|
470
|
-
),
|
|
471
|
-
),
|
|
472
|
-
cast_to=FolderListAgentsResponse,
|
|
473
|
-
)
|
|
474
|
-
|
|
475
|
-
def list_files(
|
|
476
|
-
self,
|
|
477
|
-
folder_id: str,
|
|
478
|
-
*,
|
|
479
|
-
after: Optional[str] | Omit = omit,
|
|
480
|
-
before: Optional[str] | Omit = omit,
|
|
481
|
-
include_content: bool | Omit = omit,
|
|
482
|
-
limit: Optional[int] | Omit = omit,
|
|
483
|
-
order: Literal["asc", "desc"] | Omit = omit,
|
|
484
|
-
order_by: Literal["created_at"] | Omit = omit,
|
|
485
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
486
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
487
|
-
extra_headers: Headers | None = None,
|
|
488
|
-
extra_query: Query | None = None,
|
|
489
|
-
extra_body: Body | None = None,
|
|
490
|
-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
491
|
-
) -> FolderListFilesResponse:
|
|
492
|
-
"""
|
|
493
|
-
List paginated files associated with a data folder.
|
|
494
|
-
|
|
495
|
-
Args:
|
|
496
|
-
after: File ID cursor for pagination. Returns files that come after this file ID in the
|
|
497
|
-
specified sort order
|
|
498
|
-
|
|
499
|
-
before: File ID cursor for pagination. Returns files that come before this file ID in
|
|
500
|
-
the specified sort order
|
|
501
|
-
|
|
502
|
-
include_content: Whether to include full file content
|
|
503
|
-
|
|
504
|
-
limit: Maximum number of files to return
|
|
505
|
-
|
|
506
|
-
order: Sort order for files by creation time. 'asc' for oldest first, 'desc' for newest
|
|
507
|
-
first
|
|
508
|
-
|
|
509
|
-
order_by: Field to sort by
|
|
510
|
-
|
|
511
|
-
extra_headers: Send extra headers
|
|
512
|
-
|
|
513
|
-
extra_query: Add additional query parameters to the request
|
|
514
|
-
|
|
515
|
-
extra_body: Add additional JSON properties to the request
|
|
516
|
-
|
|
517
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
518
|
-
"""
|
|
519
|
-
if not folder_id:
|
|
520
|
-
raise ValueError(f"Expected a non-empty value for `folder_id` but received {folder_id!r}")
|
|
521
|
-
return self._get(
|
|
522
|
-
f"/v1/folders/{folder_id}/files",
|
|
523
|
-
options=make_request_options(
|
|
524
|
-
extra_headers=extra_headers,
|
|
525
|
-
extra_query=extra_query,
|
|
526
|
-
extra_body=extra_body,
|
|
527
|
-
timeout=timeout,
|
|
528
|
-
query=maybe_transform(
|
|
529
|
-
{
|
|
530
|
-
"after": after,
|
|
531
|
-
"before": before,
|
|
532
|
-
"include_content": include_content,
|
|
533
|
-
"limit": limit,
|
|
534
|
-
"order": order,
|
|
535
|
-
"order_by": order_by,
|
|
536
|
-
},
|
|
537
|
-
folder_list_files_params.FolderListFilesParams,
|
|
538
|
-
),
|
|
539
|
-
),
|
|
540
|
-
cast_to=FolderListFilesResponse,
|
|
541
|
-
)
|
|
542
|
-
|
|
543
|
-
def list_passages(
|
|
544
|
-
self,
|
|
545
|
-
folder_id: str,
|
|
546
|
-
*,
|
|
547
|
-
after: Optional[str] | Omit = omit,
|
|
548
|
-
before: Optional[str] | Omit = omit,
|
|
549
|
-
limit: Optional[int] | Omit = omit,
|
|
550
|
-
order: Literal["asc", "desc"] | Omit = omit,
|
|
551
|
-
order_by: Literal["created_at"] | Omit = omit,
|
|
552
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
553
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
554
|
-
extra_headers: Headers | None = None,
|
|
555
|
-
extra_query: Query | None = None,
|
|
556
|
-
extra_body: Body | None = None,
|
|
557
|
-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
558
|
-
) -> FolderListPassagesResponse:
|
|
559
|
-
"""
|
|
560
|
-
List all passages associated with a data folder.
|
|
561
|
-
|
|
562
|
-
Args:
|
|
563
|
-
after: Passage ID cursor for pagination. Returns passages that come after this passage
|
|
564
|
-
ID in the specified sort order
|
|
565
|
-
|
|
566
|
-
before: Passage ID cursor for pagination. Returns passages that come before this passage
|
|
567
|
-
ID in the specified sort order
|
|
568
|
-
|
|
569
|
-
limit: Maximum number of passages to return
|
|
570
|
-
|
|
571
|
-
order: Sort order for passages by creation time. 'asc' for oldest first, 'desc' for
|
|
572
|
-
newest first
|
|
573
|
-
|
|
574
|
-
order_by: Field to sort by
|
|
575
|
-
|
|
576
|
-
extra_headers: Send extra headers
|
|
577
|
-
|
|
578
|
-
extra_query: Add additional query parameters to the request
|
|
579
|
-
|
|
580
|
-
extra_body: Add additional JSON properties to the request
|
|
581
|
-
|
|
582
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
583
|
-
"""
|
|
584
|
-
if not folder_id:
|
|
585
|
-
raise ValueError(f"Expected a non-empty value for `folder_id` but received {folder_id!r}")
|
|
586
|
-
return self._get(
|
|
587
|
-
f"/v1/folders/{folder_id}/passages",
|
|
588
|
-
options=make_request_options(
|
|
589
|
-
extra_headers=extra_headers,
|
|
590
|
-
extra_query=extra_query,
|
|
591
|
-
extra_body=extra_body,
|
|
592
|
-
timeout=timeout,
|
|
593
|
-
query=maybe_transform(
|
|
594
|
-
{
|
|
595
|
-
"after": after,
|
|
596
|
-
"before": before,
|
|
597
|
-
"limit": limit,
|
|
598
|
-
"order": order,
|
|
599
|
-
"order_by": order_by,
|
|
600
|
-
},
|
|
601
|
-
folder_list_passages_params.FolderListPassagesParams,
|
|
602
|
-
),
|
|
603
|
-
),
|
|
604
|
-
cast_to=FolderListPassagesResponse,
|
|
605
|
-
)
|
|
606
|
-
|
|
607
|
-
def retrieve_metadata(
|
|
608
|
-
self,
|
|
609
|
-
*,
|
|
610
|
-
include_detailed_per_source_metadata: bool | Omit = omit,
|
|
611
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
612
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
613
|
-
extra_headers: Headers | None = None,
|
|
614
|
-
extra_query: Query | None = None,
|
|
615
|
-
extra_body: Body | None = None,
|
|
616
|
-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
617
|
-
) -> OrganizationSourcesStats:
|
|
618
|
-
"""
|
|
619
|
-
Get aggregated metadata for all folders in an organization.
|
|
620
|
-
|
|
621
|
-
Returns structured metadata including:
|
|
622
|
-
|
|
623
|
-
- Total number of folders
|
|
624
|
-
- Total number of files across all folders
|
|
625
|
-
- Total size of all files
|
|
626
|
-
- Per-source breakdown with file details (file_name, file_size per file) if
|
|
627
|
-
include_detailed_per_source_metadata is True
|
|
628
|
-
|
|
629
|
-
Args:
|
|
630
|
-
extra_headers: Send extra headers
|
|
631
|
-
|
|
632
|
-
extra_query: Add additional query parameters to the request
|
|
633
|
-
|
|
634
|
-
extra_body: Add additional JSON properties to the request
|
|
635
|
-
|
|
636
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
637
|
-
"""
|
|
638
|
-
return self._get(
|
|
639
|
-
"/v1/folders/metadata",
|
|
640
|
-
options=make_request_options(
|
|
641
|
-
extra_headers=extra_headers,
|
|
642
|
-
extra_query=extra_query,
|
|
643
|
-
extra_body=extra_body,
|
|
644
|
-
timeout=timeout,
|
|
645
|
-
query=maybe_transform(
|
|
646
|
-
{"include_detailed_per_source_metadata": include_detailed_per_source_metadata},
|
|
647
|
-
folder_retrieve_metadata_params.FolderRetrieveMetadataParams,
|
|
648
|
-
),
|
|
649
|
-
),
|
|
650
|
-
cast_to=OrganizationSourcesStats,
|
|
651
|
-
)
|
|
652
|
-
|
|
653
|
-
def upload_file(
|
|
654
|
-
self,
|
|
655
|
-
folder_id: str,
|
|
656
|
-
*,
|
|
657
|
-
file: FileTypes,
|
|
658
|
-
duplicate_handling: DuplicateFileHandling | Omit = omit,
|
|
659
|
-
name: Optional[str] | Omit = omit,
|
|
660
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
661
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
662
|
-
extra_headers: Headers | None = None,
|
|
663
|
-
extra_query: Query | None = None,
|
|
664
|
-
extra_body: Body | None = None,
|
|
665
|
-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
666
|
-
) -> FileMetadata:
|
|
667
|
-
"""
|
|
668
|
-
Upload a file to a data folder.
|
|
669
|
-
|
|
670
|
-
Args:
|
|
671
|
-
duplicate_handling: How to handle duplicate filenames
|
|
672
|
-
|
|
673
|
-
name: Optional custom name to override the uploaded file's name
|
|
674
|
-
|
|
675
|
-
extra_headers: Send extra headers
|
|
676
|
-
|
|
677
|
-
extra_query: Add additional query parameters to the request
|
|
678
|
-
|
|
679
|
-
extra_body: Add additional JSON properties to the request
|
|
680
|
-
|
|
681
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
682
|
-
"""
|
|
683
|
-
if not folder_id:
|
|
684
|
-
raise ValueError(f"Expected a non-empty value for `folder_id` but received {folder_id!r}")
|
|
685
|
-
body = deepcopy_minimal({"file": file})
|
|
686
|
-
files = extract_files(cast(Mapping[str, object], body), paths=[["file"]])
|
|
687
|
-
# It should be noted that the actual Content-Type header that will be
|
|
688
|
-
# sent to the server will contain a `boundary` parameter, e.g.
|
|
689
|
-
# multipart/form-data; boundary=---abc--
|
|
690
|
-
extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})}
|
|
691
|
-
return self._post(
|
|
692
|
-
f"/v1/folders/{folder_id}/upload",
|
|
693
|
-
body=maybe_transform(body, folder_upload_file_params.FolderUploadFileParams),
|
|
694
|
-
files=files,
|
|
695
|
-
options=make_request_options(
|
|
696
|
-
extra_headers=extra_headers,
|
|
697
|
-
extra_query=extra_query,
|
|
698
|
-
extra_body=extra_body,
|
|
699
|
-
timeout=timeout,
|
|
700
|
-
query=maybe_transform(
|
|
701
|
-
{
|
|
702
|
-
"duplicate_handling": duplicate_handling,
|
|
703
|
-
"name": name,
|
|
704
|
-
},
|
|
705
|
-
folder_upload_file_params.FolderUploadFileParams,
|
|
706
|
-
),
|
|
707
|
-
),
|
|
708
|
-
cast_to=FileMetadata,
|
|
709
|
-
)
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
class AsyncFoldersResource(AsyncAPIResource):
|
|
713
|
-
@cached_property
|
|
714
|
-
def with_raw_response(self) -> AsyncFoldersResourceWithRawResponse:
|
|
715
|
-
"""
|
|
716
|
-
This property can be used as a prefix for any HTTP method call to return
|
|
717
|
-
the raw response object instead of the parsed content.
|
|
718
|
-
|
|
719
|
-
For more information, see https://www.github.com/letta-ai/letta-python#accessing-raw-response-data-eg-headers
|
|
720
|
-
"""
|
|
721
|
-
return AsyncFoldersResourceWithRawResponse(self)
|
|
722
|
-
|
|
723
|
-
@cached_property
|
|
724
|
-
def with_streaming_response(self) -> AsyncFoldersResourceWithStreamingResponse:
|
|
725
|
-
"""
|
|
726
|
-
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
727
|
-
|
|
728
|
-
For more information, see https://www.github.com/letta-ai/letta-python#with_streaming_response
|
|
729
|
-
"""
|
|
730
|
-
return AsyncFoldersResourceWithStreamingResponse(self)
|
|
731
|
-
|
|
732
|
-
async def create(
|
|
733
|
-
self,
|
|
734
|
-
*,
|
|
735
|
-
name: str,
|
|
736
|
-
description: Optional[str] | Omit = omit,
|
|
737
|
-
embedding: Optional[str] | Omit = omit,
|
|
738
|
-
embedding_chunk_size: Optional[int] | Omit = omit,
|
|
739
|
-
embedding_config: Optional[EmbeddingConfigParam] | Omit = omit,
|
|
740
|
-
instructions: Optional[str] | Omit = omit,
|
|
741
|
-
metadata: Optional[Dict[str, object]] | Omit = omit,
|
|
742
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
743
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
744
|
-
extra_headers: Headers | None = None,
|
|
745
|
-
extra_query: Query | None = None,
|
|
746
|
-
extra_body: Body | None = None,
|
|
747
|
-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
748
|
-
) -> Folder:
|
|
749
|
-
"""
|
|
750
|
-
Create a new data folder.
|
|
751
|
-
|
|
752
|
-
Args:
|
|
753
|
-
name: The name of the source.
|
|
754
|
-
|
|
755
|
-
description: The description of the source.
|
|
756
|
-
|
|
757
|
-
embedding: The handle for the embedding config used by the source.
|
|
758
|
-
|
|
759
|
-
embedding_chunk_size: The chunk size of the embedding.
|
|
760
|
-
|
|
761
|
-
embedding_config: Configuration for embedding model connection and processing parameters.
|
|
762
|
-
|
|
763
|
-
instructions: Instructions for how to use the source.
|
|
764
|
-
|
|
765
|
-
metadata: Metadata associated with the source.
|
|
766
|
-
|
|
767
|
-
extra_headers: Send extra headers
|
|
768
|
-
|
|
769
|
-
extra_query: Add additional query parameters to the request
|
|
770
|
-
|
|
771
|
-
extra_body: Add additional JSON properties to the request
|
|
772
|
-
|
|
773
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
774
|
-
"""
|
|
775
|
-
return await self._post(
|
|
776
|
-
"/v1/folders/",
|
|
777
|
-
body=await async_maybe_transform(
|
|
778
|
-
{
|
|
779
|
-
"name": name,
|
|
780
|
-
"description": description,
|
|
781
|
-
"embedding": embedding,
|
|
782
|
-
"embedding_chunk_size": embedding_chunk_size,
|
|
783
|
-
"embedding_config": embedding_config,
|
|
784
|
-
"instructions": instructions,
|
|
785
|
-
"metadata": metadata,
|
|
786
|
-
},
|
|
787
|
-
folder_create_params.FolderCreateParams,
|
|
788
|
-
),
|
|
789
|
-
options=make_request_options(
|
|
790
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
791
|
-
),
|
|
792
|
-
cast_to=Folder,
|
|
793
|
-
)
|
|
794
|
-
|
|
795
|
-
async def retrieve(
|
|
796
|
-
self,
|
|
797
|
-
folder_id: str,
|
|
798
|
-
*,
|
|
799
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
800
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
801
|
-
extra_headers: Headers | None = None,
|
|
802
|
-
extra_query: Query | None = None,
|
|
803
|
-
extra_body: Body | None = None,
|
|
804
|
-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
805
|
-
) -> Folder:
|
|
806
|
-
"""
|
|
807
|
-
Get a folder by ID
|
|
808
|
-
|
|
809
|
-
Args:
|
|
810
|
-
extra_headers: Send extra headers
|
|
811
|
-
|
|
812
|
-
extra_query: Add additional query parameters to the request
|
|
813
|
-
|
|
814
|
-
extra_body: Add additional JSON properties to the request
|
|
815
|
-
|
|
816
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
817
|
-
"""
|
|
818
|
-
if not folder_id:
|
|
819
|
-
raise ValueError(f"Expected a non-empty value for `folder_id` but received {folder_id!r}")
|
|
820
|
-
return await self._get(
|
|
821
|
-
f"/v1/folders/{folder_id}",
|
|
822
|
-
options=make_request_options(
|
|
823
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
824
|
-
),
|
|
825
|
-
cast_to=Folder,
|
|
826
|
-
)
|
|
827
|
-
|
|
828
|
-
async def update(
|
|
829
|
-
self,
|
|
830
|
-
folder_id: str,
|
|
831
|
-
*,
|
|
832
|
-
description: Optional[str] | Omit = omit,
|
|
833
|
-
embedding_config: Optional[EmbeddingConfigParam] | Omit = omit,
|
|
834
|
-
instructions: Optional[str] | Omit = omit,
|
|
835
|
-
metadata: Optional[Dict[str, object]] | Omit = omit,
|
|
836
|
-
name: Optional[str] | Omit = omit,
|
|
837
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
838
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
839
|
-
extra_headers: Headers | None = None,
|
|
840
|
-
extra_query: Query | None = None,
|
|
841
|
-
extra_body: Body | None = None,
|
|
842
|
-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
843
|
-
) -> Folder:
|
|
844
|
-
"""
|
|
845
|
-
Update the name or documentation of an existing data folder.
|
|
846
|
-
|
|
847
|
-
Args:
|
|
848
|
-
description: The description of the source.
|
|
849
|
-
|
|
850
|
-
embedding_config: Configuration for embedding model connection and processing parameters.
|
|
851
|
-
|
|
852
|
-
instructions: Instructions for how to use the source.
|
|
853
|
-
|
|
854
|
-
metadata: Metadata associated with the source.
|
|
855
|
-
|
|
856
|
-
name: The name of the source.
|
|
857
|
-
|
|
858
|
-
extra_headers: Send extra headers
|
|
859
|
-
|
|
860
|
-
extra_query: Add additional query parameters to the request
|
|
861
|
-
|
|
862
|
-
extra_body: Add additional JSON properties to the request
|
|
863
|
-
|
|
864
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
865
|
-
"""
|
|
866
|
-
if not folder_id:
|
|
867
|
-
raise ValueError(f"Expected a non-empty value for `folder_id` but received {folder_id!r}")
|
|
868
|
-
return await self._patch(
|
|
869
|
-
f"/v1/folders/{folder_id}",
|
|
870
|
-
body=await async_maybe_transform(
|
|
871
|
-
{
|
|
872
|
-
"description": description,
|
|
873
|
-
"embedding_config": embedding_config,
|
|
874
|
-
"instructions": instructions,
|
|
875
|
-
"metadata": metadata,
|
|
876
|
-
"name": name,
|
|
877
|
-
},
|
|
878
|
-
folder_update_params.FolderUpdateParams,
|
|
879
|
-
),
|
|
880
|
-
options=make_request_options(
|
|
881
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
882
|
-
),
|
|
883
|
-
cast_to=Folder,
|
|
884
|
-
)
|
|
885
|
-
|
|
886
|
-
async def list(
|
|
887
|
-
self,
|
|
888
|
-
*,
|
|
889
|
-
after: Optional[str] | Omit = omit,
|
|
890
|
-
before: Optional[str] | Omit = omit,
|
|
891
|
-
limit: Optional[int] | Omit = omit,
|
|
892
|
-
name: Optional[str] | Omit = omit,
|
|
893
|
-
order: Literal["asc", "desc"] | Omit = omit,
|
|
894
|
-
order_by: Literal["created_at"] | Omit = omit,
|
|
895
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
896
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
897
|
-
extra_headers: Headers | None = None,
|
|
898
|
-
extra_query: Query | None = None,
|
|
899
|
-
extra_body: Body | None = None,
|
|
900
|
-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
901
|
-
) -> FolderListResponse:
|
|
902
|
-
"""
|
|
903
|
-
List all data folders created by a user.
|
|
904
|
-
|
|
905
|
-
Args:
|
|
906
|
-
after: Folder ID cursor for pagination. Returns folders that come after this folder ID
|
|
907
|
-
in the specified sort order
|
|
908
|
-
|
|
909
|
-
before: Folder ID cursor for pagination. Returns folders that come before this folder ID
|
|
910
|
-
in the specified sort order
|
|
911
|
-
|
|
912
|
-
limit: Maximum number of folders to return
|
|
913
|
-
|
|
914
|
-
name: Folder name to filter by
|
|
915
|
-
|
|
916
|
-
order: Sort order for folders by creation time. 'asc' for oldest first, 'desc' for
|
|
917
|
-
newest first
|
|
918
|
-
|
|
919
|
-
order_by: Field to sort by
|
|
920
|
-
|
|
921
|
-
extra_headers: Send extra headers
|
|
922
|
-
|
|
923
|
-
extra_query: Add additional query parameters to the request
|
|
924
|
-
|
|
925
|
-
extra_body: Add additional JSON properties to the request
|
|
926
|
-
|
|
927
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
928
|
-
"""
|
|
929
|
-
return await self._get(
|
|
930
|
-
"/v1/folders/",
|
|
931
|
-
options=make_request_options(
|
|
932
|
-
extra_headers=extra_headers,
|
|
933
|
-
extra_query=extra_query,
|
|
934
|
-
extra_body=extra_body,
|
|
935
|
-
timeout=timeout,
|
|
936
|
-
query=await async_maybe_transform(
|
|
937
|
-
{
|
|
938
|
-
"after": after,
|
|
939
|
-
"before": before,
|
|
940
|
-
"limit": limit,
|
|
941
|
-
"name": name,
|
|
942
|
-
"order": order,
|
|
943
|
-
"order_by": order_by,
|
|
944
|
-
},
|
|
945
|
-
folder_list_params.FolderListParams,
|
|
946
|
-
),
|
|
947
|
-
),
|
|
948
|
-
cast_to=FolderListResponse,
|
|
949
|
-
)
|
|
950
|
-
|
|
951
|
-
async def delete(
|
|
952
|
-
self,
|
|
953
|
-
folder_id: str,
|
|
954
|
-
*,
|
|
955
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
956
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
957
|
-
extra_headers: Headers | None = None,
|
|
958
|
-
extra_query: Query | None = None,
|
|
959
|
-
extra_body: Body | None = None,
|
|
960
|
-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
961
|
-
) -> object:
|
|
962
|
-
"""
|
|
963
|
-
Delete a data folder.
|
|
964
|
-
|
|
965
|
-
Args:
|
|
966
|
-
extra_headers: Send extra headers
|
|
967
|
-
|
|
968
|
-
extra_query: Add additional query parameters to the request
|
|
969
|
-
|
|
970
|
-
extra_body: Add additional JSON properties to the request
|
|
971
|
-
|
|
972
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
973
|
-
"""
|
|
974
|
-
if not folder_id:
|
|
975
|
-
raise ValueError(f"Expected a non-empty value for `folder_id` but received {folder_id!r}")
|
|
976
|
-
return await self._delete(
|
|
977
|
-
f"/v1/folders/{folder_id}",
|
|
978
|
-
options=make_request_options(
|
|
979
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
980
|
-
),
|
|
981
|
-
cast_to=object,
|
|
982
|
-
)
|
|
983
|
-
|
|
984
|
-
async def count(
|
|
985
|
-
self,
|
|
986
|
-
*,
|
|
987
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
988
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
989
|
-
extra_headers: Headers | None = None,
|
|
990
|
-
extra_query: Query | None = None,
|
|
991
|
-
extra_body: Body | None = None,
|
|
992
|
-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
993
|
-
) -> FolderCountResponse:
|
|
994
|
-
"""Count all data folders created by a user."""
|
|
995
|
-
return await self._get(
|
|
996
|
-
"/v1/folders/count",
|
|
997
|
-
options=make_request_options(
|
|
998
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
999
|
-
),
|
|
1000
|
-
cast_to=int,
|
|
1001
|
-
)
|
|
1002
|
-
|
|
1003
|
-
async def delete_file(
|
|
1004
|
-
self,
|
|
1005
|
-
file_id: str,
|
|
1006
|
-
*,
|
|
1007
|
-
folder_id: str,
|
|
1008
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1009
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1010
|
-
extra_headers: Headers | None = None,
|
|
1011
|
-
extra_query: Query | None = None,
|
|
1012
|
-
extra_body: Body | None = None,
|
|
1013
|
-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
1014
|
-
) -> None:
|
|
1015
|
-
"""
|
|
1016
|
-
Delete a file from a folder.
|
|
1017
|
-
|
|
1018
|
-
Args:
|
|
1019
|
-
extra_headers: Send extra headers
|
|
1020
|
-
|
|
1021
|
-
extra_query: Add additional query parameters to the request
|
|
1022
|
-
|
|
1023
|
-
extra_body: Add additional JSON properties to the request
|
|
1024
|
-
|
|
1025
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
1026
|
-
"""
|
|
1027
|
-
if not folder_id:
|
|
1028
|
-
raise ValueError(f"Expected a non-empty value for `folder_id` but received {folder_id!r}")
|
|
1029
|
-
if not file_id:
|
|
1030
|
-
raise ValueError(f"Expected a non-empty value for `file_id` but received {file_id!r}")
|
|
1031
|
-
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
1032
|
-
return await self._delete(
|
|
1033
|
-
f"/v1/folders/{folder_id}/{file_id}",
|
|
1034
|
-
options=make_request_options(
|
|
1035
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
1036
|
-
),
|
|
1037
|
-
cast_to=NoneType,
|
|
1038
|
-
)
|
|
1039
|
-
|
|
1040
|
-
@typing_extensions.deprecated("deprecated")
|
|
1041
|
-
async def get_by_name(
|
|
1042
|
-
self,
|
|
1043
|
-
folder_name: str,
|
|
1044
|
-
*,
|
|
1045
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1046
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1047
|
-
extra_headers: Headers | None = None,
|
|
1048
|
-
extra_query: Query | None = None,
|
|
1049
|
-
extra_body: Body | None = None,
|
|
1050
|
-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
1051
|
-
) -> str:
|
|
1052
|
-
"""
|
|
1053
|
-
**Deprecated**: Please use the list endpoint `GET /v1/folders?name=` instead.
|
|
1054
|
-
|
|
1055
|
-
Get a folder by name.
|
|
1056
|
-
|
|
1057
|
-
Args:
|
|
1058
|
-
extra_headers: Send extra headers
|
|
1059
|
-
|
|
1060
|
-
extra_query: Add additional query parameters to the request
|
|
1061
|
-
|
|
1062
|
-
extra_body: Add additional JSON properties to the request
|
|
1063
|
-
|
|
1064
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
1065
|
-
"""
|
|
1066
|
-
if not folder_name:
|
|
1067
|
-
raise ValueError(f"Expected a non-empty value for `folder_name` but received {folder_name!r}")
|
|
1068
|
-
return await self._get(
|
|
1069
|
-
f"/v1/folders/name/{folder_name}",
|
|
1070
|
-
options=make_request_options(
|
|
1071
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
1072
|
-
),
|
|
1073
|
-
cast_to=str,
|
|
1074
|
-
)
|
|
1075
|
-
|
|
1076
|
-
async def list_agents(
|
|
1077
|
-
self,
|
|
1078
|
-
folder_id: str,
|
|
1079
|
-
*,
|
|
1080
|
-
after: Optional[str] | Omit = omit,
|
|
1081
|
-
before: Optional[str] | Omit = omit,
|
|
1082
|
-
limit: Optional[int] | Omit = omit,
|
|
1083
|
-
order: Literal["asc", "desc"] | Omit = omit,
|
|
1084
|
-
order_by: Literal["created_at"] | Omit = omit,
|
|
1085
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1086
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1087
|
-
extra_headers: Headers | None = None,
|
|
1088
|
-
extra_query: Query | None = None,
|
|
1089
|
-
extra_body: Body | None = None,
|
|
1090
|
-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
1091
|
-
) -> FolderListAgentsResponse:
|
|
1092
|
-
"""
|
|
1093
|
-
Get all agent IDs that have the specified folder attached.
|
|
1094
|
-
|
|
1095
|
-
Args:
|
|
1096
|
-
after: Agent ID cursor for pagination. Returns agents that come after this agent ID in
|
|
1097
|
-
the specified sort order
|
|
1098
|
-
|
|
1099
|
-
before: Agent ID cursor for pagination. Returns agents that come before this agent ID in
|
|
1100
|
-
the specified sort order
|
|
1101
|
-
|
|
1102
|
-
limit: Maximum number of agents to return
|
|
1103
|
-
|
|
1104
|
-
order: Sort order for agents by creation time. 'asc' for oldest first, 'desc' for
|
|
1105
|
-
newest first
|
|
1106
|
-
|
|
1107
|
-
order_by: Field to sort by
|
|
1108
|
-
|
|
1109
|
-
extra_headers: Send extra headers
|
|
1110
|
-
|
|
1111
|
-
extra_query: Add additional query parameters to the request
|
|
1112
|
-
|
|
1113
|
-
extra_body: Add additional JSON properties to the request
|
|
1114
|
-
|
|
1115
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
1116
|
-
"""
|
|
1117
|
-
if not folder_id:
|
|
1118
|
-
raise ValueError(f"Expected a non-empty value for `folder_id` but received {folder_id!r}")
|
|
1119
|
-
return await self._get(
|
|
1120
|
-
f"/v1/folders/{folder_id}/agents",
|
|
1121
|
-
options=make_request_options(
|
|
1122
|
-
extra_headers=extra_headers,
|
|
1123
|
-
extra_query=extra_query,
|
|
1124
|
-
extra_body=extra_body,
|
|
1125
|
-
timeout=timeout,
|
|
1126
|
-
query=await async_maybe_transform(
|
|
1127
|
-
{
|
|
1128
|
-
"after": after,
|
|
1129
|
-
"before": before,
|
|
1130
|
-
"limit": limit,
|
|
1131
|
-
"order": order,
|
|
1132
|
-
"order_by": order_by,
|
|
1133
|
-
},
|
|
1134
|
-
folder_list_agents_params.FolderListAgentsParams,
|
|
1135
|
-
),
|
|
1136
|
-
),
|
|
1137
|
-
cast_to=FolderListAgentsResponse,
|
|
1138
|
-
)
|
|
1139
|
-
|
|
1140
|
-
async def list_files(
|
|
1141
|
-
self,
|
|
1142
|
-
folder_id: str,
|
|
1143
|
-
*,
|
|
1144
|
-
after: Optional[str] | Omit = omit,
|
|
1145
|
-
before: Optional[str] | Omit = omit,
|
|
1146
|
-
include_content: bool | Omit = omit,
|
|
1147
|
-
limit: Optional[int] | Omit = omit,
|
|
1148
|
-
order: Literal["asc", "desc"] | Omit = omit,
|
|
1149
|
-
order_by: Literal["created_at"] | Omit = omit,
|
|
1150
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1151
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1152
|
-
extra_headers: Headers | None = None,
|
|
1153
|
-
extra_query: Query | None = None,
|
|
1154
|
-
extra_body: Body | None = None,
|
|
1155
|
-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
1156
|
-
) -> FolderListFilesResponse:
|
|
1157
|
-
"""
|
|
1158
|
-
List paginated files associated with a data folder.
|
|
1159
|
-
|
|
1160
|
-
Args:
|
|
1161
|
-
after: File ID cursor for pagination. Returns files that come after this file ID in the
|
|
1162
|
-
specified sort order
|
|
1163
|
-
|
|
1164
|
-
before: File ID cursor for pagination. Returns files that come before this file ID in
|
|
1165
|
-
the specified sort order
|
|
1166
|
-
|
|
1167
|
-
include_content: Whether to include full file content
|
|
1168
|
-
|
|
1169
|
-
limit: Maximum number of files to return
|
|
1170
|
-
|
|
1171
|
-
order: Sort order for files by creation time. 'asc' for oldest first, 'desc' for newest
|
|
1172
|
-
first
|
|
1173
|
-
|
|
1174
|
-
order_by: Field to sort by
|
|
1175
|
-
|
|
1176
|
-
extra_headers: Send extra headers
|
|
1177
|
-
|
|
1178
|
-
extra_query: Add additional query parameters to the request
|
|
1179
|
-
|
|
1180
|
-
extra_body: Add additional JSON properties to the request
|
|
1181
|
-
|
|
1182
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
1183
|
-
"""
|
|
1184
|
-
if not folder_id:
|
|
1185
|
-
raise ValueError(f"Expected a non-empty value for `folder_id` but received {folder_id!r}")
|
|
1186
|
-
return await self._get(
|
|
1187
|
-
f"/v1/folders/{folder_id}/files",
|
|
1188
|
-
options=make_request_options(
|
|
1189
|
-
extra_headers=extra_headers,
|
|
1190
|
-
extra_query=extra_query,
|
|
1191
|
-
extra_body=extra_body,
|
|
1192
|
-
timeout=timeout,
|
|
1193
|
-
query=await async_maybe_transform(
|
|
1194
|
-
{
|
|
1195
|
-
"after": after,
|
|
1196
|
-
"before": before,
|
|
1197
|
-
"include_content": include_content,
|
|
1198
|
-
"limit": limit,
|
|
1199
|
-
"order": order,
|
|
1200
|
-
"order_by": order_by,
|
|
1201
|
-
},
|
|
1202
|
-
folder_list_files_params.FolderListFilesParams,
|
|
1203
|
-
),
|
|
1204
|
-
),
|
|
1205
|
-
cast_to=FolderListFilesResponse,
|
|
1206
|
-
)
|
|
1207
|
-
|
|
1208
|
-
async def list_passages(
|
|
1209
|
-
self,
|
|
1210
|
-
folder_id: str,
|
|
1211
|
-
*,
|
|
1212
|
-
after: Optional[str] | Omit = omit,
|
|
1213
|
-
before: Optional[str] | Omit = omit,
|
|
1214
|
-
limit: Optional[int] | Omit = omit,
|
|
1215
|
-
order: Literal["asc", "desc"] | Omit = omit,
|
|
1216
|
-
order_by: Literal["created_at"] | Omit = omit,
|
|
1217
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1218
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1219
|
-
extra_headers: Headers | None = None,
|
|
1220
|
-
extra_query: Query | None = None,
|
|
1221
|
-
extra_body: Body | None = None,
|
|
1222
|
-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
1223
|
-
) -> FolderListPassagesResponse:
|
|
1224
|
-
"""
|
|
1225
|
-
List all passages associated with a data folder.
|
|
1226
|
-
|
|
1227
|
-
Args:
|
|
1228
|
-
after: Passage ID cursor for pagination. Returns passages that come after this passage
|
|
1229
|
-
ID in the specified sort order
|
|
1230
|
-
|
|
1231
|
-
before: Passage ID cursor for pagination. Returns passages that come before this passage
|
|
1232
|
-
ID in the specified sort order
|
|
1233
|
-
|
|
1234
|
-
limit: Maximum number of passages to return
|
|
1235
|
-
|
|
1236
|
-
order: Sort order for passages by creation time. 'asc' for oldest first, 'desc' for
|
|
1237
|
-
newest first
|
|
1238
|
-
|
|
1239
|
-
order_by: Field to sort by
|
|
1240
|
-
|
|
1241
|
-
extra_headers: Send extra headers
|
|
1242
|
-
|
|
1243
|
-
extra_query: Add additional query parameters to the request
|
|
1244
|
-
|
|
1245
|
-
extra_body: Add additional JSON properties to the request
|
|
1246
|
-
|
|
1247
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
1248
|
-
"""
|
|
1249
|
-
if not folder_id:
|
|
1250
|
-
raise ValueError(f"Expected a non-empty value for `folder_id` but received {folder_id!r}")
|
|
1251
|
-
return await self._get(
|
|
1252
|
-
f"/v1/folders/{folder_id}/passages",
|
|
1253
|
-
options=make_request_options(
|
|
1254
|
-
extra_headers=extra_headers,
|
|
1255
|
-
extra_query=extra_query,
|
|
1256
|
-
extra_body=extra_body,
|
|
1257
|
-
timeout=timeout,
|
|
1258
|
-
query=await async_maybe_transform(
|
|
1259
|
-
{
|
|
1260
|
-
"after": after,
|
|
1261
|
-
"before": before,
|
|
1262
|
-
"limit": limit,
|
|
1263
|
-
"order": order,
|
|
1264
|
-
"order_by": order_by,
|
|
1265
|
-
},
|
|
1266
|
-
folder_list_passages_params.FolderListPassagesParams,
|
|
1267
|
-
),
|
|
1268
|
-
),
|
|
1269
|
-
cast_to=FolderListPassagesResponse,
|
|
1270
|
-
)
|
|
1271
|
-
|
|
1272
|
-
async def retrieve_metadata(
|
|
1273
|
-
self,
|
|
1274
|
-
*,
|
|
1275
|
-
include_detailed_per_source_metadata: bool | Omit = omit,
|
|
1276
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1277
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1278
|
-
extra_headers: Headers | None = None,
|
|
1279
|
-
extra_query: Query | None = None,
|
|
1280
|
-
extra_body: Body | None = None,
|
|
1281
|
-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
1282
|
-
) -> OrganizationSourcesStats:
|
|
1283
|
-
"""
|
|
1284
|
-
Get aggregated metadata for all folders in an organization.
|
|
1285
|
-
|
|
1286
|
-
Returns structured metadata including:
|
|
1287
|
-
|
|
1288
|
-
- Total number of folders
|
|
1289
|
-
- Total number of files across all folders
|
|
1290
|
-
- Total size of all files
|
|
1291
|
-
- Per-source breakdown with file details (file_name, file_size per file) if
|
|
1292
|
-
include_detailed_per_source_metadata is True
|
|
1293
|
-
|
|
1294
|
-
Args:
|
|
1295
|
-
extra_headers: Send extra headers
|
|
1296
|
-
|
|
1297
|
-
extra_query: Add additional query parameters to the request
|
|
1298
|
-
|
|
1299
|
-
extra_body: Add additional JSON properties to the request
|
|
1300
|
-
|
|
1301
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
1302
|
-
"""
|
|
1303
|
-
return await self._get(
|
|
1304
|
-
"/v1/folders/metadata",
|
|
1305
|
-
options=make_request_options(
|
|
1306
|
-
extra_headers=extra_headers,
|
|
1307
|
-
extra_query=extra_query,
|
|
1308
|
-
extra_body=extra_body,
|
|
1309
|
-
timeout=timeout,
|
|
1310
|
-
query=await async_maybe_transform(
|
|
1311
|
-
{"include_detailed_per_source_metadata": include_detailed_per_source_metadata},
|
|
1312
|
-
folder_retrieve_metadata_params.FolderRetrieveMetadataParams,
|
|
1313
|
-
),
|
|
1314
|
-
),
|
|
1315
|
-
cast_to=OrganizationSourcesStats,
|
|
1316
|
-
)
|
|
1317
|
-
|
|
1318
|
-
async def upload_file(
|
|
1319
|
-
self,
|
|
1320
|
-
folder_id: str,
|
|
1321
|
-
*,
|
|
1322
|
-
file: FileTypes,
|
|
1323
|
-
duplicate_handling: DuplicateFileHandling | Omit = omit,
|
|
1324
|
-
name: Optional[str] | Omit = omit,
|
|
1325
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1326
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1327
|
-
extra_headers: Headers | None = None,
|
|
1328
|
-
extra_query: Query | None = None,
|
|
1329
|
-
extra_body: Body | None = None,
|
|
1330
|
-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
1331
|
-
) -> FileMetadata:
|
|
1332
|
-
"""
|
|
1333
|
-
Upload a file to a data folder.
|
|
1334
|
-
|
|
1335
|
-
Args:
|
|
1336
|
-
duplicate_handling: How to handle duplicate filenames
|
|
1337
|
-
|
|
1338
|
-
name: Optional custom name to override the uploaded file's name
|
|
1339
|
-
|
|
1340
|
-
extra_headers: Send extra headers
|
|
1341
|
-
|
|
1342
|
-
extra_query: Add additional query parameters to the request
|
|
1343
|
-
|
|
1344
|
-
extra_body: Add additional JSON properties to the request
|
|
1345
|
-
|
|
1346
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
1347
|
-
"""
|
|
1348
|
-
if not folder_id:
|
|
1349
|
-
raise ValueError(f"Expected a non-empty value for `folder_id` but received {folder_id!r}")
|
|
1350
|
-
body = deepcopy_minimal({"file": file})
|
|
1351
|
-
files = extract_files(cast(Mapping[str, object], body), paths=[["file"]])
|
|
1352
|
-
# It should be noted that the actual Content-Type header that will be
|
|
1353
|
-
# sent to the server will contain a `boundary` parameter, e.g.
|
|
1354
|
-
# multipart/form-data; boundary=---abc--
|
|
1355
|
-
extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})}
|
|
1356
|
-
return await self._post(
|
|
1357
|
-
f"/v1/folders/{folder_id}/upload",
|
|
1358
|
-
body=await async_maybe_transform(body, folder_upload_file_params.FolderUploadFileParams),
|
|
1359
|
-
files=files,
|
|
1360
|
-
options=make_request_options(
|
|
1361
|
-
extra_headers=extra_headers,
|
|
1362
|
-
extra_query=extra_query,
|
|
1363
|
-
extra_body=extra_body,
|
|
1364
|
-
timeout=timeout,
|
|
1365
|
-
query=await async_maybe_transform(
|
|
1366
|
-
{
|
|
1367
|
-
"duplicate_handling": duplicate_handling,
|
|
1368
|
-
"name": name,
|
|
1369
|
-
},
|
|
1370
|
-
folder_upload_file_params.FolderUploadFileParams,
|
|
1371
|
-
),
|
|
1372
|
-
),
|
|
1373
|
-
cast_to=FileMetadata,
|
|
1374
|
-
)
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
class FoldersResourceWithRawResponse:
|
|
1378
|
-
def __init__(self, folders: FoldersResource) -> None:
|
|
1379
|
-
self._folders = folders
|
|
1380
|
-
|
|
1381
|
-
self.create = to_raw_response_wrapper(
|
|
1382
|
-
folders.create,
|
|
1383
|
-
)
|
|
1384
|
-
self.retrieve = to_raw_response_wrapper(
|
|
1385
|
-
folders.retrieve,
|
|
1386
|
-
)
|
|
1387
|
-
self.update = to_raw_response_wrapper(
|
|
1388
|
-
folders.update,
|
|
1389
|
-
)
|
|
1390
|
-
self.list = to_raw_response_wrapper(
|
|
1391
|
-
folders.list,
|
|
1392
|
-
)
|
|
1393
|
-
self.delete = to_raw_response_wrapper(
|
|
1394
|
-
folders.delete,
|
|
1395
|
-
)
|
|
1396
|
-
self.count = to_raw_response_wrapper(
|
|
1397
|
-
folders.count,
|
|
1398
|
-
)
|
|
1399
|
-
self.delete_file = to_raw_response_wrapper(
|
|
1400
|
-
folders.delete_file,
|
|
1401
|
-
)
|
|
1402
|
-
self.get_by_name = ( # pyright: ignore[reportDeprecated]
|
|
1403
|
-
to_raw_response_wrapper(
|
|
1404
|
-
folders.get_by_name, # pyright: ignore[reportDeprecated],
|
|
1405
|
-
)
|
|
1406
|
-
)
|
|
1407
|
-
self.list_agents = to_raw_response_wrapper(
|
|
1408
|
-
folders.list_agents,
|
|
1409
|
-
)
|
|
1410
|
-
self.list_files = to_raw_response_wrapper(
|
|
1411
|
-
folders.list_files,
|
|
1412
|
-
)
|
|
1413
|
-
self.list_passages = to_raw_response_wrapper(
|
|
1414
|
-
folders.list_passages,
|
|
1415
|
-
)
|
|
1416
|
-
self.retrieve_metadata = to_raw_response_wrapper(
|
|
1417
|
-
folders.retrieve_metadata,
|
|
1418
|
-
)
|
|
1419
|
-
self.upload_file = to_raw_response_wrapper(
|
|
1420
|
-
folders.upload_file,
|
|
1421
|
-
)
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
class AsyncFoldersResourceWithRawResponse:
|
|
1425
|
-
def __init__(self, folders: AsyncFoldersResource) -> None:
|
|
1426
|
-
self._folders = folders
|
|
1427
|
-
|
|
1428
|
-
self.create = async_to_raw_response_wrapper(
|
|
1429
|
-
folders.create,
|
|
1430
|
-
)
|
|
1431
|
-
self.retrieve = async_to_raw_response_wrapper(
|
|
1432
|
-
folders.retrieve,
|
|
1433
|
-
)
|
|
1434
|
-
self.update = async_to_raw_response_wrapper(
|
|
1435
|
-
folders.update,
|
|
1436
|
-
)
|
|
1437
|
-
self.list = async_to_raw_response_wrapper(
|
|
1438
|
-
folders.list,
|
|
1439
|
-
)
|
|
1440
|
-
self.delete = async_to_raw_response_wrapper(
|
|
1441
|
-
folders.delete,
|
|
1442
|
-
)
|
|
1443
|
-
self.count = async_to_raw_response_wrapper(
|
|
1444
|
-
folders.count,
|
|
1445
|
-
)
|
|
1446
|
-
self.delete_file = async_to_raw_response_wrapper(
|
|
1447
|
-
folders.delete_file,
|
|
1448
|
-
)
|
|
1449
|
-
self.get_by_name = ( # pyright: ignore[reportDeprecated]
|
|
1450
|
-
async_to_raw_response_wrapper(
|
|
1451
|
-
folders.get_by_name, # pyright: ignore[reportDeprecated],
|
|
1452
|
-
)
|
|
1453
|
-
)
|
|
1454
|
-
self.list_agents = async_to_raw_response_wrapper(
|
|
1455
|
-
folders.list_agents,
|
|
1456
|
-
)
|
|
1457
|
-
self.list_files = async_to_raw_response_wrapper(
|
|
1458
|
-
folders.list_files,
|
|
1459
|
-
)
|
|
1460
|
-
self.list_passages = async_to_raw_response_wrapper(
|
|
1461
|
-
folders.list_passages,
|
|
1462
|
-
)
|
|
1463
|
-
self.retrieve_metadata = async_to_raw_response_wrapper(
|
|
1464
|
-
folders.retrieve_metadata,
|
|
1465
|
-
)
|
|
1466
|
-
self.upload_file = async_to_raw_response_wrapper(
|
|
1467
|
-
folders.upload_file,
|
|
1468
|
-
)
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
class FoldersResourceWithStreamingResponse:
|
|
1472
|
-
def __init__(self, folders: FoldersResource) -> None:
|
|
1473
|
-
self._folders = folders
|
|
1474
|
-
|
|
1475
|
-
self.create = to_streamed_response_wrapper(
|
|
1476
|
-
folders.create,
|
|
1477
|
-
)
|
|
1478
|
-
self.retrieve = to_streamed_response_wrapper(
|
|
1479
|
-
folders.retrieve,
|
|
1480
|
-
)
|
|
1481
|
-
self.update = to_streamed_response_wrapper(
|
|
1482
|
-
folders.update,
|
|
1483
|
-
)
|
|
1484
|
-
self.list = to_streamed_response_wrapper(
|
|
1485
|
-
folders.list,
|
|
1486
|
-
)
|
|
1487
|
-
self.delete = to_streamed_response_wrapper(
|
|
1488
|
-
folders.delete,
|
|
1489
|
-
)
|
|
1490
|
-
self.count = to_streamed_response_wrapper(
|
|
1491
|
-
folders.count,
|
|
1492
|
-
)
|
|
1493
|
-
self.delete_file = to_streamed_response_wrapper(
|
|
1494
|
-
folders.delete_file,
|
|
1495
|
-
)
|
|
1496
|
-
self.get_by_name = ( # pyright: ignore[reportDeprecated]
|
|
1497
|
-
to_streamed_response_wrapper(
|
|
1498
|
-
folders.get_by_name, # pyright: ignore[reportDeprecated],
|
|
1499
|
-
)
|
|
1500
|
-
)
|
|
1501
|
-
self.list_agents = to_streamed_response_wrapper(
|
|
1502
|
-
folders.list_agents,
|
|
1503
|
-
)
|
|
1504
|
-
self.list_files = to_streamed_response_wrapper(
|
|
1505
|
-
folders.list_files,
|
|
1506
|
-
)
|
|
1507
|
-
self.list_passages = to_streamed_response_wrapper(
|
|
1508
|
-
folders.list_passages,
|
|
1509
|
-
)
|
|
1510
|
-
self.retrieve_metadata = to_streamed_response_wrapper(
|
|
1511
|
-
folders.retrieve_metadata,
|
|
1512
|
-
)
|
|
1513
|
-
self.upload_file = to_streamed_response_wrapper(
|
|
1514
|
-
folders.upload_file,
|
|
1515
|
-
)
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
class AsyncFoldersResourceWithStreamingResponse:
|
|
1519
|
-
def __init__(self, folders: AsyncFoldersResource) -> None:
|
|
1520
|
-
self._folders = folders
|
|
1521
|
-
|
|
1522
|
-
self.create = async_to_streamed_response_wrapper(
|
|
1523
|
-
folders.create,
|
|
1524
|
-
)
|
|
1525
|
-
self.retrieve = async_to_streamed_response_wrapper(
|
|
1526
|
-
folders.retrieve,
|
|
1527
|
-
)
|
|
1528
|
-
self.update = async_to_streamed_response_wrapper(
|
|
1529
|
-
folders.update,
|
|
1530
|
-
)
|
|
1531
|
-
self.list = async_to_streamed_response_wrapper(
|
|
1532
|
-
folders.list,
|
|
1533
|
-
)
|
|
1534
|
-
self.delete = async_to_streamed_response_wrapper(
|
|
1535
|
-
folders.delete,
|
|
1536
|
-
)
|
|
1537
|
-
self.count = async_to_streamed_response_wrapper(
|
|
1538
|
-
folders.count,
|
|
1539
|
-
)
|
|
1540
|
-
self.delete_file = async_to_streamed_response_wrapper(
|
|
1541
|
-
folders.delete_file,
|
|
1542
|
-
)
|
|
1543
|
-
self.get_by_name = ( # pyright: ignore[reportDeprecated]
|
|
1544
|
-
async_to_streamed_response_wrapper(
|
|
1545
|
-
folders.get_by_name, # pyright: ignore[reportDeprecated],
|
|
1546
|
-
)
|
|
1547
|
-
)
|
|
1548
|
-
self.list_agents = async_to_streamed_response_wrapper(
|
|
1549
|
-
folders.list_agents,
|
|
1550
|
-
)
|
|
1551
|
-
self.list_files = async_to_streamed_response_wrapper(
|
|
1552
|
-
folders.list_files,
|
|
1553
|
-
)
|
|
1554
|
-
self.list_passages = async_to_streamed_response_wrapper(
|
|
1555
|
-
folders.list_passages,
|
|
1556
|
-
)
|
|
1557
|
-
self.retrieve_metadata = async_to_streamed_response_wrapper(
|
|
1558
|
-
folders.retrieve_metadata,
|
|
1559
|
-
)
|
|
1560
|
-
self.upload_file = async_to_streamed_response_wrapper(
|
|
1561
|
-
folders.upload_file,
|
|
1562
|
-
)
|