Agent Rag pdf Problem #151280
Unanswered
Abeshith
asked this question in
Code Search and Navigation
Agent Rag pdf Problem
#151280
Replies: 1 comment
-
It looks like your agent isn't accessing the PDF content properly. Here are a few things you can check:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Select Topic Area
Question
Body
from phi.knowledge.pdf import PDFKnowledgeBase, PDFReader
from phi.vectordb.pgvector import PgVector2
from dotenv import load_dotenv
from phi.tools.duckduckgo import DuckDuckGo
import os
from phi.model.google import Gemini
from phi.embedder.google import GeminiEmbedder
from phi.model.groq import groq
import google.generativeai as genai
from phi.agent import Agent
genai.configure(api_key=os.getenv("GOOGLE_API_KEY"))
knowledge_base=PDFKnowledgeBase(
path = r"C:\Users\abhes\Downloads\Abeshith Resume.pdf",
)
documents = knowledge_base.reader.read(r"C:\Users\abhes\Downloads\Abeshith Resume.pdf")
print(documents)
agent = Agent(
name="pdf reading assistant",
model = Gemini(id="gemini-2.0-flash-exp"),
embedder = GeminiEmbedder(),
knowledge=knowledge_base,
search_knowledge=True,
)
agent.knowledge.load(recreate=False)
agent.print_response("what is the uploaded file contain")
can anyone sort out this , i dont know why i am getting the response as:
┃ I do not have access to the content of any files. I can only provide information I find in the knowledge base. Is there anything else I can help you with? | from the model
Beta Was this translation helpful? Give feedback.
All reactions