datarobot-genai 0.2.7__tar.gz → 0.2.40__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.
Potentially problematic release.
This version of datarobot-genai might be problematic. Click here for more details.
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/PKG-INFO +3 -1
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/pyproject.toml +7 -1
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/core/cli/agent_kernel.py +4 -1
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/core/utils/auth.py +188 -31
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/drmcp/__init__.py +2 -2
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/drmcp/core/config.py +121 -59
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/drmcp/core/dr_mcp_server.py +0 -3
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/drmcp/core/exceptions.py +0 -4
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/drmcp/core/logging.py +2 -2
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/drmcp/core/mcp_instance.py +37 -103
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/drmcp/core/tool_config.py +24 -8
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/drmcp/core/tool_filter.py +10 -1
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/drmcp/core/utils.py +7 -0
- datarobot_genai-0.2.40/src/datarobot_genai/drmcp/test_utils/clients/anthropic.py +68 -0
- datarobot_genai-0.2.7/src/datarobot_genai/drmcp/test_utils/openai_llm_mcp_client.py → datarobot_genai-0.2.40/src/datarobot_genai/drmcp/test_utils/clients/base.py +99 -33
- datarobot_genai-0.2.40/src/datarobot_genai/drmcp/test_utils/clients/dr_gateway.py +58 -0
- datarobot_genai-0.2.40/src/datarobot_genai/drmcp/test_utils/clients/openai.py +68 -0
- datarobot_genai-0.2.40/src/datarobot_genai/drmcp/test_utils/elicitation_test_tool.py +89 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/drmcp/test_utils/integration_mcp_server.py +7 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/drmcp/test_utils/mcp_utils_ete.py +29 -1
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/drmcp/test_utils/mcp_utils_integration.py +17 -4
- datarobot_genai-0.2.40/src/datarobot_genai/drmcp/test_utils/test_interactive.py +205 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/drmcp/test_utils/tool_base_ete.py +90 -21
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/drmcp/test_utils/utils.py +1 -1
- datarobot_genai-0.2.40/src/datarobot_genai/drmcp/tools/clients/confluence.py +584 -0
- datarobot_genai-0.2.40/src/datarobot_genai/drmcp/tools/clients/gdrive.py +923 -0
- datarobot_genai-0.2.40/src/datarobot_genai/drmcp/tools/clients/jira.py +334 -0
- datarobot_genai-0.2.40/src/datarobot_genai/drmcp/tools/clients/microsoft_graph.py +650 -0
- datarobot_genai-0.2.40/src/datarobot_genai/drmcp/tools/confluence/tools.py +275 -0
- datarobot_genai-0.2.40/src/datarobot_genai/drmcp/tools/gdrive/tools.py +404 -0
- datarobot_genai-0.2.40/src/datarobot_genai/drmcp/tools/jira/tools.py +225 -0
- datarobot_genai-0.2.40/src/datarobot_genai/drmcp/tools/microsoft_graph/__init__.py +13 -0
- datarobot_genai-0.2.40/src/datarobot_genai/drmcp/tools/microsoft_graph/tools.py +330 -0
- datarobot_genai-0.2.40/src/datarobot_genai/drmcp/tools/predictive/data.py +133 -0
- datarobot_genai-0.2.40/src/datarobot_genai/drmcp/tools/predictive/deployment.py +97 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/drmcp/tools/predictive/deployment_info.py +100 -107
- datarobot_genai-0.2.40/src/datarobot_genai/drmcp/tools/predictive/model.py +183 -0
- datarobot_genai-0.2.40/src/datarobot_genai/drmcp/tools/predictive/project.py +90 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/drmcp/tools/predictive/training.py +190 -152
- datarobot_genai-0.2.40/src/datarobot_genai/nat/__init__.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/nat/agent.py +20 -7
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/nat/datarobot_llm_clients.py +124 -55
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/nat/datarobot_mcp_client.py +47 -15
- datarobot_genai-0.2.40/src/datarobot_genai/nat/helpers.py +87 -0
- datarobot_genai-0.2.40/src/datarobot_genai/py.typed +0 -0
- datarobot_genai-0.2.7/src/datarobot_genai/drmcp/core/mcp_server_tools.py +0 -129
- datarobot_genai-0.2.7/src/datarobot_genai/drmcp/tools/clients/confluence.py +0 -14
- datarobot_genai-0.2.7/src/datarobot_genai/drmcp/tools/clients/jira.py +0 -102
- datarobot_genai-0.2.7/src/datarobot_genai/drmcp/tools/confluence/tools.py +0 -13
- datarobot_genai-0.2.7/src/datarobot_genai/drmcp/tools/jira/tools.py +0 -58
- datarobot_genai-0.2.7/src/datarobot_genai/drmcp/tools/predictive/data.py +0 -97
- datarobot_genai-0.2.7/src/datarobot_genai/drmcp/tools/predictive/deployment.py +0 -91
- datarobot_genai-0.2.7/src/datarobot_genai/drmcp/tools/predictive/model.py +0 -148
- datarobot_genai-0.2.7/src/datarobot_genai/drmcp/tools/predictive/project.py +0 -72
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/.gitignore +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/AUTHORS +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/LICENSE +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/README.md +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/__init__.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/core/__init__.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/core/agents/__init__.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/core/agents/base.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/core/chat/__init__.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/core/chat/auth.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/core/chat/client.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/core/chat/responses.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/core/cli/__init__.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/core/cli/agent_environment.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/core/custom_model.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/core/mcp/__init__.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/core/mcp/common.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/core/telemetry_agent.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/core/utils/__init__.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/core/utils/urls.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/crewai/__init__.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/crewai/agent.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/crewai/base.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/crewai/events.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/crewai/mcp.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/drmcp/core/__init__.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/drmcp/core/auth.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/drmcp/core/clients.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/drmcp/core/config_utils.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/drmcp/core/constants.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/drmcp/core/credentials.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/drmcp/core/dr_mcp_server_logo.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/drmcp/core/dynamic_prompts/__init__.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/drmcp/core/dynamic_prompts/controllers.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/drmcp/core/dynamic_prompts/dr_lib.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/drmcp/core/dynamic_prompts/register.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/drmcp/core/dynamic_prompts/utils.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/drmcp/core/dynamic_tools/__init__.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/drmcp/core/dynamic_tools/deployment/__init__.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/drmcp/core/dynamic_tools/deployment/adapters/__init__.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/drmcp/core/dynamic_tools/deployment/adapters/base.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/drmcp/core/dynamic_tools/deployment/adapters/default.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/drmcp/core/dynamic_tools/deployment/adapters/drum.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/drmcp/core/dynamic_tools/deployment/config.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/drmcp/core/dynamic_tools/deployment/controllers.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/drmcp/core/dynamic_tools/deployment/metadata.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/drmcp/core/dynamic_tools/deployment/register.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/drmcp/core/dynamic_tools/deployment/schemas/drum_agentic_fallback_schema.json +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/drmcp/core/dynamic_tools/deployment/schemas/drum_prediction_fallback_schema.json +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/drmcp/core/dynamic_tools/register.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/drmcp/core/dynamic_tools/schema.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/drmcp/core/memory_management/__init__.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/drmcp/core/memory_management/manager.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/drmcp/core/memory_management/memory_tools.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/drmcp/core/routes.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/drmcp/core/routes_utils.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/drmcp/core/server_life_cycle.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/drmcp/core/telemetry.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/drmcp/server.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/drmcp/test_utils/__init__.py +0 -0
- {datarobot_genai-0.2.7/src/datarobot_genai/langgraph → datarobot_genai-0.2.40/src/datarobot_genai/drmcp/test_utils/clients}/__init__.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/drmcp/tools/__init__.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/drmcp/tools/clients/__init__.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/drmcp/tools/clients/atlassian.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/drmcp/tools/clients/s3.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/drmcp/tools/confluence/__init__.py +0 -0
- {datarobot_genai-0.2.7/src/datarobot_genai/nat → datarobot_genai-0.2.40/src/datarobot_genai/drmcp/tools/gdrive}/__init__.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/drmcp/tools/jira/__init__.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/drmcp/tools/predictive/__init__.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/drmcp/tools/predictive/predict.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/drmcp/tools/predictive/predict_realtime.py +0 -0
- /datarobot_genai-0.2.7/src/datarobot_genai/py.typed → /datarobot_genai-0.2.40/src/datarobot_genai/langgraph/__init__.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/langgraph/agent.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/langgraph/mcp.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/llama_index/__init__.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/llama_index/agent.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/llama_index/base.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/llama_index/mcp.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/nat/datarobot_auth_provider.py +0 -0
- {datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/nat/datarobot_llm_providers.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: datarobot-genai
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.40
|
|
4
4
|
Summary: Generic helpers for GenAI
|
|
5
5
|
Project-URL: Homepage, https://github.com/datarobot-oss/datarobot-genai
|
|
6
6
|
Author: DataRobot, Inc.
|
|
@@ -25,6 +25,8 @@ Requires-Dist: pypdf<7.0.0,>=6.1.3
|
|
|
25
25
|
Requires-Dist: ragas<0.4.0,>=0.3.8
|
|
26
26
|
Requires-Dist: requests<3.0.0,>=2.32.4
|
|
27
27
|
Provides-Extra: crewai
|
|
28
|
+
Requires-Dist: anthropic<1.0.0,~=0.71.0; extra == 'crewai'
|
|
29
|
+
Requires-Dist: azure-ai-inference<2.0.0,>=1.0.0b9; extra == 'crewai'
|
|
28
30
|
Requires-Dist: crewai-tools[mcp]<0.77.0,>=0.69.0; extra == 'crewai'
|
|
29
31
|
Requires-Dist: crewai>=1.1.0; extra == 'crewai'
|
|
30
32
|
Requires-Dist: opentelemetry-instrumentation-crewai<1.0.0,>=0.40.5; extra == 'crewai'
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "datarobot-genai"
|
|
7
|
-
version = "0.2.
|
|
7
|
+
version = "0.2.40"
|
|
8
8
|
description = "Generic helpers for GenAI"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.10, <3.13"
|
|
@@ -40,6 +40,8 @@ datarobot_auth_provider = "datarobot_genai.nat.datarobot_auth_provider"
|
|
|
40
40
|
|
|
41
41
|
[project.optional-dependencies]
|
|
42
42
|
crewai = [
|
|
43
|
+
"anthropic~=0.71.0,<1.0.0", # Needed for integration with anthropic endpoints
|
|
44
|
+
"azure-ai-inference>=1.0.0b9,<2.0.0", # Needed for integration with azure endpoints
|
|
43
45
|
"crewai>=1.1.0",
|
|
44
46
|
"crewai-tools[mcp]>=0.69.0,<0.77.0",
|
|
45
47
|
"opentelemetry-instrumentation-crewai>=0.40.5,<1.0.0",
|
|
@@ -128,6 +130,7 @@ dev = [
|
|
|
128
130
|
"pytest-asyncio>=0.23.5",
|
|
129
131
|
"responses>=0.25.8",
|
|
130
132
|
"ipdb>=0.13.13",
|
|
133
|
+
"aioresponses>=0.7.8",
|
|
131
134
|
]
|
|
132
135
|
|
|
133
136
|
|
|
@@ -203,6 +206,9 @@ asyncio_mode = "auto"
|
|
|
203
206
|
source = ["datarobot_genai"]
|
|
204
207
|
omit = [
|
|
205
208
|
"*/__init__.py",
|
|
209
|
+
"*/test_utils/*",
|
|
210
|
+
# nat requires Python >=3.11, can't be imported on 3.10 for coverage
|
|
211
|
+
"*/nat/*",
|
|
206
212
|
]
|
|
207
213
|
|
|
208
214
|
[tool.coverage.report]
|
{datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/core/cli/agent_kernel.py
RENAMED
|
@@ -107,7 +107,10 @@ class AgentKernel:
|
|
|
107
107
|
stream: bool = False,
|
|
108
108
|
config: Any | None = None,
|
|
109
109
|
) -> ChatCompletion | Stream[ChatCompletionChunk]:
|
|
110
|
-
|
|
110
|
+
if config is not None:
|
|
111
|
+
chat_api_url = f"http://localhost:{config.local_dev_port}"
|
|
112
|
+
else:
|
|
113
|
+
chat_api_url = self.base_url
|
|
111
114
|
print(chat_api_url)
|
|
112
115
|
|
|
113
116
|
return self._do_chat_completion(chat_api_url, user_prompt, completion_json, stream=stream)
|
|
@@ -12,17 +12,23 @@
|
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
import logging
|
|
15
|
+
import os
|
|
15
16
|
import warnings
|
|
16
17
|
from typing import Any
|
|
18
|
+
from typing import Protocol
|
|
17
19
|
|
|
20
|
+
import aiohttp
|
|
18
21
|
import jwt
|
|
19
|
-
from datarobot.auth.datarobot.oauth import AsyncOAuth as
|
|
22
|
+
from datarobot.auth.datarobot.oauth import AsyncOAuth as DatarobotOAuthClient
|
|
23
|
+
from datarobot.auth.exceptions import OAuthProviderNotFound
|
|
24
|
+
from datarobot.auth.exceptions import OAuthValidationErr
|
|
20
25
|
from datarobot.auth.identity import Identity
|
|
21
|
-
from datarobot.auth.oauth import
|
|
26
|
+
from datarobot.auth.oauth import OAuthToken
|
|
22
27
|
from datarobot.auth.session import AuthCtx
|
|
23
28
|
from datarobot.core.config import DataRobotAppFrameworkBaseSettings
|
|
24
29
|
from datarobot.models.genai.agent.auth import ToolAuth
|
|
25
30
|
from datarobot.models.genai.agent.auth import get_authorization_context
|
|
31
|
+
from mypyc.ir.ops import Sequence
|
|
26
32
|
from pydantic import BaseModel
|
|
27
33
|
|
|
28
34
|
logger = logging.getLogger(__name__)
|
|
@@ -183,52 +189,203 @@ class AuthContextHeaderHandler:
|
|
|
183
189
|
return None
|
|
184
190
|
|
|
185
191
|
|
|
192
|
+
# --- OAuth Token Provider Implementation ---
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
class TokenRetriever(Protocol):
|
|
196
|
+
"""Protocol for OAuth token retrievers."""
|
|
197
|
+
|
|
198
|
+
def filter_identities(self, identities: Sequence[Identity]) -> list[Identity]:
|
|
199
|
+
"""Filter identities to only those valid for this retriever implementation."""
|
|
200
|
+
...
|
|
201
|
+
|
|
202
|
+
async def refresh_access_token(self, identity: Identity) -> OAuthToken:
|
|
203
|
+
"""Refresh the access token for the given identity ID.
|
|
204
|
+
|
|
205
|
+
Parameters
|
|
206
|
+
----------
|
|
207
|
+
identity_id : str
|
|
208
|
+
The provider identity ID to refresh the token for.
|
|
209
|
+
|
|
210
|
+
Returns
|
|
211
|
+
-------
|
|
212
|
+
OAuthToken
|
|
213
|
+
The refreshed OAuth token.
|
|
214
|
+
"""
|
|
215
|
+
...
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
class DatarobotTokenRetriever:
|
|
219
|
+
"""Retrieves OAuth tokens using the DataRobot platform."""
|
|
220
|
+
|
|
221
|
+
def __init__(self) -> None:
|
|
222
|
+
self._client = DatarobotOAuthClient()
|
|
223
|
+
|
|
224
|
+
def filter_identities(self, identities: Sequence[Identity]) -> list[Identity]:
|
|
225
|
+
"""Filter oauth2 identities to only those with provider_identity_id.
|
|
226
|
+
|
|
227
|
+
The `provider_identity_id` is required in order to identify the provider
|
|
228
|
+
and retrieve the access token from DataRobot OAuth Providers service.
|
|
229
|
+
"""
|
|
230
|
+
return [i for i in identities if i.type == "oauth2" and i.provider_identity_id]
|
|
231
|
+
|
|
232
|
+
async def refresh_access_token(self, identity: Identity) -> OAuthToken:
|
|
233
|
+
"""Refresh the access token using DataRobot's OAuth client."""
|
|
234
|
+
return await self._client.refresh_access_token(identity_id=identity.provider_identity_id)
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
class AuthlibTokenRetriever:
|
|
238
|
+
"""Retrieves OAuth tokens from a generic Authlib-based endpoint."""
|
|
239
|
+
|
|
240
|
+
def __init__(self, application_endpoint: str) -> None:
|
|
241
|
+
if not application_endpoint:
|
|
242
|
+
raise ValueError("AuthlibTokenRetriever requires 'application_endpoint'.")
|
|
243
|
+
self.application_endpoint = application_endpoint.rstrip("/")
|
|
244
|
+
|
|
245
|
+
def filter_identities(self, identities: Sequence[Identity]) -> list[Identity]:
|
|
246
|
+
"""Filter identities to only OAuth2 identities."""
|
|
247
|
+
return [i for i in identities if i.type == "oauth2" and i.provider_identity_id is None]
|
|
248
|
+
|
|
249
|
+
async def refresh_access_token(self, identity: Identity) -> OAuthToken:
|
|
250
|
+
"""Retrieve an OAuth token via an HTTP POST request.
|
|
251
|
+
|
|
252
|
+
Parameters
|
|
253
|
+
----------
|
|
254
|
+
identity : Identity
|
|
255
|
+
The identity to retrieve the token for.
|
|
256
|
+
|
|
257
|
+
Returns
|
|
258
|
+
-------
|
|
259
|
+
OAuthToken
|
|
260
|
+
The retrieved OAuth token.
|
|
261
|
+
"""
|
|
262
|
+
api_token = os.environ.get("DATAROBOT_API_TOKEN")
|
|
263
|
+
if not api_token:
|
|
264
|
+
raise ValueError("DATAROBOT_API_TOKEN environment variable is required but not set.")
|
|
265
|
+
|
|
266
|
+
token_url = f"{self.application_endpoint}/oauth/token/"
|
|
267
|
+
headers = {"Authorization": f"Bearer {api_token}"}
|
|
268
|
+
payload = {"identity_id": identity.id}
|
|
269
|
+
timeout = aiohttp.ClientTimeout(total=30)
|
|
270
|
+
|
|
271
|
+
try:
|
|
272
|
+
async with aiohttp.ClientSession(timeout=timeout) as session:
|
|
273
|
+
async with session.post(token_url, headers=headers, json=payload) as response:
|
|
274
|
+
response.raise_for_status()
|
|
275
|
+
data = await response.json()
|
|
276
|
+
logger.debug(f"Retrieved access token from {token_url}")
|
|
277
|
+
return OAuthToken(**data)
|
|
278
|
+
except aiohttp.ClientError as e:
|
|
279
|
+
logger.error(f"Error retrieving token from {token_url}: {e}")
|
|
280
|
+
raise
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
class OAuthConfig(BaseModel):
|
|
284
|
+
"""Configuration extracted from AuthCtx metadata for OAuth operations."""
|
|
285
|
+
|
|
286
|
+
implementation: str = "datarobot"
|
|
287
|
+
application_endpoint: str | None = None
|
|
288
|
+
|
|
289
|
+
@classmethod
|
|
290
|
+
def from_auth_ctx(cls, auth_ctx: AuthCtx) -> "OAuthConfig":
|
|
291
|
+
metadata = auth_ctx.metadata or {}
|
|
292
|
+
return cls(
|
|
293
|
+
implementation=metadata.get("oauth_implementation", "datarobot"),
|
|
294
|
+
application_endpoint=metadata.get("application_endpoint"),
|
|
295
|
+
)
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
def create_token_retriever(config: OAuthConfig) -> TokenRetriever:
|
|
299
|
+
"""Create a token retriever based on the OAuth configuration.
|
|
300
|
+
|
|
301
|
+
Parameters
|
|
302
|
+
----------
|
|
303
|
+
config : OAuthConfig
|
|
304
|
+
The OAuth configuration specifying implementation type and endpoints.
|
|
305
|
+
|
|
306
|
+
Returns
|
|
307
|
+
-------
|
|
308
|
+
TokenRetriever
|
|
309
|
+
The configured token retriever instance.
|
|
310
|
+
"""
|
|
311
|
+
if config.implementation == "datarobot":
|
|
312
|
+
return DatarobotTokenRetriever()
|
|
313
|
+
|
|
314
|
+
if config.implementation == "authlib":
|
|
315
|
+
if not config.application_endpoint:
|
|
316
|
+
raise ValueError("Required 'application_endpoint' not found in metadata.")
|
|
317
|
+
return AuthlibTokenRetriever(config.application_endpoint)
|
|
318
|
+
|
|
319
|
+
raise ValueError(
|
|
320
|
+
f"Unsupported OAuth implementation: '{config.implementation}'. "
|
|
321
|
+
f"Supported values: datarobot, authlib."
|
|
322
|
+
)
|
|
323
|
+
|
|
324
|
+
|
|
186
325
|
class AsyncOAuthTokenProvider:
|
|
187
|
-
"""
|
|
326
|
+
"""Provides OAuth tokens for authorized users.
|
|
327
|
+
|
|
328
|
+
This class manages OAuth token retrieval for users with multiple identity providers.
|
|
329
|
+
It uses either DataRobot or Authlib as the OAuth token storage and refresh backend
|
|
330
|
+
based on the auth context metadata.
|
|
331
|
+
"""
|
|
188
332
|
|
|
189
333
|
def __init__(self, auth_ctx: AuthCtx) -> None:
|
|
334
|
+
"""Initialize the provider with an authorization context.
|
|
335
|
+
|
|
336
|
+
Parameters
|
|
337
|
+
----------
|
|
338
|
+
auth_ctx : AuthCtx
|
|
339
|
+
The authorization context containing user identities and metadata.
|
|
340
|
+
"""
|
|
190
341
|
self.auth_ctx = auth_ctx
|
|
191
|
-
|
|
342
|
+
config = OAuthConfig.from_auth_ctx(auth_ctx)
|
|
343
|
+
self._retriever = create_token_retriever(config)
|
|
192
344
|
|
|
193
345
|
def _get_identity(self, provider_type: str | None) -> Identity:
|
|
194
|
-
"""
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
raise ValueError("No identities found in authorization context.")
|
|
346
|
+
"""Get identity from auth context, filtered by provider_type if specified."""
|
|
347
|
+
oauth_identities = self._retriever.filter_identities(self.auth_ctx.identities)
|
|
348
|
+
if not oauth_identities:
|
|
349
|
+
raise OAuthProviderNotFound("No OAuth provider found.")
|
|
199
350
|
|
|
200
351
|
if provider_type is None:
|
|
201
|
-
if len(
|
|
202
|
-
raise
|
|
203
|
-
"Multiple
|
|
352
|
+
if len(oauth_identities) > 1:
|
|
353
|
+
raise OAuthValidationErr(
|
|
354
|
+
"Multiple OAuth providers found. Specify 'provider_type' parameter."
|
|
204
355
|
)
|
|
205
|
-
return
|
|
206
|
-
|
|
207
|
-
identity = next((id for id in identities if id.provider_type == provider_type), None)
|
|
356
|
+
return oauth_identities[0]
|
|
208
357
|
|
|
358
|
+
identity = next((i for i in oauth_identities if i.provider_type == provider_type), None)
|
|
209
359
|
if identity is None:
|
|
210
|
-
raise
|
|
211
|
-
|
|
360
|
+
raise OAuthValidationErr(f"No identity found for provider '{provider_type}'.")
|
|
212
361
|
return identity
|
|
213
362
|
|
|
214
363
|
async def get_token(self, auth_type: ToolAuth, provider_type: str | None = None) -> str:
|
|
215
|
-
"""Get OAuth access token
|
|
364
|
+
"""Get an OAuth access token for the specified auth type and provider.
|
|
365
|
+
|
|
366
|
+
Parameters
|
|
367
|
+
----------
|
|
368
|
+
auth_type : ToolAuth
|
|
369
|
+
Authentication type (only OBO is supported).
|
|
370
|
+
provider_type : str, optional
|
|
371
|
+
The specific provider to use (e.g., 'google'). Required if multiple
|
|
372
|
+
identities are available.
|
|
373
|
+
|
|
374
|
+
Returns
|
|
375
|
+
-------
|
|
376
|
+
str
|
|
377
|
+
The retrieved OAuth access token.
|
|
378
|
+
|
|
379
|
+
Raises
|
|
380
|
+
------
|
|
381
|
+
ValueError
|
|
382
|
+
If the auth type is unsupported or if a suitable identity cannot be found.
|
|
383
|
+
"""
|
|
216
384
|
if auth_type != ToolAuth.OBO:
|
|
217
385
|
raise ValueError(
|
|
218
|
-
f"Unsupported auth type: {auth_type}. Only
|
|
386
|
+
f"Unsupported auth type: {auth_type}. Only OBO (on-behalf-of) is supported."
|
|
219
387
|
)
|
|
220
388
|
|
|
221
389
|
identity = self._get_identity(provider_type)
|
|
222
|
-
token_data = await self.
|
|
223
|
-
identity_id=identity.provider_identity_id
|
|
224
|
-
)
|
|
390
|
+
token_data = await self._retriever.refresh_access_token(identity)
|
|
225
391
|
return token_data.access_token
|
|
226
|
-
|
|
227
|
-
def _create_oauth_client(self) -> AsyncOAuthComponent:
|
|
228
|
-
"""Create either DataRobot or Authlib OAuth client based on
|
|
229
|
-
authorization context.
|
|
230
|
-
|
|
231
|
-
Note: at the moment, only DataRobot OAuth client is supported.
|
|
232
|
-
"""
|
|
233
|
-
logger.debug("Using DataRobot OAuth client")
|
|
234
|
-
return DatarobotAsyncOAuthClient()
|
|
@@ -19,11 +19,11 @@ A reusable library for building Model Context Protocol (MCP) servers with DataRo
|
|
|
19
19
|
"""
|
|
20
20
|
|
|
21
21
|
# Export main server components
|
|
22
|
+
from datarobot_genai.drmcp.test_utils.clients.openai import OpenAILLMMCPClient
|
|
22
23
|
from datarobot_genai.drmcp.test_utils.mcp_utils_ete import ete_test_mcp_session
|
|
23
24
|
from datarobot_genai.drmcp.test_utils.mcp_utils_ete import get_dr_mcp_server_url
|
|
24
25
|
from datarobot_genai.drmcp.test_utils.mcp_utils_ete import get_headers
|
|
25
26
|
from datarobot_genai.drmcp.test_utils.mcp_utils_integration import integration_test_mcp_session
|
|
26
|
-
from datarobot_genai.drmcp.test_utils.openai_llm_mcp_client import LLMMCPClient
|
|
27
27
|
from datarobot_genai.drmcp.test_utils.tool_base_ete import ETETestExpectations
|
|
28
28
|
from datarobot_genai.drmcp.test_utils.tool_base_ete import ToolBaseE2E
|
|
29
29
|
from datarobot_genai.drmcp.test_utils.tool_base_ete import ToolCallTestExpectations
|
|
@@ -70,7 +70,7 @@ __all__ = [
|
|
|
70
70
|
"get_dr_mcp_server_url",
|
|
71
71
|
"get_headers",
|
|
72
72
|
"ete_test_mcp_session",
|
|
73
|
-
"
|
|
73
|
+
"OpenAILLMMCPClient",
|
|
74
74
|
"ETETestExpectations",
|
|
75
75
|
"ToolBaseE2E",
|
|
76
76
|
"ToolCallTestExpectations",
|
|
@@ -31,6 +31,124 @@ from .constants import DEFAULT_DATAROBOT_ENDPOINT
|
|
|
31
31
|
from .constants import RUNTIME_PARAM_ENV_VAR_NAME_PREFIX
|
|
32
32
|
|
|
33
33
|
|
|
34
|
+
class MCPToolConfig(BaseSettings):
|
|
35
|
+
"""Tool configuration for MCP server."""
|
|
36
|
+
|
|
37
|
+
enable_predictive_tools: bool = Field(
|
|
38
|
+
default=True,
|
|
39
|
+
validation_alias=AliasChoices(
|
|
40
|
+
RUNTIME_PARAM_ENV_VAR_NAME_PREFIX + "ENABLE_PREDICTIVE_TOOLS",
|
|
41
|
+
"ENABLE_PREDICTIVE_TOOLS",
|
|
42
|
+
),
|
|
43
|
+
description="Enable/disable predictive tools",
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
enable_jira_tools: bool = Field(
|
|
47
|
+
default=False,
|
|
48
|
+
validation_alias=AliasChoices(
|
|
49
|
+
RUNTIME_PARAM_ENV_VAR_NAME_PREFIX + "ENABLE_JIRA_TOOLS",
|
|
50
|
+
"ENABLE_JIRA_TOOLS",
|
|
51
|
+
),
|
|
52
|
+
description="Enable/disable Jira tools",
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
enable_confluence_tools: bool = Field(
|
|
56
|
+
default=False,
|
|
57
|
+
validation_alias=AliasChoices(
|
|
58
|
+
RUNTIME_PARAM_ENV_VAR_NAME_PREFIX + "ENABLE_CONFLUENCE_TOOLS",
|
|
59
|
+
"ENABLE_CONFLUENCE_TOOLS",
|
|
60
|
+
),
|
|
61
|
+
description="Enable/disable Confluence tools",
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
enable_gdrive_tools: bool = Field(
|
|
65
|
+
default=False,
|
|
66
|
+
validation_alias=AliasChoices(
|
|
67
|
+
RUNTIME_PARAM_ENV_VAR_NAME_PREFIX + "ENABLE_GDRIVE_TOOLS",
|
|
68
|
+
"ENABLE_GDRIVE_TOOLS",
|
|
69
|
+
),
|
|
70
|
+
description="Enable/disable GDrive tools",
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
enable_microsoft_graph_tools: bool = Field(
|
|
74
|
+
default=False,
|
|
75
|
+
validation_alias=AliasChoices(
|
|
76
|
+
RUNTIME_PARAM_ENV_VAR_NAME_PREFIX + "ENABLE_MICROSOFT_GRAPH_TOOLS",
|
|
77
|
+
"ENABLE_MICROSOFT_GRAPH_TOOLS",
|
|
78
|
+
),
|
|
79
|
+
description="Enable/disable Sharepoint tools",
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
is_atlassian_oauth_provider_configured: bool = Field(
|
|
83
|
+
default=False,
|
|
84
|
+
validation_alias=AliasChoices(
|
|
85
|
+
RUNTIME_PARAM_ENV_VAR_NAME_PREFIX + "IS_ATLASSIAN_OAUTH_PROVIDER_CONFIGURED",
|
|
86
|
+
"IS_ATLASSIAN_OAUTH_PROVIDER_CONFIGURED",
|
|
87
|
+
),
|
|
88
|
+
description="Whether Atlassian OAuth provider is configured for Atlassian integration",
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
@property
|
|
92
|
+
def is_atlassian_oauth_configured(self) -> bool:
|
|
93
|
+
"""Check if Atlassian OAuth is configured via provider flag or environment variables."""
|
|
94
|
+
return self.is_atlassian_oauth_provider_configured or bool(
|
|
95
|
+
os.getenv("ATLASSIAN_CLIENT_ID") and os.getenv("ATLASSIAN_CLIENT_SECRET")
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
is_google_oauth_provider_configured: bool = Field(
|
|
99
|
+
default=False,
|
|
100
|
+
validation_alias=AliasChoices(
|
|
101
|
+
RUNTIME_PARAM_ENV_VAR_NAME_PREFIX + "IS_GOOGLE_OAUTH_PROVIDER_CONFIGURED",
|
|
102
|
+
"IS_GOOGLE_OAUTH_PROVIDER_CONFIGURED",
|
|
103
|
+
),
|
|
104
|
+
description="Whether Google OAuth provider is configured for Google integration",
|
|
105
|
+
)
|
|
106
|
+
|
|
107
|
+
@property
|
|
108
|
+
def is_google_oauth_configured(self) -> bool:
|
|
109
|
+
return self.is_google_oauth_provider_configured or bool(
|
|
110
|
+
os.getenv("GOOGLE_CLIENT_ID") and os.getenv("GOOGLE_CLIENT_SECRET")
|
|
111
|
+
)
|
|
112
|
+
|
|
113
|
+
is_microsoft_oauth_provider_configured: bool = Field(
|
|
114
|
+
default=False,
|
|
115
|
+
validation_alias=AliasChoices(
|
|
116
|
+
RUNTIME_PARAM_ENV_VAR_NAME_PREFIX + "IS_MICROSOFT_OAUTH_PROVIDER_CONFIGURED",
|
|
117
|
+
"IS_MICROSOFT_OAUTH_PROVIDER_CONFIGURED",
|
|
118
|
+
),
|
|
119
|
+
description="Whether Microsoft OAuth provider is configured for Microsoft integration",
|
|
120
|
+
)
|
|
121
|
+
|
|
122
|
+
@property
|
|
123
|
+
def is_microsoft_oauth_configured(self) -> bool:
|
|
124
|
+
return self.is_microsoft_oauth_provider_configured or bool(
|
|
125
|
+
os.getenv("MICROSOFT_CLIENT_ID") and os.getenv("MICROSOFT_CLIENT_SECRET")
|
|
126
|
+
)
|
|
127
|
+
|
|
128
|
+
@field_validator(
|
|
129
|
+
"enable_predictive_tools",
|
|
130
|
+
"enable_jira_tools",
|
|
131
|
+
"enable_confluence_tools",
|
|
132
|
+
"enable_gdrive_tools",
|
|
133
|
+
"enable_microsoft_graph_tools",
|
|
134
|
+
"is_atlassian_oauth_provider_configured",
|
|
135
|
+
"is_google_oauth_provider_configured",
|
|
136
|
+
"is_microsoft_oauth_provider_configured",
|
|
137
|
+
mode="before",
|
|
138
|
+
)
|
|
139
|
+
@classmethod
|
|
140
|
+
def validate_runtime_params(cls, v: Any) -> Any:
|
|
141
|
+
"""Validate runtime parameters."""
|
|
142
|
+
return extract_datarobot_runtime_param_payload(v)
|
|
143
|
+
|
|
144
|
+
model_config = SettingsConfigDict(
|
|
145
|
+
env_file=".env",
|
|
146
|
+
case_sensitive=False,
|
|
147
|
+
env_file_encoding="utf-8",
|
|
148
|
+
extra="ignore",
|
|
149
|
+
)
|
|
150
|
+
|
|
151
|
+
|
|
34
152
|
class MCPServerConfig(BaseSettings):
|
|
35
153
|
"""MCP Server configuration using pydantic settings."""
|
|
36
154
|
|
|
@@ -188,62 +306,11 @@ class MCPServerConfig(BaseSettings):
|
|
|
188
306
|
),
|
|
189
307
|
description="Enable/disable memory management",
|
|
190
308
|
)
|
|
191
|
-
enable_predictive_tools: bool = Field(
|
|
192
|
-
default=True,
|
|
193
|
-
validation_alias=AliasChoices(
|
|
194
|
-
RUNTIME_PARAM_ENV_VAR_NAME_PREFIX + "ENABLE_PREDICTIVE_TOOLS",
|
|
195
|
-
"ENABLE_PREDICTIVE_TOOLS",
|
|
196
|
-
),
|
|
197
|
-
description="Enable/disable predictive tools",
|
|
198
|
-
)
|
|
199
309
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
validation_alias=AliasChoices(
|
|
204
|
-
RUNTIME_PARAM_ENV_VAR_NAME_PREFIX + "ENABLE_JIRA_TOOLS",
|
|
205
|
-
"ENABLE_JIRA_TOOLS",
|
|
206
|
-
),
|
|
207
|
-
description="Enable/disable Jira tools",
|
|
208
|
-
)
|
|
209
|
-
is_jira_oauth_provider_configured: bool = Field(
|
|
210
|
-
default=False,
|
|
211
|
-
validation_alias=AliasChoices(
|
|
212
|
-
RUNTIME_PARAM_ENV_VAR_NAME_PREFIX + "IS_JIRA_OAUTH_PROVIDER_CONFIGURED",
|
|
213
|
-
"IS_JIRA_OAUTH_PROVIDER_CONFIGURED",
|
|
214
|
-
),
|
|
215
|
-
description="Whether Jira OAuth provider is configured for Jira integration",
|
|
216
|
-
)
|
|
217
|
-
|
|
218
|
-
@property
|
|
219
|
-
def is_jira_oauth_configured(self) -> bool:
|
|
220
|
-
return self.is_jira_oauth_provider_configured or bool(
|
|
221
|
-
os.getenv("JIRA_CLIENT_ID") and os.getenv("JIRA_CLIENT_SECRET")
|
|
222
|
-
)
|
|
223
|
-
|
|
224
|
-
# Confluence tools
|
|
225
|
-
enable_confluence_tools: bool = Field(
|
|
226
|
-
default=False,
|
|
227
|
-
validation_alias=AliasChoices(
|
|
228
|
-
RUNTIME_PARAM_ENV_VAR_NAME_PREFIX + "ENABLE_CONFLUENCE_TOOLS",
|
|
229
|
-
"ENABLE_CONFLUENCE_TOOLS",
|
|
230
|
-
),
|
|
231
|
-
description="Enable/disable Confluence tools",
|
|
310
|
+
tool_config: MCPToolConfig = Field(
|
|
311
|
+
default_factory=MCPToolConfig,
|
|
312
|
+
description="Tool configuration",
|
|
232
313
|
)
|
|
233
|
-
is_confluence_oauth_provider_configured: bool = Field(
|
|
234
|
-
default=False,
|
|
235
|
-
validation_alias=AliasChoices(
|
|
236
|
-
RUNTIME_PARAM_ENV_VAR_NAME_PREFIX + "IS_CONFLUENCE_OAUTH_PROVIDER_CONFIGURED",
|
|
237
|
-
"IS_CONFLUENCE_OAUTH_PROVIDER_CONFIGURED",
|
|
238
|
-
),
|
|
239
|
-
description="Whether Confluence OAuth provider is configured for Confluence integration",
|
|
240
|
-
)
|
|
241
|
-
|
|
242
|
-
@property
|
|
243
|
-
def is_confluence_oauth_configured(self) -> bool:
|
|
244
|
-
return self.is_confluence_oauth_provider_configured or bool(
|
|
245
|
-
os.getenv("CONFLUENCE_CLIENT_ID") and os.getenv("CONFLUENCE_CLIENT_SECRET")
|
|
246
|
-
)
|
|
247
314
|
|
|
248
315
|
@field_validator(
|
|
249
316
|
"otel_attributes",
|
|
@@ -267,11 +334,6 @@ class MCPServerConfig(BaseSettings):
|
|
|
267
334
|
"mcp_server_register_dynamic_tools_on_startup",
|
|
268
335
|
"tool_registration_duplicate_behavior",
|
|
269
336
|
"mcp_server_register_dynamic_prompts_on_startup",
|
|
270
|
-
"enable_predictive_tools",
|
|
271
|
-
"enable_jira_tools",
|
|
272
|
-
"is_jira_oauth_provider_configured",
|
|
273
|
-
"enable_confluence_tools",
|
|
274
|
-
"is_confluence_oauth_provider_configured",
|
|
275
337
|
mode="before",
|
|
276
338
|
)
|
|
277
339
|
@classmethod
|
{datarobot_genai-0.2.7 → datarobot_genai-0.2.40}/src/datarobot_genai/drmcp/core/dr_mcp_server.py
RENAMED
|
@@ -31,9 +31,6 @@ from .dynamic_prompts.register import register_prompts_from_datarobot_prompt_man
|
|
|
31
31
|
from .dynamic_tools.deployment.register import register_tools_of_datarobot_deployments
|
|
32
32
|
from .logging import MCPLogging
|
|
33
33
|
from .mcp_instance import mcp
|
|
34
|
-
from .mcp_server_tools import get_all_available_tags # noqa # pylint: disable=unused-import
|
|
35
|
-
from .mcp_server_tools import get_tool_info_by_name # noqa # pylint: disable=unused-import
|
|
36
|
-
from .mcp_server_tools import list_tools_by_tags # noqa # pylint: disable=unused-import
|
|
37
34
|
from .memory_management.manager import MemoryManager
|
|
38
35
|
from .routes import register_routes
|
|
39
36
|
from .routes_utils import prefix_mount_path
|
|
@@ -20,7 +20,7 @@ from collections.abc import Callable
|
|
|
20
20
|
from typing import Any
|
|
21
21
|
from typing import TypeVar
|
|
22
22
|
|
|
23
|
-
from .exceptions import
|
|
23
|
+
from fastmcp.exceptions import ToolError
|
|
24
24
|
|
|
25
25
|
# Secret patterns to redact from logs
|
|
26
26
|
SECRET_PATTERNS = [
|
|
@@ -93,6 +93,6 @@ def log_execution(func: F) -> F:
|
|
|
93
93
|
return result
|
|
94
94
|
except Exception as e:
|
|
95
95
|
error_msg = _log_error(logger, func.__name__, e, args=args, kwargs=kwargs)
|
|
96
|
-
raise
|
|
96
|
+
raise ToolError(error_msg)
|
|
97
97
|
|
|
98
98
|
return wrapper # type: ignore[return-value]
|