Skip to main content

a utility wrapepr for openai calls [NOT OFFICIAL]

Project description

openai-promptify-py

Important Alert: This library is not supported by OpenAI. But only a utility wrapper maintained by certain human beings.

OpenAI Promptify Py is a Python library that provides a wrapper on top of OpenAI API models and abstracts out some details, such as retrying and chunking into smaller calls. The library also enables users to give model configurations as a dictionary, including the OpenAI model name, temperature, frequency penalty, presence penalty, and a prompt. Users can then call the API with a "proxy model name" and get the results without having to provide all configurations again and again.

Installation

You can install OpenAI Promptify Py using pip:

pip install openai-promptify-py

Usage

Here's an example of how to use OpenAI Promptify Py:

from openai_promptify_py import OpenAIPromptifyPy

    models = {
        'foo': {
            'model_name': 'text-ada-001',
            'prompt': 'Lazy brown {animal} jumped {location}',
        },
    }

    feature = OpenAIPromptify(openai_key=os.environ.get('OPENAI_KEY'), model_repo=models)
    response = feature.get_response('foo', {'animal': 'fox', 'location': 'over the moon'})

Contributing

If you'd like to contribute to OpenAI Promptify Py, please open an issue or pull request on our GitHub repository: https://github.com/tumatrix/openai-promptify-py

License

OpenAI Promptify Py is licensed under the MIT License.

Project details


Download files

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

Source Distribution

openai-promptify-py-0.0.2.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

openai_promptify_py-0.0.2-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file openai-promptify-py-0.0.2.tar.gz.

File metadata

  • Download URL: openai-promptify-py-0.0.2.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.14

File hashes

Hashes for openai-promptify-py-0.0.2.tar.gz
Algorithm Hash digest
SHA256 18bc92322e64037f1fd0e90feded1393362dc8e68f2befb5a052d97400866b5c
MD5 9deba17ba0602c8342d4f5a6121e5cce
BLAKE2b-256 1fd7a18fc078f39ec8b8ad3e9b6e7af87d75992a44ced4244f8474a69bb720e9

See more details on using hashes here.

File details

Details for the file openai_promptify_py-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for openai_promptify_py-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 be1984cdff3e5f5699fb7dc092a3805f1df740819ffe9f069682264cf627acc6
MD5 04cc713b65b9e4b59a48a86df2a5f637
BLAKE2b-256 4b051d34289db3cc21f14ce7f4136f8d5d815c5b504da650a6e52e5094dd3313

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