Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a
generate
command to the CLI, which calls out to the AI codegen services ingen
See details in #606
At the moment this is a simplified form. It doesn't generate a full adaptor, it just generates adaptor.js with the generated code.
There are a whole host of backend changes required in
gen
, including:Still to do in this PR:
openfn generate adaptor dhis2 spec=./dhis2.json --endpoint=getTrackedEntityInstances
is not particularly friendly. I suppose you can encode the whole request into jsonopenfn generate adaptor ./spec.json
, but really you only want to fire it once. At least, if we get it to work.openfn data <url>
command, or something, which basically posts a payload to an arbitrary endpoint on the python server. This is an extension hook which allows someone to easily add a new endpoint to the Python AI service and call it from the CLI without any development. Thedata
command would load some JSON input, post it to the server (perhaps with an API key), and output the result somewhere on disk.template
folder). See Build tool: generate new adaptor adaptors#19Maybe to do later: