-
Notifications
You must be signed in to change notification settings - Fork 82
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
Support for User-Defined Tags in Response Messages #339
Comments
uezo
added a commit
that referenced
this issue
Sep 13, 2024
Implement support for user-defined tags in response messages. Related issue: #339 Usage ```csharp // User defined tag example: Dynamic multi language switching // Insert following instruction to ChatGPTService. // ---- // If you want change current language, insert language tag like [language:en-US]. // // Example: // [language:en-US]From now on, let's talk in English. // ---- var chatGPTService = gameObject.GetComponent<ChatGPTService>(); chatGPTService.HandleExtractedTags = (tags, session) => { if (tags.ContainsKey("language")) { var language = tags["language"].Contains("-") ? tags["language"].Split('-')[0] : tags["language"]; if (language != "ja") { var openAITTS = gameObject.GetComponent<OpenAITTSLoader>(); modelController.RegisterTTSFunction(openAITTS.Name, openAITTS.GetAudioClipAsync, true); } else { var voicevoxTTS = gameObject.GetComponent<VoicevoxTTSLoader>(); modelController.RegisterTTSFunction(voicevoxTTS.Name, voicevoxTTS.GetAudioClipAsync, true); } var openAIListener = gameObject.GetComponent<OpenAISpeechListener>(); openAIListener.Language = language; Debug.Log($"Set language to {language}"); } }; ```
👍 |
and their WebGL components. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently, the framework supports built-in tags like [face:Joy] for facial expressions and [anim:wave_hands] for animations in the AI's response messages. It would be helpful to extend this functionality to allow user-defined tags.
Request:
This feature would allow developers to create more flexible and customizable interactions by adding their own sets of tags and corresponding custom logic for processing them.
Example use case: A developer could define a tag like [sound:bell] to trigger a specific sound effect in their application.
The text was updated successfully, but these errors were encountered: