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