HKUDS/Vibe-Trading · error · MissingInputError

MissingInputError(missing, model)

Error message

MissingInputError(missing, model)

What it means

require_inputs raises MissingInputError when any required field is absent from the supplied mapping, is None, or is a blank string. It is the central guard used by calendarise_metric, enterprise_value, equity_value_from_enterprise_value, run_dcf and project_three_statement against partially-supplied inputs.

Source

Thrown at agent/src/quantlib/valuation/contracts.py:135

    Args:
        supplied: The inputs the caller provided.
        required: Field names the model cannot run without.
        model: Name used in the error message.

    Raises:
        MissingInputError: If any required field is absent or unusable, naming
            all of them.
    """
    missing = [
        field
        for field in required
        if field not in supplied
        or supplied[field] is None
        or (isinstance(supplied[field], str) and not supplied[field].strip())
    ]
    if missing:
        raise MissingInputError(missing, model)


def require_positive(value: float, name: str, model: str) -> float:
    """Check a value that is meaningless at or below zero.

    Args:
        value: The value to check, e.g. a share count or a discount rate.
        name: Field name for the error message.
        model: Model name for the error message.

    Returns:
        ``value`` as a float.

    Raises:
        ValuationError: If the value is not a finite number greater than zero.
    """
    try:
        numeric = float(value)

View on GitHub (pinned to 80ffdda44c)

Solutions

  1. Read the error's missing tuple — it names exactly which fields are lacking; supply them.
  2. Log supplied keys vs the required list at debug level in your wrapper.
  3. Normalize your input builder: never insert None/'' for required fields; fail at assembly time instead.

Example fix

# before
inputs = {'free_cash_flow': fcf}  # forgot discount_rate
run_dcf(inputs, ...)

# after
required = {'free_cash_flow', 'discount_rate', 'terminal_growth_rate'}
assert required <= inputs.keys() and all(inputs[k] is not None for k in required)
run_dcf(inputs, ...)
Defensive patterns

Strategy: try-catch

Validate before calling

missing = [f for f in required if f not in inputs or inputs[f] is None or (isinstance(inputs[f], str) and not inputs[f].strip())]
if missing:
    raise ValueError(f'missing required inputs: {missing}')

Try / catch

from quantlib.valuation.contracts import MissingInputError
try:
    run_dcf(inputs, ...)
except MissingInputError as e:
    prompt_user_for(e.missing)  # e.missing names the fields

Prevention

When it happens

Trigger: Calling any of those APIs with an inputs/mapping dict missing a required key, having None for it, or '' — e.g. run_dcf(inputs) where 'discount_rate' was never inserted.

Common situations: Optional-chained data assembly that silently leaves keys absent; conditional population of dicts; upstream API fields returning null; refactors renaming keys but not the required list.

Understand the failure class

Background: "Missing required field" and "field is required" errors: why libraries reject payloads that omit mandatory fields — this error's family across 20 libraries.

Related errors


AI-assisted analysis of HKUDS/Vibe-Trading@80ffdda44c (2026-08-28). Data as JSON: /api/errors/005ca851b75ba548. Report an issue: GitHub.