[docs]class PydanticToolsParser(JsonOutputToolsParser):
    """Parse tools from OpenAI response."""
    tools: List[Type[BaseModel]]
[docs]    def parse_result(self, result: List[Generation], *, partial: bool = False) -> Any:
        results = super().parse_result(result)
        name_dict = {tool.__name__: tool for tool in self.tools}
        return [name_dict[res["type"]](**res["args"]) for res in results]