mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-02 12:05:54 +00:00
21 lines
506 B
Python
21 lines
506 B
Python
import os
|
|
import sys
|
|
|
|
|
|
def get_platform() -> str:
|
|
"""获取当前平台"""
|
|
# 检查是不是在 docker 里
|
|
|
|
DOCKER_ENV = os.environ.get('DOCKER_ENV', 'false')
|
|
|
|
if os.path.exists('/.dockerenv') or DOCKER_ENV == 'true':
|
|
return 'docker'
|
|
|
|
return sys.platform
|
|
|
|
|
|
def use_websocket_to_connect_plugin_runtime() -> bool:
|
|
"""是否使用 websocket 连接插件运行时"""
|
|
STANDALONE_RUNTIME = os.environ.get('STANDALONE_RUNTIME', 'false')
|
|
return STANDALONE_RUNTIME == 'true'
|