backend: Adds speech processing agent support
Enables the capability to integrate speech processing agents by adding room configuration to the token when the agent processing name is set in the environment. This allows to specify the agent to be dispatched on room creation.
This commit is contained in:
parent
bbd4d5fbaf
commit
073f0dc640
@ -82,7 +82,10 @@ export const MEET_ENV = {
|
||||
// Deployment configuration
|
||||
MODULES_FILE: process.env.MODULES_FILE || undefined,
|
||||
MODULE_NAME: process.env.MODULE_NAME || 'openviduMeet',
|
||||
ENABLED_MODULES: process.env.ENABLED_MODULES ?? ''
|
||||
ENABLED_MODULES: process.env.ENABLED_MODULES ?? '',
|
||||
|
||||
// Agent Speech Processing configuration
|
||||
AGENT_SPEECH_PROCESSING_NAME: process.env.MEET_AGENT_SPEECH_PROCESSING_NAME || '',
|
||||
};
|
||||
|
||||
export function checkModuleEnabled() {
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import { RoomAgentDispatch, RoomConfiguration } from '@livekit/protocol';
|
||||
import {
|
||||
MeetRoomMemberPermissions,
|
||||
MeetRoomMemberRole,
|
||||
@ -65,6 +66,18 @@ export class TokenService {
|
||||
at.addGrant(grants);
|
||||
}
|
||||
|
||||
if (MEET_ENV.AGENT_SPEECH_PROCESSING_NAME) {
|
||||
|
||||
this.logger.debug('Adding speech processing agent dispatch to token', MEET_ENV.AGENT_SPEECH_PROCESSING_NAME);
|
||||
at.roomConfig = new RoomConfiguration({
|
||||
agents: [
|
||||
new RoomAgentDispatch({
|
||||
agentName: MEET_ENV.AGENT_SPEECH_PROCESSING_NAME
|
||||
})
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
return await at.toJwt();
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user