fix: T2 live — camelCase setup frame + logs enrichis — 124/124 tests
This commit is contained in:
parent
16617b5c54
commit
7479ac5a05
4 changed files with 14 additions and 7 deletions
|
|
@ -7,7 +7,8 @@
|
|||
"Bash(git add:*)",
|
||||
"Bash(git commit -m ':*)",
|
||||
"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
1
.gitignore
vendored
|
|
@ -2,3 +2,4 @@ node_modules
|
|||
dist
|
||||
.env
|
||||
.env.local
|
||||
.claude/
|
||||
|
|
|
|||
|
|
@ -51,8 +51,8 @@ describe('openGeminiLiveSession', () => {
|
|||
expect(gemini.sent).toHaveLength(1)
|
||||
const setup = JSON.parse(gemini.sent[0] as string)
|
||||
expect(setup.setup.model).toMatch(/gemini/)
|
||||
expect(setup.setup.system_instruction.parts[0].text).toBe(T2_SYSTEM_PROMPT)
|
||||
expect(setup.setup.generation_config.response_modalities).toContain('AUDIO')
|
||||
expect(setup.setup.systemInstruction.parts[0].text).toBe(T2_SYSTEM_PROMPT)
|
||||
expect(setup.setup.generationConfig.responseModalities).toContain('AUDIO')
|
||||
})
|
||||
|
||||
it('forwarde un message client (Buffer audio) vers Gemini', () => {
|
||||
|
|
|
|||
|
|
@ -54,11 +54,11 @@ function buildSetupFrame(): string {
|
|||
return JSON.stringify({
|
||||
setup: {
|
||||
model: GEMINI_LIVE_MODEL,
|
||||
system_instruction: {
|
||||
systemInstruction: {
|
||||
parts: [{ text: T2_SYSTEM_PROMPT }],
|
||||
},
|
||||
generation_config: {
|
||||
response_modalities: ['AUDIO'],
|
||||
generationConfig: {
|
||||
responseModalities: ['AUDIO'],
|
||||
},
|
||||
},
|
||||
})
|
||||
|
|
@ -119,7 +119,12 @@ export function openGeminiLiveSession(
|
|||
})
|
||||
|
||||
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 {
|
||||
clientWs.send(data)
|
||||
} catch {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue