Google Gemini
Provider Slug: google
Portkey SDK Integration with Google Gemini Models
Portkey provides a consistent API to interact with models from various providers. To integrate Google Gemini with Portkey:
1. Install the Portkey SDK
Add the Portkey SDK to your application to interact with Google Gemini's API through Portkey's gateway.
2. Initialize Portkey with the Virtual Key
3. Invoke Chat Completions with Google Gemini
Use the Portkey instance to send requests to Google Gemini. You can also override the virtual key directly in the API call if needed.
Portkey supports the system_instructions
parameter for Google Gemini 1.5 - allowing you to control the behavior and output of your Gemini-powered applications with ease.
Simply include your Gemini system prompt as part of the {"role":"system"}
message within the messages
array of your request body. Portkey Gateway will automatically transform your message to ensure seamless compatibility with the Google Gemini API.
Function Calling
Managing Google Gemini Prompts
Once you're ready with your prompt, you can use the portkey.prompts.completions.create
interface to use the prompt in your application.
Next Steps
The complete list of features supported in the SDK are available on the link below.
You'll find more information in the relevant sections:
Last updated