instill-ai / instill-core

๐Ÿ”ฎ Instill Core is a full-stack AI infrastructure tool for data, model and pipeline orchestration, designed to streamline every aspect of building versatile AI-first applications
https://www.instill.tech
Other
2.13k stars 106 forks source link

[Slack] Read message cross channels #1110

Open ShihChun-H opened 1 month ago

ShihChun-H commented 1 month ago

Issue Description

Current State

Why We Want to Change?

Proposed Change


Rules for the Component Hackathon


Component Contribution Guideline | Documentation | Official Go Tutorial

linear[bot] commented 1 month ago

INS-6354 [Slack] Read message cross channels

Joycelyn-Chen commented 1 month ago

Hello @ShihChun-H, I'm interested in working on this issue for Hacktoberfest!

ShihChun-H commented 1 month ago

Hi @Joycelyn-Chen, Sounds great! This issue is assigned to you.

aazam-gh commented 1 month ago

Hi, can I work on this? :)

ShihChun-H commented 1 month ago

@aazam-gh Sure! The issue has been assigned to you.

ShihChun-H commented 1 month ago

Hi @aazam-gh, I'm following up to check on any progress made regarding this issue. Could you please provide an update? Thanks ๐Ÿ™

aazam-gh commented 1 month ago

Hi sorry for not replying sooner. Seems like I need to have an appropriate nvidia driver

make: *** [Makefile:68: latest] Error 1
alcadeus@warmachine:~/instill-core$ 

getting this error when running the make command to start services

chuang8511 commented 1 month ago

Hi @aazam-gh

Did you run make latest PROFILE=all in instill-core?

aazam-gh commented 1 month ago

@chuang8511 Yes I am running that command

aazam-gh commented 1 month ago
[sudo] password for alcadeus: 
make[1]: Entering directory '/home/alcadeus/instill-core'
make[1]: Leaving directory '/home/alcadeus/instill-core'
[+] Running 11/12
 โœ” Container pg-sql           Healthy                                                                                                                                   3.0s 
 โœ” Container elasticsearch    Healthy                                                                                                                                  11.0s 
 โœ” Container minio            Started                                                                                                                                   0.5s 
 โœ” Container milvus           Started                                                                                                                                   0.4s 
 โœ” Container redis            Healthy                                                                                                                                   5.9s 
 โœ” Container influxdb         Healthy                                                                                                                                   6.1s 
 โœ” Container temporal         Started                                                                                                                                  11.3s 
 โœ” Container openfga_migrate  Started                                                                                                                                   3.2s 
 โœ” Container console          Started                                                                                                                                   0.6s 
 โœ” Container registry         Started                                                                                                                                   6.2s 
 โœ” Container api-gateway      Started                                                                                                                                   6.3s 
 โ ธ Container ray-server       Starting                                                                                                                                 11.3s 
Error response from daemon: could not select device driver "nvidia" with capabilities: [[gpu]]
make: *** [Makefile:68: latest] Error 1
alcadeus@warmachine:~/instill-core$ 
chuang8511 commented 1 month ago

Hi @aazam-gh Thanks for your report. sudo might be the cause.

Could you not use sudo?

aazam-gh commented 1 month ago

Let me try it. I will have to give user access to docker first

aazam-gh commented 1 month ago

@chuang8511 same result :(

alcadeus@warmachine:~/instill-core$ make latest PROFILE=all
make[1]: Entering directory '/home/alcadeus/instill-core'
make[1]: Leaving directory '/home/alcadeus/instill-core'
[+] Running 12/13
 โœ” Container console          Running                                                                                                                                   0.0s 
 โœ” Container minio            Running                                                                                                                                   0.0s 
 โœ” Container pg-sql           Healthy                                                                                                                                   0.5s 
 โœ” Container influxdb         Healthy                                                                                                                                   0.5s 
 โœ” Container redis            Healthy                                                                                                                                   0.5s 
 โœ” Container elasticsearch    Healthy                                                                                                                                   0.5s 
 โœ” Container api-gateway      Running                                                                                                                                   0.0s 
 โœ” Container milvus           Running                                                                                                                                   0.0s 
 โœ” Container registry         Running                                                                                                                                   0.0s 
 โœ” Container openfga_migrate  Started                                                                                                                                   0.7s 
 โœ” Container temporal         Running                                                                                                                                   0.0s 
 โœ” Container temporal-ui      Running                                                                                                                                   0.0s 
 โ ฆ Container ray-server       Starting                                                                                                                                  0.7s 
Error response from daemon: could not select device driver "nvidia" with capabilities: [[gpu]]
make: *** [Makefile:68: latest] Error 1
alcadeus@warmachine:~/instill-core$ 
chuang8511 commented 1 month ago

@aazam-gh

You probably have NVIDIA driver installed on his machine which will enable GPU features in instill-core by default.

If you really cannot run instill-core, you can just directly run pipeline-backend. About end-to-end test part, we will help you confirm it.

Please just make sure that the unit test is ok.

Will it be ok to you?

aazam-gh commented 1 month ago

Yes that will be fine. What command should I run then instead?

chuang8511 commented 1 month ago

go test ./pkg/component/application/slack/v0/... to verify the test

make gen-component-doc to verify JSON schema

kuroxx commented 4 weeks ago

Hey @aazam-gh how's it going? We're you able to resolve the issue? If not, you can join our Discord server: https://discord.gg/sevxWsqpGh where others may be able to help!

VibhorGits commented 3 weeks ago

Hey @aazam-gh @kuroxx I would like to work on the issue if it's open for contributions now.

aazam-gh commented 3 weeks ago

Yeah, I won't have enough time to continue working on this

VibhorGits commented 3 weeks ago

Thanks @aazam-gh I should start contributing while the issue is reassigned :)

kuroxx commented 3 weeks ago

Thanks @aazam-gh for letting us know!

Hey @VibhorGits I have assigned the issue to you now ๐Ÿค Happy Hacking ๐Ÿ‘ป

VibhorGits commented 3 weeks ago

Hey @kuroxx, Iโ€™ve started reading the Slack documentation and made some progress with implementing the array of channel names using regexp. Could you please assist me out with prefix / suffix of channel name for users to scan the channels. I doesn't seem clear to me.

chuang8511 commented 3 weeks ago

Hi @VibhorGits Thanks for your question.

Currently, the users need to input the exact channel name to fetch the conversations in Slack. After this feature, we expect the users can fetch the conversations in Slack only inputing the prefix or suffix of the channel name.

e.g. there are channel names called

When the users input dev, the users can fetch the conversations in all three channels above.

VibhorGits commented 3 weeks ago

Hey @chuang8511 my apology to interrupt you on the above issue Currently I would like to get some feedback on the first part of the proposed changes: array of channel names with regexp

I made the following changes in the tasks.json file

 "TASK_READ_MESSAGE": {
    "instillShortDescription": "Get the latest message since specific date",
    "input": {
      "description": "Please input the channel name and the date that we want to start to read",
      "instillUIOrder": 0,
      "properties": {
        "channel-name": {
          "description": "Channel name, as displayed on Slack",
          "instillAcceptFormats": [
            "array"
          ],
          "instillUIMultiline": true,
          "instillUIOrder": 0,
          "instillUpstreamTypes": [
            "value",
            "reference",
            "template"
          ],
          "title": "Channel Name",
          "type": "array",
          "items": {
          "type": "string"
          }
        },
"TASK_WRITE_MESSAGE": {
    "instillShortDescription": "send message to a specific channel",
    "title": "Send Message",
    "input": {
      "description": "Input",
      "instillUIOrder": 0,
      "properties": {
        "channel-name": {
          "description": "Channel name, as displayed on Slack",
          "instillAcceptFormats": [
            "array"
          ],
          "instillUIMultiline": true,
          "instillUIOrder": 0,
          "instillUpstreamTypes": [
            "value",
            "reference",
            "template"
          ],
          "title": "Channel Name",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
chuang8511 commented 3 weeks ago
        "channel-name": {
          "description": "Channel name, as displayed on Slack",
          "instillAcceptFormats": [
            "array"
          ],

"channel-name" -> "channel-names"

"description": "Channel name, as displayed on Slack", -> "description": "Enter a partial or complete channel name to fetch conversations. For example, typing 'dev' retrieves conversations from all channels containing 'dev', such as 'dev-frontend', 'dev-backend', and 'dev-devop'."

And, you don't have to modify the write part.

VibhorGits commented 3 weeks ago

Thank you @chuang8511 I revert back all the changes in the write part to original and made the following changes in the read part. I also tried to implement the regex pattern functionality inside the input section. What you think?

"TASK_READ_MESSAGE": {
    "instillShortDescription": "Get the latest message since specific date",
    "input": {
      "description": "Please input the channel name and the date that we want to start to read",
      "instillUIOrder": 0,
      "properties": {
        "channel-names": {
          "description": "Enter a partial or complete channel name to fetch conversations.",
          "instillAcceptFormats": [
            "array"
          ],
          "instillUIMultiline": true,
          "instillUIOrder": 0,
          "instillUpstreamTypes": [
            "value",
            "reference",
            "template"
          ],
          "title": "Channel Name",
          "type": "array",
          "items": {
          "type": "string"
          }
        },
        "channel-regex": {
        "description": "Regular expression to filter channel names",
        "instillAcceptFormats": [
          "string"
        ],
        "instillUIOrder": 1,
        "title": "Channel Regex",
        "type": "string"
        },
chuang8511 commented 3 weeks ago
        "channel-regex": {
        "description": "Regular expression to filter channel names",
        "instillAcceptFormats": [
          "string"
        ],
        "instillUIOrder": 1,
        "title": "Channel Regex",
        "type": "string"
        },

After thinking again, how about removing regex part?

regex for channel name may too difficult for users to input. And, I suspect the channel should be easy to group by suffix or prefix in the most of use cases.

VibhorGits commented 3 weeks ago

Yea sure we can go with either one of them and suffix/prefix should be easier in most cases as you said. I went along with regex part as the suffix/prefix implementation wasn't quite clear to me. So now I need to add the suffix/prefix only to my read part, that's it @chuang8511 ?

chuang8511 commented 3 weeks ago

So now I need to add the suffix/prefix only to my read part, that's it @chuang8511 ?

Yes, please! Thank you!

VibhorGits commented 3 weeks ago

Sure ! @chuang8511 Here's the required changes

 "TASK_READ_MESSAGE": {
    "instillShortDescription": "Get the latest message since specific date",
    "input": {
      "description": "Please input the channel name and the date that we want to start to read",
      "instillUIOrder": 0,
      "properties": {
        "channel-names": {
          "description": "Enter a partial or complete channel name to fetch conversations.",
          "instillAcceptFormats": [
            "array"
          ],
          "instillUIMultiline": true,
          "instillUIOrder": 0,
          "instillUpstreamTypes": [
            "value",
            "reference",
            "template"
          ],
          "title": "Channel Name",
          "type": "array",
          "items": {
          "type": "string"
          }
        },
          "prefix": {
          "description": "Prefix to add to each channel name",
          "instillAcceptFormats": [
          "string"
          ],
          "instillUIOrder": 1,
          "title": "Prefix",
          "type": "string"
        },
        "suffix": {
          "description": "Suffix to add to each channel name",
          "instillAcceptFormats": [
          "string"
          ],
          "instillUIOrder": 2,
          "title": "Suffix",
          "type": "string"
        },
        "start-to-read-date": {
          // REMAINING CODE
          }
chuang8511 commented 3 weeks ago

@VibhorGits Oh, sorry. I miss to read your code.

Please use this definition.

        "channel-names": {
          "description": "Enter a partial or complete channel name to fetch conversations. For example, typing 'dev' retrieves conversations from all channels containing 'dev', such as 'dev-frontend', 'dev-backend', and 'dev-devop'.",
          "instillAcceptFormats": [
            "array"
          ],

With only channel-names, the users can set the channel partially or completely. Don't have to let the users add prefix or suffix.

          "prefix": {
          "description": "Prefix to add to each channel name",
          "instillAcceptFormats": [
          "string"
          ],
          "instillUIOrder": 1,
          "title": "Prefix",
          "type": "string"
        },
        "suffix": {
          "description": "Suffix to add to each channel name",
          "instillAcceptFormats": [
          "string"
          ],
          "instillUIOrder": 2,
          "title": "Suffix",
          "type": "string"
        },
VibhorGits commented 3 weeks ago

No worries @chuang8511 Ok so I dont need to add prefix/suffix and the following code is enough to get the desired functionality where I need to retrieve conversation from for ex: 'dev-frontend', 'dev-backend' when typing 'dev'.

"channel-names": {
  "description": "Enter a partial or complete channel name to fetch conversations. For example, typing 'dev' retrieves conversations from all channels containing 'dev'.",
  "instillAcceptFormats": [
    "array"
  ],
  "instillUIMultiline": true,
  "instillUIOrder": 0,
  "instillUpstreamTypes": [
    "value",
    "reference",
    "template"
  ],
  "title": "Channel Name",
  "type": "array",
  "items": {
    "type": "string"
  }
}
VibhorGits commented 2 weeks ago

Hey @kuroxx @chuang8511 I created a PR. Check it out : PR

kuroxx commented 1 week ago

Hey @VibhorGits as discussed on Discord, without being able to test your own code will make it difficult for our reviewers to check your code for you so I will de-assign you from this ticket now, Thanks! ๐Ÿ™