Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

优化聊天记录发言方是否是当前账号的判断逻辑 #79

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ ENV = 'development'

VITE_BASE=/
VUE_APP_PREVIEW=false
VITE_BASE_API=https://xxx.xxx.com
VITE_SOCKET_API=wss://xxx.xxx.com
VITE_BASE_API=http://127.0.0.1:9503
VITE_SOCKET_API=ws://127.0.0.1:9504
VUE_APP_WEBSITE_NAME="Lumen IM"
85 changes: 85 additions & 0 deletions src/api/embedding.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
import { post, get, upload } from '@/utils/request'

export function queryModelList(data={}) {
return post('/api/v1/echo/embedding/modelList', data)
// return new Promise((resolve, reject) => {
// chrome.runtime.sendMessage(
// {
// type: "post-data",
// url: "/echo/embedding/modelList",
// },
// (response) => {
// if (!response.status) {
// resolve(response.data);
// } else {
// reject(response);
// }
// }
// );
// });
}

export function queryChatList(params) {
return post('/api/v1/echo/embedding/chatList', params)
// return new Promise((resolve, reject) => {
// chrome.runtime.sendMessage(
// {
// type: "post-data",
// url: "/echo/embedding/chatList",
// params,
// },
// (response) => {
// if (!response.status) {
// resolve(response.data);
// } else {
// reject(response);
// }
// }
// );
// });
}

export function queryChatContentList(params) {
// return new Promise((resolve, reject) => {
// chrome.runtime.sendMessage(
// {
// type: "post-data",
// url: "/echo/embedding/chatContentList",
// params,
// },
// (response) => {
// if (!response.status) {
// resolve(response.data);
// } else {
// reject(response);
// }
// }
// );
// });
return post('/api/v1/echo/embedding/chatContentList', params)
}

export function queryCollectModelList() {
// return new Promise((resolve, reject) => {
// chrome.runtime.sendMessage(
// {
// type: "post-data",
// url: "/echo/embedding/collectModelList",
// },
// (response) => {
// if (!response.status) {
// resolve(response.data);
// } else {
// reject(response);
// }
// }
// );
// });
return post('/api/v1/echo/embedding/collectModelList')
}

// /echo/embedding/chatCompletion
export function queryChatCompletion(params) {
return get('/api/v1/echo/embedding/chatCompletion', params)
}

103 changes: 103 additions & 0 deletions src/api/openAI.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
import { post, get, upload } from '@/utils/request'

export function queryChatList(params) {
// return new Promise((resolve, reject) => {
// chrome.runtime.sendMessage(
// {
// type: "post-data",
// url: "/echo/openai/chatList",
// params,
// },
// (response) => {
// if (!response.status) {
// resolve(response.data);
// } else {
// reject(response);
// }
// }
// );
// });
return post('/api/v1/echo/openai/chatList', params)
}

export function createChat() {
// return new Promise((resolve, reject) => {
// chrome.runtime.sendMessage(
// {
// type: "post-data",
// url: "/echo/openai/createChat",
// },
// (response) => {
// if (!response.status) {
// resolve(response.data);
// } else {
// reject(response);
// }
// }
// );
// });
return post('/api/v1/echo/openai/createChat')
}

export function queryChatContentList(params) {
// return new Promise((resolve, reject) => {
// chrome.runtime.sendMessage(
// {
// type: "post-data",
// url: "/echo/openai/chatContentListByPage",
// params,
// },
// (response) => {
// if (!response.status) {
// resolve(response.data);
// } else {
// reject(response);
// }
// }
// );
// });
return post('/api/v1/echo/openai/chatContentListByPage', params)
}

export function queryPlugins() {
// return new Promise((resolve, reject) => {
// chrome.runtime.sendMessage(
// {
// type: "post-data",
// url: "/echo/openai/plugins",
// },
// (response) => {
// if (!response.status) {
// resolve(response.data);
// } else {
// reject(response);
// }
// }
// );
// });
return post('/api/v1/echo/openai/plugins')
}

export function updateChatAiPlugin(params) {
// return new Promise((resolve, reject) => {
// chrome.runtime.sendMessage(
// {
// type: "post-data",
// url: "/echo/openai/updateChatAiPlugin",
// params,
// },
// (response) => {
// if (!response.status) {
// resolve(response.data);
// } else {
// reject(response);
// }
// }
// );
// });
return post('/api/v1/echo/openai/updateChatAiPlugin', params)
}

export function callChat(params) {
return post('/api/v1/copilot/chat', params)
}
81 changes: 81 additions & 0 deletions src/api/shortCut.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
import { post, get, upload } from '@/utils/request'

export function fetchAddShortCut(params) {
// return new Promise((resolve, reject) => {
// chrome.runtime.sendMessage(
// {
// type: "post-data",
// url: "/echo/shortcut/add",
// params,
// },
// (response) => {
// if (!response.status) {
// resolve(response.data);
// } else {
// reject(response);
// }
// }
// );
// });
return post('/api/v1/echo/shortcut/add', params)
}

export function fetchShortCutList() {
// return new Promise((resolve, reject) => {
// chrome.runtime.sendMessage(
// {
// type: "post-data",
// url: "/echo/shortcut/list",
// params: {},
// },
// (response) => {
// if (!response.status) {
// resolve(response.data);
// } else {
// reject(response);
// }
// }
// );
// });
return post('/api/v1/echo/shortcut/list')
}

export function fetchShortCutDetail(params) {
// return new Promise((resolve, reject) => {
// chrome.runtime.sendMessage(
// {
// type: "post-data",
// url: "/echo/shortcut/detail",
// params,
// },
// (response) => {
// if (!response.status) {
// resolve(response.data);
// } else {
// reject(response);
// }
// }
// );
// });
return post('/api/v1/echo/shortcut/detail', params)
}

export function fetchUpdateShortCut(params) {
// return new Promise((resolve, reject) => {
// chrome.runtime.sendMessage(
// {
// type: "post-data",
// url: "/echo/shortcut/update",
// params,
// },
// (response) => {
// if (!response.status) {
// resolve(response.data);
// } else {
// reject(response);
// }
// }
// );
// });
return post('/api/v1/echo/shortcut/update', params)
}
Loading