Skip to content

Commit

Permalink
Merge pull request #780 from cesaryuan/patch-1
Browse files Browse the repository at this point in the history
fix: AI-generated desc lose space and case info #775
  • Loading branch information
terwer committed Oct 11, 2023
2 parents 05a8712 + 6fb23fb commit 8f7463d
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/components/publish/form/CommonCategories.vue
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ const cateMethods = {
const { chat } = useChatGPT()
const chatText = await chat(inputWord, {
name: "categories",
systemMessage: HtmlUtil.parseHtml(formData.html, AiConstants.MAX_INPUT_TOKEN_LENGTH, true),
systemMessage: formData.md?.substring(0, AiConstants.MAX_INPUT_TOKEN_LENGTH) ?? HtmlUtil.parseHtml(formData.html, AiConstants.MAX_INPUT_TOKEN_LENGTH, true),
})
if (StrUtil.isEmptyString(chatText)) {
ElMessage.error("请求错误,请在偏好设置配置请求地址和ChatGPT key!")
Expand Down
2 changes: 1 addition & 1 deletion src/components/publish/form/PublishCategories.vue
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ const fetchCate = async () => {
const { chat } = useChatGPT()
const chatText = await chat(inputWord,{
name: "categories",
systemMessage: HtmlUtil.parseHtml(formData.html, AiConstants.MAX_INPUT_TOKEN_LENGTH, true),
systemMessage: formData.md?.substring(0, AiConstants.MAX_INPUT_TOKEN_LENGTH) ?? HtmlUtil.parseHtml(formData.html, AiConstants.MAX_INPUT_TOKEN_LENGTH, true),
})
if (StrUtil.isEmptyString(chatText)) {
ElMessage.error("请求错误,请在偏好设置配置请求地址和ChatGPT key!")
Expand Down
2 changes: 1 addition & 1 deletion src/components/publish/form/PublishDescription.vue
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ const handleMakeDesc = async () => {
const { chat } = useChatGPT()
const chatText = await chat(inputWord, {
name: "desc",
systemMessage: HtmlUtil.parseHtml(formData.html, AiConstants.MAX_INPUT_TOKEN_LENGTH, true),
systemMessage: formData.md?.substring(0, AiConstants.MAX_INPUT_TOKEN_LENGTH) ?? HtmlUtil.parseHtml(formData.html, AiConstants.MAX_INPUT_TOKEN_LENGTH, true),
})
if (StrUtil.isEmptyString(chatText)) {
ElMessage.error("请求错误,请在偏好设置配置请求地址和ChatGPT key!")
Expand Down
2 changes: 1 addition & 1 deletion src/components/publish/form/PublishTags.vue
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ const tagMethods = {
const { chat } = useChatGPT()
const chatText = await chat(inputWord, {
name: "tags",
systemMessage: HtmlUtil.parseHtml(formData.html, AiConstants.MAX_INPUT_TOKEN_LENGTH, true),
systemMessage: formData.md?.substring(0, AiConstants.MAX_INPUT_TOKEN_LENGTH) ?? (formData.html, AiConstants.MAX_INPUT_TOKEN_LENGTH, true),
})
if (StrUtil.isEmptyString(chatText)) {
ElMessage.error("请求错误,请在偏好设置配置请求地址和ChatGPT key!")
Expand Down
2 changes: 1 addition & 1 deletion src/components/publish/form/PublishTitle.vue
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ const handleMakeTitle = async () => {
const { chat } = useChatGPT()
const chatText = await chat(inputWord, {
name: "title",
systemMessage: HtmlUtil.parseHtml(formData.html, AiConstants.MAX_INPUT_TOKEN_LENGTH, true),
systemMessage: formData.md?.substring(0, AiConstants.MAX_INPUT_TOKEN_LENGTH) ?? HtmlUtil.parseHtml(formData.html, AiConstants.MAX_INPUT_TOKEN_LENGTH, true),
})
if (StrUtil.isEmptyString(chatText)) {
ElMessage.error("请求错误,请在偏好设置配置请求地址和ChatGPT key!")
Expand Down

0 comments on commit 8f7463d

Please sign in to comment.