google-gemini / generative-ai-python

The official Python library for the Google Gemini API
https://pypi.org/project/google-generativeai/
Apache License 2.0
1.62k stars 322 forks source link

Make Tool and grounding available in StudioAI library as in VertexAI #618

Open souzatharsis opened 2 weeks ago

souzatharsis commented 2 weeks ago

Description of the feature request:

Support for Tool and grounding in google.generativeai as available in VertexAI:

from vertexai.generative_models import Tool, grounding

What problem are you trying to solve with this feature?

I would like to use grounding function as a tool from StudioAI library in generic LLM base, e.g. langchain.

In particular, be able to make the following call but using google.generativeai instead of vertexai

Tool.from_google_search_retrieval(ground.GoogleSearchRetrieval()), which today is possible in vertexai.generative_models

Any other information you'd like to share?

Thanks for making grounding available.

manojssmk commented 2 weeks ago

Hi @souzatharsis

Grounding is available in the Gemini API and AI studio. Refer to this documentation link.

Thanks

souzatharsis commented 2 weeks ago

Hi, I understand grounding feature is available in Gemini high level api.

My request instead is lower level capability.

In particular, I'd like to be able to run the below code using studioai's google.generativeai library instead of VertexAI:

from vertexai.generative_models import Tool, grounding

and the be able to call

Tool.from_google_search_retrieval(ground.GoogleSearchRetrieval())

On Thu, Nov 7, 2024, 6:10 AM S Sai Manoj Kumar @.***> wrote:

Hi @souzatharsis https://github.com/souzatharsis

Grounding is available in the Gemini API and AI studio. Refer to this documentation link https://ai.google.dev/gemini-api/docs/grounding?lang=python.

Thanks

— Reply to this email directly, view it on GitHub https://github.com/google-gemini/generative-ai-python/issues/618#issuecomment-2461692658, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADTMY3O5BAHIPX66THWTDX3Z7MVA3AVCNFSM6AAAAABRJYDG4GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINRRGY4TENRVHA . You are receiving this because you were mentioned.Message ID: @.***>

MarkDaoust commented 1 week ago

Hi, I'm still not 100% sure what you're asking here. You just want to use this syntax to specify google_search_retrieval?

Tool.from_google_search_retrieval(ground.GoogleSearchRetrieval())

souzatharsis commented 1 week ago

Yes, thanks!

But using studioai's google.generativeai library instead of VertexAI

On Tue, Nov 12, 2024 at 1:32 PM Mark Daoust @.***> wrote:

Hi, I'm still not 100% sure what you're asking here. You just want to use this syntax to specify google_search_retrieval?

Tool.from_google_search_retrieval(ground.GoogleSearchRetrieval())

— Reply to this email directly, view it on GitHub https://github.com/google-gemini/generative-ai-python/issues/618#issuecomment-2471003309, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADTMY3OJJYLEGFLHLFOPT632AIUR5AVCNFSM6AAAAABRJYDG4GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINZRGAYDGMZQHE . You are receiving this because you were mentioned.Message ID: @.***>