feat: Reply Editor AI Changes

This commit is contained in:
iamsivin
2025-12-09 15:54:31 +05:30
parent 863c033699
commit 119ac7812c
22 changed files with 1242 additions and 160 deletions
@@ -46,9 +46,13 @@ class OpenAIAPI extends ApiClient {
* @param {string} [options.tone] - The tone of the event.
* @param {string} [options.conversationId] - The ID of the conversation to process the event for.
* @param {string} options.hookId - The ID of the hook to use for processing the event.
* @param {AbortSignal} [signal] - AbortSignal to cancel the request.
* @returns {Promise} A promise that resolves with the result of the event processing.
*/
processEvent({ type = 'rephrase', content, tone, conversationId, hookId }) {
processEvent(
{ type = 'rephrase', content, tone, conversationId, hookId },
signal
) {
/**
* @type {ConversationMessageData}
*/
@@ -69,12 +73,16 @@ class OpenAIAPI extends ApiClient {
};
}
return axios.post(`${this.url}/hooks/${hookId}/process_event`, {
event: {
name: type,
data,
return axios.post(
`${this.url}/hooks/${hookId}/process_event`,
{
event: {
name: type,
data,
},
},
});
{ signal }
);
}
}