Merge pull request 'fix: remove hardcoded LAN IP from default base_url (closes #5)' (#15) from fix/issue-5 into main
Reviewed-on: https://git.home.ms/jarianc/Clover/pulls/15
This commit is contained in:
commit
0fff7aaf42
@ -29,7 +29,9 @@ def load_config():
|
|||||||
"threads": int(os.getenv("CLOVER_THREADS", "5")),
|
"threads": int(os.getenv("CLOVER_THREADS", "5")),
|
||||||
"model": os.getenv("CLOVER_MODEL", "qwen3-coder:30b"),
|
"model": os.getenv("CLOVER_MODEL", "qwen3-coder:30b"),
|
||||||
"api_key": os.getenv("CLOVER_API_KEY"),
|
"api_key": os.getenv("CLOVER_API_KEY"),
|
||||||
"base_url": os.getenv("CLOVER_BASE_URL", "http://192.168.8.223:11434"),
|
"base_url": os.getenv(
|
||||||
|
"CLOVER_BASE_URL", "error-set-CLOVER_BASE_URL-in-.env-file"
|
||||||
|
),
|
||||||
"debug": os.getenv("CLOVER_DEBUG", "false").lower() == "true",
|
"debug": os.getenv("CLOVER_DEBUG", "false").lower() == "true",
|
||||||
"verbose": os.getenv("CLOVER_VERBOSE", "false").lower() == "true",
|
"verbose": os.getenv("CLOVER_VERBOSE", "false").lower() == "true",
|
||||||
"cache_enabled": os.getenv("CLOVER_CACHE_ENABLED", "true").lower() == "true",
|
"cache_enabled": os.getenv("CLOVER_CACHE_ENABLED", "true").lower() == "true",
|
||||||
@ -205,8 +207,12 @@ def validate_config():
|
|||||||
issues = []
|
issues = []
|
||||||
|
|
||||||
# Check required settings
|
# Check required settings
|
||||||
if not config.get("base_url"):
|
base_url = config.get("base_url", "")
|
||||||
issues.append("base_url is required")
|
if not base_url or base_url.startswith("error-set-"):
|
||||||
|
issues.append(
|
||||||
|
"CLOVER_BASE_URL is not set. Set it in your .env file or environment. "
|
||||||
|
"Example: CLOVER_BASE_URL=http://localhost:11434"
|
||||||
|
)
|
||||||
|
|
||||||
# Check numeric values
|
# Check numeric values
|
||||||
try:
|
try:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user