Skip to main content

TGPT

TGPT is a command-line tool for interacting with OpenAI's GPT-3.5-turbo model and generating images using DALL-E. This tool allows users to generate text completions and create images or variations of existing images using text prompts.

Table of Contents

Installation

  1. Install the package using pip:
pip install tgpt

Usage

Text Completions

To generate text completions, you can run TGPT with your text prompt as an argument:

tgpt "Your text prompt here"

Image Generation

To generate an image based on a text prompt, use the gi command followed by the text prompt:

tgpt gi "A futuristic city skyline"

Image Variation

To generate a variation of an existing image, use the gv command followed by the path to the image:

tgpt gv "/path/to/your/image.png"

Classes Overview

ConfigHandler

Handles the retrieval of the API key, model, image path, max tokens, and temperature from the configuration file.

CommandLineInterface

Provides a command-line interface for interacting with the GPTClient and ImageHandler classes. It allows users to generate text completions, images, and image variations.

GPTClient

Responsible for making requests to OpenAI's API. It handles text completions and communicates with the ImageHandler for image-related tasks.

ImageHandler

Manages image generation and variation requests to the DALL-E API. It provides functions to generate images based on text prompts and create variations of existing images.

Additional Features and Options

Chat Mode

To enter chat mode, use the --chat flag:

tgpt --chat

In chat mode, you can have a conversation with the AI by typing your messages in the terminal. Type /exit or /quit to end the session, /help for more commands.

Customizing Text Completions

You can customize the text completions by setting the -t, -n, and -m options:

tgpt tx "Your text prompt here" -t 0.5 -n 3 -m 50

-t or --temp: Controls the randomness of the AI's output (default: 0.7). -n or --num: The number of completions to generate (default: 1). -m or --max: The maximum number of tokens to generate for completions (default: 100).

Customizing Image Generation and Variation

You can customize the image generation and variation by setting the -s and -n options:

tgpt gi "A futuristic city skyline" -s large -n 3

-s or --size: The size of the generated images (options: small, medium, large; default: medium). -n or --num: The number of images to generate or vary (default: 1).

Contributors

Magnus Jansson: mengus00@gmail.com
GPT-4: openai.com

Contributing

Contributions are welcome! Please submit a pull request or create an issue to propose changes or report bugs.

License

GNU General Public License v3.0

Changelog

New Features and Improvements
- Restructured the project into a Python package for easy installation and distribution.
- Added the ConfigHandler class for managing configuration, including API key, model, image path, max tokens, and temperature.
- Replaced the old API key retrieval method with the ConfigHandler class.
- Deprecated the install.sh script and the tgpt script. Users should use pip to install the package.
- Enhanced the command-line interface with new options and arguments for greater flexibility and control.
Removals and Deprecations
- Removed the install.sh script as it is now replaced by the package installation using pip.
- Removed the combine_files.py script and the tgpt file, as the package structure replaces the need for combining files.
- Deprecated the manual installation instructions for the tgpt script. Users should use pip to install the package.
- Removed the old image save path configuration method. The image save path is now part of the configuration managed by ConfigHandler.

Release files for tgpt 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tgpt 0.1.0
File Size Uploaded
tgpt-0.1.0.tar.gz 24.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tgpt 0.1.0
File Interpreter ABI Platform
tgpt-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 48.6 kB

Release files / tgpt-0.1.0.tar.gz

Download URL tgpt-0.1.0.tar.gz
Size 24.0 kB
Tags Source
SHA-256 checksum
How to use checksums
6a246a1d71ac0c82029b81ef2c1abf80c9c0dedec41390436b94b190ad329ea9
BLAKE2b-256 checksum
How to use checksums
c3767eaea5ed5773b62ce05a453b073ae9be9c5fd43f7dafd3a3750526346ceb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.9

Release files / tgpt-0.1.0-py3-none-any.whl

Download URL tgpt-0.1.0-py3-none-any.whl
Size 24.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
abc978374bca3d4a80ee118a0fd742c123ef19988fc538b9a483cd5cd2d5e83c
BLAKE2b-256 checksum
How to use checksums
c77814f5fd9012a1bf5f72d060c2aa7121b02c190446c9cf6a4e4c3fcab79c29
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.9

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page