Where do you go to use this ?
google ChatGPT … once you create an account you will end up with something like … OpenAI API
You train it by telling it what it has done wrong.
Also another trick is it doesn’t always give you all the code/steps, so you say continue from (last line it gave you, or from step x).
The (working) answer I got
This is the code that it produced in relation to my first question. It is simple standard alone php file that works just by quering the data base and not writing an add-on (place in a file with php extension and replace with your log in details).
<?php
// Connect to the database
$db = mysqli_connect("localhost", 'User_name, 'password', ‘database');
// Query the database to select the product name, status, and price for all products
$query = "SELECT pd.product,
CASE p.status
WHEN 'A' THEN 'Active'
WHEN 'D' THEN 'Deleted'
WHEN 'H' THEN 'Hidden'
END AS status,
p.list_price
FROM cscart_product_descriptions pd
INNER JOIN cscart_products p ON pd.product_id = p.product_id";
$result = mysqli_query($db, $query);
// Loop through the result set and display the product name, status, and price
while ($row = mysqli_fetch_array($result)) {
echo "<h3>" . $row['product'] . "</h3>";
echo "<p>Status: " . $row['status'] . "</p>";
echo "<p>Price: $" . $row['list_price'] . "</p>";
}
// Close the database connection
mysqli_close($db);
?>
How to train it to write an add-on?
After my first post (above) I almost got it to write the add-on, by saying stuff like, “aren’t you required to register the hooks” & “doesn’t cs-cart require a func.php” file and it would responsd. Yes you are right … then provide revised code/instructions. I had it writing five seperate files when it bombed out.
When I logged back in I got a completely different answer. Logged out and logged in again and got an answer close to where I started the first time. So I tried writing the question addressing many of the mistakes it made from my first attempt with the following question …
" Can you describe the steps and code required to display the last five vendors created and the number of products they own. Lets display them by appending a new data block to the TPL hook index in the admin panel dashboard template (design/backend/templates/views/index/index.tpl ). Lets call the add-on “last five vendors” and create the following files as part of the solution: addon.xml, init.php, func.php created in the app/addons/last_five_vendors directory, index.post.tpl created in the app/design/backend/templates/addons/last_five_vendors/hooks/index/ directory and index.post.php created in the app/addons/last_five_vendors/controllers/backend/ directory. The addon.xml file will need to create a table that holds the data to be displayed (drop table if it exists). The init.php file will need to register the needed hooks. The index.post.tpl file will display the data and the index.post.php file will collect the data to be displayed (from the table created within the addon.xml file)."
This addressed all mistakes it made the first time around that got me to a almost working add-on, but it still made mistakes (including not closing out the php code … ?> … and I gave up.
Unfortunetly I didn’t capture that code from my add-on attempt, but it was pretty close to working. I got a notification that it now remembers chat history but it didn’t when I tried so it is lost forever.
Why it repeats mistakes I don’t know … was it corrupted by other users (the first time they released after three days it thought it was god!) do the researchers deliberately make it make mistakes to see how different humans correct it (as part of it’s learning model) or is there multiple instances running?