letta-client 0.1.233__py3-none-any.whl → 0.1.234__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_client/__init__.py +2 -0
- letta_client/agents/__init__.py +2 -0
- letta_client/agents/blocks/__init__.py +2 -0
- letta_client/agents/blocks/client.py +72 -313
- letta_client/agents/blocks/raw_client.py +654 -0
- letta_client/agents/client.py +329 -869
- letta_client/agents/context/__init__.py +2 -0
- letta_client/agents/context/client.py +31 -66
- letta_client/agents/context/raw_client.py +122 -0
- letta_client/agents/core_memory/__init__.py +2 -0
- letta_client/agents/core_memory/client.py +31 -66
- letta_client/agents/core_memory/raw_client.py +124 -0
- letta_client/agents/files/__init__.py +2 -0
- letta_client/agents/files/client.py +39 -178
- letta_client/agents/files/raw_client.py +349 -0
- letta_client/agents/folders/__init__.py +2 -0
- letta_client/agents/folders/client.py +39 -178
- letta_client/agents/folders/raw_client.py +327 -0
- letta_client/agents/groups/__init__.py +2 -0
- letta_client/agents/groups/client.py +31 -72
- letta_client/agents/groups/raw_client.py +142 -0
- letta_client/agents/memory_variables/__init__.py +2 -0
- letta_client/agents/memory_variables/client.py +31 -65
- letta_client/agents/memory_variables/raw_client.py +125 -0
- letta_client/agents/memory_variables/types/__init__.py +2 -0
- letta_client/agents/memory_variables/types/memory_variables_list_response.py +3 -2
- letta_client/agents/messages/__init__.py +2 -0
- letta_client/agents/messages/client.py +150 -589
- letta_client/agents/messages/raw_client.py +1384 -0
- letta_client/agents/messages/types/__init__.py +2 -0
- letta_client/agents/messages/types/letta_streaming_response.py +6 -5
- letta_client/agents/messages/types/messages_modify_request.py +3 -2
- letta_client/agents/messages/types/messages_modify_response.py +5 -4
- letta_client/agents/messages/types/messages_preview_raw_payload_request.py +1 -0
- letta_client/agents/passages/__init__.py +2 -0
- letta_client/agents/passages/client.py +89 -301
- letta_client/agents/passages/raw_client.py +678 -0
- letta_client/agents/raw_client.py +2068 -0
- letta_client/agents/sources/__init__.py +2 -0
- letta_client/agents/sources/client.py +39 -178
- letta_client/agents/sources/raw_client.py +327 -0
- letta_client/agents/templates/__init__.py +2 -0
- letta_client/agents/templates/client.py +57 -276
- letta_client/agents/templates/raw_client.py +505 -0
- letta_client/agents/templates/types/__init__.py +2 -0
- letta_client/agents/templates/types/templates_create_response.py +5 -4
- letta_client/agents/templates/types/templates_migrate_response.py +3 -2
- letta_client/agents/tools/__init__.py +2 -0
- letta_client/agents/tools/client.py +40 -179
- letta_client/agents/tools/raw_client.py +327 -0
- letta_client/agents/types/__init__.py +2 -0
- letta_client/agents/types/agents_search_request_search_item.py +4 -3
- letta_client/agents/types/agents_search_request_search_item_field.py +4 -3
- letta_client/agents/types/agents_search_request_search_item_one.py +4 -3
- letta_client/agents/types/agents_search_request_search_item_three.py +3 -2
- letta_client/agents/types/agents_search_request_search_item_two.py +3 -2
- letta_client/agents/types/agents_search_request_search_item_zero.py +3 -2
- letta_client/agents/types/agents_search_response.py +5 -4
- letta_client/agents/types/create_agent_request_response_format.py +1 -0
- letta_client/agents/types/create_agent_request_tool_rules_item.py +4 -3
- letta_client/agents/types/update_agent_response_format.py +1 -0
- letta_client/agents/types/update_agent_tool_rules_item.py +4 -3
- letta_client/base_client.py +41 -49
- letta_client/batches/__init__.py +2 -0
- letta_client/batches/client.py +45 -253
- letta_client/batches/raw_client.py +457 -0
- letta_client/blocks/__init__.py +2 -0
- letta_client/blocks/agents/__init__.py +2 -0
- letta_client/blocks/agents/client.py +33 -70
- letta_client/blocks/agents/raw_client.py +144 -0
- letta_client/blocks/client.py +126 -424
- letta_client/blocks/raw_client.py +973 -0
- letta_client/client_side_access_tokens/__init__.py +2 -0
- letta_client/client_side_access_tokens/client.py +45 -216
- letta_client/client_side_access_tokens/raw_client.py +435 -0
- letta_client/client_side_access_tokens/types/__init__.py +2 -0
- letta_client/client_side_access_tokens/types/client_side_access_tokens_create_request_policy_item.py +4 -3
- letta_client/client_side_access_tokens/types/client_side_access_tokens_create_response.py +6 -5
- letta_client/client_side_access_tokens/types/client_side_access_tokens_create_response_policy.py +4 -3
- letta_client/client_side_access_tokens/types/client_side_access_tokens_create_response_policy_data_item.py +4 -3
- letta_client/client_side_access_tokens/types/client_side_access_tokens_list_client_side_access_tokens_response.py +6 -5
- letta_client/client_side_access_tokens/types/client_side_access_tokens_list_client_side_access_tokens_response_tokens_item.py +6 -5
- letta_client/client_side_access_tokens/types/client_side_access_tokens_list_client_side_access_tokens_response_tokens_item_policy.py +4 -3
- letta_client/client_side_access_tokens/types/client_side_access_tokens_list_client_side_access_tokens_response_tokens_item_policy_data_item.py +4 -3
- letta_client/core/__init__.py +5 -0
- letta_client/core/api_error.py +13 -5
- letta_client/core/client_wrapper.py +14 -5
- letta_client/core/force_multipart.py +16 -0
- letta_client/core/http_client.py +70 -26
- letta_client/core/http_response.py +55 -0
- letta_client/core/jsonable_encoder.py +0 -1
- letta_client/core/pydantic_utilities.py +70 -111
- letta_client/core/serialization.py +7 -3
- letta_client/core/unchecked_base_model.py +40 -4
- letta_client/embedding_models/__init__.py +2 -0
- letta_client/embedding_models/client.py +31 -65
- letta_client/embedding_models/raw_client.py +117 -0
- letta_client/errors/__init__.py +2 -0
- letta_client/errors/bad_request_error.py +4 -3
- letta_client/errors/conflict_error.py +4 -2
- letta_client/errors/internal_server_error.py +4 -3
- letta_client/errors/not_found_error.py +4 -3
- letta_client/errors/payment_required_error.py +4 -2
- letta_client/errors/unprocessable_entity_error.py +4 -2
- letta_client/folders/__init__.py +2 -0
- letta_client/folders/client.py +100 -564
- letta_client/folders/files/__init__.py +2 -0
- letta_client/folders/files/client.py +44 -189
- letta_client/folders/files/raw_client.py +391 -0
- letta_client/folders/passages/__init__.py +2 -0
- letta_client/folders/passages/client.py +33 -74
- letta_client/folders/passages/raw_client.py +162 -0
- letta_client/folders/raw_client.py +1084 -0
- letta_client/groups/__init__.py +2 -0
- letta_client/groups/client.py +87 -406
- letta_client/groups/messages/__init__.py +2 -0
- letta_client/groups/messages/client.py +110 -371
- letta_client/groups/messages/raw_client.py +881 -0
- letta_client/groups/messages/types/__init__.py +2 -0
- letta_client/groups/messages/types/letta_streaming_response.py +5 -4
- letta_client/groups/messages/types/messages_modify_request.py +3 -2
- letta_client/groups/messages/types/messages_modify_response.py +5 -4
- letta_client/groups/raw_client.py +807 -0
- letta_client/groups/types/__init__.py +2 -0
- letta_client/groups/types/group_create_manager_config.py +1 -0
- letta_client/groups/types/group_update_manager_config.py +1 -0
- letta_client/health/__init__.py +2 -0
- letta_client/health/client.py +31 -43
- letta_client/health/raw_client.py +85 -0
- letta_client/identities/__init__.py +2 -0
- letta_client/identities/client.py +115 -498
- letta_client/identities/properties/__init__.py +2 -0
- letta_client/identities/properties/client.py +32 -76
- letta_client/identities/properties/raw_client.py +152 -0
- letta_client/identities/raw_client.py +1010 -0
- letta_client/jobs/__init__.py +2 -0
- letta_client/jobs/client.py +67 -310
- letta_client/jobs/raw_client.py +624 -0
- letta_client/messages/__init__.py +2 -0
- letta_client/messages/client.py +41 -74
- letta_client/messages/raw_client.py +186 -0
- letta_client/models/__init__.py +2 -0
- letta_client/models/client.py +39 -73
- letta_client/models/raw_client.py +151 -0
- letta_client/projects/__init__.py +2 -0
- letta_client/projects/client.py +31 -53
- letta_client/projects/raw_client.py +125 -0
- letta_client/projects/types/__init__.py +2 -0
- letta_client/projects/types/projects_list_response.py +5 -4
- letta_client/projects/types/projects_list_response_projects_item.py +3 -2
- letta_client/providers/__init__.py +2 -0
- letta_client/providers/client.py +62 -335
- letta_client/providers/raw_client.py +664 -0
- letta_client/runs/__init__.py +2 -0
- letta_client/runs/client.py +56 -258
- letta_client/runs/messages/__init__.py +2 -0
- letta_client/runs/messages/client.py +34 -79
- letta_client/runs/messages/raw_client.py +209 -0
- letta_client/runs/raw_client.py +440 -0
- letta_client/runs/steps/__init__.py +2 -0
- letta_client/runs/steps/client.py +33 -76
- letta_client/runs/steps/raw_client.py +192 -0
- letta_client/runs/usage/__init__.py +2 -0
- letta_client/runs/usage/client.py +31 -66
- letta_client/runs/usage/raw_client.py +122 -0
- letta_client/sources/__init__.py +2 -0
- letta_client/sources/client.py +107 -625
- letta_client/sources/files/__init__.py +2 -0
- letta_client/sources/files/client.py +44 -189
- letta_client/sources/files/raw_client.py +391 -0
- letta_client/sources/passages/__init__.py +2 -0
- letta_client/sources/passages/client.py +33 -74
- letta_client/sources/passages/raw_client.py +162 -0
- letta_client/sources/raw_client.py +1209 -0
- letta_client/steps/__init__.py +2 -0
- letta_client/steps/client.py +65 -153
- letta_client/steps/feedback/__init__.py +2 -0
- letta_client/steps/feedback/client.py +32 -73
- letta_client/steps/feedback/raw_client.py +141 -0
- letta_client/steps/raw_client.py +355 -0
- letta_client/steps/types/__init__.py +2 -0
- letta_client/tags/__init__.py +2 -0
- letta_client/tags/client.py +33 -73
- letta_client/tags/raw_client.py +148 -0
- letta_client/telemetry/__init__.py +2 -0
- letta_client/telemetry/client.py +31 -66
- letta_client/telemetry/raw_client.py +118 -0
- letta_client/templates/__init__.py +2 -0
- letta_client/templates/agents/__init__.py +2 -0
- letta_client/templates/agents/client.py +48 -96
- letta_client/templates/agents/raw_client.py +227 -0
- letta_client/templates/agents/types/__init__.py +2 -0
- letta_client/templates/agents/types/agents_create_request_initial_message_sequence_item.py +4 -3
- letta_client/templates/agents/types/agents_create_response.py +4 -3
- letta_client/templates/client.py +36 -57
- letta_client/templates/raw_client.py +133 -0
- letta_client/templates/types/__init__.py +2 -0
- letta_client/templates/types/templates_list_response.py +5 -4
- letta_client/templates/types/templates_list_response_templates_item.py +3 -2
- letta_client/tools/__init__.py +2 -0
- letta_client/tools/client.py +195 -1322
- letta_client/tools/raw_client.py +2565 -0
- letta_client/tools/types/__init__.py +2 -0
- letta_client/tools/types/add_mcp_server_request.py +2 -1
- letta_client/tools/types/add_mcp_server_response_item.py +2 -1
- letta_client/tools/types/connect_mcp_server_request.py +2 -1
- letta_client/tools/types/delete_mcp_server_response_item.py +2 -1
- letta_client/tools/types/list_mcp_servers_response_value.py +1 -0
- letta_client/tools/types/streaming_response.py +5 -4
- letta_client/tools/types/test_mcp_server_request.py +2 -1
- letta_client/tools/types/update_mcp_server_request.py +2 -1
- letta_client/tools/types/update_mcp_server_response.py +2 -1
- letta_client/types/__init__.py +2 -0
- letta_client/types/action_model.py +6 -5
- letta_client/types/action_parameters_model.py +3 -2
- letta_client/types/action_response_model.py +3 -2
- letta_client/types/agent_environment_variable.py +3 -2
- letta_client/types/agent_schema.py +7 -6
- letta_client/types/agent_schema_tool_rules_item.py +2 -1
- letta_client/types/agent_state.py +9 -8
- letta_client/types/agent_state_response_format.py +1 -0
- letta_client/types/agent_state_tool_rules_item.py +4 -3
- letta_client/types/app_auth_scheme.py +4 -3
- letta_client/types/app_model.py +5 -4
- letta_client/types/assistant_message.py +3 -2
- letta_client/types/assistant_message_content.py +1 -0
- letta_client/types/audio.py +3 -2
- letta_client/types/auth_request.py +2 -1
- letta_client/types/auth_response.py +5 -4
- letta_client/types/auth_scheme_field.py +3 -2
- letta_client/types/bad_request_error_body.py +3 -2
- letta_client/types/base_64_image.py +2 -1
- letta_client/types/base_tool_rule_schema.py +3 -2
- letta_client/types/batch_job.py +4 -3
- letta_client/types/block.py +3 -2
- letta_client/types/block_update.py +2 -1
- letta_client/types/chat_completion_assistant_message_param.py +5 -4
- letta_client/types/chat_completion_assistant_message_param_content.py +1 -0
- letta_client/types/chat_completion_assistant_message_param_content_item.py +2 -1
- letta_client/types/chat_completion_audio_param.py +4 -3
- letta_client/types/chat_completion_content_part_image_param.py +4 -3
- letta_client/types/chat_completion_content_part_input_audio_param.py +4 -3
- letta_client/types/chat_completion_content_part_refusal_param.py +3 -2
- letta_client/types/chat_completion_content_part_text_param.py +3 -2
- letta_client/types/chat_completion_developer_message_param.py +4 -3
- letta_client/types/chat_completion_developer_message_param_content.py +1 -0
- letta_client/types/chat_completion_function_call_option_param.py +3 -2
- letta_client/types/chat_completion_function_message_param.py +3 -2
- letta_client/types/chat_completion_message_tool_call.py +4 -3
- letta_client/types/chat_completion_message_tool_call_param.py +4 -3
- letta_client/types/chat_completion_named_tool_choice_param.py +4 -3
- letta_client/types/chat_completion_prediction_content_param.py +4 -3
- letta_client/types/chat_completion_prediction_content_param_content.py +1 -0
- letta_client/types/chat_completion_stream_options_param.py +3 -2
- letta_client/types/chat_completion_system_message_param.py +4 -3
- letta_client/types/chat_completion_system_message_param_content.py +1 -0
- letta_client/types/chat_completion_tool_message_param.py +4 -3
- letta_client/types/chat_completion_tool_message_param_content.py +1 -0
- letta_client/types/chat_completion_tool_param.py +4 -3
- letta_client/types/chat_completion_user_message_param.py +4 -3
- letta_client/types/chat_completion_user_message_param_content.py +1 -0
- letta_client/types/chat_completion_user_message_param_content_item.py +2 -1
- letta_client/types/child_tool_rule.py +3 -2
- letta_client/types/child_tool_rule_schema.py +3 -2
- letta_client/types/code_input.py +3 -2
- letta_client/types/completion_create_params_non_streaming.py +10 -9
- letta_client/types/completion_create_params_non_streaming_function_call.py +1 -0
- letta_client/types/completion_create_params_non_streaming_messages_item.py +4 -3
- letta_client/types/completion_create_params_non_streaming_response_format.py +3 -2
- letta_client/types/completion_create_params_non_streaming_tool_choice.py +1 -0
- letta_client/types/completion_create_params_streaming.py +10 -9
- letta_client/types/completion_create_params_streaming_function_call.py +1 -0
- letta_client/types/completion_create_params_streaming_messages_item.py +4 -3
- letta_client/types/completion_create_params_streaming_response_format.py +3 -2
- letta_client/types/completion_create_params_streaming_tool_choice.py +1 -0
- letta_client/types/conditional_tool_rule.py +3 -2
- letta_client/types/conditional_tool_rule_schema.py +3 -2
- letta_client/types/conflict_error_body.py +3 -2
- letta_client/types/context_window_overview.py +4 -3
- letta_client/types/continue_tool_rule.py +3 -2
- letta_client/types/core_memory_block_schema.py +4 -3
- letta_client/types/create_block.py +3 -2
- letta_client/types/dynamic_manager.py +2 -1
- letta_client/types/dynamic_manager_update.py +2 -1
- letta_client/types/e_2_b_sandbox_config.py +2 -1
- letta_client/types/embedding_config.py +4 -3
- letta_client/types/file.py +4 -3
- letta_client/types/file_block.py +4 -3
- letta_client/types/file_file.py +3 -2
- letta_client/types/file_metadata.py +5 -4
- letta_client/types/file_stats.py +3 -2
- letta_client/types/folder.py +5 -4
- letta_client/types/function_call.py +3 -2
- letta_client/types/function_definition_input.py +3 -2
- letta_client/types/function_definition_output.py +3 -2
- letta_client/types/function_output.py +3 -2
- letta_client/types/function_tool.py +4 -3
- letta_client/types/generate_tool_input.py +3 -2
- letta_client/types/generate_tool_output.py +4 -3
- letta_client/types/group.py +4 -3
- letta_client/types/health.py +3 -2
- letta_client/types/hidden_reasoning_message.py +4 -3
- letta_client/types/http_validation_error.py +4 -3
- letta_client/types/identity.py +4 -3
- letta_client/types/identity_property.py +5 -4
- letta_client/types/image_content.py +3 -2
- letta_client/types/image_content_source.py +1 -0
- letta_client/types/image_url.py +4 -3
- letta_client/types/init_tool_rule.py +3 -2
- letta_client/types/input_audio.py +4 -3
- letta_client/types/internal_server_error_body.py +3 -2
- letta_client/types/job.py +4 -3
- letta_client/types/json_object_response_format.py +3 -2
- letta_client/types/json_schema.py +4 -3
- letta_client/types/json_schema_response_format.py +2 -1
- letta_client/types/letta_batch_messages.py +4 -3
- letta_client/types/letta_batch_request.py +4 -3
- letta_client/types/letta_image.py +2 -1
- letta_client/types/letta_message_content_union.py +4 -3
- letta_client/types/letta_message_union.py +5 -4
- letta_client/types/letta_ping.py +2 -1
- letta_client/types/letta_request.py +4 -3
- letta_client/types/letta_request_config.py +3 -2
- letta_client/types/letta_response.py +4 -3
- letta_client/types/letta_stop_reason.py +3 -2
- letta_client/types/letta_streaming_request.py +9 -3
- letta_client/types/letta_usage_statistics.py +3 -2
- letta_client/types/letta_user_message_content_union.py +2 -1
- letta_client/types/llm_config.py +6 -5
- letta_client/types/local_sandbox_config.py +3 -2
- letta_client/types/max_count_per_step_tool_rule.py +3 -2
- letta_client/types/max_count_per_step_tool_rule_schema.py +3 -2
- letta_client/types/mcp_tool.py +4 -3
- letta_client/types/memory.py +4 -3
- letta_client/types/message.py +6 -5
- letta_client/types/message_content_item.py +1 -0
- letta_client/types/message_create.py +5 -4
- letta_client/types/message_create_content.py +1 -0
- letta_client/types/message_schema.py +4 -3
- letta_client/types/modal_sandbox_config.py +2 -1
- letta_client/types/not_found_error_body.py +3 -2
- letta_client/types/omitted_reasoning_content.py +3 -2
- letta_client/types/openai_types_chat_chat_completion_message_tool_call_param_function.py +3 -2
- letta_client/types/openai_types_chat_chat_completion_named_tool_choice_param_function.py +3 -2
- letta_client/types/openai_types_chat_completion_create_params_function.py +3 -2
- letta_client/types/organization.py +3 -2
- letta_client/types/organization_create.py +2 -1
- letta_client/types/organization_sources_stats.py +3 -2
- letta_client/types/organization_update.py +2 -1
- letta_client/types/parameter_properties.py +3 -2
- letta_client/types/parameters_schema.py +4 -3
- letta_client/types/parent_tool_rule.py +3 -2
- letta_client/types/passage.py +4 -3
- letta_client/types/payment_required_error_body.py +3 -2
- letta_client/types/pip_requirement.py +3 -2
- letta_client/types/provider.py +5 -4
- letta_client/types/provider_check.py +4 -3
- letta_client/types/provider_trace.py +3 -2
- letta_client/types/reasoning_content.py +2 -1
- letta_client/types/reasoning_message.py +4 -3
- letta_client/types/redacted_reasoning_content.py +2 -1
- letta_client/types/required_before_exit_tool_rule.py +3 -2
- letta_client/types/response_format_json_object.py +3 -2
- letta_client/types/response_format_json_schema.py +4 -3
- letta_client/types/response_format_text.py +3 -2
- letta_client/types/round_robin_manager.py +2 -1
- letta_client/types/round_robin_manager_update.py +2 -1
- letta_client/types/run.py +4 -3
- letta_client/types/sandbox_config.py +4 -3
- letta_client/types/sandbox_config_create.py +4 -3
- letta_client/types/sandbox_config_create_config.py +2 -1
- letta_client/types/sandbox_config_update.py +3 -2
- letta_client/types/sandbox_config_update_config.py +2 -1
- letta_client/types/sandbox_environment_variable.py +3 -2
- letta_client/types/sandbox_environment_variable_create.py +3 -2
- letta_client/types/sandbox_environment_variable_update.py +2 -1
- letta_client/types/sleeptime_manager.py +2 -1
- letta_client/types/sleeptime_manager_update.py +2 -1
- letta_client/types/source.py +5 -4
- letta_client/types/source_create.py +4 -3
- letta_client/types/source_stats.py +4 -3
- letta_client/types/source_update.py +3 -2
- letta_client/types/sse_server_config.py +4 -3
- letta_client/types/stdio_server_config.py +4 -3
- letta_client/types/step.py +5 -4
- letta_client/types/streamable_http_server_config.py +4 -3
- letta_client/types/supervisor_manager.py +2 -1
- letta_client/types/supervisor_manager_update.py +2 -1
- letta_client/types/system_message.py +2 -1
- letta_client/types/tag_schema.py +3 -2
- letta_client/types/terminal_tool_rule.py +3 -2
- letta_client/types/text_content.py +2 -1
- letta_client/types/text_response_format.py +3 -2
- letta_client/types/tool.py +5 -4
- letta_client/types/tool_annotations.py +4 -3
- letta_client/types/tool_call.py +3 -2
- letta_client/types/tool_call_content.py +2 -1
- letta_client/types/tool_call_delta.py +3 -2
- letta_client/types/tool_call_message.py +4 -3
- letta_client/types/tool_call_message_tool_call.py +1 -0
- letta_client/types/tool_create.py +3 -2
- letta_client/types/tool_env_var_schema.py +3 -2
- letta_client/types/tool_json_schema.py +4 -3
- letta_client/types/tool_return.py +4 -3
- letta_client/types/tool_return_content.py +2 -1
- letta_client/types/tool_return_message.py +4 -3
- letta_client/types/tool_schema.py +5 -4
- letta_client/types/update_assistant_message.py +3 -2
- letta_client/types/update_assistant_message_content.py +1 -0
- letta_client/types/update_reasoning_message.py +3 -2
- letta_client/types/update_ssemcp_server.py +2 -1
- letta_client/types/update_stdio_mcp_server.py +3 -2
- letta_client/types/update_streamable_httpmcp_server.py +2 -1
- letta_client/types/update_system_message.py +2 -1
- letta_client/types/update_user_message.py +3 -2
- letta_client/types/update_user_message_content.py +1 -0
- letta_client/types/url_image.py +2 -1
- letta_client/types/usage_statistics.py +5 -4
- letta_client/types/usage_statistics_completion_token_details.py +3 -2
- letta_client/types/usage_statistics_prompt_token_details.py +3 -2
- letta_client/types/user.py +3 -2
- letta_client/types/user_create.py +3 -2
- letta_client/types/user_message.py +3 -2
- letta_client/types/user_message_content.py +1 -0
- letta_client/types/user_update.py +3 -2
- letta_client/types/validation_error.py +4 -3
- letta_client/types/voice_sleeptime_manager.py +2 -1
- letta_client/types/voice_sleeptime_manager_update.py +2 -1
- letta_client/types/web_search_options.py +4 -3
- letta_client/types/web_search_options_user_location.py +4 -3
- letta_client/types/web_search_options_user_location_approximate.py +3 -2
- letta_client/voice/__init__.py +2 -0
- letta_client/voice/client.py +33 -74
- letta_client/voice/raw_client.py +154 -0
- {letta_client-0.1.233.dist-info → letta_client-0.1.234.dist-info}/METADATA +24 -3
- letta_client-0.1.234.dist-info/RECORD +503 -0
- letta_client-0.1.233.dist-info/RECORD +0 -455
- {letta_client-0.1.233.dist-info → letta_client-0.1.234.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
from json.decoder import JSONDecodeError
|
|
5
|
+
|
|
6
|
+
from ...core.api_error import ApiError
|
|
7
|
+
from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
8
|
+
from ...core.http_response import AsyncHttpResponse, HttpResponse
|
|
9
|
+
from ...core.jsonable_encoder import jsonable_encoder
|
|
10
|
+
from ...core.request_options import RequestOptions
|
|
11
|
+
from ...core.unchecked_base_model import construct_type
|
|
12
|
+
from ...errors.unprocessable_entity_error import UnprocessableEntityError
|
|
13
|
+
from ...types.http_validation_error import HttpValidationError
|
|
14
|
+
from ...types.letta_message_union import LettaMessageUnion
|
|
15
|
+
from ...types.message_role import MessageRole
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class RawMessagesClient:
|
|
19
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
20
|
+
self._client_wrapper = client_wrapper
|
|
21
|
+
|
|
22
|
+
def list(
|
|
23
|
+
self,
|
|
24
|
+
run_id: str,
|
|
25
|
+
*,
|
|
26
|
+
before: typing.Optional[str] = None,
|
|
27
|
+
after: typing.Optional[str] = None,
|
|
28
|
+
limit: typing.Optional[int] = None,
|
|
29
|
+
order: typing.Optional[str] = None,
|
|
30
|
+
role: typing.Optional[MessageRole] = None,
|
|
31
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
32
|
+
) -> HttpResponse[typing.List[LettaMessageUnion]]:
|
|
33
|
+
"""
|
|
34
|
+
Get messages associated with a run with filtering options.
|
|
35
|
+
|
|
36
|
+
Args:
|
|
37
|
+
run_id: ID of the run
|
|
38
|
+
before: A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.
|
|
39
|
+
after: A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
|
|
40
|
+
limit: Maximum number of messages to return
|
|
41
|
+
order: Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.
|
|
42
|
+
role: Filter by role (user/assistant/system/tool)
|
|
43
|
+
return_message_object: Whether to return Message objects or LettaMessage objects
|
|
44
|
+
user_id: ID of the user making the request
|
|
45
|
+
|
|
46
|
+
Returns:
|
|
47
|
+
A list of messages associated with the run. Default is List[LettaMessage].
|
|
48
|
+
|
|
49
|
+
Parameters
|
|
50
|
+
----------
|
|
51
|
+
run_id : str
|
|
52
|
+
|
|
53
|
+
before : typing.Optional[str]
|
|
54
|
+
Cursor for pagination
|
|
55
|
+
|
|
56
|
+
after : typing.Optional[str]
|
|
57
|
+
Cursor for pagination
|
|
58
|
+
|
|
59
|
+
limit : typing.Optional[int]
|
|
60
|
+
Maximum number of messages to return
|
|
61
|
+
|
|
62
|
+
order : typing.Optional[str]
|
|
63
|
+
Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.
|
|
64
|
+
|
|
65
|
+
role : typing.Optional[MessageRole]
|
|
66
|
+
Filter by role
|
|
67
|
+
|
|
68
|
+
request_options : typing.Optional[RequestOptions]
|
|
69
|
+
Request-specific configuration.
|
|
70
|
+
|
|
71
|
+
Returns
|
|
72
|
+
-------
|
|
73
|
+
HttpResponse[typing.List[LettaMessageUnion]]
|
|
74
|
+
Successful Response
|
|
75
|
+
"""
|
|
76
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
77
|
+
f"v1/runs/{jsonable_encoder(run_id)}/messages",
|
|
78
|
+
method="GET",
|
|
79
|
+
params={
|
|
80
|
+
"before": before,
|
|
81
|
+
"after": after,
|
|
82
|
+
"limit": limit,
|
|
83
|
+
"order": order,
|
|
84
|
+
"role": role,
|
|
85
|
+
},
|
|
86
|
+
request_options=request_options,
|
|
87
|
+
)
|
|
88
|
+
try:
|
|
89
|
+
if 200 <= _response.status_code < 300:
|
|
90
|
+
_data = typing.cast(
|
|
91
|
+
typing.List[LettaMessageUnion],
|
|
92
|
+
construct_type(
|
|
93
|
+
type_=typing.List[LettaMessageUnion], # type: ignore
|
|
94
|
+
object_=_response.json(),
|
|
95
|
+
),
|
|
96
|
+
)
|
|
97
|
+
return HttpResponse(response=_response, data=_data)
|
|
98
|
+
if _response.status_code == 422:
|
|
99
|
+
raise UnprocessableEntityError(
|
|
100
|
+
headers=dict(_response.headers),
|
|
101
|
+
body=typing.cast(
|
|
102
|
+
HttpValidationError,
|
|
103
|
+
construct_type(
|
|
104
|
+
type_=HttpValidationError, # type: ignore
|
|
105
|
+
object_=_response.json(),
|
|
106
|
+
),
|
|
107
|
+
),
|
|
108
|
+
)
|
|
109
|
+
_response_json = _response.json()
|
|
110
|
+
except JSONDecodeError:
|
|
111
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
112
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
class AsyncRawMessagesClient:
|
|
116
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
117
|
+
self._client_wrapper = client_wrapper
|
|
118
|
+
|
|
119
|
+
async def list(
|
|
120
|
+
self,
|
|
121
|
+
run_id: str,
|
|
122
|
+
*,
|
|
123
|
+
before: typing.Optional[str] = None,
|
|
124
|
+
after: typing.Optional[str] = None,
|
|
125
|
+
limit: typing.Optional[int] = None,
|
|
126
|
+
order: typing.Optional[str] = None,
|
|
127
|
+
role: typing.Optional[MessageRole] = None,
|
|
128
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
129
|
+
) -> AsyncHttpResponse[typing.List[LettaMessageUnion]]:
|
|
130
|
+
"""
|
|
131
|
+
Get messages associated with a run with filtering options.
|
|
132
|
+
|
|
133
|
+
Args:
|
|
134
|
+
run_id: ID of the run
|
|
135
|
+
before: A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.
|
|
136
|
+
after: A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
|
|
137
|
+
limit: Maximum number of messages to return
|
|
138
|
+
order: Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.
|
|
139
|
+
role: Filter by role (user/assistant/system/tool)
|
|
140
|
+
return_message_object: Whether to return Message objects or LettaMessage objects
|
|
141
|
+
user_id: ID of the user making the request
|
|
142
|
+
|
|
143
|
+
Returns:
|
|
144
|
+
A list of messages associated with the run. Default is List[LettaMessage].
|
|
145
|
+
|
|
146
|
+
Parameters
|
|
147
|
+
----------
|
|
148
|
+
run_id : str
|
|
149
|
+
|
|
150
|
+
before : typing.Optional[str]
|
|
151
|
+
Cursor for pagination
|
|
152
|
+
|
|
153
|
+
after : typing.Optional[str]
|
|
154
|
+
Cursor for pagination
|
|
155
|
+
|
|
156
|
+
limit : typing.Optional[int]
|
|
157
|
+
Maximum number of messages to return
|
|
158
|
+
|
|
159
|
+
order : typing.Optional[str]
|
|
160
|
+
Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.
|
|
161
|
+
|
|
162
|
+
role : typing.Optional[MessageRole]
|
|
163
|
+
Filter by role
|
|
164
|
+
|
|
165
|
+
request_options : typing.Optional[RequestOptions]
|
|
166
|
+
Request-specific configuration.
|
|
167
|
+
|
|
168
|
+
Returns
|
|
169
|
+
-------
|
|
170
|
+
AsyncHttpResponse[typing.List[LettaMessageUnion]]
|
|
171
|
+
Successful Response
|
|
172
|
+
"""
|
|
173
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
174
|
+
f"v1/runs/{jsonable_encoder(run_id)}/messages",
|
|
175
|
+
method="GET",
|
|
176
|
+
params={
|
|
177
|
+
"before": before,
|
|
178
|
+
"after": after,
|
|
179
|
+
"limit": limit,
|
|
180
|
+
"order": order,
|
|
181
|
+
"role": role,
|
|
182
|
+
},
|
|
183
|
+
request_options=request_options,
|
|
184
|
+
)
|
|
185
|
+
try:
|
|
186
|
+
if 200 <= _response.status_code < 300:
|
|
187
|
+
_data = typing.cast(
|
|
188
|
+
typing.List[LettaMessageUnion],
|
|
189
|
+
construct_type(
|
|
190
|
+
type_=typing.List[LettaMessageUnion], # type: ignore
|
|
191
|
+
object_=_response.json(),
|
|
192
|
+
),
|
|
193
|
+
)
|
|
194
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
195
|
+
if _response.status_code == 422:
|
|
196
|
+
raise UnprocessableEntityError(
|
|
197
|
+
headers=dict(_response.headers),
|
|
198
|
+
body=typing.cast(
|
|
199
|
+
HttpValidationError,
|
|
200
|
+
construct_type(
|
|
201
|
+
type_=HttpValidationError, # type: ignore
|
|
202
|
+
object_=_response.json(),
|
|
203
|
+
),
|
|
204
|
+
),
|
|
205
|
+
)
|
|
206
|
+
_response_json = _response.json()
|
|
207
|
+
except JSONDecodeError:
|
|
208
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
209
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
@@ -0,0 +1,440 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
from json.decoder import JSONDecodeError
|
|
5
|
+
|
|
6
|
+
from ..core.api_error import ApiError
|
|
7
|
+
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
8
|
+
from ..core.http_response import AsyncHttpResponse, HttpResponse
|
|
9
|
+
from ..core.jsonable_encoder import jsonable_encoder
|
|
10
|
+
from ..core.request_options import RequestOptions
|
|
11
|
+
from ..core.unchecked_base_model import construct_type
|
|
12
|
+
from ..errors.unprocessable_entity_error import UnprocessableEntityError
|
|
13
|
+
from ..types.http_validation_error import HttpValidationError
|
|
14
|
+
from ..types.run import Run
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class RawRunsClient:
|
|
18
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
19
|
+
self._client_wrapper = client_wrapper
|
|
20
|
+
|
|
21
|
+
def list(
|
|
22
|
+
self,
|
|
23
|
+
*,
|
|
24
|
+
agent_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
|
|
25
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
26
|
+
) -> HttpResponse[typing.List[Run]]:
|
|
27
|
+
"""
|
|
28
|
+
List all runs.
|
|
29
|
+
|
|
30
|
+
Parameters
|
|
31
|
+
----------
|
|
32
|
+
agent_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
|
|
33
|
+
The unique identifier of the agent associated with the run.
|
|
34
|
+
|
|
35
|
+
request_options : typing.Optional[RequestOptions]
|
|
36
|
+
Request-specific configuration.
|
|
37
|
+
|
|
38
|
+
Returns
|
|
39
|
+
-------
|
|
40
|
+
HttpResponse[typing.List[Run]]
|
|
41
|
+
Successful Response
|
|
42
|
+
"""
|
|
43
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
44
|
+
"v1/runs/",
|
|
45
|
+
method="GET",
|
|
46
|
+
params={
|
|
47
|
+
"agent_ids": agent_ids,
|
|
48
|
+
},
|
|
49
|
+
request_options=request_options,
|
|
50
|
+
)
|
|
51
|
+
try:
|
|
52
|
+
if 200 <= _response.status_code < 300:
|
|
53
|
+
_data = typing.cast(
|
|
54
|
+
typing.List[Run],
|
|
55
|
+
construct_type(
|
|
56
|
+
type_=typing.List[Run], # type: ignore
|
|
57
|
+
object_=_response.json(),
|
|
58
|
+
),
|
|
59
|
+
)
|
|
60
|
+
return HttpResponse(response=_response, data=_data)
|
|
61
|
+
if _response.status_code == 422:
|
|
62
|
+
raise UnprocessableEntityError(
|
|
63
|
+
headers=dict(_response.headers),
|
|
64
|
+
body=typing.cast(
|
|
65
|
+
HttpValidationError,
|
|
66
|
+
construct_type(
|
|
67
|
+
type_=HttpValidationError, # type: ignore
|
|
68
|
+
object_=_response.json(),
|
|
69
|
+
),
|
|
70
|
+
),
|
|
71
|
+
)
|
|
72
|
+
_response_json = _response.json()
|
|
73
|
+
except JSONDecodeError:
|
|
74
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
75
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
76
|
+
|
|
77
|
+
def list_active(
|
|
78
|
+
self,
|
|
79
|
+
*,
|
|
80
|
+
agent_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
|
|
81
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
82
|
+
) -> HttpResponse[typing.List[Run]]:
|
|
83
|
+
"""
|
|
84
|
+
List all active runs.
|
|
85
|
+
|
|
86
|
+
Parameters
|
|
87
|
+
----------
|
|
88
|
+
agent_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
|
|
89
|
+
The unique identifier of the agent associated with the run.
|
|
90
|
+
|
|
91
|
+
request_options : typing.Optional[RequestOptions]
|
|
92
|
+
Request-specific configuration.
|
|
93
|
+
|
|
94
|
+
Returns
|
|
95
|
+
-------
|
|
96
|
+
HttpResponse[typing.List[Run]]
|
|
97
|
+
Successful Response
|
|
98
|
+
"""
|
|
99
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
100
|
+
"v1/runs/active",
|
|
101
|
+
method="GET",
|
|
102
|
+
params={
|
|
103
|
+
"agent_ids": agent_ids,
|
|
104
|
+
},
|
|
105
|
+
request_options=request_options,
|
|
106
|
+
)
|
|
107
|
+
try:
|
|
108
|
+
if 200 <= _response.status_code < 300:
|
|
109
|
+
_data = typing.cast(
|
|
110
|
+
typing.List[Run],
|
|
111
|
+
construct_type(
|
|
112
|
+
type_=typing.List[Run], # type: ignore
|
|
113
|
+
object_=_response.json(),
|
|
114
|
+
),
|
|
115
|
+
)
|
|
116
|
+
return HttpResponse(response=_response, data=_data)
|
|
117
|
+
if _response.status_code == 422:
|
|
118
|
+
raise UnprocessableEntityError(
|
|
119
|
+
headers=dict(_response.headers),
|
|
120
|
+
body=typing.cast(
|
|
121
|
+
HttpValidationError,
|
|
122
|
+
construct_type(
|
|
123
|
+
type_=HttpValidationError, # type: ignore
|
|
124
|
+
object_=_response.json(),
|
|
125
|
+
),
|
|
126
|
+
),
|
|
127
|
+
)
|
|
128
|
+
_response_json = _response.json()
|
|
129
|
+
except JSONDecodeError:
|
|
130
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
131
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
132
|
+
|
|
133
|
+
def retrieve(self, run_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[Run]:
|
|
134
|
+
"""
|
|
135
|
+
Get the status of a run.
|
|
136
|
+
|
|
137
|
+
Parameters
|
|
138
|
+
----------
|
|
139
|
+
run_id : str
|
|
140
|
+
|
|
141
|
+
request_options : typing.Optional[RequestOptions]
|
|
142
|
+
Request-specific configuration.
|
|
143
|
+
|
|
144
|
+
Returns
|
|
145
|
+
-------
|
|
146
|
+
HttpResponse[Run]
|
|
147
|
+
Successful Response
|
|
148
|
+
"""
|
|
149
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
150
|
+
f"v1/runs/{jsonable_encoder(run_id)}",
|
|
151
|
+
method="GET",
|
|
152
|
+
request_options=request_options,
|
|
153
|
+
)
|
|
154
|
+
try:
|
|
155
|
+
if 200 <= _response.status_code < 300:
|
|
156
|
+
_data = typing.cast(
|
|
157
|
+
Run,
|
|
158
|
+
construct_type(
|
|
159
|
+
type_=Run, # type: ignore
|
|
160
|
+
object_=_response.json(),
|
|
161
|
+
),
|
|
162
|
+
)
|
|
163
|
+
return HttpResponse(response=_response, data=_data)
|
|
164
|
+
if _response.status_code == 422:
|
|
165
|
+
raise UnprocessableEntityError(
|
|
166
|
+
headers=dict(_response.headers),
|
|
167
|
+
body=typing.cast(
|
|
168
|
+
HttpValidationError,
|
|
169
|
+
construct_type(
|
|
170
|
+
type_=HttpValidationError, # type: ignore
|
|
171
|
+
object_=_response.json(),
|
|
172
|
+
),
|
|
173
|
+
),
|
|
174
|
+
)
|
|
175
|
+
_response_json = _response.json()
|
|
176
|
+
except JSONDecodeError:
|
|
177
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
178
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
179
|
+
|
|
180
|
+
def delete(self, run_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[Run]:
|
|
181
|
+
"""
|
|
182
|
+
Delete a run by its run_id.
|
|
183
|
+
|
|
184
|
+
Parameters
|
|
185
|
+
----------
|
|
186
|
+
run_id : str
|
|
187
|
+
|
|
188
|
+
request_options : typing.Optional[RequestOptions]
|
|
189
|
+
Request-specific configuration.
|
|
190
|
+
|
|
191
|
+
Returns
|
|
192
|
+
-------
|
|
193
|
+
HttpResponse[Run]
|
|
194
|
+
Successful Response
|
|
195
|
+
"""
|
|
196
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
197
|
+
f"v1/runs/{jsonable_encoder(run_id)}",
|
|
198
|
+
method="DELETE",
|
|
199
|
+
request_options=request_options,
|
|
200
|
+
)
|
|
201
|
+
try:
|
|
202
|
+
if 200 <= _response.status_code < 300:
|
|
203
|
+
_data = typing.cast(
|
|
204
|
+
Run,
|
|
205
|
+
construct_type(
|
|
206
|
+
type_=Run, # type: ignore
|
|
207
|
+
object_=_response.json(),
|
|
208
|
+
),
|
|
209
|
+
)
|
|
210
|
+
return HttpResponse(response=_response, data=_data)
|
|
211
|
+
if _response.status_code == 422:
|
|
212
|
+
raise UnprocessableEntityError(
|
|
213
|
+
headers=dict(_response.headers),
|
|
214
|
+
body=typing.cast(
|
|
215
|
+
HttpValidationError,
|
|
216
|
+
construct_type(
|
|
217
|
+
type_=HttpValidationError, # type: ignore
|
|
218
|
+
object_=_response.json(),
|
|
219
|
+
),
|
|
220
|
+
),
|
|
221
|
+
)
|
|
222
|
+
_response_json = _response.json()
|
|
223
|
+
except JSONDecodeError:
|
|
224
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
225
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
class AsyncRawRunsClient:
|
|
229
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
230
|
+
self._client_wrapper = client_wrapper
|
|
231
|
+
|
|
232
|
+
async def list(
|
|
233
|
+
self,
|
|
234
|
+
*,
|
|
235
|
+
agent_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
|
|
236
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
237
|
+
) -> AsyncHttpResponse[typing.List[Run]]:
|
|
238
|
+
"""
|
|
239
|
+
List all runs.
|
|
240
|
+
|
|
241
|
+
Parameters
|
|
242
|
+
----------
|
|
243
|
+
agent_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
|
|
244
|
+
The unique identifier of the agent associated with the run.
|
|
245
|
+
|
|
246
|
+
request_options : typing.Optional[RequestOptions]
|
|
247
|
+
Request-specific configuration.
|
|
248
|
+
|
|
249
|
+
Returns
|
|
250
|
+
-------
|
|
251
|
+
AsyncHttpResponse[typing.List[Run]]
|
|
252
|
+
Successful Response
|
|
253
|
+
"""
|
|
254
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
255
|
+
"v1/runs/",
|
|
256
|
+
method="GET",
|
|
257
|
+
params={
|
|
258
|
+
"agent_ids": agent_ids,
|
|
259
|
+
},
|
|
260
|
+
request_options=request_options,
|
|
261
|
+
)
|
|
262
|
+
try:
|
|
263
|
+
if 200 <= _response.status_code < 300:
|
|
264
|
+
_data = typing.cast(
|
|
265
|
+
typing.List[Run],
|
|
266
|
+
construct_type(
|
|
267
|
+
type_=typing.List[Run], # type: ignore
|
|
268
|
+
object_=_response.json(),
|
|
269
|
+
),
|
|
270
|
+
)
|
|
271
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
272
|
+
if _response.status_code == 422:
|
|
273
|
+
raise UnprocessableEntityError(
|
|
274
|
+
headers=dict(_response.headers),
|
|
275
|
+
body=typing.cast(
|
|
276
|
+
HttpValidationError,
|
|
277
|
+
construct_type(
|
|
278
|
+
type_=HttpValidationError, # type: ignore
|
|
279
|
+
object_=_response.json(),
|
|
280
|
+
),
|
|
281
|
+
),
|
|
282
|
+
)
|
|
283
|
+
_response_json = _response.json()
|
|
284
|
+
except JSONDecodeError:
|
|
285
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
286
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
287
|
+
|
|
288
|
+
async def list_active(
|
|
289
|
+
self,
|
|
290
|
+
*,
|
|
291
|
+
agent_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
|
|
292
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
293
|
+
) -> AsyncHttpResponse[typing.List[Run]]:
|
|
294
|
+
"""
|
|
295
|
+
List all active runs.
|
|
296
|
+
|
|
297
|
+
Parameters
|
|
298
|
+
----------
|
|
299
|
+
agent_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
|
|
300
|
+
The unique identifier of the agent associated with the run.
|
|
301
|
+
|
|
302
|
+
request_options : typing.Optional[RequestOptions]
|
|
303
|
+
Request-specific configuration.
|
|
304
|
+
|
|
305
|
+
Returns
|
|
306
|
+
-------
|
|
307
|
+
AsyncHttpResponse[typing.List[Run]]
|
|
308
|
+
Successful Response
|
|
309
|
+
"""
|
|
310
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
311
|
+
"v1/runs/active",
|
|
312
|
+
method="GET",
|
|
313
|
+
params={
|
|
314
|
+
"agent_ids": agent_ids,
|
|
315
|
+
},
|
|
316
|
+
request_options=request_options,
|
|
317
|
+
)
|
|
318
|
+
try:
|
|
319
|
+
if 200 <= _response.status_code < 300:
|
|
320
|
+
_data = typing.cast(
|
|
321
|
+
typing.List[Run],
|
|
322
|
+
construct_type(
|
|
323
|
+
type_=typing.List[Run], # type: ignore
|
|
324
|
+
object_=_response.json(),
|
|
325
|
+
),
|
|
326
|
+
)
|
|
327
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
328
|
+
if _response.status_code == 422:
|
|
329
|
+
raise UnprocessableEntityError(
|
|
330
|
+
headers=dict(_response.headers),
|
|
331
|
+
body=typing.cast(
|
|
332
|
+
HttpValidationError,
|
|
333
|
+
construct_type(
|
|
334
|
+
type_=HttpValidationError, # type: ignore
|
|
335
|
+
object_=_response.json(),
|
|
336
|
+
),
|
|
337
|
+
),
|
|
338
|
+
)
|
|
339
|
+
_response_json = _response.json()
|
|
340
|
+
except JSONDecodeError:
|
|
341
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
342
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
343
|
+
|
|
344
|
+
async def retrieve(
|
|
345
|
+
self, run_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
346
|
+
) -> AsyncHttpResponse[Run]:
|
|
347
|
+
"""
|
|
348
|
+
Get the status of a run.
|
|
349
|
+
|
|
350
|
+
Parameters
|
|
351
|
+
----------
|
|
352
|
+
run_id : str
|
|
353
|
+
|
|
354
|
+
request_options : typing.Optional[RequestOptions]
|
|
355
|
+
Request-specific configuration.
|
|
356
|
+
|
|
357
|
+
Returns
|
|
358
|
+
-------
|
|
359
|
+
AsyncHttpResponse[Run]
|
|
360
|
+
Successful Response
|
|
361
|
+
"""
|
|
362
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
363
|
+
f"v1/runs/{jsonable_encoder(run_id)}",
|
|
364
|
+
method="GET",
|
|
365
|
+
request_options=request_options,
|
|
366
|
+
)
|
|
367
|
+
try:
|
|
368
|
+
if 200 <= _response.status_code < 300:
|
|
369
|
+
_data = typing.cast(
|
|
370
|
+
Run,
|
|
371
|
+
construct_type(
|
|
372
|
+
type_=Run, # type: ignore
|
|
373
|
+
object_=_response.json(),
|
|
374
|
+
),
|
|
375
|
+
)
|
|
376
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
377
|
+
if _response.status_code == 422:
|
|
378
|
+
raise UnprocessableEntityError(
|
|
379
|
+
headers=dict(_response.headers),
|
|
380
|
+
body=typing.cast(
|
|
381
|
+
HttpValidationError,
|
|
382
|
+
construct_type(
|
|
383
|
+
type_=HttpValidationError, # type: ignore
|
|
384
|
+
object_=_response.json(),
|
|
385
|
+
),
|
|
386
|
+
),
|
|
387
|
+
)
|
|
388
|
+
_response_json = _response.json()
|
|
389
|
+
except JSONDecodeError:
|
|
390
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
391
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
392
|
+
|
|
393
|
+
async def delete(
|
|
394
|
+
self, run_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
395
|
+
) -> AsyncHttpResponse[Run]:
|
|
396
|
+
"""
|
|
397
|
+
Delete a run by its run_id.
|
|
398
|
+
|
|
399
|
+
Parameters
|
|
400
|
+
----------
|
|
401
|
+
run_id : str
|
|
402
|
+
|
|
403
|
+
request_options : typing.Optional[RequestOptions]
|
|
404
|
+
Request-specific configuration.
|
|
405
|
+
|
|
406
|
+
Returns
|
|
407
|
+
-------
|
|
408
|
+
AsyncHttpResponse[Run]
|
|
409
|
+
Successful Response
|
|
410
|
+
"""
|
|
411
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
412
|
+
f"v1/runs/{jsonable_encoder(run_id)}",
|
|
413
|
+
method="DELETE",
|
|
414
|
+
request_options=request_options,
|
|
415
|
+
)
|
|
416
|
+
try:
|
|
417
|
+
if 200 <= _response.status_code < 300:
|
|
418
|
+
_data = typing.cast(
|
|
419
|
+
Run,
|
|
420
|
+
construct_type(
|
|
421
|
+
type_=Run, # type: ignore
|
|
422
|
+
object_=_response.json(),
|
|
423
|
+
),
|
|
424
|
+
)
|
|
425
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
426
|
+
if _response.status_code == 422:
|
|
427
|
+
raise UnprocessableEntityError(
|
|
428
|
+
headers=dict(_response.headers),
|
|
429
|
+
body=typing.cast(
|
|
430
|
+
HttpValidationError,
|
|
431
|
+
construct_type(
|
|
432
|
+
type_=HttpValidationError, # type: ignore
|
|
433
|
+
object_=_response.json(),
|
|
434
|
+
),
|
|
435
|
+
),
|
|
436
|
+
)
|
|
437
|
+
_response_json = _response.json()
|
|
438
|
+
except JSONDecodeError:
|
|
439
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
440
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|