Text Generation with Gemini API

Heads up... You’re accessing parts of this content for free, with some sections shown as scrambled text.

Heads up... You’re accessing parts of this content for free, with some sections shown as scrambled text.

Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.

Unlock now

Generating Text with Gemini API

Like OpenAI’s ChatGPT, Google Gemini is a powerful tool for text generation. You can create your own scripts in your local environment by leveraging the API. You can clearly see all the details from the response, including the safety parameters.

Comparing OpenAI and ChatGPT’s Text Generation Features

OpenAI and ChatGPT are both very good at text generation. Gemini leverages real-time information, which is a big advantage for certain applications. Gemini is also very strong at synthesizing information from different sources, including multi-modal input. On the other hand, ChatGPT has a great conversational flow and is good at maintaining contextual history. Here’s a fun tool to compare multiple AIs so you can see side-by-side responses. One thing they both have in common is the need for safety in regard to prompts.

Understanding Safety Settings

When generating text, it’s important to consider the safety settings of the conversation. Google Gemini utilizes filters to adjust the safety across four categories:

Degrees of Safety

You can filter each category based on degree:

See forum comments
Download course materials from Github
Previous: Introduction Next: Demo: Text Generation with Gemini API