INNER CODE UNIT · Python

_portfolio_params

Fincept-Corporation/FinceptTerminal · fincept-qt/scripts/agents/finagent_core/main.py:111

def _portfolio_params(params: Dict[str, Any]) -> Dict[str, Any]:
    """Fallback portfolio payload: the caller's params minus host bookkeeping keys.

    Older callers pass portfolio fields at the top level of `params`. The whole dict
    used to be handed to the workflow as the "portfolio", bookkeeping included
    (workflow_type / user_id / llm_profile_id) — noise in the LLM prompt.
    """
    skip = ("workflow_type", "user_id", "llm_profile_id")
    return {k: v for k, v in params.items() if k not in skip}


def _run_error_text(response: Any):
    """Return the error text when an Agno run failed, else None.

    Agno reports a failed run (missing/invalid API key, provider error, ...) as an
    ordinary RunOutput with status ERROR whose `content` is the error message. It
    used to be wrapped as {"success": True, "response": "<error message>"}, so the
    UI showed an API-key error as a successful answer.

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…