Created
November 9, 2025 13:03
-
-
Save samirsaci/4cf38dcd9b5ed50c1275f17f5f9480c7 to your computer and use it in GitHub Desktop.
AI Agent Budget Planning - Parse Email Function
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 parse_email(state: AgentState) -> AgentState: | |
| try: | |
| parser = EmailParser(model_name=config["budget_agent"]["model_name"]) | |
| params = parser.parse(state["email_text"]) | |
| if not params or ("error" in params and params["error"]): | |
| return {"error": f"Parse failed: {params.get('error', 'unknown')}"} | |
| return {"params": params} | |
| except Exception as e: | |
| logger.exception("[BudgetGraph] parse_email crashed") | |
| return {"error": f"Parse exception: {e}"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment