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

Ai assistant widget #4508

Merged
merged 13 commits into from
May 2, 2024
Merged

Conversation

thecalcc
Copy link
Contributor

@thecalcc thecalcc commented Apr 23, 2024

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.

  • verified to be working with both versions of authoring

@thecalcc
Copy link
Contributor Author

Copy link
Member

@tomaskikutis tomaskikutis left a 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.

scripts/api/desks.ts Outdated Show resolved Hide resolved
scripts/core/superdesk-api.d.ts Outdated Show resolved Hide resolved
@petrjasek petrjasek added this to the 2.8 milestone Apr 24, 2024
@thecalcc
Copy link
Contributor Author

@tomaskikutis here's a demo of the functionality

Screen.Recording.2024-04-24.at.10.08.52.mov

}

generateHeadlines() {
if (this.aiAssistant?.generateHeadlines == null) {
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

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/index.ts Outdated Show resolved Hide resolved
scripts/core/superdesk-api.d.ts Outdated Show resolved Hide resolved
scripts/extensions/ai-widget/src/ai-assistant.tsx Outdated Show resolved Hide resolved
scripts/extensions/ai-widget/src/requests.ts Outdated Show resolved Hide resolved
scripts/extensions/ai-widget/src/requests.ts Outdated Show resolved Hide resolved
Copy link
Member

@tomaskikutis tomaskikutis left a 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.

scripts/extensions/ai-widget/src/ai-assistant.tsx Outdated Show resolved Hide resolved
scripts/extensions/ai-widget/src/ai-assistant.tsx Outdated Show resolved Hide resolved

generateHeadlines() {
if (configuration.generateHeadlines == null) {
this.setError();
Copy link
Member

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

@tomaskikutis
Copy link
Member

verified to be working with both versions of authoring

also check that checkbox if you verified it already

@thecalcc thecalcc merged commit 9c502d8 into superdesk:develop May 2, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants