Giter Club home page Giter Club logo

geminisheetscustomfunction's Introduction

GEMINI Custom Function

The GEMINI function is a custom Google Apps Script function designed to work with the data within the Google Spreadsheet for analysis, summarisation and text generation

Features

  • Custom Functionality: Designed to be used as a custom function within Google Sheets, enabling on-the-fly text classification.
  • Easy to Use: Simply input your objective and the data range, and the function will classify the text accordingly.
  • Dynamic Input: Accepts a range of data, making it versatile for different use cases.

Setup

  1. API Key: Ensure you have an API key from the generative language API service. Replace YOUR_API_KEY in the script with your actual API key.

  2. Script Installation: Copy the script into the script editor in Google Sheets where you want to use the GEMINI function.

Usage

=GEMINI("objective", range)
  • objective: The objective of the content generation. For example, "classify text as SPAM or NOT SPAM".
  • range: The range of cells containing text data to be classified.

Example

If you have a column of text in A1:A10 and you want to classify each cell's content as SPAM or NOT SPAM, you can use:

=GEMINI("classify text as SPAM or NOT SPAM", A1:A10)

Analyse a range of data as a business analyst.

=GEMINI("Analyse as a business analyst. Here's the data. Generate a 100 word summary.",A1:O5)

Generate Product Descriptions.

=GEMINI("Generate 50 word product description optimised for sales and SEO, Here's the Product Title:",A2)

Function Description

GEMINI(objective, dataRange)

This is the main function that initiates the text classification process. It validates the inputs, formats the data, and communicates with the generative language API to get the classification results.

createPrompt(objective, rowData)

Generates a prompt string used for the API call, based on the objective and the data provided.

fetchAPIResponse(prompt, url, apiKey)

Makes a POST request to the generative language API with the generated prompt and handles the API response.

Current Issues

The script has issues when dealing with a single column range

Contributing

Contributions are welcome! If you have suggestions for improvements or encounter any issues, please feel free to open an issue or submit a pull request.

geminisheetscustomfunction's People

Contributors

varunmehra5 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.