Created
November 9, 2025 13:03
-
-
Save samirsaci/63de675e0ae093deb0a1f08b507fb592 to your computer and use it in GitHub Desktop.
AI Agent Budget Planning - Run Budget
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| async def run_budget(state: AgentState) -> AgentState: | |
| if "error" in state: | |
| return {} | |
| try: | |
| interpreter = BudgetPlanInterpreter( | |
| model_name=config["budget_agent"]["model_name"], | |
| session_id=state.get("session_id", | |
| config["budget_agent"]["session_id"])) | |
| results = await interpreter.run_plan(state["params"]) | |
| if "error" in results: | |
| return {"error": f"Budget run failed: {results['error']}"} | |
| return {"budget_results": results, "interpreter": interpreter} | |
| except Exception as e: | |
| logger.exception("[BudgetGraph] run_budget crashed") | |
| return {"error": f"Budget exception: {e}"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment