Selaa lähdekoodia

feat: ss-rag适配修改

Hacked_v0.19.0
fellow99 5 kuukautta sitten
vanhempi
commit
85326cdfac

+ 1
- 0
api/db/services/dialog_service.py Näytä tiedosto

@@ -111,6 +111,7 @@ def chat_solo(dialog, messages, stream=True):
last_ans = ""
delta_ans = ""
for ans in chat_mdl.chat_streamly(prompt_config.get("system", ""), msg, dialog.llm_setting):
if ans == None: continue # SSDESK: 修复RKLLM返回信息没有终止符的问题
answer = ans
delta_ans = ans[len(last_ans) :]
if num_tokens_from_string(delta_ans) < 16:

+ 4
- 3
web/.umirc.ts Näytä tiedosto

@@ -6,12 +6,12 @@ import routes from './src/routes';

export default defineConfig({
title: appName,
outputPath: 'dist',
outputPath: 'dist/ss-rag',
alias: { '@parent': path.resolve(__dirname, '../') },
npmClient: 'npm',
base: '/',
base: '/ss-rag/',
routes,
publicPath: '/',
publicPath: '/ss-rag/',
esbuildMinifyIIFE: true,
icons: {},
hash: true,
@@ -20,6 +20,7 @@ export default defineConfig({
history: {
type: 'browser',
},
exportStatic: {},
plugins: [
'@react-dev-inspector/umi4-plugin',
'@umijs/plugins/dist/tailwindcss',

+ 1
- 1
web/src/components/api-service/embed-modal/index.tsx Näytä tiedosto

@@ -52,7 +52,7 @@ const EmbedModal = ({
}, []);

const generateIframeSrc = () => {
let src = `${location.origin}/chat/share?shared_id=${token}&from=${form}&auth=${beta}`;
let src = `${location.origin}/ss-rag/chat/share?shared_id=${token}&from=${form}&auth=${beta}`;
if (visibleAvatar) {
src += '&visible_avatar=1';
}

+ 1
- 1
web/src/components/api-service/hooks.ts Näytä tiedosto

@@ -82,7 +82,7 @@ export const useShowBetaEmptyError = () => {

const getUrlWithToken = (token: string, from: string = 'chat') => {
const { protocol, host } = window.location;
return `${protocol}//${host}/chat/share?shared_id=${token}&from=${from}`;
return `${protocol}//${host}/ss-rag/chat/share?shared_id=${token}&from=${from}`;
};

const useFetchTokenListBeforeOtherStep = () => {

+ 1
- 1
web/src/components/new-document-link.tsx Näytä tiedosto

@@ -27,7 +27,7 @@ const NewDocumentLink = ({
let nextLink = link;
const extension = getExtension(documentName);
if (!link) {
nextLink = `/document/${documentId}?ext=${extension}&prefix=${prefix}`;
nextLink = `/ss-rag/document/${documentId}?ext=${extension}&prefix=${prefix}`;
}

return (

+ 1
- 1
web/src/conf.json Näytä tiedosto

@@ -1,3 +1,3 @@
{
"appName": "RAGFlow"
"appName": "浩瀚知图"
}

+ 1
- 1
web/src/pages/chat/shared-hooks.ts Näytä tiedosto

@@ -50,7 +50,7 @@ export const useSendSharedMessage = () => {
useCreateNextSharedConversation();
const { handleInputChange, value, setValue } = useHandleMessageInputChange();
const { send, answer, done, stopOutputMessage } = useSendMessageWithSse(
`/api/v1/${from === SharedFrom.Agent ? 'agentbots' : 'chatbots'}/${conversationId}/completions`,
`/ss-rag-api/api/v1/${from === SharedFrom.Agent ? 'agentbots' : 'chatbots'}/${conversationId}/completions`,
);
const {
derivedMessages,

+ 1
- 1
web/src/utils/api.ts Näytä tiedosto

@@ -1,4 +1,4 @@
let api_host = `/v1`;
let api_host = `/ss-rag-api/v1`;

export { api_host };


+ 1
- 1
web/src/utils/authorization-util.ts Näytä tiedosto

@@ -59,5 +59,5 @@ export default storage;

// Will not jump to the login page
export function redirectToLogin() {
window.location.href = location.origin + `/login`;
window.location.href = location.origin + `/ss-rag/login`;
}

Loading…
Peruuta
Tallenna