main: bail at startup if we don't have an openai api key
This commit is contained in:
@@ -509,6 +509,12 @@ enum AudioRecordRequest {
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
color_eyre::install().unwrap();
|
||||
|
||||
if option_env!("OPENAI_API_KEY").is_none() {
|
||||
eprintln!("Error: OPENAI_API_KEY environment variable not set. The application will not function without it.");
|
||||
return;
|
||||
}
|
||||
|
||||
let mut terminal: Terminal<CrosstermBackend<std::io::Stdout>> = ratatui::init();
|
||||
|
||||
let (prediction_in, mut prediction_out) = tokio::sync::watch::channel(None);
|
||||
|
||||
Reference in New Issue
Block a user