Generate a pipeline for a Triggered or Ultra Task
Use SnapGPT to generate a pipeline you can run as a Triggered Task or an Ultra Task and call over HTTP.
You can generate a pipeline that can be run as a Triggered Task or an Ultra Task and called over HTTP.
Example: price quote API
The following prompt generates a pipeline for a Triggered Task that serves a price quote API:
Create a pipeline for a Triggered Task that serves a price quote API. A GET returns a sample quote. A POST with a JSON body containing product and quantity returns HTTP 201 with the total at $10 per unit; if either field is missing, return HTTP 400 with an error message. Any other method returns HTTP 405.
After you create the Triggered Task for the generated pipeline, you can call the task with
GET, POST, and PUT requests. Replace $TASK_URL, $USER, and
$PASS with your task URL and credentials.
curl -i -u "$USER:$PASS" -X POST -H 'Content-Type: application/json' -d '{"product":"widget","quantity":3}' "$TASK_URL"
curl -i -u "$USER:$PASS" -X POST -H 'Content-Type: application/json' -d '{"product":"widget"}' "$TASK_URL"
curl -i -u "$USER:$PASS" -X PUT -H 'Content-Type: application/json' -d '{"product":"widget","quantity":3}' "$TASK_URL"
curl -i -u "$USER:$PASS" "$TASK_URL"



