Skip to main content

A library for generating tools for OpenAI projects

Project description

A clean way to generate tools to be used with openai projects

from typing import Annotated
from openai_toolgen import tool

@tool
def foo(
    arg1: Annotated[int, "Description about arg1"],
    arg2: Annotated[str, "Description about arg2"]
    ):
    """Description how to use foo"""
    ...

assert tool.export_all() == [
    {
        "type": "function",
        "name": "foo",
        "description": "Description how to use foo",
        "parameters": {
            "type": "object",
            "properties": {
                "arg1": { 
                    "type": "number",
                    "description": "Description about arg1"
                },
                "arg2": { 
                    "type": "string",
                    "description": "Description about arg2"
                }
            },
            "required": ["arg1", "arg2"]
        }
    }
]

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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

openai_toolgen-0.1.0-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file openai-toolgen-0.1.0.tar.gz.

File metadata

  • Download URL: openai-toolgen-0.1.0.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for openai-toolgen-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f2c91b9e4b96fa6a6e1726c3a7ef642c318314e84d23d11a53a631279521cd6c
MD5 fbed4649a09d087aeb73cf48262254ce
BLAKE2b-256 0d38b68d3ca345e89c16ccbef5afcf600f72a06e8c18c2dbcce3c86a762e4125

See more details on using hashes here.

File details

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

File metadata

  • Download URL: openai_toolgen-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for openai_toolgen-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 646debabc37ae363f47eacb075200858c674cef205b26690889c3b1d2de53fb7
MD5 33a4b223757c8fb05e98d82297c83b7d
BLAKE2b-256 3153e04aa21a8093f04e63d81b8737fefe40a12281ce57a9cc26e22c90145ace

See more details on using hashes here.

Supported by

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