Skip to main content

Transform Python function docstrings into JSON schemas compliant with OpenAI function calling protocols.

Project description

OpenAI Function Parser

Transform Python function docstrings into JSON schemas compliant with OpenAI function calling protocols.

Installation

pip install openai-function-parser

Usage

from openai_function_parser import get_function_calling_schema


def my_function(a: int, b: str, c: float = 1.0) -> int:
    """
    My function description.

    Args:
        a: My first argument.
        b: My second argument.
        c: My third argument.

    Returns:
        My return value.
    """
    return 1

function_call_schema = get_function_calling_schema(my_function)
print(function_call_schema)

Authors

Xiaotian Duan (xduan7 at gmail dot com)

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_func_parser-0.1.0.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

openai_func_parser-0.1.0-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

Details for the file openai_func_parser-0.1.0.tar.gz.

File metadata

  • Download URL: openai_func_parser-0.1.0.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.0 CPython/3.10.13 Darwin/23.1.0

File hashes

Hashes for openai_func_parser-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d47804b232dc4d5021a5102e1425c551f4319f5380eba7dd0022fdd35d7a4495
MD5 622c5397b0b2af6e70ba4da371a713ec
BLAKE2b-256 551c084e02f992622789de1a1f7512fc5c7bcd396b1f85cb4e7b6cd35208e807

See more details on using hashes here.

File details

Details for the file openai_func_parser-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for openai_func_parser-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b6c0246610a76743028ee0c27b2fcc25607058ddd7b56f752423a8eb784c0717
MD5 00561acac30250b3a45d9f355a430564
BLAKE2b-256 f8d9d7e0c9bb37ccc8c99758b7468586a2f36bbb828dd723730f6b3eb95687eb

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