https://github.com/joeriddles/connect-json-schema-gen
Generate a Synadia Connect component with AI!
https://github.com/joeriddles/connect-json-schema-gen
Last synced: 12 months ago
JSON representation
Generate a Synadia Connect component with AI!
- Host: GitHub
- URL: https://github.com/joeriddles/connect-json-schema-gen
- Owner: joeriddles
- Created: 2025-01-31T04:14:47.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-31T05:50:43.000Z (over 1 year ago)
- Last Synced: 2025-07-12T03:43:39.523Z (12 months ago)
- Language: Python
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Generate a [Synadia Connect](https://github.com/synadia-io/connect) component with AI!
```
❯ ./main.py generate a nats source component
{
'model_version': '1.0.0',
'name': 'nats_source',
'label': 'NATS Source',
'kind': ,
'status': ,
'description': 'A source component that pulls data from NATS messaging system.',
'fields': [
{
'path': 'server_url',
'name': 'Server URL',
'label': 'NATS Server URL',
'kind': ,
'type': ,
'description': 'The URL of the NATS server to connect to.',
'default': 'nats://localhost:4222'
},
{
'path': 'subject',
'name': 'Subject',
'label': 'NATS Subject',
'kind': ,
'type': ,
'description': 'The NATS subject to subscribe to for incoming messages.',
'default': 'my.subject'
},
{
'path': 'queue_group',
'name': 'Queue Group',
'label': 'Queue Group',
'kind': ,
'type': ,
'description': 'The queue group to use for load balancing among multiple subscribers.',
'optional': True
},
{
'path': 'durable',
'name': 'Durable Subscription',
'label': 'Durable Subscription',
'kind': ,
'type': ,
'description': 'Whether to create a durable subscription to persist messages.',
'default': False
}
]
}
```
### Getting started
Set your OpenAI API key, create a virtual environment, install dependencies, and run it.
```shell
echo "OPENAI_API_KEY=__YOUR_OPENAPI_KEY__" > .env
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install requirements.txt
python3 -m main generate a nats source component
```
To regenerate `model.py`, run `make generate`.
To convert generated schemas from JSON to YAML, run `make convert`.