-
Notifications
You must be signed in to change notification settings - Fork 692
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
Chat: feature to cancel active runs #1404
Conversation
Thanks for this, I've tested and found a few little issues but once you fix those up (and re-test yourself) then I'll re-test and get this merged in |
84943ce
to
c1bf4d2
Compare
c1bf4d2
to
6dcd566
Compare
HI! @rmackay9 take a look, I have updated the fixes as told, I tested it, You please take a test too, if there is any edge cases missing or changes needed. |
|
||
if (self.latest_run.status == "cancelled"): | ||
return "cancelled successfully" | ||
elif reply_messages is None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a blocker but the "elif" could be just an "if" because of the return one line higher
Sure @rmackay9 thanks for the review, next time onwards I will surely add testing cases, reports from my side for a better review and tests. Sometimes it does not cancel, maybe the reason is code latency, for some prompts(mostly in which function calling is not used) responses are generated by OpenAI very fast, while status being "in progress" when the code reaches cancel part it is already completed. |
if (run_status != "completed" and run_status != "cancelled" and | ||
run_status != "cancelling"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (run_status != "completed" and run_status != "cancelled" and | |
run_status != "cancelling"): | |
if run_status not in ["completed", "cancelled", "cancelling"]: |
Merged, thanks! |
This PR adds a cancel feature to cancel the active run on Open AI, i.e. it helps cancelling the active prompt given by user.