Repository: explodinggradients/ragas
Issue: PydanticSchemaGeneration error when generating synthetic dataset
Root cause: External Dependency Breakage

[ yes] I have checked the [documentation](https://docs.ragas.io/) and related resources and couldn't resolve my bug.

**Describe the bug**
A clear and concise description of what the bug is.

just the import state for TestsetGenerator is throwing the following error:

PydanticSchemaGenerationError: Unable to generate pydantic-core schema for <class 'langchain_core.caches.BaseCache'>. Set `arbitrary_types_allowed=True` in the model_config to ignore this error or implement `__get_pydantic_core_schema__` on your type to fully support it.


Ragas version:0.1.21
Python version: 3.12.1

**Code to Reproduce**
from ragas.testset.generator import TestsetGenerator

**Error trace**
---------------------------------------------------------------------------
PydanticSchemaGenerationError             Traceback (most recent call last)
Cell In[32], [line 1](vscode-notebook-cell:?execution_count=32&line=1)
----> [1](vscode-notebook-cell:?execution_count=32&line=1) from ragas.testset.generator import TestsetGenerator
      [2](vscode-notebook-cell:?execution_count=32&line=2) from ragas.testset.evolutions import simple, reasoning, multi_context
      [3](vscode-notebook-cell:?execution_count=32&line=3) from langchain_openai import ChatOpenAI, OpenAIEmbeddings

File ~/tax_qa/tax_qa_env/lib/python3.12/site-packages/ragas/__init__.py:1
----> [1](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/ragas/__init__.py:1) from ragas.adaptation import adapt
      [2](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/ragas/__init__.py:2) from ragas.evaluation import evaluate
      [3](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/ragas/__init__.py:3) from ragas.run_config import RunConfig

File ~/tax_qa/tax_qa_env/lib/python3.12/site-packages/ragas/adaptation.py:3
      [1](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/ragas/adaptation.py:1) import typing as t
----> [3](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/ragas/adaptation.py:3) from langchain_core.language_models import BaseLanguageModel
      [5](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/ragas/adaptation.py:5) from ragas.llms import llm_factory
      [6](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/ragas/adaptation.py:6) from ragas.llms.base import BaseRagasLLM, LangchainLLMWrapper

File ~/tax_qa/tax_qa_env/lib/python3.12/site-packages/langchain_core/language_models/__init__.py:48
      [1](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/langchain_core/language_models/__init__.py:1) """**Language Model** is a type of model that can generate text or complete
      [2](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/langchain_core/language_models/__init__.py:2) text prompts.
      [3](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/langchain_core/language_models/__init__.py:3) 
   (...)
     [37](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/langchain_core/language_models/__init__.py:37) https://python.langchain.com/v0.2/docs/how_to/custom_llm/
     [38](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/langchain_core/language_models/__init__.py:38) """  # noqa: E501
     [40](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/langchain_core/language_models/__init__.py:40) from langchain_core.language_models.base import (
     [41](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/langchain_core/language_models/__init__.py:41)     BaseLanguageModel,
     [42](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/langchain_core/language_models/__init__.py:42)     LangSmithParams,
   (...)
     [46](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/langchain_core/language_models/__init__.py:46)     get_tokenizer,
     [47](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/langchain_core/language_models/__init__.py:47) )
---> [48](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/langchain_core/language_models/__init__.py:48) from langchain_core.language_models.chat_models import BaseChatModel, SimpleChatModel
     [49](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/langchain_core/language_models/__init__.py:49) from langchain_core.language_models.fake import FakeListLLM, FakeStreamingListLLM
     [50](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/langchain_core/language_models/__init__.py:50) from langchain_core.language_models.fake_chat_models import (
     [51](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/langchain_core/language_models/__init__.py:51)     FakeListChatModel,
     [52](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/langchain_core/language_models/__init__.py:52)     FakeMessagesListChatModel,
     [53](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/langchain_core/language_models/__init__.py:53)     GenericFakeChatModel,
     [54](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/langchain_core/language_models/__init__.py:54)     ParrotFakeChatModel,
     [55](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/langchain_core/language_models/__init__.py:55) )

File ~/tax_qa/tax_qa_env/lib/python3.12/site-packages/langchain_core/language_models/chat_models.py:119
    [115](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/langchain_core/language_models/chat_models.py:115)     chunks = [chunk async for chunk in stream]
    [116](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/langchain_core/language_models/chat_models.py:116)     return await run_in_executor(None, generate_from_stream, iter(chunks))
--> [119](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/langchain_core/language_models/chat_models.py:119) class BaseChatModel(BaseLanguageModel[BaseMessage], ABC):
    [120](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/langchain_core/language_models/chat_models.py:120)     """Base class for chat models.
    [121](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/langchain_core/language_models/chat_models.py:121) 
    [122](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/langchain_core/language_models/chat_models.py:122)     Key imperative methods:
   (...)
    [193](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/langchain_core/language_models/chat_models.py:193) 
    [194](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/langchain_core/language_models/chat_models.py:194)     """  # noqa: E501
    [196](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/langchain_core/language_models/chat_models.py:196)     callback_manager: Optional[BaseCallbackManager] = deprecated(
    [197](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/langchain_core/language_models/chat_models.py:197)         name="callback_manager", since="0.1.7", removal="1.0", alternative="callbacks"
    [198](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/langchain_core/language_models/chat_models.py:198)     )(
   (...)
    [203](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/langchain_core/language_models/chat_models.py:203)         )
    [204](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/langchain_core/language_models/chat_models.py:204)     )

File ~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/main.py:768, in BaseModel.__class_getitem__(cls, typevar_values)
    [765](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/main.py:765) # Attempt to rebuild the origin in case new types have been defined
    [766](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/main.py:766) try:
    [767](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/main.py:767)     # depth 3 gets you above this __class_getitem__ call
--> [768](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/main.py:768)     origin.model_rebuild(_parent_namespace_depth=3)
    [769](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/main.py:769) except PydanticUndefinedAnnotation:
    [770](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/main.py:770)     # It's okay if it fails, it just means there are still undefined types
    [771](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/main.py:771)     # that could be evaluated later.
    [772](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/main.py:772)     # TODO: Make sure validation fails if there are still undefined types, perhaps using MockValidator
    [773](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/main.py:773)     pass

File ~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/main.py:563, in BaseModel.model_rebuild(cls, force, raise_errors, _parent_namespace_depth, _types_namespace)
    [561](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/main.py:561) # manually override defer_build so complete_model_class doesn't skip building the model again
    [562](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/main.py:562) config = {**cls.model_config, 'defer_build': False}
--> [563](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/main.py:563) return _model_construction.complete_model_class(
    [564](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/main.py:564)     cls,
    [565](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/main.py:565)     cls.__name__,
    [566](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/main.py:566)     _config.ConfigWrapper(config, check=False),
    [567](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/main.py:567)     raise_errors=raise_errors,
    [568](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/main.py:568)     types_namespace=types_namespace,
    [569](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/main.py:569) )

File ~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_model_construction.py:577, in complete_model_class(cls, cls_name, config_wrapper, raise_errors, types_namespace, create_model_module)
    [574](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_model_construction.py:574)     return False
    [576](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_model_construction.py:576) try:
--> [577](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_model_construction.py:577)     schema = cls.__get_pydantic_core_schema__(cls, handler)
    [578](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_model_construction.py:578) except PydanticUndefinedAnnotation as e:
    [579](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_model_construction.py:579)     if raise_errors:

File ~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/main.py:671, in BaseModel.__get_pydantic_core_schema__(cls, source, handler)
    [668](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/main.py:668)     if not cls.__pydantic_generic_metadata__['origin']:
    [669](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/main.py:669)         return cls.__pydantic_core_schema__
--> [671](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/main.py:671) return handler(source)

File ~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_schema_generation_shared.py:83, in CallbackGetCoreSchemaHandler.__call__(self, source_type)
     [82](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_schema_generation_shared.py:82) def __call__(self, source_type: Any, /) -> core_schema.CoreSchema:
---> [83](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_schema_generation_shared.py:83)     schema = self._handler(source_type)
     [84](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_schema_generation_shared.py:84)     ref = schema.get('ref')
     [85](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_schema_generation_shared.py:85)     if self._ref_mode == 'to-def':

File ~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:655, in GenerateSchema.generate_schema(self, obj, from_dunder_get_core_schema)
    [652](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:652)         schema = from_property
    [654](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:654) if schema is None:
--> [655](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:655)     schema = self._generate_schema_inner(obj)
    [657](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:657) metadata_js_function = _extract_get_pydantic_json_schema(obj, schema)
    [658](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:658) if metadata_js_function is not None:

File ~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:924, in GenerateSchema._generate_schema_inner(self, obj)
    [922](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:922) if lenient_issubclass(obj, BaseModel):
    [923](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:923)     with self.model_type_stack.push(obj):
--> [924](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:924)         return self._model_schema(obj)
    [926](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:926) if isinstance(obj, PydanticRecursiveRef):
    [927](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:927)     return core_schema.definition_reference_schema(schema_ref=obj.type_ref)

File ~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:739, in GenerateSchema._model_schema(self, cls)
    [727](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:727)     model_schema = core_schema.model_schema(
    [728](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:728)         cls,
    [729](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:729)         inner_schema,
   (...)
    [735](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:735)         metadata=metadata,
    [736](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:736)     )
    [737](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:737) else:
    [738](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:738)     fields_schema: core_schema.CoreSchema = core_schema.model_fields_schema(
--> [739](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:739)         {k: self._generate_md_field_schema(k, v, decorators) for k, v in fields.items()},
    [740](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:740)         computed_fields=[
    [741](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:741)             self._computed_field_schema(d, decorators.field_serializers)
    [742](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:742)             for d in computed_fields.values()
    [743](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:743)         ],
    [744](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:744)         extras_schema=extras_schema,
    [745](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:745)         model_name=cls.__name__,
    [746](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:746)     )
    [747](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:747)     inner_schema = apply_validators(fields_schema, decorators.root_validators.values(), None)
    [748](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:748)     new_inner_schema = define_expected_missing_refs(inner_schema, recursively_defined_type_refs())

File ~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:1115, in GenerateSchema._generate_md_field_schema(self, name, field_info, decorators)
   [1108](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:1108) def _generate_md_field_schema(
   [1109](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:1109)     self,
   [1110](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:1110)     name: str,
   [1111](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:1111)     field_info: FieldInfo,
   [1112](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:1112)     decorators: DecoratorInfos,
   [1113](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:1113) ) -> core_schema.ModelField:
   [1114](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:1114)     """Prepare a ModelField to represent a model field."""
-> [1115](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:1115)     common_field = self._common_field_schema(name, field_info, decorators)
   [1116](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:1116)     return core_schema.model_field(
   [1117](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:1117)         common_field['schema'],
   [1118](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:1118)         serialization_exclude=common_field['serialization_exclude'],
   (...)
   [1122](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:1122)         metadata=common_field['metadata'],
   [1123](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:1123)     )

File ~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:1308, in GenerateSchema._common_field_schema(self, name, field_info, decorators)
   [1304](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:1304)         schema = self._apply_annotations(
   [1305](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:1305)             source_type, annotations + validators_from_decorators, transform_inner_schema=set_discriminator
   [1306](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:1306)         )
   [1307](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:1307)     else:
-> [1308](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:1308)         schema = self._apply_annotations(
   [1309](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:1309)             source_type,
   [1310](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:1310)             annotations + validators_from_decorators,
   [1311](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:1311)         )
   [1313](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:1313) # This V1 compatibility shim should eventually be removed
   [1314](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:1314) # push down any `each_item=True` validators
   [1315](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:1315) # note that this won't work for any Annotated types that get wrapped by a function validator
   [1316](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:1316) # but that's okay because that didn't exist in V1
   [1317](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:1317) this_field_validators = filter_field_decorator_info_by_field(decorators.validators.values(), name)

File ~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:2107, in GenerateSchema._apply_annotations(self, source_type, annotations, transform_inner_schema)
   [2102](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:2102)         continue
   [2103](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:2103)     get_inner_schema = self._get_wrapped_inner_schema(
   [2104](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:2104)         get_inner_schema, annotation, pydantic_js_annotation_functions
   [2105](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:2105)     )
-> [2107](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:2107) schema = get_inner_schema(source_type)
   [2108](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:2108) if pydantic_js_annotation_functions:
   [2109](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:2109)     metadata = CoreMetadataHandler(schema).metadata

File ~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_schema_generation_shared.py:83, in CallbackGetCoreSchemaHandler.__call__(self, source_type)
     [82](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_schema_generation_shared.py:82) def __call__(self, source_type: Any, /) -> core_schema.CoreSchema:
---> [83](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_schema_generation_shared.py:83)     schema = self._handler(source_type)
     [84](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_schema_generation_shared.py:84)     ref = schema.get('ref')
     [85](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_schema_generation_shared.py:85)     if self._ref_mode == 'to-def':

File ~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:2088, in GenerateSchema._apply_annotations.<locals>.inner_handler(obj)
   [2086](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:2086) from_property = self._generate_schema_from_property(obj, source_type)
   [2087](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:2087) if from_property is None:
-> [2088](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:2088)     schema = self._generate_schema_inner(obj)
   [2089](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:2089) else:
   [2090](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:2090)     schema = from_property

File ~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:929, in GenerateSchema._generate_schema_inner(self, obj)
    [926](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:926) if isinstance(obj, PydanticRecursiveRef):
    [927](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:927)     return core_schema.definition_reference_schema(schema_ref=obj.type_ref)
--> [929](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:929) return self.match_type(obj)

File ~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:1029, in GenerateSchema.match_type(self, obj)
   [1027](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:1027) origin = get_origin(obj)
   [1028](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:1028) if origin is not None:
-> [1029](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:1029)     return self._match_generic_type(obj, origin)
   [1031](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:1031) res = self._get_prepare_pydantic_annotations_for_known_type(obj, ())
   [1032](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:1032) if res is not None:

File ~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:1058, in GenerateSchema._match_generic_type(self, obj, origin)
   [1055](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:1055)     return from_property
   [1057](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:1057) if _typing_extra.origin_is_union(origin):
-> [1058](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:1058)     return self._union_schema(obj)
   [1059](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:1059) elif origin in TUPLE_TYPES:
   [1060](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:1060)     return self._tuple_schema(obj)

File ~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:1378, in GenerateSchema._union_schema(self, union_type)
   [1376](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:1376)         nullable = True
   [1377](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:1377)     else:
-> [1378](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:1378)         choices.append(self.generate_schema(arg))
   [1380](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:1380) if len(choices) == 1:
   [1381](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:1381)     s = choices[0]

File ~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:655, in GenerateSchema.generate_schema(self, obj, from_dunder_get_core_schema)
    [652](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:652)         schema = from_property
    [654](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:654) if schema is None:
--> [655](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:655)     schema = self._generate_schema_inner(obj)
    [657](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:657) metadata_js_function = _extract_get_pydantic_json_schema(obj, schema)
    [658](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:658) if metadata_js_function is not None:

File ~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:929, in GenerateSchema._generate_schema_inner(self, obj)
    [926](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:926) if isinstance(obj, PydanticRecursiveRef):
    [927](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:927)     return core_schema.definition_reference_schema(schema_ref=obj.type_ref)
--> [929](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:929) return self.match_type(obj)

File ~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:1038, in GenerateSchema.match_type(self, obj)
   [1036](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:1036) if self._arbitrary_types:
   [1037](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:1037)     return self._arbitrary_type_schema(obj)
-> [1038](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:1038) return self._unknown_type_schema(obj)

File ~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:558, in GenerateSchema._unknown_type_schema(self, obj)
    [557](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:557) def _unknown_type_schema(self, obj: Any) -> CoreSchema:
--> [558](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:558)     raise PydanticSchemaGenerationError(
    [559](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:559)         f'Unable to generate pydantic-core schema for {obj!r}. '
    [560](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:560)         'Set `arbitrary_types_allowed=True` in the model_config to ignore this error'
    [561](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:561)         ' or implement `__get_pydantic_core_schema__` on your type to fully support it.'
    [562](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:562)         '\n\nIf you got this error by calling handler(<some type>) within'
    [563](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:563)         ' `__get_pydantic_core_schema__` then you likely need to call'
    [564](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:564)         ' `handler.generate_schema(<some type>)` since we do not call'
    [565](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:565)         ' `__get_pydantic_core_schema__` on `<some type>` otherwise to avoid infinite recursion.'
    [566](https://file+.vscode-resource.vscode-cdn.net/home/vandana/tax_qa/~/tax_qa/tax_qa_env/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:566)     )

PydanticSchemaGenerationError: Unable to generate pydantic-core schema for <class 'langchain_core.caches.BaseCache'>. Set `arbitrary_types_allowed=True` in the model_config to ignore this error or implement `__get_pydantic_core_schema__` on your type to fully support it.

If you got this error by calling handler(<some type>) within `__get_pydantic_core_schema__` then you likely need to call `handler.generate_schema(<some type>)` since we do not call `__get_pydantic_core_schema__` on `<some type>` otherwise to avoid infinite recursion.

For further information visit https://errors.pydantic.dev/2.9/u/schema-for-unknown-type

**Expected behavior**
A clear and concise description of what you expected to happen.
Not error should happen and error happens


**Additional context**
Add any other context about the problem here.

<!-- PS: bugs suck but is also part of the process. We sincerely apologies for breaking your flow because of it, but don't worry, we got your back ❤️. We will get this fixed as fast as we can and thanks for helping us out by reporting it 🙏. -->


<!-- Greeting -->
Hello @wandana! I'm here to assist you with any bugs, questions, or contributions. Let's work together to solve the issue you're facing.

<!-- Answer -->
The error you're encountering is related to Pydantic's handling of arbitrary types. To resolve this, you can configure Pydantic to allow arbitrary types by setting `arbitrary_types_allowed=True` in the model configuration. Here's how you can do it:

1. Locate the Pydantic model where the error is occurring.
2. Update the model configuration to include `arbitrary_types_allowed=True`.

For example:

```python
from pydantic import BaseModel

class MyModel(BaseModel):
    class Config:
        arbitrary_types_allowed = True
```

If you have control over the `langchain_core.caches.BaseCache` class, you can also implement the `__get_pydantic_core_schema__` method to provide a custom schema.

If these changes are not possible directly in your code, you might need to modify the library or create a wrapper around the problematic class to apply these settings.


<!-- Dosu Comment Footer -->
*To continue talking to [Dosu](https://dosu.dev), mention @dosu.*