OvidijusParsiunas / deep-chat

Fully customizable AI chatbot component for your website
https://deepchat.dev
MIT License
1.27k stars 176 forks source link

Integrating OpenAI functionality announced on 6/11/2023 #27

Closed devpulse01 closed 7 months ago

devpulse01 commented 8 months ago

Hi Ovidijus,

Thank you for creating deep-chat. It's an amazing project!

I'm curious about integrating function calling feature using OpenAI's API (https://platform.openai.com/docs/guides/gpt/function-calling)

Is this feasible within deep-chat? Thank you! Best

OvidijusParsiunas commented 8 months ago

Hi @devpulse01, this does seem like something that Deep Chat can use. I have personally not used functions before, so I will need to do some exploration to see what needs to be changed in Deep Chat to facilitate this.

I am currently in the process of working on another feature (disabling the submit button) and will be able to pick this up directly after it. For the moment I will close this issue and will re-open it when I start working on it. Thanks!

devpulse01 commented 8 months ago

Perfect. Thank you :)

OvidijusParsiunas commented 8 months ago

Hi, as promised I will now be focusing on exploring the OpenAI function API and seeing how I can integrate it into Deep Chat. I will post updates here on the progress.

OvidijusParsiunas commented 7 months ago

The timing of this issue is fortunate/unfortunate as today OpenAI announced a change to the function API via the use of tools. This change came in just as I was about to finish the function API so I had to refactor it all to the new version.

OpenAI has announced a few other new features which I will be integrating to the Deep Chat component in the coming few days, once all of that is finished I will be releasing it all together. Thanks!

devpulse01 commented 7 months ago

Thanks for the update! With all the exciting changes, I was also wondering if you'll be integrating the new assistants API.

OvidijusParsiunas commented 7 months ago

There are a lot of new interesting features that were announced and I will try to tackle them one by one (incl. assistants API).

To note, it appears that some features that were announced are not working or are not fully rolled out (going by what I read in the forums), so this limitation may hinder my integration efforts.

Nonetheless, I will be continuously updating this thread on the latest developments.

OvidijusParsiunas commented 7 months ago

I have revamped the OpenAI Audio API to now use two new speechToText and textToSpeech properties which will allow the use of all the latest OpenAI Audio features.

Stay tuned for other features.

OvidijusParsiunas commented 7 months ago

The OpenAI chat now supports sending images with the Vision API when using the gpt-4-vision-preview model.

OvidijusParsiunas commented 7 months ago

Integrating Assistants API is a little more tricky. I have started adding the initial code and will continue this feature tomorrow.

devpulse01 commented 7 months ago

Thank you for the update :)

OvidijusParsiunas commented 7 months ago

I have most of the Assistants functionality now complete. The last bit that remains is the ability to upload files. The reason why I couldn't complete it today is because the API seems to be retuning errors most of the time for unrelated reasons. Hopefully this gets better tomorrow and I should get this all done.

OvidijusParsiunas commented 7 months ago

All integration work is now complete. I am going to start updating the documentation and the playground.

OvidijusParsiunas commented 7 months ago

The latest OpenAI features have been released in version 1.4.1!!!!! :tada: :tada: :tada: :tada: You can check them out in the new OpenAI documentation page or try them out in the Playground.

I will be closing this issue now, however if you experience any problems or have suggestions for improvements (in the component and documentation) feel free to comment below or raise a new issue. Thanks!

devpulse01 commented 7 months ago

Hey Ovidijus,

Thank you for the update! 🎉 This is amazing :) I'm excited to explore the new features. However I'm planning to use the new APIs through a backend rather than a direct connection.

Do you plan to update the server examples to incorporate these new features? I've attempted to integrate them on my end but have faced some challenges.

OvidijusParsiunas commented 7 months ago

Hi @devpulse01. Because this project is focused on the component itself which uses multiple different AI APIs, we are not planning to maintain server-side specific integration code and will try to keep the server examples as lightweight as possible.

The OpenAI documentation has examples on how to get started with their features which should hopefully help. Also, because I've implemented these features directly into Deep Chat myself, I can perhaps lend a hand if you let me know what the specific problem you are having is.

devpulse01 commented 7 months ago

Yes, ok I completely understand. If I have really specific questions, I'll come back to you :) Thank you.