langchain/memory/chat_message_histories/cosmos_db.py/CosmosDBChatMessageHistory/upsert_messages
class CosmosDBChatMessageHistory:    def upsert_messages(self) -> None:
        """Update the cosmosdb item."""
        if not self._container:
            raise ValueError("Container not initialized")
        self._container.upsert_item(
            body={
                "id": self.session_id,
                "user_id": self.user_id,
                "messages": messages_to_dict(self.messages),
            }
        )