Skip to content

Commit

Permalink
add states to sendMessageToHub
Browse files Browse the repository at this point in the history
  • Loading branch information
Oceania2018 committed Feb 6, 2024
1 parent a1e6fe8 commit f81144c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/lib/services/conversation-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,17 @@ export async function GetDialogs(conversationId) {
* @param {string} conversationId The conversation id
* @param {string} message The text message sent to CSR
* @param {string} truncateMsgId The message id to be deleted
* @param {string[]} states The states to be set
*/
export async function sendMessageToHub(agentId, conversationId, message, truncateMsgId = '') {
export async function sendMessageToHub(agentId, conversationId, message, truncateMsgId = '', states = []) {
let url = replaceUrl(endpoints.conversationMessageUrl, {
agentId: agentId,
conversationId: conversationId
});
const response = await axios.post(url, {
text: message,
truncateMessageId: truncateMsgId,
states: states
});
return response.data;
}
Expand Down
2 changes: 1 addition & 1 deletion src/routes/page/task/[taskId]/execution-flow.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
let steps = task.content.split('\n');
for (let i = 0; i < steps.length; i++) {
let step = steps[i];
await sendMessageToHub(task.direct_agent_id, conversation.id, step);
await sendMessageToHub(task.direct_agent_id, conversation.id, step, '', ['hide_context=true']);
renderMessageNode(step);
}
}
Expand Down

0 comments on commit f81144c

Please sign in to comment.