Google Gemini in Landbot

Abby Updated by Abby

An alternative to chatGPT is Google Gemini, here's how you can use it in Landbot

This requires a Google Cloud account with billing enabled

Google Set Up

In your Google Cloud account you will need to enable the Generative Language API:

Once the API has been enabled if you do not already have one you will need to create an API key for this project

You will need to set the application restrictions to none (the API key will not be visible to users)

Copy the API key for use in Landbot

Landbot Set Up

In Landbot you can start with a text input:

Save the variable as @text for the webhook block

In the webhook block you'll add the following endpoint to a POST request:

https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-pro:generateContent?key=XXXXXXXXXXX

Replace XXXXX with your API key

Toggle on 'Customise Body':

Replace 'your prompt goes here' for your prompt, excluding quotation marks and special characters:

{ "system_instruction": {
"parts":
{ "text": "your prompt goes here"}
},
"contents": [
{
"role": "user",
"parts": [
{"text": "@{text}"}
]
}
]
}

Add a sample value for @text and test your request:

Click on the purple banner and save only the text output:

Display the output to the user:

How did we do?

Build a Customer Service Bot with ChatGPT and Extract Information

Contact