I am using the following code from documentation and giving error that
“AttributeError: ‘Agent’ object has no attribute ‘knowledge_base’”
Please someone help
db_url = "postgresql+psycopg://ai:ai@localhost:5532/ai"
agent = Agent(
storage=PgAgentStorage(table_name="recipe_agent", db_url=db_url),
knowledge_base=PDFUrlKnowledgeBase(
urls=["https://phi-public.s3.amazonaws.com/recipes/ThaiRecipes.pdf"],
vector_db=PgVector(table_name="recipe_documents", db_url=db_url),
),
# Show tool calls in the response
show_tool_calls=True,
# Enable the agent to search the knowledge base
search_knowledge=True,
# Enable the agent to read the chat history
read_chat_history=True,
)
# Comment out after first run
agent.knowledge_base.load(recreate=True) # type: ignore
agent.print_response("How do I make pad thai?", markdown=True)```