debug(geminiLive): minimal SDK config to isolate rejected field
This commit is contained in:
parent
91bb93a07f
commit
61be6b1959
2 changed files with 25 additions and 22 deletions
|
|
@ -125,23 +125,19 @@ describe("openGeminiLiveSession (SDK)", () => {
|
|||
capturedConnect = null;
|
||||
});
|
||||
|
||||
it("appelle live.connect avec le modèle + config Live (audio + system + transcripts + VAD)", async () => {
|
||||
it("appelle live.connect avec une config minimale (debug Sprint 6d — isolement champ rejeté)", async () => {
|
||||
const client = new FakeWs();
|
||||
const capture = await openWithMock(client);
|
||||
|
||||
expect(capture.model).toMatch(/gemini/);
|
||||
const config = capture.config;
|
||||
expect(config.responseModalities).toContain("AUDIO");
|
||||
expect(config.systemInstruction).toContain(
|
||||
"un bailleur qui propose un appartement",
|
||||
);
|
||||
expect(config.inputAudioTranscription).toEqual({});
|
||||
expect(config.outputAudioTranscription).toEqual({});
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const vad: any = (config.realtimeInputConfig as any)
|
||||
?.automaticActivityDetection;
|
||||
expect(vad?.disabled).toBe(false);
|
||||
expect(vad?.silenceDurationMs).toBe(2000);
|
||||
// ⚠ DEBUG : les autres champs sont temporairement commentés dans
|
||||
// geminiLive.ts pour isoler celui qui fait rejeter le setup par Gemini.
|
||||
expect(config.systemInstruction).toBeUndefined();
|
||||
expect(config.inputAudioTranscription).toBeUndefined();
|
||||
expect(config.outputAudioTranscription).toBeUndefined();
|
||||
expect(config.realtimeInputConfig).toBeUndefined();
|
||||
});
|
||||
|
||||
it("forwarde un chunk audio client {type:'audio'} via session.sendRealtimeInput (PCM 16k base64)", async () => {
|
||||
|
|
|
|||
|
|
@ -293,19 +293,26 @@ export function openGeminiLiveSession(
|
|||
};
|
||||
|
||||
// ── Ouverture de la session SDK ──────────────────────────────────────
|
||||
// ⚠ DEBUG : config minimale pour isoler le champ qui fait rejeter le setup
|
||||
// par Gemini. À restaurer une fois identifié.
|
||||
// Variables conservées en signature pour ne pas casser les imports / la
|
||||
// construction du prompt qui valide le sujet.
|
||||
void systemPrompt;
|
||||
void StartSensitivity;
|
||||
void EndSensitivity;
|
||||
const sdkConfig = {
|
||||
responseModalities: [Modality.AUDIO],
|
||||
systemInstruction: systemPrompt,
|
||||
inputAudioTranscription: {},
|
||||
outputAudioTranscription: {},
|
||||
realtimeInputConfig: {
|
||||
automaticActivityDetection: {
|
||||
disabled: false,
|
||||
startOfSpeechSensitivity: StartSensitivity.START_SENSITIVITY_LOW,
|
||||
endOfSpeechSensitivity: EndSensitivity.END_SENSITIVITY_LOW,
|
||||
silenceDurationMs: 2000,
|
||||
},
|
||||
},
|
||||
// systemInstruction: systemPrompt,
|
||||
// inputAudioTranscription: {},
|
||||
// outputAudioTranscription: {},
|
||||
// realtimeInputConfig: {
|
||||
// automaticActivityDetection: {
|
||||
// disabled: false,
|
||||
// startOfSpeechSensitivity: StartSensitivity.START_SENSITIVITY_LOW,
|
||||
// endOfSpeechSensitivity: EndSensitivity.END_SENSITIVITY_LOW,
|
||||
// silenceDurationMs: 2000,
|
||||
// },
|
||||
// },
|
||||
};
|
||||
|
||||
console.log("[T2] SDK config:", JSON.stringify(sdkConfig, null, 2));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue