mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-14 11:14:21 +01:00
✨ 桌面端接入 OpenAI Chat API https://github.com/siyuan-note/siyuan/issues/7560
This commit is contained in:
parent
7ae19716b6
commit
80a7ebc409
2 changed files with 32 additions and 10 deletions
|
|
@ -32,7 +32,6 @@ import {processRender} from "../util/processCode";
|
|||
import {getEventName} from "../util/compatibility";
|
||||
import {Dialog} from "../../dialog";
|
||||
import {isMobile} from "../../util/functions";
|
||||
import {progressLoading} from "../../dialog/processSystem";
|
||||
|
||||
export class Hint {
|
||||
public timeId: number;
|
||||
|
|
@ -565,15 +564,12 @@ ${unicode2Emoji(emoji.unicode, true)}</button>`;
|
|||
dialog.destroy();
|
||||
});
|
||||
btnsElement[1].addEventListener("click", () => {
|
||||
progressLoading({code: 1, cmd:"", data:"", msg:"", sid:""});
|
||||
fetchPost("/api/ai/chatGPT", {
|
||||
msg: inputElement.value,
|
||||
}, (response) => {
|
||||
progressLoading({code: 2, cmd:"", data:"", msg:"", sid:""});
|
||||
dialog.destroy();
|
||||
focusByRange(protyle.toolbar.range);
|
||||
insertHTML(`${inputElement.value}
|
||||
${response.data}`, protyle, true);
|
||||
insertHTML(`${inputElement.value}\n\n${response.data}`, protyle, true);
|
||||
});
|
||||
});
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue