williamkray / maubot-chatgpt Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Hello,
plugin starts ok in maubot docker 0.4.2
Config also seems ok (i just updated your chatgpt package from 0.0.4 to 0.0.7 and used the updated config template).
I also re-registered the bot within maubot.
When I open a chat, the bot joins automatically but I get no response. In maubot i see this error every time I write a message - how can I solve that? Is it a config error? Thank you!
Failed to run handler
Traceback (most recent call last):
File "/usr/lib/python3.11/site-packages/mautrix/client/syncer.py", line 236, in _catch_errors
await handler(data)
File "/data/plugins/org.jobmachine.chatgpt-v0.0.7.mbp/gpt.py", line 84, in on_message
if not await self.should_respond(event):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/data/plugins/org.jobmachine.chatgpt-v0.0.7.mbp/gpt.py", line 60, in should_respond
if re.search("(^|\s)(@)?" + self.name + "([ :,.!?]|$)", event.content.body, re.IGNORECASE):
~~~~~~~~~~~~~^~~~~~~~~~~
TypeError: can only concatenate str (not "NoneType") to str
Allow regex like '^@.*homeserverdomain\.tld$'
in paramter allowed_users
, so that everyone of a homeserver can use chatgpt.
Hello!
Thank you for this maubot - it works great!
How is the allow_users list supposed to be used?
When I add users with the real username @username:matrix.org i get a syntax error in the config file and the bot crashes:
ruamel.yaml.scanner.ScannerError: while scanning for the next token
found character '@' that cannot start any token
in "", line 8, column 16:
allowed_users: @user:matrix.org
^ (line: 8)
When adding users to the list as [user1:matrix.org user2:matrix.org user3:matrix.org] it's also not working - not allowed.
Any help is appreciated - thanks!
seems like the bot tries to parse the event history and breaks when it gets to the room join state event because it's not a message. workaround is to keep thread responses enabled until there are enough events in the room to push the join out of the history.
in an encrypted room with threaded-responses disabled, if i delete any message in the recent history the bot has trouble capturing the messages to use for context.
the following is an example from the logs of my testing instance:
[06:24:01](file:////opt/maubot/maubot/matrix.py:287)WARNING[client/@clorg:jobmachine.org](https://maubot.dev.jobmachine.org/#/client/@clorg:jobmachine.org)/cryptoget_event: Failed to decrypt $P5iiCx8v3WAsdfeD8tyGrIO-PQPUo3BjKY5yHV5tyv0: Unsupported event content class
[06:24:01](file:////data/plugins/org.jobmachine.chatgpt-v0.0.8-ts1698499308976.mbp/gpt.py:107)ERROR[instance/gpt](https://maubot.dev.jobmachine.org/#/instance/gpt)Something went wrong: Decryption error!
[06:24:01](file:////data/plugins/org.jobmachine.chatgpt-v0.0.8-ts1698499308976.mbp/gpt.py:107)ERROR[instance/gpt](https://maubot.dev.jobmachine.org/#/instance/gpt)Traceback (most recent call last):
File "/data/plugins/org.jobmachine.chatgpt-v0.0.8-ts1698499308976.mbp/gpt.py", line 91, in on_message
context = await self.get_context(event)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/data/plugins/org.jobmachine.chatgpt-v0.0.8-ts1698499308976.mbp/gpt.py", line 176, in get_context
async for next_event in self.generate_context_messages(event):
File "/data/plugins/org.jobmachine.chatgpt-v0.0.8-ts1698499308976.mbp/gpt.py", line 216, in generate_context_messages
raise ValueError("Decryption error!")
ValueError: Decryption error!
workarounds include sending a message with enough words in it to push the deletion event far enough back to not be included in the context, or enable threads in the bot temporarily until this naturally happens.
in the meantime, it is strongly advised to avoid deleting messages in encrypted rooms.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.