Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
davehorton committed Dec 12, 2024
1 parent b96330b commit 42b19d0
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/tasks/llm/llms/voice_agent_s2s.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,15 @@ class TaskLlmVoiceAgent_S2S extends Task {
*/
async processToolOutput(ep, tool_call_id, data) {
try {
this.logger.debug({tool_call_id, data}, 'TaskLlmVoiceAgent_S2S:processToolOutput');
const {data:response} = data;
this.logger.debug({tool_call_id, response}, 'TaskLlmVoiceAgent_S2S:processToolOutput');

if (!data.type || data.type !== 'FunctionCallResponse') {
this.logger.info({data},
if (!response.type || response.type !== 'FunctionCallResponse') {
this.logger.info({response},
'TaskLlmVoiceAgent_S2S:processToolOutput - invalid tool output, must be FunctionCallResponse');
}
else {
await this._api(ep, [ep.uuid, ClientEvent, JSON.stringify(data)]);
await this._api(ep, [ep.uuid, ClientEvent, JSON.stringify(response)]);
}
} catch (err) {
this.logger.info({err}, 'TaskLlmVoiceAgent_S2S:processToolOutput');
Expand Down

0 comments on commit 42b19d0

Please sign in to comment.