ai: add cherry-studio; add zjuchat

This commit is contained in:
EdenQwQ 2025-03-09 00:07:13 +08:00
parent 6dd2a05941
commit 239f2ebba2
10 changed files with 51 additions and 1 deletions

View file

@ -76,6 +76,27 @@
}) })
end end
''; '';
adapters.zjuchat.__raw =
# lua
''
function ()
local zjuchat_token_file = io.open(os.getenv("XDG_RUNTIME_DIR") .. "/" .. "${get_base_secret config.age.secrets.zjuchat_token.path}", "r")
local zjuchat_api_key = zjuchat_token_file:read()
zjuchat_token_file:close()
return require("codecompanion.adapters").extend("openai_compatible", {
name = "zjuchat",
env = {
url = "https://chat.zju.edu.cn/api/ai",
api_key = zjuchat_api_key,
},
schema = {
model = {
default = "deepseek-v3-671b",
}
}
})
end
'';
adapters.gemini.__raw = adapters.gemini.__raw =
# lua # lua
'' ''

View file

@ -40,6 +40,7 @@
nurl nurl
wl-color-picker wl-color-picker
matugen matugen
cherry-studio
]; ];
imports = [ imports = [
./eye-candy.nix ./eye-candy.nix

View file

@ -1,6 +1,6 @@
{ pkgs, ... }: { pkgs, ... }:
let let
swhkd = import ../../pkgs/swhkd/swhkd.nix { swhkd = import ../../pkgs/swhkd.nix {
inherit (pkgs) inherit (pkgs)
lib lib
rustPlatform rustPlatform

View file

@ -0,0 +1,9 @@
{
nixpkgs.overlays = [
(final: prev: {
cherry-studio = prev.cherry-studio.override {
commandLineArgs = "--wayland-text-input-version=3";
};
})
];
}

View file

@ -2,6 +2,7 @@
{ {
imports = [ imports = [
./qutebrowser.nix ./qutebrowser.nix
./cherry-studio.nix
./customColorSchemes ./customColorSchemes
]; ];
nixpkgs.overlays = [ nixpkgs.overlays = [

View file

@ -3,5 +3,7 @@
siliconflow_token.file = ./siliconflow_token.age; siliconflow_token.file = ./siliconflow_token.age;
gemini_token.file = ./gemini_token.age; gemini_token.file = ./gemini_token.age;
deepseek_token.file = ./deepseek_token.age; deepseek_token.file = ./deepseek_token.age;
zjuchat_token.file = ./zjuchat_token.age;
tavily_token.file = ./tavily_token.age;
}; };
} }

View file

@ -15,4 +15,12 @@ in
eden eden
eden-inspiron eden-inspiron
]; ];
"zjuchat_token.age".publicKeys = [
eden
eden-inspiron
];
"tavily_token.age".publicKeys = [
eden
eden-inspiron
];
} }

8
secrets/tavily_token.age Normal file
View file

@ -0,0 +1,8 @@
age-encryption.org/v1
-> ssh-ed25519 MpnI9A OV9oWjQE0KQmn5ph6M8sc/7vlKgCR0KpsvRvrfonhHw
J5vm/pwMonHcHm2ai9FujNxWg0FXbyUpeCuKoHOLz7A
-> ssh-ed25519 6VlDkQ tVF545JaFz+Y2oz5pG7OT9Qn1TAINIjUsZ+3K4N5XH0
5VGfA0T2la8uVFuZ2Tq3A+3L2j6qZ5IwxGjLBYHaJDc
--- Tc5KzEtm7oyAYq5Sv41m3SfdQcEXd27lp4Rq7y8HnBo
mðeQí»×íÓ Je ¥WÑ
4χ4Pï+ßkBbS[”ÈvhPs)Éœ(ˆrqweõ%ºrƒ36Ð|°8fYK^nÜÇ<>

BIN
secrets/zjuchat_token.age Normal file

Binary file not shown.