GitRJAA / ask

ask is a Python script intended for use at the command line in order to ask the OpenAI API a question, optionally including an image, and have the response read aloud by either fast local TTS or the ElevenLabs API.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ask

ask is a very simple Python script intended to be used at the command line in order to ask the OpenAI API a question, optionally including an image, and then have the response realistically read by a voice from ElevenLabs.

As written, it expects my_env.py in your home directory; its contents defining API keys as follows:

API_KEY_OPENAI = '<insert_your_OpenAI_API_key_here>'
API_KEY_ELEVENLABS = '<insert_your_ElevenLabs_API_key_here>'

Example installation:

sudo apt install portaudio-dev19
git clone https://github.com/KF-R/ask
cd ask
pip install -r requirements.txt
chmod +x ask.py
mv ask.py ~/.local/bin/ask

Usage

usage: ask [-h] [-l] [-i IMAGE_PATH] [-s | -v VOICE | -q QUERY] [prompt]

ask v0.4 Query OpenAI with an optional image and a prompt.

positional arguments:
  prompt                The prompt for the query

options:
  -h, --help            show this help message and exit
  -l, --list            Display a list of valid speaker names
  -i IMAGE_PATH, --image_path IMAGE_PATH
                        The path to the either a local image file or http(s) URL (optional)
  -s, --silent          Do not use speech
  -v VOICE, --voice VOICE
                        Specify a speaker by name
  -q QUERY, --query QUERY
                        Query speaker details by name

About

ask is a Python script intended for use at the command line in order to ask the OpenAI API a question, optionally including an image, and have the response read aloud by either fast local TTS or the ElevenLabs API.

License:The Unlicense


Languages

Language:Python 100.0%