GenAI - Python Package "GeAI" Overview
⚠️ 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
Python version: 3
Quickstart
-
Prior to utilizing the GenAI package, several prerequisites must be met.
-
Ensure that you possess an eligible device equipped with Python.
-
Access to the internet is essential to generate text or engage in chat through GenAI.
-
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
-
-
Installation (2 options)
-
Install the package from The Python Package Index (PyPI).
pip install GeAI
-
Install the package from GenAI official website.
pip install -i https://genai.gd.edu.kg/release/Python/GeAI-latest-py3-none-any.whl GeAI
-
-
Setup and get your first AI generated response using GeAI
# 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)
# 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)
-
See the documentation for more functions.