Code Generation Prompt for Custom Functions
Instructions: Replace the information inside the [brackets] to be what you want the AI agent to do.
Last updated
Instructions: Replace the information inside the [brackets] to be what you want the AI agent to do.
Last updated
I want to create a custom function for my AI agent that retrieves information based on user input.
This new custom function will [describe what you want the AI to do] using data from [how the AI is accessing the data/app/database/website etc.]
The function should be able to accept a [input_type] and return the corresponding [output_type] using the [API_name].
Example Input: [your example input from a user talking with the ai]
Example Output: [example output of what data youβre expecting the AI to get]
Provide the complete code for the Flask app and the JSON parameters for the AI custom function.
Here are the details:
The function name should be formatted like: functionName.
Based on the requirements above it will fetch the Output.
The Flask app should have an endpoint /get_{output_type}
that accepts a POST request with a JSON body containing the {input_type}.
The API response should be parsed to extract the relevant {output_type} information.
If there are any errors (HTTP errors, network errors, or invalid input), they should be handled gracefully and return appropriate error messages.
Please provide the complete code for the Flask app, and also the JSON parameters for the custom function interface.
Provide the complete code for the Flask app. Provide the JSON parameters for the custom function interface. Provide the name of the function. Provide the short description of the function. Provide the info to test in reqbin. The API keys should be stored as a variables.