Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AiChatTown-RolePlay #644

Open
7 tasks done
kvker opened this issue May 16, 2024 · 0 comments
Open
7 tasks done

AiChatTown-RolePlay #644

kvker opened this issue May 16, 2024 · 0 comments
Labels
✨ New example A new example

Comments

@kvker
Copy link

kvker commented May 16, 2024

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

@kvker kvker added the ✨ New example A new example label May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ New example A new example
Projects
None yet
Development

No branches or pull requests

1 participant