Skip to content
Open
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
12 changes: 11 additions & 1 deletion websocket-server/src/sessionManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ function tryConnectModel() {

session.modelConn.on("open", () => {
const config = session.saved_config || {};

// Include supervisor agent function for voice channel
const allFunctions = getAllFunctions();
const functionSchemas = allFunctions.map((f: FunctionHandler) => f.schema);
Expand All @@ -493,6 +493,16 @@ function tryConnectModel() {
...config,
},
});

// Send a friendly greeting when a Twilio caller connects
if (session.twilioConn) {
jsonSend(session.modelConn, {
type: "response.create",
response: {
instructions: "Greet the caller briefly before awaiting input."
}
});
}
});

session.modelConn.on("message", (data: RawData) => handleModelMessage(data, global.logsClients ?? new Set(), global.chatClients ?? new Set()));
Expand Down