diff --git a/.env.example b/.env.example index cb01683..46c268d 100644 --- a/.env.example +++ b/.env.example @@ -58,3 +58,5 @@ STRIPE_SECRET= MUX_WORKSPACE_ID= MUX_API_TOKEN= + +OPEN_AI_API_KEY= diff --git a/app/Console/Commands/GenerateTemplate.php b/app/Console/Commands/GenerateTemplate.php new file mode 100644 index 0000000..dfa3d02 --- /dev/null +++ b/app/Console/Commands/GenerateTemplate.php @@ -0,0 +1,236 @@ +Looking for a real person to speak to?
We're here for you! Just drop in your queries below and we'll connect with you as soon as we can.
", + "re_fillable": false, + "use_captcha": false, + "redirect_url": null, + "submitted_text": "Great, we've received your message. We'll get back to you as soon as we can :)
", + "uppercase_labels": false, + "submit_button_text": "Submit", + "re_fill_button_text": "Fill Again", + "color": "#3B82F6" + } + ``` + The form properties can have one of the following types: 'text', 'number', 'select', 'multi_select', 'date', 'files', 'checkbox', 'url', 'email', 'phone_number'. + All form properties objects need to have the keys 'help', 'name', 'type', 'hidden', 'placeholder', 'prefill'. + + For the type "select" and "multi_select", the input object must have a key "select" (or "multi_select") that's mapped to an object like this one: + ```json + { + "options": [ + {"id":"Option 1","name":"Option 1"}, + {"id":"Pption 2","name":"Option 2"} + ] + } + ``` + + Give me the JSON code only, for the following form: "[REPLACE]" + Do not ask me for more information about required properties or types, suggest me a form structure instead. + EOD; + + const FORM_DESCRIPTION_PROMPT = <<