GoogleCloudPlatform / generative-ai

Sample code and notebooks for Generative AI on Google Cloud, with Gemini on Vertex AI
https://cloud.google.com/vertex-ai/docs/generative-ai/learn/overview
Apache License 2.0
8.25k stars 2.33k forks source link

[Feat]: please provide examples with tool use where an individual parameter is an object #1343

Open kristoph opened 1 month ago

kristoph commented 1 month ago

Is your feature request related to a problem? Please describe.

I am able to use tools with simple parameters ( strings, numbers, booleans ) but when I try to pass an object the model fails with the object parameters payload returning 'unknown' rather than a property.

Describe the solution you'd like

I am simply looking for an example in one of the tool notebooks that shows how to pass an object as a parameter which has multiple properties.

Describe alternatives you've considered

No response

Additional context

I am the author of this:

https://github.com/EndlessInternational/intelligence

It currently supports 10 different LLM vendors including Google. I have tools ( including objects and arrays ) working for Open AI and Anthropic but Gemini has me stumped on more complex tools.

Code of Conduct

holtskinner commented 4 weeks ago

@kristoph I think this is what you are looking for?

https://github.com/GoogleCloudPlatform/generative-ai/blob/main/gemini/function-calling/function_calling_data_structures.ipynb

@koverholt is the author.

koverholt commented 4 weeks ago

Thanks for the info. We've also been tracking this discussion here:

https://github.com/GoogleCloudPlatform/generative-ai/discussions/1342

And in this upstream issue that I filed.

https://issuetracker.google.com/issues/376170319

So we can keep an eye on that bug report in the issue tracker as the core issue behind this GitHub issue and related GitHub Discussion.