ZGGSONG / STranslate

A ready-to-use, ready-to-go translation ocr tool developed by WPF/WPF 开发的一款即开即用、即用即走的翻译、OCR工具
https://stranslate.zggsong.com
MIT License
1.36k stars 82 forks source link

智谱AI内部API有问题 #78

Closed nop4LOL closed 1 month ago

nop4LOL commented 1 month ago

添加了apikey后还是无法翻译,提示 :

翻译出错: Unauthorized

ZGGSONG commented 1 month ago

你看下是不是你的apikey过期了,我刚试了一下,功能正常

image

nop4LOL commented 1 month ago

你看下是不是你的apikey过期了,我刚试了一下,功能正常

image

还是不正常,不知道怎么回事,另外还有一个bug反馈,我之前强行关闭电脑,再重新启动电脑后,STranslate的所有配置数据都没有了,又恢复成了最开始的配置,这个请一定要修复,我真的醉了!!!!!!!!

nop4LOL commented 1 month ago

2024-05-16 10:41:38.079 [INF] Opened... 2024-05-16 10:41:38.292 [WRN] 加载上次窗口位置()失败,启用默认位置 2024-05-16 12:13:48.364 [ERR] [智谱AI(4e5eea50-f1c7-4d52-881f-6a257d95bc05)] 翻译出错, 请求API: https://open.bigmodel.cn/api/paas/v4/chat/completions, 异常信息: Unauthorized 2024-05-16 12:13:48.404 [ERR] [微软翻译(1f01e507-02ee-4726-af28-821e3db536c1)] 翻译出错, 请求API: https://api.cognitive.microsofttranslator.com/translate, 异常信息: Cannot deserialize the current JSON object (e.g. {"name":"value"}) into type 'STranslate.Model.ResponseBing[]' because the type requires a JSON array (e.g. [1,2,3]) to deserialize correctly. To fix this error either change the JSON to a JSON array (e.g. [1,2,3]) or change the deserialized type so that it is a normal .NET type (e.g. not a primitive type like integer, not a collection type like an array or List) that can be deserialized from a JSON object. JsonObjectAttribute can also be added to the type to force it to deserialize from a JSON object. Path 'error', line 1, position 9. 2024-05-16 12:21:28.603 [ERR] [智谱AI(4e5eea50-f1c7-4d52-881f-6a257d95bc05)] 翻译出错, 请求API: https://open.bigmodel.cn/api/paas/v4/chat/completions, 异常信息: Unauthorized 2024-05-16 12:21:28.753 [ERR] [微软翻译(1f01e507-02ee-4726-af28-821e3db536c1)] 翻译出错, 请求API: https://api.cognitive.microsofttranslator.com/translate, 异常信息: Cannot deserialize the current JSON object (e.g. {"name":"value"}) into type 'STranslate.Model.ResponseBing[]' because the type requires a JSON array (e.g. [1,2,3]) to deserialize correctly. To fix this error either change the JSON to a JSON array (e.g. [1,2,3]) or change the deserialized type so that it is a normal .NET type (e.g. not a primitive type like integer, not a collection type like an array or List) that can be deserialized from a JSON object. JsonObjectAttribute can also be added to the type to force it to deserialize from a JSON object. Path 'error', line 1, position 9. 2024-05-16 12:21:51.771 [ERR] [智谱AI(4e5eea50-f1c7-4d52-881f-6a257d95bc05)] , 请求API: https://open.bigmodel.cn/api/paas/v4/chat/completions, 异常信息: Unauthorized 2024-05-16 12:23:18.342 [ERR] [智谱AI(4e5eea50-f1c7-4d52-881f-6a257d95bc05)] 翻译出错, 请求API: https://open.bigmodel.cn/api/paas/v4/chat/completions, 异常信息: Unauthorized 2024-05-16 12:23:18.397 [ERR] [微软翻译(1f01e507-02ee-4726-af28-821e3db536c1)] 翻译出错, 请求API: https://api.cognitive.microsofttranslator.com/translate, 异常信息: Cannot deserialize the current JSON object (e.g. {"name":"value"}) into type 'STranslate.Model.ResponseBing[]' because the type requires a JSON array (e.g. [1,2,3]) to deserialize correctly. To fix this error either change the JSON to a JSON array (e.g. [1,2,3]) or change the deserialized type so that it is a normal .NET type (e.g. not a primitive type like integer, not a collection type like an array or List) that can be deserialized from a JSON object. JsonObjectAttribute can also be added to the type to force it to deserialize from a JSON object. Path 'error', line 1, position 9. 2024-05-16 12:52:22.289 [ERR] [微软翻译(1f01e507-02ee-4726-af28-821e3db536c1)] 翻译出错, 请求API: https://api.cognitive.microsofttranslator.com/translate, 异常信息: Cannot deserialize the current JSON object (e.g. {"name":"value"}) into type 'STranslate.Model.ResponseBing[]' because the type requires a JSON array (e.g. [1,2,3]) to deserialize correctly. To fix this error either change the JSON to a JSON array (e.g. [1,2,3]) or change the deserialized type so that it is a normal .NET type (e.g. not a primitive type like integer, not a collection type like an array or List) that can be deserialized from a JSON object. JsonObjectAttribute can also be added to the type to force it to deserialize from a JSON object. Path 'error', line 1, position 9. 2024-05-16 12:52:22.319 [ERR] [智谱AI(4e5eea50-f1c7-4d52-881f-6a257d95bc05)] 翻译出错, 请求API: https://open.bigmodel.cn/api/paas/v4/chat/completions, 异常信息: Unauthorized 2024-05-16 12:52:32.124 [ERR] [Gemini(da9e5313-3037-44a7-a9a2-9a5b33c8d58e)] 请求超时, 请求API: https://generativelanguage.googleapis.com, 异常信息: The request was canceled due to the configured HttpClient.Timeout of 10 seconds elapsing. 2024-05-16 12:57:46.484 [ERR] [智谱AI(4e5eea50-f1c7-4d52-881f-6a257d95bc05)] 翻译出错, 请求API: https://open.bigmodel.cn/api/paas/v4/chat/completions, 异常信息: Unauthorized 2024-05-16 12:57:46.519 [ERR] [微软翻译(1f01e507-02ee-4726-af28-821e3db536c1)] 翻译出错, 请求API: https://api.cognitive.microsofttranslator.com/translate, 异常信息: Cannot deserialize the current JSON object (e.g. {"name":"value"}) into type 'STranslate.Model.ResponseBing[]' because the type requires a JSON array (e.g. [1,2,3]) to deserialize correctly. To fix this error either change the JSON to a JSON array (e.g. [1,2,3]) or change the deserialized type so that it is a normal .NET type (e.g. not a primitive type like integer, not a collection type like an array or List) that can be deserialized from a JSON object. JsonObjectAttribute can also be added to the type to force it to deserialize from a JSON object. Path 'error', line 1, position 9. 2024-05-16 12:57:49.373 [ERR] [Gemini(da9e5313-3037-44a7-a9a2-9a5b33c8d58e)] 请求出错, 请求API: https://generativelanguage.googleapis.com, 异常信息: The SSL connection could not be established, see inner exception. 2024-05-16 12:57:56.223 [ERR] [OpenAI(d5c2ebde-7e61-4ddd-913e-076a5177f4bb)] 请求超时, 请求API: https://api.openai.com, 异常信息: The request was canceled due to the configured HttpClient.Timeout of 10 seconds elapsing. 2024-05-16 12:58:19.590 [ERR] [智谱AI(4e5eea50-f1c7-4d52-881f-6a257d95bc05)] 翻译出错, 请求API: https://open.bigmodel.cn/api/paas/v4/chat/completions, 异常信息: Unauthorized 2024-05-16 12:58:20.209 [ERR] [微软翻译(1f01e507-02ee-4726-af28-821e3db536c1)] 翻译出错, 请求API: https://api.cognitive.microsofttranslator.com/translate, 异常信息: Cannot deserialize the current JSON object (e.g. {"name":"value"}) into type 'STranslate.Model.ResponseBing[]' because the type requires a JSON array (e.g. [1,2,3]) to deserialize correctly. To fix this error either change the JSON to a JSON array (e.g. [1,2,3]) or change the deserialized type so that it is a normal .NET type (e.g. not a primitive type like integer, not a collection type like an array or List) that can be deserialized from a JSON object. JsonObjectAttribute can also be added to the type to force it to deserialize from a JSON object. Path 'error', line 1, position 9. 2024-05-16 12:58:26.151 [ERR] [OpenAI(d5c2ebde-7e61-4ddd-913e-076a5177f4bb)] 翻译出错, 请求API: https://api.openai.com, 异常信息: Too Many Requests 2024-05-16 12:58:37.796 [ERR] [智谱AI(4e5eea50-f1c7-4d52-881f-6a257d95bc05)] 翻译出错, 请求API: https://open.bigmodel.cn/api/paas/v4/chat/completions, 异常信息: Unauthorized 2024-05-16 12:58:38.061 [ERR] [微软翻译(1f01e507-02ee-4726-af28-821e3db536c1)] 翻译出错, 请求API: https://api.cognitive.microsofttranslator.com/translate, 异常信息: Cannot deserialize the current JSON object (e.g. {"name":"value"}) into type 'STranslate.Model.ResponseBing[]' because the type requires a JSON array (e.g. [1,2,3]) to deserialize correctly. To fix this error either change the JSON to a JSON array (e.g. [1,2,3]) or change the deserialized type so that it is a normal .NET type (e.g. not a primitive type like integer, not a collection type like an array or List) that can be deserialized from a JSON object. JsonObjectAttribute can also be added to the type to force it to deserialize from a JSON object. Path 'error', line 1, position 9. 2024-05-16 12:58:43.196 [ERR] [OpenAI(d5c2ebde-7e61-4ddd-913e-076a5177f4bb)] 翻译出错, 请求API: https://api.openai.com, 异常信息: Too Many Requests 2024-05-16 13:03:56.813 [ERR] [智谱AI(4e5eea50-f1c7-4d52-881f-6a257d95bc05)] 翻译出错, 请求API: https://open.bigmodel.cn/api/paas/v4/chat/completions, 异常信息: Unauthorized 2024-05-16 13:03:57.138 [ERR] [微软翻译(1f01e507-02ee-4726-af28-821e3db536c1)] 翻译出错, 请求API: https://api.cognitive.microsofttranslator.com/translate, 异常信息: Cannot deserialize the current JSON object (e.g. {"name":"value"}) into type 'STranslate.Model.ResponseBing[]' because the type requires a JSON array (e.g. [1,2,3]) to deserialize correctly. To fix this error either change the JSON to a JSON array (e.g. [1,2,3]) or change the deserialized type so that it is a normal .NET type (e.g. not a primitive type like integer, not a collection type like an array or List) that can be deserialized from a JSON object. JsonObjectAttribute can also be added to the type to force it to deserialize from a JSON object. Path 'error', line 1, position 9. 2024-05-16 13:05:26.867 [ERR] [智谱AI(4e5eea50-f1c7-4d52-881f-6a257d95bc05)] 翻译出错, 请求API: https://open.bigmodel.cn/api/paas/v4/chat/completions, 异常信息: Unauthorized 2024-05-16 13:06:11.095 [ERR] [智谱AI(4e5eea50-f1c7-4d52-881f-6a257d95bc05)] 翻译出错, 请求API: https://open.bigmodel.cn/api/paas/v4/chat/completions, 异常信息: Unauthorized 2024-05-16 13:08:19.105 [ERR] [智谱AI(4e5eea50-f1c7-4d52-881f-6a257d95bc05)] 翻译出错, 请求API: https://open.bigmodel.cn/api/paas/v4/chat/completions, 异常信息: Unauthorized 2024-05-16 13:32:37.717 [ERR] [智谱AI(4e5eea50-f1c7-4d52-881f-6a257d95bc05)] 翻译出错, 请求API: https://open.bigmodel.cn/api/paas/v4/chat/completions, 异常信息: Unauthorized 2024-05-16 13:33:38.911 [ERR] [智谱AI(4e5eea50-f1c7-4d52-881f-6a257d95bc05)] 翻译出错, 请求API: https://open.bigmodel.cn/api/paas/v4/chat/completions, 异常信息: Unauthorized 2024-05-16 13:39:20.981 [ERR] [智谱AI(4e5eea50-f1c7-4d52-881f-6a257d95bc05)] 翻译出错, 请求API: https://open.bigmodel.cn/api/paas/v4/chat/completions, 异常信息: Unauthorized 2024-05-16 13:40:11.371 [ERR] [智谱AI(4e5eea50-f1c7-4d52-881f-6a257d95bc05)] 翻译出错, 请求API: https://open.bigmodel.cn/api/paas/v4/chat/completions, 异常信息: Unauthorized 2024-05-16 14:55:10.067 [ERR] [Kimi(d5c2ebde-7e61-4ddd-913e-076a5177f4bb)] 翻译出错, 请求API: https://api.moonshot.cn/, 异常信息: Too Many Requests 2024-05-16 14:59:09.273 [ERR] [零一万物(d5c2ebde-7e61-4ddd-913e-076a5177f4bb)] 请求超时, 请求API: https://api.lingyiwanwu.com/v1/chat/completions, 异常信息: The request was canceled due to the configured HttpClient.Timeout of 10 seconds elapsing. 2024-05-16 16:40:33.251 [INF] Closed... 2024-05-16 17:58:49.082 [INF] Opened... 2024-05-16 18:03:37.319 [ERR] [Kimi(d5c2ebde-7e61-4ddd-913e-076a5177f4bb)] 翻译出错, 请求API: https://api.moonshot.cn/, 异常信息: Too Many Requests

nop4LOL commented 1 month ago

这些是报错日志,你看下

nop4LOL commented 1 month ago

image 你看,当我强行关机的时候,备份的配置文件全部变成了0

nop4LOL commented 1 month ago

@ZGGSONG 排查出什么了吗,是不是api问题,质谱还是不行

ZGGSONG commented 1 month ago

没看出来是啥问题,有没有尝试重新生成key 把现有的智谱AI删掉,新建一个智谱AI的服务后填上新key进行测试

image