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

AI自动生成摘要丢失英文单词的空格和大小写信息 #775

Closed
cesaryuan opened this issue Oct 10, 2023 · 0 comments
Closed

AI自动生成摘要丢失英文单词的空格和大小写信息 #775

cesaryuan opened this issue Oct 10, 2023 · 0 comments

Comments

@cesaryuan
Copy link
Contributor

cesaryuan commented Oct 10, 2023

复现步骤:

  1. 新建一个文档,内容如下SetSuspendState 的全称是 Set windows suspend state
  2. 进入常规发布,点击自动提取摘要,查看结果
setwindowssuspendstate是一个Windows API函数,它用于将计算机置于暂停状态。该函数接受两个参数,第一个参数指定计算机的暂停类型,第二个参数指定计算机的唤醒源。通过调用setwindowssuspendstate函数,可以方便地控制计算机的暂停和唤醒操作。

可以发现大小写和空格都丢失了
image

image

Update:
看了下是由于HtmlUtil.parseHtml(formData.html, AiConstants.MAX_INPUT_TOKEN_LENGTH, true)返回的文本会把所有的空格删掉并转成小写导致的
https://github.com/terwer/zhi/blob/7f45bc3e86a7fe5c681da0228aad153e3d678d29/libs/zhi-common/src/lib/htmlUtil.ts#L108
https://github.com/terwer/zhi/blob/7f45bc3e86a7fe5c681da0228aad153e3d678d29/libs/zhi-common/src/lib/htmlUtil.ts#L127

或许可以直接把这里

systemMessage: HtmlUtil.parseHtml(formData.html, AiConstants.MAX_INPUT_TOKEN_LENGTH, true),

改成systemMessage: formData.md

cesaryuan added a commit to cesaryuan/siyuan-plugin-publisher that referenced this issue Oct 11, 2023
@terwer terwer closed this as completed in 6fb23fb Oct 11, 2023
terwer added a commit that referenced this issue Oct 11, 2023
fix: AI-generated desc lose space and case info #775
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

1 participant