Example of response object model : { "name": "promptname", "schema": { "type":…
- User
User: Example of response object model :
{"name": "prompt_name", "schema": { "type": "string", "code": { "prompt": { "task_name": "task name", "description": "generated description",
"dependencies": [ "generated description as array of instructions for tasks", ], "status": "pending", "isImport": false, } } } }
User: Api function model : exports.apiName = async () => {...}
User: Tasks: create detailed discriptions to perform a router file., if the api needs a params add id in the router path lik 'router/:id' , use PSOT, GET,DELETE,PUT methods Generate dependencies for the listed tasks and provide a JSON response in the following structure:
Response Format: JSON.
Assistant:
- Assistant
Here's an example response object model following your instructions for creating a router file with specified tasks using the required HTTP methods:
{ "name": "router_file_generation", "schema": { "type": "object", "code": { "prompt": { "task_name": "Create Router File", "description": "Generate a router file that defines API endpoints for handling CRUD operations. The router should include endpoints for creating, fetching, updating, and deleting resources. Each endpoint must follow the RESTful conventions and include parameterized routes when necessary.", "dependencies": [ "Define POST endpoint: router.post('/resource', createResourceHandler). Create a function to handle incoming data and save it to the database.", "Define GET endpoint: router.get('/resource/:id', getResourceHandler). Create a function to retrieve a resource by ID from the database.", "Define PUT endpoint: router.put('/resource/:id', updateResourceHandler). Create a function to update an existing resource identified by ID in the database.", "Define DELETE endpoint: router.delete('/resource/:id', deleteResourceHandler). Create a function to remove a resource identified by ID from the database." ], "status": "pending", "isImport": false } } } }