You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm toying around with the RAG example on your website and stumbled upon a pretty nasty issue. I'm not sure if Gemini is extremely stupid or if there's a tool bug going on so wanted to drop a ticket just in case.
Adding the logfire_docs.json file to the database is the easy part:
python -m toy_script.rag build
Works like a dream (note: embedding size has changed for the SentenceTransformer I'm using). Issue is that when I run:
python -m toy_script.rag search
Gemini responds with stupid things like:
I am sorry, I cannot find information on how to configure Logfire to work with FastAPI using the available tools. My knowledge about Logfire is limited.
I am sorry, I cannot find information on how to configure Logfire to work with FastAPI using the available tools. The provided retrieve function does not seem to have access to any documentation that would contain this information.
These are with the system prompt:
m=GeminiModel("gemini-1.5-flash", api_key=settings.GEMINI_API_KEY)
agent=Agent(
m,
deps_type=Deps,
retries=3,
system_prompt="Use the 'retrieve' tool to answer user queries.",
)
Even in logfire, tools aren't being detected or run.
I've done a few experiments and had some luck with adding an extra agent tool and asking it to use that first, like so:
# Init code + imports@dataclassclassDeps:
pool: asyncpg.Poolname: str="Test"m=GeminiModel("gemini-1.5-flash", api_key=settings.GEMINI_API_KEY)
agent=Agent(
m,
deps_type=Deps,
retries=3,
system_prompt="Return the users name and use the 'retrieve' tool to answer user queries.",
)
@agent.tooldefget_users_name(ctx: RunContext[Deps]) ->str:
returnctx.deps.name# Other code
That doesn't address the problem though. Let me know if you need anymore details!
Ryan
The text was updated successfully, but these errors were encountered:
I've done a few more experiments this morning, looks like other models work fine. Sorry about that! Learned something today - always try different LLM models first 😅.
Experiments
Main questions to answer:
Are the tools being detected in the Agent() instance? ✔
Are other models having the same problem? E.g., is gemini-1.5-flash garbage? ❌
1. Are the tools being detected in the Agent() instance?
From what I can tell, yes - assuming that agent._function_tools is the storage container.
I think this isn't an issue with the newer gemini models, so going to close this as resolved / as a model limitation that can be avoided. Feel free to follow up if you think this should remain open.
Hey guys,
I'm toying around with the RAG example on your website and stumbled upon a pretty nasty issue. I'm not sure if Gemini is extremely stupid or if there's a
tool bug
going on so wanted to drop a ticket just in case.Full files are in a toy-script repo. Main one to look at is the rag.py file.
I've transformed the example in the docs to one that uses PydanticAI and setup everything with docker using the following commands:
Adding the
logfire_docs.json
file to the database is the easy part:Works like a dream (note: embedding size has changed for the
SentenceTransformer
I'm using). Issue is that when I run:Gemini responds with stupid things like:
retrieve
function does not seem to have access to any documentation that would contain this information.These are with the system prompt:
Even in
logfire
, tools aren't being detected or run.I've done a few experiments and had some luck with adding an extra agent tool and asking it to use that first, like so:
That doesn't address the problem though. Let me know if you need anymore details!
Ryan
The text was updated successfully, but these errors were encountered: