BerriAI/litellm · error · ValueError

litellm_params is required for WatsonxOrchestrateA2AConfig (

Error message

litellm_params is required for WatsonxOrchestrateA2AConfig (must contain cp4d_host, instance_id, wxo_agent_id, api_key)

What it means

WatsonxOrchestrateA2AConfig.handle_non_streaming raises ValueError when kwargs lacks `litellm_params`. The watsonx Orchestrate handler needs cp4d_host, instance_id, wxo_agent_id and api_key from litellm_params to build the runs API URL and authenticate.

Source

Thrown at litellm/a2a_protocol/providers/watsonx_orchestrate/config.py:27

from litellm.a2a_protocol.providers.watsonx_orchestrate.handler import (
    WatsonxOrchestrateHandler,
)


class WatsonxOrchestrateA2AConfig(BaseA2AProviderConfig):
    """A2A bridge for IBM watsonx Orchestrate (REST runs API + poll/SSE)."""

    async def handle_non_streaming(
        self,
        request_id: str,
        params: dict[str, Any],
        api_base: str | None = None,
        **kwargs: Any,
    ) -> dict[str, Any]:
        """Handle a non-streaming A2A request via WXO runs API."""
        litellm_params: Final = kwargs.get("litellm_params")
        if not litellm_params:
            raise ValueError(
                "litellm_params is required for WatsonxOrchestrateA2AConfig "
                "(must contain cp4d_host, instance_id, wxo_agent_id, api_key)"
            )
        return await WatsonxOrchestrateHandler.handle_non_streaming(
            request_id=request_id,
            params=params,
            litellm_params=litellm_params,
        )

    async def handle_streaming(
        self,
        request_id: str,
        params: dict[str, Any],
        api_base: str | None = None,
        **kwargs: Any,
    ) -> AsyncIterator[dict[str, Any]]:
        """Handle a streaming A2A request via WXO streaming runs API."""
        litellm_params: Final = kwargs.get("litellm_params")

View on GitHub (pinned to 6c2dcb801b)

Solutions

  1. Pass litellm_params containing cp4d_host, instance_id, wxo_agent_id and api_key
  2. Configure the watsonx Orchestrate deployment in LiteLLM with all four fields so litellm_params is complete

Example fix

# before
resp = await config.handle_non_streaming(request_id=rid, params=params)
# after
resp = await config.handle_non_streaming(request_id=rid, params=params, litellm_params={"cp4d_host": "https://cpd.example.com", "instance_id": "...", "wxo_agent_id": "...", "api_key": "..."})
Defensive patterns

Strategy: validation

Validate before calling

required = ("cp4d_host", "instance_id", "wxo_agent_id", "api_key")
missing = [k for k in required if not kwargs.get("litellm_params", {}).get(k)]
if missing:
    raise ValueError(f"watsonx orchestrate params missing: {missing}")

Prevention

When it happens

Trigger: Calling the watsonx_orchestrate config handler without litellm_params in kwargs.

Common situations: Manual handler dispatch in tests/custom routers; watsonx deployment created without the required metadata fields so the params never get populated.

Related errors


AI-assisted analysis of BerriAI/litellm@6c2dcb801b (2026-08-15). Data as JSON: /api/errors/9d462890ce0bd897. Report an issue: GitHub.