Skip to main content

python openai functions tooling

Project description

openai-functools

openai-functools is a Python library designed to enhance the functionality of OpenAI's gpt-3.5-turbo-0613 and gpt-4-0613 models for function calling. This library focuses on generating the required JSON automatically by wrapping existing Python functions in our decorator. This removes the need for you to manually create and manage the JSON structures required for function calling in these models.

Installation

This package is hosted on PyPI and can be installed with pip:

pip install openai-functools

Alternatively, you can clone this repository and install with Poetry:

git clone https://github.com/username/openai-functools.git
cd openai-functools
poetry install

Usage

To use openai-functools, import the package and wrap your function with the provided decorator:

from openai_functools import openai_function

@openai_function
def my_function(arg1: str, arg2: int) -> str:
    # Your code here

This will automatically generate the necessary JSON structure for use with the Chat Completions API.

Examples

Several examples can be found in the examples directory of this repository. Each example provides a concrete implementation of how to use openai-functools in different scenarios.

Contributing

We welcome contributions to openai-functools! Please see our contributing guide for more details.

Support

For support with openai-functools, please open an issue on this GitHub repository. We will do our best to assist you.

License

openai-functools is licensed under the MIT license. See the LICENSE file for details.

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_functools-0.2.14.tar.gz (3.9 kB view hashes)

Uploaded Source

Built Distribution

openai_functools-0.2.14-py3-none-any.whl (5.1 kB view hashes)

Uploaded Python 3

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