DEV Community

Cover image for Build an AI Business Proposal Writer Using Gemini API and ToolJet in 10 minutes 🚀
Karan Rathod for ToolJet

Posted on • Originally published at blog.tooljet.com

Build an AI Business Proposal Writer Using Gemini API and ToolJet in 10 minutes 🚀

In this tutorial, we'll guide you through the process of creating an AI Business Proposal Writer using ToolJet and Gemini API. We will utilize ToolJet's pre-built components and simple integration process to quickly create an application that can interact with the Gemini API. This application will allow users to input business details and generate professional business proposals.

Here's a preview of the final application:

Image description

Image description


Prerequisites

Gemini API Key : The Gemini API is an advanced AI service provided by Google AI Studio. It enables developers to integrate powerful content generation capabilities into their applications.

ToolJet(https://github.com/ToolJet/ToolJet) : An open-source, low-code business application builder. Sign up for a free ToolJet cloud account or run ToolJet on your local machine using Docker.

Begin by creating an application named Business Proposal Writer.


1. Create a New Application

  • Open ToolJet and click on Create new application.
  • Name your application Business Proposal Writer.

Image description

Once you create a new application, you will see an empty canvas with a component library on the right and a query panel at the bottom.


2. Design the UI

Drag and drop the following components onto your canvas:

  • Containers: To organize the header, input fields and output section.
  • Text and Text Inputs: For company name, service description, budget, deadline, and company expertise.
  • Button: To generate the proposal.
  • Text: To display the generated proposal in HTML format.
  • Icons: For logo and to make the UI more appealing.

Rename the input fields for clarity:

  • companyNameInput
  • serviceDescriptionInput
  • budgetInput
  • deadlineInput
  • companyExpertiseInput

Name the button createButton.

Name the Text component that will display the generated proposal as output.

Image description

ToolJet's pre-built components offer complete flexibility in functionality and styling customization.


3. Integrating with Gemini API through Queries

  • Create a workspace constant to save your Gemini API key. Name it GEMINI_API_KEY.

  • Expand the query panel, create a new query, and name it generateProposal.

  • Change the Request Method to POST and paste the following URL under the URL input:

https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-pro:generateContent?key={{constants.GEMINI_API_KEY}}

  • Navigate to the Body section of the getContent query. Toggle on Raw JSON and enter the following code:
{
  "contents": [
    {
      "parts": [
        {
          "text": "
1. **Client/Company Name:** {{components.companyNameInput.value}}
2. **Project/Service Description:** {{components.serviceDescriptionInput.value}}
3. **Budget Range (if applicable):** {{components.budgetInput.value}}
4. **Deadline:** {{components.deadlineInput.value}}
5. **Company Expertise:** {{components.companyExpertiseInput.value}}

Based on these inputs, generate a well-structured and comprehensive business proposal document in HTML format. The generated proposal should include the following sections, each with ample padding and spacing:

1. **Executive Summary**
2. **Company Overview and Qualifications**
3. **Project Understanding and Approach**
4. **Proposed Solution and Methodology**
5. **Timeline and Deliverables**
6. **Team Structure and Bios**
7. **Cost Breakdown and Budget** (Include charts as needed)
8. **Terms and Conditions**
9. **Conclusion and Call to Action**

Ensure that the HTML output is properly formatted and visually appealing."
        }
      ]
    }
  ]
}
Enter fullscreen mode Exit fullscreen mode

Image description
Queries in ToolJet offer a simple and easy way to connect with databases, APIs, and cloud storage services.


4. Connecting the UI Components with Queries

  • Select the createButton component.

  • Add an event handler to trigger the generateProposal query when the button is clicked.

Image description

Events are used to run queries, show alerts, and other functionalities based on triggers such as button clicks or query completion.

  • Select the Text component that was created for displaying the query output.

  • Under its Data property, enter the below code:

{{queries.generateProposal.data.candidates[0].content.parts[0].text}}

Now, enter the required details in the input fields and click on the button. You should see the generated business proposal in the output component.

Image description

Image description


Conclusion

You have successfully built a business proposal writer using the Gemini API and ToolJet in just 10 minutes. This tool will streamline the creation of professional business proposals, saving you time and effort. For any questions or support, join the ToolJet Slack community. You can also check out the ToolJet documentation to learn more.

Top comments (1)

Collapse
 
heyeasley profile image
heyeasley 🍓🥭

Cool. Exciting