diff options
| -rw-r--r-- | dotfiles/fish/conf.d/ai.fish | 18 | ||||
| -rwxr-xr-x | dotfiles/scripts/aimodel | 23 |
2 files changed, 18 insertions, 23 deletions
diff --git a/dotfiles/fish/conf.d/ai.fish b/dotfiles/fish/conf.d/ai.fish index 4e89bbb..f11a642 100644 --- a/dotfiles/fish/conf.d/ai.fish +++ b/dotfiles/fish/conf.d/ai.fish @@ -3,3 +3,21 @@ abbr -a gpti "chatgpt --interactive" abbr -a suggest 'gh copilot suggest' abbr -a explain 'gh copilot explain' abbr -a aic 'aichat -e' + +function aimodels + set -l NVIM_DIR "$HOME/.config/nvim/" + set -l COPILOT_CHAT_DIR "$NVIM_DIR/pack/copilotchat/start/CopilotChat.nvim/lua/CopilotChat" + + printf "gpt-4o\ngpt-4.1\nclaude-3.7-sonnet\nclaude-3.7-sonnet-thought\n" >~/.aimodels + set -gx COPILOT_MODEL (cat ~/.aimodels | fzf) + + if test -d $COPILOT_CHAT_DIR + set -l model_config "$COPILOT_CHAT_DIR/config-$COPILOT_MODEL.lua" + if test -f "$model_config" + echo "Using CopilotChat config from $model_config" + cp -v $model_config "$COPILOT_CHAT_DIR/config.lua" + else + echo "No config found at $model_config" + end + end +end diff --git a/dotfiles/scripts/aimodel b/dotfiles/scripts/aimodel deleted file mode 100755 index 5352248..0000000 --- a/dotfiles/scripts/aimodel +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env zsh - -declare -r NVIM_DIR="$HOME/.config/nvim/" -declare -r COPILOT_CHAT_DIR="$NVIM_DIR/pack/copilotchat/start/CopilotChat.nvim/lua/CopilotChat" - -cat <<END >~/.aimodels -gpt-4o -gpt-4.1 -claude-3.7-sonnet -claude-3.7-sonnet-thought -END -declare -r COPILOT_MODEL="$(cat ~/.aimodels | fzf)" - -if [ -d $COPILOT_CHAT_DIR ]; then - local model_config="$COPILOT_CHAT_DIR/config-$COPILOT_MODEL.lua" - if [ -f "$model_config" ]; then - echo "Using CopilotChat config from $model_config" - cp -v $model_config "$COPILOT_CHAT_DIR/config.lua" - else - echo "No config found at $model_config" - fi -fi - |
