-
Notifications
You must be signed in to change notification settings - Fork 364
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: better module registry * feat: add placeholder when no compatible tools * Update playground/src/components/Chat/ChatCfgModuleSelect.tsx Co-authored-by: czhen <[email protected]> * feat: change module type to enum * feat: update playground image --------- Co-authored-by: czhen <[email protected]>
- Loading branch information
Showing
4 changed files
with
288 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
export namespace ModuleRegistry { | ||
export enum ModuleType { | ||
STT = "stt", | ||
LLM = "llm", | ||
V2V = "v2v", | ||
TTS = "tts", | ||
TOOL = "tool", | ||
} | ||
|
||
export interface Module { | ||
name: string; | ||
type: ModuleType; | ||
label: string; | ||
} | ||
|
||
export type NonToolModuleType = Exclude<ModuleType, ModuleType.TOOL> | ||
export type NonToolModule = Module & { type: NonToolModuleType }; | ||
export type ToolModule = Module & { type: ModuleType.TOOL }; | ||
} | ||
|
||
|
||
// Custom labels for specific keys | ||
export const ModuleTypeLabels: Record<ModuleRegistry.NonToolModuleType, string> = { | ||
[ModuleRegistry.ModuleType.STT]: "STT (Speech to Text)", | ||
[ModuleRegistry.ModuleType.LLM]: "LLM (Large Language Model)", | ||
[ModuleRegistry.ModuleType.TTS]: "TTS (Text to Speech)", | ||
[ModuleRegistry.ModuleType.V2V]: "LLM v2v (V2V Large Language Model)", | ||
}; | ||
|
||
export const sttModuleRegistry: Record<string, ModuleRegistry.Module> = { | ||
deepgram_asr_python: { | ||
name: "deepgram_asr_python", | ||
type: ModuleRegistry.ModuleType.STT, | ||
label: "Deepgram STT", | ||
}, | ||
transcribe_asr_python: { | ||
name: "transcribe_asr_python", | ||
type: ModuleRegistry.ModuleType.STT, | ||
label: "Transcribe STT", | ||
} | ||
} | ||
|
||
export const llmModuleRegistry: Record<string, ModuleRegistry.Module> = { | ||
openai_chatgpt_python: { | ||
name: "openai_chatgpt_python", | ||
type: ModuleRegistry.ModuleType.LLM, | ||
label: "OpenAI ChatGPT", | ||
}, | ||
gemini_llm_python: { | ||
name: "gemini_llm_python", | ||
type: ModuleRegistry.ModuleType.LLM, | ||
label: "Gemini LLM", | ||
}, | ||
bedrock_llm_python: { | ||
name: "bedrock_llm_python", | ||
type: ModuleRegistry.ModuleType.LLM, | ||
label: "Bedrock LLM", | ||
}, | ||
} | ||
|
||
export const ttsModuleRegistry: Record<string, ModuleRegistry.Module> = { | ||
azure_tts: { | ||
name: "azure_tts", | ||
type: ModuleRegistry.ModuleType.TTS, | ||
label: "Azure TTS", | ||
}, | ||
cartesia_tts: { | ||
name: "cartesia_tts", | ||
type: ModuleRegistry.ModuleType.TTS, | ||
label: "Cartesia TTS", | ||
}, | ||
cosy_tts_python: { | ||
name: "cosy_tts_python", | ||
type: ModuleRegistry.ModuleType.TTS, | ||
label: "Cosy TTS", | ||
}, | ||
elevenlabs_tts_python: { | ||
name: "elevenlabs_tts_python", | ||
type: ModuleRegistry.ModuleType.TTS, | ||
label: "Elevenlabs TTS", | ||
}, | ||
fish_audio_tts: { | ||
name: "fish_audio_tts", | ||
type: ModuleRegistry.ModuleType.TTS, | ||
label: "Fish Audio TTS", | ||
}, | ||
minimax_tts_python: { | ||
name: "minimax_tts_python", | ||
type: ModuleRegistry.ModuleType.TTS, | ||
label: "Minimax TTS", | ||
}, | ||
polly_tts: { | ||
name: "polly_tts", | ||
type: ModuleRegistry.ModuleType.TTS, | ||
label: "Polly TTS", | ||
} | ||
} | ||
|
||
export const v2vModuleRegistry: Record<string, ModuleRegistry.Module> = { | ||
openai_v2v_python: { | ||
name: "openai_v2v_python", | ||
type: ModuleRegistry.ModuleType.V2V, | ||
label: "OpenAI Realtime", | ||
} | ||
} | ||
|
||
export const toolModuleRegistry: Record<string, ModuleRegistry.ToolModule> = { | ||
vision_analyze_tool_python: { | ||
name: "vision_analyze_tool_python", | ||
type: ModuleRegistry.ModuleType.TOOL, | ||
label: "Vision Analyze Tool", | ||
}, | ||
weatherapi_tool_python: { | ||
name: "weatherapi_tool_python", | ||
type: ModuleRegistry.ModuleType.TOOL, | ||
label: "WeatherAPI Tool", | ||
}, | ||
bingsearch_tool_python: { | ||
name: "bingsearch_tool_python", | ||
type: ModuleRegistry.ModuleType.TOOL, | ||
label: "BingSearch Tool", | ||
}, | ||
vision_tool_python: { | ||
name: "vision_tool_python", | ||
type: ModuleRegistry.ModuleType.TOOL, | ||
label: "Vision Tool", | ||
}, | ||
} | ||
|
||
export const moduleRegistry: Record<string, ModuleRegistry.Module> = { | ||
...sttModuleRegistry, | ||
...llmModuleRegistry, | ||
...ttsModuleRegistry, | ||
...v2vModuleRegistry | ||
} | ||
|
||
export const compatibleTools: Record<string, string[]> = { | ||
openai_chatgpt_python: ["vision_tool_python", "weatherapi_tool_python", "bingsearch_tool_python"], | ||
openai_v2v_python: ["weatherapi_tool_python", "bingsearch_tool_python"], | ||
} |
Oops, something went wrong.