Feat/llm verb (#931)

* wip

* working version for openai realtime beta

* lint

* tests: update db to latest 0.9.2 schema
This commit is contained in:
Dave Horton
2024-10-12 19:26:27 -04:00
committed by GitHub
parent f84b3793e1
commit f09722a5b5
9 changed files with 459 additions and 29 deletions

View File

@@ -1589,6 +1589,17 @@ Duration=${duration} `
this.logger.info({response}, '_lccBoostAudioSignal: response from freeswitch');
}
_lccToolOutput(tool_call_id, opts, callSid) {
// this whole thing requires us to be in a Dial verb
const task = this.currentTask;
if (!task || !task.name.startsWith('Llm')) {
return this.logger.info('CallSession:_lccToolOutput - invalid command since we are not in an llm');
}
task.processToolOutput(tool_call_id, opts)
.catch((err) => this.logger.error(err, 'CallSession:_lccToolOutput'));
}
/**
* perform call hangup by jambonz
@@ -1845,7 +1856,7 @@ Duration=${duration} `
this._jambonzHangup();
}
async _onCommand({msgid, command, call_sid, queueCommand, data}) {
async _onCommand({msgid, command, call_sid, queueCommand, tool_call_id, data}) {
this.logger.info({msgid, command, queueCommand, data}, 'CallSession:_onCommand - received command');
let resolution;
switch (command) {
@@ -1946,6 +1957,10 @@ Duration=${duration} `
});
break;
case 'llm:tool-output':
this._lccToolOutput(tool_call_id, data, call_sid);
break;
default:
this.logger.info(`CallSession:_onCommand - invalid command ${command}`);
}