Skip to main content

This package contains implementation of a code generator with Google Gemini AI integrated into it.

Project description

gemini_code_generator

Gemini Code Generator is an application used to generate code of any programming language based on the given specifications, with Google Gemini AI integrated into it.

Source Code

The source code of Gemini Code Generator is available in Source Code.

Installation

pip install gemini_code_generator

How to Use the Application?

Pre-requisites:

  1. Python installed in your device.
  2. .env file in the same directory as <GEMINI_CODE_GENERATOR_DIRECTORY> and has the value of GEMINI_API_KEY.
cd <GEMINI_CODE_GENERATOR_DIRECTORY>
python3 gemini_code_generator.py

Note: Replace <GEMINI_CODE_GENERATOR_DIRECTORY> with the path to the directory of the application Gemini Code Generator.

Then, the application will start with something looking like in the screenshot below.

Application

You will then be asked to input the following values.

  1. Temperature - between 0 and 1 inclusive
  2. Top P - between 0 and 1 inclusive
  3. Top K - at least 1
  4. Max output tokens - at least 1

The following screenshot shows what is displayed after inputting the mentioned values.

Programming Language Input

You will be required to enter the name of the programming language you want the code to be generated in. Then, you will be asked to enter the name of the file containing the generated code (it must be a file of the name of the programming language you entered earlier).

Code File Input

After that, your next step is to enter the specifications of the code you want to generate.

Specifications Input

Then, the file with the generated code will be run and you will see the output.

Code File Output

The generated code is in the relative path "../codes/<CODE_FILE_NAME>" from <GEMINI_CODE_GENERATOR_DIRECTORY>, where <CODE_FILE_NAME> is the name of the file containing the code (as you entered previously).

Generated Code File

Project details


Release history Release notifications | RSS feed

This version

1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gemini_code_generator-1.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

gemini_code_generator-1-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file gemini_code_generator-1.tar.gz.

File metadata

  • Download URL: gemini_code_generator-1.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.31.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.4

File hashes

Hashes for gemini_code_generator-1.tar.gz
Algorithm Hash digest
SHA256 9cfa665505548d016e7cf43b00ca0a5d2d0fcc22656c56e3758e38dd7ecfa4c2
MD5 f8f46a42a220870eb799f80adeb3c649
BLAKE2b-256 19ab31c36c007e147f5d7943baa65216701fe1cefb0a6b301154081cb6cc9834

See more details on using hashes here.

File details

Details for the file gemini_code_generator-1-py3-none-any.whl.

File metadata

  • Download URL: gemini_code_generator-1-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.31.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.4

File hashes

Hashes for gemini_code_generator-1-py3-none-any.whl
Algorithm Hash digest
SHA256 cb7e91c370eed1b0a3c38c69358463a65b5df7b73e7c122881f4a7073dac3a3e
MD5 4acf2e000b01139977b18209809aa030
BLAKE2b-256 ef3251a2717a66daa4e09aaeb809d83067f523952681b784349098f6642ab3b4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page