TauricResearch/TradingAgents · error · ValueError

Configured vendor(s) {explicit} not available for '{method}'

Error message

Configured vendor(s) {explicit} not available for '{method}'. Available: {all_available_vendors}.

What it means

Raised by route_to_vendor() in tradingagents/dataflows/interface.py when the user explicitly configured vendors (data_vendors or tool_vendors) for a method's category, but none of the explicitly named vendors exist in VENDOR_METHODS[method]. Since the configured list IS the chain with no silent fallback (#988/#289), a fully unrecognized list aborts immediately with the available options listed.

Source

Thrown at tradingagents/dataflows/interface.py:188

    category = get_category_for_method(method)
    vendor_config = get_vendor(category, method)
    primary_vendors = [v.strip() for v in vendor_config.split(',')]

    if method not in VENDOR_METHODS:
        raise ValueError(f"Method '{method}' not supported")

    all_available_vendors = list(VENDOR_METHODS[method].keys())

    # The configured vendor list IS the chain: we do NOT silently fall back to
    # vendors the user did not choose (#988/#289) — that returned data from an
    # unexpected source and caused cross-vendor inconsistencies. For multi-vendor
    # fallback, list them in order, e.g. data_vendors="yfinance,alpha_vantage".
    # The "default" sentinel (no explicit config) uses all available vendors.
    explicit = [v for v in primary_vendors if v and v != "default"]
    if explicit:
        vendor_chain = [v for v in explicit if v in VENDOR_METHODS[method]]
        if not vendor_chain:
            raise ValueError(
                f"Configured vendor(s) {explicit} not available for '{method}'. "
                f"Available: {all_available_vendors}."
            )
    else:
        vendor_chain = all_available_vendors

    last_no_data: NoMarketDataError | None = None
    first_error: Exception | None = None
    for vendor in vendor_chain:
        vendor_impl = VENDOR_METHODS[method][vendor]
        impl_func = vendor_impl[0] if isinstance(vendor_impl, list) else vendor_impl

        try:
            return impl_func(*args, **kwargs)
        except VendorRateLimitError:
            logger.warning("Vendor %r rate-limited for %s; trying next vendor.", vendor, method)
            continue
        except VendorNotConfiguredError as e:

View on GitHub (pinned to a33fd4c0f1)

Solutions

  1. Read the message — it lists the valid vendors; correct data_vendors/tool_vendors to use one of them exactly (e.g. 'alpha_vantage', underscore included)
  2. Scope vendor choices per category/tool via tool_vendors when a vendor only serves some methods
  3. Leave the value as 'default' (or omit it) to use all available vendors in order
  4. For ordered fallback list several: data_vendors="yfinance,alpha_vantage"

Example fix

# before
config: {"data_vendors": {"stock_data": "alphavantage"}}  # typo: missing underscore
# -> ValueError: Configured vendor(s) ['alphavantage'] not available for 'get_stock_data_indicators_adjusted'. Available: ['yfinance', 'alpha_vantage', ...].

# after
config: {"data_vendors": {"stock_data": "alpha_vantage"}}
# or multi-vendor chain: {"data_vendors": {"stock_data": "yfinance,alpha_vantage"}}
Defensive patterns

Strategy: validation

Validate before calling

from tradingagents.dataflows.interface import VENDOR_METHODS, TOOLS_CATEGORIES

def validate_vendor_config(cfg: dict) -> list[str]:
    problems = []
    dv = cfg.get("data_vendors", {})
    tv = cfg.get("tool_vendors", {})
    for method in (m for i in TOOLS_CATEGORIES.values() for m in i["tools"]):
        vendors = tv.get(method) or dv.get(TOOLS_CATEGORIES and next(c for c, i2 in TOOLS_CATEGORIES.items() if method in i2["tools"]), "default")
        wanted = [v.strip() for v in (vendors or "default").split(",") if v.strip() and v != "default"]
        unknown = [v for v in wanted if v not in VENDOR_METHODS.get(method, {})]
        if wanted and unknown:
            problems.append(f"{method}: {unknown} not in {list(VENDOR_METHODS[method])}")
    return problems

Try / catch

try:
    route_to_vendor("get_stock_data_indicators_adjusted", "AAPL", "2025-06-10", 10, "close")
except ValueError as e:
    if "not available for" in str(e):
        # fix config: use a vendor from the 'Available:' list in the message
        fix_data_vendors_from_error(e)
    raise

Prevention

When it happens

Trigger: Setting data_vendors={"stock_data": "finnhub"} when only ['yfinance','alpha_vantage',...] are implemented for those tools; misspelling a vendor ('alphavantage' without the underscore); configuring a vendor valid for one category on a category it does not serve; stale names after a vendor was removed in an upgrade.

Common situations: Copy-pasted config from older/newer docs; typos; assuming one vendor setting applies to every category; config files surviving an upgrade that renamed vendors.

Related errors


AI-assisted analysis of TauricResearch/TradingAgents@a33fd4c0f1 (2026-08-14). Data as JSON: /api/errors/542cbf824ab85a48. Report an issue: GitHub.