GenAI - Python Package "GeAI" Overview

PyPI Version download count

⚠️ NOTICE for Python package "GeAI" ⚠️
The Python package is currently in the development phase. Please exercise caution when using it, as it may not be entirely stable or free of potential issues.


Basic Information

GeAI: Generative Artificial Intelligence

Utilizing Generative Artificial Intelligence models like "GPT-4" and "Gemini Pro" as coding and writing assistants for "Python" users. Through these models, "GeAI" offers a variety of functions, encompassing text generation, code optimization, natural language processing, chat, and image interpretation. The goal is to aid "Python" users in streamlining laborious coding and language processing tasks.

Author: Li Yuan

Maintainer: Li Yuan <[email protected]>

BugReports: https://github.com/GitData-GA/GenAI/issues

License: CC BY 4.0

URL: https://genai.gd.edu.kg/

Python version: 3


Quickstart

  1. Prior to utilizing the GenAI package, several prerequisites must be met.

    1. Ensure that you possess an eligible device equipped with Python.

    2. Access to the internet is essential to generate text or engage in chat through GenAI.

    3. Obtain an API key from the selected Generative AI service provider. GenAI currently supports Generative AI models from both Google and OpenAI.

      • To acquire an API key for Google's models, refer to: Get an API key
      • To acquire an API key for OpenAI's models, refer to: Account setup
  2. Installation (2 options)

    1. Install the package from The Python Package Index (PyPI).

      pip install GeAI

    2. Install the package from GenAI official website.

      pip install -i https://genai.gd.edu.kg/release/Python/GeAI-latest-py3-none-any.whl GeAI

  3. Setup and get your first AI generated response using GeAI

    Open In Colab
    # Import the library
    import GeAI as ga
    
    # Get supported models
    models = ga.available_models()
    
    # Select a model and connect, replace API_KEY with your api key
    google_model = ga.connect('google',
                              models['google']['model'][0],
                              models['google']['version'][0],
                              'API_KEY',
                              proxy = False)
    
    # Text generation
    google_text = ga.txt(google_model,
                         0.9,
                         "Write a story about a magic backpack.")
    print(google_text)
    Open In Colab
    # Import the library
    import GeAI as ga
    
    # Get supported models
    models = ga.available_models()
    
    # Select a model and connect, replace API_KEY with your api key
    openai_model = ga.connect('openai',
                              models['openai']['model'][0],
                              models['openai']['version'][0],
                              'API_KEY',
                              proxy = False)
    
    # Text generation
    openai_text = ga.txt(openai_model,
                         0.9,
                         "Write a story about a magic backpack.")
    print(openai_text)
  4. See the documentation for more functions.