end-4 / dots-hyprland

Modern, feature-rich and accessible desktop configuration.
https://end-4.github.io/dots-hyprland-wiki/en/
GNU General Public License v3.0
3.16k stars 204 forks source link

How do I add additional chatbot models into the sidebar instead of chatgpt? #354

Open MNkoder opened 3 months ago

MNkoder commented 3 months ago
(com.github.Aylur.ags:15918): Gjs-WARNING **: 16:00:01.242: JS ERROR: SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data @ file:///home/em-en/.config/ags/services/gemini.js:220:18
appendHistory@file:///home/em-en/.config/ags/services/gemini.js:220:18
loadHistory@file:///home/em-en/.config/ags/services/gemini.js:213:14
GeminiService@file:///home/em-en/.config/ags/services/gemini.js:163:38
@file:///home/em-en/.config/ags/services/gemini.js:328:16
_init/GLib.MainLoop.prototype.runAsync/</<@resource:///org/gnome/gjs/modules/core/overrides/GLib.js:266:34

(com.github.Aylur.ags:15918): Gjs-Console-CRITICAL **: 16:00:01.273: Error: There is no window named overview
getWindow@resource:///com/github/Aylur/ags/app.js:140:27
update@file:///home/em-en/.config/ags/modules/overview/overview_hyprland.js:334:26
default/OverviewRow/setup/<@file:///home/em-en/.config/ags/modules/overview/overview_hyprland.js:377:60
hook/<@resource:///com/github/Aylur/ags/widgets/widget.js:43:25
_init/GLib.MainLoop.prototype.runAsync/</<@resource:///org/gnome/gjs/modules/core/overrides/GLib.js:266:34

(com.github.Aylur.ags:15918): Gjs-CRITICAL **: 16:00:01.273: JS ERROR: TypeError: (intermediate value).getWindow(...) is undefined
update@file:///home/em-en/.config/ags/modules/overview/overview_hyprland.js:334:26
default/OverviewRow/setup/<@file:///home/em-en/.config/ags/modules/overview/overview_hyprland.js:377:60
hook/<@resource:///com/github/Aylur/ags/widgets/widget.js:43:25
_init/GLib.MainLoop.prototype.runAsync/</<@resource:///org/gnome/gjs/modules/core/overrides/GLib.js:266:34

(com.github.Aylur.ags:15918): Gjs-Console-CRITICAL **: 16:00:01.273: Error: There is no window named overview
getWindow@resource:///com/github/Aylur/ags/app.js:140:27
update@file:///home/em-en/.config/ags/modules/overview/overview_hyprland.js:334:26
default/OverviewRow/setup/<@file:///home/em-en/.config/ags/modules/overview/overview_hyprland.js:398:39
hook/<@resource:///com/github/Aylur/ags/widgets/widget.js:43:25
_init/GLib.MainLoop.prototype.runAsync/</<@resource:///org/gnome/gjs/modules/core/overrides/GLib.js:266:34

(com.github.Aylur.ags:15918): Gjs-CRITICAL **: 16:00:01.273: JS ERROR: TypeError: (intermediate value).getWindow(...) is undefined
update@file:///home/em-en/.config/ags/modules/overview/overview_hyprland.js:334:26
default/OverviewRow/setup/<@file:///home/em-en/.config/ags/modules/overview/overview_hyprland.js:398:39
hook/<@resource:///com/github/Aylur/ags/widgets/widget.js:43:25
_init/GLib.MainLoop.prototype.runAsync/</<@resource:///org/gnome/gjs/modules/core/overrides/GLib.js:266:34

(com.github.Aylur.ags:15918): Gjs-Console-CRITICAL **: 16:00:01.273: Error: There is no window named overview
getWindow@resource:///com/github/Aylur/ags/app.js:140:27
update@file:///home/em-en/.config/ags/modules/overview/overview_hyprland.js:334:26
default/OverviewRow/setup/<@file:///home/em-en/.config/ags/modules/overview/overview_hyprland.js:377:60
hook/<@resource:///com/github/Aylur/ags/widgets/widget.js:43:25
_init/GLib.MainLoop.prototype.runAsync/</<@resource:///org/gnome/gjs/modules/core/overrides/GLib.js:266:34

(com.github.Aylur.ags:15918): Gjs-CRITICAL **: 16:00:01.273: JS ERROR: TypeError: (intermediate value).getWindow(...) is undefined
update@file:///home/em-en/.config/ags/modules/overview/overview_hyprland.js:334:26
default/OverviewRow/setup/<@file:///home/em-en/.config/ags/modules/overview/overview_hyprland.js:377:60
hook/<@resource:///com/github/Aylur/ags/widgets/widget.js:43:25
_init/GLib.MainLoop.prototype.runAsync/</<@resource:///org/gnome/gjs/modules/core/overrides/GLib.js:266:34

(com.github.Aylur.ags:15918): Gjs-Console-CRITICAL **: 16:00:01.274: Error: There is no window named overview
getWindow@resource:///com/github/Aylur/ags/app.js:140:27
update@file:///home/em-en/.config/ags/modules/overview/overview_hyprland.js:334:26
default/OverviewRow/setup/<@file:///home/em-en/.config/ags/modules/overview/overview_hyprland.js:398:39
hook/<@resource:///com/github/Aylur/ags/widgets/widget.js:43:25
_init/GLib.MainLoop.prototype.runAsync/</<@resource:///org/gnome/gjs/modules/core/overrides/GLib.js:266:34

(com.github.Aylur.ags:15918): Gjs-CRITICAL **: 16:00:01.274: JS ERROR: TypeError: (intermediate value).getWindow(...) is undefined
update@file:///home/em-en/.config/ags/modules/overview/overview_hyprland.js:334:26
default/OverviewRow/setup/<@file:///home/em-en/.config/ags/modules/overview/overview_hyprland.js:398:39
hook/<@resource:///com/github/Aylur/ags/widgets/widget.js:43:25
_init/GLib.MainLoop.prototype.runAsync/</<@resource:///org/gnome/gjs/modules/core/overrides/GLib.js:266:34
clsty commented 3 months ago

Try to run this command:

rm ~/.cache/ags/user/ai/chats/gemini.txt
pkill ags;ags
MNkoder commented 3 months ago

removed the txt btw

image

end-4 commented 3 months ago

thats sus. why does running ags after killing give that? reboot maybe

MNkoder commented 3 months ago

thats sus. why does running ags after killing give that? reboot maybe

finally.. rebooted thrice and worked the 3rd time!

MNkoder commented 3 months ago

also hey sorry for asking in this issue but how would i add an ai model to the sidebar? for example, i want to add this one called [https://www.perplexity.ai/](perplexity ai) i have the api key and endpoint address, what would be the steps i need to do to add it?

end-4 commented 3 months ago

does it work similar to chatgpt? if yes, you can simply add it to the const PROVIDERS array in ~/.config/ags/services/gpt.js. (and tell me if it works ;) ) else, you'll have to implement your own caller/parser based on that file

MNkoder commented 3 months ago

does it work similar to chatgpt? if yes, you can simply add it to the const PROVIDERS array in ~/.config/ags/services/gpt.js. (and tell me if it works ;) ) else, you'll have to implement your own caller/parser based on that file

afaik it does work similar to chatgpt but this is the error i get.

{"error":{"message":"Invalid model 'gpt-3.5-turbo-1106'. Permitted models can be found in the documentation at https://docs.perplexity.ai/docs/model-cards.","type":"invalid_model","code":400}}
 ...

i think they use customized models but im not sure, can you please look into it and help me with it if you're free <3

MNkoder commented 3 months ago

alright.. so i somehow made it work by changing the model name and now this is the problem,

image

is there any way to fix this formatting? i tried turning on and off enhancements.. still the same

image

end-4 commented 3 months ago

right after this line

const line = this._decoder.decode(bytes);

add this

console.log(line)

then show me console output

end-4 commented 3 months ago

i think they use customized models but im not sure, can you please look into it and help me with it if you're free <3

i should make that PROVIDERS array also contain model name

MNkoder commented 3 months ago

right after this line

const line = this._decoder.decode(bytes);

add this

console.log(line)

then show me console output

im sorry if i sound dumb but where would i find the console output?

end-4 commented 3 months ago

you should run ags in terminal. with my dotfiles it's Super+T to open foot type pkill ags; ags then hit enter ask the model something, wait for it to respond then copy whatever shows up in the console over here

MNkoder commented 3 months ago

its a beefy log;

https://pastebin.com/uau3j4fn

MNkoder commented 3 months ago

heyy 🤕