Skip to content

Commit

Permalink
fix: #775
Browse files Browse the repository at this point in the history
  • Loading branch information
cesaryuan committed Oct 11, 2023
1 parent e4f07f7 commit 6fb23fb
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 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/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 6fb23fb

Please sign in to comment.