فهرست منبع

:art: 加入针对内容块的人工智能辅助支持 https://github.com/siyuan-note/siyuan/issues/7566

Liang Ding 2 سال پیش
والد
کامیت
1cc65f5f2a
1فایلهای تغییر یافته به همراه3 افزوده شده و 3 حذف شده
  1. 3 3
      app/src/ai/actions.ts

+ 3 - 3
app/src/ai/actions.ts

@@ -85,7 +85,7 @@ export const AIActions = (elements: Element[], protyle: IProtyle) => {
         }, {
         }, {
             label: window.siyuan.languages.aiExtractSummary,
             label: window.siyuan.languages.aiExtractSummary,
             click() {
             click() {
-                fetchPost("/api/ai/chatGPTWithAction", {ids, action: "Summarize"}, (response) => {
+                fetchPost("/api/ai/chatGPTWithAction", {ids, action: window.siyuan.languages.aiExtractSummary}, (response) => {
                     focusByRange(protyle.toolbar.range);
                     focusByRange(protyle.toolbar.range);
                     insertHTML(response.data, protyle, true);
                     insertHTML(response.data, protyle, true);
                 });
                 });
@@ -93,7 +93,7 @@ export const AIActions = (elements: Element[], protyle: IProtyle) => {
         }, {
         }, {
             label: window.siyuan.languages.aiBrainStorm,
             label: window.siyuan.languages.aiBrainStorm,
             click() {
             click() {
-                fetchPost("/api/ai/chatGPTWithAction", {ids, action: "Brainstorm"}, (response) => {
+                fetchPost("/api/ai/chatGPTWithAction", {ids, action: window.siyuan.languages.aiBrainStorm}, (response) => {
                     focusByRange(protyle.toolbar.range);
                     focusByRange(protyle.toolbar.range);
                     insertHTML(response.data, protyle, true);
                     insertHTML(response.data, protyle, true);
                 });
                 });
@@ -101,7 +101,7 @@ export const AIActions = (elements: Element[], protyle: IProtyle) => {
         }, {
         }, {
             label: window.siyuan.languages.aiFixGrammarSpell,
             label: window.siyuan.languages.aiFixGrammarSpell,
             click() {
             click() {
-                fetchPost("/api/ai/chatGPTWithAction", {ids, action: "Identify the language used in the following text and mark it as {x}, correct the grammar and spelling errors, return the result in language {x}"}, (response) => {
+                fetchPost("/api/ai/chatGPTWithAction", {ids, action: window.siyuan.languages.aiFixGrammarSpell}, (response) => {
                     focusByRange(protyle.toolbar.range);
                     focusByRange(protyle.toolbar.range);
                     insertHTML(response.data, protyle, true);
                     insertHTML(response.data, protyle, true);
                 });
                 });