ibm-watsonx-orchestrate 1.6.0b0__tar.gz → 1.6.1__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.1}/PKG-INFO +2 -2
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/pyproject.toml +1 -1
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/__init__.py +1 -1
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/agent_builder/agents/agent.py +1 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/agent_builder/agents/types.py +5 -1
- ibm_watsonx_orchestrate-1.6.1/src/ibm_watsonx_orchestrate/agent_builder/agents/webchat_customizations/__init__.py +2 -0
- ibm_watsonx_orchestrate-1.6.1/src/ibm_watsonx_orchestrate/agent_builder/agents/webchat_customizations/prompts.py +34 -0
- ibm_watsonx_orchestrate-1.6.1/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.1}/src/ibm_watsonx_orchestrate/agent_builder/connections/__init__.py +2 -2
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/agent_builder/connections/connections.py +21 -7
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/agent_builder/connections/types.py +39 -36
- ibm_watsonx_orchestrate-1.6.1/src/ibm_watsonx_orchestrate/agent_builder/tools/flow_tool.py +83 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/agent_builder/tools/types.py +7 -1
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/cli/commands/agents/agents_controller.py +56 -18
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/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.1}/src/ibm_watsonx_orchestrate/cli/commands/chat/chat_command.py +2 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/cli/commands/connections/connections_command.py +26 -18
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/cli/commands/connections/connections_controller.py +61 -61
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/cli/commands/environment/environment_controller.py +1 -1
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/cli/commands/evaluations/evaluations_command.py +118 -30
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/cli/commands/evaluations/evaluations_controller.py +22 -9
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/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.1}/src/ibm_watsonx_orchestrate/cli/commands/server/server_command.py +123 -5
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/cli/commands/toolkit/toolkit_controller.py +9 -3
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/cli/commands/tools/tools_controller.py +107 -22
- ibm_watsonx_orchestrate-1.6.1/src/ibm_watsonx_orchestrate/client/agents/agent_client.py +123 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/client/base_api_client.py +2 -1
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/client/connections/connections_client.py +18 -9
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/client/connections/utils.py +4 -2
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/client/local_service_instance.py +1 -1
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/client/service_instance.py +3 -3
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/client/tools/tempus_client.py +8 -3
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/client/utils.py +10 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/docker/compose-lite.yml +228 -67
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/docker/default.env +32 -13
- ibm_watsonx_orchestrate-1.6.1/src/ibm_watsonx_orchestrate/docker/proxy-config-single.yaml +12 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/flow_builder/flows/flow.py +15 -5
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/flow_builder/utils.py +78 -48
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/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.1}/.gitignore +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/LICENSE +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/agent_builder/__init__.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/agent_builder/agents/__init__.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/agent_builder/agents/assistant_agent.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/agent_builder/agents/external_agent.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/agent_builder/knowledge_bases/knowledge_base.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/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.1}/src/ibm_watsonx_orchestrate/agent_builder/knowledge_bases/types.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/agent_builder/model_policies/__init__.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/agent_builder/model_policies/types.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/agent_builder/models/__init__.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/agent_builder/models/types.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/agent_builder/toolkits/base_toolkit.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/agent_builder/toolkits/types.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/agent_builder/tools/__init__.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/agent_builder/tools/base_tool.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/agent_builder/tools/openapi_tool.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/agent_builder/tools/python_tool.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/agent_builder/utils/__init__.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/agent_builder/utils/pydantic_utils.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/cli/__init__.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/cli/commands/__init__.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/cli/commands/agents/agents_command.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/cli/commands/channels/channels_command.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/cli/commands/channels/channels_controller.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/cli/commands/channels/types.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/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.1}/src/ibm_watsonx_orchestrate/cli/commands/environment/environment_command.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/cli/commands/environment/types.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/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.1}/src/ibm_watsonx_orchestrate/cli/commands/login/login_command.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/cli/commands/models/model_provider_mapper.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/cli/commands/models/models_command.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/cli/commands/models/models_controller.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/cli/commands/server/types.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/cli/commands/settings/__init__.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/cli/commands/settings/observability/__init__.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/cli/commands/settings/observability/langfuse/__init__.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/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.1}/src/ibm_watsonx_orchestrate/cli/commands/settings/observability/observability_command.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/cli/commands/settings/settings_command.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/cli/commands/toolkit/toolkit_command.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/cli/commands/tools/tools_command.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/cli/commands/tools/types.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/cli/config.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/cli/init_helper.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/cli/main.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/client/__init__.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/client/agents/assistant_agent_client.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/client/agents/external_agent_client.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/client/analytics/__init__.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/client/analytics/llm/__init__.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/client/analytics/llm/analytics_llm_client.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/client/base_service_instance.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/client/client.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/client/client_errors.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/client/connections/__init__.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/client/credentials.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/client/knowledge_bases/knowledge_base_client.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/client/model_policies/__init__.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/client/model_policies/model_policies_client.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/client/models/__init__.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/client/models/models_client.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/client/toolkit/toolkit_client.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/client/tools/tool_client.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/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.1}/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.1}/src/ibm_watsonx_orchestrate/docker/start-up.sh +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/docker/tempus/common-config.yaml +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/flow_builder/__init__.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/flow_builder/data_map.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/flow_builder/flows/__init__.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/flow_builder/flows/constants.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/flow_builder/flows/decorators.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/flow_builder/flows/events.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/flow_builder/node.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/flow_builder/resources/flow_status.openapi.yml +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/flow_builder/types.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/run/__init__.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/utils/__init__.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/utils/logging/__init__.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/utils/logging/logger.py +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/src/ibm_watsonx_orchestrate/utils/logging/logging.yaml +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0 → ibm_watsonx_orchestrate-1.6.1}/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.1
|
4
4
|
Summary: IBM watsonx.orchestrate SDK
|
5
5
|
Author-email: IBM <support@ibm.com>
|
6
6
|
License: MIT License
|
@@ -11,7 +11,7 @@ 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
17
|
Requires-Dist: langchain-community<1.0.0,>=0.3.12
|
@@ -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")
|
@@ -122,6 +122,18 @@ def parse_create_native_args(name: str, kind: AgentKind, description: str | None
|
|
122
122
|
context_variables = [x.strip() for x in context_variables if x.strip() != ""]
|
123
123
|
agent_details["context_variables"] = context_variables
|
124
124
|
|
125
|
+
# hidden = args.get("hidden")
|
126
|
+
# if hidden:
|
127
|
+
# agent_details["hidden"] = hidden
|
128
|
+
|
129
|
+
# starter_prompts = args.get("starter_prompts")
|
130
|
+
# if starter_prompts:
|
131
|
+
# agent_details["starter_prompts"] = starter_prompts
|
132
|
+
|
133
|
+
# welcome_content = args.get("welcome_content")
|
134
|
+
# if welcome_content:
|
135
|
+
# agent_details["welcome_content"] = welcome_content
|
136
|
+
|
125
137
|
return agent_details
|
126
138
|
|
127
139
|
def parse_create_external_args(name: str, kind: AgentKind, description: str | None, **args) -> dict:
|
@@ -553,7 +565,7 @@ class AgentsController:
|
|
553
565
|
|
554
566
|
return agent
|
555
567
|
|
556
|
-
def dereference_external_or_assistant_agent_dependencies(self, agent: ExternalAgent | AssistantAgent) -> ExternalAgent | AssistantAgent:
|
568
|
+
def dereference_external_or_assistant_agent_dependencies(self, agent: ExternalAgent | AssistantAgent) -> ExternalAgent | AssistantAgent:
|
557
569
|
agent_dict = agent.model_dump()
|
558
570
|
|
559
571
|
if agent_dict.get("app_id") or agent.config.model_dump().get("app_id"):
|
@@ -561,7 +573,7 @@ class AgentsController:
|
|
561
573
|
|
562
574
|
return agent
|
563
575
|
|
564
|
-
def reference_external_or_assistant_agent_dependencies(self, agent: ExternalAgent | AssistantAgent) -> ExternalAgent | AssistantAgent:
|
576
|
+
def reference_external_or_assistant_agent_dependencies(self, agent: ExternalAgent | AssistantAgent) -> ExternalAgent | AssistantAgent:
|
565
577
|
agent_dict = agent.model_dump()
|
566
578
|
|
567
579
|
if agent_dict.get("connection_id") or agent.config.model_dump().get("connection_id"):
|
@@ -735,14 +747,25 @@ class AgentsController:
|
|
735
747
|
return knowledge_bases
|
736
748
|
|
737
749
|
def list_agents(self, kind: AgentKind=None, verbose: bool=False):
|
750
|
+
parse_errors = []
|
751
|
+
|
738
752
|
if kind == AgentKind.NATIVE or kind is None:
|
739
753
|
response = self.get_native_client().get()
|
740
|
-
native_agents = [
|
754
|
+
native_agents = []
|
755
|
+
for agent in response:
|
756
|
+
try:
|
757
|
+
native_agents.append(Agent.model_validate(agent))
|
758
|
+
except Exception as e:
|
759
|
+
name = agent.get('name', None)
|
760
|
+
parse_errors.append([
|
761
|
+
f"Agent '{name}' could not be parsed",
|
762
|
+
json.dumps(agent),
|
763
|
+
e
|
764
|
+
])
|
741
765
|
|
742
766
|
if verbose:
|
743
767
|
agents_list = []
|
744
768
|
for agent in native_agents:
|
745
|
-
|
746
769
|
agents_list.append(json.loads(agent.dumps_spec()))
|
747
770
|
|
748
771
|
rich.print(rich.json.JSON(json.dumps(agents_list, indent=4)))
|
@@ -754,14 +777,14 @@ class AgentsController:
|
|
754
777
|
show_lines=True
|
755
778
|
)
|
756
779
|
column_args = {
|
757
|
-
"Name": {},
|
780
|
+
"Name": {"overflow": "fold"},
|
758
781
|
"Description": {},
|
759
782
|
"LLM": {"overflow": "fold"},
|
760
783
|
"Style": {},
|
761
784
|
"Collaborators": {},
|
762
785
|
"Tools": {},
|
763
786
|
"Knowledge Base": {},
|
764
|
-
"ID": {},
|
787
|
+
"ID": {"overflow": "fold"},
|
765
788
|
}
|
766
789
|
for column in column_args:
|
767
790
|
native_table.add_column(column, **column_args[column])
|
@@ -787,7 +810,13 @@ class AgentsController:
|
|
787
810
|
if kind == AgentKind.EXTERNAL or kind is None:
|
788
811
|
response = self.get_external_client().get()
|
789
812
|
|
790
|
-
external_agents = [
|
813
|
+
external_agents = []
|
814
|
+
for agent in response:
|
815
|
+
try:
|
816
|
+
external_agents.append(ExternalAgent.model_validate(agent))
|
817
|
+
except Exception as e:
|
818
|
+
name = agent.get('name', None)
|
819
|
+
parse_errors.append([f"External Agent {name} could not be parsed", e])
|
791
820
|
|
792
821
|
response_dict = {agent["id"]: agent for agent in response}
|
793
822
|
|
@@ -811,7 +840,7 @@ class AgentsController:
|
|
811
840
|
show_lines=True
|
812
841
|
)
|
813
842
|
column_args = {
|
814
|
-
"Name": {},
|
843
|
+
"Name": {"overflow": "fold"},
|
815
844
|
"Title": {},
|
816
845
|
"Description": {},
|
817
846
|
"Tags": {},
|
@@ -819,9 +848,9 @@ class AgentsController:
|
|
819
848
|
"Chat Params": {},
|
820
849
|
"Config": {},
|
821
850
|
"Nickname": {},
|
822
|
-
"App ID": {},
|
823
|
-
"ID": {}
|
824
|
-
|
851
|
+
"App ID": {"overflow": "fold"},
|
852
|
+
"ID": {"overflow": "fold"}
|
853
|
+
}
|
825
854
|
|
826
855
|
for column in column_args:
|
827
856
|
external_table.add_column(column, **column_args[column])
|
@@ -847,7 +876,13 @@ class AgentsController:
|
|
847
876
|
if kind == AgentKind.ASSISTANT or kind is None:
|
848
877
|
response = self.get_assistant_client().get()
|
849
878
|
|
850
|
-
assistant_agents = [
|
879
|
+
assistant_agents = []
|
880
|
+
for agent in response:
|
881
|
+
try:
|
882
|
+
assistant_agents.append(AssistantAgent.model_validate(agent))
|
883
|
+
except Exception as e:
|
884
|
+
name = agent.get('name', None)
|
885
|
+
parse_errors.append([f"Assistant Agent {name} could not be parsed", e])
|
851
886
|
|
852
887
|
response_dict = {agent["id"]: agent for agent in response}
|
853
888
|
|
@@ -872,17 +907,17 @@ class AgentsController:
|
|
872
907
|
title="Assistant Agents",
|
873
908
|
show_lines=True)
|
874
909
|
column_args = {
|
875
|
-
"Name": {},
|
910
|
+
"Name": {"overflow": "fold"},
|
876
911
|
"Title": {},
|
877
912
|
"Description": {},
|
878
913
|
"Tags": {},
|
879
914
|
"Nickname": {},
|
880
915
|
"CRN": {},
|
881
916
|
"Instance URL": {},
|
882
|
-
"Assistant ID": {},
|
883
|
-
"Environment ID": {},
|
884
|
-
"ID": {}
|
885
|
-
|
917
|
+
"Assistant ID": {"overflow": "fold"},
|
918
|
+
"Environment ID": {"overflow": "fold"},
|
919
|
+
"ID": {"overflow": "fold"}
|
920
|
+
}
|
886
921
|
|
887
922
|
for column in column_args:
|
888
923
|
assistants_table.add_column(column, **column_args[column])
|
@@ -902,6 +937,10 @@ class AgentsController:
|
|
902
937
|
)
|
903
938
|
rich.print(assistants_table)
|
904
939
|
|
940
|
+
for error in parse_errors:
|
941
|
+
for l in error:
|
942
|
+
logger.error(l)
|
943
|
+
|
905
944
|
def remove_agent(self, name: str, kind: AgentKind):
|
906
945
|
try:
|
907
946
|
if kind == AgentKind.NATIVE:
|
@@ -969,7 +1008,6 @@ class AgentsController:
|
|
969
1008
|
|
970
1009
|
|
971
1010
|
def export_agent(self, name: str, kind: AgentKind, output_path: str, agent_only_flag: bool=False, zip_file_out: zipfile.ZipFile | None = None) -> None:
|
972
|
-
|
973
1011
|
output_file = Path(output_path)
|
974
1012
|
output_file_extension = output_file.suffix
|
975
1013
|
output_file_name = output_file.stem
|