Loading skill
Install any skill in seconds. Free to start, no credit card required.
Get Started Free →根据文件类型向指定文件中添加代码行。当用户提到批量添加代码、按类型插入行、自动加 import 时使用。
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | -35% | 0% |
| case-02 | ✗→✓ | ▲ Improved | -30% | 0% |
| case-03 | ✗→✓ | ▲ Improved | -54% | 0% |
| case-04 | ✗→✓ | ▲ Improved | -40% | 0% |
| case-05 | ✗→✓ | ▲ Improved | -50% | 0% |
> 根据类型添加行
根据文件类型,向指定文件中添加对应的代码行。
> ⚠️ TODO: 该功能为历史功能,行为待测试。
office/skills/file/add_line_by_type/
pythonfrom skills.file import add_line_by_type add_line_by_type( add_line_dict={'import': 'import os'}, file_path='./test.py', file_type='.py', output_path='add_line' )
| 参数 | 类型 | 必填 | 默认值 | 说明 | |------|------|------|--------|------| | add_line_dict | dict | 是 | - | 添加行的字典 | | file_path | str | 是 | - | 文件路径 | | file_type | str | 否 | '.py' | 文件类型 | | output_path | str | 否 | 'add_line' | 输出路径 |
None
office.api.file.add_line_by_type
Other measured skills in the registry, with their headline benchmark lift.