-
Notifications
You must be signed in to change notification settings - Fork 87
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
Ai assistant widget #4508
Ai assistant widget #4508
Conversation
Yes exactly, I use it later for a bunch of things |
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.
Can you add a video demonstrating how the widget works?
I've reviewed the integration and after I check the video I'll review the widget code.
@tomaskikutis here's a demo of the functionality Screen.Recording.2024-04-24.at.10.08.52.mov |
scripts/apps/authoring-bridge/widgets/ai-widget/ai-assistant.tsx
Outdated
Show resolved
Hide resolved
} | ||
|
||
generateHeadlines() { | ||
if (this.aiAssistant?.generateHeadlines == null) { |
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.
what about not even registering the widget if this is not defined?
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.
fyi, you commented on the previous implementation, but the new one is similar. Well, that can't be done with the design you suggested. Using this design it's possible to register the extension, but you can skip registering the custom API requests. So that's why if someone wants, they can register the extension. And actually for the future I see a benefit since since some clients might want to have e.g. summary, translations but not headlines generation.
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.
In another comment I asked to make generateHeadlines/generateSummary
mandatory. If you want to keep it optional, update the UI so if headlines/summary is not passed - buttons to generate shouldn't appear either.
And if buttons appear only when it's registered - there's no use in this function to again check if it's registered.
scripts/apps/authoring-bridge/widgets/ai-widget/ai-assistant.tsx
Outdated
Show resolved
Hide resolved
scripts/apps/authoring-bridge/widgets/ai-widget/ai-assistant.tsx
Outdated
Show resolved
Hide resolved
scripts/apps/authoring-bridge/widgets/ai-widget/ai-assistant.tsx
Outdated
Show resolved
Hide resolved
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.
I left some comments unresolved that you didn't address. Let's talk tomorrow and go through them.
|
||
generateHeadlines() { | ||
if (configuration.generateHeadlines == null) { | ||
this.setError(); |
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.
Headlines are only generated from headlines widget. And we don't show headlines widget if we don't have the configuration. Then it means this line would never execute - so let's drop it. Same with generateSummary
also check that checkbox if you verified it already |
Can you suggest me a good way to handle the
id
of the extension? I'm using that to track a bunch of things and I need it to be accessible from belga's repo and also client-core. One option is to put it in the config and having a constant with the id at the top. Then this config property would be accessible in clien-core as well as belga's repo, and for the future clients that want to use the ai widget setup would also be pretty easy.