diff --git a/.ignore b/.ignore new file mode 100644 index 00000000..63f1fef0 --- /dev/null +++ b/.ignore @@ -0,0 +1 @@ +*.lock diff --git a/home/programs/aichat.nix b/home/programs/aichat.nix index d8365e10..288fb835 100644 --- a/home/programs/aichat.nix +++ b/home/programs/aichat.nix @@ -1,4 +1,8 @@ -{config, ...}: { +{ + pkgs, + config, + ... +}: { sops = { secrets."llama/api_key" = {}; secrets."openai/api_key" = {}; @@ -17,7 +21,7 @@ settings = { save_session = true; model = "ryu:qwen3:30b-a3b"; - rag_embedding_model = "ollama:RobinBially/nomic-embed-text-8k"; + rag_embedding_model = "ryu:RobinBially/nomic-embed-text-8k"; clients = [ { type = "openai-compatible"; @@ -33,11 +37,13 @@ name = "qwen3:30b-a3b"; type = "chat"; } - # { - # name = "RobinBially/nomic-embed-text-8k"; - # type = "embedding"; - # default_chunk_size = 8000; - # } + { + name = "RobinBially/nomic-embed-text-8k"; + type = "embedding"; + default_chunk_size = 1000; + max_tokens_per_chunk = 8192; + max_batch_size = 100; + } # { # name = "deepseek-r1:14b"; # type = "chat"; @@ -133,9 +139,16 @@ }; } ]; + document_loaders = { + git = + /* + sh + */ + ''sh -c "yek $1 --json | jq '[.[] | { path: .filename, contents: .content }]'"''; + }; }; roles = { - "%git-commit%" = + "git-commit" = /* md */ @@ -146,5 +159,9 @@ Your task is to generate a concise and informative commit message based on the provided diff. Use the conventional commit format, which includes a type (feat, fix, chore, docs, style, refactor, perf, test) and an optional scope. The message should be in the imperative mood and should not exceed 72 characters in the subject line. Do not under any circumstance include any additional text or explanations, just add the commit message. ''; }; + extraPackages = with pkgs; [ + jq + yek + ]; }; } diff --git a/modules/aichat.nix b/modules/aichat.nix index 429eb698..5638556f 100644 --- a/modules/aichat.nix +++ b/modules/aichat.nix @@ -81,6 +81,14 @@ in { type = lib.types.attrsOf lib.types.str; description = "Roles for the AI chat clients"; }; + extraPackages = mkOption { + type = lib.types.listOf lib.types.package; + default = []; + example = literalExpression "with pkgs; [ jq yek ];"; + description = '' + Additional packages to install. + ''; + }; }; }; @@ -99,7 +107,7 @@ in { ''; }; in { - home.packages = mkIf cfg.enable [aichat-wrapped]; + home.packages = mkIf cfg.enable ([aichat-wrapped] ++ cfg.extraPackages); programs.fish.interactiveShellInit = mkIf cfg.enableFishIntegration fishIntegration; programs.bash.initExtra = mkIf cfg.enableBashIntegration bashIntegration;