How to define and add custom AIGC scenes
mainThe Node Server automatically discovers available scenes by reading .json files located in the server/scenes directory. To add a new scene:
- Create a new
xxxx.jsonfile inserver/scenes/(wherexxxxis your scene name). - Use
default.jsonas a template to ensure your JSON structure is correct. Note that filenames are case-sensitive. - Restart the server after modifying scenes. If using
yarn --cwd server dev, the server will automatically restart on JS/JSON changes, but it will not restart when.env.localchanges.
Important Lifecycle Notes:
- The server dynamically generates
RTC RoomId,UserId,Token, andVoiceChat TaskIdfor each session. These are not written back to your JSON files. AgentConfig.UserIdmust be provided within your scene JSON.- The server overrides
VoiceChatfields such asAppId,RoomId,TaskId, andAgentConfig.TargetUserId, and enablesEnableConversationStateCallback. You do not need to include these runtime fields in your JSON.
// Reference server/scenes/default.json for the correct schema