Creating a Corporate Assistant with Gemini Pro

creating-a-corporate-assistant-with-gemini-pro

In today’s globalized world, effective communication in English is crucial for professional success. However, language barriers can hinder collaboration and the flow of information. On this occasion, we will explore the advantages of generative artificial intelligence as a support tool in our day-to-day work with simple tasks at the corporate communication level.

To build this assistant we will use:

  1. Gemini Pro The most powerful and multimodal model that Google has released.
  2. Google AI Studio Web tool for quickly prototyping Generative AI applications.
  3. Streamlit Allows us to create web applications easily.

We will create an application that contains two main functionalities:

  1. Translator of phrases / ideas to different tones.
  2. Meeting summary generator.

Translator of phrases / ideas to different tones

Design of the translator to different tones

The application will receive the message that we want to translate and as result we expect to generate the same message but in 3 different tones: An elegant tone, a concise one and a professional response in a friendly tone.

We will use the following prompt:

You are a corporate assistant, and your objective is to review the input text and translate it into three different professional tones: a CORPORATE ELEGANT, a more CONCISE, and A FRIENDLY tone.
text: You are kidding me! This is nonsense! Your solution is not possible.

**Corporate Tone:** I am concerned that the proposed solution may not be feasible. I suggest we explore alternative options together.
**Concise Tone:** Solution infeasible. Explore alternatives.
**Friendly Tone:** Thank you for your suggestion. I appreciate your creativity. However, I'm concerned about the feasibility of the proposed solution. Let's brainstorm some other options that might be a better fit for our current situation.

text: {Here we will add the new text that we want to translate}

We will configure the prompt in Google AI Studio to test and evaluate the results with new phrases.

The text highlighted in blue is the new response that the model generates in the same format as the example provided.

We are using Gemini 1.0 Pro to generate the results. After validating the results in Google AI Studio, we export the generated code by selecting the GET CODE option.

We will add the generated code to the following function:

def translator(text, geminiAPIKey):
return corporate_content, concise_content, friendly_content

The result of this function will be translated text into the 3 requested styles.

Demo: Translation to Corporate

Meeting Summary Generator

The second functionality of our corporate assistant will be a generator of summaries and key points of the content of a meeting.

We will use the following prompt:

You are a corporate assistant, your objective is to summarize the input text and provide the most important key pointsn
text: {text}

You can test the generated prompt in Google AI Studio and then proceed to export the generated code from the Get Code option.

Let’s put the generated code in the following function:

def meeting_notes(text, geminiAPIKey):
return summary

The output of this function will be the summary of the meeting with the most relevant points. In this case the prompt is simple, we are not providing many details so Gemini will provide us with the best summary.

Demo: Meeting Summary Generator

Web application

To create the web application we will use Streamlit. The structure of the generated code will be:

import streamlit as st
import google.generativeai as genai

def inputs():
# Here we define the sidebar of the application for the two functionalities
# Of the corporate assistant
return google_key, text, button, text_sum, button2

def translator(text, key):
# Code generated in Google AI Studio for
# Translator of phrases / ideas to different Corporate tones
return corporate_content, concise_content, friendly_content

def meeting_notes(text, key):
# Code generated in Google AI Studio for
# Meeting Summary Generator
return summary

def main():
# We generate the sidebar
google_key, text, button, text_sum, button2 = inputs()

if button:
# If the first button is pressed, we call the translator function
corporate_content, concise_content, friendly_content = translator(text, google_key)
# Then we proceed to display the results

elif button2:
# If the second button is pressed, we call the function
# Meeting Notes
st.text(meeting_notes(text_sum, google_key))

if __name__ == "__main__":
main()

The complete code can be found at: https://github.com/nathalyAlarconT/Gemini_Sprint

In order to connect to Gemini from the web application we just created, you need to generate your API Key in Google AI Studio: https://aistudio.google.com/app/apikey

Copy the Api Key generated in Google AI Studio into the application

Finally, launch the application with the command:

streamlit run corporateAssistant.py

Thanks for making it this far.

You can follow me on all networks with the username @NathalyAlarconT 🙂


Creating a Corporate Assistant with Gemini Pro was originally published in Google Developer Experts on Medium, where people are continuing the conversation by highlighting and responding to this story.

Total
0
Shares
Leave a Reply

Your email address will not be published. Required fields are marked *

Previous Post
python-web-scraping:-best-libraries-and-practices

Python Web Scraping: Best Libraries and Practices

Next Post
what’s-new-at-meteor:-beta-releases,-community-tutorials,-and-more

What’s New at Meteor: Beta Releases, Community Tutorials, and More

Related Posts