feat: show AI progress and configure prompt directory
This commit is contained in:
@@ -168,6 +168,14 @@ def _parse_elevenlabs_config(raw: Any) -> ElevenLabsConfig:
|
||||
def _parse_ai_config(raw: Any) -> AiConfig:
|
||||
raw_config = _parse_mapping(raw, field_name="ai")
|
||||
|
||||
raw_prompt_dir = raw_config.get("prompt_dir", "prompts")
|
||||
prompt_dir_value = str(raw_prompt_dir).strip()
|
||||
if os.environ.get("AI_PROMPT_DIR") is not None:
|
||||
prompt_dir_value = os.environ["AI_PROMPT_DIR"].strip()
|
||||
if not prompt_dir_value:
|
||||
raise ValueError("ai.prompt_dir is required")
|
||||
prompt_dir = Path(prompt_dir_value).expanduser()
|
||||
|
||||
def parse_provider(
|
||||
name: str,
|
||||
*,
|
||||
@@ -286,6 +294,7 @@ def _parse_ai_config(raw: Any) -> AiConfig:
|
||||
return AiConfig(
|
||||
glm=glm,
|
||||
deepseek=deepseek,
|
||||
prompt_dir=prompt_dir,
|
||||
max_context_messages=max_context_messages,
|
||||
max_media_bytes=max_media_bytes,
|
||||
max_tool_rounds=max_tool_rounds,
|
||||
@@ -439,7 +448,9 @@ def load_app_config(root: Path) -> AppConfig:
|
||||
|
||||
elevenlabs = _parse_elevenlabs_config(raw.get("elevenlabs"))
|
||||
ai = _parse_ai_config(raw.get("ai"))
|
||||
ai.prompt_dir = root / "prompts"
|
||||
if not ai.prompt_dir.is_absolute():
|
||||
ai.prompt_dir = root / ai.prompt_dir
|
||||
ai.prompt_dir = ai.prompt_dir.resolve()
|
||||
ai.base_dir = root
|
||||
|
||||
if not accounts:
|
||||
|
||||
Reference in New Issue
Block a user