GDevelopApp/GDevelop-examples

AiChatTown-RolePlay

Opened this issue · 0 comments

Describe the example

This is a game demo that illustrates how to use JavaScript to call OpenAI's ChatGPT conversation API. The demo includes two scenarios: one for selecting a model, where you can move to the corresponding character and press the spacebar to enter the conversation scene; the other is the conversation scene, which follows different logic paths based on your choices.

There are mainly two types of interactions: one is SSE (Server-Sent Events) streaming conversation, and the other is synchronous conversation.

If you wish to make modifications, it is recommended to replace the API URL with the one from OpenAI, along with the corresponding API key.
(Note that considering the accessibility for users in China, a proxy URL and key are used. Non-Chinese users should use their own credentials.)

Checklist

  • [ x] I've followed all of the best practices.
  • My game has a proper name in the game properties.
  • My game package name begins with com.example..
  • My game has all events unfolded.
  • I've added myself as the author in the game properties.
  • I've included a file called "README.md" with a description in proper English, explaining what this example is doing.
  • I confirm that this game and all of its resources can be integrated to this GitHub repository, distributed and MIT licensed.
  • I've cleaned unused resources.

Game folder

AiChatTown-RolePlay.zip