python - Agno (Phidata) reading PDF as knowledge base failed - Stack Overflow

This is the codefrom agno.agent import Agentfrom agno.models.openai import OpenAIChatfrom agno.embed

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条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信