Error importing DynamoDBChatMessageHistory
Labels: name: area: memory, name: auto:bug, name: stale, name: integration: aws

### System Info

I am following this example: https://python.langchain.com/docs/integrations/memory/dynamodb_chat_message_history

When attempting to import DynamoDBChatMessageHistory I am receiving an error 

`from langchain.memory.chat_message_histories import DynamoDBChatMessageHistory`

`---------------------------------------------------------------------------
PydanticUserError                         Traceback (most recent call last)
/var/folders/jq/w80pdyz11zbbhbvz7p8795gh0000gn/T/ipykernel_9395/3590968237.py in <module>
----> 1 from langchain.memory.chat_message_histories import DynamoDBChatMessageHistory
      2 
      3 # history = DynamoDBChatMessageHistory(table_name="SessionTable", session_id="0")
      4 
      5 # history.add_user_message("hi!")

/usr/local/lib/python3.9/site-packages/langchain/__init__.py in <module>
      4 from typing import Optional
      5 
----> 6 from langchain.agents import MRKLChain, ReActChain, SelfAskWithSearchChain
      7 from langchain.cache import BaseCache
      8 from langchain.chains import (

/usr/local/lib/python3.9/site-packages/langchain/agents/__init__.py in <module>
      1 """Interface for agents."""
----> 2 from langchain.agents.agent import (
      3     Agent,
      4     AgentExecutor,
      5     AgentOutputParser,

/usr/local/lib/python3.9/site-packages/langchain/agents/agent.py in <module>
     13 from pydantic import BaseModel, root_validator
     14 
---> 15 from langchain.agents.tools import InvalidTool
     16 from langchain.base_language import BaseLanguageModel
     17 from langchain.callbacks.base import BaseCallbackManager

/usr/local/lib/python3.9/site-packages/langchain/agents/tools.py in <module>
      2 from typing import Optional
      3 
----> 4 from langchain.callbacks.manager import (
      5     AsyncCallbackManagerForToolRun,
      6     CallbackManagerForToolRun,

/usr/local/lib/python3.9/site-packages/langchain/callbacks/__init__.py in <module>
      1 """Callback handlers that allow listening to events in LangChain."""
      2 
----> 3 from langchain.callbacks.aim_callback import AimCallbackHandler
      4 from langchain.callbacks.clearml_callback import ClearMLCallbackHandler
      5 from langchain.callbacks.comet_ml_callback import CometCallbackHandler

/usr/local/lib/python3.9/site-packages/langchain/callbacks/aim_callback.py in <module>
      2 from typing import Any, Dict, List, Optional, Union
      3 
----> 4 from langchain.callbacks.base import BaseCallbackHandler
      5 from langchain.schema import AgentAction, AgentFinish, LLMResult
      6 

/usr/local/lib/python3.9/site-packages/langchain/callbacks/base.py in <module>
      5 from uuid import UUID
      6 
----> 7 from langchain.schema import (
      8     AgentAction,
      9     AgentFinish,

/usr/local/lib/python3.9/site-packages/langchain/schema.py in <module>
    145 
    146 
--> 147 class ChatGeneration(Generation):
    148     """Output of a single generation."""
    149 

/usr/local/lib/python3.9/site-packages/langchain/schema.py in ChatGeneration()
    152 
    153     @root_validator
--> 154     def set_text(cls, values: Dict[str, Any]) -> Dict[str, Any]:
    155         values["text"] = values["message"].content
    156         return values

/usr/local/lib/python3.9/site-packages/pydantic/deprecated/class_validators.py in root_validator(pre, skip_on_failure, allow_reuse, *__args)
    220     if __args:
    221         # Ensure a nice error is raised if someone attempts to use the bare decorator
--> 222         return root_validator()(*__args)  # type: ignore
    223 
    224     if allow_reuse is True:  # pragma: no cover

/usr/local/lib/python3.9/site-packages/pydantic/deprecated/class_validators.py in root_validator(pre, skip_on_failure, allow_reuse, *__args)
    226     mode: Literal['before', 'after'] = 'before' if pre is True else 'after'
    227     if pre is False and skip_on_failure is not True:
--> 228         raise PydanticUserError(
    229             'If you use `@root_validator` with pre=False (the default) you MUST specify `skip_on_failure=True`.'
    230             ' Note that `@root_validator` is deprecated and should be replaced with `@model_validator`.',

PydanticUserError: If you use `@root_validator` with pre=False (the default) you MUST specify `skip_on_failure=True`. Note that `@root_validator` is deprecated and should be replaced with `@model_validator`.

For further information visit https://errors.pydantic.dev/2.1.1/u/root-validator-pre-skip`

### Who can help?

_No response_

### Information

- [X] The official example notebooks/scripts
- [ ] My own modified scripts

### Related Components

- [ ] LLMs/Chat Models
- [ ] Embedding Models
- [ ] Prompts / Prompt Templates / Prompt Selectors
- [ ] Output Parsers
- [ ] Document Loaders
- [ ] Vector Stores / Retrievers
- [X] Memory
- [ ] Agents / Agent Executors
- [ ] Tools / Toolkits
- [ ] Chains
- [ ] Callbacks/Tracing
- [ ] Async

### Reproduction

Attempt to import DynamoDBChatMessageHistory

from langchain.memory.chat_message_histories import DynamoDBChatMessageHistory

### Expected behavior

no errors, successful import