feat(agent): 增强 Agent 配置,新增结构化字段与聊天功能支持
This commit is contained in:
1 parent
ac4262cd75
commit
c8ce77199e
183 files changed
+11690
-2300
No files matched your search
@@ -12,6 +12,16 @@ def parse_api_error(body: dict) -> dict:
|
||||
return error
|
||||
|
||||
|
||||
def parse_api_data(body: dict):
|
||||
"""
|
||||
从标准 API 成功 envelope 中提取 data;legacy 裸 JSON 则原样返回。
|
||||
"""
|
||||
assert isinstance(body, dict)
|
||||
if body.get('success') is True:
|
||||
return body.get('data')
|
||||
return body
|
||||
|
||||
|
||||
def flatten_api_error(body: dict) -> dict:
|
||||
"""
|
||||
将 envelope 错误扁平化为 { error_code, error, ...details },便于 WeCom 等历史测试断言。
|
||||
|
||||
Reference in new issue
Block a user