Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

开启流式返回中文乱码 #133

Closed
Endlessworld opened this issue Mar 28, 2023 · 14 comments
Closed

开启流式返回中文乱码 #133

Endlessworld opened this issue Mar 28, 2023 · 14 comments

Comments

@Endlessworld
Copy link

image

@obiscr
Copy link
Owner

obiscr commented Mar 28, 2023

第二条返回正常,第一条,不知道具体是什么数据。请提供一下idea.log

@Endlessworld
Copy link
Author

image
第二条是未勾选时的返回

@Endlessworld
Copy link
Author

2023-03-28 10:18:54,587 [3134233] INFO - com.obiscr.chatgpt.GPT35TurboHandler - GPT 3.5 Turbo Request: question=你好
2023-03-28 10:18:57,346 [3136992] INFO - com.obiscr.chatgpt.GPT35TurboHandler - GPT 3.5 Turbo Response: answer={"id":"chatcmpl-6ytDDAPkig9iRmUGIRYb6OwVwM1ih","object":"chat.completion","created":1679969935,"model":"gpt-3.5-turbo-0301","usage":{"prompt_tokens":21,"completion_tokens":18,"total_tokens":39},"choices":[{"message":{"role":"assistant","content":"你好!有什么我可以帮助你的吗?"},"finish_reason":"stop","index":0}]}

2023-03-28 10:18:58,400 [3138046] WARN - #c.i.o.o.e.ConfigurableExtensionPointUtil - ignore deprecated groupId: language for id: preferences.language.Kotlin.scripting
2023-03-28 10:18:58,498 [3138144] INFO - #c.i.AbstractBundle - Cannot load resource bundle from *.properties file, falling back to slow class loading: messages.codegeex
2023-03-28 10:19:05,691 [3145337] INFO - com.obiscr.chatgpt.ChatGPTHandler - ChatGPT: conversation open. Url = https://api.openai.com/v1/chat/completions
2023-03-28 10:19:07,029 [3146675] INFO - com.obiscr.chatgpt.ChatGPTHandler - ChatGPT: conversation close. Url = https://api.openai.com/v1/chat/completions
2023-03-28 10:19:11,304 [3150950] INFO - #c.i.c.ComponentStoreImpl - Saving appDiffSettings took 12 ms, GeneralSettings took 11 ms, MybatisXSettings took 11 ms
2023-03-28 10:19:24,530 [3164176] INFO - com.obiscr.chatgpt.ChatGPTHandler - ChatGPT: conversation open. Url = https://api.openai.com/v1/chat/completions
2023-03-28 10:19:26,576 [3166222] INFO - com.obiscr.chatgpt.ChatGPTHandler - ChatGPT: conversation close. Url = https://api.openai.com/v1/chat/completions

@Endlessworld
Copy link
Author

前两条日志未勾选Enable stream response

@Endlessworld
Copy link
Author

image

@obiscr
Copy link
Owner

obiscr commented Mar 28, 2023

反馈的人比较多,应该是有问题。但是在我的机器上,始终正常。无法复现这个问题。

我换了多台机器,都是正常的。

@Endlessworld
Copy link
Author

使用源代码运行插件 runIde确实是正常的,但是从idea安装的就会乱码

@obiscr obiscr reopened this Mar 28, 2023
@obiscr
Copy link
Owner

obiscr commented Mar 28, 2023

我使用源码运行和插件包安装都没问题,测试了多台机器,都正常,但是反馈的人确实也有。感觉还是哪里有问题。

@Endlessworld
Copy link
Author

image
-Dfile.encoding=UTF-8
-Dsun.jnu.encoding=UTF-8

@Endlessworld
Copy link
Author

解决了

@Endlessworld
Copy link
Author

加上这两句参数就行了

@MeditatorV
Copy link

这个乱码的问题我这边也同样出现

@obiscr
Copy link
Owner

obiscr commented Mar 29, 2023

我今天会尝试修复一下,因为我开发环境无法复现。我大概定位到了问题,只是猜测。

@obiscr
Copy link
Owner

obiscr commented Mar 30, 2023

@obiscr obiscr closed this as completed Mar 30, 2023
obiscr added a commit that referenced this issue Mar 30, 2023
obiscr added a commit that referenced this issue Mar 30, 2023
obiscr added a commit that referenced this issue Mar 30, 2023
obiscr added a commit that referenced this issue Mar 30, 2023
@obiscr obiscr mentioned this issue Mar 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants