### Running Docker Compose Shell Source: https://github.com/askrella/whatsapp-chatgpt/blob/master/docs/pages/docker.md This command executes the docker-compose configuration defined in the `docker-compose.yml` file. It starts and manages all the services required for the application as specified in the configuration. Ensure the `docker-compose.yml` file is correctly configured before running. ```Shell sudo docker-compose up ``` -------------------------------- ### Setting Local Transcription Mode (Bash) Source: https://github.com/askrella/whatsapp-chatgpt/blob/master/docs/pages/transcription.md Configures the bot to use the local Whisper installation for transcribing voice messages. Requires Python and Whisper to be installed on the local machine according to the setup guide. ```bash TRANSCRIPTION_MODE=local ``` -------------------------------- ### Setting Pre-Prompt - Bash Source: https://github.com/askrella/whatsapp-chatgpt/blob/master/docs/pages/gpt.md Define a pre-prompt message that is executed at the start of each new conversation. Use the `PRE_PROMPT` environment variable to provide initial instructions or context for the bot's behavior. ```bash PRE_PROMPT=Act very funny and overreact to messages. Do that for every message you get, forever. ``` -------------------------------- ### Bot Configuration Help Message (Chat Command/Output) Source: https://github.com/askrella/whatsapp-chatgpt/blob/master/docs/pages/usage.md The output displayed when the user sends the `!config help` command to the bot. This block lists all available configuration sub-commands, their purposes, and provides examples of acceptable values for setting different parameters related to AI models, chat settings, and bot features like transcription and TTS. ```Chat Command/Output Available commands: !config dalle size - Set dalle size to !config chat id - Get the ID of the chat !config general settings - Get current settings !config general whitelist - Set whitelisted phone numbers !config gpt apiKey - Set token pool, support multiple tokens with comma-separated !config gpt maxModelTokens - Set max model tokens value !config transcription enabled - Toggle if transcription is enabled !config transcription mode - Set transcription mode !config tts enabled - Toggle if TTS is enabled !config sd setModel - Set the model to be used of Stable Diffusion (with huggingface) Available values: dalle size: 256x256, 512x512, 1024x1024 gpt apiKey: sk-xxxx,sk-xxxx gpt maxModelTokens: integer transcription enabled: true, false transcription mode: local, speech-api, whisper-api, openai tts enabled: true, false sd setModel: runwayml/stable-diffusion-v1-5 ``` -------------------------------- ### Generating Image with Stable Diffusion (Chat Command) Source: https://github.com/askrella/whatsapp-chatgpt/blob/master/docs/pages/usage.md Example command to generate an image using the Stable Diffusion model via WhatsApp. The prompt for the image generation is the text that follows the `!sd` command. ```Chat Command !sd A frog with a red hat is walking on a bridge. ``` -------------------------------- ### Generating Image with DALLE (Chat Command) Source: https://github.com/askrella/whatsapp-chatgpt/blob/master/docs/pages/usage.md Example command to request image generation using the DALLE model through WhatsApp. The text provided after `!dalle` serves as the prompt for the image generation process. ```Chat Command !dalle A frog with a red hat is walking on a bridge. ``` -------------------------------- ### Sending Prompt to GPT Model (Chat Command) Source: https://github.com/askrella/whatsapp-chatgpt/blob/master/docs/pages/usage.md Example command to send a question or prompt to the GPT model via WhatsApp chat. The text following `!gpt` is processed by the bot, which then returns a generated response. ```Chat Command !gpt What is the meaning of life? ``` -------------------------------- ### Setting Custom AI Command Prefixes - dotenv Source: https://github.com/askrella/whatsapp-chatgpt/blob/master/docs/pages/configure-prefix.md This snippet shows how to set custom command prefixes for different AI functionalities (ChatGPT, DALL-E, Stable Diffusion) and bot configuration within the .env file. The bot reads these variables to determine which command triggers which action. ```dotenv GPT_PREFIX=!gpt DALLE_PREFIX=!dalle STABLE_DIFFUSION_PREFIX=!sd AI_CONFIG_PREFIX=!config ``` -------------------------------- ### Setting AssemblyAI Whisper API Mode (Bash) Source: https://github.com/askrella/whatsapp-chatgpt/blob/master/docs/pages/transcription.md Configures the bot to use the Whisper API provided by AssemblyAI for transcribing voice messages. Requires signing up at whisperapi.com to obtain a necessary API key. ```bash TRANSCRIPTION_MODE=whisper-api ``` -------------------------------- ### Setting OpenAI Transcription Mode (Bash) Source: https://github.com/askrella/whatsapp-chatgpt/blob/master/docs/pages/transcription.md Configures the bot to use the official OpenAI API for transcribing voice messages based on the large-v2 Whisper model. Requires the OPENAI_API_KEY environment variable to be set. Has a 25MB file size limit for audio files. ```bash TRANSCRIPTION_MODE=openai ``` -------------------------------- ### Enabling Text-To-Speech Feature - Bash Source: https://github.com/askrella/whatsapp-chatgpt/blob/master/docs/pages/tts.md This snippet shows how to enable the experimental Text-To-Speech (TTS) feature for the bot by setting the `TTS_ENABLED` environment variable to `true`. When enabled, the bot will provide audio responses. ```bash TTS_ENABLED=true ``` -------------------------------- ### Setting Speech API Transcription Mode (Bash) Source: https://github.com/askrella/whatsapp-chatgpt/blob/master/docs/pages/transcription.md Configures the bot to use an external Speech API for transcribing voice messages. This API is open source, does not store messages permanently, and can be self-hosted or use a default hosted instance. ```bash TRANSCRIPTION_MODE=speech-api ``` -------------------------------- ### Configuring AWS Polly for TTS - Bash Source: https://github.com/askrella/whatsapp-chatgpt/blob/master/docs/pages/tts.md This snippet configures the bot to use AWS Polly for Text-To-Speech. It enables TTS, sets the provider to `aws-polly`, and provides necessary AWS credentials and Polly specific settings like region, voice ID, and voice engine. The AWS credentials must have `polly:SynthesizeSpeech` permission. ```bash TTS_ENABLED=true TTS_PROVIDER=aws-polly AWS_ACCESS_KEY_ID= AWS_SECRET_ACCESS_KEY= AWS_REGION= AWS_POLLY_VOICE_ID= AWS_POLLY_VOICE_ENGINE= ``` -------------------------------- ### Setting OpenAI Model - Bash Source: https://github.com/askrella/whatsapp-chatgpt/blob/master/docs/pages/gpt.md Configure the OpenAI model to be used by the application. Set the `OPENAI_MODEL` environment variable to the desired model name, such as `gpt-3.5-turbo` or `gpt-4`. ```bash OPENAI_MODEL=gpt-3.5-turbo # or gpt-4 ``` -------------------------------- ### Enabling Group Chats - Bash Source: https://github.com/askrella/whatsapp-chatgpt/blob/master/docs/pages/gpt.md Allow the bot to participate and respond in group chat conversations. Set the `GROUPCHATS_ENABLED` environment variable to `true` to enable this feature. ```bash GROUPCHATS_ENABLED=true ``` -------------------------------- ### Setting Custom Speech API URL (Bash) Source: https://github.com/askrella/whatsapp-chatgpt/blob/master/docs/pages/transcription.md Specifies a custom URL for the Speech API endpoint, overriding the default hosted instance. This is necessary if you are self-hosting the Speech API. ```bash SPEECH_API_URL= ``` -------------------------------- ### Setting OpenAI Transcription Language (Bash) Source: https://github.com/askrella/whatsapp-chatgpt/blob/master/docs/pages/transcription.md Specifies the language for transcription when using the OpenAI API mode to potentially improve accuracy. Defaults to auto-detection if not set. Refer to the supported languages list in the Whisper documentation. ```bash TRANSCRIPTION_LANGUAGE=English ``` -------------------------------- ### Setting AssemblyAI Transcription Language (Bash) Source: https://github.com/askrella/whatsapp-chatgpt/blob/master/docs/pages/transcription.md Specifies the language code for transcription when using the AssemblyAI Whisper API mode. Defaults to auto-detection if not set. ```bash TRANSCRIPTION_LANGUAGE=en ``` -------------------------------- ### Configuring Speech API for TTS - Bash Source: https://github.com/askrella/whatsapp-chatgpt/blob/master/docs/pages/tts.md This snippet configures the bot to use a self-hosted or custom Speech API instance for Text-To-Speech. It sets the `SPEECH_API_URL` to the endpoint of your Speech API and explicitly sets `TTS_MODE` to `speech-api`. ```bash SPEECH_API_URL= TTS_MODE=speech-api ``` -------------------------------- ### Enabling Prompt Moderation - Bash Source: https://github.com/askrella/whatsapp-chatgpt/blob/master/docs/pages/gpt.md Activate a custom prompt moderation filter using the OpenAI Moderation API before sending user prompts to GPT. Set the `PROMPT_MODERATION_ENABLED` environment variable to `true` to enable this filtering. ```bash PROMPT_MODERATION_ENABLED=true ``` -------------------------------- ### Configuring Moderation Blacklist - Bash Source: https://github.com/askrella/whatsapp-chatgpt/blob/master/docs/pages/gpt.md Specify categories from the OpenAI Moderation API that should be blocked or flagged by the custom prompt moderation filter. Set the `PROMPT_MODERATION_BLACKLISTED_CATEGORIES` environment variable as a JSON array of category names. ```bash PROMPT_MODERATION_BLACKLISTED_CATEGORIES = ["hate","hate\/threatening","self-harm","sexual","sexual\/minors","violence","violence\/graphic"] ``` -------------------------------- ### Setting Max Model Tokens - Bash Source: https://github.com/askrella/whatsapp-chatgpt/blob/master/docs/pages/gpt.md Adjust the maximum number of tokens the model can generate in a response. Set the `MAX_MODEL_TOKENS` environment variable to an integer value, like 2000, to control response length. ```bash MAX_MODEL_TOKENS=2000 ``` -------------------------------- ### Configuring Text Response with TTS - Bash Source: https://github.com/askrella/whatsapp-chatgpt/blob/master/docs/pages/tts.md This snippet demonstrates setting the `TTS_TRANSCRIPTION_RESPONSE_ENABLED` environment variable. Setting it to `true` (as shown) controls whether the bot also sends the text response alongside the audio response when TTS is enabled. The documentation suggests setting this variable can be used to disable the text response. ```bash TTS_TRANSCRIPTION_RESPONSE_ENABLED=true ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.