mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-06 16:24:17 +00:00
21 lines
651 B
TypeScript
21 lines
651 B
TypeScript
import type { AgentType } from '@shumai/dtos'
|
|||
|
|
|
||
|
|
const systemAgentSettings = {
|
||
|
|
embedding: { envKey: 'ENABLE_EMBEDDING_AGENT', name: 'Embedding agent', avatar: 'avatar-1' },
|
||
|
|
transcription: {
|
||
|
|
envKey: 'ENABLE_TRANSCRIPTION_AGENT',
|
||
|
|
name: 'Transcript Agent',
|
||
|
|
avatar: 'avatar-2',
|
||
|
|
},
|
||
|
|
} as const
|
||
|
|
|
||
|
|
export function getSystemAgentSetting(type: AgentType) {
|
||
|
|
if (type !== 'embedding' && type !== 'transcription') return undefined
|
||
|
|
|
||
|
|
const { envKey, name, avatar } = systemAgentSettings[type]
|
||
|
|
const value = process.env[envKey]
|
||
|
|
if (value !== 'true' && value !== 'false') return undefined
|
||
|
|
|
||
|
|
return { name, avatar, enabled: value === 'true' }
|
||
|
|
}
|