deepset-ai / haystack-core-integrations

Additional packages (components, document stores and the likes) to extend the capabilities of Haystack version 2.0 and onwards
https://haystack.deepset.ai
Apache License 2.0
122 stars 121 forks source link

Google Gemini (Rest API) Integration #135

Closed TuanaCelik closed 9 months ago

TuanaCelik commented 11 months ago

Summary and motivation

Google Gemini isn't only provided via Vertex AI. Let's create an integration for the REST API offering, too. There you only need a simple API Key - no need for a GCP account.

Checklist

If the request is accepted, ensure the following checklist is complete before closing this issue.

silvanocerza commented 11 months ago

To support Gemini through Makersuite we will probably need to use a different library from the one used in Vertex AI.

We'll need google-generativeai, at least version 0.3.1. This because the google-cloud-aiplatform library used in the Google Vertex AI integration doesn't support Makersuite. Documentation is over here. Library repo here. Here to get the API key instead.

Also note that Makersuite is only available in the USA.

TuanaCelik commented 11 months ago

Would the ideal name for this integration be gemini-haystack or makersuite-haystack or something else? Wdyt?

TuanaCelik commented 11 months ago

Expanding on the comment above: especially if we want to document all of these integrations (which we do), we might end up wanting to rethink how we name them. E.g., in the google-vertexai-haystack integration we have the GeminiGeneroator, if this is to be a separate integration here, we probably want to start naming them to be explicit in how they're using Gemini??

E.g.: VertexAIGeminiGenerator and MakersuiteGeminiGenerator - I may be well off here.. Lmk what you think

TuanaCelik commented 11 months ago

Here's the draft PR when someone from core is back to finalize it: https://github.com/deepset-ai/haystack-core-integrations/pull/156

It has an example notebook in there. Works with:

Needs:

TuanaCelik commented 11 months ago

@dfokina @silvanocerza Let's get the docs going. Feel free to assign to me if needed. I can also take the example/demonstration. @bilgeyucel or @annthurium do one of you have room for the integration page? Or to switch the demo with me?

dfokina commented 10 months ago

@TuanaCelik @silvanocerza Docs are live: https://docs.haystack.deepset.ai/v2.0/docs/googleaigeminichatgenerator & https://docs.haystack.deepset.ai/v2.0/docs/googleaigeminigenerator