Skip to main content

No project description provided

Project description

synapseai

Generate OpenAI function-calling schemas from your tool classes!

Features

  • Reads all Python tool classes in a folder
  • Extracts class name, docstring, and Pydantic Field attributes
  • Outputs OpenAI-compatible function-calling schema JSON

Installation

pip install synapse

As a Python Library

from synapseai import generate_schema

schemas = generate_schema(folder='/path/to/tools')
# or
schemas = generate_schema(files=['/path/to/tools/ToolA.py', '/path/to/tools/ToolB.py'])

Output Format

The output is a list of schemas in OpenAI function-calling format:

[
  {
    "type": "function",
    "function": {
      "name": "tool_name",
      "description": "...",
      "parameters": {
        "type": "object",
        "properties": { ... },
        "required": [ ... ]
      }
    }
  },
  ...
]

License

MIT

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

synapseai_python-0.2.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

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

synapseai_python-0.2-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file synapseai_python-0.2.tar.gz.

File metadata

  • Download URL: synapseai_python-0.2.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for synapseai_python-0.2.tar.gz
Algorithm Hash digest
SHA256 682092f6d898ebff262c46cea17a208be7f44b8d8a3bf0c2c61d2c7dd4c49234
MD5 3fb3de75fd3261d1ad118b9af6eccc54
BLAKE2b-256 b3b4cbe40d8e24ee4bc46de73d6915507181df92ce3f6cec0bf941931edf47c7

See more details on using hashes here.

File details

Details for the file synapseai_python-0.2-py3-none-any.whl.

File metadata

  • Download URL: synapseai_python-0.2-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for synapseai_python-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8fec3a7f1de19d8efa5caac0266c0948e12fee254f9ade2c0b0b2056430aaba7
MD5 f875f984c6f9ddcb48935709a11362e4
BLAKE2b-256 69ef69ed07dd0e99d613ae238a9a57e28a7189df0e0b6fd83271cd4464fac2aa

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