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.4.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

openai_promptify_py-0.0.4-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: openai-promptify-py-0.0.4.tar.gz
  • Upload date:
  • Size: 5.6 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.4.tar.gz
Algorithm Hash digest
SHA256 896df1fd3565770939c975b14c3b50a6edc1854aaec4f15bbf9c285545f98f6c
MD5 f96675d4d2c67cf426b3a9c0c673da20
BLAKE2b-256 761bee9a7a16c5a6c0f5b5dfc7e1de54bfc5369e0aadf2c1fe97c6a5ea622c3b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for openai_promptify_py-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e5fd23def20ae89136301ca0e6aac11702aa7edf39ed3695ca8dd95370373960
MD5 6a95544340094b0369886d49e0ed6e3e
BLAKE2b-256 ced60deeb6e82373c3636778118253a5c5c6ba123bb16f98f7a02b8e6e8a2dd1

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