- DEBUG =
set do
description 'Enable debugging for chat client'
decode { _1.to_i == 1 }
default 0
end
- MODEL =
set do
description 'Default model to use for the chat'
default 'llama3.1'
end
- SYSTEM =
set do
description 'Default system prompt'
end
- COLLECTION =
set do
description 'Default collection for embeddings'
end
- HISTORY =
set do
description 'File to save the chat history in'
default XDG_STATE_HOME + 'history.jsonl'
end
- USER =
set do
description '(Full) Name of the chat user'
default { ENV['USER'] }
end
- TTS_URL =
set do
description 'Base URL for the TTS (Text-to-Speech) service'
default 'http://localhost:8880'
required true
sensitive true
decode { URI.parse(_1) if _1.present? }
check { value.scheme =~ /\Ahttps?\z/ }
end
- AUDIO_PLAYER_CONFIG =
set do
description <<~EOT
Audio player configuration (JSON with four keys):
command – Shell command that receives raw PCM on stdin.
Opened via IO.popen(cmd, "w"); the playback thread
writes audio bytes and silence chunks to its stdin.
Default: ffplay s16le 24 kHz mono pipe.
frequency – Sample rate in Hz (e.g. 24000). Used to compute
the byte size of silence chunks: frequency ×
(bits / 8) × pause.
bits – Bit depth per sample (e.g. 16). Determines bytes
per sample for silence chunk calculation.
pause – Seconds of silence injected when the audio queue
is empty. Prevents the playback process from
seeing EOF and hanging. Also the sleep duration
between silence writes.
EOT
default <<~EOT
{
"command": "ffplay -autoexit -nodisp -loglevel quiet -vn -volume 80 -f s16le -ar 24000 -ch_layout mono -i -",
"frequency": 24000,
"bits": 16,
"pause": 0.01
}
EOT
decode json
check { value.command && value.frequency && value.bits && value.pause if value.present? }
end