Call predict and then parse the results.
(
self, callbacks: Callbacks = None, **kwargs: Any
)
| 322 | return (await self.acall(kwargs, callbacks=callbacks))[self.output_key] |
| 323 | |
| 324 | def predict_and_parse( |
| 325 | self, callbacks: Callbacks = None, **kwargs: Any |
| 326 | ) -> Union[str, List[str], Dict[str, Any]]: |
| 327 | """Call predict and then parse the results.""" |
| 328 | warnings.warn( |
| 329 | "The predict_and_parse method is deprecated, " |
| 330 | "instead pass an output parser directly to LLMChain." |
| 331 | ) |
| 332 | result = self.predict(callbacks=callbacks, **kwargs) |
| 333 | if self.prompt.output_parser is not None: |
| 334 | return self.prompt.output_parser.parse(result) |
| 335 | else: |
| 336 | return result |
| 337 | |
| 338 | async def apredict_and_parse( |
| 339 | self, callbacks: Callbacks = None, **kwargs: Any |