最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin0浏览0评论

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?

发布评论

评论列表(0)

  1. 暂无评论