Reuse Athena router key for OpenClaw dictation
This commit is contained in:
@@ -57,3 +57,25 @@ test("dictation registers separately and sends G.711 audio to Athena Whisper", a
|
||||
await new Promise((resolve) => server.close(resolve));
|
||||
}
|
||||
});
|
||||
|
||||
test("dictation reuses only a TTS key for the same Athena origin", () => {
|
||||
let transcription;
|
||||
plugin.register({
|
||||
registerRealtimeTranscriptionProvider: (value) => { transcription = value; },
|
||||
registerRealtimeVoiceProvider: () => {},
|
||||
registerHttpRoute: () => {},
|
||||
});
|
||||
const base = {
|
||||
talk: { realtime: { providers: { "athena-talk": { modelProvider: "llama-cpp" } } } },
|
||||
models: { providers: { "llama-cpp": { baseUrl: "http://athena:8081/v1" } } },
|
||||
};
|
||||
const withTts = (baseUrl) => ({ ...base, tts: { providers: { openai: {
|
||||
baseUrl, apiKey: "shared-key",
|
||||
} } } });
|
||||
assert.equal(transcription.resolveConfig({
|
||||
cfg: withTts("http://athena:8081/v1"), rawConfig: {},
|
||||
}).apiKey, "shared-key");
|
||||
assert.equal(transcription.resolveConfig({
|
||||
cfg: withTts("http://other:8081/v1"), rawConfig: {},
|
||||
}).apiKey, "");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user