MCPcopy Create free account
hub / github.com/ZyphrZero/z.ai2api_python / _build_request_variables

Method _build_request_variables

app/core/upstream.py:639–651  ·  view source on GitHub ↗

构建上游请求需要的运行时变量。

(self)

Source from the content-addressed store, hash-verified

637 }
638
639 def _build_request_variables(self) -> Dict[str, str]:
640 """构建上游请求需要的运行时变量。"""
641 now = datetime.now()
642 return {
643 "{{USER_NAME}}": "Guest",
644 "{{USER_LOCATION}}": "Unknown",
645 "{{CURRENT_DATETIME}}": now.strftime("%Y-%m-%d %H:%M:%S"),
646 "{{CURRENT_DATE}}": now.strftime("%Y-%m-%d"),
647 "{{CURRENT_TIME}}": now.strftime("%H:%M:%S"),
648 "{{CURRENT_WEEKDAY}}": now.strftime("%A"),
649 "{{CURRENT_TIMEZONE}}": DEFAULT_TIMEZONE,
650 "{{USER_LANGUAGE}}": DEFAULT_LANGUAGE,
651 }
652
653 def _build_browser_query_params(
654 self,

Callers 2

transform_requestMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected