输入路径是文件夹,开始批量处理...
Input path is a directory, start batch processing...
当前正在处理文件:config.yml
Currently processing file: config.yml
文件内容长度98003超过最大长度1024,开始使用PKVPM算法拆分内容...
File content length 98003 exceeds the maximum length 1024, start splitting the content using PKVPM algorithm...
原始文件内容长度:98003
共拆分为38部分进行翻译
翻译第1部分...
Translating the 1 part...
第1部分翻译失败:Error code: 401 - {'error': {'message': 'Incorrect API key provided: sk-zk25838f6. You can find your API key at https://platform.openai.com/account/api-keys.', 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_api_key'}}
如果再次失败,请检查文件内容。
The 1 part of the translation failed: Error code: 401 - {'error': {'message': 'Incorrect API key provided: sk-zk25838f6. You can find your API key at https://platform.openai.com/account/api-keys.', 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_api_key'}}
If it fails again, please check the file content.
Traceback (most recent call last):
File "C:\Users\11610\Desktop\ChatGPT-Minecraft-Plugin-Translater-main\main.py", line 274, in
main(_output_language=output_language,
File "C:\Users\11610\Desktop\ChatGPT-Minecraft-Plugin-Translater-main\main.py", line 236, in main
translated_count = process_directory(_input_path, _model, _output_language, _max_tokens, _output_path, log_path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\11610\Desktop\ChatGPT-Minecraft-Plugin-Translater-main\main.py", line 218, in process_directory
process_file(file_path, _model, _output_language, _max_tokens, output_folder, log_path)
File "C:\Users\11610\Desktop\ChatGPT-Minecraft-Plugin-Translater-main\main.py", line 173, in process_file
translated_part = openai_interact(prompt=_prompt, part=part, model=_model, max_tokens=_max_tokens)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\11610\Desktop\ChatGPT-Minecraft-Plugin-Translater-main\main.py", line 73, in openai_interact
response = client.chat.completions.create(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\11610\AppData\Local\Programs\Python\Python312\Lib\site-packages\openai_utils_utils.py", line 275, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\11610\AppData\Local\Programs\Python\Python312\Lib\site-packages\openai\resources\chat\completions.py", line 663, in create
return self._post(
^^^^^^^^^^^
File "C:\Users\11610\AppData\Local\Programs\Python\Python312\Lib\site-packages\openai_base_client.py", line 1200, in post
return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\11610\AppData\Local\Programs\Python\Python312\Lib\site-packages\openai_base_client.py", line 889, in request
return self._request(
^^^^^^^^^^^^^^
File "C:\Users\11610\AppData\Local\Programs\Python\Python312\Lib\site-packages\openai_base_client.py", line 980, in _request
raise self._make_status_error_from_response(err.response) from None
openai.AuthenticationError: Error code: 401 - {'error': {'message': 'Incorrect API key provided: sk-zk258***38f6. You can find your API key at https://platform.openai.com/account/api-keys.', 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_api_key'}}
输入路径是文件夹,开始批量处理... Input path is a directory, start batch processing... 当前正在处理文件:config.yml Currently processing file: config.yml 文件内容长度98003超过最大长度1024,开始使用PKVPM算法拆分内容... File content length 98003 exceeds the maximum length 1024, start splitting the content using PKVPM algorithm... 原始文件内容长度:98003 共拆分为38部分进行翻译 翻译第1部分... Translating the 1 part... 第1部分翻译失败:Error code: 401 - {'error': {'message': 'Incorrect API key provided: sk-zk25838f6. You can find your API key at https://platform.openai.com/account/api-keys.', 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_api_key'}} 如果再次失败,请检查文件内容。 The 1 part of the translation failed: Error code: 401 - {'error': {'message': 'Incorrect API key provided: sk-zk25838f6. You can find your API key at https://platform.openai.com/account/api-keys.', 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_api_key'}} If it fails again, please check the file content. Traceback (most recent call last): File "C:\Users\11610\Desktop\ChatGPT-Minecraft-Plugin-Translater-main\main.py", line 274, in
main(_output_language=output_language,
File "C:\Users\11610\Desktop\ChatGPT-Minecraft-Plugin-Translater-main\main.py", line 236, in main
translated_count = process_directory(_input_path, _model, _output_language, _max_tokens, _output_path, log_path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\11610\Desktop\ChatGPT-Minecraft-Plugin-Translater-main\main.py", line 218, in process_directory
process_file(file_path, _model, _output_language, _max_tokens, output_folder, log_path)
File "C:\Users\11610\Desktop\ChatGPT-Minecraft-Plugin-Translater-main\main.py", line 173, in process_file
translated_part = openai_interact(prompt=_prompt, part=part, model=_model, max_tokens=_max_tokens)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\11610\Desktop\ChatGPT-Minecraft-Plugin-Translater-main\main.py", line 73, in openai_interact
response = client.chat.completions.create(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\11610\AppData\Local\Programs\Python\Python312\Lib\site-packages\openai_utils_utils.py", line 275, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\11610\AppData\Local\Programs\Python\Python312\Lib\site-packages\openai\resources\chat\completions.py", line 663, in create
return self._post(
^^^^^^^^^^^
File "C:\Users\11610\AppData\Local\Programs\Python\Python312\Lib\site-packages\openai_base_client.py", line 1200, in post
return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\11610\AppData\Local\Programs\Python\Python312\Lib\site-packages\openai_base_client.py", line 889, in request
return self._request(
^^^^^^^^^^^^^^
File "C:\Users\11610\AppData\Local\Programs\Python\Python312\Lib\site-packages\openai_base_client.py", line 980, in _request
raise self._make_status_error_from_response(err.response) from None
openai.AuthenticationError: Error code: 401 - {'error': {'message': 'Incorrect API key provided: sk-zk258***38f6. You can find your API key at https://platform.openai.com/account/api-keys.', 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_api_key'}}