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
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 openai_functools-0.2.12-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd233a860477bbdf45c763316874a5938605197244d355ac0185927ad8103f7b |
|
MD5 | 5787642f67c9a0eef9697f38c8fc4243 |
|
BLAKE2b-256 | 783f6b1e40c6c5ffbb324d2181195e59613c4bea8283f290fc7c6591f9a5810b |