Skip to content

Commit ea374e6

Browse files
author
mengqian
committed
Modify comments
1 parent abf88be commit ea374e6

File tree

3 files changed

+13
-14
lines changed

3 files changed

+13
-14
lines changed

examples/file_parsing_example.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def file_parser_create_example(file_path, tool_type, file_type):
2222
)
2323
print("Task created successfully. Response:")
2424
print(response)
25-
# 一般可获取 task_id
25+
# Usually you can get task_id
2626
task_id = getattr(response, "task_id", None)
2727
return task_id
2828

@@ -48,17 +48,16 @@ def file_parser_complete_example():
4848
"""
4949
Full Example: Submit file for parsing, then poll until result is ready
5050
"""
51-
# 1. 创建解析任务
52-
# 请修改本地文件路径
51+
# 1. Create parsing task
52+
# Please modify the local file path
5353
file_path = 'your file path'
5454
task_id = file_parser_create_example(file_path=file_path, tool_type="lite", file_type="pdf")
5555
if not task_id:
5656
print("Could not submit file for parsing.")
5757
return
5858

59-
''
60-
# 2. 轮询获取结果
61-
max_wait = 60 # 最多等待1分钟
59+
# 2. Poll to get the result
60+
max_wait = 60 # Wait up to 1 minute
6261
wait_time = 0
6362
while wait_time < max_wait:
6463
print(f"Waiting {wait_time}/{max_wait} seconds before querying result...")

src/zai/types/file_parser/file_parser_create_params.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88

99
class FileParserCreateParams(TypedDict):
1010
file: FileTypes
11-
"""上传的文件"""
11+
"""Uploaded file"""
1212
file_type: str
13-
"""文件类型"""
13+
"""File type"""
1414
tool_type: Literal["lite", "expert", "prime"]
15-
"""工具类型"""
15+
"""Tool type"""
1616

1717

1818
class FileParserDownloadParams(TypedDict):
1919
task_id: str
20-
"""解析任务id"""
20+
"""Parsing task id"""
2121
format_type: Literal["text", "download_link"]
22-
"""结果返回类型"""
22+
"""Result return type"""

src/zai/types/file_parser/file_parser_resp.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
class FileParserTaskCreateResp(BaseModel):
1111
task_id: str
12-
# 任务id
12+
# Task ID
1313
message: str
14-
# message
14+
# Message
1515
success: bool
16-
# 是否成功
16+
# Whether successful

0 commit comments

Comments
 (0)