OvidijusParsiunas / deep-chat

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

Issue with OpenAI Assistants and simulation & updating OpenAIImages interface. #137

Open devpulse01 opened 4 months ago

devpulse01 commented 4 months ago

Hey Ovidijus, I'm using the OpenAI Assistants API with this stream parameter:

{simulation: 20}

As the message appears immediately, whether or not the stream parameter is set, I'm not sure if the parameter is being taken into account.


Regarding OpenAI Images, is it possible to update the OpenAIImages interface to add specific DALL-E 3 parameters?

Currently, there is:

export interface OpenAIImages {
    model?: string;
    n?: number;
    size?: '256x256' | '512x512' | '1024x1024';
    response_format?: 'url' | 'b64_json';
    user?: string;
  }

But when using it with DALL-E 3:

Reference: https://platform.openai.com/docs/api-reference/images/create

Thank you! Best

OvidijusParsiunas commented 4 months ago

Hi @devpulse01.

The simulation property not working for assistants was a bug. I have fixed this and have also updated the images interface for dall-e-3.

These changes have been deployed to deep-chat-dev and deep-chat-react-dev packages version 9.0.141.

The dev packages behave the same way as the original ones - except their names are different. The next release for Deep Chat is going to be a big one as we are migrating a lot of its logic to another web component called active chat and with that we are changing quite a few property names, such as changing the request property to connect and moving stream to the connect object. The old properties will still keep working as usual except you will see warnings in the console for their deprecation. Most importantly, because this is going to be a very big release - it is likely that it will take place some time next month, so the new code is going to remain in the dev packages until this will happen.

Let me know if you have any questions. Thankyou!

devpulse01 commented 4 months ago

Hi,

Thank you for your prompt reply and the provided fix.

I installed the deep-chat-dev package but encountered errors with stream and request no longer exist on the deepChat element. Does this mean I have to migrate to the new structure (using connect) in order to receive the updates?

Thank you!

OvidijusParsiunas commented 4 months ago

Hey @devpulse01, everything should work as expected using the old or the new properties. The warnings are just there to encourage developers to move onto the new properties as they will adhere the new documentation which will be updated along with the big release.

devpulse01 commented 4 months ago

Hey Ovidijus, That's weird, if I use the latest deep-chat-dev package ("^9.0.141")

I have these issues:

Thank you

OvidijusParsiunas commented 4 months ago

Yes, the types will break and you will have to use the new types as guided by TS and console warnings, however the functionality should still work as normal with the old code.

Note on the new onMessage event - the isInitial property that has been passed into it has now been renamed to isHistory. That will be one thing that will need to change if you were using the isInitial property before.

devpulse01 commented 4 months ago

Ok, I understand now. PS: the stream simulation with the assistants API works perfectly. Thanks a lot!