personal memory agent
0

Configure Feed

Select the types of activity you want to include in your feed.

solstone / tests / test_voice_config.py
1.3 kB 43 lines
1# SPDX-License-Identifier: AGPL-3.0-only 2# Copyright (c) 2026 sol pbc 3 4from __future__ import annotations 5 6from solstone.think.voice import config 7 8 9def test_voice_config_defaults(monkeypatch): 10 monkeypatch.setattr(config, "get_config", lambda: {"agent": {"name": "sol"}}) 11 monkeypatch.delenv("OPENAI_API_KEY", raising=False) 12 13 assert config.get_openai_api_key() is None 14 assert config.get_voice_model() == "gpt-realtime" 15 assert config.get_brain_model() == "haiku" 16 17 18def test_voice_config_prefers_journal_key(monkeypatch): 19 monkeypatch.setattr( 20 config, 21 "get_config", 22 lambda: { 23 "voice": { 24 "openai_api_key": "sk-config", 25 "model": "gpt-realtime-mini", 26 "brain_model": "sonnet", 27 } 28 }, 29 ) 30 monkeypatch.setenv("OPENAI_API_KEY", "sk-env") 31 32 assert config.get_openai_api_key() == "sk-config" 33 assert config.get_voice_model() == "gpt-realtime-mini" 34 assert config.get_brain_model() == "sonnet" 35 36 37def test_voice_config_falls_back_to_env(monkeypatch): 38 monkeypatch.setattr( 39 config, "get_config", lambda: {"voice": {"openai_api_key": " "}} 40 ) 41 monkeypatch.setenv("OPENAI_API_KEY", "sk-env") 42 43 assert config.get_openai_api_key() == "sk-env"