Package: tgpt
TGPTTGPT 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 ContentsInstallationUsageText CompletionsImage GenerationImage VariationClasses OverviewConfigHandlerCommandLineInterfaceGPTClientImageHandlerAdditional Features and OptionsChat ModeCustomizing Text CompletionsCustomizing Image Generation and VariationContributorsContributingLicenseChangelogNew Features and ImprovementsRemovals and DeprecationsInstallationInstall the package using pip:pipinstalltgptUsageText CompletionsTo generate text completions, you can run TGPT with your text prompt as an argument:tgpt"Your text prompt here"Image GenerationTo generate an image based on a text prompt, use the gi command followed by the text prompt:tgptgi"A futuristic city skyline"Image VariationTo generate a variation of an existing image, use the gv command followed by the path to the image:tgptgv"/path/to/your/image.png"Classes OverviewConfigHandlerHandles the retrieval of the API key, model, image path, max tokens, and temperature from the configuration file.CommandLineInterfaceProvides a command-line interface for interacting with the GPTClient and ImageHandler classes. It allows users to generate text completions, images, and image variations.GPTClientResponsible for making requests to OpenAI's API. It handles text completions and communicates with the ImageHandler for image-related tasks.ImageHandlerManages 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 OptionsChat ModeTo enter chat mode, use the --chat flag:tgpt--chatIn 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 CompletionsYou can customize the text completions by setting the -t, -n, and -m options:tgpttx"Your text prompt here"-t0.5-n3-m50-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 VariationYou can customize the image generation and variation by setting the -s and -n options:tgptgi"A futuristic city skyline"-slarge-n3-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).ContributorsMagnus Jansson: mengus00@gmail.com
GPT-4: openai.comContributingContributions are welcome! Please submit a pull request or create an issue to propose changes or report bugs.LicenseGNU General Public License v3.0ChangelogNew 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.