13 lines
464 B
Python
13 lines
464 B
Python
"""Explicit chat-only provider compatibility, without exposing reasoning as answers."""
|
|
import os
|
|
|
|
|
|
def chat_model_options():
|
|
mode = os.getenv("CHAT_THINKING_MODE", "").strip().lower()
|
|
if mode not in ("", "disabled", "enabled"):
|
|
raise ValueError("CHAT_THINKING_MODE 只允许 disabled、enabled 或留空")
|
|
options = {"timeout": 60, "max_retries": 0}
|
|
if mode:
|
|
options["extra_body"] = {"thinking": {"type": mode}}
|
|
return options
|