fix: T2 live — camelCase setup frame + logs enrichis — 124/124 tests

This commit is contained in:
Hermann_Kitio 2026-04-17 04:44:54 +03:00
parent 16617b5c54
commit 7479ac5a05
4 changed files with 14 additions and 7 deletions

View file

@ -7,7 +7,8 @@
"Bash(git add:*)", "Bash(git add:*)",
"Bash(git commit -m ':*)", "Bash(git commit -m ':*)",
"Bash(git push:*)", "Bash(git push:*)",
"Bash(git commit:*)" "Bash(git commit:*)",
"Bash(node -e \"console.log\\(Buffer.from\\('49 6e 76 61 6c 69 64 20 4a 53 4f 4e 20 70 61 79 6c 6f 61 64 20 72 65 63 65 69 76 65 64 2e 20 55 6e 65 78 70 65 63 74 65 64 20 74 6f 6b 65 6e 2e 0a 77'.replace\\(/ /g, ''\\), 'hex'\\).toString\\(\\)\\)\")"
] ]
} }
} }

1
.gitignore vendored
View file

@ -2,3 +2,4 @@ node_modules
dist dist
.env .env
.env.local .env.local
.claude/

View file

@ -51,8 +51,8 @@ describe('openGeminiLiveSession', () => {
expect(gemini.sent).toHaveLength(1) expect(gemini.sent).toHaveLength(1)
const setup = JSON.parse(gemini.sent[0] as string) const setup = JSON.parse(gemini.sent[0] as string)
expect(setup.setup.model).toMatch(/gemini/) expect(setup.setup.model).toMatch(/gemini/)
expect(setup.setup.system_instruction.parts[0].text).toBe(T2_SYSTEM_PROMPT) expect(setup.setup.systemInstruction.parts[0].text).toBe(T2_SYSTEM_PROMPT)
expect(setup.setup.generation_config.response_modalities).toContain('AUDIO') expect(setup.setup.generationConfig.responseModalities).toContain('AUDIO')
}) })
it('forwarde un message client (Buffer audio) vers Gemini', () => { it('forwarde un message client (Buffer audio) vers Gemini', () => {

View file

@ -54,11 +54,11 @@ function buildSetupFrame(): string {
return JSON.stringify({ return JSON.stringify({
setup: { setup: {
model: GEMINI_LIVE_MODEL, model: GEMINI_LIVE_MODEL,
system_instruction: { systemInstruction: {
parts: [{ text: T2_SYSTEM_PROMPT }], parts: [{ text: T2_SYSTEM_PROMPT }],
}, },
generation_config: { generationConfig: {
response_modalities: ['AUDIO'], responseModalities: ['AUDIO'],
}, },
}, },
}) })
@ -119,7 +119,12 @@ export function openGeminiLiveSession(
}) })
geminiWs.on('message', (data) => { geminiWs.on('message', (data) => {
console.log('[T2] Gemini message received, type:', typeof data) console.log(
'[T2] Gemini message received, type:',
typeof data,
'content:',
(data as { toString?: () => string })?.toString?.().slice(0, 500)
)
try { try {
clientWs.send(data) clientWs.send(data)
} catch { } catch {