forked from trpc-group/trpc-agent-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
29 lines (24 loc) · 1.1 KB
/
Copy pathconfig.py
File metadata and controls
29 lines (24 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Tencent is pleased to support the open source community by making tRPC-Agent-Python available.
#
# Copyright (C) 2026 Tencent. All rights reserved.
#
# tRPC-Agent-Python is licensed under Apache-2.0.
""" Agent config module"""
import os
def get_model_config() -> tuple[str, str, str]:
"""Get model config from environment variables"""
api_key = os.getenv('TRPC_AGENT_API_KEY', '')
url = os.getenv('TRPC_AGENT_BASE_URL', '')
model_name = os.getenv('TRPC_AGENT_MODEL_NAME', '')
if not api_key or not url or not model_name:
raise ValueError('''TRPC_AGENT_API_KEY, TRPC_AGENT_BASE_URL,
and TRPC_AGENT_MODEL_NAME must be set in environment variables''')
return api_key, url, model_name
def get_mempalace_config() -> dict:
"""Get MemPalace tool configuration from environment variables."""
return {
"palace_path": os.getenv("MEMPALACE_PALACE_PATH") or None,
"kg_path": os.getenv("MEMPALACE_KG_PATH") or None,
"wing": os.getenv("MEMPALACE_WING", "personal_assistant_alice"),
"room": os.getenv("MEMPALACE_ROOM", "user_profile"),
}