|
@@ -449,42 +449,47 @@ function handleEdit(index: number) {
|
|
|
},
|
|
|
ai: {
|
|
|
models: {
|
|
|
- custom: {
|
|
|
- url: "http://127.0.0.1:6039/chat/send",
|
|
|
- headers: () => {
|
|
|
- return {
|
|
|
- "Content-Type": "application/json;charset=UTF-8",
|
|
|
- Authorization: "Bearer " + getToken(),
|
|
|
- Accept: "text/event-stream ",
|
|
|
- };
|
|
|
- },
|
|
|
- wrapPayload: (message: string) => {
|
|
|
- return JSON.stringify({
|
|
|
- messages: [
|
|
|
- {
|
|
|
- role: "user",
|
|
|
- content: message,
|
|
|
- },
|
|
|
- ],
|
|
|
- model: nGptStore.value.modelLabel,
|
|
|
- });
|
|
|
- },
|
|
|
- parseMessage: (message: any) => {
|
|
|
- const data = JSON.parse(message);
|
|
|
- const msg =
|
|
|
- data.choices[0].delta?.content ??
|
|
|
- data.choices[0].delta?.reasoning_content ??
|
|
|
- "";
|
|
|
- return {
|
|
|
- role: "assistant",
|
|
|
- content: msg,
|
|
|
- // index: number,
|
|
|
- // //0 代表首个文本结果;1 代表中间文本结果;2 代表最后一个文本结果。
|
|
|
- // status: 0|1|2,
|
|
|
- };
|
|
|
- },
|
|
|
- protocol: "sse",
|
|
|
+ openai: {
|
|
|
+ endpoint: "https://dashscope.aliyuncs.com/compatible-mode",
|
|
|
+ model: "deepseek-v3",
|
|
|
+ apiKey: "sk-4a781ddcd68246f38c57dceefa21592a"
|
|
|
},
|
|
|
+ // custom: {
|
|
|
+ // url: "http://127.0.0.1:6039/chat/send",
|
|
|
+ // headers: () => {
|
|
|
+ // return {
|
|
|
+ // "Content-Type": "application/json;charset=UTF-8",
|
|
|
+ // Authorization: "Bearer " + getToken(),
|
|
|
+ // Accept: "text/event-stream ",
|
|
|
+ // };
|
|
|
+ // },
|
|
|
+ // wrapPayload: (message: string) => {
|
|
|
+ // return JSON.stringify({
|
|
|
+ // messages: [
|
|
|
+ // {
|
|
|
+ // role: "user",
|
|
|
+ // content: message,
|
|
|
+ // },
|
|
|
+ // ],
|
|
|
+ // model: nGptStore.value.modelLabel,
|
|
|
+ // });
|
|
|
+ // },
|
|
|
+ // parseMessage: (message: any) => {
|
|
|
+ // const data = JSON.parse(message);
|
|
|
+ // const msg =
|
|
|
+ // data.choices[0].delta?.content ??
|
|
|
+ // data.choices[0].delta?.reasoning_content ??
|
|
|
+ // "";
|
|
|
+ // return {
|
|
|
+ // role: "assistant",
|
|
|
+ // content: msg,
|
|
|
+ // // index: number,
|
|
|
+ // // //0 代表首个文本结果;1 代表中间文本结果;2 代表最后一个文本结果。
|
|
|
+ // // status: 0|1|2,
|
|
|
+ // };
|
|
|
+ // },
|
|
|
+ // protocol: "sse",
|
|
|
+ // },
|
|
|
},
|
|
|
bubblePanelMenus: [
|
|
|
{
|
|
@@ -747,8 +752,8 @@ load();
|
|
|
style="width: 80%"
|
|
|
preset="dialog"
|
|
|
positive-text="确认"
|
|
|
- negative-text="算了"
|
|
|
- title="确认"
|
|
|
+ negative-text="取消"
|
|
|
+ title="AI 编辑"
|
|
|
@positive-click="submitCallback"
|
|
|
@negative-click="showDialog = false"
|
|
|
>
|