letta-client 1.0.0a6__py3-none-any.whl → 1.0.0a8__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_client/pagination.py +107 -0
- {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 +228 -744
- {letta_sdk/resources/agents/core_memory → letta_client/resources/agents}/blocks.py +112 -19
- {letta_sdk → letta_client}/resources/agents/files.py +71 -8
- {letta_sdk → letta_client}/resources/agents/folders.py +101 -11
- letta_client/resources/agents/groups.py +245 -0
- {letta_sdk → letta_client}/resources/agents/messages.py +265 -490
- {letta_sdk → letta_client}/resources/agents/tools.py +147 -31
- letta_sdk/resources/jobs.py → letta_client/resources/archives.py +268 -280
- {letta_sdk/resources/messages → letta_client/resources/batches}/batches.py +46 -161
- 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 +287 -0
- {letta_sdk/resources → letta_client/resources/blocks}/blocks.py +64 -175
- letta_client/resources/folders/__init__.py +47 -0
- letta_client/resources/folders/agents.py +237 -0
- letta_client/resources/folders/files.py +472 -0
- letta_sdk/resources/providers.py → letta_client/resources/folders/folders.py +298 -313
- {letta_sdk → letta_client}/resources/groups/groups.py +24 -88
- {letta_sdk → letta_client}/resources/groups/messages.py +178 -37
- letta_client/resources/identities/__init__.py +61 -0
- letta_client/resources/identities/agents.py +269 -0
- letta_client/resources/identities/blocks.py +237 -0
- {letta_sdk/resources → letta_client/resources/identities}/identities.py +277 -533
- 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 +189 -157
- letta_client/resources/runs/runs.py +462 -0
- letta_client/resources/runs/steps.py +229 -0
- 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 +237 -0
- letta_client/resources/steps/metrics.py +167 -0
- letta_client/resources/steps/steps.py +513 -0
- letta_sdk/resources/telemetry.py → letta_client/resources/steps/trace.py +45 -56
- {letta_sdk → letta_client}/resources/tags.py +13 -10
- 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 +249 -433
- letta_client/types/__init__.py +111 -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 +10 -21
- 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 +5 -5
- letta_client/types/agents/group_list_params.py +37 -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/types/tools → letta_client/types/blocks}/__init__.py +2 -0
- letta_sdk/types/block_list_agents_params.py → letta_client/types/blocks/agent_list_params.py +22 -5
- 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_client/types/folders/agent_list_response.py +7 -0
- letta_sdk/types/folder_list_files_params.py → letta_client/types/folders/file_list_params.py +2 -2
- letta_sdk/types/file_metadata.py → letta_client/types/folders/file_list_response.py +5 -5
- letta_sdk/types/source_upload_file_params.py → letta_client/types/folders/file_upload_params.py +5 -6
- letta_client/types/folders/file_upload_response.py +65 -0
- {letta_sdk → letta_client}/types/groups/__init__.py +1 -2
- {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 +7 -0
- letta_sdk/types/identity_list_agents_params.py → letta_client/types/identities/agent_list_params.py +19 -3
- letta_client/types/identities/block_list_params.py +34 -0
- 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 +8 -0
- letta_sdk/types/run_list_messages_params.py → letta_client/types/runs/message_list_params.py +5 -2
- 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/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 +32 -0
- letta_sdk/types/step_retrieve_metrics_response.py → letta_client/types/steps/metric_retrieve_response.py +6 -6
- {letta_sdk → letta_client}/types/tag_list_response.py +1 -2
- letta_client/types/templates/__init__.py +5 -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_list_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.0a8.dist-info}/METADATA +110 -70
- letta_client-1.0.0a8.dist-info/RECORD +289 -0
- {letta_client-1.0.0a6.dist-info → letta_client-1.0.0a8.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/projects.py +0 -189
- 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_list_groups_response.py +0 -10
- letta_sdk/types/agent_list_response.py +0 -10
- 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/block_list_response.py +0 -10
- 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/folder_list_response.py +0 -10
- 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_list_response.py +0 -10
- 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_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/block_list_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_list_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/group_list_response.py +0 -10
- letta_sdk/types/groups/message_list_response.py +0 -10
- letta_sdk/types/identity_list_agents_response.py +0 -10
- letta_sdk/types/identity_list_blocks_response.py +0 -10
- letta_sdk/types/identity_list_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/job_list_response.py +0 -10
- letta_sdk/types/messages/__init__.py +0 -10
- letta_sdk/types/messages/batch_job.py +0 -60
- letta_sdk/types/messages/batch_list_response.py +0 -10
- 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_active_response.py +0 -10
- letta_sdk/types/run_list_messages_response.py +0 -10
- letta_sdk/types/run_list_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/step_list_response.py +0 -10
- 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/tool_upsert_base_response.py +0 -10
- 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}/types/agent_count_response.py +0 -0
- {letta_sdk → letta_client}/types/agents/assistant_message.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_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_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 → 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_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_update_params.py +0 -0
- {letta_sdk → letta_client}/types/groups/message_list_params.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_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/sleeptime_manager_param.py +0 -0
- {letta_sdk → letta_client}/types/step_list_params.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/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_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.0a8.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 ..pagination import SyncArrayPage, AsyncArrayPage
|
|
22
|
+
from ..types.tool import Tool
|
|
23
|
+
from .._base_client import AsyncPaginator, make_request_options
|
|
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
|
*,
|
|
@@ -211,7 +276,7 @@ class ToolsResource(SyncAPIResource):
|
|
|
211
276
|
extra_query: Query | None = None,
|
|
212
277
|
extra_body: Body | None = None,
|
|
213
278
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
214
|
-
) ->
|
|
279
|
+
) -> SyncArrayPage[Tool]:
|
|
215
280
|
"""
|
|
216
281
|
Get a list of all tools available to agents.
|
|
217
282
|
|
|
@@ -251,8 +316,9 @@ class ToolsResource(SyncAPIResource):
|
|
|
251
316
|
|
|
252
317
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
253
318
|
"""
|
|
254
|
-
return self.
|
|
319
|
+
return self._get_api_list(
|
|
255
320
|
"/v1/tools/",
|
|
321
|
+
page=SyncArrayPage[Tool],
|
|
256
322
|
options=make_request_options(
|
|
257
323
|
extra_headers=extra_headers,
|
|
258
324
|
extra_query=extra_query,
|
|
@@ -276,7 +342,7 @@ class ToolsResource(SyncAPIResource):
|
|
|
276
342
|
tool_list_params.ToolListParams,
|
|
277
343
|
),
|
|
278
344
|
),
|
|
279
|
-
|
|
345
|
+
model=Tool,
|
|
280
346
|
)
|
|
281
347
|
|
|
282
348
|
def delete(
|
|
@@ -294,6 +360,8 @@ class ToolsResource(SyncAPIResource):
|
|
|
294
360
|
Delete a tool by name
|
|
295
361
|
|
|
296
362
|
Args:
|
|
363
|
+
tool_id: The ID of the tool in the format 'tool-<uuid4>'
|
|
364
|
+
|
|
297
365
|
extra_headers: Send extra headers
|
|
298
366
|
|
|
299
367
|
extra_query: Add additional query parameters to the request
|
|
@@ -380,20 +448,19 @@ class ToolsResource(SyncAPIResource):
|
|
|
380
448
|
cast_to=int,
|
|
381
449
|
)
|
|
382
450
|
|
|
383
|
-
def
|
|
451
|
+
def upsert(
|
|
384
452
|
self,
|
|
385
|
-
tool_id: str,
|
|
386
453
|
*,
|
|
454
|
+
source_code: str,
|
|
387
455
|
args_json_schema: Optional[Dict[str, object]] | Omit = omit,
|
|
388
456
|
default_requires_approval: Optional[bool] | Omit = omit,
|
|
389
457
|
description: Optional[str] | Omit = omit,
|
|
458
|
+
enable_parallel_execution: Optional[bool] | Omit = omit,
|
|
390
459
|
json_schema: Optional[Dict[str, object]] | Omit = omit,
|
|
391
|
-
metadata: Optional[Dict[str, object]] | Omit = omit,
|
|
392
460
|
npm_requirements: Optional[Iterable[NpmRequirementParam]] | Omit = omit,
|
|
393
461
|
pip_requirements: Optional[Iterable[PipRequirementParam]] | Omit = omit,
|
|
394
|
-
return_char_limit:
|
|
395
|
-
|
|
396
|
-
source_type: Optional[str] | Omit = omit,
|
|
462
|
+
return_char_limit: int | Omit = omit,
|
|
463
|
+
source_type: str | Omit = omit,
|
|
397
464
|
tags: Optional[SequenceNotStr[str]] | Omit = omit,
|
|
398
465
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
399
466
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -403,29 +470,30 @@ class ToolsResource(SyncAPIResource):
|
|
|
403
470
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
404
471
|
) -> Tool:
|
|
405
472
|
"""
|
|
406
|
-
|
|
473
|
+
Create or update a tool
|
|
407
474
|
|
|
408
475
|
Args:
|
|
476
|
+
source_code: The source code of the function.
|
|
477
|
+
|
|
409
478
|
args_json_schema: The args JSON schema of the function.
|
|
410
479
|
|
|
411
480
|
default_requires_approval: Whether or not to require approval before executing this tool.
|
|
412
481
|
|
|
413
482
|
description: The description of the tool.
|
|
414
483
|
|
|
484
|
+
enable_parallel_execution: If set to True, then this tool will potentially be executed concurrently with
|
|
485
|
+
other tools. Default False.
|
|
486
|
+
|
|
415
487
|
json_schema: The JSON schema of the function (auto-generated from source_code if not
|
|
416
488
|
provided)
|
|
417
489
|
|
|
418
|
-
metadata: A dictionary of additional metadata for the tool.
|
|
419
|
-
|
|
420
490
|
npm_requirements: Optional list of npm packages required by this tool.
|
|
421
491
|
|
|
422
492
|
pip_requirements: Optional list of pip packages required by this tool.
|
|
423
493
|
|
|
424
494
|
return_char_limit: The maximum number of characters in the response.
|
|
425
495
|
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
source_type: The type of the source code.
|
|
496
|
+
source_type: The source type of the function.
|
|
429
497
|
|
|
430
498
|
tags: Metadata tags.
|
|
431
499
|
|
|
@@ -437,25 +505,23 @@ class ToolsResource(SyncAPIResource):
|
|
|
437
505
|
|
|
438
506
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
439
507
|
"""
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
return self._patch(
|
|
443
|
-
f"/v1/tools/{tool_id}",
|
|
508
|
+
return self._put(
|
|
509
|
+
"/v1/tools/",
|
|
444
510
|
body=maybe_transform(
|
|
445
511
|
{
|
|
512
|
+
"source_code": source_code,
|
|
446
513
|
"args_json_schema": args_json_schema,
|
|
447
514
|
"default_requires_approval": default_requires_approval,
|
|
448
515
|
"description": description,
|
|
516
|
+
"enable_parallel_execution": enable_parallel_execution,
|
|
449
517
|
"json_schema": json_schema,
|
|
450
|
-
"metadata": metadata,
|
|
451
518
|
"npm_requirements": npm_requirements,
|
|
452
519
|
"pip_requirements": pip_requirements,
|
|
453
520
|
"return_char_limit": return_char_limit,
|
|
454
|
-
"source_code": source_code,
|
|
455
521
|
"source_type": source_type,
|
|
456
522
|
"tags": tags,
|
|
457
523
|
},
|
|
458
|
-
|
|
524
|
+
tool_upsert_params.ToolUpsertParams,
|
|
459
525
|
),
|
|
460
526
|
options=make_request_options(
|
|
461
527
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
@@ -463,85 +529,54 @@ class ToolsResource(SyncAPIResource):
|
|
|
463
529
|
cast_to=Tool,
|
|
464
530
|
)
|
|
465
531
|
|
|
466
|
-
def
|
|
532
|
+
def upsert_base_tools(
|
|
467
533
|
self,
|
|
468
534
|
*,
|
|
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
535
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
479
536
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
480
537
|
extra_headers: Headers | None = None,
|
|
481
538
|
extra_query: Query | None = None,
|
|
482
539
|
extra_body: Body | None = None,
|
|
483
540
|
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.
|
|
541
|
+
) -> ToolUpsertBaseToolsResponse:
|
|
542
|
+
"""Upsert base tools"""
|
|
543
|
+
return self._post(
|
|
544
|
+
"/v1/tools/add-base-tools",
|
|
545
|
+
options=make_request_options(
|
|
546
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
547
|
+
),
|
|
548
|
+
cast_to=ToolUpsertBaseToolsResponse,
|
|
549
|
+
)
|
|
505
550
|
|
|
506
|
-
source_type: The type of the source code.
|
|
507
551
|
|
|
508
|
-
|
|
552
|
+
class AsyncToolsResource(AsyncAPIResource):
|
|
553
|
+
@cached_property
|
|
554
|
+
def with_raw_response(self) -> AsyncToolsResourceWithRawResponse:
|
|
555
|
+
"""
|
|
556
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
557
|
+
the raw response object instead of the parsed content.
|
|
509
558
|
|
|
510
|
-
|
|
559
|
+
For more information, see https://www.github.com/letta-ai/letta-python#accessing-raw-response-data-eg-headers
|
|
560
|
+
"""
|
|
561
|
+
return AsyncToolsResourceWithRawResponse(self)
|
|
511
562
|
|
|
512
|
-
|
|
563
|
+
@cached_property
|
|
564
|
+
def with_streaming_response(self) -> AsyncToolsResourceWithStreamingResponse:
|
|
565
|
+
"""
|
|
566
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
513
567
|
|
|
514
|
-
|
|
568
|
+
For more information, see https://www.github.com/letta-ai/letta-python#with_streaming_response
|
|
515
569
|
"""
|
|
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
|
-
)
|
|
570
|
+
return AsyncToolsResourceWithStreamingResponse(self)
|
|
537
571
|
|
|
538
|
-
def
|
|
572
|
+
async def create(
|
|
539
573
|
self,
|
|
540
574
|
*,
|
|
541
575
|
source_code: str,
|
|
542
576
|
args_json_schema: Optional[Dict[str, object]] | Omit = omit,
|
|
543
577
|
default_requires_approval: Optional[bool] | Omit = omit,
|
|
544
578
|
description: Optional[str] | Omit = omit,
|
|
579
|
+
enable_parallel_execution: Optional[bool] | Omit = omit,
|
|
545
580
|
json_schema: Optional[Dict[str, object]] | Omit = omit,
|
|
546
581
|
npm_requirements: Optional[Iterable[NpmRequirementParam]] | Omit = omit,
|
|
547
582
|
pip_requirements: Optional[Iterable[PipRequirementParam]] | Omit = omit,
|
|
@@ -556,7 +591,7 @@ class ToolsResource(SyncAPIResource):
|
|
|
556
591
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
557
592
|
) -> Tool:
|
|
558
593
|
"""
|
|
559
|
-
Create
|
|
594
|
+
Create a new tool
|
|
560
595
|
|
|
561
596
|
Args:
|
|
562
597
|
source_code: The source code of the function.
|
|
@@ -567,6 +602,9 @@ class ToolsResource(SyncAPIResource):
|
|
|
567
602
|
|
|
568
603
|
description: The description of the tool.
|
|
569
604
|
|
|
605
|
+
enable_parallel_execution: If set to True, then this tool will potentially be executed concurrently with
|
|
606
|
+
other tools. Default False.
|
|
607
|
+
|
|
570
608
|
json_schema: The JSON schema of the function (auto-generated from source_code if not
|
|
571
609
|
provided)
|
|
572
610
|
|
|
@@ -588,14 +626,15 @@ class ToolsResource(SyncAPIResource):
|
|
|
588
626
|
|
|
589
627
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
590
628
|
"""
|
|
591
|
-
return self.
|
|
629
|
+
return await self._post(
|
|
592
630
|
"/v1/tools/",
|
|
593
|
-
body=
|
|
631
|
+
body=await async_maybe_transform(
|
|
594
632
|
{
|
|
595
633
|
"source_code": source_code,
|
|
596
634
|
"args_json_schema": args_json_schema,
|
|
597
635
|
"default_requires_approval": default_requires_approval,
|
|
598
636
|
"description": description,
|
|
637
|
+
"enable_parallel_execution": enable_parallel_execution,
|
|
599
638
|
"json_schema": json_schema,
|
|
600
639
|
"npm_requirements": npm_requirements,
|
|
601
640
|
"pip_requirements": pip_requirements,
|
|
@@ -603,7 +642,7 @@ class ToolsResource(SyncAPIResource):
|
|
|
603
642
|
"source_type": source_type,
|
|
604
643
|
"tags": tags,
|
|
605
644
|
},
|
|
606
|
-
|
|
645
|
+
tool_create_params.ToolCreateParams,
|
|
607
646
|
),
|
|
608
647
|
options=make_request_options(
|
|
609
648
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
@@ -611,8 +650,9 @@ class ToolsResource(SyncAPIResource):
|
|
|
611
650
|
cast_to=Tool,
|
|
612
651
|
)
|
|
613
652
|
|
|
614
|
-
def
|
|
653
|
+
async def retrieve(
|
|
615
654
|
self,
|
|
655
|
+
tool_id: str,
|
|
616
656
|
*,
|
|
617
657
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
618
658
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -620,57 +660,46 @@ class ToolsResource(SyncAPIResource):
|
|
|
620
660
|
extra_query: Query | None = None,
|
|
621
661
|
extra_body: Body | None = None,
|
|
622
662
|
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)
|
|
663
|
+
) -> Tool:
|
|
664
|
+
"""
|
|
665
|
+
Get a tool by ID
|
|
638
666
|
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
return AsyncMcpResource(self._client)
|
|
667
|
+
Args:
|
|
668
|
+
tool_id: The ID of the tool in the format 'tool-<uuid4>'
|
|
642
669
|
|
|
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.
|
|
670
|
+
extra_headers: Send extra headers
|
|
648
671
|
|
|
649
|
-
|
|
650
|
-
"""
|
|
651
|
-
return AsyncToolsResourceWithRawResponse(self)
|
|
672
|
+
extra_query: Add additional query parameters to the request
|
|
652
673
|
|
|
653
|
-
|
|
654
|
-
def with_streaming_response(self) -> AsyncToolsResourceWithStreamingResponse:
|
|
655
|
-
"""
|
|
656
|
-
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
674
|
+
extra_body: Add additional JSON properties to the request
|
|
657
675
|
|
|
658
|
-
|
|
676
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
659
677
|
"""
|
|
660
|
-
|
|
678
|
+
if not tool_id:
|
|
679
|
+
raise ValueError(f"Expected a non-empty value for `tool_id` but received {tool_id!r}")
|
|
680
|
+
return await self._get(
|
|
681
|
+
f"/v1/tools/{tool_id}",
|
|
682
|
+
options=make_request_options(
|
|
683
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
684
|
+
),
|
|
685
|
+
cast_to=Tool,
|
|
686
|
+
)
|
|
661
687
|
|
|
662
|
-
async def
|
|
688
|
+
async def update(
|
|
663
689
|
self,
|
|
690
|
+
tool_id: str,
|
|
664
691
|
*,
|
|
665
|
-
source_code: str,
|
|
666
692
|
args_json_schema: Optional[Dict[str, object]] | Omit = omit,
|
|
667
693
|
default_requires_approval: Optional[bool] | Omit = omit,
|
|
668
694
|
description: Optional[str] | Omit = omit,
|
|
695
|
+
enable_parallel_execution: Optional[bool] | Omit = omit,
|
|
669
696
|
json_schema: Optional[Dict[str, object]] | Omit = omit,
|
|
697
|
+
metadata: Optional[Dict[str, object]] | Omit = omit,
|
|
670
698
|
npm_requirements: Optional[Iterable[NpmRequirementParam]] | Omit = omit,
|
|
671
699
|
pip_requirements: Optional[Iterable[PipRequirementParam]] | Omit = omit,
|
|
672
|
-
return_char_limit: int | Omit = omit,
|
|
673
|
-
|
|
700
|
+
return_char_limit: Optional[int] | Omit = omit,
|
|
701
|
+
source_code: Optional[str] | Omit = omit,
|
|
702
|
+
source_type: Optional[str] | Omit = omit,
|
|
674
703
|
tags: Optional[SequenceNotStr[str]] | Omit = omit,
|
|
675
704
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
676
705
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -680,10 +709,10 @@ class AsyncToolsResource(AsyncAPIResource):
|
|
|
680
709
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
681
710
|
) -> Tool:
|
|
682
711
|
"""
|
|
683
|
-
|
|
712
|
+
Update an existing tool
|
|
684
713
|
|
|
685
714
|
Args:
|
|
686
|
-
|
|
715
|
+
tool_id: The ID of the tool in the format 'tool-<uuid4>'
|
|
687
716
|
|
|
688
717
|
args_json_schema: The args JSON schema of the function.
|
|
689
718
|
|
|
@@ -691,16 +720,23 @@ class AsyncToolsResource(AsyncAPIResource):
|
|
|
691
720
|
|
|
692
721
|
description: The description of the tool.
|
|
693
722
|
|
|
723
|
+
enable_parallel_execution: If set to True, then this tool will potentially be executed concurrently with
|
|
724
|
+
other tools. Default False.
|
|
725
|
+
|
|
694
726
|
json_schema: The JSON schema of the function (auto-generated from source_code if not
|
|
695
727
|
provided)
|
|
696
728
|
|
|
729
|
+
metadata: A dictionary of additional metadata for the tool.
|
|
730
|
+
|
|
697
731
|
npm_requirements: Optional list of npm packages required by this tool.
|
|
698
732
|
|
|
699
733
|
pip_requirements: Optional list of pip packages required by this tool.
|
|
700
734
|
|
|
701
735
|
return_char_limit: The maximum number of characters in the response.
|
|
702
736
|
|
|
703
|
-
|
|
737
|
+
source_code: The source code of the function.
|
|
738
|
+
|
|
739
|
+
source_type: The type of the source code.
|
|
704
740
|
|
|
705
741
|
tags: Metadata tags.
|
|
706
742
|
|
|
@@ -712,22 +748,26 @@ class AsyncToolsResource(AsyncAPIResource):
|
|
|
712
748
|
|
|
713
749
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
714
750
|
"""
|
|
715
|
-
|
|
716
|
-
"
|
|
751
|
+
if not tool_id:
|
|
752
|
+
raise ValueError(f"Expected a non-empty value for `tool_id` but received {tool_id!r}")
|
|
753
|
+
return await self._patch(
|
|
754
|
+
f"/v1/tools/{tool_id}",
|
|
717
755
|
body=await async_maybe_transform(
|
|
718
756
|
{
|
|
719
|
-
"source_code": source_code,
|
|
720
757
|
"args_json_schema": args_json_schema,
|
|
721
758
|
"default_requires_approval": default_requires_approval,
|
|
722
759
|
"description": description,
|
|
760
|
+
"enable_parallel_execution": enable_parallel_execution,
|
|
723
761
|
"json_schema": json_schema,
|
|
762
|
+
"metadata": metadata,
|
|
724
763
|
"npm_requirements": npm_requirements,
|
|
725
764
|
"pip_requirements": pip_requirements,
|
|
726
765
|
"return_char_limit": return_char_limit,
|
|
766
|
+
"source_code": source_code,
|
|
727
767
|
"source_type": source_type,
|
|
728
768
|
"tags": tags,
|
|
729
769
|
},
|
|
730
|
-
|
|
770
|
+
tool_update_params.ToolUpdateParams,
|
|
731
771
|
),
|
|
732
772
|
options=make_request_options(
|
|
733
773
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
@@ -735,40 +775,7 @@ class AsyncToolsResource(AsyncAPIResource):
|
|
|
735
775
|
cast_to=Tool,
|
|
736
776
|
)
|
|
737
777
|
|
|
738
|
-
|
|
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
|
-
async def list(
|
|
778
|
+
def list(
|
|
772
779
|
self,
|
|
773
780
|
*,
|
|
774
781
|
after: Optional[str] | Omit = omit,
|
|
@@ -789,7 +796,7 @@ class AsyncToolsResource(AsyncAPIResource):
|
|
|
789
796
|
extra_query: Query | None = None,
|
|
790
797
|
extra_body: Body | None = None,
|
|
791
798
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
792
|
-
) ->
|
|
799
|
+
) -> AsyncPaginator[Tool, AsyncArrayPage[Tool]]:
|
|
793
800
|
"""
|
|
794
801
|
Get a list of all tools available to agents.
|
|
795
802
|
|
|
@@ -829,14 +836,15 @@ class AsyncToolsResource(AsyncAPIResource):
|
|
|
829
836
|
|
|
830
837
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
831
838
|
"""
|
|
832
|
-
return
|
|
839
|
+
return self._get_api_list(
|
|
833
840
|
"/v1/tools/",
|
|
841
|
+
page=AsyncArrayPage[Tool],
|
|
834
842
|
options=make_request_options(
|
|
835
843
|
extra_headers=extra_headers,
|
|
836
844
|
extra_query=extra_query,
|
|
837
845
|
extra_body=extra_body,
|
|
838
846
|
timeout=timeout,
|
|
839
|
-
query=
|
|
847
|
+
query=maybe_transform(
|
|
840
848
|
{
|
|
841
849
|
"after": after,
|
|
842
850
|
"before": before,
|
|
@@ -854,7 +862,7 @@ class AsyncToolsResource(AsyncAPIResource):
|
|
|
854
862
|
tool_list_params.ToolListParams,
|
|
855
863
|
),
|
|
856
864
|
),
|
|
857
|
-
|
|
865
|
+
model=Tool,
|
|
858
866
|
)
|
|
859
867
|
|
|
860
868
|
async def delete(
|
|
@@ -872,6 +880,8 @@ class AsyncToolsResource(AsyncAPIResource):
|
|
|
872
880
|
Delete a tool by name
|
|
873
881
|
|
|
874
882
|
Args:
|
|
883
|
+
tool_id: The ID of the tool in the format 'tool-<uuid4>'
|
|
884
|
+
|
|
875
885
|
extra_headers: Send extra headers
|
|
876
886
|
|
|
877
887
|
extra_query: Add additional query parameters to the request
|
|
@@ -958,161 +968,6 @@ class AsyncToolsResource(AsyncAPIResource):
|
|
|
958
968
|
cast_to=int,
|
|
959
969
|
)
|
|
960
970
|
|
|
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
971
|
async def upsert(
|
|
1117
972
|
self,
|
|
1118
973
|
*,
|
|
@@ -1120,6 +975,7 @@ class AsyncToolsResource(AsyncAPIResource):
|
|
|
1120
975
|
args_json_schema: Optional[Dict[str, object]] | Omit = omit,
|
|
1121
976
|
default_requires_approval: Optional[bool] | Omit = omit,
|
|
1122
977
|
description: Optional[str] | Omit = omit,
|
|
978
|
+
enable_parallel_execution: Optional[bool] | Omit = omit,
|
|
1123
979
|
json_schema: Optional[Dict[str, object]] | Omit = omit,
|
|
1124
980
|
npm_requirements: Optional[Iterable[NpmRequirementParam]] | Omit = omit,
|
|
1125
981
|
pip_requirements: Optional[Iterable[PipRequirementParam]] | Omit = omit,
|
|
@@ -1145,6 +1001,9 @@ class AsyncToolsResource(AsyncAPIResource):
|
|
|
1145
1001
|
|
|
1146
1002
|
description: The description of the tool.
|
|
1147
1003
|
|
|
1004
|
+
enable_parallel_execution: If set to True, then this tool will potentially be executed concurrently with
|
|
1005
|
+
other tools. Default False.
|
|
1006
|
+
|
|
1148
1007
|
json_schema: The JSON schema of the function (auto-generated from source_code if not
|
|
1149
1008
|
provided)
|
|
1150
1009
|
|
|
@@ -1174,6 +1033,7 @@ class AsyncToolsResource(AsyncAPIResource):
|
|
|
1174
1033
|
"args_json_schema": args_json_schema,
|
|
1175
1034
|
"default_requires_approval": default_requires_approval,
|
|
1176
1035
|
"description": description,
|
|
1036
|
+
"enable_parallel_execution": enable_parallel_execution,
|
|
1177
1037
|
"json_schema": json_schema,
|
|
1178
1038
|
"npm_requirements": npm_requirements,
|
|
1179
1039
|
"pip_requirements": pip_requirements,
|
|
@@ -1189,7 +1049,7 @@ class AsyncToolsResource(AsyncAPIResource):
|
|
|
1189
1049
|
cast_to=Tool,
|
|
1190
1050
|
)
|
|
1191
1051
|
|
|
1192
|
-
async def
|
|
1052
|
+
async def upsert_base_tools(
|
|
1193
1053
|
self,
|
|
1194
1054
|
*,
|
|
1195
1055
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
@@ -1198,14 +1058,14 @@ class AsyncToolsResource(AsyncAPIResource):
|
|
|
1198
1058
|
extra_query: Query | None = None,
|
|
1199
1059
|
extra_body: Body | None = None,
|
|
1200
1060
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
1201
|
-
) ->
|
|
1061
|
+
) -> ToolUpsertBaseToolsResponse:
|
|
1202
1062
|
"""Upsert base tools"""
|
|
1203
1063
|
return await self._post(
|
|
1204
1064
|
"/v1/tools/add-base-tools",
|
|
1205
1065
|
options=make_request_options(
|
|
1206
1066
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
1207
1067
|
),
|
|
1208
|
-
cast_to=
|
|
1068
|
+
cast_to=ToolUpsertBaseToolsResponse,
|
|
1209
1069
|
)
|
|
1210
1070
|
|
|
1211
1071
|
|
|
@@ -1219,6 +1079,9 @@ class ToolsResourceWithRawResponse:
|
|
|
1219
1079
|
self.retrieve = to_raw_response_wrapper(
|
|
1220
1080
|
tools.retrieve,
|
|
1221
1081
|
)
|
|
1082
|
+
self.update = to_raw_response_wrapper(
|
|
1083
|
+
tools.update,
|
|
1084
|
+
)
|
|
1222
1085
|
self.list = to_raw_response_wrapper(
|
|
1223
1086
|
tools.list,
|
|
1224
1087
|
)
|
|
@@ -1228,27 +1091,13 @@ class ToolsResourceWithRawResponse:
|
|
|
1228
1091
|
self.count = to_raw_response_wrapper(
|
|
1229
1092
|
tools.count,
|
|
1230
1093
|
)
|
|
1231
|
-
self.modify = to_raw_response_wrapper(
|
|
1232
|
-
tools.modify,
|
|
1233
|
-
)
|
|
1234
|
-
self.run = to_raw_response_wrapper(
|
|
1235
|
-
tools.run,
|
|
1236
|
-
)
|
|
1237
1094
|
self.upsert = to_raw_response_wrapper(
|
|
1238
1095
|
tools.upsert,
|
|
1239
1096
|
)
|
|
1240
|
-
self.
|
|
1241
|
-
tools.
|
|
1097
|
+
self.upsert_base_tools = to_raw_response_wrapper(
|
|
1098
|
+
tools.upsert_base_tools,
|
|
1242
1099
|
)
|
|
1243
1100
|
|
|
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
1101
|
|
|
1253
1102
|
class AsyncToolsResourceWithRawResponse:
|
|
1254
1103
|
def __init__(self, tools: AsyncToolsResource) -> None:
|
|
@@ -1260,6 +1109,9 @@ class AsyncToolsResourceWithRawResponse:
|
|
|
1260
1109
|
self.retrieve = async_to_raw_response_wrapper(
|
|
1261
1110
|
tools.retrieve,
|
|
1262
1111
|
)
|
|
1112
|
+
self.update = async_to_raw_response_wrapper(
|
|
1113
|
+
tools.update,
|
|
1114
|
+
)
|
|
1263
1115
|
self.list = async_to_raw_response_wrapper(
|
|
1264
1116
|
tools.list,
|
|
1265
1117
|
)
|
|
@@ -1269,27 +1121,13 @@ class AsyncToolsResourceWithRawResponse:
|
|
|
1269
1121
|
self.count = async_to_raw_response_wrapper(
|
|
1270
1122
|
tools.count,
|
|
1271
1123
|
)
|
|
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
1124
|
self.upsert = async_to_raw_response_wrapper(
|
|
1279
1125
|
tools.upsert,
|
|
1280
1126
|
)
|
|
1281
|
-
self.
|
|
1282
|
-
tools.
|
|
1127
|
+
self.upsert_base_tools = async_to_raw_response_wrapper(
|
|
1128
|
+
tools.upsert_base_tools,
|
|
1283
1129
|
)
|
|
1284
1130
|
|
|
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
1131
|
|
|
1294
1132
|
class ToolsResourceWithStreamingResponse:
|
|
1295
1133
|
def __init__(self, tools: ToolsResource) -> None:
|
|
@@ -1301,6 +1139,9 @@ class ToolsResourceWithStreamingResponse:
|
|
|
1301
1139
|
self.retrieve = to_streamed_response_wrapper(
|
|
1302
1140
|
tools.retrieve,
|
|
1303
1141
|
)
|
|
1142
|
+
self.update = to_streamed_response_wrapper(
|
|
1143
|
+
tools.update,
|
|
1144
|
+
)
|
|
1304
1145
|
self.list = to_streamed_response_wrapper(
|
|
1305
1146
|
tools.list,
|
|
1306
1147
|
)
|
|
@@ -1310,27 +1151,13 @@ class ToolsResourceWithStreamingResponse:
|
|
|
1310
1151
|
self.count = to_streamed_response_wrapper(
|
|
1311
1152
|
tools.count,
|
|
1312
1153
|
)
|
|
1313
|
-
self.modify = to_streamed_response_wrapper(
|
|
1314
|
-
tools.modify,
|
|
1315
|
-
)
|
|
1316
|
-
self.run = to_streamed_response_wrapper(
|
|
1317
|
-
tools.run,
|
|
1318
|
-
)
|
|
1319
1154
|
self.upsert = to_streamed_response_wrapper(
|
|
1320
1155
|
tools.upsert,
|
|
1321
1156
|
)
|
|
1322
|
-
self.
|
|
1323
|
-
tools.
|
|
1157
|
+
self.upsert_base_tools = to_streamed_response_wrapper(
|
|
1158
|
+
tools.upsert_base_tools,
|
|
1324
1159
|
)
|
|
1325
1160
|
|
|
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
1161
|
|
|
1335
1162
|
class AsyncToolsResourceWithStreamingResponse:
|
|
1336
1163
|
def __init__(self, tools: AsyncToolsResource) -> None:
|
|
@@ -1342,6 +1169,9 @@ class AsyncToolsResourceWithStreamingResponse:
|
|
|
1342
1169
|
self.retrieve = async_to_streamed_response_wrapper(
|
|
1343
1170
|
tools.retrieve,
|
|
1344
1171
|
)
|
|
1172
|
+
self.update = async_to_streamed_response_wrapper(
|
|
1173
|
+
tools.update,
|
|
1174
|
+
)
|
|
1345
1175
|
self.list = async_to_streamed_response_wrapper(
|
|
1346
1176
|
tools.list,
|
|
1347
1177
|
)
|
|
@@ -1351,23 +1181,9 @@ class AsyncToolsResourceWithStreamingResponse:
|
|
|
1351
1181
|
self.count = async_to_streamed_response_wrapper(
|
|
1352
1182
|
tools.count,
|
|
1353
1183
|
)
|
|
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
1184
|
self.upsert = async_to_streamed_response_wrapper(
|
|
1361
1185
|
tools.upsert,
|
|
1362
1186
|
)
|
|
1363
|
-
self.
|
|
1364
|
-
tools.
|
|
1187
|
+
self.upsert_base_tools = async_to_streamed_response_wrapper(
|
|
1188
|
+
tools.upsert_base_tools,
|
|
1365
1189
|
)
|
|
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)
|