-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add report AI invalid responses btn #22
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mszostok
force-pushed
the
add-ai-report-btn
branch
from
April 24, 2024 22:55
5f5093c
to
e0febca
Compare
mszostok
commented
Apr 25, 2024
internal/source/ai-brain/response.go
Outdated
Comment on lines
119
to
133
{ | ||
ParentActivityID: messageID, | ||
BaseBody: api.Body{ | ||
// We use the Plaintext to make sure that Teams renderer will send | ||
// as simplified card (https://learn.microsoft.com/en-us/microsoftteams/platform/bots/how-to/format-your-bot-messages#format-text-content) | ||
// instead of AdaptiveCard (https://learn.microsoft.com/en-us/microsoftteams/platform/task-modules-and-cards/cards/cards-format?tabs=adaptive-md%2Cdesktop%2Cconnector-html#format-cards-with-markdown) | ||
// which doesn't support most of the markdown elements. | ||
Plaintext: markdownToTeams(response), | ||
}, | ||
}, | ||
{ | ||
ParentActivityID: messageID, | ||
Sections: []api.Section{ | ||
{ | ||
Buttons: api.Buttons{btn}, | ||
}, | ||
}, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, we need to send 2 messages, reason:
- For AI responses, we use a simplified card that handles the Markdown formatting pretty well, however btn are not available here.
- AdaptiveCard on the other hand allows btn, but doesn't support most of the markdown elements. It means that if we will use it, we won't get the multiline code blocks, which will make AI responses quite unreadable.
mszostok
force-pushed
the
add-ai-report-btn
branch
from
April 25, 2024 13:16
e0febca
to
78cd41f
Compare
mszostok
force-pushed
the
add-ai-report-btn
branch
from
April 25, 2024 13:35
78cd41f
to
f58038b
Compare
pkosiec
approved these changes
Apr 26, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, will test it to dev e2e 👍
mszostok
force-pushed
the
add-ai-report-btn
branch
from
April 26, 2024 17:16
f58038b
to
7f180e9
Compare
mszostok
force-pushed
the
add-ai-report-btn
branch
from
April 26, 2024 17:17
7f180e9
to
d12b9b0
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Changes proposed in this pull request:
Testing
Repo
botkube-cloud-plugins
:gh pr checkout 22
PLUGIN_TARGETS='ai,ai-brain' make build-plugins-single
make serve-local-plugins
Repo
botkube-cloud
:gh pr checkout 1032
Demo
Note
Discord and Mattermost don't support interactivity. Additionally, they don't support cloud commands, meaning we're not able to easily add support for those platforms.
Related issue(s)