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

keep TUI open and continue conversation #197

Open
caarlos0 opened this issue Jan 22, 2024 · 2 comments
Open

keep TUI open and continue conversation #197

caarlos0 opened this issue Jan 22, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@caarlos0
Copy link
Member

No description provided.

@caarlos0 caarlos0 added the enhancement New feature or request label Jan 22, 2024
@caarlos0 caarlos0 self-assigned this Jan 22, 2024
@sheldonhull
Copy link

That would be cool!

In the meantime for folks that want to piece it together I use this:

ai () {
        mods "$(gum write --char-limit=0 --placeholder='what do you want to ask the AI overlords?')"
}

aicc () {
	mods --continue-last "$(gum write --char-limit=0 --placeholder='what do you want to ask the AI overlords?')"
}

aipickbackup() {
conversationID=$(mods --list | gum filter | awk '{print $1}')
mods --continue $conversationID "$(gum write --placeholder='more to add?')"
}

YMMV, but maybe useful for anyone wanting to see practical way to use it.

@caarlos0 caarlos0 mentioned this issue Mar 1, 2024
@caarlos0 caarlos0 pinned this issue Mar 1, 2024
@ansemjo
Copy link

ansemjo commented Aug 13, 2024

I wrote myself another one:

# enter an interactive chat conversation using mods
chat() {
  # pick a model alias from your config
  model=$(yq -r .apis[].models[].aliases[0] ~/.config/mods/mods.yml \
    | gum choose --height 8 --header "Pick model to chat with:" --no-show-help)
  if [[ -z $model ]]; then
    gum format "  :pensive:  cancelled, no model picked." -t emoji
    return 1
  fi
  # first invocation starts a new conversation
  mods --model "$model" --prompt-args || return $?
  # after that enter a loop until user quits
  while mods --model "$model" --prompt-args --continue-last; do :; done
  return $?;
}

The model choice uses the first items from all models' aliases fields, so I suggest you prune your config and remove any providers and models that you don't want to see in this list. Or, you know, just hardcode it.

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

No branches or pull requests

3 participants