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

feature request: Sleep or kill phrase #54

Open
wiredzax opened this issue Jun 29, 2023 · 13 comments
Open

feature request: Sleep or kill phrase #54

wiredzax opened this issue Jun 29, 2023 · 13 comments
Milestone

Comments

@wiredzax
Copy link

Some kind of set phrase like the wake phrases that stop the bot. I don't know for sure if the stopping_strings is that setting or if there is something i'm missing.

@jmoney7823956789378
Copy link

+1 here, sometimes my bot goes on a schizophrenic rampage and it would be great to have a /stop that would function similarly to the one in the webui.

@chrisrude
Copy link
Owner

Thanks for the suggestion!

In terms of automatic stopping, you can use either stop_markers (under discord) or stopping_strings (under oobabooga > request_params). They both do basically the same thing, as anything you add to stopping_strings will be propagated to stop_markers internally.

For /stop, are you looking for what's in the web ui -- to stop a bot's immediate response generation... or are you looking to "time out" the bot and not have it respond automatically for some period?

I've been thinking of a /timeout command might be useful, which would tell the bot to just not respond for a period of time.

@chrisrude chrisrude added this to the 0.2 milestone Jun 30, 2023
@jmoney7823956789378
Copy link

Thanks for the suggestion!

In terms of automatic stopping, you can use either stop_markers (under discord) or stopping_strings (under oobabooga > request_params). They both do basically the same thing, as anything you add to stopping_strings will be propagated to stop_markers internally.

For /stop, are you looking for what's in the web ui -- to stop a bot's immediate response generation... or are you looking to "time out" the bot and not have it respond automatically for some period?

I've been thinking of a /timeout command might be useful, which would tell the bot to just not respond for a period of time.

My intended use is something along the lines of:

(Bot is typing a huge 500 token response filled with nothing meaningful)
(I type /stop)
(oobabot calls /api/v1/stop-stream on oobabooga server)
https://github.com/oobabooga/text-generation-webui/blob/main/extensions/api/blocking_api.py#L97
(Bot stops ALL generation)

@jmoney7823956789378
Copy link

Adding to that, a few lines down there is also a _continue function in the same file:
https://github.com/oobabooga/text-generation-webui/blob/3c076c3c8096fa83440d701ba4d7d49606aaf61f/extensions/api/blocking_api.py#L77C1-L77C1

@wiredzax
Copy link
Author

wiredzax commented Jul 1, 2023

I think it would be better as a set able word like the wake words just in reverse.
I run a stable diffusion bot on top of the text gen bot, so i can only use one set of / commands at a time. i can either have the /lobotomize or my /draw command with ever more options that what are present in oobabot.

@jmoney7823956789378
Copy link

jmoney7823956789378 commented Jul 6, 2023

@chrisrude I've very roughly implemented my own /stop command into bot_commands.py and ooba_client.py (with my limited knowledge) and I'm wondering how far into it you are. I can make a PR now, but my current implementation is simply a hardcoded URL to my oobabooga server, so it wouldn't work out of the box.
I'm sure I could bash the keyboard and eventually I'll have it pulling the host from the config.yml like it should, but I just thought I'd ask.
Current issues with my implementation are:

  • Discord reports "The application did not respond"
  • oobabooga BLOCKING API has to be manually inserted into ooba_client.py
  • probably many more

@chrisrude
Copy link
Owner

Feel free to have a stab at it if you like! I was rushing to get other features out so haven't started on this yet. Or if you want you could also just send over a work in progress PR and then I can polish off things you're unsure about.

Thanks for your help!

@jmoney7823956789378
Copy link

Feel free to have a stab at it if you like! I was rushing to get other features out so haven't started on this yet. Or if you want you could also just send over a work in progress PR and then I can polish off things you're unsure about.

Thanks for your help!

I sure gave it a stab!
#62
feel free to berate me for my code's mediocrity.

@chrisrude chrisrude modified the milestones: 0.2.1, 0.2.2 Jul 17, 2023
@chrisrude
Copy link
Owner

Still interested in this feature, and it's one of the priorities to be implemented sooner rather than later. My time has been split between a few projects recently, though, so it may still be a few weeks before I'm able to get it more packaged.

@jmoney7823956789378 if you're comfortable with a larger change, the main work that needs to be done from the PR above is:

  • add a configuration setting for the synchronous API port, defaulting to 5000, in the oobabooga section of the config.yml.
  • testing the change to make sure things don't break

In particular, I'm curious about testing the case where there are multiple replies in the queue and /stop is invoked. I would hope it would simply cancel the in-progress request without affecting the others, but it's also possible that something would break there.

You'd be totally welcome to step in more if you're interested, if not I'll work on getting to it in the next few updates. Those may be somewhat delayed to to commitments I have on other projects.

Thanks again for all your help so far!

@jmoney7823956789378
Copy link

  • add a configuration setting for the synchronous API port, defaulting to 5000, in the oobabooga section of the config.yml.
  • testing the change to make sure things don't break

In all honesty I'm totally clueless about how the settings are pulled from config.yml, and I also have some important stuff coming up that might keep me off the project for a few weeks.

In particular, I'm curious about testing the case where there are multiple replies in the queue and /stop is invoked. I would hope it would simply cancel the in-progress request without affecting the others, but it's also possible that something would break there.

So far I believe it stops only the current message in queue, so maybe it should be renamed to /cancel :)

@chrisrude
Copy link
Owner

No worries! I appreciate having non-github priorities as well. :)

Thanks again for all your help so far, and don't worry I'll get this in at some point. :)

@dakky221
Copy link

So... did you get to this, is now /timeout a reality or still not? People in my server are complaining it's talking too much and responding to everyone once it starts, timeout command is necessary to make it stop talking unless addressed (tagged) again.

@jmoney7823956789378
Copy link

So... did you get to this, is now /timeout a reality or still not? People in my server are complaining it's talking too much and responding to everyone once it starts, timeout command is necessary to make it stop talking unless addressed (tagged) again.

You might be better off disabling unsolicited replies.

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

No branches or pull requests

4 participants