(
self, step_by_step_plan: str, user_context: str, search_results: dict
)
| 21 | self.llm = LLM(model_id=base_model) |
| 22 | |
| 23 | def render( |
| 24 | self, step_by_step_plan: str, user_context: str, search_results: dict |
| 25 | ) -> str: |
| 26 | env = Environment(loader=BaseLoader()) |
| 27 | template = env.from_string(PROMPT) |
| 28 | return template.render( |
| 29 | step_by_step_plan=step_by_step_plan, |
| 30 | user_context=user_context, |
| 31 | search_results=search_results, |
| 32 | ) |
| 33 | |
| 34 | def validate_response(self, response: str) -> Union[List[Dict[str, str]], bool]: |
| 35 | response = response.strip() |