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

Function get_user_agent_instance

app/utils/user_agent.py:17–22  ·  view source on GitHub ↗

获取或创建 UserAgent 实例(单例模式)

()

Source from the content-addressed store, hash-verified

15
16
17def get_user_agent_instance() -> UserAgent:
18 """获取或创建 UserAgent 实例(单例模式)"""
19 global _user_agent_instance
20 if _user_agent_instance is None:
21 _user_agent_instance = UserAgent()
22 return _user_agent_instance
23
24
25def get_random_user_agent(browser_type: Optional[str] = None) -> str:

Callers 1

get_random_user_agentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected