letta-client 0.1.233__py3-none-any.whl → 0.1.235__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 +349 -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 +2088 -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 +14 -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.235.dist-info}/METADATA +24 -3
- letta_client-0.1.235.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.235.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,
|
|
@@ -252,6 +230,7 @@ class AgentsClient:
|
|
|
252
230
|
timezone: typing.Optional[str] = OMIT,
|
|
253
231
|
max_files_open: typing.Optional[int] = OMIT,
|
|
254
232
|
per_file_view_window_char_limit: typing.Optional[int] = OMIT,
|
|
233
|
+
hidden: typing.Optional[bool] = OMIT,
|
|
255
234
|
request_options: typing.Optional[RequestOptions] = None,
|
|
256
235
|
) -> AgentState:
|
|
257
236
|
"""
|
|
@@ -382,6 +361,9 @@ class AgentsClient:
|
|
|
382
361
|
per_file_view_window_char_limit : typing.Optional[int]
|
|
383
362
|
The per-file view window character limit for this agent. Setting this too high may exceed the context window, which will break the agent.
|
|
384
363
|
|
|
364
|
+
hidden : typing.Optional[bool]
|
|
365
|
+
If set to True, the agent will be hidden.
|
|
366
|
+
|
|
385
367
|
request_options : typing.Optional[RequestOptions]
|
|
386
368
|
Request-specific configuration.
|
|
387
369
|
|
|
@@ -400,93 +382,52 @@ class AgentsClient:
|
|
|
400
382
|
)
|
|
401
383
|
client.agents.create()
|
|
402
384
|
"""
|
|
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
|
-
|
|
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
|
-
},
|
|
385
|
+
_response = self._raw_client.create(
|
|
386
|
+
name=name,
|
|
387
|
+
memory_blocks=memory_blocks,
|
|
388
|
+
tools=tools,
|
|
389
|
+
tool_ids=tool_ids,
|
|
390
|
+
source_ids=source_ids,
|
|
391
|
+
block_ids=block_ids,
|
|
392
|
+
tool_rules=tool_rules,
|
|
393
|
+
tags=tags,
|
|
394
|
+
system=system,
|
|
395
|
+
agent_type=agent_type,
|
|
396
|
+
llm_config=llm_config,
|
|
397
|
+
embedding_config=embedding_config,
|
|
398
|
+
initial_message_sequence=initial_message_sequence,
|
|
399
|
+
include_base_tools=include_base_tools,
|
|
400
|
+
include_multi_agent_tools=include_multi_agent_tools,
|
|
401
|
+
include_base_tool_rules=include_base_tool_rules,
|
|
402
|
+
include_default_source=include_default_source,
|
|
403
|
+
description=description,
|
|
404
|
+
metadata=metadata,
|
|
405
|
+
model=model,
|
|
406
|
+
embedding=embedding,
|
|
407
|
+
context_window_limit=context_window_limit,
|
|
408
|
+
embedding_chunk_size=embedding_chunk_size,
|
|
409
|
+
max_tokens=max_tokens,
|
|
410
|
+
max_reasoning_tokens=max_reasoning_tokens,
|
|
411
|
+
enable_reasoner=enable_reasoner,
|
|
412
|
+
from_template=from_template,
|
|
413
|
+
template=template,
|
|
414
|
+
project=project,
|
|
415
|
+
tool_exec_environment_variables=tool_exec_environment_variables,
|
|
416
|
+
memory_variables=memory_variables,
|
|
417
|
+
project_id=project_id,
|
|
418
|
+
template_id=template_id,
|
|
419
|
+
base_template_id=base_template_id,
|
|
420
|
+
identity_ids=identity_ids,
|
|
421
|
+
message_buffer_autoclear=message_buffer_autoclear,
|
|
422
|
+
enable_sleeptime=enable_sleeptime,
|
|
423
|
+
response_format=response_format,
|
|
424
|
+
timezone=timezone,
|
|
425
|
+
max_files_open=max_files_open,
|
|
426
|
+
per_file_view_window_char_limit=per_file_view_window_char_limit,
|
|
427
|
+
hidden=hidden,
|
|
464
428
|
request_options=request_options,
|
|
465
|
-
omit=OMIT,
|
|
466
429
|
)
|
|
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)
|
|
430
|
+
return _response.data
|
|
490
431
|
|
|
491
432
|
def count(self, *, request_options: typing.Optional[RequestOptions] = None) -> int:
|
|
492
433
|
"""
|
|
@@ -512,34 +453,8 @@ class AgentsClient:
|
|
|
512
453
|
)
|
|
513
454
|
client.agents.count()
|
|
514
455
|
"""
|
|
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)
|
|
456
|
+
_response = self._raw_client.count(request_options=request_options)
|
|
457
|
+
return _response.data
|
|
543
458
|
|
|
544
459
|
def export_file(self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> str:
|
|
545
460
|
"""
|
|
@@ -569,34 +484,8 @@ class AgentsClient:
|
|
|
569
484
|
agent_id="agent_id",
|
|
570
485
|
)
|
|
571
486
|
"""
|
|
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)
|
|
487
|
+
_response = self._raw_client.export_file(agent_id, request_options=request_options)
|
|
488
|
+
return _response.data
|
|
600
489
|
|
|
601
490
|
def import_file(
|
|
602
491
|
self,
|
|
@@ -646,45 +535,15 @@ class AgentsClient:
|
|
|
646
535
|
)
|
|
647
536
|
client.agents.import_file()
|
|
648
537
|
"""
|
|
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
|
-
},
|
|
538
|
+
_response = self._raw_client.import_file(
|
|
539
|
+
file=file,
|
|
540
|
+
append_copy_suffix=append_copy_suffix,
|
|
541
|
+
override_existing_tools=override_existing_tools,
|
|
542
|
+
project_id=project_id,
|
|
543
|
+
strip_messages=strip_messages,
|
|
662
544
|
request_options=request_options,
|
|
663
|
-
omit=OMIT,
|
|
664
545
|
)
|
|
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)
|
|
546
|
+
return _response.data
|
|
688
547
|
|
|
689
548
|
def retrieve(
|
|
690
549
|
self,
|
|
@@ -723,37 +582,10 @@ class AgentsClient:
|
|
|
723
582
|
agent_id="agent_id",
|
|
724
583
|
)
|
|
725
584
|
"""
|
|
726
|
-
_response = self.
|
|
727
|
-
|
|
728
|
-
method="GET",
|
|
729
|
-
params={
|
|
730
|
-
"include_relationships": include_relationships,
|
|
731
|
-
},
|
|
732
|
-
request_options=request_options,
|
|
585
|
+
_response = self._raw_client.retrieve(
|
|
586
|
+
agent_id, include_relationships=include_relationships, request_options=request_options
|
|
733
587
|
)
|
|
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)
|
|
588
|
+
return _response.data
|
|
757
589
|
|
|
758
590
|
def delete(
|
|
759
591
|
self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
@@ -785,34 +617,8 @@ class AgentsClient:
|
|
|
785
617
|
agent_id="agent_id",
|
|
786
618
|
)
|
|
787
619
|
"""
|
|
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)
|
|
620
|
+
_response = self._raw_client.delete(agent_id, request_options=request_options)
|
|
621
|
+
return _response.data
|
|
816
622
|
|
|
817
623
|
def modify(
|
|
818
624
|
self,
|
|
@@ -845,6 +651,7 @@ class AgentsClient:
|
|
|
845
651
|
timezone: typing.Optional[str] = OMIT,
|
|
846
652
|
max_files_open: typing.Optional[int] = OMIT,
|
|
847
653
|
per_file_view_window_char_limit: typing.Optional[int] = OMIT,
|
|
654
|
+
hidden: typing.Optional[bool] = OMIT,
|
|
848
655
|
request_options: typing.Optional[RequestOptions] = None,
|
|
849
656
|
) -> AgentState:
|
|
850
657
|
"""
|
|
@@ -935,6 +742,9 @@ class AgentsClient:
|
|
|
935
742
|
per_file_view_window_char_limit : typing.Optional[int]
|
|
936
743
|
The per-file view window character limit for this agent. Setting this too high may exceed the context window, which will break the agent.
|
|
937
744
|
|
|
745
|
+
hidden : typing.Optional[bool]
|
|
746
|
+
If set to True, the agent will be hidden.
|
|
747
|
+
|
|
938
748
|
request_options : typing.Optional[RequestOptions]
|
|
939
749
|
Request-specific configuration.
|
|
940
750
|
|
|
@@ -955,75 +765,39 @@ class AgentsClient:
|
|
|
955
765
|
agent_id="agent_id",
|
|
956
766
|
)
|
|
957
767
|
"""
|
|
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
|
-
|
|
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
|
-
},
|
|
768
|
+
_response = self._raw_client.modify(
|
|
769
|
+
agent_id,
|
|
770
|
+
name=name,
|
|
771
|
+
tool_ids=tool_ids,
|
|
772
|
+
source_ids=source_ids,
|
|
773
|
+
block_ids=block_ids,
|
|
774
|
+
tags=tags,
|
|
775
|
+
system=system,
|
|
776
|
+
tool_rules=tool_rules,
|
|
777
|
+
llm_config=llm_config,
|
|
778
|
+
embedding_config=embedding_config,
|
|
779
|
+
message_ids=message_ids,
|
|
780
|
+
description=description,
|
|
781
|
+
metadata=metadata,
|
|
782
|
+
tool_exec_environment_variables=tool_exec_environment_variables,
|
|
783
|
+
project_id=project_id,
|
|
784
|
+
template_id=template_id,
|
|
785
|
+
base_template_id=base_template_id,
|
|
786
|
+
identity_ids=identity_ids,
|
|
787
|
+
message_buffer_autoclear=message_buffer_autoclear,
|
|
788
|
+
model=model,
|
|
789
|
+
embedding=embedding,
|
|
790
|
+
enable_sleeptime=enable_sleeptime,
|
|
791
|
+
response_format=response_format,
|
|
792
|
+
last_run_completion=last_run_completion,
|
|
793
|
+
last_run_duration_ms=last_run_duration_ms,
|
|
794
|
+
timezone=timezone,
|
|
795
|
+
max_files_open=max_files_open,
|
|
796
|
+
per_file_view_window_char_limit=per_file_view_window_char_limit,
|
|
797
|
+
hidden=hidden,
|
|
1001
798
|
request_options=request_options,
|
|
1002
|
-
omit=OMIT,
|
|
1003
799
|
)
|
|
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)
|
|
800
|
+
return _response.data
|
|
1027
801
|
|
|
1028
802
|
def summarize_agent_conversation(
|
|
1029
803
|
self, agent_id: str, *, max_message_length: int, request_options: typing.Optional[RequestOptions] = None
|
|
@@ -1061,31 +835,10 @@ class AgentsClient:
|
|
|
1061
835
|
max_message_length=1,
|
|
1062
836
|
)
|
|
1063
837
|
"""
|
|
1064
|
-
_response = self.
|
|
1065
|
-
|
|
1066
|
-
method="POST",
|
|
1067
|
-
params={
|
|
1068
|
-
"max_message_length": max_message_length,
|
|
1069
|
-
},
|
|
1070
|
-
request_options=request_options,
|
|
838
|
+
_response = self._raw_client.summarize_agent_conversation(
|
|
839
|
+
agent_id, max_message_length=max_message_length, request_options=request_options
|
|
1071
840
|
)
|
|
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)
|
|
841
|
+
return _response.data
|
|
1089
842
|
|
|
1090
843
|
def search(
|
|
1091
844
|
self,
|
|
@@ -1138,56 +891,56 @@ class AgentsClient:
|
|
|
1138
891
|
)
|
|
1139
892
|
client.agents.search()
|
|
1140
893
|
"""
|
|
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
|
-
},
|
|
894
|
+
_response = self._raw_client.search(
|
|
895
|
+
search=search,
|
|
896
|
+
project_id=project_id,
|
|
897
|
+
combinator=combinator,
|
|
898
|
+
limit=limit,
|
|
899
|
+
after=after,
|
|
900
|
+
sort_by=sort_by,
|
|
901
|
+
ascending=ascending,
|
|
1158
902
|
request_options=request_options,
|
|
1159
|
-
omit=OMIT,
|
|
1160
903
|
)
|
|
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)
|
|
904
|
+
return _response.data
|
|
1174
905
|
|
|
1175
906
|
|
|
1176
907
|
class AsyncAgentsClient:
|
|
1177
908
|
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
|
-
|
|
909
|
+
self._raw_client = AsyncRawAgentsClient(client_wrapper=client_wrapper)
|
|
910
|
+
self.context = AsyncContextClient(client_wrapper=client_wrapper)
|
|
911
|
+
|
|
912
|
+
self.tools = AsyncToolsClient(client_wrapper=client_wrapper)
|
|
913
|
+
|
|
914
|
+
self.sources = AsyncSourcesClient(client_wrapper=client_wrapper)
|
|
915
|
+
|
|
916
|
+
self.folders = AsyncFoldersClient(client_wrapper=client_wrapper)
|
|
917
|
+
|
|
918
|
+
self.files = AsyncFilesClient(client_wrapper=client_wrapper)
|
|
919
|
+
|
|
920
|
+
self.core_memory = AsyncCoreMemoryClient(client_wrapper=client_wrapper)
|
|
921
|
+
|
|
922
|
+
self.blocks = AsyncBlocksClient(client_wrapper=client_wrapper)
|
|
923
|
+
|
|
924
|
+
self.passages = AsyncPassagesClient(client_wrapper=client_wrapper)
|
|
925
|
+
|
|
926
|
+
self.messages = AsyncMessagesClient(client_wrapper=client_wrapper)
|
|
927
|
+
|
|
928
|
+
self.groups = AsyncGroupsClient(client_wrapper=client_wrapper)
|
|
929
|
+
|
|
930
|
+
self.templates = AsyncTemplatesClient(client_wrapper=client_wrapper)
|
|
931
|
+
|
|
932
|
+
self.memory_variables = AsyncMemoryVariablesClient(client_wrapper=client_wrapper)
|
|
933
|
+
|
|
934
|
+
@property
|
|
935
|
+
def with_raw_response(self) -> AsyncRawAgentsClient:
|
|
936
|
+
"""
|
|
937
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
938
|
+
|
|
939
|
+
Returns
|
|
940
|
+
-------
|
|
941
|
+
AsyncRawAgentsClient
|
|
942
|
+
"""
|
|
943
|
+
return self._raw_client
|
|
1191
944
|
|
|
1192
945
|
async def list(
|
|
1193
946
|
self,
|
|
@@ -1288,51 +1041,25 @@ class AsyncAgentsClient:
|
|
|
1288
1041
|
|
|
1289
1042
|
asyncio.run(main())
|
|
1290
1043
|
"""
|
|
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
|
-
},
|
|
1044
|
+
_response = await self._raw_client.list(
|
|
1045
|
+
name=name,
|
|
1046
|
+
tags=tags,
|
|
1047
|
+
match_all_tags=match_all_tags,
|
|
1048
|
+
before=before,
|
|
1049
|
+
after=after,
|
|
1050
|
+
limit=limit,
|
|
1051
|
+
query_text=query_text,
|
|
1052
|
+
project_id=project_id,
|
|
1053
|
+
template_id=template_id,
|
|
1054
|
+
base_template_id=base_template_id,
|
|
1055
|
+
identity_id=identity_id,
|
|
1056
|
+
identifier_keys=identifier_keys,
|
|
1057
|
+
include_relationships=include_relationships,
|
|
1058
|
+
ascending=ascending,
|
|
1059
|
+
sort_by=sort_by,
|
|
1311
1060
|
request_options=request_options,
|
|
1312
1061
|
)
|
|
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)
|
|
1062
|
+
return _response.data
|
|
1336
1063
|
|
|
1337
1064
|
async def create(
|
|
1338
1065
|
self,
|
|
@@ -1378,6 +1105,7 @@ class AsyncAgentsClient:
|
|
|
1378
1105
|
timezone: typing.Optional[str] = OMIT,
|
|
1379
1106
|
max_files_open: typing.Optional[int] = OMIT,
|
|
1380
1107
|
per_file_view_window_char_limit: typing.Optional[int] = OMIT,
|
|
1108
|
+
hidden: typing.Optional[bool] = OMIT,
|
|
1381
1109
|
request_options: typing.Optional[RequestOptions] = None,
|
|
1382
1110
|
) -> AgentState:
|
|
1383
1111
|
"""
|
|
@@ -1508,6 +1236,9 @@ class AsyncAgentsClient:
|
|
|
1508
1236
|
per_file_view_window_char_limit : typing.Optional[int]
|
|
1509
1237
|
The per-file view window character limit for this agent. Setting this too high may exceed the context window, which will break the agent.
|
|
1510
1238
|
|
|
1239
|
+
hidden : typing.Optional[bool]
|
|
1240
|
+
If set to True, the agent will be hidden.
|
|
1241
|
+
|
|
1511
1242
|
request_options : typing.Optional[RequestOptions]
|
|
1512
1243
|
Request-specific configuration.
|
|
1513
1244
|
|
|
@@ -1534,93 +1265,52 @@ class AsyncAgentsClient:
|
|
|
1534
1265
|
|
|
1535
1266
|
asyncio.run(main())
|
|
1536
1267
|
"""
|
|
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
|
-
|
|
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
|
-
},
|
|
1268
|
+
_response = await self._raw_client.create(
|
|
1269
|
+
name=name,
|
|
1270
|
+
memory_blocks=memory_blocks,
|
|
1271
|
+
tools=tools,
|
|
1272
|
+
tool_ids=tool_ids,
|
|
1273
|
+
source_ids=source_ids,
|
|
1274
|
+
block_ids=block_ids,
|
|
1275
|
+
tool_rules=tool_rules,
|
|
1276
|
+
tags=tags,
|
|
1277
|
+
system=system,
|
|
1278
|
+
agent_type=agent_type,
|
|
1279
|
+
llm_config=llm_config,
|
|
1280
|
+
embedding_config=embedding_config,
|
|
1281
|
+
initial_message_sequence=initial_message_sequence,
|
|
1282
|
+
include_base_tools=include_base_tools,
|
|
1283
|
+
include_multi_agent_tools=include_multi_agent_tools,
|
|
1284
|
+
include_base_tool_rules=include_base_tool_rules,
|
|
1285
|
+
include_default_source=include_default_source,
|
|
1286
|
+
description=description,
|
|
1287
|
+
metadata=metadata,
|
|
1288
|
+
model=model,
|
|
1289
|
+
embedding=embedding,
|
|
1290
|
+
context_window_limit=context_window_limit,
|
|
1291
|
+
embedding_chunk_size=embedding_chunk_size,
|
|
1292
|
+
max_tokens=max_tokens,
|
|
1293
|
+
max_reasoning_tokens=max_reasoning_tokens,
|
|
1294
|
+
enable_reasoner=enable_reasoner,
|
|
1295
|
+
from_template=from_template,
|
|
1296
|
+
template=template,
|
|
1297
|
+
project=project,
|
|
1298
|
+
tool_exec_environment_variables=tool_exec_environment_variables,
|
|
1299
|
+
memory_variables=memory_variables,
|
|
1300
|
+
project_id=project_id,
|
|
1301
|
+
template_id=template_id,
|
|
1302
|
+
base_template_id=base_template_id,
|
|
1303
|
+
identity_ids=identity_ids,
|
|
1304
|
+
message_buffer_autoclear=message_buffer_autoclear,
|
|
1305
|
+
enable_sleeptime=enable_sleeptime,
|
|
1306
|
+
response_format=response_format,
|
|
1307
|
+
timezone=timezone,
|
|
1308
|
+
max_files_open=max_files_open,
|
|
1309
|
+
per_file_view_window_char_limit=per_file_view_window_char_limit,
|
|
1310
|
+
hidden=hidden,
|
|
1598
1311
|
request_options=request_options,
|
|
1599
|
-
omit=OMIT,
|
|
1600
1312
|
)
|
|
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)
|
|
1313
|
+
return _response.data
|
|
1624
1314
|
|
|
1625
1315
|
async def count(self, *, request_options: typing.Optional[RequestOptions] = None) -> int:
|
|
1626
1316
|
"""
|
|
@@ -1654,34 +1344,8 @@ class AsyncAgentsClient:
|
|
|
1654
1344
|
|
|
1655
1345
|
asyncio.run(main())
|
|
1656
1346
|
"""
|
|
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)
|
|
1347
|
+
_response = await self._raw_client.count(request_options=request_options)
|
|
1348
|
+
return _response.data
|
|
1685
1349
|
|
|
1686
1350
|
async def export_file(self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> str:
|
|
1687
1351
|
"""
|
|
@@ -1719,34 +1383,8 @@ class AsyncAgentsClient:
|
|
|
1719
1383
|
|
|
1720
1384
|
asyncio.run(main())
|
|
1721
1385
|
"""
|
|
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)
|
|
1386
|
+
_response = await self._raw_client.export_file(agent_id, request_options=request_options)
|
|
1387
|
+
return _response.data
|
|
1750
1388
|
|
|
1751
1389
|
async def import_file(
|
|
1752
1390
|
self,
|
|
@@ -1804,45 +1442,15 @@ class AsyncAgentsClient:
|
|
|
1804
1442
|
|
|
1805
1443
|
asyncio.run(main())
|
|
1806
1444
|
"""
|
|
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
|
-
},
|
|
1445
|
+
_response = await self._raw_client.import_file(
|
|
1446
|
+
file=file,
|
|
1447
|
+
append_copy_suffix=append_copy_suffix,
|
|
1448
|
+
override_existing_tools=override_existing_tools,
|
|
1449
|
+
project_id=project_id,
|
|
1450
|
+
strip_messages=strip_messages,
|
|
1820
1451
|
request_options=request_options,
|
|
1821
|
-
omit=OMIT,
|
|
1822
1452
|
)
|
|
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)
|
|
1453
|
+
return _response.data
|
|
1846
1454
|
|
|
1847
1455
|
async def retrieve(
|
|
1848
1456
|
self,
|
|
@@ -1889,37 +1497,10 @@ class AsyncAgentsClient:
|
|
|
1889
1497
|
|
|
1890
1498
|
asyncio.run(main())
|
|
1891
1499
|
"""
|
|
1892
|
-
_response = await self.
|
|
1893
|
-
|
|
1894
|
-
method="GET",
|
|
1895
|
-
params={
|
|
1896
|
-
"include_relationships": include_relationships,
|
|
1897
|
-
},
|
|
1898
|
-
request_options=request_options,
|
|
1500
|
+
_response = await self._raw_client.retrieve(
|
|
1501
|
+
agent_id, include_relationships=include_relationships, request_options=request_options
|
|
1899
1502
|
)
|
|
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)
|
|
1503
|
+
return _response.data
|
|
1923
1504
|
|
|
1924
1505
|
async def delete(
|
|
1925
1506
|
self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
@@ -1959,34 +1540,8 @@ class AsyncAgentsClient:
|
|
|
1959
1540
|
|
|
1960
1541
|
asyncio.run(main())
|
|
1961
1542
|
"""
|
|
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)
|
|
1543
|
+
_response = await self._raw_client.delete(agent_id, request_options=request_options)
|
|
1544
|
+
return _response.data
|
|
1990
1545
|
|
|
1991
1546
|
async def modify(
|
|
1992
1547
|
self,
|
|
@@ -2019,6 +1574,7 @@ class AsyncAgentsClient:
|
|
|
2019
1574
|
timezone: typing.Optional[str] = OMIT,
|
|
2020
1575
|
max_files_open: typing.Optional[int] = OMIT,
|
|
2021
1576
|
per_file_view_window_char_limit: typing.Optional[int] = OMIT,
|
|
1577
|
+
hidden: typing.Optional[bool] = OMIT,
|
|
2022
1578
|
request_options: typing.Optional[RequestOptions] = None,
|
|
2023
1579
|
) -> AgentState:
|
|
2024
1580
|
"""
|
|
@@ -2109,6 +1665,9 @@ class AsyncAgentsClient:
|
|
|
2109
1665
|
per_file_view_window_char_limit : typing.Optional[int]
|
|
2110
1666
|
The per-file view window character limit for this agent. Setting this too high may exceed the context window, which will break the agent.
|
|
2111
1667
|
|
|
1668
|
+
hidden : typing.Optional[bool]
|
|
1669
|
+
If set to True, the agent will be hidden.
|
|
1670
|
+
|
|
2112
1671
|
request_options : typing.Optional[RequestOptions]
|
|
2113
1672
|
Request-specific configuration.
|
|
2114
1673
|
|
|
@@ -2137,75 +1696,39 @@ class AsyncAgentsClient:
|
|
|
2137
1696
|
|
|
2138
1697
|
asyncio.run(main())
|
|
2139
1698
|
"""
|
|
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
|
-
|
|
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
|
-
},
|
|
1699
|
+
_response = await self._raw_client.modify(
|
|
1700
|
+
agent_id,
|
|
1701
|
+
name=name,
|
|
1702
|
+
tool_ids=tool_ids,
|
|
1703
|
+
source_ids=source_ids,
|
|
1704
|
+
block_ids=block_ids,
|
|
1705
|
+
tags=tags,
|
|
1706
|
+
system=system,
|
|
1707
|
+
tool_rules=tool_rules,
|
|
1708
|
+
llm_config=llm_config,
|
|
1709
|
+
embedding_config=embedding_config,
|
|
1710
|
+
message_ids=message_ids,
|
|
1711
|
+
description=description,
|
|
1712
|
+
metadata=metadata,
|
|
1713
|
+
tool_exec_environment_variables=tool_exec_environment_variables,
|
|
1714
|
+
project_id=project_id,
|
|
1715
|
+
template_id=template_id,
|
|
1716
|
+
base_template_id=base_template_id,
|
|
1717
|
+
identity_ids=identity_ids,
|
|
1718
|
+
message_buffer_autoclear=message_buffer_autoclear,
|
|
1719
|
+
model=model,
|
|
1720
|
+
embedding=embedding,
|
|
1721
|
+
enable_sleeptime=enable_sleeptime,
|
|
1722
|
+
response_format=response_format,
|
|
1723
|
+
last_run_completion=last_run_completion,
|
|
1724
|
+
last_run_duration_ms=last_run_duration_ms,
|
|
1725
|
+
timezone=timezone,
|
|
1726
|
+
max_files_open=max_files_open,
|
|
1727
|
+
per_file_view_window_char_limit=per_file_view_window_char_limit,
|
|
1728
|
+
hidden=hidden,
|
|
2183
1729
|
request_options=request_options,
|
|
2184
|
-
omit=OMIT,
|
|
2185
1730
|
)
|
|
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)
|
|
1731
|
+
return _response.data
|
|
2209
1732
|
|
|
2210
1733
|
async def summarize_agent_conversation(
|
|
2211
1734
|
self, agent_id: str, *, max_message_length: int, request_options: typing.Optional[RequestOptions] = None
|
|
@@ -2251,31 +1774,10 @@ class AsyncAgentsClient:
|
|
|
2251
1774
|
|
|
2252
1775
|
asyncio.run(main())
|
|
2253
1776
|
"""
|
|
2254
|
-
_response = await self.
|
|
2255
|
-
|
|
2256
|
-
method="POST",
|
|
2257
|
-
params={
|
|
2258
|
-
"max_message_length": max_message_length,
|
|
2259
|
-
},
|
|
2260
|
-
request_options=request_options,
|
|
1777
|
+
_response = await self._raw_client.summarize_agent_conversation(
|
|
1778
|
+
agent_id, max_message_length=max_message_length, request_options=request_options
|
|
2261
1779
|
)
|
|
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)
|
|
1780
|
+
return _response.data
|
|
2279
1781
|
|
|
2280
1782
|
async def search(
|
|
2281
1783
|
self,
|
|
@@ -2336,36 +1838,14 @@ class AsyncAgentsClient:
|
|
|
2336
1838
|
|
|
2337
1839
|
asyncio.run(main())
|
|
2338
1840
|
"""
|
|
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
|
-
},
|
|
1841
|
+
_response = await self._raw_client.search(
|
|
1842
|
+
search=search,
|
|
1843
|
+
project_id=project_id,
|
|
1844
|
+
combinator=combinator,
|
|
1845
|
+
limit=limit,
|
|
1846
|
+
after=after,
|
|
1847
|
+
sort_by=sort_by,
|
|
1848
|
+
ascending=ascending,
|
|
2356
1849
|
request_options=request_options,
|
|
2357
|
-
omit=OMIT,
|
|
2358
1850
|
)
|
|
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)
|
|
1851
|
+
return _response.data
|