Abstract method to execute the graph and return the result.
(self)
| 321 | |
| 322 | @abstractmethod |
| 323 | def run(self) -> str: |
| 324 | """ |
| 325 | Abstract method to execute the graph and return the result. |
| 326 | """ |
| 327 | inputs = {"user_prompt": self.prompt, self.input_key: self.source} |
| 328 | self.final_state, self.execution_info = self.graph.execute(inputs) |
| 329 | result = self.final_state.get("answer", "No answer found.") |
| 330 | return result |
| 331 | |
| 332 | async def run_safe_async(self) -> str: |
| 333 | """ |