letta-client 0.1.232__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 +4 -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 +4 -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 +28 -0
- 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 +4 -2
- letta_client/types/sandbox_config_update.py +3 -2
- letta_client/types/sandbox_config_update_config.py +4 -2
- 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/sandbox_type.py +1 -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/tool_type.py +0 -1
- 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.232.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.232.dist-info/RECORD +0 -454
- {letta_client-0.1.232.dist-info → letta_client-0.1.234.dist-info}/WHEEL +0 -0
letta_client/agents/client.py
CHANGED
|
@@ -1,55 +1,37 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
+
import datetime as dt
|
|
3
4
|
import typing
|
|
4
|
-
|
|
5
|
-
from
|
|
6
|
-
from .
|
|
7
|
-
from .sources.client import SourcesClient
|
|
8
|
-
from .folders.client import FoldersClient
|
|
9
|
-
from .files.client import FilesClient
|
|
10
|
-
from .core_memory.client import CoreMemoryClient
|
|
11
|
-
from .blocks.client import BlocksClient
|
|
12
|
-
from .passages.client import PassagesClient
|
|
13
|
-
from .messages.client import MessagesClient
|
|
14
|
-
from .groups.client import GroupsClient
|
|
15
|
-
from .templates.client import TemplatesClient
|
|
16
|
-
from .memory_variables.client import MemoryVariablesClient
|
|
5
|
+
|
|
6
|
+
from .. import core
|
|
7
|
+
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
17
8
|
from ..core.request_options import RequestOptions
|
|
18
9
|
from ..types.agent_state import AgentState
|
|
19
|
-
from ..core.unchecked_base_model import construct_type
|
|
20
|
-
from ..errors.unprocessable_entity_error import UnprocessableEntityError
|
|
21
|
-
from ..types.http_validation_error import HttpValidationError
|
|
22
|
-
from json.decoder import JSONDecodeError
|
|
23
|
-
from ..core.api_error import ApiError
|
|
24
|
-
from ..types.create_block import CreateBlock
|
|
25
|
-
from .types.create_agent_request_tool_rules_item import CreateAgentRequestToolRulesItem
|
|
26
10
|
from ..types.agent_type import AgentType
|
|
27
|
-
from ..types.
|
|
11
|
+
from ..types.create_block import CreateBlock
|
|
28
12
|
from ..types.embedding_config import EmbeddingConfig
|
|
13
|
+
from ..types.llm_config import LlmConfig
|
|
29
14
|
from ..types.message_create import MessageCreate
|
|
30
|
-
from .
|
|
31
|
-
from
|
|
32
|
-
from
|
|
33
|
-
from
|
|
34
|
-
from .
|
|
35
|
-
from .
|
|
36
|
-
import
|
|
15
|
+
from .blocks.client import AsyncBlocksClient, BlocksClient
|
|
16
|
+
from .context.client import AsyncContextClient, ContextClient
|
|
17
|
+
from .core_memory.client import AsyncCoreMemoryClient, CoreMemoryClient
|
|
18
|
+
from .files.client import AsyncFilesClient, FilesClient
|
|
19
|
+
from .folders.client import AsyncFoldersClient, FoldersClient
|
|
20
|
+
from .groups.client import AsyncGroupsClient, GroupsClient
|
|
21
|
+
from .memory_variables.client import AsyncMemoryVariablesClient, MemoryVariablesClient
|
|
22
|
+
from .messages.client import AsyncMessagesClient, MessagesClient
|
|
23
|
+
from .passages.client import AsyncPassagesClient, PassagesClient
|
|
24
|
+
from .raw_client import AsyncRawAgentsClient, RawAgentsClient
|
|
25
|
+
from .sources.client import AsyncSourcesClient, SourcesClient
|
|
26
|
+
from .templates.client import AsyncTemplatesClient, TemplatesClient
|
|
27
|
+
from .tools.client import AsyncToolsClient, ToolsClient
|
|
37
28
|
from .types.agents_search_request_search_item import AgentsSearchRequestSearchItem
|
|
38
29
|
from .types.agents_search_request_sort_by import AgentsSearchRequestSortBy
|
|
39
30
|
from .types.agents_search_response import AgentsSearchResponse
|
|
40
|
-
from
|
|
41
|
-
from .
|
|
42
|
-
from .
|
|
43
|
-
from .
|
|
44
|
-
from .folders.client import AsyncFoldersClient
|
|
45
|
-
from .files.client import AsyncFilesClient
|
|
46
|
-
from .core_memory.client import AsyncCoreMemoryClient
|
|
47
|
-
from .blocks.client import AsyncBlocksClient
|
|
48
|
-
from .passages.client import AsyncPassagesClient
|
|
49
|
-
from .messages.client import AsyncMessagesClient
|
|
50
|
-
from .groups.client import AsyncGroupsClient
|
|
51
|
-
from .templates.client import AsyncTemplatesClient
|
|
52
|
-
from .memory_variables.client import AsyncMemoryVariablesClient
|
|
31
|
+
from .types.create_agent_request_response_format import CreateAgentRequestResponseFormat
|
|
32
|
+
from .types.create_agent_request_tool_rules_item import CreateAgentRequestToolRulesItem
|
|
33
|
+
from .types.update_agent_response_format import UpdateAgentResponseFormat
|
|
34
|
+
from .types.update_agent_tool_rules_item import UpdateAgentToolRulesItem
|
|
53
35
|
|
|
54
36
|
# this is used as the default value for optional parameters
|
|
55
37
|
OMIT = typing.cast(typing.Any, ...)
|
|
@@ -57,19 +39,41 @@ OMIT = typing.cast(typing.Any, ...)
|
|
|
57
39
|
|
|
58
40
|
class AgentsClient:
|
|
59
41
|
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
60
|
-
self.
|
|
61
|
-
self.context = ContextClient(client_wrapper=
|
|
62
|
-
|
|
63
|
-
self.
|
|
64
|
-
|
|
65
|
-
self.
|
|
66
|
-
|
|
67
|
-
self.
|
|
68
|
-
|
|
69
|
-
self.
|
|
70
|
-
|
|
71
|
-
self.
|
|
72
|
-
|
|
42
|
+
self._raw_client = RawAgentsClient(client_wrapper=client_wrapper)
|
|
43
|
+
self.context = ContextClient(client_wrapper=client_wrapper)
|
|
44
|
+
|
|
45
|
+
self.tools = ToolsClient(client_wrapper=client_wrapper)
|
|
46
|
+
|
|
47
|
+
self.sources = SourcesClient(client_wrapper=client_wrapper)
|
|
48
|
+
|
|
49
|
+
self.folders = FoldersClient(client_wrapper=client_wrapper)
|
|
50
|
+
|
|
51
|
+
self.files = FilesClient(client_wrapper=client_wrapper)
|
|
52
|
+
|
|
53
|
+
self.core_memory = CoreMemoryClient(client_wrapper=client_wrapper)
|
|
54
|
+
|
|
55
|
+
self.blocks = BlocksClient(client_wrapper=client_wrapper)
|
|
56
|
+
|
|
57
|
+
self.passages = PassagesClient(client_wrapper=client_wrapper)
|
|
58
|
+
|
|
59
|
+
self.messages = MessagesClient(client_wrapper=client_wrapper)
|
|
60
|
+
|
|
61
|
+
self.groups = GroupsClient(client_wrapper=client_wrapper)
|
|
62
|
+
|
|
63
|
+
self.templates = TemplatesClient(client_wrapper=client_wrapper)
|
|
64
|
+
|
|
65
|
+
self.memory_variables = MemoryVariablesClient(client_wrapper=client_wrapper)
|
|
66
|
+
|
|
67
|
+
@property
|
|
68
|
+
def with_raw_response(self) -> RawAgentsClient:
|
|
69
|
+
"""
|
|
70
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
71
|
+
|
|
72
|
+
Returns
|
|
73
|
+
-------
|
|
74
|
+
RawAgentsClient
|
|
75
|
+
"""
|
|
76
|
+
return self._raw_client
|
|
73
77
|
|
|
74
78
|
def list(
|
|
75
79
|
self,
|
|
@@ -162,51 +166,25 @@ class AgentsClient:
|
|
|
162
166
|
)
|
|
163
167
|
client.agents.list()
|
|
164
168
|
"""
|
|
165
|
-
_response = self.
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
"include_relationships": include_relationships,
|
|
182
|
-
"ascending": ascending,
|
|
183
|
-
"sort_by": sort_by,
|
|
184
|
-
},
|
|
169
|
+
_response = self._raw_client.list(
|
|
170
|
+
name=name,
|
|
171
|
+
tags=tags,
|
|
172
|
+
match_all_tags=match_all_tags,
|
|
173
|
+
before=before,
|
|
174
|
+
after=after,
|
|
175
|
+
limit=limit,
|
|
176
|
+
query_text=query_text,
|
|
177
|
+
project_id=project_id,
|
|
178
|
+
template_id=template_id,
|
|
179
|
+
base_template_id=base_template_id,
|
|
180
|
+
identity_id=identity_id,
|
|
181
|
+
identifier_keys=identifier_keys,
|
|
182
|
+
include_relationships=include_relationships,
|
|
183
|
+
ascending=ascending,
|
|
184
|
+
sort_by=sort_by,
|
|
185
185
|
request_options=request_options,
|
|
186
186
|
)
|
|
187
|
-
|
|
188
|
-
if 200 <= _response.status_code < 300:
|
|
189
|
-
return typing.cast(
|
|
190
|
-
typing.List[AgentState],
|
|
191
|
-
construct_type(
|
|
192
|
-
type_=typing.List[AgentState], # type: ignore
|
|
193
|
-
object_=_response.json(),
|
|
194
|
-
),
|
|
195
|
-
)
|
|
196
|
-
if _response.status_code == 422:
|
|
197
|
-
raise UnprocessableEntityError(
|
|
198
|
-
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, body=_response.text)
|
|
209
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
187
|
+
return _response.data
|
|
210
188
|
|
|
211
189
|
def create(
|
|
212
190
|
self,
|
|
@@ -400,93 +378,51 @@ class AgentsClient:
|
|
|
400
378
|
)
|
|
401
379
|
client.agents.create()
|
|
402
380
|
"""
|
|
403
|
-
_response = self.
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
"project": project,
|
|
446
|
-
"tool_exec_environment_variables": tool_exec_environment_variables,
|
|
447
|
-
"memory_variables": memory_variables,
|
|
448
|
-
"project_id": project_id,
|
|
449
|
-
"template_id": template_id,
|
|
450
|
-
"base_template_id": base_template_id,
|
|
451
|
-
"identity_ids": identity_ids,
|
|
452
|
-
"message_buffer_autoclear": message_buffer_autoclear,
|
|
453
|
-
"enable_sleeptime": enable_sleeptime,
|
|
454
|
-
"response_format": convert_and_respect_annotation_metadata(
|
|
455
|
-
object_=response_format, annotation=CreateAgentRequestResponseFormat, direction="write"
|
|
456
|
-
),
|
|
457
|
-
"timezone": timezone,
|
|
458
|
-
"max_files_open": max_files_open,
|
|
459
|
-
"per_file_view_window_char_limit": per_file_view_window_char_limit,
|
|
460
|
-
},
|
|
461
|
-
headers={
|
|
462
|
-
"content-type": "application/json",
|
|
463
|
-
},
|
|
381
|
+
_response = self._raw_client.create(
|
|
382
|
+
name=name,
|
|
383
|
+
memory_blocks=memory_blocks,
|
|
384
|
+
tools=tools,
|
|
385
|
+
tool_ids=tool_ids,
|
|
386
|
+
source_ids=source_ids,
|
|
387
|
+
block_ids=block_ids,
|
|
388
|
+
tool_rules=tool_rules,
|
|
389
|
+
tags=tags,
|
|
390
|
+
system=system,
|
|
391
|
+
agent_type=agent_type,
|
|
392
|
+
llm_config=llm_config,
|
|
393
|
+
embedding_config=embedding_config,
|
|
394
|
+
initial_message_sequence=initial_message_sequence,
|
|
395
|
+
include_base_tools=include_base_tools,
|
|
396
|
+
include_multi_agent_tools=include_multi_agent_tools,
|
|
397
|
+
include_base_tool_rules=include_base_tool_rules,
|
|
398
|
+
include_default_source=include_default_source,
|
|
399
|
+
description=description,
|
|
400
|
+
metadata=metadata,
|
|
401
|
+
model=model,
|
|
402
|
+
embedding=embedding,
|
|
403
|
+
context_window_limit=context_window_limit,
|
|
404
|
+
embedding_chunk_size=embedding_chunk_size,
|
|
405
|
+
max_tokens=max_tokens,
|
|
406
|
+
max_reasoning_tokens=max_reasoning_tokens,
|
|
407
|
+
enable_reasoner=enable_reasoner,
|
|
408
|
+
from_template=from_template,
|
|
409
|
+
template=template,
|
|
410
|
+
project=project,
|
|
411
|
+
tool_exec_environment_variables=tool_exec_environment_variables,
|
|
412
|
+
memory_variables=memory_variables,
|
|
413
|
+
project_id=project_id,
|
|
414
|
+
template_id=template_id,
|
|
415
|
+
base_template_id=base_template_id,
|
|
416
|
+
identity_ids=identity_ids,
|
|
417
|
+
message_buffer_autoclear=message_buffer_autoclear,
|
|
418
|
+
enable_sleeptime=enable_sleeptime,
|
|
419
|
+
response_format=response_format,
|
|
420
|
+
timezone=timezone,
|
|
421
|
+
max_files_open=max_files_open,
|
|
422
|
+
per_file_view_window_char_limit=per_file_view_window_char_limit,
|
|
464
423
|
request_options=request_options,
|
|
465
|
-
omit=OMIT,
|
|
466
424
|
)
|
|
467
|
-
|
|
468
|
-
if 200 <= _response.status_code < 300:
|
|
469
|
-
return typing.cast(
|
|
470
|
-
AgentState,
|
|
471
|
-
construct_type(
|
|
472
|
-
type_=AgentState, # type: ignore
|
|
473
|
-
object_=_response.json(),
|
|
474
|
-
),
|
|
475
|
-
)
|
|
476
|
-
if _response.status_code == 422:
|
|
477
|
-
raise UnprocessableEntityError(
|
|
478
|
-
typing.cast(
|
|
479
|
-
HttpValidationError,
|
|
480
|
-
construct_type(
|
|
481
|
-
type_=HttpValidationError, # type: ignore
|
|
482
|
-
object_=_response.json(),
|
|
483
|
-
),
|
|
484
|
-
)
|
|
485
|
-
)
|
|
486
|
-
_response_json = _response.json()
|
|
487
|
-
except JSONDecodeError:
|
|
488
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
489
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
425
|
+
return _response.data
|
|
490
426
|
|
|
491
427
|
def count(self, *, request_options: typing.Optional[RequestOptions] = None) -> int:
|
|
492
428
|
"""
|
|
@@ -512,34 +448,8 @@ class AgentsClient:
|
|
|
512
448
|
)
|
|
513
449
|
client.agents.count()
|
|
514
450
|
"""
|
|
515
|
-
_response = self.
|
|
516
|
-
|
|
517
|
-
method="GET",
|
|
518
|
-
request_options=request_options,
|
|
519
|
-
)
|
|
520
|
-
try:
|
|
521
|
-
if 200 <= _response.status_code < 300:
|
|
522
|
-
return typing.cast(
|
|
523
|
-
int,
|
|
524
|
-
construct_type(
|
|
525
|
-
type_=int, # type: ignore
|
|
526
|
-
object_=_response.json(),
|
|
527
|
-
),
|
|
528
|
-
)
|
|
529
|
-
if _response.status_code == 422:
|
|
530
|
-
raise UnprocessableEntityError(
|
|
531
|
-
typing.cast(
|
|
532
|
-
HttpValidationError,
|
|
533
|
-
construct_type(
|
|
534
|
-
type_=HttpValidationError, # type: ignore
|
|
535
|
-
object_=_response.json(),
|
|
536
|
-
),
|
|
537
|
-
)
|
|
538
|
-
)
|
|
539
|
-
_response_json = _response.json()
|
|
540
|
-
except JSONDecodeError:
|
|
541
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
542
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
451
|
+
_response = self._raw_client.count(request_options=request_options)
|
|
452
|
+
return _response.data
|
|
543
453
|
|
|
544
454
|
def export_file(self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> str:
|
|
545
455
|
"""
|
|
@@ -569,34 +479,8 @@ class AgentsClient:
|
|
|
569
479
|
agent_id="agent_id",
|
|
570
480
|
)
|
|
571
481
|
"""
|
|
572
|
-
_response = self.
|
|
573
|
-
|
|
574
|
-
method="GET",
|
|
575
|
-
request_options=request_options,
|
|
576
|
-
)
|
|
577
|
-
try:
|
|
578
|
-
if 200 <= _response.status_code < 300:
|
|
579
|
-
return typing.cast(
|
|
580
|
-
str,
|
|
581
|
-
construct_type(
|
|
582
|
-
type_=str, # type: ignore
|
|
583
|
-
object_=_response.json(),
|
|
584
|
-
),
|
|
585
|
-
)
|
|
586
|
-
if _response.status_code == 422:
|
|
587
|
-
raise UnprocessableEntityError(
|
|
588
|
-
typing.cast(
|
|
589
|
-
HttpValidationError,
|
|
590
|
-
construct_type(
|
|
591
|
-
type_=HttpValidationError, # type: ignore
|
|
592
|
-
object_=_response.json(),
|
|
593
|
-
),
|
|
594
|
-
)
|
|
595
|
-
)
|
|
596
|
-
_response_json = _response.json()
|
|
597
|
-
except JSONDecodeError:
|
|
598
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
599
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
482
|
+
_response = self._raw_client.export_file(agent_id, request_options=request_options)
|
|
483
|
+
return _response.data
|
|
600
484
|
|
|
601
485
|
def import_file(
|
|
602
486
|
self,
|
|
@@ -646,45 +530,15 @@ class AgentsClient:
|
|
|
646
530
|
)
|
|
647
531
|
client.agents.import_file()
|
|
648
532
|
"""
|
|
649
|
-
_response = self.
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
"project_id": project_id,
|
|
656
|
-
"strip_messages": strip_messages,
|
|
657
|
-
},
|
|
658
|
-
data={},
|
|
659
|
-
files={
|
|
660
|
-
"file": file,
|
|
661
|
-
},
|
|
533
|
+
_response = self._raw_client.import_file(
|
|
534
|
+
file=file,
|
|
535
|
+
append_copy_suffix=append_copy_suffix,
|
|
536
|
+
override_existing_tools=override_existing_tools,
|
|
537
|
+
project_id=project_id,
|
|
538
|
+
strip_messages=strip_messages,
|
|
662
539
|
request_options=request_options,
|
|
663
|
-
omit=OMIT,
|
|
664
540
|
)
|
|
665
|
-
|
|
666
|
-
if 200 <= _response.status_code < 300:
|
|
667
|
-
return typing.cast(
|
|
668
|
-
AgentState,
|
|
669
|
-
construct_type(
|
|
670
|
-
type_=AgentState, # type: ignore
|
|
671
|
-
object_=_response.json(),
|
|
672
|
-
),
|
|
673
|
-
)
|
|
674
|
-
if _response.status_code == 422:
|
|
675
|
-
raise UnprocessableEntityError(
|
|
676
|
-
typing.cast(
|
|
677
|
-
HttpValidationError,
|
|
678
|
-
construct_type(
|
|
679
|
-
type_=HttpValidationError, # type: ignore
|
|
680
|
-
object_=_response.json(),
|
|
681
|
-
),
|
|
682
|
-
)
|
|
683
|
-
)
|
|
684
|
-
_response_json = _response.json()
|
|
685
|
-
except JSONDecodeError:
|
|
686
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
687
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
541
|
+
return _response.data
|
|
688
542
|
|
|
689
543
|
def retrieve(
|
|
690
544
|
self,
|
|
@@ -723,37 +577,10 @@ class AgentsClient:
|
|
|
723
577
|
agent_id="agent_id",
|
|
724
578
|
)
|
|
725
579
|
"""
|
|
726
|
-
_response = self.
|
|
727
|
-
|
|
728
|
-
method="GET",
|
|
729
|
-
params={
|
|
730
|
-
"include_relationships": include_relationships,
|
|
731
|
-
},
|
|
732
|
-
request_options=request_options,
|
|
580
|
+
_response = self._raw_client.retrieve(
|
|
581
|
+
agent_id, include_relationships=include_relationships, request_options=request_options
|
|
733
582
|
)
|
|
734
|
-
|
|
735
|
-
if 200 <= _response.status_code < 300:
|
|
736
|
-
return typing.cast(
|
|
737
|
-
AgentState,
|
|
738
|
-
construct_type(
|
|
739
|
-
type_=AgentState, # type: ignore
|
|
740
|
-
object_=_response.json(),
|
|
741
|
-
),
|
|
742
|
-
)
|
|
743
|
-
if _response.status_code == 422:
|
|
744
|
-
raise UnprocessableEntityError(
|
|
745
|
-
typing.cast(
|
|
746
|
-
HttpValidationError,
|
|
747
|
-
construct_type(
|
|
748
|
-
type_=HttpValidationError, # type: ignore
|
|
749
|
-
object_=_response.json(),
|
|
750
|
-
),
|
|
751
|
-
)
|
|
752
|
-
)
|
|
753
|
-
_response_json = _response.json()
|
|
754
|
-
except JSONDecodeError:
|
|
755
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
756
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
583
|
+
return _response.data
|
|
757
584
|
|
|
758
585
|
def delete(
|
|
759
586
|
self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
@@ -785,34 +612,8 @@ class AgentsClient:
|
|
|
785
612
|
agent_id="agent_id",
|
|
786
613
|
)
|
|
787
614
|
"""
|
|
788
|
-
_response = self.
|
|
789
|
-
|
|
790
|
-
method="DELETE",
|
|
791
|
-
request_options=request_options,
|
|
792
|
-
)
|
|
793
|
-
try:
|
|
794
|
-
if 200 <= _response.status_code < 300:
|
|
795
|
-
return typing.cast(
|
|
796
|
-
typing.Optional[typing.Any],
|
|
797
|
-
construct_type(
|
|
798
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
|
799
|
-
object_=_response.json(),
|
|
800
|
-
),
|
|
801
|
-
)
|
|
802
|
-
if _response.status_code == 422:
|
|
803
|
-
raise UnprocessableEntityError(
|
|
804
|
-
typing.cast(
|
|
805
|
-
HttpValidationError,
|
|
806
|
-
construct_type(
|
|
807
|
-
type_=HttpValidationError, # type: ignore
|
|
808
|
-
object_=_response.json(),
|
|
809
|
-
),
|
|
810
|
-
)
|
|
811
|
-
)
|
|
812
|
-
_response_json = _response.json()
|
|
813
|
-
except JSONDecodeError:
|
|
814
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
815
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
615
|
+
_response = self._raw_client.delete(agent_id, request_options=request_options)
|
|
616
|
+
return _response.data
|
|
816
617
|
|
|
817
618
|
def modify(
|
|
818
619
|
self,
|
|
@@ -955,75 +756,38 @@ class AgentsClient:
|
|
|
955
756
|
agent_id="agent_id",
|
|
956
757
|
)
|
|
957
758
|
"""
|
|
958
|
-
_response = self.
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
"embedding": embedding,
|
|
988
|
-
"enable_sleeptime": enable_sleeptime,
|
|
989
|
-
"response_format": convert_and_respect_annotation_metadata(
|
|
990
|
-
object_=response_format, annotation=UpdateAgentResponseFormat, direction="write"
|
|
991
|
-
),
|
|
992
|
-
"last_run_completion": last_run_completion,
|
|
993
|
-
"last_run_duration_ms": last_run_duration_ms,
|
|
994
|
-
"timezone": timezone,
|
|
995
|
-
"max_files_open": max_files_open,
|
|
996
|
-
"per_file_view_window_char_limit": per_file_view_window_char_limit,
|
|
997
|
-
},
|
|
998
|
-
headers={
|
|
999
|
-
"content-type": "application/json",
|
|
1000
|
-
},
|
|
759
|
+
_response = self._raw_client.modify(
|
|
760
|
+
agent_id,
|
|
761
|
+
name=name,
|
|
762
|
+
tool_ids=tool_ids,
|
|
763
|
+
source_ids=source_ids,
|
|
764
|
+
block_ids=block_ids,
|
|
765
|
+
tags=tags,
|
|
766
|
+
system=system,
|
|
767
|
+
tool_rules=tool_rules,
|
|
768
|
+
llm_config=llm_config,
|
|
769
|
+
embedding_config=embedding_config,
|
|
770
|
+
message_ids=message_ids,
|
|
771
|
+
description=description,
|
|
772
|
+
metadata=metadata,
|
|
773
|
+
tool_exec_environment_variables=tool_exec_environment_variables,
|
|
774
|
+
project_id=project_id,
|
|
775
|
+
template_id=template_id,
|
|
776
|
+
base_template_id=base_template_id,
|
|
777
|
+
identity_ids=identity_ids,
|
|
778
|
+
message_buffer_autoclear=message_buffer_autoclear,
|
|
779
|
+
model=model,
|
|
780
|
+
embedding=embedding,
|
|
781
|
+
enable_sleeptime=enable_sleeptime,
|
|
782
|
+
response_format=response_format,
|
|
783
|
+
last_run_completion=last_run_completion,
|
|
784
|
+
last_run_duration_ms=last_run_duration_ms,
|
|
785
|
+
timezone=timezone,
|
|
786
|
+
max_files_open=max_files_open,
|
|
787
|
+
per_file_view_window_char_limit=per_file_view_window_char_limit,
|
|
1001
788
|
request_options=request_options,
|
|
1002
|
-
omit=OMIT,
|
|
1003
789
|
)
|
|
1004
|
-
|
|
1005
|
-
if 200 <= _response.status_code < 300:
|
|
1006
|
-
return typing.cast(
|
|
1007
|
-
AgentState,
|
|
1008
|
-
construct_type(
|
|
1009
|
-
type_=AgentState, # type: ignore
|
|
1010
|
-
object_=_response.json(),
|
|
1011
|
-
),
|
|
1012
|
-
)
|
|
1013
|
-
if _response.status_code == 422:
|
|
1014
|
-
raise UnprocessableEntityError(
|
|
1015
|
-
typing.cast(
|
|
1016
|
-
HttpValidationError,
|
|
1017
|
-
construct_type(
|
|
1018
|
-
type_=HttpValidationError, # type: ignore
|
|
1019
|
-
object_=_response.json(),
|
|
1020
|
-
),
|
|
1021
|
-
)
|
|
1022
|
-
)
|
|
1023
|
-
_response_json = _response.json()
|
|
1024
|
-
except JSONDecodeError:
|
|
1025
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
1026
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
790
|
+
return _response.data
|
|
1027
791
|
|
|
1028
792
|
def summarize_agent_conversation(
|
|
1029
793
|
self, agent_id: str, *, max_message_length: int, request_options: typing.Optional[RequestOptions] = None
|
|
@@ -1061,31 +825,10 @@ class AgentsClient:
|
|
|
1061
825
|
max_message_length=1,
|
|
1062
826
|
)
|
|
1063
827
|
"""
|
|
1064
|
-
_response = self.
|
|
1065
|
-
|
|
1066
|
-
method="POST",
|
|
1067
|
-
params={
|
|
1068
|
-
"max_message_length": max_message_length,
|
|
1069
|
-
},
|
|
1070
|
-
request_options=request_options,
|
|
828
|
+
_response = self._raw_client.summarize_agent_conversation(
|
|
829
|
+
agent_id, max_message_length=max_message_length, request_options=request_options
|
|
1071
830
|
)
|
|
1072
|
-
|
|
1073
|
-
if 200 <= _response.status_code < 300:
|
|
1074
|
-
return
|
|
1075
|
-
if _response.status_code == 422:
|
|
1076
|
-
raise UnprocessableEntityError(
|
|
1077
|
-
typing.cast(
|
|
1078
|
-
HttpValidationError,
|
|
1079
|
-
construct_type(
|
|
1080
|
-
type_=HttpValidationError, # type: ignore
|
|
1081
|
-
object_=_response.json(),
|
|
1082
|
-
),
|
|
1083
|
-
)
|
|
1084
|
-
)
|
|
1085
|
-
_response_json = _response.json()
|
|
1086
|
-
except JSONDecodeError:
|
|
1087
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
1088
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
831
|
+
return _response.data
|
|
1089
832
|
|
|
1090
833
|
def search(
|
|
1091
834
|
self,
|
|
@@ -1138,56 +881,56 @@ class AgentsClient:
|
|
|
1138
881
|
)
|
|
1139
882
|
client.agents.search()
|
|
1140
883
|
"""
|
|
1141
|
-
_response = self.
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
"combinator": combinator,
|
|
1150
|
-
"limit": limit,
|
|
1151
|
-
"after": after,
|
|
1152
|
-
"sortBy": sort_by,
|
|
1153
|
-
"ascending": ascending,
|
|
1154
|
-
},
|
|
1155
|
-
headers={
|
|
1156
|
-
"content-type": "application/json",
|
|
1157
|
-
},
|
|
884
|
+
_response = self._raw_client.search(
|
|
885
|
+
search=search,
|
|
886
|
+
project_id=project_id,
|
|
887
|
+
combinator=combinator,
|
|
888
|
+
limit=limit,
|
|
889
|
+
after=after,
|
|
890
|
+
sort_by=sort_by,
|
|
891
|
+
ascending=ascending,
|
|
1158
892
|
request_options=request_options,
|
|
1159
|
-
omit=OMIT,
|
|
1160
893
|
)
|
|
1161
|
-
|
|
1162
|
-
if 200 <= _response.status_code < 300:
|
|
1163
|
-
return typing.cast(
|
|
1164
|
-
AgentsSearchResponse,
|
|
1165
|
-
construct_type(
|
|
1166
|
-
type_=AgentsSearchResponse, # type: ignore
|
|
1167
|
-
object_=_response.json(),
|
|
1168
|
-
),
|
|
1169
|
-
)
|
|
1170
|
-
_response_json = _response.json()
|
|
1171
|
-
except JSONDecodeError:
|
|
1172
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
1173
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
894
|
+
return _response.data
|
|
1174
895
|
|
|
1175
896
|
|
|
1176
897
|
class AsyncAgentsClient:
|
|
1177
898
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
1178
|
-
self.
|
|
1179
|
-
self.context = AsyncContextClient(client_wrapper=
|
|
1180
|
-
|
|
1181
|
-
self.
|
|
1182
|
-
|
|
1183
|
-
self.
|
|
1184
|
-
|
|
1185
|
-
self.
|
|
1186
|
-
|
|
1187
|
-
self.
|
|
1188
|
-
|
|
1189
|
-
self.
|
|
1190
|
-
|
|
899
|
+
self._raw_client = AsyncRawAgentsClient(client_wrapper=client_wrapper)
|
|
900
|
+
self.context = AsyncContextClient(client_wrapper=client_wrapper)
|
|
901
|
+
|
|
902
|
+
self.tools = AsyncToolsClient(client_wrapper=client_wrapper)
|
|
903
|
+
|
|
904
|
+
self.sources = AsyncSourcesClient(client_wrapper=client_wrapper)
|
|
905
|
+
|
|
906
|
+
self.folders = AsyncFoldersClient(client_wrapper=client_wrapper)
|
|
907
|
+
|
|
908
|
+
self.files = AsyncFilesClient(client_wrapper=client_wrapper)
|
|
909
|
+
|
|
910
|
+
self.core_memory = AsyncCoreMemoryClient(client_wrapper=client_wrapper)
|
|
911
|
+
|
|
912
|
+
self.blocks = AsyncBlocksClient(client_wrapper=client_wrapper)
|
|
913
|
+
|
|
914
|
+
self.passages = AsyncPassagesClient(client_wrapper=client_wrapper)
|
|
915
|
+
|
|
916
|
+
self.messages = AsyncMessagesClient(client_wrapper=client_wrapper)
|
|
917
|
+
|
|
918
|
+
self.groups = AsyncGroupsClient(client_wrapper=client_wrapper)
|
|
919
|
+
|
|
920
|
+
self.templates = AsyncTemplatesClient(client_wrapper=client_wrapper)
|
|
921
|
+
|
|
922
|
+
self.memory_variables = AsyncMemoryVariablesClient(client_wrapper=client_wrapper)
|
|
923
|
+
|
|
924
|
+
@property
|
|
925
|
+
def with_raw_response(self) -> AsyncRawAgentsClient:
|
|
926
|
+
"""
|
|
927
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
928
|
+
|
|
929
|
+
Returns
|
|
930
|
+
-------
|
|
931
|
+
AsyncRawAgentsClient
|
|
932
|
+
"""
|
|
933
|
+
return self._raw_client
|
|
1191
934
|
|
|
1192
935
|
async def list(
|
|
1193
936
|
self,
|
|
@@ -1288,51 +1031,25 @@ class AsyncAgentsClient:
|
|
|
1288
1031
|
|
|
1289
1032
|
asyncio.run(main())
|
|
1290
1033
|
"""
|
|
1291
|
-
_response = await self.
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
"include_relationships": include_relationships,
|
|
1308
|
-
"ascending": ascending,
|
|
1309
|
-
"sort_by": sort_by,
|
|
1310
|
-
},
|
|
1034
|
+
_response = await self._raw_client.list(
|
|
1035
|
+
name=name,
|
|
1036
|
+
tags=tags,
|
|
1037
|
+
match_all_tags=match_all_tags,
|
|
1038
|
+
before=before,
|
|
1039
|
+
after=after,
|
|
1040
|
+
limit=limit,
|
|
1041
|
+
query_text=query_text,
|
|
1042
|
+
project_id=project_id,
|
|
1043
|
+
template_id=template_id,
|
|
1044
|
+
base_template_id=base_template_id,
|
|
1045
|
+
identity_id=identity_id,
|
|
1046
|
+
identifier_keys=identifier_keys,
|
|
1047
|
+
include_relationships=include_relationships,
|
|
1048
|
+
ascending=ascending,
|
|
1049
|
+
sort_by=sort_by,
|
|
1311
1050
|
request_options=request_options,
|
|
1312
1051
|
)
|
|
1313
|
-
|
|
1314
|
-
if 200 <= _response.status_code < 300:
|
|
1315
|
-
return typing.cast(
|
|
1316
|
-
typing.List[AgentState],
|
|
1317
|
-
construct_type(
|
|
1318
|
-
type_=typing.List[AgentState], # type: ignore
|
|
1319
|
-
object_=_response.json(),
|
|
1320
|
-
),
|
|
1321
|
-
)
|
|
1322
|
-
if _response.status_code == 422:
|
|
1323
|
-
raise UnprocessableEntityError(
|
|
1324
|
-
typing.cast(
|
|
1325
|
-
HttpValidationError,
|
|
1326
|
-
construct_type(
|
|
1327
|
-
type_=HttpValidationError, # type: ignore
|
|
1328
|
-
object_=_response.json(),
|
|
1329
|
-
),
|
|
1330
|
-
)
|
|
1331
|
-
)
|
|
1332
|
-
_response_json = _response.json()
|
|
1333
|
-
except JSONDecodeError:
|
|
1334
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
1335
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
1052
|
+
return _response.data
|
|
1336
1053
|
|
|
1337
1054
|
async def create(
|
|
1338
1055
|
self,
|
|
@@ -1534,93 +1251,51 @@ class AsyncAgentsClient:
|
|
|
1534
1251
|
|
|
1535
1252
|
asyncio.run(main())
|
|
1536
1253
|
"""
|
|
1537
|
-
_response = await self.
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
"project": project,
|
|
1580
|
-
"tool_exec_environment_variables": tool_exec_environment_variables,
|
|
1581
|
-
"memory_variables": memory_variables,
|
|
1582
|
-
"project_id": project_id,
|
|
1583
|
-
"template_id": template_id,
|
|
1584
|
-
"base_template_id": base_template_id,
|
|
1585
|
-
"identity_ids": identity_ids,
|
|
1586
|
-
"message_buffer_autoclear": message_buffer_autoclear,
|
|
1587
|
-
"enable_sleeptime": enable_sleeptime,
|
|
1588
|
-
"response_format": convert_and_respect_annotation_metadata(
|
|
1589
|
-
object_=response_format, annotation=CreateAgentRequestResponseFormat, direction="write"
|
|
1590
|
-
),
|
|
1591
|
-
"timezone": timezone,
|
|
1592
|
-
"max_files_open": max_files_open,
|
|
1593
|
-
"per_file_view_window_char_limit": per_file_view_window_char_limit,
|
|
1594
|
-
},
|
|
1595
|
-
headers={
|
|
1596
|
-
"content-type": "application/json",
|
|
1597
|
-
},
|
|
1254
|
+
_response = await self._raw_client.create(
|
|
1255
|
+
name=name,
|
|
1256
|
+
memory_blocks=memory_blocks,
|
|
1257
|
+
tools=tools,
|
|
1258
|
+
tool_ids=tool_ids,
|
|
1259
|
+
source_ids=source_ids,
|
|
1260
|
+
block_ids=block_ids,
|
|
1261
|
+
tool_rules=tool_rules,
|
|
1262
|
+
tags=tags,
|
|
1263
|
+
system=system,
|
|
1264
|
+
agent_type=agent_type,
|
|
1265
|
+
llm_config=llm_config,
|
|
1266
|
+
embedding_config=embedding_config,
|
|
1267
|
+
initial_message_sequence=initial_message_sequence,
|
|
1268
|
+
include_base_tools=include_base_tools,
|
|
1269
|
+
include_multi_agent_tools=include_multi_agent_tools,
|
|
1270
|
+
include_base_tool_rules=include_base_tool_rules,
|
|
1271
|
+
include_default_source=include_default_source,
|
|
1272
|
+
description=description,
|
|
1273
|
+
metadata=metadata,
|
|
1274
|
+
model=model,
|
|
1275
|
+
embedding=embedding,
|
|
1276
|
+
context_window_limit=context_window_limit,
|
|
1277
|
+
embedding_chunk_size=embedding_chunk_size,
|
|
1278
|
+
max_tokens=max_tokens,
|
|
1279
|
+
max_reasoning_tokens=max_reasoning_tokens,
|
|
1280
|
+
enable_reasoner=enable_reasoner,
|
|
1281
|
+
from_template=from_template,
|
|
1282
|
+
template=template,
|
|
1283
|
+
project=project,
|
|
1284
|
+
tool_exec_environment_variables=tool_exec_environment_variables,
|
|
1285
|
+
memory_variables=memory_variables,
|
|
1286
|
+
project_id=project_id,
|
|
1287
|
+
template_id=template_id,
|
|
1288
|
+
base_template_id=base_template_id,
|
|
1289
|
+
identity_ids=identity_ids,
|
|
1290
|
+
message_buffer_autoclear=message_buffer_autoclear,
|
|
1291
|
+
enable_sleeptime=enable_sleeptime,
|
|
1292
|
+
response_format=response_format,
|
|
1293
|
+
timezone=timezone,
|
|
1294
|
+
max_files_open=max_files_open,
|
|
1295
|
+
per_file_view_window_char_limit=per_file_view_window_char_limit,
|
|
1598
1296
|
request_options=request_options,
|
|
1599
|
-
omit=OMIT,
|
|
1600
1297
|
)
|
|
1601
|
-
|
|
1602
|
-
if 200 <= _response.status_code < 300:
|
|
1603
|
-
return typing.cast(
|
|
1604
|
-
AgentState,
|
|
1605
|
-
construct_type(
|
|
1606
|
-
type_=AgentState, # type: ignore
|
|
1607
|
-
object_=_response.json(),
|
|
1608
|
-
),
|
|
1609
|
-
)
|
|
1610
|
-
if _response.status_code == 422:
|
|
1611
|
-
raise UnprocessableEntityError(
|
|
1612
|
-
typing.cast(
|
|
1613
|
-
HttpValidationError,
|
|
1614
|
-
construct_type(
|
|
1615
|
-
type_=HttpValidationError, # type: ignore
|
|
1616
|
-
object_=_response.json(),
|
|
1617
|
-
),
|
|
1618
|
-
)
|
|
1619
|
-
)
|
|
1620
|
-
_response_json = _response.json()
|
|
1621
|
-
except JSONDecodeError:
|
|
1622
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
1623
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
1298
|
+
return _response.data
|
|
1624
1299
|
|
|
1625
1300
|
async def count(self, *, request_options: typing.Optional[RequestOptions] = None) -> int:
|
|
1626
1301
|
"""
|
|
@@ -1654,34 +1329,8 @@ class AsyncAgentsClient:
|
|
|
1654
1329
|
|
|
1655
1330
|
asyncio.run(main())
|
|
1656
1331
|
"""
|
|
1657
|
-
_response = await self.
|
|
1658
|
-
|
|
1659
|
-
method="GET",
|
|
1660
|
-
request_options=request_options,
|
|
1661
|
-
)
|
|
1662
|
-
try:
|
|
1663
|
-
if 200 <= _response.status_code < 300:
|
|
1664
|
-
return typing.cast(
|
|
1665
|
-
int,
|
|
1666
|
-
construct_type(
|
|
1667
|
-
type_=int, # type: ignore
|
|
1668
|
-
object_=_response.json(),
|
|
1669
|
-
),
|
|
1670
|
-
)
|
|
1671
|
-
if _response.status_code == 422:
|
|
1672
|
-
raise UnprocessableEntityError(
|
|
1673
|
-
typing.cast(
|
|
1674
|
-
HttpValidationError,
|
|
1675
|
-
construct_type(
|
|
1676
|
-
type_=HttpValidationError, # type: ignore
|
|
1677
|
-
object_=_response.json(),
|
|
1678
|
-
),
|
|
1679
|
-
)
|
|
1680
|
-
)
|
|
1681
|
-
_response_json = _response.json()
|
|
1682
|
-
except JSONDecodeError:
|
|
1683
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
1684
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
1332
|
+
_response = await self._raw_client.count(request_options=request_options)
|
|
1333
|
+
return _response.data
|
|
1685
1334
|
|
|
1686
1335
|
async def export_file(self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> str:
|
|
1687
1336
|
"""
|
|
@@ -1719,34 +1368,8 @@ class AsyncAgentsClient:
|
|
|
1719
1368
|
|
|
1720
1369
|
asyncio.run(main())
|
|
1721
1370
|
"""
|
|
1722
|
-
_response = await self.
|
|
1723
|
-
|
|
1724
|
-
method="GET",
|
|
1725
|
-
request_options=request_options,
|
|
1726
|
-
)
|
|
1727
|
-
try:
|
|
1728
|
-
if 200 <= _response.status_code < 300:
|
|
1729
|
-
return typing.cast(
|
|
1730
|
-
str,
|
|
1731
|
-
construct_type(
|
|
1732
|
-
type_=str, # type: ignore
|
|
1733
|
-
object_=_response.json(),
|
|
1734
|
-
),
|
|
1735
|
-
)
|
|
1736
|
-
if _response.status_code == 422:
|
|
1737
|
-
raise UnprocessableEntityError(
|
|
1738
|
-
typing.cast(
|
|
1739
|
-
HttpValidationError,
|
|
1740
|
-
construct_type(
|
|
1741
|
-
type_=HttpValidationError, # type: ignore
|
|
1742
|
-
object_=_response.json(),
|
|
1743
|
-
),
|
|
1744
|
-
)
|
|
1745
|
-
)
|
|
1746
|
-
_response_json = _response.json()
|
|
1747
|
-
except JSONDecodeError:
|
|
1748
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
1749
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
1371
|
+
_response = await self._raw_client.export_file(agent_id, request_options=request_options)
|
|
1372
|
+
return _response.data
|
|
1750
1373
|
|
|
1751
1374
|
async def import_file(
|
|
1752
1375
|
self,
|
|
@@ -1804,45 +1427,15 @@ class AsyncAgentsClient:
|
|
|
1804
1427
|
|
|
1805
1428
|
asyncio.run(main())
|
|
1806
1429
|
"""
|
|
1807
|
-
_response = await self.
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
"project_id": project_id,
|
|
1814
|
-
"strip_messages": strip_messages,
|
|
1815
|
-
},
|
|
1816
|
-
data={},
|
|
1817
|
-
files={
|
|
1818
|
-
"file": file,
|
|
1819
|
-
},
|
|
1430
|
+
_response = await self._raw_client.import_file(
|
|
1431
|
+
file=file,
|
|
1432
|
+
append_copy_suffix=append_copy_suffix,
|
|
1433
|
+
override_existing_tools=override_existing_tools,
|
|
1434
|
+
project_id=project_id,
|
|
1435
|
+
strip_messages=strip_messages,
|
|
1820
1436
|
request_options=request_options,
|
|
1821
|
-
omit=OMIT,
|
|
1822
1437
|
)
|
|
1823
|
-
|
|
1824
|
-
if 200 <= _response.status_code < 300:
|
|
1825
|
-
return typing.cast(
|
|
1826
|
-
AgentState,
|
|
1827
|
-
construct_type(
|
|
1828
|
-
type_=AgentState, # type: ignore
|
|
1829
|
-
object_=_response.json(),
|
|
1830
|
-
),
|
|
1831
|
-
)
|
|
1832
|
-
if _response.status_code == 422:
|
|
1833
|
-
raise UnprocessableEntityError(
|
|
1834
|
-
typing.cast(
|
|
1835
|
-
HttpValidationError,
|
|
1836
|
-
construct_type(
|
|
1837
|
-
type_=HttpValidationError, # type: ignore
|
|
1838
|
-
object_=_response.json(),
|
|
1839
|
-
),
|
|
1840
|
-
)
|
|
1841
|
-
)
|
|
1842
|
-
_response_json = _response.json()
|
|
1843
|
-
except JSONDecodeError:
|
|
1844
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
1845
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
1438
|
+
return _response.data
|
|
1846
1439
|
|
|
1847
1440
|
async def retrieve(
|
|
1848
1441
|
self,
|
|
@@ -1889,37 +1482,10 @@ class AsyncAgentsClient:
|
|
|
1889
1482
|
|
|
1890
1483
|
asyncio.run(main())
|
|
1891
1484
|
"""
|
|
1892
|
-
_response = await self.
|
|
1893
|
-
|
|
1894
|
-
method="GET",
|
|
1895
|
-
params={
|
|
1896
|
-
"include_relationships": include_relationships,
|
|
1897
|
-
},
|
|
1898
|
-
request_options=request_options,
|
|
1485
|
+
_response = await self._raw_client.retrieve(
|
|
1486
|
+
agent_id, include_relationships=include_relationships, request_options=request_options
|
|
1899
1487
|
)
|
|
1900
|
-
|
|
1901
|
-
if 200 <= _response.status_code < 300:
|
|
1902
|
-
return typing.cast(
|
|
1903
|
-
AgentState,
|
|
1904
|
-
construct_type(
|
|
1905
|
-
type_=AgentState, # type: ignore
|
|
1906
|
-
object_=_response.json(),
|
|
1907
|
-
),
|
|
1908
|
-
)
|
|
1909
|
-
if _response.status_code == 422:
|
|
1910
|
-
raise UnprocessableEntityError(
|
|
1911
|
-
typing.cast(
|
|
1912
|
-
HttpValidationError,
|
|
1913
|
-
construct_type(
|
|
1914
|
-
type_=HttpValidationError, # type: ignore
|
|
1915
|
-
object_=_response.json(),
|
|
1916
|
-
),
|
|
1917
|
-
)
|
|
1918
|
-
)
|
|
1919
|
-
_response_json = _response.json()
|
|
1920
|
-
except JSONDecodeError:
|
|
1921
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
1922
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
1488
|
+
return _response.data
|
|
1923
1489
|
|
|
1924
1490
|
async def delete(
|
|
1925
1491
|
self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
@@ -1959,34 +1525,8 @@ class AsyncAgentsClient:
|
|
|
1959
1525
|
|
|
1960
1526
|
asyncio.run(main())
|
|
1961
1527
|
"""
|
|
1962
|
-
_response = await self.
|
|
1963
|
-
|
|
1964
|
-
method="DELETE",
|
|
1965
|
-
request_options=request_options,
|
|
1966
|
-
)
|
|
1967
|
-
try:
|
|
1968
|
-
if 200 <= _response.status_code < 300:
|
|
1969
|
-
return typing.cast(
|
|
1970
|
-
typing.Optional[typing.Any],
|
|
1971
|
-
construct_type(
|
|
1972
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
|
1973
|
-
object_=_response.json(),
|
|
1974
|
-
),
|
|
1975
|
-
)
|
|
1976
|
-
if _response.status_code == 422:
|
|
1977
|
-
raise UnprocessableEntityError(
|
|
1978
|
-
typing.cast(
|
|
1979
|
-
HttpValidationError,
|
|
1980
|
-
construct_type(
|
|
1981
|
-
type_=HttpValidationError, # type: ignore
|
|
1982
|
-
object_=_response.json(),
|
|
1983
|
-
),
|
|
1984
|
-
)
|
|
1985
|
-
)
|
|
1986
|
-
_response_json = _response.json()
|
|
1987
|
-
except JSONDecodeError:
|
|
1988
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
1989
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
1528
|
+
_response = await self._raw_client.delete(agent_id, request_options=request_options)
|
|
1529
|
+
return _response.data
|
|
1990
1530
|
|
|
1991
1531
|
async def modify(
|
|
1992
1532
|
self,
|
|
@@ -2137,75 +1677,38 @@ class AsyncAgentsClient:
|
|
|
2137
1677
|
|
|
2138
1678
|
asyncio.run(main())
|
|
2139
1679
|
"""
|
|
2140
|
-
_response = await self.
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
"embedding": embedding,
|
|
2170
|
-
"enable_sleeptime": enable_sleeptime,
|
|
2171
|
-
"response_format": convert_and_respect_annotation_metadata(
|
|
2172
|
-
object_=response_format, annotation=UpdateAgentResponseFormat, direction="write"
|
|
2173
|
-
),
|
|
2174
|
-
"last_run_completion": last_run_completion,
|
|
2175
|
-
"last_run_duration_ms": last_run_duration_ms,
|
|
2176
|
-
"timezone": timezone,
|
|
2177
|
-
"max_files_open": max_files_open,
|
|
2178
|
-
"per_file_view_window_char_limit": per_file_view_window_char_limit,
|
|
2179
|
-
},
|
|
2180
|
-
headers={
|
|
2181
|
-
"content-type": "application/json",
|
|
2182
|
-
},
|
|
1680
|
+
_response = await self._raw_client.modify(
|
|
1681
|
+
agent_id,
|
|
1682
|
+
name=name,
|
|
1683
|
+
tool_ids=tool_ids,
|
|
1684
|
+
source_ids=source_ids,
|
|
1685
|
+
block_ids=block_ids,
|
|
1686
|
+
tags=tags,
|
|
1687
|
+
system=system,
|
|
1688
|
+
tool_rules=tool_rules,
|
|
1689
|
+
llm_config=llm_config,
|
|
1690
|
+
embedding_config=embedding_config,
|
|
1691
|
+
message_ids=message_ids,
|
|
1692
|
+
description=description,
|
|
1693
|
+
metadata=metadata,
|
|
1694
|
+
tool_exec_environment_variables=tool_exec_environment_variables,
|
|
1695
|
+
project_id=project_id,
|
|
1696
|
+
template_id=template_id,
|
|
1697
|
+
base_template_id=base_template_id,
|
|
1698
|
+
identity_ids=identity_ids,
|
|
1699
|
+
message_buffer_autoclear=message_buffer_autoclear,
|
|
1700
|
+
model=model,
|
|
1701
|
+
embedding=embedding,
|
|
1702
|
+
enable_sleeptime=enable_sleeptime,
|
|
1703
|
+
response_format=response_format,
|
|
1704
|
+
last_run_completion=last_run_completion,
|
|
1705
|
+
last_run_duration_ms=last_run_duration_ms,
|
|
1706
|
+
timezone=timezone,
|
|
1707
|
+
max_files_open=max_files_open,
|
|
1708
|
+
per_file_view_window_char_limit=per_file_view_window_char_limit,
|
|
2183
1709
|
request_options=request_options,
|
|
2184
|
-
omit=OMIT,
|
|
2185
1710
|
)
|
|
2186
|
-
|
|
2187
|
-
if 200 <= _response.status_code < 300:
|
|
2188
|
-
return typing.cast(
|
|
2189
|
-
AgentState,
|
|
2190
|
-
construct_type(
|
|
2191
|
-
type_=AgentState, # type: ignore
|
|
2192
|
-
object_=_response.json(),
|
|
2193
|
-
),
|
|
2194
|
-
)
|
|
2195
|
-
if _response.status_code == 422:
|
|
2196
|
-
raise UnprocessableEntityError(
|
|
2197
|
-
typing.cast(
|
|
2198
|
-
HttpValidationError,
|
|
2199
|
-
construct_type(
|
|
2200
|
-
type_=HttpValidationError, # type: ignore
|
|
2201
|
-
object_=_response.json(),
|
|
2202
|
-
),
|
|
2203
|
-
)
|
|
2204
|
-
)
|
|
2205
|
-
_response_json = _response.json()
|
|
2206
|
-
except JSONDecodeError:
|
|
2207
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
2208
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
1711
|
+
return _response.data
|
|
2209
1712
|
|
|
2210
1713
|
async def summarize_agent_conversation(
|
|
2211
1714
|
self, agent_id: str, *, max_message_length: int, request_options: typing.Optional[RequestOptions] = None
|
|
@@ -2251,31 +1754,10 @@ class AsyncAgentsClient:
|
|
|
2251
1754
|
|
|
2252
1755
|
asyncio.run(main())
|
|
2253
1756
|
"""
|
|
2254
|
-
_response = await self.
|
|
2255
|
-
|
|
2256
|
-
method="POST",
|
|
2257
|
-
params={
|
|
2258
|
-
"max_message_length": max_message_length,
|
|
2259
|
-
},
|
|
2260
|
-
request_options=request_options,
|
|
1757
|
+
_response = await self._raw_client.summarize_agent_conversation(
|
|
1758
|
+
agent_id, max_message_length=max_message_length, request_options=request_options
|
|
2261
1759
|
)
|
|
2262
|
-
|
|
2263
|
-
if 200 <= _response.status_code < 300:
|
|
2264
|
-
return
|
|
2265
|
-
if _response.status_code == 422:
|
|
2266
|
-
raise UnprocessableEntityError(
|
|
2267
|
-
typing.cast(
|
|
2268
|
-
HttpValidationError,
|
|
2269
|
-
construct_type(
|
|
2270
|
-
type_=HttpValidationError, # type: ignore
|
|
2271
|
-
object_=_response.json(),
|
|
2272
|
-
),
|
|
2273
|
-
)
|
|
2274
|
-
)
|
|
2275
|
-
_response_json = _response.json()
|
|
2276
|
-
except JSONDecodeError:
|
|
2277
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
2278
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
1760
|
+
return _response.data
|
|
2279
1761
|
|
|
2280
1762
|
async def search(
|
|
2281
1763
|
self,
|
|
@@ -2336,36 +1818,14 @@ class AsyncAgentsClient:
|
|
|
2336
1818
|
|
|
2337
1819
|
asyncio.run(main())
|
|
2338
1820
|
"""
|
|
2339
|
-
_response = await self.
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
"combinator": combinator,
|
|
2348
|
-
"limit": limit,
|
|
2349
|
-
"after": after,
|
|
2350
|
-
"sortBy": sort_by,
|
|
2351
|
-
"ascending": ascending,
|
|
2352
|
-
},
|
|
2353
|
-
headers={
|
|
2354
|
-
"content-type": "application/json",
|
|
2355
|
-
},
|
|
1821
|
+
_response = await self._raw_client.search(
|
|
1822
|
+
search=search,
|
|
1823
|
+
project_id=project_id,
|
|
1824
|
+
combinator=combinator,
|
|
1825
|
+
limit=limit,
|
|
1826
|
+
after=after,
|
|
1827
|
+
sort_by=sort_by,
|
|
1828
|
+
ascending=ascending,
|
|
2356
1829
|
request_options=request_options,
|
|
2357
|
-
omit=OMIT,
|
|
2358
1830
|
)
|
|
2359
|
-
|
|
2360
|
-
if 200 <= _response.status_code < 300:
|
|
2361
|
-
return typing.cast(
|
|
2362
|
-
AgentsSearchResponse,
|
|
2363
|
-
construct_type(
|
|
2364
|
-
type_=AgentsSearchResponse, # type: ignore
|
|
2365
|
-
object_=_response.json(),
|
|
2366
|
-
),
|
|
2367
|
-
)
|
|
2368
|
-
_response_json = _response.json()
|
|
2369
|
-
except JSONDecodeError:
|
|
2370
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
2371
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
1831
|
+
return _response.data
|