StampyAI / stampy

A Discord bot for the Robert Miles AI server
37 stars 9 forks source link

Stampy chat module #325

Closed mruwnik closed 8 months ago

mruwnik commented 8 months ago

A bunch of small refactors + little bug fixes, and a new module that uses the https://chat.stampy.ai chat bot

ProducerMatt commented 8 months ago

If the new chat and ChatGPT are both enabled, what kind of message will get picked up by the new one?

ProducerMatt commented 8 months ago

I'm trying to submit changes but for some reason my local copy isn't matching what's on GitHub 🤔 I'm probably doing something wrong

ProducerMatt commented 8 months ago

Btw you've done a very good job compressing my code, thank you :)

mruwnik commented 8 months ago

if both are enabled. whichever one claims to have a higher confidece will be chosen. If they both have the same confidence, then I believe it's undefined which will be chosen. In practice this means that the new chat will win, as it has higher confidence. The way this works is that all enabled modules get to answer all messages - they return a Response(text, confidence) instance, where text is either something to display or a callback. Then all the messages are sorted by confidence, and whichever has the highest confidence is picked. If it has a text message, then it returns that then and there, but if it's a callback it will execute it and add the result to the list of messages. This happens in a loop. So generally the callback will return something with higher confidence if it's a valid answer, as that will then certainly be returned (if the previously picked message had confidence n and the new message n+m, then the new message is guaranteed to have the higest confidecce). And if the callback couldn't come up with anything decent, it can return a response with a very low confidence - this will result in a different module having a chance to reply

mruwnik commented 8 months ago

ping

ProducerMatt commented 8 months ago

@mruwnik seen this? https://github.com/StampyAI/stampy/pull/325#discussion_r1378236334

mruwnik commented 8 months ago

it looks like something went wrong with that comment. Could you repost it, or plop it in discord?

ProducerMatt commented 8 months ago

@mruwnik weird. Config.py line 229, you added a default None for the private channel, and i was arguing it should be a required parameter, else the only choice is to silently suppress error logging.

mruwnik commented 8 months ago

ah, that. Could you update the README to explain how to set it? I set the default, as otherwise I couldn't get it to even start, and didn't know what to put there

mruwnik commented 8 months ago

ping

ProducerMatt commented 8 months ago

@mruwnik Sorry. Added the note in README and made it required again

ProducerMatt commented 8 months ago

I think it's ready for merge?