letta-client 1.0.0a6__py3-none-any.whl → 1.0.0a7__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of letta-client might be problematic. Click here for more details.
- {letta_sdk → letta_client}/__init__.py +8 -8
- {letta_sdk → letta_client}/_base_client.py +1 -1
- {letta_sdk → letta_client}/_client.py +124 -171
- {letta_sdk → letta_client}/_exceptions.py +2 -2
- {letta_sdk → letta_client}/_resource.py +5 -5
- {letta_sdk → letta_client}/_response.py +8 -6
- {letta_sdk → letta_client}/_streaming.py +3 -3
- {letta_sdk → letta_client}/_types.py +1 -1
- {letta_sdk → letta_client}/_utils/_logs.py +3 -3
- {letta_sdk → letta_client}/_utils/_resources_proxy.py +4 -4
- {letta_sdk → letta_client}/_version.py +2 -2
- {letta_sdk → letta_client}/resources/__init__.py +14 -154
- {letta_sdk → letta_client}/resources/agents/__init__.py +28 -42
- {letta_sdk → letta_client}/resources/agents/agents.py +216 -734
- {letta_sdk/resources/agents/core_memory → letta_client/resources/agents}/blocks.py +103 -12
- {letta_sdk → letta_client}/resources/agents/files.py +71 -8
- {letta_sdk → letta_client}/resources/agents/folders.py +90 -3
- letta_client/resources/agents/groups.py +242 -0
- {letta_sdk → letta_client}/resources/agents/messages.py +252 -480
- {letta_sdk → letta_client}/resources/agents/tools.py +135 -22
- letta_sdk/resources/jobs.py → letta_client/resources/archives.py +268 -280
- {letta_sdk/resources/messages → letta_client/resources/batches}/batches.py +35 -152
- letta_client/resources/batches/messages.py +238 -0
- {letta_sdk/resources/agents/core_memory → letta_client/resources/blocks}/__init__.py +14 -14
- letta_client/resources/blocks/agents.py +284 -0
- {letta_sdk/resources → letta_client/resources/blocks}/blocks.py +54 -167
- letta_client/resources/folders/__init__.py +47 -0
- letta_client/resources/folders/agents.py +234 -0
- letta_client/resources/folders/files.py +469 -0
- letta_sdk/resources/providers.py → letta_client/resources/folders/folders.py +292 -309
- {letta_sdk → letta_client}/resources/groups/groups.py +12 -78
- {letta_sdk → letta_client}/resources/groups/messages.py +165 -27
- letta_client/resources/identities/__init__.py +61 -0
- letta_client/resources/identities/agents.py +266 -0
- letta_client/resources/identities/blocks.py +234 -0
- {letta_sdk/resources → letta_client/resources/identities}/identities.py +267 -525
- letta_client/resources/identities/properties.py +174 -0
- letta_client/resources/models/__init__.py +33 -0
- {letta_sdk/resources → letta_client/resources/models}/embeddings.py +26 -49
- {letta_sdk/resources → letta_client/resources/models}/models.py +42 -117
- letta_client/resources/runs/__init__.py +61 -0
- letta_sdk/resources/archives.py → letta_client/resources/runs/messages.py +182 -153
- letta_client/resources/runs/runs.py +460 -0
- letta_sdk/resources/projects.py → letta_client/resources/runs/steps.py +93 -56
- letta_sdk/resources/voice_beta/chat.py → letta_client/resources/runs/usage.py +50 -57
- letta_client/resources/steps/__init__.py +75 -0
- letta_client/resources/steps/feedback.py +198 -0
- letta_client/resources/steps/messages.py +234 -0
- letta_client/resources/steps/metrics.py +167 -0
- letta_client/resources/steps/steps.py +511 -0
- letta_sdk/resources/telemetry.py → letta_client/resources/steps/trace.py +45 -56
- letta_client/resources/templates/__init__.py +33 -0
- letta_client/resources/templates/agents.py +236 -0
- letta_client/resources/templates/templates.py +102 -0
- {letta_sdk/resources/tools → letta_client/resources}/tools.py +239 -425
- letta_client/types/__init__.py +120 -0
- {letta_sdk → letta_client}/types/agent_create_params.py +5 -2
- {letta_sdk → letta_client}/types/agent_environment_variable.py +3 -0
- letta_client/types/agent_export_file_params.py +18 -0
- letta_sdk/types/agent_export_response.py → letta_client/types/agent_export_file_response.py +2 -2
- letta_sdk/types/agent_import_params.py → letta_client/types/agent_import_file_params.py +5 -2
- letta_sdk/types/agent_import_response.py → letta_client/types/agent_import_file_response.py +2 -2
- {letta_sdk → letta_client}/types/agent_list_params.py +19 -2
- {letta_sdk → letta_client}/types/agent_retrieve_params.py +20 -3
- {letta_sdk → letta_client}/types/agent_state.py +131 -3
- {letta_sdk → letta_client}/types/agent_type.py +1 -0
- {letta_sdk → letta_client}/types/agent_update_params.py +12 -0
- {letta_sdk → letta_client}/types/agents/__init__.py +12 -19
- letta_client/types/agents/approval_create_param.py +44 -0
- {letta_sdk → letta_client}/types/agents/approval_request_message.py +10 -2
- letta_client/types/agents/approval_response_message.py +63 -0
- {letta_sdk/types/agents/core_memory → letta_client/types/agents}/block.py +1 -1
- letta_sdk/types/identity_list_blocks_params.py → letta_client/types/agents/block_list_params.py +2 -2
- {letta_sdk/types/agents/core_memory → letta_client/types/agents}/block_update_params.py +1 -0
- letta_client/types/agents/file_list_params.py +40 -0
- letta_client/types/agents/folder_list_params.py +34 -0
- letta_sdk/types/source.py → letta_client/types/agents/folder_list_response.py +10 -6
- letta_client/types/agents/group_list_params.py +37 -0
- letta_client/types/agents/group_list_response.py +10 -0
- {letta_sdk → letta_client}/types/agents/letta_assistant_message_content_union.py +3 -0
- {letta_sdk → letta_client}/types/agents/letta_assistant_message_content_union_param.py +4 -0
- {letta_sdk → letta_client}/types/agents/letta_response.py +0 -4
- {letta_sdk → letta_client}/types/agents/message.py +93 -2
- {letta_sdk → letta_client}/types/agents/message_list_params.py +20 -5
- letta_sdk/types/agent_reset_messages_params.py → letta_client/types/agents/message_reset_params.py +2 -2
- {letta_sdk → letta_client}/types/agents/message_send_async_params.py +12 -3
- {letta_sdk → letta_client}/types/agents/message_send_params.py +12 -3
- letta_sdk/types/agents/message_send_stream_params.py → letta_client/types/agents/message_stream_params.py +14 -5
- {letta_sdk → letta_client}/types/agents/message_update_params.py +4 -0
- {letta_sdk → letta_client}/types/agents/omitted_reasoning_content.py +3 -0
- {letta_sdk → letta_client}/types/agents/omitted_reasoning_content_param.py +4 -0
- {letta_sdk → letta_client}/types/agents/run.py +16 -19
- {letta_sdk → letta_client}/types/agents/text_content.py +3 -0
- {letta_sdk → letta_client}/types/agents/text_content_param.py +4 -0
- {letta_sdk → letta_client}/types/agents/tool_call_content.py +3 -0
- {letta_sdk → letta_client}/types/agents/tool_call_content_param.py +4 -1
- {letta_sdk → letta_client}/types/agents/tool_call_message.py +6 -2
- letta_client/types/agents/tool_list_params.py +34 -0
- {letta_sdk → letta_client}/types/agents/tool_return.py +7 -3
- letta_client/types/agents/tool_return_param.py +25 -0
- letta_client/types/agents/tool_update_approval_params.py +21 -0
- {letta_sdk → letta_client}/types/archive.py +4 -0
- letta_client/types/archive_create_params.py +19 -0
- letta_sdk/types/archive_retrieve_params.py → letta_client/types/archive_list_params.py +2 -2
- letta_sdk/types/archive_retrieve_response.py → letta_client/types/archive_list_response.py +2 -2
- {letta_sdk → letta_client}/types/archive_update_params.py +3 -3
- {letta_sdk/types/messages → letta_client/types}/batch_create_params.py +15 -6
- letta_sdk/types/job.py → letta_client/types/batch_job.py +8 -3
- letta_client/types/batches/__init__.py +6 -0
- letta_sdk/types/messages/batch_list_messages_params.py → letta_client/types/batches/message_list_params.py +2 -2
- letta_sdk/types/messages/batch_list_messages_response.py → letta_client/types/batches/message_list_response.py +2 -2
- {letta_sdk → letta_client}/types/block_list_response.py +1 -1
- letta_client/types/blocks/__init__.py +6 -0
- letta_sdk/types/block_list_agents_params.py → letta_client/types/blocks/agent_list_params.py +22 -5
- letta_sdk/types/agent_list_groups_response.py → letta_client/types/blocks/agent_list_response.py +3 -3
- letta_client/types/child_tool_rule.py +40 -0
- letta_client/types/child_tool_rule_param.py +42 -0
- letta_client/types/folders/__init__.py +10 -0
- letta_sdk/types/folder_list_agents_params.py → letta_client/types/folders/agent_list_params.py +2 -2
- letta_sdk/types/run_list_active_response.py → letta_client/types/folders/agent_list_response.py +2 -4
- letta_sdk/types/folder_list_files_params.py → letta_client/types/folders/file_list_params.py +2 -2
- letta_client/types/folders/file_list_response.py +68 -0
- letta_sdk/types/source_upload_file_params.py → letta_client/types/folders/file_upload_params.py +5 -6
- letta_sdk/types/file_metadata.py → letta_client/types/folders/file_upload_response.py +5 -5
- {letta_sdk → letta_client}/types/groups/__init__.py +1 -1
- {letta_sdk → letta_client}/types/groups/message_send_params.py +12 -3
- letta_sdk/types/groups/message_send_stream_params.py → letta_client/types/groups/message_stream_params.py +14 -5
- {letta_sdk → letta_client}/types/groups/message_update_params.py +4 -0
- letta_sdk/types/health_check_response.py → letta_client/types/health_response.py +2 -2
- letta_client/types/identities/__init__.py +9 -0
- letta_sdk/types/identity_list_agents_params.py → letta_client/types/identities/agent_list_params.py +19 -3
- letta_client/types/identities/agent_list_response.py +10 -0
- letta_client/types/identities/block_list_params.py +34 -0
- letta_sdk/types/agents/folder_list_response.py → letta_client/types/identities/block_list_response.py +3 -3
- letta_sdk/types/identity_upsert_properties_params.py → letta_client/types/identities/property_upsert_params.py +3 -3
- letta_sdk/types/identity_modify_params.py → letta_client/types/identity_update_params.py +2 -2
- {letta_sdk → letta_client}/types/init_tool_rule.py +10 -1
- {letta_sdk → letta_client}/types/init_tool_rule_param.py +10 -1
- {letta_sdk → letta_client}/types/llm_config.py +6 -0
- {letta_sdk → letta_client}/types/llm_config_param.py +6 -0
- {letta_sdk/types/voice_beta → letta_client/types/models}/__init__.py +1 -1
- letta_sdk/types/agents/archival_memory_create_response.py → letta_client/types/models/embedding_list_response.py +3 -3
- {letta_sdk → letta_client}/types/run_list_params.py +29 -5
- letta_client/types/runs/__init__.py +10 -0
- letta_sdk/types/run_list_messages_params.py → letta_client/types/runs/message_list_params.py +5 -2
- letta_client/types/runs/message_list_response.py +10 -0
- letta_sdk/types/run_retrieve_stream_params.py → letta_client/types/runs/message_stream_params.py +2 -2
- letta_sdk/types/run_list_steps_params.py → letta_client/types/runs/step_list_params.py +9 -6
- letta_sdk/types/job_list_response.py → letta_client/types/runs/step_list_response.py +3 -3
- letta_sdk/types/run_retrieve_usage_response.py → letta_client/types/runs/usage_retrieve_response.py +3 -3
- {letta_sdk → letta_client}/types/step.py +6 -6
- letta_client/types/steps/__init__.py +8 -0
- letta_sdk/types/step_update_feedback_params.py → letta_client/types/steps/feedback_create_params.py +3 -3
- letta_sdk/types/step_list_messages_params.py → letta_client/types/steps/message_list_params.py +2 -2
- letta_client/types/steps/message_list_response.py +34 -0
- letta_sdk/types/step_retrieve_metrics_response.py → letta_client/types/steps/metric_retrieve_response.py +6 -6
- {letta_sdk/types/tools → letta_client/types/templates}/__init__.py +2 -0
- letta_sdk/types/template_create_agents_params.py → letta_client/types/templates/agent_create_params.py +4 -4
- {letta_sdk → letta_client}/types/tool.py +6 -0
- {letta_sdk → letta_client}/types/tool_create_params.py +6 -0
- {letta_sdk → letta_client}/types/tool_return_message.py +3 -0
- letta_sdk/types/tool_modify_params.py → letta_client/types/tool_update_params.py +8 -2
- letta_sdk/types/tool_upsert_base_response.py → letta_client/types/tool_upsert_base_tools_response.py +2 -2
- {letta_sdk → letta_client}/types/tool_upsert_params.py +6 -0
- {letta_client-1.0.0a6.dist-info → letta_client-1.0.0a7.dist-info}/METADATA +110 -70
- letta_client-1.0.0a7.dist-info/RECORD +307 -0
- {letta_client-1.0.0a6.dist-info → letta_client-1.0.0a7.dist-info}/licenses/LICENSE +1 -1
- letta_client-1.0.0a6.dist-info/RECORD +0 -420
- letta_sdk/resources/_internal_templates/__init__.py +0 -33
- letta_sdk/resources/_internal_templates/_internal_templates.py +0 -961
- letta_sdk/resources/_internal_templates/deployment.py +0 -268
- letta_sdk/resources/agents/archival_memory.py +0 -581
- letta_sdk/resources/agents/core_memory/core_memory.py +0 -278
- letta_sdk/resources/agents/sources.py +0 -332
- letta_sdk/resources/client_side_access_tokens.py +0 -402
- letta_sdk/resources/folders.py +0 -1562
- letta_sdk/resources/health.py +0 -135
- letta_sdk/resources/messages/messages.py +0 -102
- letta_sdk/resources/runs.py +0 -1016
- letta_sdk/resources/sources/__init__.py +0 -33
- letta_sdk/resources/sources/files.py +0 -341
- letta_sdk/resources/sources/sources.py +0 -1371
- letta_sdk/resources/steps.py +0 -784
- letta_sdk/resources/templates.py +0 -1310
- letta_sdk/resources/tools/__init__.py +0 -47
- letta_sdk/resources/tools/composio/__init__.py +0 -33
- letta_sdk/resources/tools/composio/apps.py +0 -214
- letta_sdk/resources/tools/composio/composio.py +0 -201
- letta_sdk/resources/tools/mcp/__init__.py +0 -47
- letta_sdk/resources/tools/mcp/mcp.py +0 -134
- letta_sdk/resources/tools/mcp/oauth.py +0 -214
- letta_sdk/resources/tools/mcp/servers/__init__.py +0 -33
- letta_sdk/resources/tools/mcp/servers/servers.py +0 -1785
- letta_sdk/resources/tools/mcp/servers/tools.py +0 -263
- letta_sdk/resources/voice_beta/__init__.py +0 -33
- letta_sdk/resources/voice_beta/voice_beta.py +0 -102
- letta_sdk/types/__init__.py +0 -226
- letta_sdk/types/_internal_templates/__init__.py +0 -7
- letta_sdk/types/_internal_templates/deployment_delete_response.py +0 -17
- letta_sdk/types/_internal_templates/deployment_list_entities_params.py +0 -15
- letta_sdk/types/_internal_templates/deployment_list_entities_response.py +0 -31
- letta_sdk/types/agent_export_params.py +0 -17
- letta_sdk/types/agent_list_groups_params.py +0 -13
- letta_sdk/types/agent_migrate_params.py +0 -19
- letta_sdk/types/agent_migrate_response.py +0 -11
- letta_sdk/types/agent_retrieve_context_response.py +0 -110
- letta_sdk/types/agent_search_params.py +0 -78
- letta_sdk/types/agent_search_response.py +0 -16
- letta_sdk/types/agent_summarize_params.py +0 -12
- letta_sdk/types/agents/approval_create_param.py +0 -22
- letta_sdk/types/agents/approval_response_message.py +0 -41
- letta_sdk/types/agents/archival_memory_create_params.py +0 -23
- letta_sdk/types/agents/archival_memory_list_params.py +0 -28
- letta_sdk/types/agents/archival_memory_list_response.py +0 -10
- letta_sdk/types/agents/archival_memory_search_params.py +0 -35
- letta_sdk/types/agents/archival_memory_search_response.py +0 -26
- letta_sdk/types/agents/core_memory/__init__.py +0 -7
- letta_sdk/types/agents/core_memory_retrieve_variables_response.py +0 -11
- letta_sdk/types/agents/file_list_params.py +0 -19
- letta_sdk/types/agents/letta_request_param.py +0 -45
- letta_sdk/types/agents/letta_streaming_request_param.py +0 -60
- letta_sdk/types/agents/memory.py +0 -92
- letta_sdk/types/agents/message_preview_raw_payload_params.py +0 -103
- letta_sdk/types/agents/message_preview_raw_payload_response.py +0 -8
- letta_sdk/types/agents/message_search_params.py +0 -38
- letta_sdk/types/agents/message_search_response.py +0 -29
- letta_sdk/types/agents/source_list_response.py +0 -10
- letta_sdk/types/agents/tool_modify_approval_params.py +0 -13
- letta_sdk/types/block_list_agents_response.py +0 -10
- letta_sdk/types/child_tool_rule.py +0 -21
- letta_sdk/types/child_tool_rule_param.py +0 -23
- letta_sdk/types/client_side_access_token_create_params.py +0 -32
- letta_sdk/types/client_side_access_token_create_response.py +0 -34
- letta_sdk/types/client_side_access_token_delete_params.py +0 -11
- letta_sdk/types/client_side_access_token_list_params.py +0 -23
- letta_sdk/types/client_side_access_token_list_response.py +0 -40
- letta_sdk/types/duplicate_file_handling.py +0 -7
- letta_sdk/types/embedding_get_total_storage_size_response.py +0 -7
- letta_sdk/types/file_processing_status.py +0 -7
- letta_sdk/types/folder_get_by_name_response.py +0 -7
- letta_sdk/types/folder_list_agents_response.py +0 -8
- letta_sdk/types/folder_list_files_response.py +0 -10
- letta_sdk/types/folder_list_passages_params.py +0 -34
- letta_sdk/types/folder_list_passages_response.py +0 -10
- letta_sdk/types/folder_retrieve_metadata_params.py +0 -11
- letta_sdk/types/folder_upload_file_params.py +0 -21
- letta_sdk/types/identity_list_agents_response.py +0 -10
- letta_sdk/types/identity_list_blocks_response.py +0 -10
- letta_sdk/types/internal_template_create_agent_params.py +0 -217
- letta_sdk/types/internal_template_create_block_params.py +0 -54
- letta_sdk/types/internal_template_create_group_params.py +0 -49
- letta_sdk/types/job_list_active_params.py +0 -28
- letta_sdk/types/job_list_active_response.py +0 -10
- letta_sdk/types/job_list_params.py +0 -31
- letta_sdk/types/messages/__init__.py +0 -10
- letta_sdk/types/messages/batch_job.py +0 -60
- letta_sdk/types/model_list_embedding_response.py +0 -10
- letta_sdk/types/organization_sources_stats.py +0 -49
- letta_sdk/types/passage.py +0 -56
- letta_sdk/types/project_list_params.py +0 -16
- letta_sdk/types/project_list_response.py +0 -23
- letta_sdk/types/provider.py +0 -42
- letta_sdk/types/provider_check_params.py +0 -30
- letta_sdk/types/provider_create_params.py +0 -33
- letta_sdk/types/provider_list_params.py +0 -42
- letta_sdk/types/provider_list_response.py +0 -10
- letta_sdk/types/provider_update_params.py +0 -25
- letta_sdk/types/run_list_active_params.py +0 -18
- letta_sdk/types/run_list_messages_response.py +0 -10
- letta_sdk/types/run_list_steps_response.py +0 -10
- letta_sdk/types/source_count_response.py +0 -7
- letta_sdk/types/source_create_params.py +0 -33
- letta_sdk/types/source_get_agents_response.py +0 -8
- letta_sdk/types/source_get_by_name_response.py +0 -7
- letta_sdk/types/source_get_metadata_params.py +0 -11
- letta_sdk/types/source_list_passages_params.py +0 -19
- letta_sdk/types/source_list_passages_response.py +0 -10
- letta_sdk/types/source_list_response.py +0 -10
- letta_sdk/types/source_update_params.py +0 -27
- letta_sdk/types/sources/__init__.py +0 -7
- letta_sdk/types/sources/file_list_params.py +0 -26
- letta_sdk/types/sources/file_list_response.py +0 -10
- letta_sdk/types/sources/file_retrieve_params.py +0 -14
- letta_sdk/types/step_list_messages_response.py +0 -34
- letta_sdk/types/template_create_agents_response.py +0 -12
- letta_sdk/types/template_create_params.py +0 -40
- letta_sdk/types/template_create_response.py +0 -29
- letta_sdk/types/template_delete_response.py +0 -9
- letta_sdk/types/template_fork_params.py +0 -17
- letta_sdk/types/template_fork_response.py +0 -29
- letta_sdk/types/template_get_snapshot_response.py +0 -258
- letta_sdk/types/template_list_params.py +0 -34
- letta_sdk/types/template_list_response.py +0 -35
- letta_sdk/types/template_list_versions_params.py +0 -16
- letta_sdk/types/template_list_versions_response.py +0 -29
- letta_sdk/types/template_rename_params.py +0 -14
- letta_sdk/types/template_rename_response.py +0 -9
- letta_sdk/types/template_save_version_params.py +0 -32
- letta_sdk/types/template_save_version_response.py +0 -29
- letta_sdk/types/template_update_description_params.py +0 -14
- letta_sdk/types/template_update_description_response.py +0 -9
- letta_sdk/types/tool_run_params.py +0 -43
- letta_sdk/types/tools/composio/__init__.py +0 -6
- letta_sdk/types/tools/composio/app_list_actions_response.py +0 -70
- letta_sdk/types/tools/composio/app_list_response.py +0 -103
- letta_sdk/types/tools/mcp/__init__.py +0 -21
- letta_sdk/types/tools/mcp/mcp_server_type.py +0 -7
- letta_sdk/types/tools/mcp/oauth_callback_params.py +0 -22
- letta_sdk/types/tools/mcp/server_add_params.py +0 -68
- letta_sdk/types/tools/mcp/server_add_response.py +0 -14
- letta_sdk/types/tools/mcp/server_connect_params.py +0 -68
- letta_sdk/types/tools/mcp/server_delete_response.py +0 -14
- letta_sdk/types/tools/mcp/server_list_response.py +0 -14
- letta_sdk/types/tools/mcp/server_resync_params.py +0 -12
- letta_sdk/types/tools/mcp/server_test_params.py +0 -68
- letta_sdk/types/tools/mcp/server_update_params.py +0 -43
- letta_sdk/types/tools/mcp/server_update_response.py +0 -12
- letta_sdk/types/tools/mcp/servers/__init__.py +0 -6
- letta_sdk/types/tools/mcp/servers/tool_execute_params.py +0 -15
- letta_sdk/types/tools/mcp/servers/tool_list_response.py +0 -85
- letta_sdk/types/tools/mcp/sse_server_config.py +0 -27
- letta_sdk/types/tools/mcp/sse_server_config_param.py +0 -29
- letta_sdk/types/tools/mcp/stdio_server_config.py +0 -24
- letta_sdk/types/tools/mcp/stdio_server_config_param.py +0 -27
- letta_sdk/types/tools/mcp/streamable_http_server_config.py +0 -27
- letta_sdk/types/tools/mcp/streamable_http_server_config_param.py +0 -29
- letta_sdk/types/voice_beta/chat_create_completion_params.py +0 -12
- {letta_sdk → letta_client}/_compat.py +0 -0
- {letta_sdk → letta_client}/_constants.py +0 -0
- {letta_sdk → letta_client}/_files.py +0 -0
- {letta_sdk → letta_client}/_models.py +0 -0
- {letta_sdk → letta_client}/_qs.py +0 -0
- {letta_sdk → letta_client}/_utils/__init__.py +0 -0
- {letta_sdk → letta_client}/_utils/_compat.py +0 -0
- {letta_sdk → letta_client}/_utils/_datetime_parse.py +0 -0
- {letta_sdk → letta_client}/_utils/_proxy.py +0 -0
- {letta_sdk → letta_client}/_utils/_reflection.py +0 -0
- {letta_sdk → letta_client}/_utils/_streams.py +0 -0
- {letta_sdk → letta_client}/_utils/_sync.py +0 -0
- {letta_sdk → letta_client}/_utils/_transform.py +0 -0
- {letta_sdk → letta_client}/_utils/_typing.py +0 -0
- {letta_sdk → letta_client}/_utils/_utils.py +0 -0
- {letta_sdk → letta_client}/lib/.keep +0 -0
- {letta_sdk → letta_client}/py.typed +0 -0
- {letta_sdk/resources/messages → letta_client/resources/batches}/__init__.py +6 -6
- {letta_sdk → letta_client}/resources/groups/__init__.py +0 -0
- {letta_sdk → letta_client}/resources/tags.py +0 -0
- {letta_sdk → letta_client}/types/agent_count_response.py +0 -0
- {letta_sdk → letta_client}/types/agent_list_response.py +0 -0
- {letta_sdk → letta_client}/types/agents/assistant_message.py +0 -0
- {letta_sdk/types/agents/core_memory → letta_client/types/agents}/block_list_response.py +0 -0
- {letta_sdk → letta_client}/types/agents/file_close_all_response.py +0 -0
- {letta_sdk → letta_client}/types/agents/file_list_response.py +0 -0
- {letta_sdk → letta_client}/types/agents/file_open_response.py +0 -0
- {letta_sdk → letta_client}/types/agents/hidden_reasoning_message.py +0 -0
- {letta_sdk → letta_client}/types/agents/image_content.py +0 -0
- {letta_sdk → letta_client}/types/agents/image_content_param.py +0 -0
- {letta_sdk → letta_client}/types/agents/job_status.py +0 -0
- {letta_sdk → letta_client}/types/agents/job_type.py +0 -0
- {letta_sdk → letta_client}/types/agents/letta_message_union.py +0 -0
- {letta_sdk → letta_client}/types/agents/letta_user_message_content_union.py +0 -0
- {letta_sdk → letta_client}/types/agents/letta_user_message_content_union_param.py +0 -0
- {letta_sdk → letta_client}/types/agents/message_cancel_params.py +0 -0
- {letta_sdk → letta_client}/types/agents/message_cancel_response.py +0 -0
- {letta_sdk → letta_client}/types/agents/message_list_response.py +0 -0
- {letta_sdk → letta_client}/types/agents/message_role.py +0 -0
- {letta_sdk → letta_client}/types/agents/message_type.py +0 -0
- {letta_sdk → letta_client}/types/agents/message_update_response.py +0 -0
- {letta_sdk → letta_client}/types/agents/reasoning_content.py +0 -0
- {letta_sdk → letta_client}/types/agents/reasoning_content_param.py +0 -0
- {letta_sdk → letta_client}/types/agents/reasoning_message.py +0 -0
- {letta_sdk → letta_client}/types/agents/redacted_reasoning_content.py +0 -0
- {letta_sdk → letta_client}/types/agents/redacted_reasoning_content_param.py +0 -0
- {letta_sdk → letta_client}/types/agents/system_message.py +0 -0
- {letta_sdk → letta_client}/types/agents/tool_call.py +0 -0
- {letta_sdk → letta_client}/types/agents/tool_call_delta.py +0 -0
- {letta_sdk → letta_client}/types/agents/tool_list_response.py +0 -0
- {letta_sdk → letta_client}/types/agents/tool_return_content.py +0 -0
- {letta_sdk → letta_client}/types/agents/tool_return_content_param.py +0 -0
- {letta_sdk → letta_client}/types/agents/update_assistant_message_param.py +0 -0
- {letta_sdk → letta_client}/types/agents/update_reasoning_message_param.py +0 -0
- {letta_sdk → letta_client}/types/agents/update_system_message_param.py +0 -0
- {letta_sdk → letta_client}/types/agents/update_user_message_param.py +0 -0
- {letta_sdk → letta_client}/types/agents/user_message.py +0 -0
- {letta_sdk/types/messages → letta_client/types}/batch_list_params.py +0 -0
- {letta_sdk/types/messages → letta_client/types}/batch_list_response.py +0 -0
- {letta_sdk → letta_client}/types/block_count_response.py +0 -0
- {letta_sdk → letta_client}/types/block_create_params.py +0 -0
- {letta_sdk → letta_client}/types/block_list_params.py +0 -0
- {letta_sdk → letta_client}/types/block_update_params.py +0 -0
- {letta_sdk → letta_client}/types/conditional_tool_rule.py +0 -0
- {letta_sdk → letta_client}/types/conditional_tool_rule_param.py +0 -0
- {letta_sdk → letta_client}/types/continue_tool_rule.py +0 -0
- {letta_sdk → letta_client}/types/continue_tool_rule_param.py +0 -0
- {letta_sdk → letta_client}/types/create_block_param.py +0 -0
- {letta_sdk → letta_client}/types/dynamic_manager_param.py +0 -0
- {letta_sdk → letta_client}/types/embedding_config.py +0 -0
- {letta_sdk → letta_client}/types/embedding_config_param.py +0 -0
- {letta_sdk → letta_client}/types/folder.py +0 -0
- {letta_sdk → letta_client}/types/folder_count_response.py +0 -0
- {letta_sdk → letta_client}/types/folder_create_params.py +0 -0
- {letta_sdk → letta_client}/types/folder_list_params.py +0 -0
- {letta_sdk → letta_client}/types/folder_list_response.py +0 -0
- {letta_sdk → letta_client}/types/folder_update_params.py +0 -0
- {letta_sdk → letta_client}/types/group.py +0 -0
- {letta_sdk → letta_client}/types/group_count_response.py +0 -0
- {letta_sdk → letta_client}/types/group_create_params.py +0 -0
- {letta_sdk → letta_client}/types/group_list_params.py +0 -0
- {letta_sdk → letta_client}/types/group_list_response.py +0 -0
- {letta_sdk → letta_client}/types/group_update_params.py +0 -0
- {letta_sdk → letta_client}/types/groups/message_list_params.py +0 -0
- {letta_sdk → letta_client}/types/groups/message_list_response.py +0 -0
- {letta_sdk → letta_client}/types/groups/message_update_response.py +0 -0
- {letta_sdk → letta_client}/types/identity.py +0 -0
- {letta_sdk → letta_client}/types/identity_count_response.py +0 -0
- {letta_sdk → letta_client}/types/identity_create_params.py +0 -0
- {letta_sdk → letta_client}/types/identity_list_params.py +0 -0
- {letta_sdk → letta_client}/types/identity_list_response.py +0 -0
- {letta_sdk → letta_client}/types/identity_property.py +0 -0
- {letta_sdk → letta_client}/types/identity_property_param.py +0 -0
- {letta_sdk → letta_client}/types/identity_type.py +0 -0
- {letta_sdk → letta_client}/types/identity_upsert_params.py +0 -0
- {letta_sdk → letta_client}/types/json_object_response_format.py +0 -0
- {letta_sdk → letta_client}/types/json_object_response_format_param.py +0 -0
- {letta_sdk → letta_client}/types/json_schema_response_format.py +0 -0
- {letta_sdk → letta_client}/types/json_schema_response_format_param.py +0 -0
- {letta_sdk → letta_client}/types/letta_message_content_union_param.py +0 -0
- {letta_sdk → letta_client}/types/manager_type.py +0 -0
- {letta_sdk → letta_client}/types/max_count_per_step_tool_rule.py +0 -0
- {letta_sdk → letta_client}/types/max_count_per_step_tool_rule_param.py +0 -0
- {letta_sdk → letta_client}/types/message_create_param.py +0 -0
- {letta_sdk → letta_client}/types/model_list_params.py +0 -0
- {letta_sdk → letta_client}/types/model_list_response.py +0 -0
- {letta_sdk → letta_client}/types/npm_requirement.py +0 -0
- {letta_sdk → letta_client}/types/npm_requirement_param.py +0 -0
- {letta_sdk → letta_client}/types/parent_tool_rule.py +0 -0
- {letta_sdk → letta_client}/types/parent_tool_rule_param.py +0 -0
- {letta_sdk → letta_client}/types/pip_requirement.py +0 -0
- {letta_sdk → letta_client}/types/pip_requirement_param.py +0 -0
- {letta_sdk → letta_client}/types/provider_category.py +0 -0
- {letta_sdk → letta_client}/types/provider_trace.py +0 -0
- {letta_sdk → letta_client}/types/provider_type.py +0 -0
- {letta_sdk → letta_client}/types/required_before_exit_tool_rule.py +0 -0
- {letta_sdk → letta_client}/types/required_before_exit_tool_rule_param.py +0 -0
- {letta_sdk → letta_client}/types/requires_approval_tool_rule.py +0 -0
- {letta_sdk → letta_client}/types/requires_approval_tool_rule_param.py +0 -0
- {letta_sdk → letta_client}/types/round_robin_manager_param.py +0 -0
- {letta_sdk → letta_client}/types/run_list_response.py +0 -0
- {letta_sdk → letta_client}/types/sleeptime_manager_param.py +0 -0
- {letta_sdk → letta_client}/types/step_list_params.py +0 -0
- {letta_sdk → letta_client}/types/step_list_response.py +0 -0
- {letta_sdk → letta_client}/types/stop_reason_type.py +0 -0
- {letta_sdk → letta_client}/types/supervisor_manager_param.py +0 -0
- {letta_sdk → letta_client}/types/tag_list_params.py +0 -0
- {letta_sdk → letta_client}/types/tag_list_response.py +0 -0
- {letta_sdk → letta_client}/types/terminal_tool_rule.py +0 -0
- {letta_sdk → letta_client}/types/terminal_tool_rule_param.py +0 -0
- {letta_sdk → letta_client}/types/text_response_format.py +0 -0
- {letta_sdk → letta_client}/types/text_response_format_param.py +0 -0
- {letta_sdk → letta_client}/types/tool_count_params.py +0 -0
- {letta_sdk → letta_client}/types/tool_count_response.py +0 -0
- {letta_sdk → letta_client}/types/tool_list_params.py +0 -0
- {letta_sdk → letta_client}/types/tool_list_response.py +0 -0
- {letta_sdk → letta_client}/types/tool_type.py +1 -1
- {letta_sdk → letta_client}/types/vector_db_provider.py +0 -0
- {letta_sdk → letta_client}/types/voice_sleeptime_manager_param.py +0 -0
- {letta_client-1.0.0a6.dist-info → letta_client-1.0.0a7.dist-info}/WHEEL +0 -0
|
@@ -7,61 +7,29 @@ from typing_extensions import Literal
|
|
|
7
7
|
|
|
8
8
|
import httpx
|
|
9
9
|
|
|
10
|
-
from
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
tool_upsert_params,
|
|
17
|
-
)
|
|
18
|
-
from .mcp.mcp import (
|
|
19
|
-
McpResource,
|
|
20
|
-
AsyncMcpResource,
|
|
21
|
-
McpResourceWithRawResponse,
|
|
22
|
-
AsyncMcpResourceWithRawResponse,
|
|
23
|
-
McpResourceWithStreamingResponse,
|
|
24
|
-
AsyncMcpResourceWithStreamingResponse,
|
|
25
|
-
)
|
|
26
|
-
from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
|
|
27
|
-
from ..._utils import maybe_transform, async_maybe_transform
|
|
28
|
-
from ..._compat import cached_property
|
|
29
|
-
from ..._resource import SyncAPIResource, AsyncAPIResource
|
|
30
|
-
from ..._response import (
|
|
10
|
+
from ..types import tool_list_params, tool_count_params, tool_create_params, tool_update_params, tool_upsert_params
|
|
11
|
+
from .._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
|
|
12
|
+
from .._utils import maybe_transform, async_maybe_transform
|
|
13
|
+
from .._compat import cached_property
|
|
14
|
+
from .._resource import SyncAPIResource, AsyncAPIResource
|
|
15
|
+
from .._response import (
|
|
31
16
|
to_raw_response_wrapper,
|
|
32
17
|
to_streamed_response_wrapper,
|
|
33
18
|
async_to_raw_response_wrapper,
|
|
34
19
|
async_to_streamed_response_wrapper,
|
|
35
20
|
)
|
|
36
|
-
from
|
|
37
|
-
from
|
|
38
|
-
from .
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
ComposioResourceWithStreamingResponse,
|
|
44
|
-
AsyncComposioResourceWithStreamingResponse,
|
|
45
|
-
)
|
|
46
|
-
from ...types.tool_list_response import ToolListResponse
|
|
47
|
-
from ...types.tool_count_response import ToolCountResponse
|
|
48
|
-
from ...types.tool_return_message import ToolReturnMessage
|
|
49
|
-
from ...types.npm_requirement_param import NpmRequirementParam
|
|
50
|
-
from ...types.pip_requirement_param import PipRequirementParam
|
|
51
|
-
from ...types.tool_upsert_base_response import ToolUpsertBaseResponse
|
|
21
|
+
from ..types.tool import Tool
|
|
22
|
+
from .._base_client import make_request_options
|
|
23
|
+
from ..types.tool_list_response import ToolListResponse
|
|
24
|
+
from ..types.tool_count_response import ToolCountResponse
|
|
25
|
+
from ..types.npm_requirement_param import NpmRequirementParam
|
|
26
|
+
from ..types.pip_requirement_param import PipRequirementParam
|
|
27
|
+
from ..types.tool_upsert_base_tools_response import ToolUpsertBaseToolsResponse
|
|
52
28
|
|
|
53
29
|
__all__ = ["ToolsResource", "AsyncToolsResource"]
|
|
54
30
|
|
|
55
31
|
|
|
56
32
|
class ToolsResource(SyncAPIResource):
|
|
57
|
-
@cached_property
|
|
58
|
-
def composio(self) -> ComposioResource:
|
|
59
|
-
return ComposioResource(self._client)
|
|
60
|
-
|
|
61
|
-
@cached_property
|
|
62
|
-
def mcp(self) -> McpResource:
|
|
63
|
-
return McpResource(self._client)
|
|
64
|
-
|
|
65
33
|
@cached_property
|
|
66
34
|
def with_raw_response(self) -> ToolsResourceWithRawResponse:
|
|
67
35
|
"""
|
|
@@ -88,6 +56,7 @@ class ToolsResource(SyncAPIResource):
|
|
|
88
56
|
args_json_schema: Optional[Dict[str, object]] | Omit = omit,
|
|
89
57
|
default_requires_approval: Optional[bool] | Omit = omit,
|
|
90
58
|
description: Optional[str] | Omit = omit,
|
|
59
|
+
enable_parallel_execution: Optional[bool] | Omit = omit,
|
|
91
60
|
json_schema: Optional[Dict[str, object]] | Omit = omit,
|
|
92
61
|
npm_requirements: Optional[Iterable[NpmRequirementParam]] | Omit = omit,
|
|
93
62
|
pip_requirements: Optional[Iterable[PipRequirementParam]] | Omit = omit,
|
|
@@ -113,6 +82,9 @@ class ToolsResource(SyncAPIResource):
|
|
|
113
82
|
|
|
114
83
|
description: The description of the tool.
|
|
115
84
|
|
|
85
|
+
enable_parallel_execution: If set to True, then this tool will potentially be executed concurrently with
|
|
86
|
+
other tools. Default False.
|
|
87
|
+
|
|
116
88
|
json_schema: The JSON schema of the function (auto-generated from source_code if not
|
|
117
89
|
provided)
|
|
118
90
|
|
|
@@ -142,6 +114,7 @@ class ToolsResource(SyncAPIResource):
|
|
|
142
114
|
"args_json_schema": args_json_schema,
|
|
143
115
|
"default_requires_approval": default_requires_approval,
|
|
144
116
|
"description": description,
|
|
117
|
+
"enable_parallel_execution": enable_parallel_execution,
|
|
145
118
|
"json_schema": json_schema,
|
|
146
119
|
"npm_requirements": npm_requirements,
|
|
147
120
|
"pip_requirements": pip_requirements,
|
|
@@ -172,6 +145,8 @@ class ToolsResource(SyncAPIResource):
|
|
|
172
145
|
Get a tool by ID
|
|
173
146
|
|
|
174
147
|
Args:
|
|
148
|
+
tool_id: The ID of the tool in the format 'tool-<uuid4>'
|
|
149
|
+
|
|
175
150
|
extra_headers: Send extra headers
|
|
176
151
|
|
|
177
152
|
extra_query: Add additional query parameters to the request
|
|
@@ -190,6 +165,96 @@ class ToolsResource(SyncAPIResource):
|
|
|
190
165
|
cast_to=Tool,
|
|
191
166
|
)
|
|
192
167
|
|
|
168
|
+
def update(
|
|
169
|
+
self,
|
|
170
|
+
tool_id: str,
|
|
171
|
+
*,
|
|
172
|
+
args_json_schema: Optional[Dict[str, object]] | Omit = omit,
|
|
173
|
+
default_requires_approval: Optional[bool] | Omit = omit,
|
|
174
|
+
description: Optional[str] | Omit = omit,
|
|
175
|
+
enable_parallel_execution: Optional[bool] | Omit = omit,
|
|
176
|
+
json_schema: Optional[Dict[str, object]] | Omit = omit,
|
|
177
|
+
metadata: Optional[Dict[str, object]] | Omit = omit,
|
|
178
|
+
npm_requirements: Optional[Iterable[NpmRequirementParam]] | Omit = omit,
|
|
179
|
+
pip_requirements: Optional[Iterable[PipRequirementParam]] | Omit = omit,
|
|
180
|
+
return_char_limit: Optional[int] | Omit = omit,
|
|
181
|
+
source_code: Optional[str] | Omit = omit,
|
|
182
|
+
source_type: Optional[str] | Omit = omit,
|
|
183
|
+
tags: Optional[SequenceNotStr[str]] | Omit = omit,
|
|
184
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
185
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
186
|
+
extra_headers: Headers | None = None,
|
|
187
|
+
extra_query: Query | None = None,
|
|
188
|
+
extra_body: Body | None = None,
|
|
189
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
190
|
+
) -> Tool:
|
|
191
|
+
"""
|
|
192
|
+
Update an existing tool
|
|
193
|
+
|
|
194
|
+
Args:
|
|
195
|
+
tool_id: The ID of the tool in the format 'tool-<uuid4>'
|
|
196
|
+
|
|
197
|
+
args_json_schema: The args JSON schema of the function.
|
|
198
|
+
|
|
199
|
+
default_requires_approval: Whether or not to require approval before executing this tool.
|
|
200
|
+
|
|
201
|
+
description: The description of the tool.
|
|
202
|
+
|
|
203
|
+
enable_parallel_execution: If set to True, then this tool will potentially be executed concurrently with
|
|
204
|
+
other tools. Default False.
|
|
205
|
+
|
|
206
|
+
json_schema: The JSON schema of the function (auto-generated from source_code if not
|
|
207
|
+
provided)
|
|
208
|
+
|
|
209
|
+
metadata: A dictionary of additional metadata for the tool.
|
|
210
|
+
|
|
211
|
+
npm_requirements: Optional list of npm packages required by this tool.
|
|
212
|
+
|
|
213
|
+
pip_requirements: Optional list of pip packages required by this tool.
|
|
214
|
+
|
|
215
|
+
return_char_limit: The maximum number of characters in the response.
|
|
216
|
+
|
|
217
|
+
source_code: The source code of the function.
|
|
218
|
+
|
|
219
|
+
source_type: The type of the source code.
|
|
220
|
+
|
|
221
|
+
tags: Metadata tags.
|
|
222
|
+
|
|
223
|
+
extra_headers: Send extra headers
|
|
224
|
+
|
|
225
|
+
extra_query: Add additional query parameters to the request
|
|
226
|
+
|
|
227
|
+
extra_body: Add additional JSON properties to the request
|
|
228
|
+
|
|
229
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
230
|
+
"""
|
|
231
|
+
if not tool_id:
|
|
232
|
+
raise ValueError(f"Expected a non-empty value for `tool_id` but received {tool_id!r}")
|
|
233
|
+
return self._patch(
|
|
234
|
+
f"/v1/tools/{tool_id}",
|
|
235
|
+
body=maybe_transform(
|
|
236
|
+
{
|
|
237
|
+
"args_json_schema": args_json_schema,
|
|
238
|
+
"default_requires_approval": default_requires_approval,
|
|
239
|
+
"description": description,
|
|
240
|
+
"enable_parallel_execution": enable_parallel_execution,
|
|
241
|
+
"json_schema": json_schema,
|
|
242
|
+
"metadata": metadata,
|
|
243
|
+
"npm_requirements": npm_requirements,
|
|
244
|
+
"pip_requirements": pip_requirements,
|
|
245
|
+
"return_char_limit": return_char_limit,
|
|
246
|
+
"source_code": source_code,
|
|
247
|
+
"source_type": source_type,
|
|
248
|
+
"tags": tags,
|
|
249
|
+
},
|
|
250
|
+
tool_update_params.ToolUpdateParams,
|
|
251
|
+
),
|
|
252
|
+
options=make_request_options(
|
|
253
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
254
|
+
),
|
|
255
|
+
cast_to=Tool,
|
|
256
|
+
)
|
|
257
|
+
|
|
193
258
|
def list(
|
|
194
259
|
self,
|
|
195
260
|
*,
|
|
@@ -294,6 +359,8 @@ class ToolsResource(SyncAPIResource):
|
|
|
294
359
|
Delete a tool by name
|
|
295
360
|
|
|
296
361
|
Args:
|
|
362
|
+
tool_id: The ID of the tool in the format 'tool-<uuid4>'
|
|
363
|
+
|
|
297
364
|
extra_headers: Send extra headers
|
|
298
365
|
|
|
299
366
|
extra_query: Add additional query parameters to the request
|
|
@@ -380,20 +447,19 @@ class ToolsResource(SyncAPIResource):
|
|
|
380
447
|
cast_to=int,
|
|
381
448
|
)
|
|
382
449
|
|
|
383
|
-
def
|
|
450
|
+
def upsert(
|
|
384
451
|
self,
|
|
385
|
-
tool_id: str,
|
|
386
452
|
*,
|
|
453
|
+
source_code: str,
|
|
387
454
|
args_json_schema: Optional[Dict[str, object]] | Omit = omit,
|
|
388
455
|
default_requires_approval: Optional[bool] | Omit = omit,
|
|
389
456
|
description: Optional[str] | Omit = omit,
|
|
457
|
+
enable_parallel_execution: Optional[bool] | Omit = omit,
|
|
390
458
|
json_schema: Optional[Dict[str, object]] | Omit = omit,
|
|
391
|
-
metadata: Optional[Dict[str, object]] | Omit = omit,
|
|
392
459
|
npm_requirements: Optional[Iterable[NpmRequirementParam]] | Omit = omit,
|
|
393
460
|
pip_requirements: Optional[Iterable[PipRequirementParam]] | Omit = omit,
|
|
394
|
-
return_char_limit:
|
|
395
|
-
|
|
396
|
-
source_type: Optional[str] | Omit = omit,
|
|
461
|
+
return_char_limit: int | Omit = omit,
|
|
462
|
+
source_type: str | Omit = omit,
|
|
397
463
|
tags: Optional[SequenceNotStr[str]] | Omit = omit,
|
|
398
464
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
399
465
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -403,29 +469,30 @@ class ToolsResource(SyncAPIResource):
|
|
|
403
469
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
404
470
|
) -> Tool:
|
|
405
471
|
"""
|
|
406
|
-
|
|
472
|
+
Create or update a tool
|
|
407
473
|
|
|
408
474
|
Args:
|
|
475
|
+
source_code: The source code of the function.
|
|
476
|
+
|
|
409
477
|
args_json_schema: The args JSON schema of the function.
|
|
410
478
|
|
|
411
479
|
default_requires_approval: Whether or not to require approval before executing this tool.
|
|
412
480
|
|
|
413
481
|
description: The description of the tool.
|
|
414
482
|
|
|
483
|
+
enable_parallel_execution: If set to True, then this tool will potentially be executed concurrently with
|
|
484
|
+
other tools. Default False.
|
|
485
|
+
|
|
415
486
|
json_schema: The JSON schema of the function (auto-generated from source_code if not
|
|
416
487
|
provided)
|
|
417
488
|
|
|
418
|
-
metadata: A dictionary of additional metadata for the tool.
|
|
419
|
-
|
|
420
489
|
npm_requirements: Optional list of npm packages required by this tool.
|
|
421
490
|
|
|
422
491
|
pip_requirements: Optional list of pip packages required by this tool.
|
|
423
492
|
|
|
424
493
|
return_char_limit: The maximum number of characters in the response.
|
|
425
494
|
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
source_type: The type of the source code.
|
|
495
|
+
source_type: The source type of the function.
|
|
429
496
|
|
|
430
497
|
tags: Metadata tags.
|
|
431
498
|
|
|
@@ -437,25 +504,23 @@ class ToolsResource(SyncAPIResource):
|
|
|
437
504
|
|
|
438
505
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
439
506
|
"""
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
return self._patch(
|
|
443
|
-
f"/v1/tools/{tool_id}",
|
|
507
|
+
return self._put(
|
|
508
|
+
"/v1/tools/",
|
|
444
509
|
body=maybe_transform(
|
|
445
510
|
{
|
|
511
|
+
"source_code": source_code,
|
|
446
512
|
"args_json_schema": args_json_schema,
|
|
447
513
|
"default_requires_approval": default_requires_approval,
|
|
448
514
|
"description": description,
|
|
515
|
+
"enable_parallel_execution": enable_parallel_execution,
|
|
449
516
|
"json_schema": json_schema,
|
|
450
|
-
"metadata": metadata,
|
|
451
517
|
"npm_requirements": npm_requirements,
|
|
452
518
|
"pip_requirements": pip_requirements,
|
|
453
519
|
"return_char_limit": return_char_limit,
|
|
454
|
-
"source_code": source_code,
|
|
455
520
|
"source_type": source_type,
|
|
456
521
|
"tags": tags,
|
|
457
522
|
},
|
|
458
|
-
|
|
523
|
+
tool_upsert_params.ToolUpsertParams,
|
|
459
524
|
),
|
|
460
525
|
options=make_request_options(
|
|
461
526
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
@@ -463,85 +528,54 @@ class ToolsResource(SyncAPIResource):
|
|
|
463
528
|
cast_to=Tool,
|
|
464
529
|
)
|
|
465
530
|
|
|
466
|
-
def
|
|
531
|
+
def upsert_base_tools(
|
|
467
532
|
self,
|
|
468
533
|
*,
|
|
469
|
-
args: Dict[str, object],
|
|
470
|
-
source_code: str,
|
|
471
|
-
args_json_schema: Optional[Dict[str, object]] | Omit = omit,
|
|
472
|
-
env_vars: Dict[str, str] | Omit = omit,
|
|
473
|
-
json_schema: Optional[Dict[str, object]] | Omit = omit,
|
|
474
|
-
name: Optional[str] | Omit = omit,
|
|
475
|
-
npm_requirements: Optional[Iterable[NpmRequirementParam]] | Omit = omit,
|
|
476
|
-
pip_requirements: Optional[Iterable[PipRequirementParam]] | Omit = omit,
|
|
477
|
-
source_type: Optional[str] | Omit = omit,
|
|
478
534
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
479
535
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
480
536
|
extra_headers: Headers | None = None,
|
|
481
537
|
extra_query: Query | None = None,
|
|
482
538
|
extra_body: Body | None = None,
|
|
483
539
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
484
|
-
) ->
|
|
485
|
-
"""
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
args_json_schema: The args JSON schema of the function.
|
|
494
|
-
|
|
495
|
-
env_vars: The environment variables to pass to the tool.
|
|
496
|
-
|
|
497
|
-
json_schema: The JSON schema of the function (auto-generated from source_code if not
|
|
498
|
-
provided)
|
|
499
|
-
|
|
500
|
-
name: The name of the tool to run.
|
|
501
|
-
|
|
502
|
-
npm_requirements: Optional list of npm packages required by this tool.
|
|
503
|
-
|
|
504
|
-
pip_requirements: Optional list of pip packages required by this tool.
|
|
540
|
+
) -> ToolUpsertBaseToolsResponse:
|
|
541
|
+
"""Upsert base tools"""
|
|
542
|
+
return self._post(
|
|
543
|
+
"/v1/tools/add-base-tools",
|
|
544
|
+
options=make_request_options(
|
|
545
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
546
|
+
),
|
|
547
|
+
cast_to=ToolUpsertBaseToolsResponse,
|
|
548
|
+
)
|
|
505
549
|
|
|
506
|
-
source_type: The type of the source code.
|
|
507
550
|
|
|
508
|
-
|
|
551
|
+
class AsyncToolsResource(AsyncAPIResource):
|
|
552
|
+
@cached_property
|
|
553
|
+
def with_raw_response(self) -> AsyncToolsResourceWithRawResponse:
|
|
554
|
+
"""
|
|
555
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
556
|
+
the raw response object instead of the parsed content.
|
|
509
557
|
|
|
510
|
-
|
|
558
|
+
For more information, see https://www.github.com/letta-ai/letta-python#accessing-raw-response-data-eg-headers
|
|
559
|
+
"""
|
|
560
|
+
return AsyncToolsResourceWithRawResponse(self)
|
|
511
561
|
|
|
512
|
-
|
|
562
|
+
@cached_property
|
|
563
|
+
def with_streaming_response(self) -> AsyncToolsResourceWithStreamingResponse:
|
|
564
|
+
"""
|
|
565
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
513
566
|
|
|
514
|
-
|
|
567
|
+
For more information, see https://www.github.com/letta-ai/letta-python#with_streaming_response
|
|
515
568
|
"""
|
|
516
|
-
return self
|
|
517
|
-
"/v1/tools/run",
|
|
518
|
-
body=maybe_transform(
|
|
519
|
-
{
|
|
520
|
-
"args": args,
|
|
521
|
-
"source_code": source_code,
|
|
522
|
-
"args_json_schema": args_json_schema,
|
|
523
|
-
"env_vars": env_vars,
|
|
524
|
-
"json_schema": json_schema,
|
|
525
|
-
"name": name,
|
|
526
|
-
"npm_requirements": npm_requirements,
|
|
527
|
-
"pip_requirements": pip_requirements,
|
|
528
|
-
"source_type": source_type,
|
|
529
|
-
},
|
|
530
|
-
tool_run_params.ToolRunParams,
|
|
531
|
-
),
|
|
532
|
-
options=make_request_options(
|
|
533
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
534
|
-
),
|
|
535
|
-
cast_to=ToolReturnMessage,
|
|
536
|
-
)
|
|
569
|
+
return AsyncToolsResourceWithStreamingResponse(self)
|
|
537
570
|
|
|
538
|
-
def
|
|
571
|
+
async def create(
|
|
539
572
|
self,
|
|
540
573
|
*,
|
|
541
574
|
source_code: str,
|
|
542
575
|
args_json_schema: Optional[Dict[str, object]] | Omit = omit,
|
|
543
576
|
default_requires_approval: Optional[bool] | Omit = omit,
|
|
544
577
|
description: Optional[str] | Omit = omit,
|
|
578
|
+
enable_parallel_execution: Optional[bool] | Omit = omit,
|
|
545
579
|
json_schema: Optional[Dict[str, object]] | Omit = omit,
|
|
546
580
|
npm_requirements: Optional[Iterable[NpmRequirementParam]] | Omit = omit,
|
|
547
581
|
pip_requirements: Optional[Iterable[PipRequirementParam]] | Omit = omit,
|
|
@@ -556,7 +590,7 @@ class ToolsResource(SyncAPIResource):
|
|
|
556
590
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
557
591
|
) -> Tool:
|
|
558
592
|
"""
|
|
559
|
-
Create
|
|
593
|
+
Create a new tool
|
|
560
594
|
|
|
561
595
|
Args:
|
|
562
596
|
source_code: The source code of the function.
|
|
@@ -567,6 +601,9 @@ class ToolsResource(SyncAPIResource):
|
|
|
567
601
|
|
|
568
602
|
description: The description of the tool.
|
|
569
603
|
|
|
604
|
+
enable_parallel_execution: If set to True, then this tool will potentially be executed concurrently with
|
|
605
|
+
other tools. Default False.
|
|
606
|
+
|
|
570
607
|
json_schema: The JSON schema of the function (auto-generated from source_code if not
|
|
571
608
|
provided)
|
|
572
609
|
|
|
@@ -588,14 +625,15 @@ class ToolsResource(SyncAPIResource):
|
|
|
588
625
|
|
|
589
626
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
590
627
|
"""
|
|
591
|
-
return self.
|
|
628
|
+
return await self._post(
|
|
592
629
|
"/v1/tools/",
|
|
593
|
-
body=
|
|
630
|
+
body=await async_maybe_transform(
|
|
594
631
|
{
|
|
595
632
|
"source_code": source_code,
|
|
596
633
|
"args_json_schema": args_json_schema,
|
|
597
634
|
"default_requires_approval": default_requires_approval,
|
|
598
635
|
"description": description,
|
|
636
|
+
"enable_parallel_execution": enable_parallel_execution,
|
|
599
637
|
"json_schema": json_schema,
|
|
600
638
|
"npm_requirements": npm_requirements,
|
|
601
639
|
"pip_requirements": pip_requirements,
|
|
@@ -603,7 +641,7 @@ class ToolsResource(SyncAPIResource):
|
|
|
603
641
|
"source_type": source_type,
|
|
604
642
|
"tags": tags,
|
|
605
643
|
},
|
|
606
|
-
|
|
644
|
+
tool_create_params.ToolCreateParams,
|
|
607
645
|
),
|
|
608
646
|
options=make_request_options(
|
|
609
647
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
@@ -611,8 +649,9 @@ class ToolsResource(SyncAPIResource):
|
|
|
611
649
|
cast_to=Tool,
|
|
612
650
|
)
|
|
613
651
|
|
|
614
|
-
def
|
|
652
|
+
async def retrieve(
|
|
615
653
|
self,
|
|
654
|
+
tool_id: str,
|
|
616
655
|
*,
|
|
617
656
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
618
657
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -620,57 +659,46 @@ class ToolsResource(SyncAPIResource):
|
|
|
620
659
|
extra_query: Query | None = None,
|
|
621
660
|
extra_body: Body | None = None,
|
|
622
661
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
623
|
-
) ->
|
|
624
|
-
"""
|
|
625
|
-
|
|
626
|
-
"/v1/tools/add-base-tools",
|
|
627
|
-
options=make_request_options(
|
|
628
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
629
|
-
),
|
|
630
|
-
cast_to=ToolUpsertBaseResponse,
|
|
631
|
-
)
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
class AsyncToolsResource(AsyncAPIResource):
|
|
635
|
-
@cached_property
|
|
636
|
-
def composio(self) -> AsyncComposioResource:
|
|
637
|
-
return AsyncComposioResource(self._client)
|
|
662
|
+
) -> Tool:
|
|
663
|
+
"""
|
|
664
|
+
Get a tool by ID
|
|
638
665
|
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
return AsyncMcpResource(self._client)
|
|
666
|
+
Args:
|
|
667
|
+
tool_id: The ID of the tool in the format 'tool-<uuid4>'
|
|
642
668
|
|
|
643
|
-
|
|
644
|
-
def with_raw_response(self) -> AsyncToolsResourceWithRawResponse:
|
|
645
|
-
"""
|
|
646
|
-
This property can be used as a prefix for any HTTP method call to return
|
|
647
|
-
the raw response object instead of the parsed content.
|
|
669
|
+
extra_headers: Send extra headers
|
|
648
670
|
|
|
649
|
-
|
|
650
|
-
"""
|
|
651
|
-
return AsyncToolsResourceWithRawResponse(self)
|
|
671
|
+
extra_query: Add additional query parameters to the request
|
|
652
672
|
|
|
653
|
-
|
|
654
|
-
def with_streaming_response(self) -> AsyncToolsResourceWithStreamingResponse:
|
|
655
|
-
"""
|
|
656
|
-
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
673
|
+
extra_body: Add additional JSON properties to the request
|
|
657
674
|
|
|
658
|
-
|
|
675
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
659
676
|
"""
|
|
660
|
-
|
|
677
|
+
if not tool_id:
|
|
678
|
+
raise ValueError(f"Expected a non-empty value for `tool_id` but received {tool_id!r}")
|
|
679
|
+
return await self._get(
|
|
680
|
+
f"/v1/tools/{tool_id}",
|
|
681
|
+
options=make_request_options(
|
|
682
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
683
|
+
),
|
|
684
|
+
cast_to=Tool,
|
|
685
|
+
)
|
|
661
686
|
|
|
662
|
-
async def
|
|
687
|
+
async def update(
|
|
663
688
|
self,
|
|
689
|
+
tool_id: str,
|
|
664
690
|
*,
|
|
665
|
-
source_code: str,
|
|
666
691
|
args_json_schema: Optional[Dict[str, object]] | Omit = omit,
|
|
667
692
|
default_requires_approval: Optional[bool] | Omit = omit,
|
|
668
693
|
description: Optional[str] | Omit = omit,
|
|
694
|
+
enable_parallel_execution: Optional[bool] | Omit = omit,
|
|
669
695
|
json_schema: Optional[Dict[str, object]] | Omit = omit,
|
|
696
|
+
metadata: Optional[Dict[str, object]] | Omit = omit,
|
|
670
697
|
npm_requirements: Optional[Iterable[NpmRequirementParam]] | Omit = omit,
|
|
671
698
|
pip_requirements: Optional[Iterable[PipRequirementParam]] | Omit = omit,
|
|
672
|
-
return_char_limit: int | Omit = omit,
|
|
673
|
-
|
|
699
|
+
return_char_limit: Optional[int] | Omit = omit,
|
|
700
|
+
source_code: Optional[str] | Omit = omit,
|
|
701
|
+
source_type: Optional[str] | Omit = omit,
|
|
674
702
|
tags: Optional[SequenceNotStr[str]] | Omit = omit,
|
|
675
703
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
676
704
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -680,10 +708,10 @@ class AsyncToolsResource(AsyncAPIResource):
|
|
|
680
708
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
681
709
|
) -> Tool:
|
|
682
710
|
"""
|
|
683
|
-
|
|
711
|
+
Update an existing tool
|
|
684
712
|
|
|
685
713
|
Args:
|
|
686
|
-
|
|
714
|
+
tool_id: The ID of the tool in the format 'tool-<uuid4>'
|
|
687
715
|
|
|
688
716
|
args_json_schema: The args JSON schema of the function.
|
|
689
717
|
|
|
@@ -691,16 +719,23 @@ class AsyncToolsResource(AsyncAPIResource):
|
|
|
691
719
|
|
|
692
720
|
description: The description of the tool.
|
|
693
721
|
|
|
722
|
+
enable_parallel_execution: If set to True, then this tool will potentially be executed concurrently with
|
|
723
|
+
other tools. Default False.
|
|
724
|
+
|
|
694
725
|
json_schema: The JSON schema of the function (auto-generated from source_code if not
|
|
695
726
|
provided)
|
|
696
727
|
|
|
728
|
+
metadata: A dictionary of additional metadata for the tool.
|
|
729
|
+
|
|
697
730
|
npm_requirements: Optional list of npm packages required by this tool.
|
|
698
731
|
|
|
699
732
|
pip_requirements: Optional list of pip packages required by this tool.
|
|
700
733
|
|
|
701
734
|
return_char_limit: The maximum number of characters in the response.
|
|
702
735
|
|
|
703
|
-
|
|
736
|
+
source_code: The source code of the function.
|
|
737
|
+
|
|
738
|
+
source_type: The type of the source code.
|
|
704
739
|
|
|
705
740
|
tags: Metadata tags.
|
|
706
741
|
|
|
@@ -712,22 +747,26 @@ class AsyncToolsResource(AsyncAPIResource):
|
|
|
712
747
|
|
|
713
748
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
714
749
|
"""
|
|
715
|
-
|
|
716
|
-
"
|
|
750
|
+
if not tool_id:
|
|
751
|
+
raise ValueError(f"Expected a non-empty value for `tool_id` but received {tool_id!r}")
|
|
752
|
+
return await self._patch(
|
|
753
|
+
f"/v1/tools/{tool_id}",
|
|
717
754
|
body=await async_maybe_transform(
|
|
718
755
|
{
|
|
719
|
-
"source_code": source_code,
|
|
720
756
|
"args_json_schema": args_json_schema,
|
|
721
757
|
"default_requires_approval": default_requires_approval,
|
|
722
758
|
"description": description,
|
|
759
|
+
"enable_parallel_execution": enable_parallel_execution,
|
|
723
760
|
"json_schema": json_schema,
|
|
761
|
+
"metadata": metadata,
|
|
724
762
|
"npm_requirements": npm_requirements,
|
|
725
763
|
"pip_requirements": pip_requirements,
|
|
726
764
|
"return_char_limit": return_char_limit,
|
|
765
|
+
"source_code": source_code,
|
|
727
766
|
"source_type": source_type,
|
|
728
767
|
"tags": tags,
|
|
729
768
|
},
|
|
730
|
-
|
|
769
|
+
tool_update_params.ToolUpdateParams,
|
|
731
770
|
),
|
|
732
771
|
options=make_request_options(
|
|
733
772
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
@@ -735,39 +774,6 @@ class AsyncToolsResource(AsyncAPIResource):
|
|
|
735
774
|
cast_to=Tool,
|
|
736
775
|
)
|
|
737
776
|
|
|
738
|
-
async def retrieve(
|
|
739
|
-
self,
|
|
740
|
-
tool_id: str,
|
|
741
|
-
*,
|
|
742
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
743
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
744
|
-
extra_headers: Headers | None = None,
|
|
745
|
-
extra_query: Query | None = None,
|
|
746
|
-
extra_body: Body | None = None,
|
|
747
|
-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
748
|
-
) -> Tool:
|
|
749
|
-
"""
|
|
750
|
-
Get a tool by ID
|
|
751
|
-
|
|
752
|
-
Args:
|
|
753
|
-
extra_headers: Send extra headers
|
|
754
|
-
|
|
755
|
-
extra_query: Add additional query parameters to the request
|
|
756
|
-
|
|
757
|
-
extra_body: Add additional JSON properties to the request
|
|
758
|
-
|
|
759
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
760
|
-
"""
|
|
761
|
-
if not tool_id:
|
|
762
|
-
raise ValueError(f"Expected a non-empty value for `tool_id` but received {tool_id!r}")
|
|
763
|
-
return await self._get(
|
|
764
|
-
f"/v1/tools/{tool_id}",
|
|
765
|
-
options=make_request_options(
|
|
766
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
767
|
-
),
|
|
768
|
-
cast_to=Tool,
|
|
769
|
-
)
|
|
770
|
-
|
|
771
777
|
async def list(
|
|
772
778
|
self,
|
|
773
779
|
*,
|
|
@@ -872,6 +878,8 @@ class AsyncToolsResource(AsyncAPIResource):
|
|
|
872
878
|
Delete a tool by name
|
|
873
879
|
|
|
874
880
|
Args:
|
|
881
|
+
tool_id: The ID of the tool in the format 'tool-<uuid4>'
|
|
882
|
+
|
|
875
883
|
extra_headers: Send extra headers
|
|
876
884
|
|
|
877
885
|
extra_query: Add additional query parameters to the request
|
|
@@ -958,161 +966,6 @@ class AsyncToolsResource(AsyncAPIResource):
|
|
|
958
966
|
cast_to=int,
|
|
959
967
|
)
|
|
960
968
|
|
|
961
|
-
async def modify(
|
|
962
|
-
self,
|
|
963
|
-
tool_id: str,
|
|
964
|
-
*,
|
|
965
|
-
args_json_schema: Optional[Dict[str, object]] | Omit = omit,
|
|
966
|
-
default_requires_approval: Optional[bool] | Omit = omit,
|
|
967
|
-
description: Optional[str] | Omit = omit,
|
|
968
|
-
json_schema: Optional[Dict[str, object]] | Omit = omit,
|
|
969
|
-
metadata: Optional[Dict[str, object]] | Omit = omit,
|
|
970
|
-
npm_requirements: Optional[Iterable[NpmRequirementParam]] | Omit = omit,
|
|
971
|
-
pip_requirements: Optional[Iterable[PipRequirementParam]] | Omit = omit,
|
|
972
|
-
return_char_limit: Optional[int] | Omit = omit,
|
|
973
|
-
source_code: Optional[str] | Omit = omit,
|
|
974
|
-
source_type: Optional[str] | Omit = omit,
|
|
975
|
-
tags: Optional[SequenceNotStr[str]] | Omit = omit,
|
|
976
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
977
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
978
|
-
extra_headers: Headers | None = None,
|
|
979
|
-
extra_query: Query | None = None,
|
|
980
|
-
extra_body: Body | None = None,
|
|
981
|
-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
982
|
-
) -> Tool:
|
|
983
|
-
"""
|
|
984
|
-
Update an existing tool
|
|
985
|
-
|
|
986
|
-
Args:
|
|
987
|
-
args_json_schema: The args JSON schema of the function.
|
|
988
|
-
|
|
989
|
-
default_requires_approval: Whether or not to require approval before executing this tool.
|
|
990
|
-
|
|
991
|
-
description: The description of the tool.
|
|
992
|
-
|
|
993
|
-
json_schema: The JSON schema of the function (auto-generated from source_code if not
|
|
994
|
-
provided)
|
|
995
|
-
|
|
996
|
-
metadata: A dictionary of additional metadata for the tool.
|
|
997
|
-
|
|
998
|
-
npm_requirements: Optional list of npm packages required by this tool.
|
|
999
|
-
|
|
1000
|
-
pip_requirements: Optional list of pip packages required by this tool.
|
|
1001
|
-
|
|
1002
|
-
return_char_limit: The maximum number of characters in the response.
|
|
1003
|
-
|
|
1004
|
-
source_code: The source code of the function.
|
|
1005
|
-
|
|
1006
|
-
source_type: The type of the source code.
|
|
1007
|
-
|
|
1008
|
-
tags: Metadata tags.
|
|
1009
|
-
|
|
1010
|
-
extra_headers: Send extra headers
|
|
1011
|
-
|
|
1012
|
-
extra_query: Add additional query parameters to the request
|
|
1013
|
-
|
|
1014
|
-
extra_body: Add additional JSON properties to the request
|
|
1015
|
-
|
|
1016
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
1017
|
-
"""
|
|
1018
|
-
if not tool_id:
|
|
1019
|
-
raise ValueError(f"Expected a non-empty value for `tool_id` but received {tool_id!r}")
|
|
1020
|
-
return await self._patch(
|
|
1021
|
-
f"/v1/tools/{tool_id}",
|
|
1022
|
-
body=await async_maybe_transform(
|
|
1023
|
-
{
|
|
1024
|
-
"args_json_schema": args_json_schema,
|
|
1025
|
-
"default_requires_approval": default_requires_approval,
|
|
1026
|
-
"description": description,
|
|
1027
|
-
"json_schema": json_schema,
|
|
1028
|
-
"metadata": metadata,
|
|
1029
|
-
"npm_requirements": npm_requirements,
|
|
1030
|
-
"pip_requirements": pip_requirements,
|
|
1031
|
-
"return_char_limit": return_char_limit,
|
|
1032
|
-
"source_code": source_code,
|
|
1033
|
-
"source_type": source_type,
|
|
1034
|
-
"tags": tags,
|
|
1035
|
-
},
|
|
1036
|
-
tool_modify_params.ToolModifyParams,
|
|
1037
|
-
),
|
|
1038
|
-
options=make_request_options(
|
|
1039
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
1040
|
-
),
|
|
1041
|
-
cast_to=Tool,
|
|
1042
|
-
)
|
|
1043
|
-
|
|
1044
|
-
async def run(
|
|
1045
|
-
self,
|
|
1046
|
-
*,
|
|
1047
|
-
args: Dict[str, object],
|
|
1048
|
-
source_code: str,
|
|
1049
|
-
args_json_schema: Optional[Dict[str, object]] | Omit = omit,
|
|
1050
|
-
env_vars: Dict[str, str] | Omit = omit,
|
|
1051
|
-
json_schema: Optional[Dict[str, object]] | Omit = omit,
|
|
1052
|
-
name: Optional[str] | Omit = omit,
|
|
1053
|
-
npm_requirements: Optional[Iterable[NpmRequirementParam]] | Omit = omit,
|
|
1054
|
-
pip_requirements: Optional[Iterable[PipRequirementParam]] | Omit = omit,
|
|
1055
|
-
source_type: Optional[str] | Omit = omit,
|
|
1056
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1057
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1058
|
-
extra_headers: Headers | None = None,
|
|
1059
|
-
extra_query: Query | None = None,
|
|
1060
|
-
extra_body: Body | None = None,
|
|
1061
|
-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
1062
|
-
) -> ToolReturnMessage:
|
|
1063
|
-
"""
|
|
1064
|
-
Attempt to build a tool from source, then run it on the provided arguments
|
|
1065
|
-
|
|
1066
|
-
Args:
|
|
1067
|
-
args: The arguments to pass to the tool.
|
|
1068
|
-
|
|
1069
|
-
source_code: The source code of the function.
|
|
1070
|
-
|
|
1071
|
-
args_json_schema: The args JSON schema of the function.
|
|
1072
|
-
|
|
1073
|
-
env_vars: The environment variables to pass to the tool.
|
|
1074
|
-
|
|
1075
|
-
json_schema: The JSON schema of the function (auto-generated from source_code if not
|
|
1076
|
-
provided)
|
|
1077
|
-
|
|
1078
|
-
name: The name of the tool to run.
|
|
1079
|
-
|
|
1080
|
-
npm_requirements: Optional list of npm packages required by this tool.
|
|
1081
|
-
|
|
1082
|
-
pip_requirements: Optional list of pip packages required by this tool.
|
|
1083
|
-
|
|
1084
|
-
source_type: The type of the source code.
|
|
1085
|
-
|
|
1086
|
-
extra_headers: Send extra headers
|
|
1087
|
-
|
|
1088
|
-
extra_query: Add additional query parameters to the request
|
|
1089
|
-
|
|
1090
|
-
extra_body: Add additional JSON properties to the request
|
|
1091
|
-
|
|
1092
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
1093
|
-
"""
|
|
1094
|
-
return await self._post(
|
|
1095
|
-
"/v1/tools/run",
|
|
1096
|
-
body=await async_maybe_transform(
|
|
1097
|
-
{
|
|
1098
|
-
"args": args,
|
|
1099
|
-
"source_code": source_code,
|
|
1100
|
-
"args_json_schema": args_json_schema,
|
|
1101
|
-
"env_vars": env_vars,
|
|
1102
|
-
"json_schema": json_schema,
|
|
1103
|
-
"name": name,
|
|
1104
|
-
"npm_requirements": npm_requirements,
|
|
1105
|
-
"pip_requirements": pip_requirements,
|
|
1106
|
-
"source_type": source_type,
|
|
1107
|
-
},
|
|
1108
|
-
tool_run_params.ToolRunParams,
|
|
1109
|
-
),
|
|
1110
|
-
options=make_request_options(
|
|
1111
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
1112
|
-
),
|
|
1113
|
-
cast_to=ToolReturnMessage,
|
|
1114
|
-
)
|
|
1115
|
-
|
|
1116
969
|
async def upsert(
|
|
1117
970
|
self,
|
|
1118
971
|
*,
|
|
@@ -1120,6 +973,7 @@ class AsyncToolsResource(AsyncAPIResource):
|
|
|
1120
973
|
args_json_schema: Optional[Dict[str, object]] | Omit = omit,
|
|
1121
974
|
default_requires_approval: Optional[bool] | Omit = omit,
|
|
1122
975
|
description: Optional[str] | Omit = omit,
|
|
976
|
+
enable_parallel_execution: Optional[bool] | Omit = omit,
|
|
1123
977
|
json_schema: Optional[Dict[str, object]] | Omit = omit,
|
|
1124
978
|
npm_requirements: Optional[Iterable[NpmRequirementParam]] | Omit = omit,
|
|
1125
979
|
pip_requirements: Optional[Iterable[PipRequirementParam]] | Omit = omit,
|
|
@@ -1145,6 +999,9 @@ class AsyncToolsResource(AsyncAPIResource):
|
|
|
1145
999
|
|
|
1146
1000
|
description: The description of the tool.
|
|
1147
1001
|
|
|
1002
|
+
enable_parallel_execution: If set to True, then this tool will potentially be executed concurrently with
|
|
1003
|
+
other tools. Default False.
|
|
1004
|
+
|
|
1148
1005
|
json_schema: The JSON schema of the function (auto-generated from source_code if not
|
|
1149
1006
|
provided)
|
|
1150
1007
|
|
|
@@ -1174,6 +1031,7 @@ class AsyncToolsResource(AsyncAPIResource):
|
|
|
1174
1031
|
"args_json_schema": args_json_schema,
|
|
1175
1032
|
"default_requires_approval": default_requires_approval,
|
|
1176
1033
|
"description": description,
|
|
1034
|
+
"enable_parallel_execution": enable_parallel_execution,
|
|
1177
1035
|
"json_schema": json_schema,
|
|
1178
1036
|
"npm_requirements": npm_requirements,
|
|
1179
1037
|
"pip_requirements": pip_requirements,
|
|
@@ -1189,7 +1047,7 @@ class AsyncToolsResource(AsyncAPIResource):
|
|
|
1189
1047
|
cast_to=Tool,
|
|
1190
1048
|
)
|
|
1191
1049
|
|
|
1192
|
-
async def
|
|
1050
|
+
async def upsert_base_tools(
|
|
1193
1051
|
self,
|
|
1194
1052
|
*,
|
|
1195
1053
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
@@ -1198,14 +1056,14 @@ class AsyncToolsResource(AsyncAPIResource):
|
|
|
1198
1056
|
extra_query: Query | None = None,
|
|
1199
1057
|
extra_body: Body | None = None,
|
|
1200
1058
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
1201
|
-
) ->
|
|
1059
|
+
) -> ToolUpsertBaseToolsResponse:
|
|
1202
1060
|
"""Upsert base tools"""
|
|
1203
1061
|
return await self._post(
|
|
1204
1062
|
"/v1/tools/add-base-tools",
|
|
1205
1063
|
options=make_request_options(
|
|
1206
1064
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
1207
1065
|
),
|
|
1208
|
-
cast_to=
|
|
1066
|
+
cast_to=ToolUpsertBaseToolsResponse,
|
|
1209
1067
|
)
|
|
1210
1068
|
|
|
1211
1069
|
|
|
@@ -1219,6 +1077,9 @@ class ToolsResourceWithRawResponse:
|
|
|
1219
1077
|
self.retrieve = to_raw_response_wrapper(
|
|
1220
1078
|
tools.retrieve,
|
|
1221
1079
|
)
|
|
1080
|
+
self.update = to_raw_response_wrapper(
|
|
1081
|
+
tools.update,
|
|
1082
|
+
)
|
|
1222
1083
|
self.list = to_raw_response_wrapper(
|
|
1223
1084
|
tools.list,
|
|
1224
1085
|
)
|
|
@@ -1228,27 +1089,13 @@ class ToolsResourceWithRawResponse:
|
|
|
1228
1089
|
self.count = to_raw_response_wrapper(
|
|
1229
1090
|
tools.count,
|
|
1230
1091
|
)
|
|
1231
|
-
self.modify = to_raw_response_wrapper(
|
|
1232
|
-
tools.modify,
|
|
1233
|
-
)
|
|
1234
|
-
self.run = to_raw_response_wrapper(
|
|
1235
|
-
tools.run,
|
|
1236
|
-
)
|
|
1237
1092
|
self.upsert = to_raw_response_wrapper(
|
|
1238
1093
|
tools.upsert,
|
|
1239
1094
|
)
|
|
1240
|
-
self.
|
|
1241
|
-
tools.
|
|
1095
|
+
self.upsert_base_tools = to_raw_response_wrapper(
|
|
1096
|
+
tools.upsert_base_tools,
|
|
1242
1097
|
)
|
|
1243
1098
|
|
|
1244
|
-
@cached_property
|
|
1245
|
-
def composio(self) -> ComposioResourceWithRawResponse:
|
|
1246
|
-
return ComposioResourceWithRawResponse(self._tools.composio)
|
|
1247
|
-
|
|
1248
|
-
@cached_property
|
|
1249
|
-
def mcp(self) -> McpResourceWithRawResponse:
|
|
1250
|
-
return McpResourceWithRawResponse(self._tools.mcp)
|
|
1251
|
-
|
|
1252
1099
|
|
|
1253
1100
|
class AsyncToolsResourceWithRawResponse:
|
|
1254
1101
|
def __init__(self, tools: AsyncToolsResource) -> None:
|
|
@@ -1260,6 +1107,9 @@ class AsyncToolsResourceWithRawResponse:
|
|
|
1260
1107
|
self.retrieve = async_to_raw_response_wrapper(
|
|
1261
1108
|
tools.retrieve,
|
|
1262
1109
|
)
|
|
1110
|
+
self.update = async_to_raw_response_wrapper(
|
|
1111
|
+
tools.update,
|
|
1112
|
+
)
|
|
1263
1113
|
self.list = async_to_raw_response_wrapper(
|
|
1264
1114
|
tools.list,
|
|
1265
1115
|
)
|
|
@@ -1269,27 +1119,13 @@ class AsyncToolsResourceWithRawResponse:
|
|
|
1269
1119
|
self.count = async_to_raw_response_wrapper(
|
|
1270
1120
|
tools.count,
|
|
1271
1121
|
)
|
|
1272
|
-
self.modify = async_to_raw_response_wrapper(
|
|
1273
|
-
tools.modify,
|
|
1274
|
-
)
|
|
1275
|
-
self.run = async_to_raw_response_wrapper(
|
|
1276
|
-
tools.run,
|
|
1277
|
-
)
|
|
1278
1122
|
self.upsert = async_to_raw_response_wrapper(
|
|
1279
1123
|
tools.upsert,
|
|
1280
1124
|
)
|
|
1281
|
-
self.
|
|
1282
|
-
tools.
|
|
1125
|
+
self.upsert_base_tools = async_to_raw_response_wrapper(
|
|
1126
|
+
tools.upsert_base_tools,
|
|
1283
1127
|
)
|
|
1284
1128
|
|
|
1285
|
-
@cached_property
|
|
1286
|
-
def composio(self) -> AsyncComposioResourceWithRawResponse:
|
|
1287
|
-
return AsyncComposioResourceWithRawResponse(self._tools.composio)
|
|
1288
|
-
|
|
1289
|
-
@cached_property
|
|
1290
|
-
def mcp(self) -> AsyncMcpResourceWithRawResponse:
|
|
1291
|
-
return AsyncMcpResourceWithRawResponse(self._tools.mcp)
|
|
1292
|
-
|
|
1293
1129
|
|
|
1294
1130
|
class ToolsResourceWithStreamingResponse:
|
|
1295
1131
|
def __init__(self, tools: ToolsResource) -> None:
|
|
@@ -1301,6 +1137,9 @@ class ToolsResourceWithStreamingResponse:
|
|
|
1301
1137
|
self.retrieve = to_streamed_response_wrapper(
|
|
1302
1138
|
tools.retrieve,
|
|
1303
1139
|
)
|
|
1140
|
+
self.update = to_streamed_response_wrapper(
|
|
1141
|
+
tools.update,
|
|
1142
|
+
)
|
|
1304
1143
|
self.list = to_streamed_response_wrapper(
|
|
1305
1144
|
tools.list,
|
|
1306
1145
|
)
|
|
@@ -1310,27 +1149,13 @@ class ToolsResourceWithStreamingResponse:
|
|
|
1310
1149
|
self.count = to_streamed_response_wrapper(
|
|
1311
1150
|
tools.count,
|
|
1312
1151
|
)
|
|
1313
|
-
self.modify = to_streamed_response_wrapper(
|
|
1314
|
-
tools.modify,
|
|
1315
|
-
)
|
|
1316
|
-
self.run = to_streamed_response_wrapper(
|
|
1317
|
-
tools.run,
|
|
1318
|
-
)
|
|
1319
1152
|
self.upsert = to_streamed_response_wrapper(
|
|
1320
1153
|
tools.upsert,
|
|
1321
1154
|
)
|
|
1322
|
-
self.
|
|
1323
|
-
tools.
|
|
1155
|
+
self.upsert_base_tools = to_streamed_response_wrapper(
|
|
1156
|
+
tools.upsert_base_tools,
|
|
1324
1157
|
)
|
|
1325
1158
|
|
|
1326
|
-
@cached_property
|
|
1327
|
-
def composio(self) -> ComposioResourceWithStreamingResponse:
|
|
1328
|
-
return ComposioResourceWithStreamingResponse(self._tools.composio)
|
|
1329
|
-
|
|
1330
|
-
@cached_property
|
|
1331
|
-
def mcp(self) -> McpResourceWithStreamingResponse:
|
|
1332
|
-
return McpResourceWithStreamingResponse(self._tools.mcp)
|
|
1333
|
-
|
|
1334
1159
|
|
|
1335
1160
|
class AsyncToolsResourceWithStreamingResponse:
|
|
1336
1161
|
def __init__(self, tools: AsyncToolsResource) -> None:
|
|
@@ -1342,6 +1167,9 @@ class AsyncToolsResourceWithStreamingResponse:
|
|
|
1342
1167
|
self.retrieve = async_to_streamed_response_wrapper(
|
|
1343
1168
|
tools.retrieve,
|
|
1344
1169
|
)
|
|
1170
|
+
self.update = async_to_streamed_response_wrapper(
|
|
1171
|
+
tools.update,
|
|
1172
|
+
)
|
|
1345
1173
|
self.list = async_to_streamed_response_wrapper(
|
|
1346
1174
|
tools.list,
|
|
1347
1175
|
)
|
|
@@ -1351,23 +1179,9 @@ class AsyncToolsResourceWithStreamingResponse:
|
|
|
1351
1179
|
self.count = async_to_streamed_response_wrapper(
|
|
1352
1180
|
tools.count,
|
|
1353
1181
|
)
|
|
1354
|
-
self.modify = async_to_streamed_response_wrapper(
|
|
1355
|
-
tools.modify,
|
|
1356
|
-
)
|
|
1357
|
-
self.run = async_to_streamed_response_wrapper(
|
|
1358
|
-
tools.run,
|
|
1359
|
-
)
|
|
1360
1182
|
self.upsert = async_to_streamed_response_wrapper(
|
|
1361
1183
|
tools.upsert,
|
|
1362
1184
|
)
|
|
1363
|
-
self.
|
|
1364
|
-
tools.
|
|
1185
|
+
self.upsert_base_tools = async_to_streamed_response_wrapper(
|
|
1186
|
+
tools.upsert_base_tools,
|
|
1365
1187
|
)
|
|
1366
|
-
|
|
1367
|
-
@cached_property
|
|
1368
|
-
def composio(self) -> AsyncComposioResourceWithStreamingResponse:
|
|
1369
|
-
return AsyncComposioResourceWithStreamingResponse(self._tools.composio)
|
|
1370
|
-
|
|
1371
|
-
@cached_property
|
|
1372
|
-
def mcp(self) -> AsyncMcpResourceWithStreamingResponse:
|
|
1373
|
-
return AsyncMcpResourceWithStreamingResponse(self._tools.mcp)
|