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

[FEATURE] Add "AI" support #3026

Open
pbek opened this issue May 10, 2024 · 18 comments
Open

[FEATURE] Add "AI" support #3026

pbek opened this issue May 10, 2024 · 18 comments
Assignees
Labels

Comments

@pbek
Copy link
Owner

pbek commented May 10, 2024

I want to try to integrate support for the OpenAI Autocomplete API to see where that leads us. I mainly plan to expose that to the scripting engine, so users can come up with new ideas of what to do with it. 😊

@pbek pbek self-assigned this May 10, 2024
@pbek
Copy link
Owner Author

pbek commented May 10, 2024

Currently, you can create API Keys at https://console.groq.com/keys for free to play around.

pbek added a commit that referenced this issue May 11, 2024
pbek added a commit that referenced this issue May 12, 2024
pbek added a commit that referenced this issue May 12, 2024
pbek added a commit that referenced this issue May 13, 2024
pbek added a commit that referenced this issue May 15, 2024
pbek added a commit that referenced this issue May 15, 2024
pbek added a commit that referenced this issue May 15, 2024
pbek added a commit that referenced this issue May 15, 2024
pbek added a commit that referenced this issue May 15, 2024
pbek added a commit that referenced this issue May 15, 2024
pbek added a commit that referenced this issue May 16, 2024
pbek added a commit that referenced this issue May 16, 2024
pbek added a commit that referenced this issue May 17, 2024
pbek added a commit to qownnotes/scripts that referenced this issue May 17, 2024
pbek added a commit to qownnotes/scripts that referenced this issue May 17, 2024
pbek added a commit that referenced this issue May 17, 2024
pbek added a commit that referenced this issue May 17, 2024
pbek added a commit that referenced this issue May 17, 2024
@alexanderino
Copy link

Many thanks for this interesting development, Patrizio. Unfortunately, the AI toolbar doesn't function properly in my portable installation (24.5.4, with previously customised toolbars and layout). Only one button can be enabled manually (first row, far right):

image

On a clean portable install, this is how it looks with two drop-down lists (AI toolbar moved down to improve screenshot):

image

Is there anything I can do to make it work in my existing installation? In the AI toolbar settings, AI backend selector and AI model selector (which provide the drop-down lists) are not listed, and I couldn't find those in any of the toolbar items in the left column.

@alexanderino
Copy link

Update: the issue has been fixed by editing QOwnNotes.ini. I removed some lines (struck out below) and re-numbered (highlighted in bold) the subsequent lines:

5\name=aiToolbar
5\title=AI toolbar
5\items=@invalid()
6\name=windowToolbar
6\title=window toolbar
6\items=actionWorkspaceComboBox, actionStore_as_new_workspace, actionRemove_current_workspace, actionRename_current_workspace, actionSwitch_to_previous_workspace, actionUnlock_panels, , actionToggle_distraction_free_mode, action_Increase_note_text_size, action_Decrease_note_text_size, action_Reset_note_text_size
7\name=quitToolbar
7\title=quit toolbar
7\items=action_Export_note_as_PDF_markdown, actionExport_preview_HTML, customAction_pandocExport, action_Settings, action_Quit

New code:

5\name=windowToolbar
5\title=window toolbar
5\items=actionWorkspaceComboBox, actionStore_as_new_workspace, actionRemove_current_workspace, actionRename_current_workspace, actionSwitch_to_previous_workspace, actionUnlock_panels, , actionToggle_distraction_free_mode, action_Increase_note_text_size, action_Decrease_note_text_size, action_Reset_note_text_size
6\name=quitToolbar
6\title=quit toolbar
6\items=action_Export_note_as_PDF_markdown, actionExport_preview_HTML, customAction_pandocExport, action_Settings, action_Quit

@pbek
Copy link
Owner Author

pbek commented May 20, 2024

If the toolbar gets too long it's just cut off, you can either move toolbar items to somewhere else or turn off toolbars you don't need.

@alexanderino
Copy link

alexanderino commented May 20, 2024

It's not the length. I could move the AI toolbar item to the start, and it would still show only one button (after adding it manually — until then, there was no button on the AI toolbar).

Anyway, editing it out of the INI file fixed the issue.

@pbek
Copy link
Owner Author

pbek commented May 20, 2024

Only one button? Did you try to move the enable button from the main menu to a toolbar manually?
There is an AI toolbar with the button and two selectors, that just can be turned on...

@alexanderino
Copy link

There is an AI toolbar with the button and two selectors, that just can be turned on...

I turned it on after upgrading to 24.5.4, and only a blank toolbar (no icons) appeared.

Only one button? Did you try to move the enable button from the main menu to a toolbar manually?

Yes, and that's how I managed to show the 'database' button. The two dropdown list items are nowhere to be found.

@pbek
Copy link
Owner Author

pbek commented May 20, 2024

I turned it on after upgrading to 24.5.4, and only a blank toolbar (no icons) appeared.

Really!? What OS and what Qt version do you have?

Yes, and that's how I managed to show the 'database' button. The two dropdown list items are nowhere to be found.

Yes, there is no drop-down in the main menu. Those are added in source code, like e.g. the workspace selector. 🤔

@alexanderino
Copy link

Really!? What OS and what Qt version do you have?

Windows 11, Qt 5.15.2 (official 24.5.2 build). Also occurs with Windows 10.

@pbek
Copy link
Owner Author

pbek commented May 20, 2024

I just tried it on a Windows 8 VM. Updated from a year-old release of QOwnNotes. The AI Toolbar was intact for me, just cut off because there was no space to show it in full... I made a little room and the backend and model selector were present.

@alexanderino
Copy link

Is the toolbar layout/buttons customised?

@pbek
Copy link
Owner Author

pbek commented May 20, 2024

The AI toolbar? No.

@alexanderino
Copy link

I customised other toolbars' buttons before the AI toolbar was introduced. Those changes are stored in the QOwnNotes.ini file. Maybe this is what resulted in my issue. After all, a clean portable install of 24.5.4 has no problems with the AI toolbar.

@pbek
Copy link
Owner Author

pbek commented May 20, 2024

Hm, maybe...
And you are really sure the toolbar was not just cut off? Your first screenshot doesn't really show that. 🤔

@alexanderino
Copy link

Definitely not cut off. Both rows are fully presented. I've highlighted the AI toolbar, showing the blank space where the drop-down lists should have been:

image

@pbek
Copy link
Owner Author

pbek commented May 20, 2024

If there is not enough room, the whole widget will not be shown. I can't say if there was enough room on your screenshot.

@alexanderino
Copy link

I have a backup of the INI file before I modified it. Here are screenshots of the entire program using it:

Upon start-up, the AI Toolbar is hiding here:

image

AI toolbar moved up to the top row and expanded. No buttons are visible:

image

No button listed in the AI toolbar settings:

image

Enable AI support added from the Edit toolbar item list:

image

This is the result — one button:

image

@pbek
Copy link
Owner Author

pbek commented May 20, 2024

Interesting, good to know. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants