Ver código fonte

feat: ss-rag适配修改

Hacked_v0.19.0
fellow99 5 meses atrás
pai
commit
85326cdfac

+ 1
- 0
api/db/services/dialog_service.py Ver arquivo

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

+ 4
- 3
web/.umirc.ts Ver arquivo



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

+ 1
- 1
web/src/components/api-service/embed-modal/index.tsx Ver arquivo

}, []); }, []);


const generateIframeSrc = () => { 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) { if (visibleAvatar) {
src += '&visible_avatar=1'; src += '&visible_avatar=1';
} }

+ 1
- 1
web/src/components/api-service/hooks.ts Ver arquivo



const getUrlWithToken = (token: string, from: string = 'chat') => { const getUrlWithToken = (token: string, from: string = 'chat') => {
const { protocol, host } = window.location; 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 = () => { const useFetchTokenListBeforeOtherStep = () => {

+ 1
- 1
web/src/components/new-document-link.tsx Ver arquivo

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


return ( return (

+ 1
- 1
web/src/conf.json Ver arquivo

{ {
"appName": "RAGFlow"
"appName": "浩瀚知图"
} }

+ 1
- 1
web/src/pages/chat/shared-hooks.ts Ver arquivo

useCreateNextSharedConversation(); useCreateNextSharedConversation();
const { handleInputChange, value, setValue } = useHandleMessageInputChange(); const { handleInputChange, value, setValue } = useHandleMessageInputChange();
const { send, answer, done, stopOutputMessage } = useSendMessageWithSse( 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 { const {
derivedMessages, derivedMessages,

+ 1
- 1
web/src/utils/api.ts Ver arquivo

let api_host = `/v1`;
let api_host = `/ss-rag-api/v1`;


export { api_host }; export { api_host };



+ 1
- 1
web/src/utils/authorization-util.ts Ver arquivo



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

Carregando…
Cancelar
Salvar