{"id":570,"date":"2023-12-18T16:54:20","date_gmt":"2023-12-18T16:54:20","guid":{"rendered":"https:\/\/beams-experiments.com\/?page_id=570"},"modified":"2024-01-04T03:44:44","modified_gmt":"2024-01-04T03:44:44","slug":"test-gpt-4","status":"publish","type":"page","link":"https:\/\/beams-experiments.com\/index.php\/test-gpt-4\/","title":{"rendered":"Test GPT-4"},"content":{"rendered":"\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"UTF-8\">\n    <title>Task Setup<\/title>\n    <!-- Include jQuery -->\n    <script src=\"https:\/\/ajax.googleapis.com\/ajax\/libs\/jquery\/3.6.0\/jquery.min.js\"><\/script>\n<\/head>\n<body>\n<div id=\"taskDisplay\"><\/div>\n\n<form id=\"taskSetupForm\">\n    <!-- Session Number Input -->\n    <p>Enter the number of sessions for GPT-4 to perform:<br>\n       <input type=\"number\" id=\"sessionsNumber\" min=\"1\"><\/p>\n\n    <!-- Group ID Selection -->\n    <p>Enter the groupID:<br>\n       <select id=\"groupID\">\n           <option value=\"0\">0 = Control Group<\/option>\n           <option value=\"1\">1 = SCAMPER<\/option>\n           <option value=\"2\">2 = Association<\/option>\n           <option value=\"3\">3 = Transformational Creativity<\/option>\n       <\/select><\/p>\n\n    <!-- Product ID Selection -->\n    <p>Enter the productID:<br>\n       <select id=\"productID\">\n           <option value=\"1\">1 = Phone<\/option>\n           <option value=\"2\">2 = Shoe<\/option>\n           <option value=\"3\">3 = Water Bottle<\/option>\n       <\/select><\/p>\n\n    <!-- Send Task Button -->\n    <button type=\"button\" id=\"sendButton\">Send Task<\/button>\n<\/form>\n\n<script>\n    function sendTaskToGPT4(completeTask, groupID, productID) {\n        $.post('https:\/\/beams-experiments.com\/getAPIKey2.php', { chatLog: completeTask })\n        .done(function(responseText) {\n            try {\n                var response = JSON.parse(responseText);\n                if (response && response.choices && response.choices.length > 0 && response.choices[0].message) {\n                    var gpt4Response = response.choices[0].message.content;\n                    console.log('GPT-4 Response:', gpt4Response);\n\n                    \/\/ Send GPT-4 response to your database\n                    $.post('https:\/\/www.beams-experiments.com\/testGPT4.php', {\n                        chatLog: gpt4Response,\n                        groupID: groupID,\n                        productID: productID\n                    })\n                    .done(function(dbResponse) {\n                        console.log('Response from database insert:', dbResponse);\n                    })\n                    .fail(function(jqXHR, textStatus, errorThrown) {\n                        console.error(\"Error sending data to the database:\", textStatus, errorThrown);\n                    });\n                } else {\n                    console.error('Unexpected response format or no response:', response);\n                }\n            } catch (e) {\n                console.error(\"Error parsing JSON response:\", e);\n            }\n        })\n        .fail(function(jqXHR, textStatus, errorThrown) {\n            console.error(\"Error in communication with GPT-4:\", textStatus, errorThrown);\n        });\n    }\n\n    document.getElementById('sendButton').addEventListener('click', function() {\n        var sessionsNumber = parseInt(document.getElementById('sessionsNumber').value);\n        var groupID = parseInt(document.getElementById('groupID').value);\n        var productID = parseInt(document.getElementById('productID').value);\n\n        var productType, companyType, completeTask;\n        switch (productID) {\n            case 1:\n                productType = \"phone\";\n                companyType = \"mobile phone\";\n                break;\n            case 2:\n                productType = \"sport shoe\";\n                companyType = \"footwear\";\n                break;\n            case 3:\n                productType = \"water bottle\";\n                companyType = \"water bottling\";\n                break;\n        }\n\n        completeTask = \"You work for a prominent \" + companyType + \" company in the unit responsible for developing new products. Your supervisor has requested that you present a minimum of 10 ideas for a new \" + productType + \", targeting a specific market or consumer segment that is currently underserved. Ensure that you provide 10 creative ideas.\";\n\n                            \/\/ Append additional text based on groupID\n     if (parseInt(groupID) === 1) {\n        completeTask += \" Additionally, you are instructed to use the following technique\/process called SCAMPER - an acronym for Substitute, Combine, Adapt, Modify, Put to another use, Eliminate, and Reverse:\\n\" +\n            \"\u2022 Substitute: Replace elements of your idea with alternatives.\\n\" +\n            \"\u2022 Combine: Merge different features or aspects.\\n\" +\n            \"\u2022 Adapt: Borrow elements from other ideas or contexts.\\n\" +\n            \"\u2022 Modify: Alter aspects of your idea to improve it.\\n\" +\n            \"\u2022 Put to another use: Imagine new applications for your idea.\\n\" +\n            \"\u2022 Eliminate: Remove unnecessary elements.\\n\" +\n            \"\u2022 Reverse: Rearrange or invert aspects of your idea.\";\n    } else if (parseInt(groupID) === 2) {\n        completeTask += \" Additionally, you are instructed to use the following technique\/process called Association: Establish connections\u2014for example, associating the product concept with items that are seemingly not connected such as a stapler, wallet, light, or articles of clothing.\";\n    } else if (parseInt(groupID) === 3) {\n        completeTask += \" Additionally, you are guided to apply a method known as Transformational Creativity. Transformational creativity refers to a profound and often radical process of innovation that fundamentally alters the conceptual framework and understanding of a subject, object, or field. It involves redefining or reimagining the core attributes, purposes, or applications of an idea or product. This form of creativity typically leads to disruptive innovations, creating new paradigms or significantly reshaping existing ones. It is characterized by its open-ended, exploratory nature and its potential to generate groundbreaking, paradigm-shifting outcomes, rather than just incremental improvements.\";\n    }\n\n\n\n        console.log('completeTask is ', completeTask);\n\n        \/\/ Loop to handle multiple sessions\n        for (let i = 0; i < sessionsNumber; i++) {\n            sendTaskToGPT4(completeTask, groupID, productID);\n        }\n    });\n<\/script>\n\n<\/body>\n<\/html>\n\n","protected":false},"excerpt":{"rendered":"<p>Task Setup Enter the number of sessions for GPT-4 to perform: Enter the groupID: 0 = Control Group1 = SCAMPER2 = Association3 = Transformational Creativity Enter the productID: 1 = Phone2 = Shoe3 = Water Bottle Send Task<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"om_disable_all_campaigns":false,"footnotes":""},"class_list":["post-570","page","type-page","status-publish","hentry"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/beams-experiments.com\/index.php\/wp-json\/wp\/v2\/pages\/570","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/beams-experiments.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/beams-experiments.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/beams-experiments.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/beams-experiments.com\/index.php\/wp-json\/wp\/v2\/comments?post=570"}],"version-history":[{"count":33,"href":"https:\/\/beams-experiments.com\/index.php\/wp-json\/wp\/v2\/pages\/570\/revisions"}],"predecessor-version":[{"id":719,"href":"https:\/\/beams-experiments.com\/index.php\/wp-json\/wp\/v2\/pages\/570\/revisions\/719"}],"wp:attachment":[{"href":"https:\/\/beams-experiments.com\/index.php\/wp-json\/wp\/v2\/media?parent=570"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}