arcuru / chaz

Chaz is for chats
https://chaz.is
MIT License
30 stars 3 forks source link

[Feature Request] Passive participation #6

Open lboklin opened 1 month ago

lboklin commented 1 month ago

Would be interesting to let chaz sit in on a conversation but only respond when it seems appropriate, such as when directly addressed, when certain topics or sentiments appear, or if it is implicitly pulled into the conversation.

However, it seems like currently it can't identify individual participants, with any new message being attributed simply to "User". For the feature request to make sense, each new message would have to include at least the author's username. That seems straight forward enough...

The big question is how the decision to butt in or not could be implemented. There would have to be another model in addition to the one generating responses: one that performs sentiment and content analysis in order to determine whether a response is warranted or not.

I do not know how well or not current models are able to handle multi-participant conversations, but I imagine they might do ok with the right guidance.

arcuru commented 1 month ago

That's an interesting idea. There are a couple different suggestions here that I want to break down.

  1. Only respond when directly addressed.
  2. Handle multi-user conversations.
  3. Decide when to respond itself.

1 has been on my list to implement. My plan was to change the interface to take "!chaz" (or a custom name) as the prefix for commands instead of just "." And have it operate in a DM mode where it always responds like now, or only when directly queried. I already added support for "!chaz" style commands to the headjack library, as I switched to those commands for my other tool https://github.com/arcuru/pokem

2 is pretty reasonable, I'd thought about that as well. I was going to try experimenting with replacing "USER" with the names of participants in the conversation sent to the LLMs when running it in a room with multiple participants, as you suggested too. I suspect that the more sophisticated models will handle it fine but the others will struggle, some of them get confused with my "USER" and "ASSISTANT" labels already.

The OpenAI APIs have a "completion" and a "conversation" interface, but because I was lazy with the backend and am plugging everything into AIChat it is stuck using only the "completion" interface and I'm adding the labeling to fake the conversation myself.

3, deciding the right time to respond, is pretty interesting. I hadn't thought of that but I'd love to explore it.