Skip to main content

Generate OpenAI Compatible tool definitions by parsing Python functions

Project description

OpenAI Function Generator

This project provides a tool to generate JSON schema definitions for OpenAI functions.

Installation

pip install openai-tool-generator

Usage

from openai_tool_generator.generate_tool_definition import generate_tool_definition

def sample_func(a: int, b: Optional[str] = "default", c: List[float] = [1.0, 2.0]) -> None:
    """
    Sample function for testing
    """
    pass

definition = generate_tool_definition(sample_func)
print(definition)

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_tool_generator-0.2.0.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

openai_tool_generator-0.2.0-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file openai_tool_generator-0.2.0.tar.gz.

File metadata

  • Download URL: openai_tool_generator-0.2.0.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.1

File hashes

Hashes for openai_tool_generator-0.2.0.tar.gz
Algorithm Hash digest
SHA256 cf80a1b5dabe3925bfeb2a552a02732c402a9e7c4261e9ef1e2256741c751534
MD5 10b6d9d2eb83a5c96bdd466c5bf6804c
BLAKE2b-256 d8dde9afd8e935c49f93a6b76f997758f17fee625264a3c04c428572fc2d4855

See more details on using hashes here.

File details

Details for the file openai_tool_generator-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for openai_tool_generator-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6cc2954a479467bda33f79b8e7ed8daaf35ac45c9c2d286c1b8055eebe6c4c8d
MD5 13197a0e300786fa0be51fe2e4d504a9
BLAKE2b-256 3b51aa7f2f07e862f2d7909e7d5c4963d485750bbab1164a99d927f8bb942f8c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page