mirror of
https://github.com/GoodStartLabs/AI_Diplomacy.git
synced 2026-04-30 17:40:47 +00:00
Another pass at basic moments
Adding diary, name of powers, name of moment type, and some supporting thoughts. Added a debug menu item to disable or enable the eleven labs speech. Useful for removing it when debugging
This commit is contained in:
parent
e1309c4012
commit
ecf8e1db06
7 changed files with 227 additions and 23 deletions
|
|
@ -67,6 +67,11 @@ async function testElevenLabsKey() {
|
|||
* @returns Promise that resolves when audio completes or rejects on error
|
||||
*/
|
||||
export async function speakSummary(summaryText: string): Promise<void> {
|
||||
if (!config.speechEnabled) {
|
||||
console.log("Speech disabled via config, skipping TTS");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!summaryText || summaryText.trim() === '') {
|
||||
console.warn("No summary text provided to speakSummary function");
|
||||
return;
|
||||
|
|
@ -98,12 +103,11 @@ export async function speakSummary(summaryText: string): Promise<void> {
|
|||
|
||||
try {
|
||||
// Truncate text to first 100 characters for ElevenLabs
|
||||
// FIXME: Is this meant to be truncated? Presumably not
|
||||
//const textForSpeaking = textToSpeak.substring(0, 100);
|
||||
let textForSpeaking;
|
||||
if (config.isDebugMode) {
|
||||
const textForSpeaking = textToSpeak.substring(0, 100);
|
||||
textForSpeaking = textToSpeak.substring(0, 100);
|
||||
} else {
|
||||
const textForSpeaking = textToSpeak
|
||||
textForSpeaking = textToSpeak
|
||||
}
|
||||
// Hit ElevenLabs TTS endpoint with the truncated text
|
||||
const headers = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue