Dear Phidata community,
I’ve recently ventured into Phidata slowly learning the nuances of how can make the most of this. I was trying to build an agentic rag. I am nowhere using OpenAI in my code but still this ‘openai.AuthenticationError’ gets triggered all of a sudden!
Here’s the code snippet:
db_url = "postgresql+psycopg://ai:ai@localhost:5532/ai"
knowledge_base=PDFUrlKnowledgeBase(
urls=["https://phi-public.s3.amazonaws.com/recipes/ThaiRecipes.pdf"],
vector_db=PgVector2(collection="recipies",db_url=db_url)
)
knowledge_base.load(recreate=True, upsert=True)
#knowledge_base.load()
storage=PgAssistantStorage(table_name="pdf-assistant",db_url=db_url)
agent = Agent(
model=Groq(id="llama-3.3-70b-versatile"),
knowledge=knowledge_base,
storage=storage,
)
response: RunResponse = agent.run("What is the recipe for chicken curry?")
res = response.content
The error that I’m getting:
openai.AuthenticationError: Error code: 401 - {'error': {'message': 'Incorrect API key provided: GJUQLOdd************************************************************************************************************************************************uKYA. You can find your API key at https://platform.openai.com/account/api-keys.', 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_api_key'}}