This is the code
from agno.agent import Agent
from agno.models.openai import OpenAIChat
from agno.embedder.openai import OpenAIEmbedder
from agno.knowledge.pdf_url import PDFUrlKnowledgeBase
from agno.vectordb.lancedb import LanceDb, SearchType
api_key = 'sk-XXX'
knowledge_base = PDFUrlKnowledgeBase(
urls=[".2524v5"],
vector_db=LanceDb(
uri="tmp/lancedb",
table_name="paper",
search_type=SearchType.hybrid,
embedder=OpenAIEmbedder(id="text-embedding-3-small", api_key=api_key),
),
)
agent = Agent(
model=OpenAIChat(id="gpt-4o", api_key=api_key),
description="You are a person who read a paper and knows about it",
instructions=[
"Search only the knowledge base.",
"Don't search the web"
],
knowledge=knowledge_base,
show_tool_calls=True,
markdown=True
)
agent.print_response("what is title of paper?.", stream=True)
and it says
I'm sorry, but I couldn't find any specific paper title in the knowledge base I have access to. Could you please provide more details or specify a different query related to a paper you are interested in?
The paper is online and readable, I would like to know why agno failed to create knowledge base database?
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745072562a4609639.html
评论列表(0条)