fix
This commit is contained in:
@@ -36,10 +36,6 @@ class SegmentsTranslateAgent(Agent):
|
|||||||
{r'{"0":"hello","1":"apple","2":true,"3":"false"}'}
|
{r'{"0":"hello","1":"apple","2":true,"3":"false"}'}
|
||||||
## 输出
|
## 输出
|
||||||
{r'{"0":"你好","1":"苹果","2":true,"3":"错误"}'}
|
{r'{"0":"你好","1":"苹果","2":true,"3":"错误"}'}
|
||||||
# 错误输出示例
|
|
||||||
"{r'"{\"0\":\"你好\",\"1\":\"苹果\"}"'}"
|
|
||||||
# 正确输出示例
|
|
||||||
{r'{"0":"你好","1":"苹果"}'}
|
|
||||||
警告:绝不要将整个JSON对象用引号包裹成一个字符串。
|
警告:绝不要将整个JSON对象用引号包裹成一个字符串。
|
||||||
"""
|
"""
|
||||||
if config.custom_prompt:
|
if config.custom_prompt:
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ def flat_json_split(js: dict, chunk_size_max: int) -> list[dict]:
|
|||||||
if chunk_size <= chunk_size_max:
|
if chunk_size <= chunk_size_max:
|
||||||
chunk[key] = val
|
chunk[key] = val
|
||||||
else:
|
else:
|
||||||
chunks.append(json.dumps(chunk,ensure_ascii=False))
|
chunks.append(chunk)
|
||||||
chunk = {key:val}
|
chunk = {key:val}
|
||||||
chunks.append(chunk)
|
chunks.append(chunk)
|
||||||
return chunks
|
return chunks
|
||||||
|
|||||||
Reference in New Issue
Block a user