Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access to the chat stream at stream start #252

Open
FranzHell opened this issue Aug 26, 2024 · 2 comments
Open

Access to the chat stream at stream start #252

FranzHell opened this issue Aug 26, 2024 · 2 comments
Assignees
Labels
advice Information how to use/implement the component

Comments

@FranzHell
Copy link

I am currently using https://deepchat.dev/docs/events/#onMessage to access the message that is received by deep-chat. However I can only access it after the stream has ended for that message. Optimally I would like to access the streaming object and use it, because I want to trigger something after the first few incoming words.

I have set stream: true and am successfully rendering the streaming input from my python backend which returns

    return Response(stream_with_context(stream_response(handler)), mimetype="text/event-stream")

Is there a way to do so? Thanks very much for your feedback!

@OvidijusParsiunas
Copy link
Owner

Hi @FranzHell. Apologies for the late reply as I have just moved to another country.

If you want to monitor events/segments from a stream, I would recommend using the responseInterceptor property. Let me know if this helps.

Thanks!

@OvidijusParsiunas OvidijusParsiunas self-assigned this Aug 30, 2024
@OvidijusParsiunas OvidijusParsiunas added the advice Information how to use/implement the component label Aug 30, 2024
@FranzHell
Copy link
Author

works well, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
advice Information how to use/implement the component
Projects
None yet
Development

No branches or pull requests

2 participants