Saturday, April 08, 2023

ChatGPT generated chess, to play with OpenAI GPT API

Play chess against GPT-4 using its own generated code for UX interaction. | LinkedIn

interesting experiment; HTML+JS code generated by ChatGPT (4) 
that is able to call OpenAI GPT API to "play chess"

This requires opening an account on OpenAI
and then generating "API KEY" that is needed to play this chess.
But that API KEY is not free, need to provide billing info (credit card).
There is an option to configure soft and hard limit.
The default is $120, so make sure to adjust it before using!

Anyway, while the chess UI code works, the generate response from OpenAI API
comes with "invalid move"... That is likely since default API is using GPT3, not GPT4

here is the code on GitHub

jean-bovet/GPT: Experimentations with GPT-4

a simple way to run on local computer is to run a simple web server

here are a few way to run local web server from the folder with web source code

DraganSr: simplest web file server

i.e. with JavaScript / npm

npm install http-server -g
http-server -a localhost -p 8080
or with Python
python -m http.server

No comments: