Files
doubao-clone/android/kernel/speech.py
l e693b84e2e 语音加 V3(只要一个 API Key)+ 各控制台快捷入口 + 对话支持 Markdown
【语音 V3:用户要的"一个 Key 搞定"那条路】
之前我给的方案是 V1(AppID + Access Token),用户问"不是只要 api key 就行了吗"——
他是对的。查官方文档确认 V3 用 X-Api-Key,不用 appid:
  https://docs.volcengine.com/docs/DoubaoVoice/APIKeyUsage

实测踩到两个坑,都已写进注释:
  1. 路径不能带 plan。/api/v3/plan/tts/unidirectional 是方舟 Agent Plan 专用,
     语音控制台的 Key 打过去 401;/api/v3/tts/unidirectional 才通(返回真 MP3)。
  2. 普通**方舟** Key 也不行,会回 `acquire failed err:call ark 401` ——
     必须是语音控制台「API Key 管理」里建的那个。
三个 Key 逐个测过,结论写进了错误提示里,用户一看就知道该去哪儿拿。

V3 音色是另一套命名(zh_female_vv_uranus_bigtts),和 V1 的 BVxxx 完全不通用。
8 个音色实测都能合成,名字照官方音色列表核对。

【各控制台快捷入口】
设置页每个提供商下面多一行「去 XX 申请 API Key ↗」,语音卡片同理。
地址放在内核的一张表里(PROVIDER_CONSOLE_URLS / SPEECH_CONSOLE_URLS)而不是
写死在界面:实测 Kimi 已经从 platform.moonshot.cn 迁到 platform.kimi.com,
集中一处以后好改。每个地址都访问核实过可达。

【对话 Markdown】
自写了个轻量渲染(零依赖是这个项目的既定约束):
块级支持代码块 / 标题 / 列表 / 引用 / 分隔线,行内支持粗体斜体行内码链接删除线。
只对助手回复渲染 —— 用户输入里的 `2 * 3 * 4` 会被当成斜体,显示得和打的不一样。

【验收】
verify-speech.mjs 扩到 36 项,含 V3 音色表、命名不混用、控制台链接下发。
Node 与 Python 两份内核对拍全过 —— 这轮就是靠它抓到 Node 侧漏了 VOLC_V3_SPEAKERS。

【豆包搜索:已调通接口,但需要先开通】
接口形状摸清了(POST /api/v3/responses + tools:[{"type":"web_search"}]),
用有效方舟 Key 实测返回 403 Access denied for web search,
需要在方舟控制台「应用组件库 > 豆包搜索」开通服务后才可用。开通后即可接入。
2026-10-09 16:28:55 +08:00

512 lines
21 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"""
语音:朗读(TTS)和语音识别(STT)。
对应 Node 版 server/src/speech.mjs,两份实现的请求体/返回字段逐字段一致。
为什么放在内核里而不是安卓端直接调:
1. API Key 只存一份(跟对话的 Key 放一起),安卓端拿不到也不该拿;
2. 电脑端的 Web/exe 版能白捡同一个能力(浏览器用 MediaRecorder 录音就行);
3. 厂商鉴权差异只在这一个文件里,界面侧只管"给我一段文字 / 给我一段音频"。
支持的引擎:
TTS
- 'volc' 火山语音合成(豆包同款音色)https://openspeech.bytedance.com/api/v1/tts
- 'openai' OpenAI 兼容的 /audio/speech(返回原始音频字节)
- 'system' 不调云端,交给设备自带的 TTS(安卓 TextToSpeech / 浏览器 speechSynthesis)
STT
- 'openai' OpenAI 兼容的 /audio/transcriptions(multipart)
- 'system' 交给设备自带的识别(安卓 SpeechRecognizer)
只用标准库:urllib 发请求;multipart 手拼(标准库没有现成的编码器)。
"""
import base64
import json
import os
import urllib.error
import urllib.request
import uuid
DEFAULT_TIMEOUT_TTS = 60
DEFAULT_TIMEOUT_STT = 120
# 允许用环境变量覆盖:自测时把火山接口指到本地 mock,就能验证"我们到底发了什么"
# (鉴权头那个分号、body 的层级,光看代码容易自我说服,实测才算数)
VOLC_TTS_URL = os.environ.get('DOUBAO_VOLC_TTS_URL') or 'https://openspeech.bytedance.com/api/v1/tts'
# 火山「豆包语音」V3 接口。★ 和 V1 是两套东西:
# V1 openspeech/api/v1/tts 鉴权:appid + access_token(Bearer; 分号)
# V3 openspeech/api/v3/tts/... 鉴权:**只要一个 API Key**(X-Api-Key)
# 用户问"不是只要 api key 就行了吗"——对,走的就是这条。
#
# ★ 注意路径里**没有 plan**:/api/v3/tts/unidirectional 才是语音控制台 API Key 能用的;
# /api/v3/plan/tts/unidirectional 是方舟 Agent Plan 专用,拿普通 Key 打会 401。
# 实测:同一个 Key,plan 路径 401、非 plan 路径 200 且返回真 MP3。
# 文档:https://docs.volcengine.com/docs/DoubaoVoice/APIKeyUsage
VOLC_V3_TTS_URL = os.environ.get('DOUBAO_VOLC_V3_TTS_URL') or \
'https://openspeech.bytedance.com/api/v3/tts/unidirectional'
VOLC_V3_RESOURCE_ID = 'seed-tts-2.0'
# 火山的 encoding -> MIME。文档里 mp3/wav/ogg_opus/pcm 是常用的几个
VOLC_MIME = {
'mp3': 'audio/mpeg',
'wav': 'audio/wav',
'ogg_opus': 'audio/ogg',
'pcm': 'audio/L16',
}
class SpeechError(Exception):
"""带用户可读原因的失败。界面直接把它显示出来,不用再猜。"""
def _settings_speech(settings: dict) -> dict:
speech = (settings or {}).get('speech')
return speech if isinstance(speech, dict) else {}
def _post_json(url: str, body: dict, headers: dict, timeout: int) -> dict:
data = json.dumps(body, ensure_ascii=False).encode('utf-8')
req = urllib.request.Request(url, data=data, method='POST')
req.add_header('Content-Type', 'application/json')
for k, v in headers.items():
req.add_header(k, v)
try:
with urllib.request.urlopen(req, timeout=timeout) as resp:
raw = resp.read()
except urllib.error.HTTPError as exc:
detail = ''
try:
detail = exc.read().decode('utf-8', 'replace')[:400]
except Exception: # noqa: BLE001
pass
raise SpeechError(f'HTTP {exc.code} {detail or exc.reason}') from exc
except urllib.error.URLError as exc:
raise SpeechError(f'连不上:{exc.reason}') from exc
try:
return json.loads(raw.decode('utf-8'))
except Exception as exc: # noqa: BLE001
raise SpeechError(f'返回不是 JSON:{raw[:200]!r}') from exc
# --------------------------------------------------------------------------- #
# 朗读
# --------------------------------------------------------------------------- #
def synthesize(text: str, settings: dict) -> dict:
"""
把文字合成为音频。
返回:
{'engine': 'system'} → 让设备自己念(没配云端时)
{'engine': 'volc'|'openai', 'mime': ..., 'audio': '<base64>'}
"""
content = (text or '').strip()
if not content:
raise SpeechError('没有要朗读的内容')
speech = _settings_speech(settings)
engine = (speech.get('ttsEngine') or 'system').lower()
speed = float(speech.get('ttsSpeed') or 1.0)
speed = min(max(speed, 0.2), 3.0)
if engine == 'volc':
return _synthesize_volc(content, speech, speed)
if engine == 'volcv3':
return _synthesize_volc_v3(content, speech, speed)
if engine == 'openai':
return _synthesize_openai(content, settings, speech, speed)
return {'engine': 'system'}
def _synthesize_volc_v3(text: str, speech: dict, speed: float) -> dict:
"""
豆包语音 V3 合成。
和 V1 的区别(用户最容易搞混的地方):
- **只要一个 API Key**(语音控制台 → API Key 管理里创建),不需要 AppID / Access Token;
- 音色是另一套命名:`zh_female_vv_uranus_bigtts`,不是 V1 的 `BV700_streaming`;
- 返回是**逐行 JSON**(NDJSON),每行一段 base64 音频,`code=20000000` 表示结束。
两个实测踩过的坑:
1. 路径别带 plan。`/api/v3/plan/...` 是方舟 Agent Plan 专用,普通语音 Key 打过去 401;
2. 普通**方舟** Key 也不行 —— 会回 `acquire failed err:call ark ... 401`。
必须是**语音控制台**里那个 API Key(console.volcengine.com/speech → API Key 管理)。
"""
api_key = (speech.get('volcApiKey') or '').strip()
speaker = (speech.get('ttsVoice') or '').strip() or 'zh_female_vv_uranus_bigtts'
fmt = (speech.get('volcEncoding') or 'mp3').strip() or 'mp3'
if fmt not in ('mp3', 'wav', 'ogg_opus', 'pcm'):
fmt = 'mp3'
if not api_key:
raise SpeechError(
'豆包语音 V3 需要一个 API Key:语音控制台 →(左侧)API Key → 创建 API Key。'
'注意不是方舟的 Key —— 方舟 Key 打这个接口会被判 401。'
)
body = {
'req_params': {
'text': text,
'speaker': speaker,
'audio_params': {
'format': fmt,
# 24k 是大模型音色的标准采样率,调低会明显发闷
'sample_rate': 24000,
# V3 的语速是 ±100 的百分比,不是倍率(实测 -50 变慢、+50 变快)
'speech_rate': int(round((speed - 1.0) * 100)),
},
},
}
data = json.dumps(body, ensure_ascii=False).encode('utf-8')
req = urllib.request.Request(VOLC_V3_TTS_URL, data=data, method='POST')
req.add_header('Content-Type', 'application/json')
req.add_header('X-Api-Key', api_key)
req.add_header('X-Api-Resource-Id', VOLC_V3_RESOURCE_ID)
req.add_header('X-Control-Require-Usage-Tokens-Return', '*')
try:
with urllib.request.urlopen(req, timeout=DEFAULT_TIMEOUT_TTS) as resp:
raw = resp.read()
except urllib.error.HTTPError as exc:
detail = ''
try:
detail = exc.read().decode('utf-8', 'replace')[:400]
except Exception: # noqa: BLE001
pass
raise SpeechError(f'HTTP {exc.code} {detail or exc.reason}') from exc
except urllib.error.URLError as exc:
raise SpeechError(f'连不上:{exc.reason}') from exc
# 逐行解析:每行一个 JSON,拼 data 里的音频片段
chunks = []
error = None
for line in raw.decode('utf-8', 'replace').splitlines():
line = line.strip()
if not line:
continue
try:
item = json.loads(line)
except Exception: # noqa: BLE001
continue
code = item.get('code', 0)
payload = item.get('data')
if isinstance(payload, str) and payload:
chunks.append(payload)
if code == 20000000:
break
if isinstance(code, int) and code > 0 and code != 20000000:
error = f'code={code} {item.get("message") or item.get("msg") or ""}'.strip()
break
if error:
raise SpeechError(f'火山 V3 失败:{error}')
if not chunks:
raise SpeechError('火山 V3 没返回音频数据')
return {'engine': 'volcv3', 'mime': VOLC_MIME.get(fmt, 'audio/mpeg'), 'audio': ''.join(chunks)}
def _synthesize_volc(text: str, speech: dict, speed: float) -> dict:
"""
火山语音合成。
两个容易踩的点(都对着官方文档和第三方实现核对过):
1. 鉴权头是 `Bearer;{token}` —— **分号,不是空格**。写成空格会被判鉴权失败;
2. 成功判定看 body 里的 `code == 3000`,HTTP 状态码是 200 也可能带错误码。
返回的 `data` 是**纯 base64**(不是 data URL),直接解出来就是音频字节。
"""
app_id = (speech.get('volcAppId') or '').strip()
token = (speech.get('volcToken') or '').strip()
cluster = (speech.get('volcCluster') or 'volcano_tts').strip() or 'volcano_tts'
voice = (speech.get('ttsVoice') or '').strip() or 'BV700_streaming'
encoding = (speech.get('volcEncoding') or 'mp3').strip() or 'mp3'
if not app_id or not token:
raise SpeechError('火山语音需要 App ID 和 Access Token(在火山控制台「语音技术」里创建应用后拿到)')
body = {
'app': {'appid': app_id, 'token': token, 'cluster': cluster},
'user': {'uid': 'doubao'},
'audio': {
'voice_type': voice,
'encoding': encoding,
'speed_ratio': speed,
'volume_ratio': 1.0,
'pitch_ratio': 1.0,
},
'request': {
'reqid': str(uuid.uuid4()),
'text': text,
'text_type': 'plain',
'operation': 'query',
},
}
result = _post_json(VOLC_TTS_URL, body, {'Authorization': f'Bearer;{token}'}, DEFAULT_TIMEOUT_TTS)
code = result.get('code')
if code != 3000:
raise SpeechError(f'火山返回 code={code} message={result.get("message") or result.get("Message") or "?"}')
data = result.get('data')
if not data:
raise SpeechError('火山没返回音频数据')
return {'engine': 'volc', 'mime': VOLC_MIME.get(encoding, 'audio/mpeg'), 'audio': data}
def _synthesize_openai(text: str, settings: dict, speech: dict, speed: float) -> dict:
"""OpenAI 兼容的 /audio/speech:POST 进去,直接吐音频字节(不是 JSON)。"""
api_key, base_url = _resolve_openai(settings, speech)
voice = (speech.get('ttsVoice') or '').strip() or 'alloy'
model = (speech.get('ttsModel') or '').strip() or 'tts-1'
fmt = (speech.get('openaiFormat') or 'mp3').strip() or 'mp3'
body = json.dumps({
'model': model,
'input': text,
'voice': voice,
'response_format': fmt,
'speed': speed,
}, ensure_ascii=False).encode('utf-8')
req = urllib.request.Request(f'{base_url}/audio/speech', data=body, method='POST')
req.add_header('Content-Type', 'application/json')
req.add_header('Authorization', f'Bearer {api_key}')
try:
with urllib.request.urlopen(req, timeout=DEFAULT_TIMEOUT_TTS) as resp:
raw = resp.read()
ctype = resp.headers.get('Content-Type') or 'audio/mpeg'
except urllib.error.HTTPError as exc:
detail = ''
try:
detail = exc.read().decode('utf-8', 'replace')[:400]
except Exception: # noqa: BLE001
pass
raise SpeechError(f'HTTP {exc.code} {detail or exc.reason}') from exc
except urllib.error.URLError as exc:
raise SpeechError(f'连不上:{exc.reason}') from exc
if not raw:
raise SpeechError('返回了空音频')
return {
'engine': 'openai',
'mime': ctype.split(';')[0].strip() or 'audio/mpeg',
'audio': base64.b64encode(raw).decode('ascii'),
}
# --------------------------------------------------------------------------- #
# 语音识别
# --------------------------------------------------------------------------- #
def transcribe(audio: bytes, filename: str, content_type: str, settings: dict) -> dict:
"""
把一段音频转成文字。
返回 {'engine': 'system'} 表示"交给设备自己的识别",
否则 {'engine': 'openai', 'text': '...'}。
"""
if not audio:
raise SpeechError('没有录到音频')
speech = _settings_speech(settings)
engine = (speech.get('sttEngine') or 'system').lower()
if engine != 'openai':
return {'engine': 'system'}
api_key, base_url = _resolve_openai(settings, speech)
model = (speech.get('sttModel') or '').strip() or 'whisper-1'
lang = (speech.get('sttLanguage') or '').strip()
fields = {'model': model}
if lang:
fields['language'] = lang
body, boundary = _multipart(fields, 'file', filename or 'audio.wav', content_type or 'audio/wav', audio)
req = urllib.request.Request(f'{base_url}/audio/transcriptions', data=body, method='POST')
req.add_header('Content-Type', f'multipart/form-data; boundary={boundary}')
req.add_header('Authorization', f'Bearer {api_key}')
try:
with urllib.request.urlopen(req, timeout=DEFAULT_TIMEOUT_STT) as resp:
raw = resp.read()
except urllib.error.HTTPError as exc:
detail = ''
try:
detail = exc.read().decode('utf-8', 'replace')[:400]
except Exception: # noqa: BLE001
pass
raise SpeechError(f'HTTP {exc.code} {detail or exc.reason}') from exc
except urllib.error.URLError as exc:
raise SpeechError(f'连不上:{exc.reason}') from exc
try:
result = json.loads(raw.decode('utf-8'))
except Exception as exc: # noqa: BLE001
raise SpeechError(f'返回不是 JSON:{raw[:200]!r}') from exc
text = (result.get('text') or '').strip()
if not text:
raise SpeechError('识别结果为空(可能是没人说话,或音频格式不对)')
return {'engine': 'openai', 'text': text}
def _multipart(fields: dict, file_field: str, filename: str, content_type: str, content: bytes):
"""
手拼 multipart/form-data。
为什么不用 requests:Chaquopy 里第三方库要额外打包,而标准库没有
multipart 编码器 —— 这个格式本身很简单,拼一遍就够了。
"""
boundary = f'----doubao{uuid.uuid4().hex}'
out = bytearray()
for key, value in fields.items():
out += f'--{boundary}\r\n'.encode()
out += f'Content-Disposition: form-data; name="{key}"\r\n\r\n'.encode()
out += f'{value}\r\n'.encode()
out += f'--{boundary}\r\n'.encode()
out += f'Content-Disposition: form-data; name="{file_field}"; filename="{filename}"\r\n'.encode()
out += f'Content-Type: {content_type}\r\n\r\n'.encode()
out += content
out += f'\r\n--{boundary}--\r\n'.encode()
return bytes(out), boundary
def _resolve_openai(settings: dict, speech: dict):
"""
取 OpenAI 兼容那套的 Key 和地址。
默认复用主对话的设置(同一个 Key 通常也能用语音接口);
也可以在 speech 里单独填,方便"对话用方舟、语音用 OpenAI"这种组合。
"""
api_key = (speech.get('openaiApiKey') or '').strip() or (settings or {}).get('apiKey') or ''
base_url = (speech.get('openaiBaseUrl') or '').strip() or (settings or {}).get('baseUrl') or ''
base_url = base_url.rstrip('/')
if not api_key:
raise SpeechError('没有 API Key(在设置里填,或在「语音」里单独指定)')
if not base_url:
raise SpeechError('没有 Base URL')
return api_key, base_url
def speech_state(settings: dict) -> dict:
"""给界面看的当前语音配置(脱敏)。"""
speech = _settings_speech(settings)
return {
'ttsEngine': speech.get('ttsEngine') or 'system',
'ttsVoice': speech.get('ttsVoice') or '',
'ttsSpeed': speech.get('ttsSpeed') or 1.0,
'autoRead': bool(speech.get('autoRead')),
'sttEngine': speech.get('sttEngine') or 'system',
'sttModel': speech.get('sttModel') or 'whisper-1',
'sttLanguage': speech.get('sttLanguage') or '',
'volcAppId': speech.get('volcAppId') or '',
'volcCluster': speech.get('volcCluster') or 'volcano_tts',
'volcEncoding': speech.get('volcEncoding') or 'mp3',
'hasVolcToken': bool(speech.get('volcToken')),
# V3 只要这一个 Key,所以界面按它判断"配没配"
'hasVolcApiKey': bool(speech.get('volcApiKey')),
'hasOpenaiKey': bool(speech.get('openaiApiKey') or (settings or {}).get('apiKey')),
'openaiBaseUrl': speech.get('openaiBaseUrl') or '',
'ttsModel': speech.get('ttsModel') or 'tts-1',
# 各家「申请语音 Key」的直达链接,界面上做成快捷入口。
# 这里放内核而不是写死在界面里:以后加厂商只改一处。
'consoleUrls': SPEECH_CONSOLE_URLS,
}
# 语音相关控制台的直达链接(都已访问核实可达)
SPEECH_CONSOLE_URLS = {
# V3:语音控制台 → API Key 管理。**这是"只要一个 API Key"那条路的入口**
'volcv3': 'https://console.volcengine.com/speech/new/setting/apikeys',
# V1:同一个控制台,但拿的是 AppID + Access Token(在「语音合成」应用详情里)
'volc': 'https://console.volcengine.com/speech/app',
'openai': 'https://platform.openai.com/api-keys',
# 方舟 Agent Plan:另一条能用 API Key 的路(和语音控制台不是一回事)
'agentPlan': 'https://ark.volcengine.com/region:cn-beijing/openManagement?advancedActiveKey=agentPlan',
}
# 默认值:Android 端 Kotlin 侧也用不到这个,但 Node/Python 必须一致
DEFAULT_SPEECH = {
'ttsEngine': 'system',
'ttsVoice': '',
'ttsSpeed': 1.0,
'autoRead': False,
'sttEngine': 'system',
'sttModel': 'whisper-1',
'sttLanguage': '',
'volcAppId': '',
'volcToken': '',
'volcApiKey': '', # V3 用的那个(语音控制台 → API Key 管理)
'volcCluster': 'volcano_tts',
'volcEncoding': 'mp3',
'openaiApiKey': '',
'openaiBaseUrl': '',
'ttsModel': 'tts-1',
}
# 常用音色。★ 名字全部照官方音色列表核对过:
# https://docs.volcengine.com/docs/DoubaoVoice/Tonelist
# 之前这份列表是按印象写的,实测 6 个里错了 4 个(BV701 其实叫「擎苍」不是「通用男声2」,
# BV138 是「情感女声-Lawrence」不是「沉稳男声」)。音色名是用户唯一的识别依据,
# 写错等于让人盲选,所以这里宁可少列几个也要列准。
VOLC_VOICES = [
{'value': 'BV700_streaming', 'label': '灿灿 · 通用女声(22 种情感,推荐)'},
{'value': 'BV700_V2_streaming', 'label': '灿灿 2.0(升级版)'},
{'value': 'BV001_streaming', 'label': '通用女声'},
{'value': 'BV001_V2_streaming', 'label': '通用女声 2.0'},
{'value': 'BV002_streaming', 'label': '通用男声'},
{'value': 'BV701_streaming', 'label': '擎苍 · 有声阅读'},
{'value': 'BV701_V2_streaming', 'label': '擎苍 2.0'},
{'value': 'BV705_streaming', 'label': '炀炀 · 自然对话'},
{'value': 'BV009_streaming', 'label': '知性女声'},
{'value': 'BV007_streaming', 'label': '亲切女声'},
{'value': 'BV123_streaming', 'label': '阳光青年'},
{'value': 'BV406_streaming', 'label': '超自然音色 · 梓梓'},
]
OPENAI_VOICES = [
{'value': 'alloy', 'label': 'alloy(中性)'},
{'value': 'nova', 'label': 'nova(女声,推荐)'},
{'value': 'shimmer', 'label': 'shimmer(女声,柔和)'},
{'value': 'echo', 'label': 'echo(男声)'},
{'value': 'onyx', 'label': 'onyx(男声,低沉)'},
{'value': 'fable', 'label': 'fable(叙述)'},
{'value': 'coral', 'label': 'coral(女声,明快)'},
{'value': 'sage', 'label': 'sage(女声,沉稳)'},
]
# V3(大模型音色)的 speaker。★ 名字照官方「音色列表」核对过。
# 这一套和 V1 的 BVxxx 完全不通用 —— 拿 BV700_streaming 去 V3 会报音色不存在。
# 下面这 8 个是实测能合成出真 MP3 的(2026-10 验证)。
VOLC_V3_SPEAKERS = [
{'value': 'zh_female_vv_uranus_bigtts', 'label': 'Vivi 2.0(女声,默认)'},
{'value': 'zh_female_cancan_uranus_bigtts', 'label': '知性灿灿 2.0'},
{'value': 'zh_female_xiaohe_uranus_bigtts', 'label': '小何 2.0'},
{'value': 'zh_female_tianmeixiaoyuan_uranus_bigtts', 'label': '甜美小源 2.0'},
{'value': 'zh_female_shuangkuaisisi_uranus_bigtts', 'label': '爽快思思 2.0'},
{'value': 'zh_male_qingcang_uranus_bigtts', 'label': '擎苍 2.0(男声)'},
{'value': 'zh_male_m191_uranus_bigtts', 'label': '云舟 2.0'},
{'value': 'zh_male_taocheng_uranus_bigtts', 'label': '小天 2.0'},
]
def voice_options(engine: str):
if engine == 'volc':
return VOLC_VOICES
if engine == 'volcv3':
return VOLC_V3_SPEAKERS
if engine == 'openai':
return OPENAI_VOICES
return []
def debug_env() -> dict:
"""给 /api/speech/state 用的环境信息(判断能不能用云端语音)。"""
return {
'isAndroid': bool(os.environ.get('ANDROID_ROOT')),
'hasStdlib': True,
}