(json_obj, file_name)
| 130 | |
| 131 | |
| 132 | def write_json(json_obj, file_name): |
| 133 | with open(file_name, "w", encoding="utf-8") as f: |
| 134 | json.dump(json_obj, f, indent=2, ensure_ascii=False) |
| 135 | |
| 136 | |
| 137 | def encode_string_by_tiktoken(content: str, model_name: str = "gpt-4o"): |