datarobot_genai.drmcpbase.dynamic_tools.deployment.adapters.drum
drum
DrumTargetType
Bases: StrEnum
Source code in datarobot_genai/drmcpbase/dynamic_tools/deployment/adapters/drum.py
prediction_types
classmethod
Get the set of DRUM target types that correspond to structured predictions.
Source code in datarobot_genai/drmcpbase/dynamic_tools/deployment/adapters/drum.py
DrumMetadataAdapter
Bases: MetadataBase
Adapter for DRUM deployment metadata.
Source code in datarobot_genai/drmcpbase/dynamic_tools/deployment/adapters/drum.py
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 | |
supports_chat_api
property
Whether the deployment advertises chat completions support.
Sourced from the deployment /capabilities/ API
(supports_chat_api). Defaults to False when absent so legacy
deployments without this flag retain their existing endpoint mapping.
endpoint
property
Return the appropriate endpoint for the DRUM target type.
When the deployment advertises supports_chat_api=True, route to
/chat/completions regardless of target type. This is required for
chat-style TextGeneration deployments (Guarded RAG, LLM blueprints,
NIM-served models) which implement only the DRUM chat() hook and
return 503 on /predictions.
__init__
Initialize adapter with validated metadata.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
metadata
|
dict[str, Any]
|
Dictionary containing at minimum a 'target_type' key. |
required |
Note
Use class methods from_deployment_metadata() or from_target_type()
for construction instead of calling this directly.
Source code in datarobot_genai/drmcpbase/dynamic_tools/deployment/adapters/drum.py
from_deployment_metadata
classmethod
Create adapter from full deployment metadata.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
metadata
|
dict[str, Any]
|
The response retrieved from the custom model /info/ route. |
required |
Returns
DrumMetadataAdapter instance.
Raises
ValueError: If metadata is not from a DRUM deployment.
Source code in datarobot_genai/drmcpbase/dynamic_tools/deployment/adapters/drum.py
from_target_type
classmethod
Create adapter from target type only.
Used for testing/minimal setup when broader set of information from metadata built from model-metadata.yaml information is not available i.e. datarobot predictive models.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
target_type
|
str
|
The DRUM target type (e.g., 'binary', 'regression'). |
required |
Returns
DrumMetadataAdapter instance with minimal metadata.
Source code in datarobot_genai/drmcpbase/dynamic_tools/deployment/adapters/drum.py
get_default_schema
Get the default input schema for a given DRUM target type, when the deployment does not provide one. This fallback mechanism is here to lower the friction of using DRUM deployments with MCP, for more advanced use cases it is recommended to provide a custom input and expose it via model-metadata.yaml inputSchema parameter.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
target_type
|
str
|
The target type of the DRUM deployment. |
required |
Returns
A dictionary representing the default input schema wrapped in HTTP request structure.
Source code in datarobot_genai/drmcpbase/dynamic_tools/deployment/adapters/drum.py
is_drum
Check if the deployment is a DRUM deployment.
DRUM deployments are identified by the presence of both drum_server and drum_version fields in the metadata response.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
metadata
|
dict[str, Any]
|
The response retrieved from the custom model /info/ route. |
required |
Returns
True if this is a DRUM deployment, False otherwise.