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

Ollama Chat Threads #13

Closed
kevinthedang opened this issue Jan 31, 2024 · 9 comments · Fixed by #62
Closed

Ollama Chat Threads #13

kevinthedang opened this issue Jan 31, 2024 · 9 comments · Fixed by #62
Assignees
Labels
enhancement New feature or request

Comments

@kevinthedang
Copy link
Owner

Steps to Reproduce

  • Run the bot on 1 machine (server or local machine)
  • Allow 1 person to run a query from the bot
  • Then another different person queries the bot
  • The result should be similar as below

image

Ideas

  • It would be nice to reduce the clutter on a channel by allowing the bot to create threads and chat individually with a user
    • The permissions of the thread should only be writable to the bot and the conversation with another user.
    • It should be fine for other users to view the thread, but not create queries (chat)
    • Refer below as an example from Slash Commands Integration #12 called threadCreate.ts. Maybe the same way but instead it is on a new query.
      • Shifts message to thread and creates an ephemeral message (somehow)
      • We want to store the threadId and make sure that it is a parent of this thread is the one in the environment.

image

@kevinthedang kevinthedang added the enhancement New feature or request label Jan 31, 2024
@kevinthedang kevinthedang self-assigned this Feb 19, 2024
@kevinthedang
Copy link
Owner Author

Just found this out while testing out the slash command:

  • Threads have their own channels (so kind of like a child process in a OS)
  • There is no threadMessageCreate so we just have to use messageCreate to handle valid chat instances
    • For example, let's say we have 2 chat threads with ids 123 and 124. The bot should only validate messageCreate somehow within those channels.
    • When threadCreate is called, we want to add it to the instance of valid channels to run Ollama.
    • When threadDelete is called, we want to remove it from the instance of valid channels to run Ollama in.

The Client Class found in the discord.js docs lists all of their interactions and brief descriptions of how they work.

image

@kevinthedang kevinthedang removed their assignment Mar 30, 2024
@kevinthedang
Copy link
Owner Author

Since we are dealing with channels that are "valid", meaning they are still up and being used, we need a way to store them:

I thought about:

  1. Storing via json file, editing and removing from it. We can already do that like with the config so it's possible. What is also cool is that we can create configs for different users and put it in their threads/channels/servers so different for each type. What differs between them? Not sure! We'll figure that out later.
  2. Some kind of external service, but it would be nice to not depend on other services and only depend on the discord.js package development to reduce dependencies.

@JT2M0L3Y JT2M0L3Y added the backlog This issue is pushed to a later date label Apr 4, 2024
@kevinthedang kevinthedang removed the backlog This issue is pushed to a later date label Apr 8, 2024
@kevinthedang
Copy link
Owner Author

Just had a thought:

  • If a user ran the /thread command again, it would generate another chat thread. Should we allow this or prevent multiple chats threads with the same user? @JT2M0L3Y

@kevinthedang
Copy link
Owner Author

kevinthedang commented Apr 8, 2024

Another thing is when a thread is created these appear:

image

Should we clean this up using the bot or should we leave them there. @JT2M0L3Y
Deleting these do not delete the thread.

@kevinthedang kevinthedang self-assigned this Apr 8, 2024
@JT2M0L3Y
Copy link
Collaborator

JT2M0L3Y commented Apr 8, 2024

@kevinthedang
I think users should be allowed multiple threads.
We should clean up the remnant thread messages in the main channel stream.

@kevinthedang
Copy link
Owner Author

@JT2M0L3Y New Idea for this...

We allow threads to be created everywhere, but the bot can no longer talk in channels.

The only exception for this is in #43 as the bot would talk in a regular public channel.

@JT2M0L3Y
Copy link
Collaborator

Definitely.

@kevinthedang
Copy link
Owner Author

Extra Stuff

@kevinthedang
Copy link
Owner Author

Thoughts:

@JT2M0L3Y

@JT2M0L3Y JT2M0L3Y unpinned this issue Jun 7, 2024
@JT2M0L3Y JT2M0L3Y pinned this issue Jun 7, 2024
@kevinthedang kevinthedang linked a pull request Jun 11, 2024 that will close this issue
@JT2M0L3Y JT2M0L3Y unpinned this issue Jun 11, 2024
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

Successfully merging a pull request may close this issue.

2 participants