Skip to content

Commit

Permalink
Update config version and parse options.json in websocket.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
oleander committed Jan 31, 2024
1 parent 686bdf3 commit 736fca0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion config.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
---
version: 1.0.10
version: 1.0.11
slug: linus
name: Linus
description: Linus OpenAI pipeline
url: https://github.com/oleander/ha-openai-rs
arch: [amd64]
init: false
options:
openai_api_key: random_value
schema:
openai_api_key: string
ports:
Expand Down
4 changes: 4 additions & 0 deletions src/bin/websocket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ async fn main() {
tools.push(tool);
}

// read /data/options.json as json
let options = std::fs::read_to_string("/data/options.json").expect("Error reading options");
let options: serde_json::Value = serde_json::from_str(&options).expect("Error parsing options");
println!("Loaded options: {}", options);
println!("Loaded {} tools", tools.len());
println!("Supervisor token: {}", *shared::SUPERVISOR_TOKEN);
println!("OpenAi API key: {}", *shared::OPENAI_API_KEY);
Expand Down

0 comments on commit 736fca0

Please sign in to comment.