Page 1 of 1

OpenAI / ChatGPT ViCiDial Intergration

PostPosted: Wed Mar 15, 2023 5:24 pm
by martinch
Good evening guys,

Inspired by bbakirtas in http://vicidial.org/VICIDIALforum/viewtopic.php?f=3&t=41572#p150666, I decided to try and integrate OpenAI's ChatGPT into ViCiDial. This version uses cURL rather than any third-party library to achieve it's ends. I've written the code by myself but have co-credited bbakirtas as he inspired me to do this :)

I've propose two new system settings;

Image

Here is a question I asked ChatGPT...it was SO WRONG...Vincent Silvidi? Is there any truth to this Matt? lol the tiny window is draggable as to not obstruct parts of the dialler.

Image

Feature submitted on Mantis http://www.vicidial.org/VICIDIALmantis/view.php?id=1455

Code: Select all
=============================================
OpenAI / ChatGPT Integration for ViCiDial.
=============================================

Ticket Type: Add Feature.
Reporter: Martin McCarthy (martinch).
Impacted Users: ViCiDial agents.
Priority: Low.
Product(s) Affected: ViCiDial.
Deadline: No firm deadline in place.
Time / Effort Estimate: 4 hours of development / 1 hour of QA testing.

=============================================
Description
=============================================

It would be nice to provide ViCi agents with the chance to interface with ChatGPT during calls...perhaps to pull out a fact from thin or or get information very very quickly. Inspired by bbakirtas's idea, I have implemented an initial version of OpenAI's ChatGPT into ViCiDial.

Tasks;

- Create two new system settings options;
    - OpenAI Enabled (ENUM - Y - N)
    - OpenAI API Key (VARCHAR)
- Create a new div to contain the question input and answer output.
- Make the div draggable as to not obscure the agent's view of dialler controls.
- Create a button on the ViCiDial sidebar to show and hide the div.
- Create a PHP page to process requests to OpenAI (via cURL).

If you have any queries, please reach out to me.

=============================================
End
=============================================

Re: OpenAI / ChatGPT ViCiDial Intergration

PostPosted: Thu Mar 16, 2023 7:32 am
by mflorell
LOL, another WAAAY off response from ChatGTP. I've noticed that the more widely know topics(global politics, current events, etc...) it seems to get pretty much right, but the more niche a topic is(VICIdial history, etc...) the more it gets wrong, even if there is published information available on the web about it.

Re: OpenAI / ChatGPT ViCiDial Intergration

PostPosted: Tue Jul 18, 2023 1:17 pm
by martinch
Hey, just an update from me on this one...I introduced this feature into my fork, mDial, if you're interested in using it in your setup. I made a couple of changes to the code though and the feature doesn't support chat history currently but support can easily be added. You can find the code in the link in my sig. Cheers. :)

Image