mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-05 13:37:55 +00:00
ref: https://github.com/chatwoot/chatwoot/issues/6436 fixes: https://linear.app/chatwoot/issue/CW-1552/ability-to-rephrase-text-in-the-editor-using-gpt-integration --------- Co-authored-by: Sojan <sojan@pepalo.com> Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
24 lines
455 B
JavaScript
24 lines
455 B
JavaScript
/* global axios */
|
|
|
|
import ApiClient from '../ApiClient';
|
|
|
|
class OpenAIAPI extends ApiClient {
|
|
constructor() {
|
|
super('integrations', { accountScoped: true });
|
|
}
|
|
|
|
processEvent({ name = 'rephrase', content, tone, hookId }) {
|
|
return axios.post(`${this.url}/hooks/${hookId}/process_event`, {
|
|
event: {
|
|
name: name,
|
|
data: {
|
|
tone,
|
|
content,
|
|
},
|
|
},
|
|
});
|
|
}
|
|
}
|
|
|
|
export default new OpenAIAPI();
|