方向、版本与真实能力发现:练习答案
练习解答
python
def require_tool(names,name):
if name not in names:raise ValueError('unsupported: '+name)
return name
assert require_tool(['codex','codex-reply'],'codex-reply')=='codex-reply'
try:require_tool(['codex'],'codex-reply')
except ValueError:pass
else:raise AssertionError('silent new conversation')
print('capability check passed')静默新建会话会丢历史和任务身份,还可能重复执行原操作。