OPENAI tool that runs your prompts over a document
Project description
GPT Engine
GPT Engine is a Python module that allows you to interact with the OpenAI API to generate text. It can be used for a variety of tasks, such as:
Generating text:
This task allows you to generate text in a variety of formats, such as poems, code, scripts, musical pieces, email, letters, etc.
Answering questions:
This task allows you to ask OpenAI questions and get informative answers, even if they are open ended, challenging, or strange.
Following instructions:
This task allows you to provide OpenAI with instructions and have it complete your requests thoughtfully. To use GPT Engine, you will need to create a free account with OpenAI and get an API key. You can then install the GPT Engine module using pip:
pip install gptEngine Once you have installed the module, you need to create a credentials.ini file in the same directory as your project. The credentials.ini file should contain the following information:
[openai] OPENAI_API_KEY=<YOUR_OPENAI_API_KEY> The OPENAI_API_KEY parameter is your OpenAI API key. You can get your API key from your OpenAI account.
Once you have created the credentials.ini file, you can create a GPT Engine object:
engine = GPTEngine(main_task="Generate Text", input_prompt="Write a poem about love.") The main_task parameter specifies the type of task that you want to perform, and the input_prompt parameter specifies the input text that you want to provide to OpenAI.
To generate text, you can call the generate_response() method:
response = engine.generate_response("Convert the document to a poem.") The generate_response() method takes the instructions for how to convert the document as input. The response from OpenAI will be returned as a string.
The response from OpenAI will be a new document that has been converted based on the instructions that you have provided.
For more information, please see the GPT Engine documentation: https://github.com/mbsuraj/gptEngine/blob/main/README.md.
I hope this helps! Let me know if you have any other questions.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for gptEngine-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e36b2b6ef95053d91c1ab0a267039f85b1b8c9bdf91d67f0d9fd02c7ef284dc8 |
|
MD5 | ee018d0e2058bab1a47f9c3b8adfdf37 |
|
BLAKE2b-256 | f54f95ccf023591066c0c97c174ee3ce5cec6e76d08be65a2746a088217ecfa2 |