Getting error AttributeError: 'super' object has no attribute 'parse_obj'

While running the code from Tools and Routing which is doing:

spec = OpenAPISpec.from_text(text)

I get this error. Here are my versions:

langchain == 0.0.345
pydantic == 2.5.2

Here is the complete stack:


AttributeError Traceback (most recent call last)
Cell In[5], line 1
----> 1 spec = OpenAPISpec.from_text(text)

File C:\GenerativeAI\venv\lib\site-packages\langchain\utilities\openapi.py:226, in OpenAPISpec.from_text(cls, text)
224 except json.JSONDecodeError:
225 spec_dict = yaml.safe_load(text)
→ 226 return cls.from_spec_dict(spec_dict)

File C:\GenerativeAI\venv\lib\site-packages\langchain\utilities\openapi.py:217, in OpenAPISpec.from_spec_dict(cls, spec_dict)
214 @classmethod
215 def from_spec_dict(cls, spec_dict: dict) → OpenAPISpec:
216 “”“Get an OpenAPI spec from a dict.”“”
→ 217 return cls.parse_obj(spec_dict)

File C:\GenerativeAI\venv\lib\site-packages\langchain\utilities\openapi.py:201, in OpenAPISpec.parse_obj(cls, obj)
199 try:
200 cls._alert_unsupported_spec(obj)
→ 201 return super().parse_obj(obj)
202 except ValidationError as e:
203 # We are handling possibly misconfigured specs and
204 # want to do a best-effort job to get a reasonable interface out of it.
205 new_obj = copy.deepcopy(obj)

AttributeError: ‘super’ object has no attribute ‘parse_obj’

Any ideas?