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

room level and thread level context or both #29

Open
seshubonam opened this issue Jun 28, 2023 · 17 comments
Open

room level and thread level context or both #29

seshubonam opened this issue Jun 28, 2023 · 17 comments
Labels
enhancement New feature or request

Comments

@seshubonam
Copy link

https://github.com/matrixgpt/matrix-chatgpt-bot#good-to-know

This popular bot allows the following :

  • The bot uses threads by default, to keep the context you should reply to this thread or the bot will think its a new conversation. "Threads" were previously experimental, you may need to activate them in your client's settings (e.g. in Element in the "lab"-section).
  • There is support to set the context to work at either the:
    room level
    thread level
    both (threads fork the conversation from the main room)

any possibility to add this feature? would be very useful for practical use cases in a group chat setting. This also solves the problem of context per user query that we discussed few weeks ago.

Thanks

@hibobmaster
Copy link
Owner

hibobmaster commented Jun 28, 2023

I have been very busy recently and won't have time until next week. I will look into these features at that time.

@seshubonam
Copy link
Author

yup sure thanks

@jaodei
Copy link

jaodei commented Jul 4, 2023

Hi,

seshubonam

May I know what are the benefits of adding this feature? Cheers.

@Dual-0
Copy link

Dual-0 commented Aug 1, 2023

May I know what are the benefits of adding this feature? Cheers.

Thread level is based on the functionality of ChatGPT. The bot keeps the context of the chat inside a thread. If you want the bot to refer to a message, reply to it in the thread. If you don't want it to, you can open a new thread. If you don't have this function, the bot will refer to all previously sent messages and treat them as context.

@hibobmaster
Copy link
Owner

hibobmaster commented Sep 20, 2023

Thread level has "rel_type": "m.thread", it's possible to implement it but It is difficult to maintain and differentiate the relationship between contexts. So for now, let's keep things as they are, with each person's conversation undisturbed, maintaining their own contextual relationships.
image

It seems unsigned[transaction_id] in thread is equal .

          "unsigned": {
            "age": 2944662618,
            "transaction_id": "m1692237232973.89"
          },

@seshubonam
Copy link
Author

yup thats good enough ... very good work on repo so far 👏👏

@mwnu
Copy link

mwnu commented Apr 22, 2024

yup thats good enough ... very good work on repo so far 👏👏是的,这足够好...到目前为止,回购工作非常好👏👏

I believe that having robots reply within threads (message columns) is a better approach. Firstly, use a command (such as !gpt) followed by a prompt to trigger the robot's response. Then, the robot replies within the thread, where users can converse without needing further commands. The robot will gather context from within the thread. This setup allows for multiple topics to be discussed within a single room, avoiding the clutter of long contexts and mixed topics in the message list.Like this project

@seshubonam
Copy link
Author

seshubonam commented Apr 22, 2024

hi, great thought. we are trying threads on a matrix client using this matrix bot. you can checkout the site at https://pixx.co/ the repo at https://github.com/pixxels-team/Pixxels-App

Screenshot_20240423_040345_Chrome.jpg

Screenshot_20240423_040358_Chrome.jpg

@hibobmaster
Copy link
Owner

I will look at it. It may take some time to achieve that.

@hibobmaster
Copy link
Owner

hibobmaster commented Apr 23, 2024

To make less changes, i implement thread level context in following steps:

  1. mention bot with prompt
  2. bot replies in thread
  3. send prompt in thread directly without mention it

From web:
image
image
From mobile:
1713868674293
1713868674289

In this way you guy don't need do anything, then we have room level or thread level chat.

@hibobmaster hibobmaster added the enhancement New feature or request label Apr 23, 2024
@seshubonam
Copy link
Author

hi, great thought. we are trying threads on a matrix client using this matrix bot. you can checkout the site at https://pixx.co/ the repo at https://github.com/pixxels-team/Pixxels-App

Screenshot_20240423_040358_Chrome.jpg

wow so quick. 

we tried to manage thread context using llm and msgid. but will try this out. thanks again and again and again.

@hibobmaster
Copy link
Owner

In version v1.7.0, room level context is user independent same as before, thread level context is thread independent.

So users can use the same context for a single thread, which make more senses. 🎉
https://github.com/hibobmaster/matrix_chatgpt_bot#thread-level-context

Remember create a blank context.db and edit your compose.yaml accordingly before spinning up new version.

@seshubonam
Copy link
Author

sure thank you, will check

@mwnu
Copy link

mwnu commented Apr 24, 2024

In version v1.7.0, room level context is user independent same as before, thread level context is thread independent.

So users can use the same context for a single thread, which make more senses. 🎉 https://github.com/hibobmaster/matrix_chatgpt_bot#thread-level-context

Remember create a blank context.db and edit your compose.yaml accordingly before spinning up new version.

The upgrade is fantastic, but there's a minor issue. In the Matrix Spec v1.4, the implementation method for threads involves assigning the value m.thread to rel_type when an event occurs. However, some clients might use their own tags. For instance, Element Web and Element Desktop might label thread events as "rel_type": "io.element.thread". This is because the server has not yet implemented this version of the Thread MSC, or the client version is outdated, leading to these compatibility changes.
I suggest including "io.element.thread" in the robot's thread response events as well.

@hibobmaster
Copy link
Owner

In version v1.7.0, room level context is user independent same as before, thread level context is thread independent.
So users can use the same context for a single thread, which make more senses. 🎉 https://github.com/hibobmaster/matrix_chatgpt_bot#thread-level-context
Remember create a blank context.db and edit your compose.yaml accordingly before spinning up new version.

The upgrade is fantastic, but there's a minor issue. In the Matrix Spec v1.4, the implementation method for threads involves assigning the value m.thread to rel_type when an event occurs. However, some clients might use their own tags. For instance, Element Web and Element Desktop might label thread events as "rel_type": "io.element.thread". This is because the server has not yet implemented this version of the Thread MSC, or the client version is outdated, leading to these compatibility changes. I suggest including "io.element.thread" in the robot's thread response events as well.

Adding "rel_type": "io.element.thread" to the response does not work.
image
image

@mwnu
Copy link

mwnu commented Apr 24, 2024

In version v1.7.0, room level context is user independent same as before, thread level context is thread independent.
So users can use the same context for a single thread, which make more senses. 🎉 https://github.com/hibobmaster/matrix_chatgpt_bot#thread-level-context
Remember create a blank context.db and edit your compose.yaml accordingly before spinning up new version.

The upgrade is fantastic, but there's a minor issue. In the Matrix Spec v1.4, the implementation method for threads involves assigning the value m.thread to rel_type when an event occurs. However, some clients might use their own tags. For instance, Element Web and Element Desktop might label thread events as "rel_type": "io.element.thread". This is because the server has not yet implemented this version of the Thread MSC, or the client version is outdated, leading to these compatibility changes. I suggest including "io.element.thread" in the robot's thread response events as well.

Adding "rel_type": "io.element.thread" to the response does not work. image image

"rel_type": "io.element.thread" replaces "rel_type": "m.thread", rather than treating them as an array.

@hibobmaster
Copy link
Owner

io.element.thread

If we use "rel_type": "io.element.thread", thread is nether properly display from element web nor element android.
image
Screenshot_2024-04-24-18-40-06-973_im vector app-edit
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants