from langchain.agents import create_agent from langchain.tools import tool from langchain_core.documents import Document from langchain_core.language_models.chat_models import BaseChatModel from langchain_core.messages import AIMessage, ToolMessage from langchain_core.outputs import ChatGeneration, ChatResult documents = [ Document( page_content=( "The support assistant refund policy says unopened hardware can be " "refunded within 30 days of delivery." ), metadata={"source": "support-policy.md"}, ), Document( page_content=( "Warranty exchanges require a serial number and proof of purchase " "before the returns team approves replacement stock." ), metadata={"source": "warranty-process.md"}, ), ]