backend: Update captions agent name and improve environment checks in TokenService
This commit is contained in:
parent
43f7ff5001
commit
4ac182c244
@ -49,7 +49,7 @@ export const INTERNAL_CONFIG = {
|
||||
PARTICIPANT_MAX_CONCURRENT_NAME_REQUESTS: '20', // Maximum number of request by the same name at the same time allowed
|
||||
PARTICIPANT_NAME_RESERVATION_TTL: '12h' as StringValue, // Time-to-live for participant name reservations
|
||||
|
||||
CAPTIONS_AGENT_NAME: 'agent-meet-captions',
|
||||
CAPTIONS_AGENT_NAME: 'agent-speech-processing',
|
||||
|
||||
// MongoDB Schema Versions
|
||||
// These define the current schema version for each collection
|
||||
|
||||
@ -71,17 +71,22 @@ export class TokenService {
|
||||
at.addGrant(grants);
|
||||
}
|
||||
|
||||
const captionsEnabledInEnv = MEET_ENV.CAPTIONS_ENABLED === 'true';
|
||||
const captionsEnabledGlobally = MEET_ENV.CAPTIONS_ENABLED === 'true';
|
||||
const captionsEnabledInRoom = Boolean(roomWithCaptions);
|
||||
|
||||
// Warn if configuration is inconsistent
|
||||
if (!captionsEnabledInEnv && captionsEnabledInRoom) {
|
||||
this.logger.warn(
|
||||
`Captions feature is disabled in environment but Room is created with captions enabled. Please enable captions in environment by setting MEET_CAPTIONS_ENABLED=true to ensure proper functionality.`
|
||||
);
|
||||
if (!captionsEnabledGlobally) {
|
||||
if (captionsEnabledInRoom) {
|
||||
this.logger.warn(
|
||||
`Captions feature is disabled in environment but Room is created with captions enabled. ` +
|
||||
`Please enable captions in environment by setting MEET_CAPTIONS_ENABLED=true to ensure proper functionality.`
|
||||
);
|
||||
}
|
||||
|
||||
return await at.toJwt();
|
||||
}
|
||||
|
||||
if (captionsEnabledInEnv && captionsEnabledInRoom) {
|
||||
if (captionsEnabledInRoom) {
|
||||
this.logger.debug('Activating Captions Agent. Configuring Room Agent Dispatch.');
|
||||
at.roomConfig = new RoomConfiguration({
|
||||
agents: [
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user