Spaces:
Sleeping
Sleeping
| from .utils.prompts import budgeting_prompt | |
| from langchain_core.messages import SystemMessage , ToolMessage, FunctionMessage | |
| from.utils.tools import cost_table,budget_tiers_schema | |
| from src.genai.utils.models_loader import llm | |
| from .utils.state import json_schema, VideoIdeasBudgetSchema | |
| def budget_calculator(business_details, final_ideation): | |
| print('The final ideation is:',final_ideation) | |
| print('type:',type(final_ideation)) | |
| template = budgeting_prompt(final_ideation,business_details) | |
| messages = [SystemMessage(content=template), | |
| ToolMessage(content="The cost table is:\n"+ str(cost_table) + "\n" + "The budget tier schema is:\n"+ str(budget_tiers_schema) ,tool_call_id='call_cost_table'), | |
| # FunctionMessage(name="cost_and_budget",content="The cost table is:\n"+ str(cost_table) + "\n" + "The budget tier schema is:\n"+ str(budget_tiers_schema) ,tool_call_id='call_cost_table')] | |
| ] | |
| response = llm.with_structured_output(VideoIdeasBudgetSchema).invoke(messages) | |
| print('Budget Calculator Response:\n',response) | |
| return response | |