Skip to content

Commit

Permalink
Update version to 0.2.3 in preparation for release.
Browse files Browse the repository at this point in the history
Update pyright version, fix new pyright warning in
fancy_logger.py.
  • Loading branch information
chrisrude committed Sep 1, 2023
1 parent 6780263 commit fa234d6
Show file tree
Hide file tree
Showing 8 changed files with 128 additions and 60 deletions.
50 changes: 26 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,15 @@ usage: oobabot [-h] [-c CONFIG] [--generate-config] [--invite-url] [--ai-name AI
[--stable-diffusion-url STABLE_DIFFUSION_URL]
[--extra-prompt-text EXTRA_PROMPT_TEXT]
oobabot v0.2.1: Discord bot for oobabooga's text-generation-webui
oobabot v0.2.2: Discord bot for oobabooga's text-generation-webui
General Settings:
-h, --help
-c CONFIG, --config CONFIG
Path to a config file to read settings from. Command line settings
will override settings in this file. (default: config.yml)
Path to a config file to read settings from. Command line
settings will override settings in this file. (default:
config.yml)
--generate-config If set, oobabot will print its configuration as a .yml file, then
exit. Any command-line settings also passed will be reflected in
this file. (default: False)
Expand All @@ -99,42 +100,43 @@ General Settings:
Persona:
--ai-name AI_NAME Name the AI will use to refer to itself (default: oobabot)
--persona PERSONA This prefix will be added in front of every user-supplied request.
This is useful for setting up a 'character' for the bot to play.
Alternatively, this can be set with the OOBABOT_PERSONA environment
variable. (default: )
--persona PERSONA This prefix will be added in front of every user-supplied
request. This is useful for setting up a 'character' for the bot
to play. Alternatively, this can be set with the OOBABOT_PERSONA
environment variable. (default: )
--wakewords [WAKEWORDS ...]
One or more words that the bot will listen for. The bot will listen
in all discord channels it can access for one of these words to be
mentioned, then reply to any messages it sees with a matching word.
The bot will always reply to @-mentions and direct messages, even
if no wakewords are supplied. (default: ['oobabot'])
One or more words that the bot will listen for. The bot will
listen in all discord channels it can access for one of these
words to be mentioned, then reply to any messages it sees with a
matching word. The bot will always reply to @-mentions and direct
messages, even if no wakewords are supplied. (default:
['oobabot'])
Discord:
--discord-token DISCORD_TOKEN
Token to log into Discord with. For security purposes it's strongly
recommended that you set this via the DISCORD_TOKEN environment
variable instead, if possible. (default: None)
Token to log into Discord with. For security purposes it's
strongly recommended that you set this via the DISCORD_TOKEN
environment variable instead, if possible. (default: )
--dont-split-responses
Post the entire response as a single message, rather than splitting
it into separate messages by sentence. (default: False)
Post the entire response as a single message, rather than
splitting it into separate messages by sentence. (default: False)
--history-lines HISTORY_LINES
Number of lines of chat history the AI will see when generating a
response. (default: 7)
--ignore-dms If set, the bot will not respond to direct messages. (default:
False)
--reply-in-thread If set, the bot will generate a thread to respond in if it is not
already in one. (default: False)
--stream-responses FEATURE PREVIEW: Stream responses into a single message as they are
generated. Note: may be janky (default: False)
--stream-responses FEATURE PREVIEW: Stream responses into a single message as they
are generated. Note: may be janky (default: False)
Oobabooga:
--base-url BASE_URL Base URL for the oobabooga instance. This should be
ws://hostname[:port] for plain websocket connections, or
wss://hostname[:port] for websocket connections over TLS. (default:
ws://localhost:5005)
wss://hostname[:port] for websocket connections over TLS.
(default: ws://localhost:5005)
--log-all-the-things Print all AI input and output to STDOUT. (default: False)
--message-regex MESSAGE_REGEX
A regex that will be used to extract message lines from the AI's
Expand All @@ -145,9 +147,9 @@ Oobabooga:
Stable Diffusion:
--image-words [IMAGE_WORDS ...]
When one of these words is used in a message, the bot will generate
an image. (default: ['draw me', 'drawing', 'photo', 'pic',
'picture', 'image', 'sketch'])
When one of these words is used in a message, the bot will
generate an image. (default: ['draw me', 'drawing', 'photo',
'pic', 'picture', 'image', 'sketch'])
--stable-diffusion-url STABLE_DIFFUSION_URL
URL for an AUTOMATIC1111 Stable Diffusion server. (default: )
--extra-prompt-text EXTRA_PROMPT_TEXT
Expand Down
5 changes: 5 additions & 0 deletions docs/RELEASE-0.2.2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

# Release v.0.2.2

Version 0.2.2 only involved an update to oobabot-plugin, not
oobabot. The next update for oobabot is [v0.2.3](RELEASE-0.2.3.md).
59 changes: 59 additions & 0 deletions docs/RELEASE-0.2.3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@

# Release v.0.2.3

Note: version 0.2.2 only updated oobabot-plugin, not oobabot. This
shows changes to oobabot since the prior release, [v0.2.1](RELEASE-0.2.1.md).

## What's Changed

Mainly a bugfix update for 0.2.1, with a few fixes and configuration
parameters.

## New Features

* Option to disable unsolicited replies entirely

Unsolicited replies are still enabled by default, but you can now disable them entirely by changing this setting in your config.yml:

```yaml
# If set, the bot will not reply to any messages that do not @-mention it or include a
# wakeword. If unsolicited replies are disabled, the unsolicited_channel_cap setting will
# have no effect.
# default: False
disable_unsolicited_replies: true
```
The objective of this change is to support cases where
unsolicited replies are not desired, such as when the bot is used in a
channel with a high volume of messages.
## Bug Fixes / Tech Improvements
* Unicode logging reliability fix ooba_client.py
Unicode bugs in oobabooga seem to be a moving target, so
this fix gates the fix applied in 0.2.1 to only be applied
in cases where oobabooga is known to be broken.
* Security fix: Bump aiohttp from 3.8.4 to 3.8.5
Update dependency aiohttp to v3.8.5. This fixes [a security
issue in aiohttp](https://github.com/aio-libs/aiohttp/blob/v3.8.5/CHANGES.rst). On a quick scan it doesn't seem to be something
a user could exploit within oobabot, but better to update anyway.
* Preserve newlines when prompting the bot
In some cases the whitespace in user messages is important. One case is
described in the [issue 76, reported by @xydreen](https://github.com/aio-libs/aiohttp/security/advisories/GHSA-45c4-8wx5-qw6w).
When sending a prompt to the bot, we will now preserve any newlines
that the bot itself had generated in the past.
We will still strip newlines from messages from user-generated messages,
as otherwise they would have the ability to imitate our prompt format.
This would let users so inclined to fool the bot into thinking a
message was sent by another user, or even itself.
### Full Changelog
[All changes from 0.2.1 to 0.2.3](https://github.com/chrisrude/oobabot/compare/v0.2.1...v0.2.3)
2 changes: 1 addition & 1 deletion docs/config.sample.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# "config.yml" from the current directory when it is run.
#

version: 0.2.1
version: 0.2.3

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# persona
Expand Down
59 changes: 31 additions & 28 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "oobabot"
version = "0.2.1"
version = "0.2.3"
description = "A Discord bot which talks to Large Language Model AIs running on oobabooga's text-generation-webui"
authors = ["Christopher Rude <chris@rudesoftware.net>"]
license = "MIT"
Expand Down Expand Up @@ -34,7 +34,7 @@ black = "^23.3.0"
flake8 = "^6.0.0"
isort = "^5.12.0"
pre-commit = "^3.2.0"
pyright = "^1.1.316"
pyright = "^1.1.325"
pytest = "^7.1"
pylint = "^2.17.4"

Expand Down
2 changes: 1 addition & 1 deletion src/oobabot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
"""

# todo: sync this up automatically
__version__ = "0.2.1"
__version__ = "0.2.3"
7 changes: 3 additions & 4 deletions src/oobabot/fancy_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,7 @@ def get_all(self) -> typing.List[str]:
# return wrapper


def excepthook(*exc_info):
exc_type = exc_info[0]
def excepthook(exc_type, exc_value, exc_traceback):
if issubclass(exc_type, (KeyboardInterrupt, SystemExit)):
sys.__excepthook__(*exc_info)
get().error("Unhandled exception", exc_info=exc_info)
sys.__excepthook__(exc_type, exc_value, exc_traceback)
get().error("Unhandled exception", exc_info=(exc_type, exc_value, exc_traceback))

0 comments on commit fa234d6

Please sign in to comment.