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

Cancelling pending chat messages of user on submission of a new message #2141

Merged
merged 2 commits into from Mar 21, 2023

Conversation

yk
Copy link
Collaborator

@yk yk commented Mar 20, 2023

No description provided.

@yk yk requested a review from andreaskoepf as a code owner March 20, 2023 16:24
@yk yk added the inference label Mar 20, 2023
@@ -30,6 +31,9 @@ async def start_work(
logger.debug(f"Starting work on message {message_id}")
message = await self.get_assistant_message_by_id(message_id)

if message.state == inference.MessageState.cancelled:
raise chat_schema.MessageCancelled(message_id=message_id)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

name of exception classes in python usually have Error/Exception suffix

@yk yk enabled auto-merge (squash) March 21, 2023 10:53
@yk yk merged commit 410036d into main Mar 21, 2023
3 checks passed
@yk yk deleted the cancel-pending-messages-on-new-message branch March 21, 2023 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants