Skip to content
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

Update google-ai.md #148

Merged
merged 1 commit into from
Jan 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions integrations/google-ai.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ To get an API key visit [Google Makersuite](https://makersuite.google.com).
To use Gemini model for text generation, initialize a `GoogleAIGeminiGenerator` with `"gemini-pro"` and `api_key`:

```python
from google_ai_haystack.generators.gemini import GoogleAIGeminiGenerator
from haystack_integrations.components.generators.google_ai import GoogleAIGeminiGenerator

gemini_generator = GoogleAIGeminiGenerator(model="gemini-pro", api_key=api_key)
result = gemini_generator.run(parts = ["What is assemblage in art?"])
Expand All @@ -77,7 +77,7 @@ To use `gemini-pro-vision` model for visual question answering, initialize a `Go
import requests
from haystack.dataclasses.byte_stream import ByteStream

from google_ai_haystack.generators.gemini import GoogleAIGeminiGenerator
from haystack_integrations.components.generators.google_ai import GoogleAIGeminiGenerator

BASE_URL = (
"https://raw.githubusercontent.com/deepset-ai/haystack-core-integrations"
Expand Down Expand Up @@ -117,7 +117,7 @@ When chatting with Gemini we can also use function calls.
from google.ai.generativelanguage import FunctionDeclaration, Tool
from haystack.dataclasses import ChatMessage
from google_ai_haystack.generators.chat.gemini import GoogleAIGeminiChatGenerator
from haystack_integrations.components.generators.google_ai import GoogleAIGeminiChatGenerator
# Define a function that return always some nice weather
def get_current_weather(location: str, unit: str = "celsius"):
Expand Down Expand Up @@ -174,7 +174,7 @@ In Berlin, the weather is sunny with a temperature of 21.8 degrees Celsius.
Gemini can also easily generate code, here's an example:

```python
from google_ai_haystack.generators.gemini import GoogleAIGeminiGenerator
from haystack_integrations.components.generators.google_ai import GoogleAIGeminiGenerator
gemini_generator = GoogleAIGeminiGenerator(model="gemini-pro", api_key=api_key)
result = gemini_generator.run("Write a code for calculating fibonacci numbers in JavaScript")
Expand Down