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

optimize ai gateway script #127

Merged
merged 1 commit into from
Jan 17, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions all-in-one/get-ai-gateway.sh
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ resetEnv() {
LLM_ENVS=()
}

# Configuration wizard
runConfigWizard() {
echo "Provide a key for each LLM provider you want to enable, then press Enter."
echo "If no key is provided and Enter is pressed, configuration for that provider will be skipped."
Expand Down Expand Up @@ -185,15 +186,14 @@ runConfigWizard() {
i+=1
echo "${i}. ${mark}${providerName}"
done
read -r -p "Please choose an LLM service provider to configure (1~$i, 0 to break): " selectedIndex
read -r -p "Please choose an LLM service provider to configure (1~$i, press Enter alone to break): " selectedIndex

case $selectedIndex in
'' | *[!0-9]*) ;;
'') break ;; # Breaks the loop if the input is an empty string
*[!0-9]*) ;; # Handles invalid input where characters are non-numeric
*)
selectedIndex=$((selectedIndex))
if [ $selectedIndex -eq 0 ]; then
break
elif [ $selectedIndex -gt $i ]; then
if [ $selectedIndex -gt $i ]; then
echo "Incorrect option number."
else
local provider=${providers[$selectedIndex - 1]}
Expand Down
Loading