Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 45 additions & 3 deletions client/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,51 @@ class DemoApp {
text: `Hello, what can i do for you?`
}
]);
this.client.updateSession({ instructions: OPENAI_INSTRUCTIONS });
this.client.updateSession({ input_audio_transcription: { model: 'whisper-1' } });
await this.client.updateSession({
instructions: OPENAI_INSTRUCTIONS,
input_audio_transcription: { model: 'whisper-1' },
voice: 'shimmer'
});

// Voice control tools
this.client.addTool({
'name': 'change_voice',
'description': 'Changes the AI voice to a different option',
'parameters': {
'type': 'object',
'properties': {
'voice': {
'type': 'string',
'enum': ['alloy', 'echo', 'fable', 'onyx', 'nova', 'shimmer'],
'description': 'The voice to switch to'
}
},
'required': ['voice']
}
}, async ({ voice }) => {
await this.client.updateSession({ voice });
return {
success: true,
message: `Voice changed to ${voice}`,
current_voice: voice
};
});

this.client.addTool({
'name': 'get_current_voice',
'description': 'Returns the currently active voice',
'parameters': {
'type': 'object',
'properties': {}
}
}, async () => {
const session = await this.client.getSession();
return {
current_voice: session.voice || 'default'
};
});

// Camera reference tool
this.client.addTool({
'name': 'detect_reference_question',
'description': 'Returns the answers to context-dependent questions that refer to previously mentioned or visually present subjects (e.g., \'What is this?\', \'How do I solve this?\')',
Expand Down Expand Up @@ -151,7 +194,6 @@ class DemoApp {
};
}
});

}

async startRecording() {
Expand Down
280 changes: 278 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,8 @@
"devDependencies": {
"nodemon": "^3.1.7",
"parcel": "^2.12.0"
},
"optionalDependencies": {
"@parcel/watcher-linux-x64-glibc": "^2.5.1"
}
}