ibm-watsonx-orchestrate 1.6.0b0__tar.gz → 1.6.2__tar.gz
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.
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/PKG-INFO +5 -3
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/pyproject.toml +4 -2
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/__init__.py +1 -1
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/agent_builder/agents/agent.py +1 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/agent_builder/agents/types.py +5 -1
- ibm_watsonx_orchestrate-1.6.2/src/ibm_watsonx_orchestrate/agent_builder/agents/webchat_customizations/__init__.py +2 -0
- ibm_watsonx_orchestrate-1.6.2/src/ibm_watsonx_orchestrate/agent_builder/agents/webchat_customizations/prompts.py +34 -0
- ibm_watsonx_orchestrate-1.6.2/src/ibm_watsonx_orchestrate/agent_builder/agents/webchat_customizations/welcome_content.py +20 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/agent_builder/connections/__init__.py +2 -2
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/agent_builder/connections/connections.py +21 -7
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/agent_builder/connections/types.py +39 -36
- ibm_watsonx_orchestrate-1.6.2/src/ibm_watsonx_orchestrate/agent_builder/tools/flow_tool.py +83 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/agent_builder/tools/types.py +7 -1
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/cli/commands/agents/agents_controller.py +56 -18
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/cli/commands/channels/webchat/channels_webchat_controller.py +104 -21
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/cli/commands/chat/chat_command.py +2 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/cli/commands/connections/connections_command.py +26 -18
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/cli/commands/connections/connections_controller.py +61 -61
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/cli/commands/environment/environment_controller.py +1 -1
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/cli/commands/evaluations/evaluations_command.py +118 -30
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/cli/commands/evaluations/evaluations_controller.py +22 -9
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/cli/commands/knowledge_bases/knowledge_bases_controller.py +2 -2
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/cli/commands/server/server_command.py +123 -5
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/cli/commands/toolkit/toolkit_controller.py +9 -3
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/cli/commands/tools/tools_controller.py +107 -22
- ibm_watsonx_orchestrate-1.6.2/src/ibm_watsonx_orchestrate/client/agents/agent_client.py +123 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/client/base_api_client.py +2 -1
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/client/connections/connections_client.py +18 -9
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/client/connections/utils.py +4 -2
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/client/local_service_instance.py +1 -1
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/client/service_instance.py +3 -3
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/client/tools/tempus_client.py +8 -3
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/client/utils.py +10 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/docker/compose-lite.yml +228 -67
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/docker/default.env +32 -13
- ibm_watsonx_orchestrate-1.6.2/src/ibm_watsonx_orchestrate/docker/proxy-config-single.yaml +12 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/flow_builder/flows/flow.py +15 -5
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/flow_builder/utils.py +78 -48
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/run/connections.py +4 -4
- ibm_watsonx_orchestrate-1.6.0b0/src/ibm_watsonx_orchestrate/client/agents/agent_client.py +0 -55
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/.gitignore +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/LICENSE +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/agent_builder/__init__.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/agent_builder/agents/__init__.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/agent_builder/agents/assistant_agent.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/agent_builder/agents/external_agent.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/agent_builder/knowledge_bases/knowledge_base.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/agent_builder/knowledge_bases/knowledge_base_requests.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/agent_builder/knowledge_bases/types.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/agent_builder/model_policies/__init__.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/agent_builder/model_policies/types.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/agent_builder/models/__init__.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/agent_builder/models/types.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/agent_builder/toolkits/base_toolkit.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/agent_builder/toolkits/types.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/agent_builder/tools/__init__.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/agent_builder/tools/base_tool.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/agent_builder/tools/openapi_tool.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/agent_builder/tools/python_tool.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/agent_builder/utils/__init__.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/agent_builder/utils/pydantic_utils.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/cli/__init__.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/cli/commands/__init__.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/cli/commands/agents/agents_command.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/cli/commands/channels/channels_command.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/cli/commands/channels/channels_controller.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/cli/commands/channels/types.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/cli/commands/channels/webchat/channels_webchat_command.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/cli/commands/environment/environment_command.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/cli/commands/environment/types.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/cli/commands/knowledge_bases/knowledge_bases_command.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/cli/commands/login/login_command.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/cli/commands/models/model_provider_mapper.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/cli/commands/models/models_command.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/cli/commands/models/models_controller.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/cli/commands/server/types.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/cli/commands/settings/__init__.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/cli/commands/settings/observability/__init__.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/cli/commands/settings/observability/langfuse/__init__.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/cli/commands/settings/observability/langfuse/langfuse_command.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/cli/commands/settings/observability/observability_command.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/cli/commands/settings/settings_command.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/cli/commands/toolkit/toolkit_command.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/cli/commands/tools/tools_command.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/cli/commands/tools/types.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/cli/config.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/cli/init_helper.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/cli/main.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/client/__init__.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/client/agents/assistant_agent_client.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/client/agents/external_agent_client.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/client/analytics/__init__.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/client/analytics/llm/__init__.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/client/analytics/llm/analytics_llm_client.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/client/base_service_instance.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/client/client.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/client/client_errors.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/client/connections/__init__.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/client/credentials.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/client/knowledge_bases/knowledge_base_client.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/client/model_policies/__init__.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/client/model_policies/model_policies_client.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/client/models/__init__.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/client/models/models_client.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/client/toolkit/toolkit_client.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/client/tools/tool_client.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/docker/sdk/ibm_watsonx_orchestrate-0.6.0-py3-none-any.whl +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/docker/sdk/ibm_watsonx_orchestrate-0.6.0.tar.gz +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/docker/start-up.sh +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/docker/tempus/common-config.yaml +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/flow_builder/__init__.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/flow_builder/data_map.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/flow_builder/flows/__init__.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/flow_builder/flows/constants.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/flow_builder/flows/decorators.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/flow_builder/flows/events.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/flow_builder/node.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/flow_builder/resources/flow_status.openapi.yml +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/flow_builder/types.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/run/__init__.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/utils/__init__.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/utils/logging/__init__.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/utils/logging/logger.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/utils/logging/logging.yaml +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.2}/src/ibm_watsonx_orchestrate/utils/utils.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: ibm-watsonx-orchestrate
|
3
|
-
Version: 1.6.
|
3
|
+
Version: 1.6.2
|
4
4
|
Summary: IBM watsonx.orchestrate SDK
|
5
5
|
Author-email: IBM <support@ibm.com>
|
6
6
|
License: MIT License
|
@@ -11,10 +11,12 @@ Requires-Dist: click<8.2.0,>=8.0.0
|
|
11
11
|
Requires-Dist: docstring-parser<1.0,>=0.16
|
12
12
|
Requires-Dist: httpx<1.0.0,>=0.28.1
|
13
13
|
Requires-Dist: ibm-cloud-sdk-core>=3.22.0
|
14
|
-
Requires-Dist: ibm-watsonx-orchestrate-evaluation-framework==1.0.
|
14
|
+
Requires-Dist: ibm-watsonx-orchestrate-evaluation-framework==1.0.6
|
15
15
|
Requires-Dist: jsonref==1.1.0
|
16
16
|
Requires-Dist: jsonschema<5.0.0,>=4.23.0
|
17
|
-
Requires-Dist: langchain-community
|
17
|
+
Requires-Dist: langchain-community<=0.3.25,>=0.3.12
|
18
|
+
Requires-Dist: langchain-core<=0.3.63
|
19
|
+
Requires-Dist: langsmith<=0.3.45
|
18
20
|
Requires-Dist: munch>=4.0.0
|
19
21
|
Requires-Dist: numpy>=1.26.0
|
20
22
|
Requires-Dist: packaging>=24.2
|
@@ -23,7 +23,9 @@ dependencies = [
|
|
23
23
|
"ibm-cloud-sdk-core>=3.22.0",
|
24
24
|
"jsonref==1.1.0",
|
25
25
|
"jsonschema>=4.23.0,<5.0.0",
|
26
|
-
"langchain-community>=0.3.12
|
26
|
+
"langchain-community>=0.3.12,<=0.3.25",
|
27
|
+
"langchain-core<=0.3.63",
|
28
|
+
"langsmith<=0.3.45",
|
27
29
|
"numpy>=1.26.0",
|
28
30
|
"packaging>=24.2",
|
29
31
|
"pydantic>=2.10.3,<3.0.0",
|
@@ -37,7 +39,7 @@ dependencies = [
|
|
37
39
|
"munch>=4.0.0",
|
38
40
|
"pytz>=2025.2",
|
39
41
|
"redis>=6.0.0",
|
40
|
-
"ibm_watsonx_orchestrate_evaluation_framework==1.0.
|
42
|
+
"ibm_watsonx_orchestrate_evaluation_framework==1.0.6"
|
41
43
|
]
|
42
44
|
|
43
45
|
[project.optional-dependencies]
|
@@ -14,6 +14,7 @@ class Agent(AgentSpec):
|
|
14
14
|
content = json.load(f)
|
15
15
|
else:
|
16
16
|
raise ValueError('file must end in .json, .yaml, or .yml')
|
17
|
+
|
17
18
|
if not content.get("spec_version"):
|
18
19
|
raise ValueError(f"Field 'spec_version' not provided. Please ensure provided spec conforms to a valid spec format")
|
19
20
|
agent = Agent.model_validate(content)
|
@@ -6,6 +6,7 @@ from pydantic import BaseModel, model_validator, ConfigDict
|
|
6
6
|
from ibm_watsonx_orchestrate.agent_builder.tools import BaseTool, PythonTool
|
7
7
|
from ibm_watsonx_orchestrate.agent_builder.knowledge_bases.types import KnowledgeBaseSpec, KnowledgeBaseBuiltInVectorIndexConfig, HAPFiltering, HAPFilteringConfig, CitationsConfig, ConfidenceThresholds, QueryRewriteConfig, GenerationConfiguration
|
8
8
|
from ibm_watsonx_orchestrate.agent_builder.knowledge_bases.knowledge_base import KnowledgeBase
|
9
|
+
from ibm_watsonx_orchestrate.agent_builder.agents.webchat_customizations import StarterPrompts, WelcomeContent
|
9
10
|
from pydantic import Field, AliasChoices
|
10
11
|
from typing import Annotated
|
11
12
|
|
@@ -32,7 +33,8 @@ class AgentProvider(str, Enum):
|
|
32
33
|
WXAI = "wx.ai"
|
33
34
|
EXT_CHAT = "external_chat"
|
34
35
|
SALESFORCE = "salesforce"
|
35
|
-
WATSONX = "watsonx"
|
36
|
+
WATSONX = "watsonx"
|
37
|
+
A2A = 'external_chat/A2A/0.2.1' #provider type returned from an assistant agent
|
36
38
|
|
37
39
|
|
38
40
|
class AssistantAgentAuthType(str, Enum):
|
@@ -114,6 +116,8 @@ class AgentSpec(BaseAgentSpec):
|
|
114
116
|
hidden: bool = False
|
115
117
|
knowledge_base: Optional[List[str]] | Optional[List['KnowledgeBaseSpec']] = []
|
116
118
|
chat_with_docs: Optional[ChatWithDocsConfig] = None
|
119
|
+
starter_prompts: Optional[StarterPrompts] = None
|
120
|
+
welcome_content: Optional[WelcomeContent] = None
|
117
121
|
|
118
122
|
|
119
123
|
def __init__(self, *args, **kwargs):
|
@@ -0,0 +1,34 @@
|
|
1
|
+
from enum import Enum
|
2
|
+
from typing import Optional, Dict, List, Annotated
|
3
|
+
from annotated_types import Len
|
4
|
+
from pydantic import BaseModel, model_validator
|
5
|
+
|
6
|
+
|
7
|
+
class PromptState(str,Enum):
|
8
|
+
ACTIVE = "active"
|
9
|
+
INACTIVE = "inactive"
|
10
|
+
MISSING = ""
|
11
|
+
|
12
|
+
|
13
|
+
class AgentPrompt(BaseModel):
|
14
|
+
id: str
|
15
|
+
title: str
|
16
|
+
subtitle: Optional[str] = None
|
17
|
+
prompt: str
|
18
|
+
state: PromptState = PromptState.ACTIVE
|
19
|
+
|
20
|
+
@model_validator(mode='before')
|
21
|
+
def validate_fields(cls,values):
|
22
|
+
return validate_agent_prompt_fields(values)
|
23
|
+
|
24
|
+
|
25
|
+
def validate_agent_prompt_fields(values: Dict):
|
26
|
+
for field in ['id','title','prompt','state']:
|
27
|
+
value = values.get(field)
|
28
|
+
if value and not str(value).strip():
|
29
|
+
raise ValueError(f"{field} cannot be empty or just whitespace")
|
30
|
+
return values
|
31
|
+
|
32
|
+
class StarterPrompts(BaseModel):
|
33
|
+
is_default_prompts: bool = False
|
34
|
+
prompts: Annotated[List[AgentPrompt], Len(min_length=1)]
|
@@ -0,0 +1,20 @@
|
|
1
|
+
|
2
|
+
from typing import Optional,Dict
|
3
|
+
from pydantic import BaseModel, model_validator
|
4
|
+
|
5
|
+
class WelcomeContent(BaseModel):
|
6
|
+
welcome_message: str
|
7
|
+
description: Optional[str] = None
|
8
|
+
is_default_message: bool = False
|
9
|
+
|
10
|
+
@model_validator(mode='before')
|
11
|
+
def validate_fields(cls,values):
|
12
|
+
return validate_welcome_content_fields(values)
|
13
|
+
|
14
|
+
|
15
|
+
def validate_welcome_content_fields(values: Dict):
|
16
|
+
for field in ['welcome_message']:
|
17
|
+
value = values.get(field)
|
18
|
+
if value and not str(value).strip():
|
19
|
+
raise ValueError(f"{field} cannot be empty or just whitespace")
|
20
|
+
return values
|
@@ -15,8 +15,8 @@ from .types import (
|
|
15
15
|
BearerTokenAuthCredentials,
|
16
16
|
APIKeyAuthCredentials,
|
17
17
|
OAuth2TokenCredentials,
|
18
|
-
|
19
|
-
|
18
|
+
OAuth2AuthCodeCredentials,
|
19
|
+
OAuth2ClientCredentials,
|
20
20
|
# OAuth2ImplicitCredentials,
|
21
21
|
# OAuth2PasswordCredentials,
|
22
22
|
OAuthOnBehalfOfCredentials,
|
@@ -8,6 +8,7 @@ from ibm_watsonx_orchestrate.agent_builder.connections.types import (
|
|
8
8
|
OAuth2TokenCredentials,
|
9
9
|
KeyValueConnectionCredentials,
|
10
10
|
ConnectionType,
|
11
|
+
ConnectionSecurityScheme,
|
11
12
|
CREDENTIALS,
|
12
13
|
CONNECTION_TYPE_CREDENTIAL_MAPPING
|
13
14
|
)
|
@@ -26,6 +27,18 @@ connection_type_requirements_mapping = {
|
|
26
27
|
KeyValueConnectionCredentials: None
|
27
28
|
}
|
28
29
|
|
30
|
+
connection_type_security_schema_map = {
|
31
|
+
ConnectionType.API_KEY_AUTH: ConnectionSecurityScheme.API_KEY_AUTH,
|
32
|
+
ConnectionType.BASIC_AUTH: ConnectionSecurityScheme.BASIC_AUTH,
|
33
|
+
ConnectionType.BEARER_TOKEN: ConnectionSecurityScheme.BEARER_TOKEN,
|
34
|
+
ConnectionType.KEY_VALUE: ConnectionSecurityScheme.KEY_VALUE,
|
35
|
+
ConnectionType.OAUTH2_AUTH_CODE: ConnectionSecurityScheme.OAUTH2,
|
36
|
+
ConnectionType.OAUTH2_CLIENT_CREDS: ConnectionSecurityScheme.OAUTH2,
|
37
|
+
ConnectionType.OAUTH_ON_BEHALF_OF_FLOW: ConnectionSecurityScheme.OAUTH2,
|
38
|
+
# ConnectionType.OAUTH2_IMPLICIT: ConnectionSecurityScheme.OAUTH2,
|
39
|
+
# ConnectionType.OAUTH2_PASSWORD: ConnectionSecurityScheme.OAUTH2
|
40
|
+
}
|
41
|
+
|
29
42
|
def _clean_env_vars(vars: dict[str:str], requirements: List[str], app_id: str) -> dict[str,str]:
|
30
43
|
base_prefix = _PREFIX_TEMPLATE.format(app_id=app_id)
|
31
44
|
|
@@ -75,10 +88,10 @@ def _build_credentials_model(credentials_type: type[CREDENTIALS], vars: dict[str
|
|
75
88
|
)
|
76
89
|
|
77
90
|
|
78
|
-
def _validate_schema_type(requested_type:
|
91
|
+
def _validate_schema_type(requested_type: ConnectionSecurityScheme, expected_type: ConnectionSecurityScheme) -> bool:
|
79
92
|
return expected_type == requested_type
|
80
93
|
|
81
|
-
def _get_credentials_model(connection_type:
|
94
|
+
def _get_credentials_model(connection_type: ConnectionSecurityScheme, app_id: str) -> type[CREDENTIALS]:
|
82
95
|
base_prefix = _PREFIX_TEMPLATE.format(app_id=app_id)
|
83
96
|
variables = {}
|
84
97
|
for key, value in os.environ.items():
|
@@ -93,7 +106,7 @@ def _get_credentials_model(connection_type: ConnectionType, app_id: str) -> type
|
|
93
106
|
|
94
107
|
return _build_credentials_model(credentials_type=credentials_type, vars=variables, base_prefix=base_prefix)
|
95
108
|
|
96
|
-
def get_connection_type(app_id: str) ->
|
109
|
+
def get_connection_type(app_id: str) -> ConnectionSecurityScheme:
|
97
110
|
sanitized_app_id = sanatize_app_id(app_id=app_id)
|
98
111
|
expected_schema_key = f"WXO_SECURITY_SCHEMA_{sanitized_app_id}"
|
99
112
|
expected_schema = os.environ.get(expected_schema_key)
|
@@ -103,7 +116,7 @@ def get_connection_type(app_id: str) -> ConnectionType:
|
|
103
116
|
logger.error(message)
|
104
117
|
raise ValueError(message)
|
105
118
|
|
106
|
-
auth_types = {e.value for e in
|
119
|
+
auth_types = {e.value for e in ConnectionSecurityScheme}
|
107
120
|
if expected_schema not in auth_types:
|
108
121
|
message = f"The expected type '{expected_schema}' cannot be resolved into a valid connection auth type ({', '.join(list(auth_types))})"
|
109
122
|
logger.error(message)
|
@@ -114,10 +127,11 @@ def get_connection_type(app_id: str) -> ConnectionType:
|
|
114
127
|
def get_application_connection_credentials(type: ConnectionType, app_id: str) -> CREDENTIALS:
|
115
128
|
sanitized_app_id = sanatize_app_id(app_id=app_id)
|
116
129
|
expected_schema = get_connection_type(app_id=app_id)
|
130
|
+
requested_schema = connection_type_security_schema_map.get(type)
|
117
131
|
|
118
|
-
if not _validate_schema_type(requested_type=
|
119
|
-
message = f"The requested type '{
|
132
|
+
if not _validate_schema_type(requested_type=requested_schema, expected_type=expected_schema):
|
133
|
+
message = f"The requested type '{requested_schema}' does not match the type '{expected_schema}' for the connection '{app_id}'"
|
120
134
|
logger.error(message)
|
121
135
|
raise ValueError(message)
|
122
136
|
|
123
|
-
return _get_credentials_model(connection_type=
|
137
|
+
return _get_credentials_model(connection_type=requested_schema, app_id=sanitized_app_id)
|
@@ -6,10 +6,10 @@ class ConnectionKind(str, Enum):
|
|
6
6
|
basic = 'basic'
|
7
7
|
bearer = 'bearer'
|
8
8
|
api_key = 'api_key'
|
9
|
-
|
9
|
+
oauth_auth_code_flow = 'oauth_auth_code_flow'
|
10
10
|
# oauth_auth_implicit_flow = 'oauth_auth_implicit_flow'
|
11
11
|
# oauth_auth_password_flow = 'oauth_auth_password_flow'
|
12
|
-
|
12
|
+
oauth_auth_client_credentials_flow = 'oauth_auth_client_credentials_flow'
|
13
13
|
oauth_auth_on_behalf_of_flow = 'oauth_auth_on_behalf_of_flow'
|
14
14
|
key_value = 'key_value'
|
15
15
|
kv = 'kv'
|
@@ -32,10 +32,10 @@ class ConnectionPreference(str, Enum):
|
|
32
32
|
return self.value
|
33
33
|
|
34
34
|
class ConnectionAuthType(str, Enum):
|
35
|
-
|
35
|
+
OAUTH2_AUTH_CODE = 'oauth2_auth_code'
|
36
36
|
# OAUTH2_IMPLICIT = 'oauth2_implicit'
|
37
37
|
# OAUTH2_PASSWORD = 'oauth2_password'
|
38
|
-
|
38
|
+
OAUTH2_CLIENT_CREDS = 'oauth2_client_creds'
|
39
39
|
OAUTH_ON_BEHALF_OF_FLOW = 'oauth_on_behalf_of_flow'
|
40
40
|
|
41
41
|
def __str__(self):
|
@@ -63,10 +63,10 @@ class ConnectionType(str, Enum):
|
|
63
63
|
BASIC_AUTH = ConnectionSecurityScheme.BASIC_AUTH.value
|
64
64
|
BEARER_TOKEN = ConnectionSecurityScheme.BEARER_TOKEN.value
|
65
65
|
API_KEY_AUTH = ConnectionSecurityScheme.API_KEY_AUTH.value
|
66
|
-
|
66
|
+
OAUTH2_AUTH_CODE = ConnectionAuthType.OAUTH2_AUTH_CODE.value
|
67
67
|
# OAUTH2_IMPLICIT = ConnectionAuthType.OAUTH2_IMPLICIT.value
|
68
68
|
# OAUTH2_PASSWORD = ConnectionAuthType.OAUTH2_PASSWORD.value
|
69
|
-
|
69
|
+
OAUTH2_CLIENT_CREDS = ConnectionAuthType.OAUTH2_CLIENT_CREDS.value
|
70
70
|
OAUTH_ON_BEHALF_OF_FLOW = ConnectionAuthType.OAUTH_ON_BEHALF_OF_FLOW.value
|
71
71
|
KEY_VALUE = ConnectionSecurityScheme.KEY_VALUE.value
|
72
72
|
|
@@ -77,8 +77,8 @@ class ConnectionType(str, Enum):
|
|
77
77
|
return repr(self.value)
|
78
78
|
|
79
79
|
OAUTH_CONNECTION_TYPES = {
|
80
|
-
|
81
|
-
|
80
|
+
ConnectionType.OAUTH2_AUTH_CODE,
|
81
|
+
ConnectionType.OAUTH2_CLIENT_CREDS,
|
82
82
|
# ConnectionType.OAUTH2_IMPLICIT,
|
83
83
|
# ConnectionType.OAUTH2_PASSWORD,
|
84
84
|
ConnectionType.OAUTH_ON_BEHALF_OF_FLOW,
|
@@ -137,10 +137,15 @@ class ConnectionConfiguration(BaseModel):
|
|
137
137
|
|
138
138
|
@model_validator(mode="after")
|
139
139
|
def validate_config(self):
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
140
|
+
conn_type = None
|
141
|
+
if self.security_scheme == ConnectionSecurityScheme.OAUTH2:
|
142
|
+
conn_type = self.auth_type
|
143
|
+
else:
|
144
|
+
conn_type = self.security_scheme
|
145
|
+
if self.sso and conn_type != ConnectionAuthType.OAUTH_ON_BEHALF_OF_FLOW:
|
146
|
+
raise ValueError(f"SSO not supported for auth scheme '{conn_type}'. SSO can only be used with OAuth auth types")
|
147
|
+
if not self.sso and conn_type == ConnectionAuthType.OAUTH_ON_BEHALF_OF_FLOW:
|
148
|
+
raise ValueError(f"SSO required for '{conn_type}'. Please enable SSO.")
|
144
149
|
if self.sso:
|
145
150
|
if not self.idp_config_data:
|
146
151
|
raise ValueError("For SSO auth 'idp_config_data' is a required field")
|
@@ -167,11 +172,12 @@ class OAuth2TokenCredentials(BaseModel):
|
|
167
172
|
access_token: str
|
168
173
|
url: Optional[str] = None
|
169
174
|
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
+
class OAuth2AuthCodeCredentials(BaseModel):
|
176
|
+
client_id: str
|
177
|
+
client_secret: str
|
178
|
+
token_url: str
|
179
|
+
authorization_url: str
|
180
|
+
scopes : Optional[List[str]] = None
|
175
181
|
|
176
182
|
# class OAuth2ImplicitCredentials(BaseModel):
|
177
183
|
# client_id: str
|
@@ -183,10 +189,11 @@ class OAuth2TokenCredentials(BaseModel):
|
|
183
189
|
# token_url: str
|
184
190
|
# authorization_url: str
|
185
191
|
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
192
|
+
class OAuth2ClientCredentials(BaseModel):
|
193
|
+
client_id: str
|
194
|
+
client_secret: str
|
195
|
+
token_url: str
|
196
|
+
scopes : Optional[List[str]] = None
|
190
197
|
|
191
198
|
class OAuthOnBehalfOfCredentials(BaseModel):
|
192
199
|
client_id: str
|
@@ -205,10 +212,10 @@ CREDENTIALS_SET = Union[
|
|
205
212
|
BasicAuthCredentials,
|
206
213
|
BearerTokenAuthCredentials,
|
207
214
|
APIKeyAuthCredentials,
|
208
|
-
|
215
|
+
OAuth2AuthCodeCredentials,
|
209
216
|
# OAuth2ImplicitCredentials,
|
210
217
|
# OAuth2PasswordCredentials,
|
211
|
-
|
218
|
+
OAuth2ClientCredentials,
|
212
219
|
OAuthOnBehalfOfCredentials,
|
213
220
|
KeyValueConnectionCredentials
|
214
221
|
]
|
@@ -219,33 +226,29 @@ CONNECTION_KIND_SCHEME_MAPPING = {
|
|
219
226
|
ConnectionKind.basic: ConnectionSecurityScheme.BASIC_AUTH,
|
220
227
|
ConnectionKind.bearer: ConnectionSecurityScheme.BEARER_TOKEN,
|
221
228
|
ConnectionKind.api_key: ConnectionSecurityScheme.API_KEY_AUTH,
|
222
|
-
|
229
|
+
ConnectionKind.oauth_auth_code_flow: ConnectionSecurityScheme.OAUTH2,
|
223
230
|
# ConnectionKind.oauth_auth_implicit_flow: ConnectionSecurityScheme.OAUTH2,
|
224
231
|
# ConnectionKind.oauth_auth_password_flow: ConnectionSecurityScheme.OAUTH2,
|
225
|
-
|
232
|
+
ConnectionKind.oauth_auth_client_credentials_flow: ConnectionSecurityScheme.OAUTH2,
|
226
233
|
ConnectionKind.oauth_auth_on_behalf_of_flow: ConnectionSecurityScheme.OAUTH2,
|
227
234
|
ConnectionKind.key_value: ConnectionSecurityScheme.KEY_VALUE,
|
228
235
|
ConnectionKind.kv: ConnectionSecurityScheme.KEY_VALUE,
|
229
236
|
}
|
230
237
|
|
231
238
|
CONNECTION_KIND_OAUTH_TYPE_MAPPING = {
|
232
|
-
|
239
|
+
ConnectionKind.oauth_auth_code_flow: ConnectionAuthType.OAUTH2_AUTH_CODE,
|
233
240
|
# ConnectionKind.oauth_auth_implicit_flow: ConnectionAuthType.OAUTH2_IMPLICIT,
|
234
241
|
# ConnectionKind.oauth_auth_password_flow: ConnectionAuthType.OAUTH2_PASSWORD,
|
235
|
-
|
242
|
+
ConnectionKind.oauth_auth_client_credentials_flow: ConnectionAuthType.OAUTH2_CLIENT_CREDS,
|
236
243
|
ConnectionKind.oauth_auth_on_behalf_of_flow: ConnectionAuthType.OAUTH_ON_BEHALF_OF_FLOW,
|
237
244
|
}
|
238
245
|
|
239
246
|
CONNECTION_TYPE_CREDENTIAL_MAPPING = {
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
# ConnectionType.OAUTH2_PASSWORD: BearerTokenAuthCredentials,
|
246
|
-
# ConnectionType.OAUTH2_CLIENT_CREDS: BearerTokenAuthCredentials,
|
247
|
-
ConnectionType.OAUTH_ON_BEHALF_OF_FLOW: OAuth2TokenCredentials,
|
248
|
-
ConnectionType.KEY_VALUE: KeyValueConnectionCredentials,
|
247
|
+
ConnectionSecurityScheme.BASIC_AUTH: BasicAuthCredentials,
|
248
|
+
ConnectionSecurityScheme.BEARER_TOKEN: BearerTokenAuthCredentials,
|
249
|
+
ConnectionSecurityScheme.API_KEY_AUTH: APIKeyAuthCredentials,
|
250
|
+
ConnectionSecurityScheme.OAUTH2: OAuth2TokenCredentials,
|
251
|
+
ConnectionSecurityScheme.KEY_VALUE: KeyValueConnectionCredentials,
|
249
252
|
}
|
250
253
|
|
251
254
|
class IdentityProviderCredentials(BaseModel):
|
@@ -0,0 +1,83 @@
|
|
1
|
+
|
2
|
+
import json
|
3
|
+
import logging
|
4
|
+
|
5
|
+
from ibm_watsonx_orchestrate.utils.utils import yaml_safe_load
|
6
|
+
from .types import FlowToolBinding, ToolBinding, ToolSpec
|
7
|
+
from .base_tool import BaseTool
|
8
|
+
from .types import ToolPermission
|
9
|
+
|
10
|
+
import json
|
11
|
+
|
12
|
+
logger = logging.getLogger(__name__)
|
13
|
+
|
14
|
+
|
15
|
+
class FlowTool(BaseTool):
|
16
|
+
def __init__(self, spec: ToolSpec):
|
17
|
+
BaseTool.__init__(self, spec=spec)
|
18
|
+
|
19
|
+
async def __call__(self, **kwargs):
|
20
|
+
raise RuntimeError('Flow Tools are only available when deployed onto watson orchestrate or the watson '
|
21
|
+
'orchestrate-light runtime')
|
22
|
+
|
23
|
+
@staticmethod
|
24
|
+
def from_spec(file: str) -> 'FlowTool':
|
25
|
+
with open(file, 'r') as f:
|
26
|
+
if file.endswith('.yaml') or file.endswith('.yml'):
|
27
|
+
spec = ToolSpec.model_validate(yaml_safe_load(f))
|
28
|
+
elif file.endswith('.json'):
|
29
|
+
spec = ToolSpec.model_validate(json.load(f))
|
30
|
+
else:
|
31
|
+
raise ValueError('file must end in .json, .yaml, or .yml')
|
32
|
+
|
33
|
+
if spec.binding.openapi is None or spec.binding.openapi is None:
|
34
|
+
raise ValueError('failed to load python tool as the tool had no openapi binding')
|
35
|
+
|
36
|
+
return FlowTool(spec=spec)
|
37
|
+
|
38
|
+
def __repr__(self):
|
39
|
+
return f"FlowTool(model={self.__tool_spec__.binding.flow.model}, name='{self.__tool_spec__.name}', description='{self.__tool_spec__.description}')"
|
40
|
+
|
41
|
+
def __str__(self):
|
42
|
+
return self.__repr__()
|
43
|
+
|
44
|
+
@property
|
45
|
+
def __doc__(self):
|
46
|
+
return self.__tool_spec__.description
|
47
|
+
|
48
|
+
|
49
|
+
def create_flow_json_tool(
|
50
|
+
flow_model: dict,
|
51
|
+
name: str = None,
|
52
|
+
description: str = None,
|
53
|
+
permission: ToolPermission = None,
|
54
|
+
) -> FlowTool:
|
55
|
+
"""
|
56
|
+
Creates a flow tool from a Flow JSON model
|
57
|
+
|
58
|
+
Here we create the basic tool spec. The remaining properties of the tool spec
|
59
|
+
are set by the server when the tool is registered. The server will publish the model to the
|
60
|
+
flow engine and generate the rest of the tool spec based on it's openAPI specification.
|
61
|
+
"""
|
62
|
+
|
63
|
+
spec_name = name
|
64
|
+
spec_permission = permission
|
65
|
+
if spec_name is None:
|
66
|
+
raise ValueError(
|
67
|
+
f"No name provided for tool.")
|
68
|
+
|
69
|
+
spec_description = description
|
70
|
+
if spec_description is None:
|
71
|
+
raise ValueError(
|
72
|
+
f"No description provided for tool.")
|
73
|
+
|
74
|
+
spec = ToolSpec(
|
75
|
+
name=spec_name,
|
76
|
+
description=spec_description,
|
77
|
+
permission=spec_permission
|
78
|
+
)
|
79
|
+
|
80
|
+
spec.binding = ToolBinding(flow=FlowToolBinding(flow_id=name, model=flow_model))
|
81
|
+
|
82
|
+
return FlowTool(spec=spec)
|
83
|
+
|
@@ -148,6 +148,10 @@ class McpToolBinding(BaseModel):
|
|
148
148
|
source: str
|
149
149
|
connections: Dict[str, str] | None
|
150
150
|
|
151
|
+
class FlowToolBinding(BaseModel):
|
152
|
+
flow_id: str
|
153
|
+
model: Optional[dict] = None
|
154
|
+
|
151
155
|
class ToolBinding(BaseModel):
|
152
156
|
openapi: OpenApiToolBinding = None
|
153
157
|
python: PythonToolBinding = None
|
@@ -155,6 +159,7 @@ class ToolBinding(BaseModel):
|
|
155
159
|
skill: SkillToolBinding = None
|
156
160
|
client_side: ClientSideToolBinding = None
|
157
161
|
mcp: McpToolBinding = None
|
162
|
+
flow: FlowToolBinding = None
|
158
163
|
|
159
164
|
@model_validator(mode='after')
|
160
165
|
def validate_binding_type(self) -> 'ToolBinding':
|
@@ -164,7 +169,8 @@ class ToolBinding(BaseModel):
|
|
164
169
|
self.wxflows is not None,
|
165
170
|
self.skill is not None,
|
166
171
|
self.client_side is not None,
|
167
|
-
self.mcp is not None
|
172
|
+
self.mcp is not None,
|
173
|
+
self.flow is not None
|
168
174
|
]
|
169
175
|
if sum(bindings) == 0:
|
170
176
|
raise ValueError("One binding must be set")
|