Skip to main content

A package that helps users easily create functions to feed to GPT function calling API

Project description

FunctionalOAI

FunctionalOAI is a Python module // library designed to help you make the use of the GPT function calling API much easier.

Ideas

If you have any features or ideas that could be added to this project, you could open an issue.

Installation

  • Through pip
pip3 install funcOAI
  • Through setup.py
python3 setup.py install

Usage

# importing the main class
from funAI import FunAI

helper = FunAI()

@helper.attach
def my_function(*args, **kwargs):
    # provide gpt with something

# you could also use attachFunction
helper.attachFunction([my_function, func1, func2])

# or even this cursed one
helper.functions = my_function

# to see all functions
print(helper.functions)
  • After creating you're functions then you could use openai python module to create a chat with chatgpt and you could provide it with helper.functions

NOTICE!!

To make this module work correctly with all of you're functions there are set of rules you have to go by when defining the functions

  • Providing type annotations for all the arguments e.g ...
def foo(arg1: int, arg2: str, arg3: list):
  • Providing a docstring that follows PEP-257 One liner docstrings (you could do it as you like as long as its a function desciption without parameters and returns)
def add(x: int, y: int):
    """return the sum of x and y"""
    return x + y

WARNING

  • This module is not fully complete as it still lacks some extra functionality
  • There is no error handling as for now, so obeying the rules of function defining is necessary

Contribute

You could contribute through

  • Opening issues
  • Forking the repo
  • Creating Pull requests
  • etc...

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

funcOAI-0.0.2.tar.gz (4.0 kB view hashes)

Uploaded Source

Built Distribution

funcOAI-0.0.2-py3-none-any.whl (4.3 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