-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trying out Gemini's Tool
API
#718
base: main
Are you sure you want to change the base?
Conversation
/gcbrun exp -n dg -ag |
Hi @mihaimaruseac I am unsure what's the best way to let an agent focus on one tool in our use case. Could you please let me know if I missed (or am wrong about) anything? Given the goal is to generate a buildable fuzz target, the agent has two main tasks:
Correspondingly, there are two tools (or
I did not separate them into two agents, because I think task 1 needs both tools: In order to understand a build error (e.g., wrong type), the agent needs to cross-check the related source code (e.g., type/function definition). Also I am unsure if I used the
Then I call tool1/tool2 with the params from I thought about a flattened struct:
But LLM can mix/miss some params, and I cannot define which params are mandatory given I don't know which tool will use. Thanks! |
/gcbrun exp -n dg -ag |
/gcbrun exp -n dg -ag |
Apparently |
7eab405
to
7bcbe5a
Compare
/gcbrun exp -n dg -ag |
7bcbe5a
to
5a775f6
Compare
For the agents part I think it all makes sense. On the Tool API, from the description it looks like it should support multiple functions. Is it that the agents gets confused on which parameters belong to which function? Or the API actually doesn't support multiple functions, although documentation says it does? |
Thanks @mihaimaruseac
Yep, it's a limitation from the API, despite the description and definition suggests otherwise. I recall I discovered this from an exception thrown by vertex when I defined 2 tools. |
Yeah, in this case the nested structs work |
System instructions and tools serve different purposes right? There's still value to having system instructions for describing the general task (I assume this is better than just us prepending this in our first prompt)? |
@DonggeLiu can you explain the limitations here a bit more? We can only have 1 tool... but each tool supports multiple functions right? Can't we still achieve what we want with this? i.e.
(from https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/function-calling) |
Yep, they have different purpose and system instruction can be used to describe general tasks. When I created #717 and this PR, the main goal was to ensure LLM to respond in a predefined format (XML-style tags) so that we can parse the tool commands (e.g., bash, compile). The instruction content in #717 for this purpose is no longer needed because this PR shows I plan to cherry-pick some commits from #717 and this PR so that we use system instructions with a new content, focusing on:
|
Thanks, maybe I defined multiple tools instead of multiple functions in one tool and misremembered? On hindsight, I should have committed and pushed the old code with the code and its error is documented in this PR for us to double-check. |
Trying out the
Tool
API on a new agent (Repairer
) as a PoC.This is an alternative to
system instructions
(#717, which had an unreproducible error) to address the malformatted response issue.If this works well, I will use
Tool
inPrototyper
too.Repairer
focuses on fixing fuzz target (and build script) whenprototyper
encounters a build error. It comes with different prompts (and likely examples later).