Supported API operations for sending requests to the Model Endpoint

To interact with a deployed workflow, HTTP POST requests can be sent with the supported API operations to the MODEL_ENDPOINT.

The following section details the complete list of API operations available for a deployed workbench model:

Kickoff

This API operation is designed to start the workflow process using the specified inputs.

Input parameters:
  • kickoff_inputs: It is defined during task creation and provided as a Base64-encoded JSON string.
Example request:
payload = {
  "action_type": "kickoff",
  "kickoff_inputs": inputs_encoded
}

resp = requests.post(
  MODEL_ENDPOINT, 
  json={
    "request": payload
  },
  headers={"authorization": f"Bearer {CDSW_APIV2_KEY}", "Content-Type": "application/json"},
)
out = resp.json()
Response:
{
  "trace_id": "formatted-trace-id"
}

Get Configuration

This API operation retrieves the complete workflow configuration, enabling the development of custom user interfaces and experiences that operate on top of the deployed endpoint.

Input parameters: None

Example Request:
payload = {
  "action_type": "get-configuration",
}

resp = requests.post(
  MODEL_ENDPOINT, 
  json={
    "request": payload
  },
  headers={"authorization": f"Bearer {CDSW_APIV2_KEY}", "Content-Type": "application/json"},
)
out = resp.json()

Response: Returns a comprehensive workflow definition including, workflow metadata, language model configurations, agent definitions, task specifications, tool instances, and MCP instances.

Example configuration output:
{
  "configuration": {
    "agents": [
      {
        "crew_ai_backstory": "You can calculate complex mathematical expressions like ((5 + 3) * 2 - 4 / 2) or ((3+90/9)*2)+(8+(9*2)*1)+100 or even simple ones like 5 + 3.",
        "crew_ai_goal": "Because LLMs are not good at math, use the tools at your disposal to correctly calculate the value of mathematical expressions given to you.",
        ...
        "name": "Calculator Agent",
        "tool_instance_ids": [
          "888608cb-dc08-4d26-82d9-62ae52035b54"
        ]
      }
    ],
    "default_language_model_id": "5dbd9021-4d01-4e3a-8e29-4c69c4b9453a",
    "language_models": [
      {
        "generation_config": {
          "do_sample": true,
          "max_length": null,
          "max_new_tokens": 4096,
          ...
        },
        "model_id": "5dbd9021-4d01-4e3a-8e29-4c69c4b9453a",
        "model_name": "gpt-4o-mini"
      }
    ],
    "mcp_instances": [],
    "tasks": [
      {
        "assigned_agent_id": "8acc5d6c-e269-4db0-ad14-6a9ab3cd3090",
        "description": "For arithmetic expression {expression} , find the result.",
        "expected_output": "Present the result while greeting the user nicely.",
        "id": "271c6053-5113-44d3-878d-431da3ccb664"
      }
 ],
    "tool_instances": [
      {
        "id": "888608cb-dc08-4d26-82d9-62ae52035b54","is_venv_tool": true,
        "name": "Calculator Tool",
        "python_code_file_name": "tool.py",
        "python_requirements_file_name": "requirements.txt",
        "source_folder_path": "studio-data/workflows/copy_of_calculator_workflow_9mdTehB/tools/calculator_tool_vkKaav84",
        "tool_image_uri": "studio-data/dynamic_assets/tool_instance_icons/888608cb-dc08-4d26-82d9-62ae52035b54_icon.png",
        "tool_metadata": "{\"user_params\": [], \"user_params_metadata\": {}, \"status\": \"\"}"
      }
    ],
    "workflow": {
      "agent_ids": [
        "8acc5d6c-e269-4db0-ad14-6a9ab3cd3090"
      ],
      "crew_ai_process": "sequential",
      "description": "This workflow uses a Calculator Agent to accurately evaluate mathematical expressions by leveraging Pydantic for input validation and performing basic arithmetic operations based on user-provided inputs",
      "id": "2e544957-e9da-473f-9e3e-5d03948838d4",
      "is_conversational": false,
      "llm_provider_model_id": "",
      "manager_agent_id": null,
      "name": "Copy of Calculator Workflow",
      "task_ids": [
        "271c6053-5113-44d3-878d-431da3ccb664"
      ]
    }
  }
}

Get Asset Data

This API operation fetches binary assets for agents and tools.

Input parameter:
  • get_asset_data_inputs: Retrieves a list of asset URIs, such as agent icons.
Example Request:
payload = {
  "action_type": "get-asset-data",
  "get_asset_data_inputs": [
    "studio-data/dynamic_assets/tool_instance_icons/888608cb-dc08-4d26-82d9-62ae52035b54_icon.png"
  ]
}

resp = requests.post(
  MODEL_ENDPOINT, 
  json={
    "request": payload
  },
  headers={"authorization": f"Bearer {CDSW_APIV2_KEY}", "Content-Type": "application/json"},
)
out = resp.json()
Response:
{
  "asset_data": {
    "studio-data/dynamic_assets/tool_instance_icons/888608cb-dc08-4d26-82d9-62ae52035b54_icon.png": "base64-encoded-data"
  },
  "unavailable_assets": ["list-of-missing-assets"]
}

Get MCP Tool Definitions

This API operation retrieves Model Context Protocol (MCP) tool definitions.

Input parameters: None

Example Request:
payload = {
  "action_type": "get-mcp-tool-definitions",
}

resp = requests.post(
  MODEL_ENDPOINT, 
  json={
    "request": payload
  },
  headers={"authorization": f"Bearer {CDSW_APIV2_KEY}", "Content-Type": "application/json"},
)
out = resp.json()
Response:
{
  "ready": true,
  "mcp_tool_definitions": {
    "mcp_instance_id": [
      {
        "name": "tool_name",
        "description": "tool_description", 
        "parameters": {...}
      }
    ]
  }
}