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

Fix stream ChatMessage for ChatInterface and mention serialize #6452

Merged
merged 3 commits into from
Mar 7, 2024

Conversation

ahuang11
Copy link
Contributor

@ahuang11 ahuang11 commented Mar 6, 2024

Allows doing this:

    def test_stream_chat_message(self, chat_interface):
        chat_interface.stream(ChatMessage("testeroo", user="useroo", avatar="avataroo"))
        chat_message = chat_interface.objects[0]
        assert chat_message.user == "useroo"
        assert chat_message.avatar == "avataroo"
        assert chat_message.object == "testeroo"

Previously, since it defaulted to self.user it would raise an error.

Also, fixes the typing of the stream; ChatMessage was already supported, just not documented properly.

Lastly, sneaks in a docs mention of the serialize + custom_serializer method in Feed

@ahuang11 ahuang11 requested a review from philippjfr March 6, 2024 21:35
@ahuang11 ahuang11 changed the title Fix stream chat message Fix stream ChatMessage for ChatInterface Mar 6, 2024
@ahuang11 ahuang11 changed the title Fix stream ChatMessage for ChatInterface Fix stream ChatMessage for ChatInterface and mention serialize Mar 6, 2024
Copy link

codecov bot commented Mar 6, 2024

Codecov Report

Attention: Patch coverage is 90.90909% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 71.59%. Comparing base (67377d7) to head (ec073a6).

Files Patch % Lines
panel/chat/interface.py 50.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6452      +/-   ##
==========================================
+ Coverage   71.58%   71.59%   +0.01%     
==========================================
  Files         310      310              
  Lines       45955    45975      +20     
==========================================
+ Hits        32896    32916      +20     
  Misses      13059    13059              
Flag Coverage Δ
unitexamples-tests 71.59% <90.90%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@philippjfr philippjfr merged commit e43706f into main Mar 7, 2024
12 of 15 checks passed
@philippjfr philippjfr deleted the fix_stream_chat_message branch March 7, 2024 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants