#!/bin/bash if [ $# -lt 2 ]; then echo "Usage: bash chat_completion.sh [] []" exit 1 fi ENDPOINT="http://localhost:8000/v1/chat/completions" MODEL_NAME="$1" MAX_TOKENS="$2" TEMPERATURE="${3:-1.0}" # Default temperature is 1.0 if not provided STOP_SEQUENCE="${4:-\\n###}" # Default stop sequence is '\n###' if not provided echo "Enter your conversation ('q' to quit):" CONVERSATION="" while true; do read -p "You: " USER_INPUT if [ "$USER_INPUT" == "q" ]; then echo "Exiting..." exit 0 fi # Append user input to the conversation CONVERSATION="$CONVERSATION\n### Human: $USER_INPUT" DATA=$(cat <