Skip to content

adamobeng/schemagen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

schemagen: Make tool-calling schemas for existing tools

Installation

The cli tool groff must be installed this package to work, e.g. on MacOS:

brew install groff

Usage

> json_function_schema, schema_arguments = man_schema(</path/to/man_file>)

json_function_schema can then be passed to tools which use JSON schemas to specify functions.

schema_arguments can be used to take a tool call dictionary and return the CLI arguments to run (e.g. via subprocess.run):

> json_function_schema, schema_arguments = man_schema(</path/to/ssh_man_file>)
> tool_call = { "destination": "user@example.org", "4": True, "E": "/tmp/log", "A": False, }
> get_cli_args(tool_call, schema_arguments)
['-4', '-E', '/tmp/log', 'user@example.org']

About

Make tool-calling schemas for existing tools

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published