feat: handle conflict

This commit is contained in:
shiweisong.ssw 2023-07-03 20:07:51 +08:00
commit 16198d626f
91 changed files with 349 additions and 1001 deletions

View File

@ -1,14 +1,50 @@
"use client"
import dynamic from 'next/dynamic'
import { useRequest } from 'ahooks';
import { sendGetRequest, sendPostRequest } from '@/utils/request';
import useAgentChat from '@/hooks/useAgentChat';
import ChatBoxComp from '@/components/chatBoxTemp';
import { useDialogueContext } from '@/app/context/dialogue';
import { useSearchParams } from 'next/navigation';
const DynamicWrapper = dynamic(() => import ('@/components/agentPage'), {
loading: () => <p>Loading...</p>,
ssr: false,
});
const AgentPage = () => {
const searchParams = useSearchParams();
const { refreshDialogList } = useDialogueContext();
const id = searchParams.get('id');
const scene = searchParams.get('scene');
const { data: historyList } = useRequest(async () => await sendGetRequest('/v1/chat/dialogue/messages/history', {
con_uid: id
}), {
ready: !!id,
refreshDeps: [id]
});
const { data: paramsList } = useRequest(async () => await sendPostRequest(`/v1/chat/mode/params/list?chat_mode=${scene}`), {
ready: !!scene,
refreshDeps: [id, scene]
});
const { history, handleChatSubmit } = useAgentChat({
queryAgentURL: `/v1/chat/completions`,
queryBody: {
conv_uid: id,
chat_mode: scene || 'chat_normal',
},
initHistory: historyList?.data
});
const DynamicAgentPage = (props: any) => {
return (
<DynamicWrapper {...props} />
<>
<ChatBoxComp
clearIntialMessage={async () => {
await refreshDialogList();
}}
messages={history || []}
onSubmit={handleChatSubmit}
paramsList={paramsList?.data}
/>
</>
)
}
export default DynamicAgentPage;
export default AgentPage;

View File

@ -18,7 +18,7 @@ export default function Home() {
resolver: zodResolver(Schema),
defaultValues: {},
});
const { data: scenesList } = useRequest(async () => await sendPostRequest('v1/chat/dialogue/scenes'));
const { data: scenesList } = useRequest(async () => await sendPostRequest('/v1/chat/dialogue/scenes'));
const submit = async ({ query }: z.infer<typeof Schema>) => {
try {
@ -61,6 +61,9 @@ export default function Home() {
size="md"
variant="solid"
className='text-base rounded-none '
style={{
boxShadow: '0px 8px 10px 0px rgb(31 31 31 / 50%)'
}}
onClick={async () => {
const res = await sendPostRequest('/v1/chat/dialogue/new', {
chat_mode: scene['chat_scene']

View File

@ -1,53 +0,0 @@
"use client"
import { useRequest } from 'ahooks';
import { sendGetRequest, sendPostRequest } from '@/utils/request';
import useAgentChat from '@/hooks/useAgentChat';
import ChatBoxComp from '@/components/chatBoxTemp';
import { useDialogueContext } from '@/app/context/dialogue';
const AgentPage = (props: {
searchParams: {
id?: string;
scene?: string;
initMessage?: string;
}
}) => {
const { refreshDialogList } = useDialogueContext();
const { data: historyList } = useRequest(async () => await sendGetRequest('/v1/chat/dialogue/messages/history', {
con_uid: props.searchParams?.id
}), {
ready: !!props.searchParams?.id,
refreshDeps: [props.searchParams?.id]
});
const { data: paramsList } = useRequest(async () => await sendPostRequest(`/v1/chat/mode/params/list?chat_mode=${props.searchParams?.scene}`), {
ready: !!props.searchParams?.scene,
refreshDeps: [props.searchParams?.scene]
});
const { history, handleChatSubmit } = useAgentChat({
queryAgentURL: `/v1/chat/completions`,
queryBody: {
conv_uid: props.searchParams?.id,
chat_mode: props.searchParams?.scene || 'chat_normal',
},
initHistory: historyList?.data
});
return (
<>
<ChatBoxComp
initialMessage={historyList?.data ? (historyList?.data?.length <= 0 ? props.searchParams?.initMessage : undefined) : undefined}
clearIntialMessage={async () => {
await refreshDialogList();
}}
messages={history || []}
onSubmit={handleChatSubmit}
paramsList={paramsList?.data}
/>
</>
)
}
export default AgentPage;

View File

@ -10,11 +10,11 @@ import SmartToyOutlinedIcon from '@mui/icons-material/SmartToyOutlined';
import Markdown from 'markdown-to-jsx';
import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter';
import { okaidia } from 'react-syntax-highlighter/dist/esm/styles/prism';
import { useSearchParams } from 'next/navigation';
type Props = {
messages: Message[];
onSubmit: (message: string, otherQueryBody?: any) => Promise<any>;
initialMessage?: string;
readOnly?: boolean;
paramsList?: { [key: string]: string };
clearIntialMessage?: () => void;
@ -25,12 +25,13 @@ const Schema = z.object({ query: z.string().min(1) });
const ChatBoxComp = ({
messages,
onSubmit,
initialMessage,
readOnly,
paramsList,
clearIntialMessage
}: Props) => {
const { mode } = useColorScheme();
const searchParams = useSearchParams();
const initMessage = searchParams.get('initMessage');
const scrollableRef = React.useRef<HTMLDivElement>(null);
const [isLoading, setIsLoading] = useState(false);
const [currentParam, setCurrentParam] = useState<string | undefined | null>();
@ -42,6 +43,7 @@ const ChatBoxComp = ({
const submit = async ({ query }: z.infer<typeof Schema>) => {
try {
console.log('submit');
setIsLoading(true);
methods.reset();
await onSubmit(query, {
@ -55,10 +57,11 @@ const ChatBoxComp = ({
const handleInitMessage = async () => {
try {
const searchParams = new URLSearchParams(window.location.search);
searchParams.delete('initMessage');
window.history.replaceState(null, null, `?${searchParams.toString()}`);
await submit({ query: (initialMessage as string) });
const searchParamsTemp = new URLSearchParams(window.location.search);
const initMessage = searchParamsTemp.get('initMessage');
searchParamsTemp.delete('initMessage');
window.history.replaceState(null, null, `?${searchParamsTemp.toString()}`);
await submit({ query: (initMessage as string) });
} catch (err) {
console.log(err);
} finally {
@ -83,12 +86,12 @@ const ChatBoxComp = ({
scrollableRef.current.scrollTo(0, scrollableRef.current.scrollHeight);
}, [messages?.length]);
React.useEffect(() => {
if (initialMessage && messages.length <= 0) {
if (initMessage && messages.length <= 0) {
handleInitMessage();
}
}, [initialMessage]);
}, [initMessage, messages.length]);
React.useEffect(() => {
if (paramsList && Object.keys(paramsList || {})?.length > 0) {

View File

@ -130,7 +130,7 @@ const LeftSider = () => {
<ListItemContent>
<Link href={`/chat?id=${each.conv_uid}&scene=${each?.chat_mode}`} className="flex items-center justify-between">
<Typography fontSize={14} noWrap={true}>
<SmsOutlinedIcon className='mr-2' />
<SmsOutlinedIcon style={{ marginRight: '0.5rem' }} />
{each?.user_name || each?.user_input || 'undefined'}
</Typography>
<IconButton
@ -146,7 +146,7 @@ const LeftSider = () => {
width: '276px',
centered: true,
async onOk() {
await sendPostRequest(`v1/chat/dialogue/delete?con_uid=${each.conv_uid}`);
await sendPostRequest(`/v1/chat/dialogue/delete?con_uid=${each.conv_uid}`);
await refreshDialogList();
if (pathname === `/chat` && searchParams.get('id') === each.conv_uid) {
router.push('/');

View File

@ -8,7 +8,7 @@ export const joyTheme = extendTheme({
mode: 'dark',
primary: {
...colors.grey,
solidBg: '#dfdfdf91',
solidBg: '#9a9a9a91',
solidColor: '#4e4e4e',
solidHoverBg: '#d5d5d5',
outlinedColor: '#4e4e59'
@ -36,7 +36,9 @@ export const joyTheme = extendTheme({
...colors.grey,
softBg: '#353539',
softHoverBg: '#35353978',
softDisabledBg: '#353539'
softDisabledBg: '#353539',
solidBg: '#434356',
solidHoverBg: '#5a5a72',
},
neutral: {
plainColor: '#D8D8DF',

View File

@ -49,7 +49,7 @@ import { useDialogueContext } from '@/app/context/dialogue';
const ctrl = new AbortController();
let buffer = '';
await fetchEventSource(`${process.env.API_BASE_URL + queryAgentURL}`, {
await fetchEventSource(`${process.env.API_BASE_URL + "/api" + queryAgentURL}`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',

View File

@ -8,7 +8,7 @@ const nextConfig = {
ignoreBuildErrors: true
},
env: {
API_BASE_URL: process.env.API_BASE_URL || 'http://localhost:5000'
API_BASE_URL: process.env.API_BASE_URL || 'https://u158074-879a-d00019a9.westa.seetacloud.com:8443'
}
}

View File

@ -30,7 +30,7 @@ export const sendGetRequest = (url: string, qs?: { [key: string]: any }) => {
url += `?${str}`;
}
}
return axios.get(url, {
return axios.get("/api" + url, {
headers: DEFAULT_HEADERS
}).then(res => res).catch(err => {
message.error(err);
@ -40,7 +40,7 @@ export const sendGetRequest = (url: string, qs?: { [key: string]: any }) => {
export const sendPostRequest = (url: string, body?: any) => {
const reqBody = sanitizeBody(body);
return axios.post(url, {
return axios.post("/api" + url, {
body: reqBody,
headers: DEFAULT_HEADERS
}).then(res => res).catch(err => {

View File

@ -33,9 +33,6 @@ class SourceEmbedding(ABC):
self.vector_store_config = vector_store_config
self.embedding_args = embedding_args
self.embeddings = vector_store_config["embeddings"]
self.vector_client = VectorStoreConnector(
CFG.VECTOR_STORE_TYPE, vector_store_config
)
@abstractmethod
@register
@ -59,11 +56,17 @@ class SourceEmbedding(ABC):
@register
def index_to_store(self, docs):
"""index to vector store"""
return self.vector_client.load_document(docs)
self.vector_client = VectorStoreConnector(
CFG.VECTOR_STORE_TYPE, self.vector_store_config
)
self.vector_client.load_document(docs)
@register
def similar_search(self, doc, topk):
"""vector store similarity_search"""
self.vector_client = VectorStoreConnector(
CFG.VECTOR_STORE_TYPE, self.vector_store_config
)
try:
ans = self.vector_client.similar_search(doc, topk)
except NotEnoughElementsException:
@ -71,6 +74,9 @@ class SourceEmbedding(ABC):
return ans
def vector_name_exist(self):
self.vector_client = VectorStoreConnector(
CFG.VECTOR_STORE_TYPE, self.vector_store_config
)
return self.vector_client.vector_name_exists()
def source_embedding(self):

View File

@ -53,7 +53,7 @@ async def validation_exception_handler(request: Request, exc: RequestValidationE
message = ""
for error in exc.errors():
message += ".".join(error.get("loc")) + ":" + error.get("msg") + ";"
return Result.faild(msg=message)
return Result.faild(code= "E0001", msg=message)
def __get_conv_user_message(conversations: dict):
@ -96,9 +96,9 @@ def knowledge_list():
return params
@router.get("/")
async def read_main():
return FileResponse(f"{static_file_path}/index.html")
# @router.get("/")
# async def read_main():
# return FileResponse(f"{static_file_path}/index.html")
@router.get("/v1/chat/dialogue/list", response_model=Result[ConversationVo])

View File

@ -34,7 +34,7 @@ class ConversationVo(BaseModel):
dialogue_uid
"""
conv_uid: str = Field(..., description="dialogue uid")
conv_uid: str = ""
"""
user input
"""
@ -46,7 +46,7 @@ class ConversationVo(BaseModel):
"""
the scene of chat
"""
chat_mode: str = Field(..., description="the scene of chat ")
chat_mode: str = ""
"""
chat scene select param

View File

@ -39,7 +39,6 @@ from pilot.scene.base_message import (
ViewMessage,
)
from pilot.configs.config import Config
from pilot.server.llmserver import worker
logger = build_logger("BaseChat", LOGDIR + "BaseChat.log")
headers = {"User-Agent": "dbgpt Client"}
@ -143,6 +142,7 @@ class BaseChat(ABC):
)
return response
else:
from pilot.server.llmserver import worker
return worker.generate_stream_gate(payload)
except Exception as e:
print(traceback.format_exc())
@ -168,6 +168,7 @@ class BaseChat(ABC):
)
else:
###TODO no stream mode need independent
from pilot.server.llmserver import worker
output = worker.generate_stream_gate(payload)
for rsp in output:
rsp_str = str(rsp, "utf-8")

View File

@ -65,11 +65,19 @@ app.add_middleware(
allow_headers=["*"],
)
app.mount("/_next/static", StaticFiles(directory=static_file_path + "/_next/static", html=True))
app.mount("/static", StaticFiles(directory=static_file_path), name="static2")
app.include_router(knowledge_router)
app.include_router(api_v1, prefix="/api")
app.include_router(knowledge_router, prefix="/api")
app.include_router(api_v1)
app.include_router(knowledge_router)
app.mount("/static", StaticFiles(directory=static_file_path), name="static")
app.mount("/_next/static", StaticFiles(directory=static_file_path + "/_next/static"))
app.mount("/", StaticFiles(directory=static_file_path, html=True), name="static")
app.add_exception_handler(RequestValidationError, validation_exception_handler)
if __name__ == "__main__":
@ -87,6 +95,9 @@ if __name__ == "__main__":
# init server config
args = parser.parse_args()
from pilot.server.llmserver import worker
worker.start_check()
server_init(args)
CFG.NEW_SERVER_MODE = True
import uvicorn

View File

@ -1 +1 @@
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><title>404: This page could not be found</title><meta name="next-head-count" content="3"/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js"></script><script src="/_next/static/chunks/webpack-24270a861878a52b.js" defer=""></script><script src="/_next/static/chunks/framework-43665103d101a22d.js" defer=""></script><script src="/_next/static/chunks/main-4d516eb54537b10d.js" defer=""></script><script src="/_next/static/chunks/pages/_app-1f2755172264764d.js" defer=""></script><script src="/_next/static/chunks/pages/_error-f5357f382422dd96.js" defer=""></script><script src="/_next/static/88tBPZRhns7FgumS5knsE/_buildManifest.js" defer=""></script><script src="/_next/static/88tBPZRhns7FgumS5knsE/_ssgManifest.js" defer=""></script></head><body><div id="__next"><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">This page could not be found<!-- -->.</h2></div></div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":404}},"page":"/_error","query":{},"buildId":"88tBPZRhns7FgumS5knsE","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><title>404: This page could not be found</title><meta name="next-head-count" content="3"/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js"></script><script src="/_next/static/chunks/webpack-df861d847f51bde9.js" defer=""></script><script src="/_next/static/chunks/framework-43665103d101a22d.js" defer=""></script><script src="/_next/static/chunks/main-66255ab057ead764.js" defer=""></script><script src="/_next/static/chunks/pages/_app-1f2755172264764d.js" defer=""></script><script src="/_next/static/chunks/pages/_error-f5357f382422dd96.js" defer=""></script><script src="/_next/static/G8l4Pp61aoRoPGwULWvrz/_buildManifest.js" defer=""></script><script src="/_next/static/G8l4Pp61aoRoPGwULWvrz/_ssgManifest.js" defer=""></script></head><body><div id="__next"><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">This page could not be found<!-- -->.</h2></div></div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":404}},"page":"/_error","query":{},"buildId":"G8l4Pp61aoRoPGwULWvrz","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,9 +0,0 @@
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[920],{20704:function(e,t,n){Promise.resolve().then(n.bind(n,93516))},93516:function(e,t,n){"use strict";n.r(t);var r=n(9268),l=n(51213),u=n.n(l);let o=u()(()=>Promise.all([n.e(180),n.e(448),n.e(22),n.e(86),n.e(93),n.e(259),n.e(751),n.e(234),n.e(702)]).then(n.bind(n,49702)),{loadableGenerated:{webpack:()=>[49702]},loading:()=>(0,r.jsx)("p",{children:"Loading..."}),ssr:!1});t.default=e=>(0,r.jsx)(o,{...e})},51213:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o}});let r=n(26927);n(86006);let l=r._(n(91354));function u(e){return{default:(null==e?void 0:e.default)||e}}function o(e,t){let n=l.default,r={loading:e=>{let{error:t,isLoading:n,pastDelay:r}=e;return null}};"function"==typeof e&&(r.loader=e),Object.assign(r,t);let o=r.loader;return n({...r,loader:()=>null!=o?o().then(u):Promise.resolve(u(()=>null))})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},23238:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{suspense:function(){return l},NoSSR:function(){return u}}),n(26927),n(86006);let r=n(65978);function l(){let e=Error(r.NEXT_DYNAMIC_NO_SSR_CODE);throw e.digest=r.NEXT_DYNAMIC_NO_SSR_CODE,e}function u(e){let{children:t}=e;return t}},91354:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o}});let r=n(26927),l=r._(n(86006)),u=n(23238),o=function(e){let t=Object.assign({loader:null,loading:null,ssr:!0},e);function n(e){let n=t.loading,r=l.default.createElement(n,{isLoading:!0,pastDelay:!0,error:null}),o=t.ssr?l.default.Fragment:u.NoSSR,a=t.lazy;return l.default.createElement(l.default.Suspense,{fallback:r},l.default.createElement(o,null,l.default.createElement(a,e)))}return t.lazy=l.default.lazy(t.loader),n.displayName="LoadableComponent",n}},83177:function(e,t,n){"use strict";/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var r=n(86006),l=Symbol.for("react.element"),u=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,f={key:!0,ref:!0,__self:!0,__source:!0};function i(e,t,n){var r,u={},i=null,s=null;for(r in void 0!==n&&(i=""+n),void 0!==t.key&&(i=""+t.key),void 0!==t.ref&&(s=t.ref),t)o.call(t,r)&&!f.hasOwnProperty(r)&&(u[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===u[r]&&(u[r]=t[r]);return{$$typeof:l,type:e,key:i,ref:s,props:u,_owner:a.current}}t.Fragment=u,t.jsx=i,t.jsxs=i},9268:function(e,t,n){"use strict";e.exports=n(83177)}},function(e){e.O(0,[253,769,744],function(){return e(e.s=20704)}),_N_E=e.O()}]);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,9 @@
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[929],{84380:function(e,t,n){Promise.resolve().then(n.bind(n,87329))},87329:function(e,t,n){"use strict";n.r(t);var r=n(9268),l=n(51213),u=n.n(l);let o=u()(()=>Promise.all([n.e(180),n.e(430),n.e(577),n.e(635),n.e(86),n.e(562),n.e(259),n.e(751),n.e(662),n.e(620)]).then(n.bind(n,69620)),{loadableGenerated:{webpack:()=>[69620]},loading:()=>(0,r.jsx)("p",{children:"Loading..."}),ssr:!1});t.default=e=>(0,r.jsx)(o,{...e})},51213:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o}});let r=n(26927);n(86006);let l=r._(n(91354));function u(e){return{default:(null==e?void 0:e.default)||e}}function o(e,t){let n=l.default,r={loading:e=>{let{error:t,isLoading:n,pastDelay:r}=e;return null}};"function"==typeof e&&(r.loader=e),Object.assign(r,t);let o=r.loader;return n({...r,loader:()=>null!=o?o().then(u):Promise.resolve(u(()=>null))})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},23238:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{suspense:function(){return l},NoSSR:function(){return u}}),n(26927),n(86006);let r=n(65978);function l(){let e=Error(r.NEXT_DYNAMIC_NO_SSR_CODE);throw e.digest=r.NEXT_DYNAMIC_NO_SSR_CODE,e}function u(e){let{children:t}=e;return t}},91354:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o}});let r=n(26927),l=r._(n(86006)),u=n(23238),o=function(e){let t=Object.assign({loader:null,loading:null,ssr:!0},e);function n(e){let n=t.loading,r=l.default.createElement(n,{isLoading:!0,pastDelay:!0,error:null}),o=t.ssr?l.default.Fragment:u.NoSSR,a=t.lazy;return l.default.createElement(l.default.Suspense,{fallback:r},l.default.createElement(o,null,l.default.createElement(a,e)))}return t.lazy=l.default.lazy(t.loader),n.displayName="LoadableComponent",n}},83177:function(e,t,n){"use strict";/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var r=n(86006),l=Symbol.for("react.element"),u=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,f={key:!0,ref:!0,__self:!0,__source:!0};function i(e,t,n){var r,u={},i=null,s=null;for(r in void 0!==n&&(i=""+n),void 0!==t.key&&(i=""+t.key),void 0!==t.ref&&(s=t.ref),t)o.call(t,r)&&!f.hasOwnProperty(r)&&(u[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===u[r]&&(u[r]=t[r]);return{$$typeof:l,type:e,key:i,ref:s,props:u,_owner:a.current}}t.Fragment=u,t.jsx=i,t.jsxs=i},9268:function(e,t,n){"use strict";e.exports=n(83177)}},function(e){e.O(0,[253,769,744],function(){return e(e.s=84380)}),_N_E=e.O()}]);

View File

@ -0,0 +1 @@
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[538],{55254:function(e,t,n){Promise.resolve().then(n.bind(n,26257))},26257:function(e,t,n){"use strict";n.r(t);var a=n(9268),i=n(56008),s=n(86006),o=n(78635),c=n(70900),r=n(44334),l=n(311),d=n(22046),h=n(83192),u=n(23910),g=n(1031);t.default=()=>{let e=(0,i.useRouter)(),{mode:t}=(0,o.tv)(),n=(0,i.useSearchParams)().get("spacename"),x=(0,i.useSearchParams)().get("documentid"),[j,p]=(0,s.useState)(0),[m,f]=(0,s.useState)(0),[S,y]=(0,s.useState)([]);return(0,s.useEffect)(()=>{(async function(){let e=await fetch("".concat("http://localhost:5000","/knowledge/").concat(n,"/chunk/list"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({document_id:x,page:1,page_size:20})}),t=await e.json();t.success&&(y(t.data.data),p(t.data.total),f(t.data.page))})()},[]),(0,a.jsxs)("div",{className:"p-4",children:[(0,a.jsx)(c.Z,{direction:"row",justifyContent:"flex-start",alignItems:"center",sx:{marginBottom:"20px"},children:(0,a.jsxs)(r.Z,{"aria-label":"breadcrumbs",children:[(0,a.jsx)(l.Z,{onClick:()=>{e.push("/datastores")},underline:"hover",color:"neutral",fontSize:"inherit",children:"Knowledge Space"},"Knowledge Space"),(0,a.jsx)(l.Z,{onClick:()=>{e.push("/datastores/documents?name=".concat(n))},underline:"hover",color:"neutral",fontSize:"inherit",children:"Documents"},"Knowledge Space"),(0,a.jsx)(d.ZP,{fontSize:"inherit",children:"Chunks"})]})}),(0,a.jsx)("div",{className:"p-4",children:S.length?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(h.Z,{color:"primary",variant:"plain",size:"lg",sx:{"& tbody tr: hover":{backgroundColor:"light"===t?"rgb(246, 246, 246)":"rgb(33, 33, 40)"},"& tbody tr: hover a":{textDecoration:"underline"}},children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{children:"Name"}),(0,a.jsx)("th",{children:"Content"}),(0,a.jsx)("th",{children:"Meta Data"})]})}),(0,a.jsx)("tbody",{children:S.map(e=>(0,a.jsxs)("tr",{children:[(0,a.jsx)("td",{children:e.doc_name}),(0,a.jsx)("td",{children:(0,a.jsx)(u.Z,{content:e.content,trigger:"hover",children:e.content.length>10?"".concat(e.content.slice(0,10),"..."):e.content})}),(0,a.jsx)("td",{children:(0,a.jsx)(u.Z,{content:JSON.stringify(e.meta_info||"{}",null,2),trigger:"hover",children:e.meta_info.length>10?"".concat(e.meta_info.slice(0,10),"..."):e.meta_info})})]},e.id))})]}),(0,a.jsx)(c.Z,{direction:"row",justifyContent:"flex-end",sx:{marginTop:"20px"},children:(0,a.jsx)(g.Z,{defaultPageSize:20,showSizeChanger:!1,current:m,total:j,onChange:async e=>{let t=await fetch("".concat("http://localhost:5000","/knowledge/").concat(n,"/chunk/list"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({document_id:x,page:e,page_size:20})}),a=await t.json();a.success&&(y(a.data.data),p(a.data.total),f(a.data.page))},hideOnSinglePage:!0})})]}):(0,a.jsx)(a.Fragment,{})})]})}}},function(e){e.O(0,[430,635,456,585,440,232,253,769,744],function(){return e(e.s=55254)}),_N_E=e.O()}]);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
!function(){"use strict";var e,t,n,r,o,u,i,c,f,a={},d={};function l(e){var t=d[e];if(void 0!==t)return t.exports;var n=d[e]={id:e,loaded:!1,exports:{}},r=!0;try{a[e].call(n.exports,n,n.exports,l),r=!1}finally{r&&delete d[e]}return n.loaded=!0,n.exports}l.m=a,e=[],l.O=function(t,n,r,o){if(n){o=o||0;for(var u=e.length;u>0&&e[u-1][2]>o;u--)e[u]=e[u-1];e[u]=[n,r,o];return}for(var i=1/0,u=0;u<e.length;u++){for(var n=e[u][0],r=e[u][1],o=e[u][2],c=!0,f=0;f<n.length;f++)i>=o&&Object.keys(l.O).every(function(e){return l.O[e](n[f])})?n.splice(f--,1):(c=!1,o<i&&(i=o));if(c){e.splice(u--,1);var a=r();void 0!==a&&(t=a)}}return t},l.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(t,{a:t}),t},n=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},l.t=function(e,r){if(1&r&&(e=this(e)),8&r||"object"==typeof e&&e&&(4&r&&e.__esModule||16&r&&"function"==typeof e.then))return e;var o=Object.create(null);l.r(o);var u={};t=t||[null,n({}),n([]),n(n)];for(var i=2&r&&e;"object"==typeof i&&!~t.indexOf(i);i=n(i))Object.getOwnPropertyNames(i).forEach(function(t){u[t]=function(){return e[t]}});return u.default=function(){return e},l.d(o,u),o},l.d=function(e,t){for(var n in t)l.o(t,n)&&!l.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},l.f={},l.e=function(e){return Promise.all(Object.keys(l.f).reduce(function(t,n){return l.f[n](e,t),t},[]))},l.u=function(e){return 702===e?"static/chunks/702.d4f5815f0f061322.js":"static/chunks/"+(180===e?"0e02fca3":e)+"-"+({22:"703ba16bc0ddc40c",86:"3a20bc6b78835c59",93:"d96460b174626309",180:"615d0d51fa074d92",234:"8eba541fbdf57ced",259:"2c3490a9eca2f411",448:"f3a26a5f721e5a66",751:"9808572c67f2351c"})[e]+".js"},l.miniCssF=function(e){return"static/css/1a8d71ce4977c414.css"},l.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r={},o="_N_E:",l.l=function(e,t,n,u){if(r[e]){r[e].push(t);return}if(void 0!==n)for(var i,c,f=document.getElementsByTagName("script"),a=0;a<f.length;a++){var d=f[a];if(d.getAttribute("src")==e||d.getAttribute("data-webpack")==o+n){i=d;break}}i||(c=!0,(i=document.createElement("script")).charset="utf-8",i.timeout=120,l.nc&&i.setAttribute("nonce",l.nc),i.setAttribute("data-webpack",o+n),i.src=l.tu(e)),r[e]=[t];var s=function(t,n){i.onerror=i.onload=null,clearTimeout(p);var o=r[e];if(delete r[e],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach(function(e){return e(n)}),t)return t(n)},p=setTimeout(s.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=s.bind(null,i.onerror),i.onload=s.bind(null,i.onload),c&&document.head.appendChild(i)},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e},l.tt=function(){return void 0===u&&(u={createScriptURL:function(e){return e}},"undefined"!=typeof trustedTypes&&trustedTypes.createPolicy&&(u=trustedTypes.createPolicy("nextjs#bundler",u))),u},l.tu=function(e){return l.tt().createScriptURL(e)},l.p="/_next/",i={272:0},l.f.j=function(e,t){var n=l.o(i,e)?i[e]:void 0;if(0!==n){if(n)t.push(n[2]);else if(272!=e){var r=new Promise(function(t,r){n=i[e]=[t,r]});t.push(n[2]=r);var o=l.p+l.u(e),u=Error();l.l(o,function(t){if(l.o(i,e)&&(0!==(n=i[e])&&(i[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;u.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",u.name="ChunkLoadError",u.type=r,u.request=o,n[1](u)}},"chunk-"+e,e)}else i[e]=0}},l.O.j=function(e){return 0===i[e]},c=function(e,t){var n,r,o=t[0],u=t[1],c=t[2],f=0;if(o.some(function(e){return 0!==i[e]})){for(n in u)l.o(u,n)&&(l.m[n]=u[n]);if(c)var a=c(l)}for(e&&e(t);f<o.length;f++)r=o[f],l.o(i,r)&&i[r]&&i[r][0](),i[r]=0;return l.O(a)},(f=self.webpackChunk_N_E=self.webpackChunk_N_E||[]).forEach(c.bind(null,0)),f.push=c.bind(null,f.push.bind(f))}();

View File

@ -0,0 +1 @@
!function(){"use strict";var e,t,n,r,o,u,c,i,f,a={},d={};function l(e){var t=d[e];if(void 0!==t)return t.exports;var n=d[e]={id:e,loaded:!1,exports:{}},r=!0;try{a[e].call(n.exports,n,n.exports,l),r=!1}finally{r&&delete d[e]}return n.loaded=!0,n.exports}l.m=a,e=[],l.O=function(t,n,r,o){if(n){o=o||0;for(var u=e.length;u>0&&e[u-1][2]>o;u--)e[u]=e[u-1];e[u]=[n,r,o];return}for(var c=1/0,u=0;u<e.length;u++){for(var n=e[u][0],r=e[u][1],o=e[u][2],i=!0,f=0;f<n.length;f++)c>=o&&Object.keys(l.O).every(function(e){return l.O[e](n[f])})?n.splice(f--,1):(i=!1,o<c&&(c=o));if(i){e.splice(u--,1);var a=r();void 0!==a&&(t=a)}}return t},l.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(t,{a:t}),t},n=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},l.t=function(e,r){if(1&r&&(e=this(e)),8&r||"object"==typeof e&&e&&(4&r&&e.__esModule||16&r&&"function"==typeof e.then))return e;var o=Object.create(null);l.r(o);var u={};t=t||[null,n({}),n([]),n(n)];for(var c=2&r&&e;"object"==typeof c&&!~t.indexOf(c);c=n(c))Object.getOwnPropertyNames(c).forEach(function(t){u[t]=function(){return e[t]}});return u.default=function(){return e},l.d(o,u),o},l.d=function(e,t){for(var n in t)l.o(t,n)&&!l.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},l.f={},l.e=function(e){return Promise.all(Object.keys(l.f).reduce(function(t,n){return l.f[n](e,t),t},[]))},l.u=function(e){return 620===e?"static/chunks/620.539117410db93b23.js":"static/chunks/"+(180===e?"0e02fca3":e)+"-"+({86:"3a20bc6b78835c59",180:"615d0d51fa074d92",259:"2c3490a9eca2f411",430:"bb3a86cc36f88444",562:"967d90db5cfc2e85",577:"98027453991b6c69",635:"b9a05804c40d9a36",662:"6f651dffca342bc9",751:"9808572c67f2351c"})[e]+".js"},l.miniCssF=function(e){return"static/css/a4b50755e0d5ba2a.css"},l.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r={},o="_N_E:",l.l=function(e,t,n,u){if(r[e]){r[e].push(t);return}if(void 0!==n)for(var c,i,f=document.getElementsByTagName("script"),a=0;a<f.length;a++){var d=f[a];if(d.getAttribute("src")==e||d.getAttribute("data-webpack")==o+n){c=d;break}}c||(i=!0,(c=document.createElement("script")).charset="utf-8",c.timeout=120,l.nc&&c.setAttribute("nonce",l.nc),c.setAttribute("data-webpack",o+n),c.src=l.tu(e)),r[e]=[t];var s=function(t,n){c.onerror=c.onload=null,clearTimeout(p);var o=r[e];if(delete r[e],c.parentNode&&c.parentNode.removeChild(c),o&&o.forEach(function(e){return e(n)}),t)return t(n)},p=setTimeout(s.bind(null,void 0,{type:"timeout",target:c}),12e4);c.onerror=s.bind(null,c.onerror),c.onload=s.bind(null,c.onload),i&&document.head.appendChild(c)},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e},l.tt=function(){return void 0===u&&(u={createScriptURL:function(e){return e}},"undefined"!=typeof trustedTypes&&trustedTypes.createPolicy&&(u=trustedTypes.createPolicy("nextjs#bundler",u))),u},l.tu=function(e){return l.tt().createScriptURL(e)},l.p="/_next/",c={272:0},l.f.j=function(e,t){var n=l.o(c,e)?c[e]:void 0;if(0!==n){if(n)t.push(n[2]);else if(272!=e){var r=new Promise(function(t,r){n=c[e]=[t,r]});t.push(n[2]=r);var o=l.p+l.u(e),u=Error();l.l(o,function(t){if(l.o(c,e)&&(0!==(n=c[e])&&(c[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;u.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",u.name="ChunkLoadError",u.type=r,u.request=o,n[1](u)}},"chunk-"+e,e)}else c[e]=0}},l.O.j=function(e){return 0===c[e]},i=function(e,t){var n,r,o=t[0],u=t[1],i=t[2],f=0;if(o.some(function(e){return 0!==c[e]})){for(n in u)l.o(u,n)&&(l.m[n]=u[n]);if(i)var a=i(l)}for(e&&e(t);f<o.length;f++)r=o[f],l.o(c,r)&&c[r]&&c[r][0](),c[r]=0;return l.O(a)},(f=self.webpackChunk_N_E=self.webpackChunk_N_E||[]).forEach(i.bind(null,0)),f.push=i.bind(null,f.push.bind(f))}();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,9 +1,9 @@
1:HL["/_next/static/css/1a8d71ce4977c414.css",{"as":"style"}]
0:["88tBPZRhns7FgumS5knsE",[[["",{"children":["agents",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],"$L2",[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/1a8d71ce4977c414.css","precedence":"next"}]],["$L3",null]]]]]
4:I{"id":"50902","chunks":["180:static/chunks/0e02fca3-615d0d51fa074d92.js","448:static/chunks/448-f3a26a5f721e5a66.js","22:static/chunks/22-703ba16bc0ddc40c.js","599:static/chunks/599-3961dce1841e3605.js","93:static/chunks/93-d96460b174626309.js","952:static/chunks/952-2dc4f0545dc6908d.js","261:static/chunks/261-cafe8fb2d045b3ac.js","751:static/chunks/751-9808572c67f2351c.js","66:static/chunks/66-a59692966e930d12.js","185:static/chunks/app/layout-7dd71906a9fa8a24.js"],"name":"","async":false}
5:I{"id":"13211","chunks":["272:static/chunks/webpack-24270a861878a52b.js","253:static/chunks/bce60fc1-18c9f145b45d8f36.js","769:static/chunks/769-5cc40fd35d2e3ebe.js"],"name":"","async":false}
6:I{"id":"5767","chunks":["272:static/chunks/webpack-24270a861878a52b.js","253:static/chunks/bce60fc1-18c9f145b45d8f36.js","769:static/chunks/769-5cc40fd35d2e3ebe.js"],"name":"","async":false}
7:I{"id":"37396","chunks":["272:static/chunks/webpack-24270a861878a52b.js","253:static/chunks/bce60fc1-18c9f145b45d8f36.js","769:static/chunks/769-5cc40fd35d2e3ebe.js"],"name":"","async":false}
8:I{"id":"68947","chunks":["180:static/chunks/0e02fca3-615d0d51fa074d92.js","757:static/chunks/f60284a2-6891068c9ea7ce77.js","448:static/chunks/448-f3a26a5f721e5a66.js","22:static/chunks/22-703ba16bc0ddc40c.js","86:static/chunks/86-3a20bc6b78835c59.js","93:static/chunks/93-d96460b174626309.js","259:static/chunks/259-2c3490a9eca2f411.js","751:static/chunks/751-9808572c67f2351c.js","234:static/chunks/234-8eba541fbdf57ced.js","947:static/chunks/947-209ba7aac7928863.js","718:static/chunks/app/agents/page-4286c92088ccc4e9.js"],"name":"","async":false}
1:HL["/_next/static/css/a4b50755e0d5ba2a.css",{"as":"style"}]
0:["G8l4Pp61aoRoPGwULWvrz",[[["",{"children":["agents",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],"$L2",[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/a4b50755e0d5ba2a.css","precedence":"next"}]],["$L3",null]]]]]
4:I{"id":"50902","chunks":["180:static/chunks/0e02fca3-615d0d51fa074d92.js","430:static/chunks/430-bb3a86cc36f88444.js","577:static/chunks/577-98027453991b6c69.js","635:static/chunks/635-b9a05804c40d9a36.js","562:static/chunks/562-967d90db5cfc2e85.js","456:static/chunks/456-3509097c86aa8e9a.js","440:static/chunks/440-96bb64772ec3a56d.js","672:static/chunks/672-860e1c1d53658862.js","751:static/chunks/751-9808572c67f2351c.js","216:static/chunks/216-66e88a07cca64650.js","185:static/chunks/app/layout-da5f0ec502fcb9db.js"],"name":"","async":false}
5:I{"id":"13211","chunks":["272:static/chunks/webpack-df861d847f51bde9.js","253:static/chunks/bce60fc1-18c9f145b45d8f36.js","769:static/chunks/769-5cc40fd35d2e3ebe.js"],"name":"","async":false}
6:I{"id":"5767","chunks":["272:static/chunks/webpack-df861d847f51bde9.js","253:static/chunks/bce60fc1-18c9f145b45d8f36.js","769:static/chunks/769-5cc40fd35d2e3ebe.js"],"name":"","async":false}
7:I{"id":"37396","chunks":["272:static/chunks/webpack-df861d847f51bde9.js","253:static/chunks/bce60fc1-18c9f145b45d8f36.js","769:static/chunks/769-5cc40fd35d2e3ebe.js"],"name":"","async":false}
8:I{"id":"4191","chunks":["180:static/chunks/0e02fca3-615d0d51fa074d92.js","757:static/chunks/f60284a2-6891068c9ea7ce77.js","430:static/chunks/430-bb3a86cc36f88444.js","577:static/chunks/577-98027453991b6c69.js","86:static/chunks/86-3a20bc6b78835c59.js","562:static/chunks/562-967d90db5cfc2e85.js","259:static/chunks/259-2c3490a9eca2f411.js","751:static/chunks/751-9808572c67f2351c.js","662:static/chunks/662-6f651dffca342bc9.js","481:static/chunks/481-dff870b22d66febc.js","718:static/chunks/app/agents/page-b042b218cb84ae55.js"],"name":"","async":false}
2:[["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","loading":"$undefined","loadingStyles":"$undefined","hasLoading":false,"template":["$","$L6",null,{}],"templateStyles":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","childProp":{"current":[["$","$L5",null,{"parallelRouterKey":"children","segmentPath":["children","agents","children"],"error":"$undefined","errorStyles":"$undefined","loading":"$undefined","loadingStyles":"$undefined","hasLoading":false,"template":["$","$L6",null,{}],"templateStyles":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","childProp":{"current":[["$","$L7",null,{"propsForComponent":{"params":{}},"Component":"$8"}],null],"segment":"__PAGE__"},"styles":[]}],null],"segment":"agents"},"styles":[]}],"params":{}}],null]
3:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","link","2",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"any"}]]

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,9 @@
1:HL["/_next/static/css/a4b50755e0d5ba2a.css",{"as":"style"}]
0:["G8l4Pp61aoRoPGwULWvrz",[[["",{"children":["chat",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],"$L2",[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/a4b50755e0d5ba2a.css","precedence":"next"}]],["$L3",null]]]]]
4:I{"id":"50902","chunks":["180:static/chunks/0e02fca3-615d0d51fa074d92.js","430:static/chunks/430-bb3a86cc36f88444.js","577:static/chunks/577-98027453991b6c69.js","635:static/chunks/635-b9a05804c40d9a36.js","562:static/chunks/562-967d90db5cfc2e85.js","456:static/chunks/456-3509097c86aa8e9a.js","440:static/chunks/440-96bb64772ec3a56d.js","672:static/chunks/672-860e1c1d53658862.js","751:static/chunks/751-9808572c67f2351c.js","216:static/chunks/216-66e88a07cca64650.js","185:static/chunks/app/layout-da5f0ec502fcb9db.js"],"name":"","async":false}
5:I{"id":"13211","chunks":["272:static/chunks/webpack-df861d847f51bde9.js","253:static/chunks/bce60fc1-18c9f145b45d8f36.js","769:static/chunks/769-5cc40fd35d2e3ebe.js"],"name":"","async":false}
6:I{"id":"5767","chunks":["272:static/chunks/webpack-df861d847f51bde9.js","253:static/chunks/bce60fc1-18c9f145b45d8f36.js","769:static/chunks/769-5cc40fd35d2e3ebe.js"],"name":"","async":false}
7:I{"id":"37396","chunks":["272:static/chunks/webpack-df861d847f51bde9.js","253:static/chunks/bce60fc1-18c9f145b45d8f36.js","769:static/chunks/769-5cc40fd35d2e3ebe.js"],"name":"","async":false}
8:I{"id":"87329","chunks":["929:static/chunks/app/chat/page-45ff75b6f5c7fb3c.js"],"name":"","async":false}
2:[["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","loading":"$undefined","loadingStyles":"$undefined","hasLoading":false,"template":["$","$L6",null,{}],"templateStyles":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","childProp":{"current":["$","$L5",null,{"parallelRouterKey":"children","segmentPath":["children","chat","children"],"error":"$undefined","errorStyles":"$undefined","loading":"$undefined","loadingStyles":"$undefined","hasLoading":false,"template":["$","$L6",null,{}],"templateStyles":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","childProp":{"current":[["$","$L7",null,{"propsForComponent":{"params":{}},"Component":"$8"}],null],"segment":"__PAGE__"},"styles":[]}],"segment":"chat"},"styles":[]}],"params":{}}],null]
3:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","link","2",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"any"}]]

File diff suppressed because one or more lines are too long

View File

@ -1,9 +1,9 @@
1:HL["/_next/static/css/1a8d71ce4977c414.css",{"as":"style"}]
0:["88tBPZRhns7FgumS5knsE",[[["",{"children":["datastores",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],"$L2",[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/1a8d71ce4977c414.css","precedence":"next"}]],["$L3",null]]]]]
4:I{"id":"50902","chunks":["180:static/chunks/0e02fca3-615d0d51fa074d92.js","448:static/chunks/448-f3a26a5f721e5a66.js","22:static/chunks/22-703ba16bc0ddc40c.js","599:static/chunks/599-3961dce1841e3605.js","93:static/chunks/93-d96460b174626309.js","952:static/chunks/952-2dc4f0545dc6908d.js","261:static/chunks/261-cafe8fb2d045b3ac.js","751:static/chunks/751-9808572c67f2351c.js","66:static/chunks/66-a59692966e930d12.js","185:static/chunks/app/layout-7dd71906a9fa8a24.js"],"name":"","async":false}
5:I{"id":"13211","chunks":["272:static/chunks/webpack-24270a861878a52b.js","253:static/chunks/bce60fc1-18c9f145b45d8f36.js","769:static/chunks/769-5cc40fd35d2e3ebe.js"],"name":"","async":false}
6:I{"id":"5767","chunks":["272:static/chunks/webpack-24270a861878a52b.js","253:static/chunks/bce60fc1-18c9f145b45d8f36.js","769:static/chunks/769-5cc40fd35d2e3ebe.js"],"name":"","async":false}
7:I{"id":"37396","chunks":["272:static/chunks/webpack-24270a861878a52b.js","253:static/chunks/bce60fc1-18c9f145b45d8f36.js","769:static/chunks/769-5cc40fd35d2e3ebe.js"],"name":"","async":false}
8:I{"id":"44323","chunks":["448:static/chunks/448-f3a26a5f721e5a66.js","22:static/chunks/22-703ba16bc0ddc40c.js","599:static/chunks/599-3961dce1841e3605.js","86:static/chunks/86-3a20bc6b78835c59.js","952:static/chunks/952-2dc4f0545dc6908d.js","261:static/chunks/261-cafe8fb2d045b3ac.js","777:static/chunks/777-6762a9fec77c12c4.js","611:static/chunks/611-d8d91bbf74fb8a74.js","43:static/chunks/app/datastores/page-171d660b8104db30.js"],"name":"","async":false}
1:HL["/_next/static/css/a4b50755e0d5ba2a.css",{"as":"style"}]
0:["G8l4Pp61aoRoPGwULWvrz",[[["",{"children":["datastores",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],"$L2",[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/a4b50755e0d5ba2a.css","precedence":"next"}]],["$L3",null]]]]]
4:I{"id":"50902","chunks":["180:static/chunks/0e02fca3-615d0d51fa074d92.js","430:static/chunks/430-bb3a86cc36f88444.js","577:static/chunks/577-98027453991b6c69.js","635:static/chunks/635-b9a05804c40d9a36.js","562:static/chunks/562-967d90db5cfc2e85.js","456:static/chunks/456-3509097c86aa8e9a.js","440:static/chunks/440-96bb64772ec3a56d.js","672:static/chunks/672-860e1c1d53658862.js","751:static/chunks/751-9808572c67f2351c.js","216:static/chunks/216-66e88a07cca64650.js","185:static/chunks/app/layout-da5f0ec502fcb9db.js"],"name":"","async":false}
5:I{"id":"13211","chunks":["272:static/chunks/webpack-df861d847f51bde9.js","253:static/chunks/bce60fc1-18c9f145b45d8f36.js","769:static/chunks/769-5cc40fd35d2e3ebe.js"],"name":"","async":false}
6:I{"id":"5767","chunks":["272:static/chunks/webpack-df861d847f51bde9.js","253:static/chunks/bce60fc1-18c9f145b45d8f36.js","769:static/chunks/769-5cc40fd35d2e3ebe.js"],"name":"","async":false}
7:I{"id":"37396","chunks":["272:static/chunks/webpack-df861d847f51bde9.js","253:static/chunks/bce60fc1-18c9f145b45d8f36.js","769:static/chunks/769-5cc40fd35d2e3ebe.js"],"name":"","async":false}
8:I{"id":"44323","chunks":["430:static/chunks/430-bb3a86cc36f88444.js","577:static/chunks/577-98027453991b6c69.js","635:static/chunks/635-b9a05804c40d9a36.js","86:static/chunks/86-3a20bc6b78835c59.js","456:static/chunks/456-3509097c86aa8e9a.js","585:static/chunks/585-c91fc54776d36acd.js","672:static/chunks/672-860e1c1d53658862.js","816:static/chunks/816-d789aef0a8ccb438.js","43:static/chunks/app/datastores/page-026ae692a27f76d5.js"],"name":"","async":false}
2:[["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","loading":"$undefined","loadingStyles":"$undefined","hasLoading":false,"template":["$","$L6",null,{}],"templateStyles":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","childProp":{"current":["$","$L5",null,{"parallelRouterKey":"children","segmentPath":["children","datastores","children"],"error":"$undefined","errorStyles":"$undefined","loading":"$undefined","loadingStyles":"$undefined","hasLoading":false,"template":["$","$L6",null,{}],"templateStyles":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","childProp":{"current":[["$","$L7",null,{"propsForComponent":{"params":{}},"Component":"$8"}],null],"segment":"__PAGE__"},"styles":[]}],"segment":"datastores"},"styles":[]}],"params":{}}],null]
3:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","link","2",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"any"}]]

File diff suppressed because one or more lines are too long

View File

@ -1,9 +1,9 @@
1:HL["/_next/static/css/1a8d71ce4977c414.css",{"as":"style"}]
0:["88tBPZRhns7FgumS5knsE",[[["",{"children":["datastores",{"children":["documents",{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",true],"$L2",[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/1a8d71ce4977c414.css","precedence":"next"}]],["$L3",null]]]]]
4:I{"id":"50902","chunks":["180:static/chunks/0e02fca3-615d0d51fa074d92.js","448:static/chunks/448-f3a26a5f721e5a66.js","22:static/chunks/22-703ba16bc0ddc40c.js","599:static/chunks/599-3961dce1841e3605.js","93:static/chunks/93-d96460b174626309.js","952:static/chunks/952-2dc4f0545dc6908d.js","261:static/chunks/261-cafe8fb2d045b3ac.js","751:static/chunks/751-9808572c67f2351c.js","66:static/chunks/66-a59692966e930d12.js","185:static/chunks/app/layout-7dd71906a9fa8a24.js"],"name":"","async":false}
5:I{"id":"13211","chunks":["272:static/chunks/webpack-24270a861878a52b.js","253:static/chunks/bce60fc1-18c9f145b45d8f36.js","769:static/chunks/769-5cc40fd35d2e3ebe.js"],"name":"","async":false}
6:I{"id":"5767","chunks":["272:static/chunks/webpack-24270a861878a52b.js","253:static/chunks/bce60fc1-18c9f145b45d8f36.js","769:static/chunks/769-5cc40fd35d2e3ebe.js"],"name":"","async":false}
7:I{"id":"37396","chunks":["272:static/chunks/webpack-24270a861878a52b.js","253:static/chunks/bce60fc1-18c9f145b45d8f36.js","769:static/chunks/769-5cc40fd35d2e3ebe.js"],"name":"","async":false}
8:I{"id":"42069","chunks":["550:static/chunks/925f3d25-1af7259455ef26bd.js","448:static/chunks/448-f3a26a5f721e5a66.js","22:static/chunks/22-703ba16bc0ddc40c.js","599:static/chunks/599-3961dce1841e3605.js","86:static/chunks/86-3a20bc6b78835c59.js","952:static/chunks/952-2dc4f0545dc6908d.js","261:static/chunks/261-cafe8fb2d045b3ac.js","777:static/chunks/777-6762a9fec77c12c4.js","434:static/chunks/434-09f9dde89abf2ac7.js","611:static/chunks/611-d8d91bbf74fb8a74.js","470:static/chunks/app/datastores/documents/page-0b797043cfee212f.js"],"name":"","async":false}
1:HL["/_next/static/css/a4b50755e0d5ba2a.css",{"as":"style"}]
0:["G8l4Pp61aoRoPGwULWvrz",[[["",{"children":["datastores",{"children":["documents",{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",true],"$L2",[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/a4b50755e0d5ba2a.css","precedence":"next"}]],["$L3",null]]]]]
4:I{"id":"50902","chunks":["180:static/chunks/0e02fca3-615d0d51fa074d92.js","430:static/chunks/430-bb3a86cc36f88444.js","577:static/chunks/577-98027453991b6c69.js","635:static/chunks/635-b9a05804c40d9a36.js","562:static/chunks/562-967d90db5cfc2e85.js","456:static/chunks/456-3509097c86aa8e9a.js","440:static/chunks/440-96bb64772ec3a56d.js","672:static/chunks/672-860e1c1d53658862.js","751:static/chunks/751-9808572c67f2351c.js","216:static/chunks/216-66e88a07cca64650.js","185:static/chunks/app/layout-da5f0ec502fcb9db.js"],"name":"","async":false}
5:I{"id":"13211","chunks":["272:static/chunks/webpack-df861d847f51bde9.js","253:static/chunks/bce60fc1-18c9f145b45d8f36.js","769:static/chunks/769-5cc40fd35d2e3ebe.js"],"name":"","async":false}
6:I{"id":"5767","chunks":["272:static/chunks/webpack-df861d847f51bde9.js","253:static/chunks/bce60fc1-18c9f145b45d8f36.js","769:static/chunks/769-5cc40fd35d2e3ebe.js"],"name":"","async":false}
7:I{"id":"37396","chunks":["272:static/chunks/webpack-df861d847f51bde9.js","253:static/chunks/bce60fc1-18c9f145b45d8f36.js","769:static/chunks/769-5cc40fd35d2e3ebe.js"],"name":"","async":false}
8:I{"id":"42069","chunks":["550:static/chunks/925f3d25-1af7259455ef26bd.js","430:static/chunks/430-bb3a86cc36f88444.js","577:static/chunks/577-98027453991b6c69.js","635:static/chunks/635-b9a05804c40d9a36.js","86:static/chunks/86-3a20bc6b78835c59.js","456:static/chunks/456-3509097c86aa8e9a.js","585:static/chunks/585-c91fc54776d36acd.js","440:static/chunks/440-96bb64772ec3a56d.js","672:static/chunks/672-860e1c1d53658862.js","232:static/chunks/232-8f672ca290539d0e.js","816:static/chunks/816-d789aef0a8ccb438.js","470:static/chunks/app/datastores/documents/page-27ef6afeadf1a638.js"],"name":"","async":false}
2:[["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","loading":"$undefined","loadingStyles":"$undefined","hasLoading":false,"template":["$","$L6",null,{}],"templateStyles":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","childProp":{"current":["$","$L5",null,{"parallelRouterKey":"children","segmentPath":["children","datastores","children"],"error":"$undefined","errorStyles":"$undefined","loading":"$undefined","loadingStyles":"$undefined","hasLoading":false,"template":["$","$L6",null,{}],"templateStyles":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","childProp":{"current":["$","$L5",null,{"parallelRouterKey":"children","segmentPath":["children","datastores","children","documents","children"],"error":"$undefined","errorStyles":"$undefined","loading":"$undefined","loadingStyles":"$undefined","hasLoading":false,"template":["$","$L6",null,{}],"templateStyles":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","childProp":{"current":[["$","$L7",null,{"propsForComponent":{"params":{}},"Component":"$8"}],null],"segment":"__PAGE__"},"styles":[]}],"segment":"documents"},"styles":[]}],"segment":"datastores"},"styles":[]}],"params":{}}],null]
3:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","link","2",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"any"}]]

File diff suppressed because one or more lines are too long

View File

@ -1,9 +1,9 @@
1:HL["/_next/static/css/1a8d71ce4977c414.css",{"as":"style"}]
0:["88tBPZRhns7FgumS5knsE",[[["",{"children":["datastores",{"children":["documents",{"children":["chunklist",{"children":["__PAGE__",{}]}]}]}]},"$undefined","$undefined",true],"$L2",[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/1a8d71ce4977c414.css","precedence":"next"}]],["$L3",null]]]]]
4:I{"id":"50902","chunks":["180:static/chunks/0e02fca3-615d0d51fa074d92.js","448:static/chunks/448-f3a26a5f721e5a66.js","22:static/chunks/22-703ba16bc0ddc40c.js","599:static/chunks/599-3961dce1841e3605.js","93:static/chunks/93-d96460b174626309.js","952:static/chunks/952-2dc4f0545dc6908d.js","261:static/chunks/261-cafe8fb2d045b3ac.js","751:static/chunks/751-9808572c67f2351c.js","66:static/chunks/66-a59692966e930d12.js","185:static/chunks/app/layout-7dd71906a9fa8a24.js"],"name":"","async":false}
5:I{"id":"13211","chunks":["272:static/chunks/webpack-24270a861878a52b.js","253:static/chunks/bce60fc1-18c9f145b45d8f36.js","769:static/chunks/769-5cc40fd35d2e3ebe.js"],"name":"","async":false}
6:I{"id":"5767","chunks":["272:static/chunks/webpack-24270a861878a52b.js","253:static/chunks/bce60fc1-18c9f145b45d8f36.js","769:static/chunks/769-5cc40fd35d2e3ebe.js"],"name":"","async":false}
7:I{"id":"37396","chunks":["272:static/chunks/webpack-24270a861878a52b.js","253:static/chunks/bce60fc1-18c9f145b45d8f36.js","769:static/chunks/769-5cc40fd35d2e3ebe.js"],"name":"","async":false}
8:I{"id":"26257","chunks":["448:static/chunks/448-f3a26a5f721e5a66.js","599:static/chunks/599-3961dce1841e3605.js","952:static/chunks/952-2dc4f0545dc6908d.js","777:static/chunks/777-6762a9fec77c12c4.js","434:static/chunks/434-09f9dde89abf2ac7.js","538:static/chunks/app/datastores/documents/chunklist/page-65ded782e5468079.js"],"name":"","async":false}
1:HL["/_next/static/css/a4b50755e0d5ba2a.css",{"as":"style"}]
0:["G8l4Pp61aoRoPGwULWvrz",[[["",{"children":["datastores",{"children":["documents",{"children":["chunklist",{"children":["__PAGE__",{}]}]}]}]},"$undefined","$undefined",true],"$L2",[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/a4b50755e0d5ba2a.css","precedence":"next"}]],["$L3",null]]]]]
4:I{"id":"50902","chunks":["180:static/chunks/0e02fca3-615d0d51fa074d92.js","430:static/chunks/430-bb3a86cc36f88444.js","577:static/chunks/577-98027453991b6c69.js","635:static/chunks/635-b9a05804c40d9a36.js","562:static/chunks/562-967d90db5cfc2e85.js","456:static/chunks/456-3509097c86aa8e9a.js","440:static/chunks/440-96bb64772ec3a56d.js","672:static/chunks/672-860e1c1d53658862.js","751:static/chunks/751-9808572c67f2351c.js","216:static/chunks/216-66e88a07cca64650.js","185:static/chunks/app/layout-da5f0ec502fcb9db.js"],"name":"","async":false}
5:I{"id":"13211","chunks":["272:static/chunks/webpack-df861d847f51bde9.js","253:static/chunks/bce60fc1-18c9f145b45d8f36.js","769:static/chunks/769-5cc40fd35d2e3ebe.js"],"name":"","async":false}
6:I{"id":"5767","chunks":["272:static/chunks/webpack-df861d847f51bde9.js","253:static/chunks/bce60fc1-18c9f145b45d8f36.js","769:static/chunks/769-5cc40fd35d2e3ebe.js"],"name":"","async":false}
7:I{"id":"37396","chunks":["272:static/chunks/webpack-df861d847f51bde9.js","253:static/chunks/bce60fc1-18c9f145b45d8f36.js","769:static/chunks/769-5cc40fd35d2e3ebe.js"],"name":"","async":false}
8:I{"id":"26257","chunks":["430:static/chunks/430-bb3a86cc36f88444.js","635:static/chunks/635-b9a05804c40d9a36.js","456:static/chunks/456-3509097c86aa8e9a.js","585:static/chunks/585-c91fc54776d36acd.js","440:static/chunks/440-96bb64772ec3a56d.js","232:static/chunks/232-8f672ca290539d0e.js","538:static/chunks/app/datastores/documents/chunklist/page-9706432b1bf08219.js"],"name":"","async":false}
2:[["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","loading":"$undefined","loadingStyles":"$undefined","hasLoading":false,"template":["$","$L6",null,{}],"templateStyles":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","childProp":{"current":["$","$L5",null,{"parallelRouterKey":"children","segmentPath":["children","datastores","children"],"error":"$undefined","errorStyles":"$undefined","loading":"$undefined","loadingStyles":"$undefined","hasLoading":false,"template":["$","$L6",null,{}],"templateStyles":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","childProp":{"current":["$","$L5",null,{"parallelRouterKey":"children","segmentPath":["children","datastores","children","documents","children"],"error":"$undefined","errorStyles":"$undefined","loading":"$undefined","loadingStyles":"$undefined","hasLoading":false,"template":["$","$L6",null,{}],"templateStyles":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","childProp":{"current":["$","$L5",null,{"parallelRouterKey":"children","segmentPath":["children","datastores","children","documents","children","chunklist","children"],"error":"$undefined","errorStyles":"$undefined","loading":"$undefined","loadingStyles":"$undefined","hasLoading":false,"template":["$","$L6",null,{}],"templateStyles":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","childProp":{"current":[["$","$L7",null,{"propsForComponent":{"params":{}},"Component":"$8"}],null],"segment":"__PAGE__"},"styles":[]}],"segment":"chunklist"},"styles":[]}],"segment":"documents"},"styles":[]}],"segment":"datastores"},"styles":[]}],"params":{}}],null]
3:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","link","2",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"any"}]]

File diff suppressed because one or more lines are too long

View File

@ -1,9 +1,9 @@
1:HL["/_next/static/css/1a8d71ce4977c414.css",{"as":"style"}]
0:["88tBPZRhns7FgumS5knsE",[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],"$L2",[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/1a8d71ce4977c414.css","precedence":"next"}]],["$L3",null]]]]]
4:I{"id":"50902","chunks":["180:static/chunks/0e02fca3-615d0d51fa074d92.js","448:static/chunks/448-f3a26a5f721e5a66.js","22:static/chunks/22-703ba16bc0ddc40c.js","599:static/chunks/599-3961dce1841e3605.js","93:static/chunks/93-d96460b174626309.js","952:static/chunks/952-2dc4f0545dc6908d.js","261:static/chunks/261-cafe8fb2d045b3ac.js","751:static/chunks/751-9808572c67f2351c.js","66:static/chunks/66-a59692966e930d12.js","185:static/chunks/app/layout-7dd71906a9fa8a24.js"],"name":"","async":false}
5:I{"id":"13211","chunks":["272:static/chunks/webpack-24270a861878a52b.js","253:static/chunks/bce60fc1-18c9f145b45d8f36.js","769:static/chunks/769-5cc40fd35d2e3ebe.js"],"name":"","async":false}
6:I{"id":"5767","chunks":["272:static/chunks/webpack-24270a861878a52b.js","253:static/chunks/bce60fc1-18c9f145b45d8f36.js","769:static/chunks/769-5cc40fd35d2e3ebe.js"],"name":"","async":false}
7:I{"id":"37396","chunks":["272:static/chunks/webpack-24270a861878a52b.js","253:static/chunks/bce60fc1-18c9f145b45d8f36.js","769:static/chunks/769-5cc40fd35d2e3ebe.js"],"name":"","async":false}
8:I{"id":"93768","chunks":["180:static/chunks/0e02fca3-615d0d51fa074d92.js","448:static/chunks/448-f3a26a5f721e5a66.js","22:static/chunks/22-703ba16bc0ddc40c.js","599:static/chunks/599-3961dce1841e3605.js","86:static/chunks/86-3a20bc6b78835c59.js","93:static/chunks/93-d96460b174626309.js","259:static/chunks/259-2c3490a9eca2f411.js","931:static/chunks/app/page-3c8cf4f6594ea538.js"],"name":"","async":false}
1:HL["/_next/static/css/a4b50755e0d5ba2a.css",{"as":"style"}]
0:["G8l4Pp61aoRoPGwULWvrz",[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],"$L2",[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/a4b50755e0d5ba2a.css","precedence":"next"}]],["$L3",null]]]]]
4:I{"id":"50902","chunks":["180:static/chunks/0e02fca3-615d0d51fa074d92.js","430:static/chunks/430-bb3a86cc36f88444.js","577:static/chunks/577-98027453991b6c69.js","635:static/chunks/635-b9a05804c40d9a36.js","562:static/chunks/562-967d90db5cfc2e85.js","456:static/chunks/456-3509097c86aa8e9a.js","440:static/chunks/440-96bb64772ec3a56d.js","672:static/chunks/672-860e1c1d53658862.js","751:static/chunks/751-9808572c67f2351c.js","216:static/chunks/216-66e88a07cca64650.js","185:static/chunks/app/layout-da5f0ec502fcb9db.js"],"name":"","async":false}
5:I{"id":"13211","chunks":["272:static/chunks/webpack-df861d847f51bde9.js","253:static/chunks/bce60fc1-18c9f145b45d8f36.js","769:static/chunks/769-5cc40fd35d2e3ebe.js"],"name":"","async":false}
6:I{"id":"5767","chunks":["272:static/chunks/webpack-df861d847f51bde9.js","253:static/chunks/bce60fc1-18c9f145b45d8f36.js","769:static/chunks/769-5cc40fd35d2e3ebe.js"],"name":"","async":false}
7:I{"id":"37396","chunks":["272:static/chunks/webpack-df861d847f51bde9.js","253:static/chunks/bce60fc1-18c9f145b45d8f36.js","769:static/chunks/769-5cc40fd35d2e3ebe.js"],"name":"","async":false}
8:I{"id":"93768","chunks":["180:static/chunks/0e02fca3-615d0d51fa074d92.js","430:static/chunks/430-bb3a86cc36f88444.js","577:static/chunks/577-98027453991b6c69.js","86:static/chunks/86-3a20bc6b78835c59.js","562:static/chunks/562-967d90db5cfc2e85.js","259:static/chunks/259-2c3490a9eca2f411.js","931:static/chunks/app/page-61cd9f4e1f62545d.js"],"name":"","async":false}
2:[["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","loading":"$undefined","loadingStyles":"$undefined","hasLoading":false,"template":["$","$L6",null,{}],"templateStyles":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","childProp":{"current":[["$","$L7",null,{"propsForComponent":{"params":{}},"Component":"$8"}],null],"segment":"__PAGE__"},"styles":[]}],"params":{}}],null]
3:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","link","2",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"any"}]]

View File

@ -1,19 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Streaming Demo</title>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
</head>
<body>
<div id="output">Hello World! I'm DB-GPT!</div>
<script>
$(document).ready(function() {
var source = new EventSource("/v1/chat/completions");
source.onmessage = function(event) {
$("#output").append(event.data);
}
});
</script>
</body>
</html>

View File

@ -37,7 +37,7 @@ from pilot.conversation import (
from pilot.server.gradio_css import code_highlight_css
from pilot.server.gradio_patch import Chatbot as grChatbot
from pilot.source_embedding.knowledge_embedding import KnowledgeEmbedding
from pilot.embedding_engine.knowledge_embedding import KnowledgeEmbedding
from pilot.utils import build_logger
from pilot.vector_store.extract_tovec import (
get_vector_storelist,
@ -297,54 +297,40 @@ def http_bot(
if ChatScene.ChatWithDbExecute == scene:
chat_param = {
"temperature": temperature,
"max_new_tokens": max_new_tokens,
"chat_session_id": state.conv_id,
"db_name": db_selector,
"user_input": state.last_user_input,
}
elif ChatScene.ChatWithDbQA == scene:
chat_param = {
"temperature": temperature,
"max_new_tokens": max_new_tokens,
"chat_session_id": state.conv_id,
"db_name": db_selector,
"user_input": state.last_user_input,
}
elif ChatScene.ChatExecution == scene:
chat_param = {
"temperature": temperature,
"max_new_tokens": max_new_tokens,
"chat_session_id": state.conv_id,
"plugin_selector": plugin_selector,
"user_input": state.last_user_input,
}
elif ChatScene.ChatNormal == scene:
chat_param = {
"temperature": temperature,
"max_new_tokens": max_new_tokens,
"chat_session_id": state.conv_id,
"user_input": state.last_user_input,
}
elif ChatScene.ChatDefaultKnowledge == scene:
chat_param = {
"temperature": temperature,
"max_new_tokens": max_new_tokens,
"chat_session_id": state.conv_id,
"user_input": state.last_user_input,
}
elif ChatScene.ChatNewKnowledge == scene:
chat_param = {
"temperature": temperature,
"max_new_tokens": max_new_tokens,
"chat_session_id": state.conv_id,
"user_input": state.last_user_input,
"knowledge_name": knowledge_name,
}
elif ChatScene.ChatUrlKnowledge == scene:
chat_param = {
"temperature": temperature,
"max_new_tokens": max_new_tokens,
"chat_session_id": state.conv_id,
"user_input": state.last_user_input,
"url": url_input,

View File

@ -38,10 +38,6 @@ def server_init(args):
# init config
cfg = Config()
from pilot.server.llmserver import worker
worker.start_check()
load_native_plugins(cfg)
signal.signal(signal.SIGINT, signal_handler)
async_db_summery()

View File

@ -1,26 +0,0 @@
from typing import List, Optional
import chardet
from langchain.docstore.document import Document
from langchain.document_loaders.base import BaseLoader
class EncodeTextLoader(BaseLoader):
"""Load text files."""
def __init__(self, file_path: str, encoding: Optional[str] = None):
"""Initialize with file path."""
self.file_path = file_path
self.encoding = encoding
def load(self) -> List[Document]:
"""Load from file path."""
with open(self.file_path, "rb") as f:
raw_text = f.read()
result = chardet.detect(raw_text)
if result["encoding"] is None:
text = raw_text.decode("utf-8")
else:
text = raw_text.decode(result["encoding"])
metadata = {"source": self.file_path}
return [Document(page_content=text, metadata=metadata)]

View File

@ -1,3 +0,0 @@
from pilot.source_embedding.source_embedding import SourceEmbedding, register
__all__ = ["SourceEmbedding", "register"]

View File

@ -1,55 +0,0 @@
import re
from typing import List
from langchain.text_splitter import CharacterTextSplitter
class CHNDocumentSplitter(CharacterTextSplitter):
def __init__(self, pdf: bool = False, sentence_size: int = None, **kwargs):
super().__init__(**kwargs)
self.pdf = pdf
self.sentence_size = sentence_size
def split_text(self, text: str) -> List[str]:
if self.pdf:
text = re.sub(r"\n{3,}", r"\n", text)
text = re.sub("\s", " ", text)
text = re.sub("\n\n", "", text)
text = re.sub(r"([;.!?。!?\?])([^”’])", r"\1\n\2", text)
text = re.sub(r'(\.{6})([^"’”」』])', r"\1\n\2", text)
text = re.sub(r'(\{2})([^"’”」』])', r"\1\n\2", text)
text = re.sub(r'([;!?。!?\?]["’”」』]{0,2})([^;!?,。!?\?])', r"\1\n\2", text)
text = text.rstrip()
ls = [i for i in text.split("\n") if i]
for ele in ls:
if len(ele) > self.sentence_size:
ele1 = re.sub(r'([,.]["’”」』]{0,2})([^,.])', r"\1\n\2", ele)
ele1_ls = ele1.split("\n")
for ele_ele1 in ele1_ls:
if len(ele_ele1) > self.sentence_size:
ele_ele2 = re.sub(
r'([\n]{1,}| {2,}["’”」』]{0,2})([^\s])', r"\1\n\2", ele_ele1
)
ele2_ls = ele_ele2.split("\n")
for ele_ele2 in ele2_ls:
if len(ele_ele2) > self.sentence_size:
ele_ele3 = re.sub(
'( ["’”」』]{0,2})([^ ])', r"\1\n\2", ele_ele2
)
ele2_id = ele2_ls.index(ele_ele2)
ele2_ls = (
ele2_ls[:ele2_id]
+ [i for i in ele_ele3.split("\n") if i]
+ ele2_ls[ele2_id + 1 :]
)
ele_id = ele1_ls.index(ele_ele1)
ele1_ls = (
ele1_ls[:ele_id]
+ [i for i in ele2_ls if i]
+ ele1_ls[ele_id + 1 :]
)
id = ls.index(ele)
ls = ls[:id] + [i for i in ele1_ls if i] + ls[id + 1 :]
return ls

View File

@ -1,36 +0,0 @@
from typing import Dict, List, Optional
from langchain.document_loaders import CSVLoader
from langchain.schema import Document
from pilot.source_embedding import SourceEmbedding, register
class CSVEmbedding(SourceEmbedding):
"""csv embedding for read csv document."""
def __init__(
self,
file_path,
vector_store_config,
embedding_args: Optional[Dict] = None,
):
"""Initialize with csv path."""
super().__init__(file_path, vector_store_config)
self.file_path = file_path
self.vector_store_config = vector_store_config
self.embedding_args = embedding_args
@register
def read(self):
"""Load from csv path."""
loader = CSVLoader(file_path=self.file_path)
return loader.load()
@register
def data_process(self, documents: List[Document]):
i = 0
for d in documents:
documents[i].page_content = d.page_content.replace("\n", "")
i += 1
return documents

View File

@ -1,60 +0,0 @@
from typing import Optional
from chromadb.errors import NotEnoughElementsException
from langchain.embeddings import HuggingFaceEmbeddings
from pilot.configs.config import Config
from pilot.embedding_engine.knowledge_type import get_knowledge_embedding
from pilot.vector_store.connector import VectorStoreConnector
CFG = Config()
class KnowledgeEmbedding:
def __init__(
self,
model_name,
vector_store_config,
file_type: Optional[str] = "default",
file_path: Optional[str] = None,
):
"""Initialize with Loader url, model_name, vector_store_config"""
self.file_path = file_path
self.model_name = model_name
self.vector_store_config = vector_store_config
self.file_type = file_type
self.embeddings = HuggingFaceEmbeddings(model_name=self.model_name)
self.vector_store_config["embeddings"] = self.embeddings
def knowledge_embedding(self):
self.knowledge_embedding_client = self.init_knowledge_embedding()
self.knowledge_embedding_client.source_embedding()
def knowledge_embedding_batch(self, docs):
# docs = self.knowledge_embedding_client.read_batch()
self.knowledge_embedding_client.index_to_store(docs)
def read(self):
self.knowledge_embedding_client = self.init_knowledge_embedding()
return self.knowledge_embedding_client.read_batch()
def init_knowledge_embedding(self):
return get_knowledge_embedding(
self.file_type.upper(), self.file_path, self.vector_store_config
)
def similar_search(self, text, topk):
vector_client = VectorStoreConnector(
CFG.VECTOR_STORE_TYPE, self.vector_store_config
)
try:
ans = vector_client.similar_search(text, topk)
except NotEnoughElementsException:
ans = vector_client.similar_search(text, 1)
return ans
def vector_exist(self):
vector_client = VectorStoreConnector(
CFG.VECTOR_STORE_TYPE, self.vector_store_config
)
return vector_client.vector_name_exists()

View File

@ -1,51 +0,0 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
from typing import List
import markdown
from bs4 import BeautifulSoup
from langchain.schema import Document
from langchain.text_splitter import SpacyTextSplitter
from pilot.configs.config import Config
from pilot.source_embedding import SourceEmbedding, register
from pilot.source_embedding.EncodeTextLoader import EncodeTextLoader
from pilot.source_embedding.chn_document_splitter import CHNDocumentSplitter
CFG = Config()
class MarkdownEmbedding(SourceEmbedding):
"""markdown embedding for read markdown document."""
def __init__(self, file_path, vector_store_config):
"""Initialize with markdown path."""
super().__init__(file_path, vector_store_config)
self.file_path = file_path
self.vector_store_config = vector_store_config
# self.encoding = encoding
@register
def read(self):
"""Load from markdown path."""
loader = EncodeTextLoader(self.file_path)
textsplitter = SpacyTextSplitter(
pipeline="zh_core_web_sm",
chunk_size=CFG.KNOWLEDGE_CHUNK_SIZE,
chunk_overlap=100,
)
return loader.load_and_split(textsplitter)
@register
def data_process(self, documents: List[Document]):
i = 0
for d in documents:
content = markdown.markdown(d.page_content)
soup = BeautifulSoup(content, "html.parser")
for tag in soup(["!doctype", "meta", "i.fa"]):
tag.extract()
documents[i].page_content = soup.get_text()
documents[i].page_content = documents[i].page_content.replace("\n", " ")
i += 1
return documents

View File

@ -1,44 +0,0 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from typing import List
from langchain.document_loaders import PyPDFLoader
from langchain.schema import Document
from langchain.text_splitter import SpacyTextSplitter
from pilot.configs.config import Config
from pilot.source_embedding import SourceEmbedding, register
CFG = Config()
class PDFEmbedding(SourceEmbedding):
"""pdf embedding for read pdf document."""
def __init__(self, file_path, vector_store_config):
"""Initialize with pdf path."""
super().__init__(file_path, vector_store_config)
self.file_path = file_path
self.vector_store_config = vector_store_config
@register
def read(self):
"""Load from pdf path."""
loader = PyPDFLoader(self.file_path)
# textsplitter = CHNDocumentSplitter(
# pdf=True, sentence_size=CFG.KNOWLEDGE_CHUNK_SIZE
# )
textsplitter = SpacyTextSplitter(
pipeline="zh_core_web_sm",
chunk_size=CFG.KNOWLEDGE_CHUNK_SIZE,
chunk_overlap=100,
)
return loader.load_and_split(textsplitter)
@register
def data_process(self, documents: List[Document]):
i = 0
for d in documents:
documents[i].page_content = d.page_content.replace("\n", "")
i += 1
return documents

View File

@ -1,55 +0,0 @@
"""Loader that loads image files."""
import os
from typing import List
import fitz
from langchain.document_loaders.unstructured import UnstructuredFileLoader
from paddleocr import PaddleOCR
class UnstructuredPaddlePDFLoader(UnstructuredFileLoader):
"""Loader that uses unstructured to load image files, such as PNGs and JPGs."""
def _get_elements(self) -> List:
def pdf_ocr_txt(filepath, dir_path="tmp_files"):
full_dir_path = os.path.join(os.path.dirname(filepath), dir_path)
if not os.path.exists(full_dir_path):
os.makedirs(full_dir_path)
filename = os.path.split(filepath)[-1]
ocr = PaddleOCR(lang="ch", use_gpu=False, show_log=False)
doc = fitz.open(filepath)
txt_file_path = os.path.join(full_dir_path, "%s.txt" % (filename))
img_name = os.path.join(full_dir_path, ".tmp.png")
with open(txt_file_path, "w", encoding="utf-8") as fout:
for i in range(doc.page_count):
page = doc[i]
text = page.get_text("")
fout.write(text)
fout.write("\n")
img_list = page.get_images()
for img in img_list:
pix = fitz.Pixmap(doc, img[0])
pix.save(img_name)
result = ocr.ocr(img_name)
ocr_result = [i[1][0] for line in result for i in line]
fout.write("\n".join(ocr_result))
os.remove(img_name)
return txt_file_path
txt_file_path = pdf_ocr_txt(self.file_path)
from unstructured.partition.text import partition_text
return partition_text(filename=txt_file_path, **self.unstructured_kwargs)
if __name__ == "__main__":
filepath = os.path.join(
os.path.dirname(os.path.dirname(__file__)), "content", "samples", "test_py.pdf"
)
loader = UnstructuredPaddlePDFLoader(filepath, mode="elements")
docs = loader.load()
for doc in docs:
print(doc)

View File

@ -1,41 +0,0 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from typing import List
from langchain.document_loaders import UnstructuredPowerPointLoader
from langchain.schema import Document
from langchain.text_splitter import SpacyTextSplitter
from pilot.configs.config import Config
from pilot.source_embedding import SourceEmbedding, register
CFG = Config()
class PPTEmbedding(SourceEmbedding):
"""ppt embedding for read ppt document."""
def __init__(self, file_path, vector_store_config):
"""Initialize with pdf path."""
super().__init__(file_path, vector_store_config)
self.file_path = file_path
self.vector_store_config = vector_store_config
@register
def read(self):
"""Load from ppt path."""
loader = UnstructuredPowerPointLoader(self.file_path)
textsplitter = SpacyTextSplitter(
pipeline="zh_core_web_sm",
chunk_size=CFG.KNOWLEDGE_CHUNK_SIZE,
chunk_overlap=200,
)
return loader.load_and_split(textsplitter)
@register
def data_process(self, documents: List[Document]):
i = 0
for d in documents:
documents[i].page_content = d.page_content.replace("\n", "")
i += 1
return documents

View File

@ -1,61 +0,0 @@
# from langchain.embeddings import HuggingFaceEmbeddings
# from langchain.vectorstores import Milvus
# from pymilvus import Collection,utility
# from pymilvus import connections, DataType, FieldSchema, CollectionSchema
#
# # milvus = connections.connect(
# # alias="default",
# # host='localhost',
# # port="19530"
# # )
# # collection = Collection("book")
#
#
# # Get an existing collection.
# # collection.load()
# #
# # search_params = {"metric_type": "L2", "params": {}, "offset": 5}
# #
# # results = collection.search(
# # data=[[0.1, 0.2]],
# # anns_field="book_intro",
# # param=search_params,
# # limit=10,
# # expr=None,
# # output_fields=['book_id'],
# # consistency_level="Strong"
# # )
# #
# # # get the IDs of all returned hits
# # results[0].ids
# #
# # # get the distances to the query vector from all returned hits
# # results[0].distances
# #
# # # get the value of an output field specified in the search request.
# # # vector fields are not supported yet.
# # hit = results[0][0]
# # hit.entity.get('title')
#
# # milvus = connections.connect(
# # alias="default",
# # host='localhost',
# # port="19530"
# # )
# from pilot.vector_store.milvus_store import MilvusStore
#
# data = ["aaa", "bbb"]
# model_name = "xx/all-MiniLM-L6-v2"
# embeddings = HuggingFaceEmbeddings(model_name=model_name)
#
# # text_embeddings = Text2Vectors()
# mivuls = MilvusStore(cfg={"url": "127.0.0.1", "port": "19530", "alias": "default", "table_name": "test_k"})
#
# mivuls.insert(["textc","tezt2"])
# print("success")
# ct
# # mivuls.from_texts(texts=data, embedding=embeddings)
# # docs,
# # embedding=embeddings,
# # connection_args={"host": "127.0.0.1", "port": "19530", "alias": "default"}
# # )

View File

@ -1,101 +0,0 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from abc import ABC, abstractmethod
from typing import Dict, List, Optional
from chromadb.errors import NotEnoughElementsException
from pilot.configs.config import Config
from pilot.vector_store.connector import VectorStoreConnector
registered_methods = []
CFG = Config()
def register(method):
registered_methods.append(method.__name__)
return method
class SourceEmbedding(ABC):
"""base class for read data source embedding pipeline.
include data read, data process, data split, data to vector, data index vector store
Implementations should implement the method
"""
def __init__(
self,
file_path,
vector_store_config,
embedding_args: Optional[Dict] = None,
):
"""Initialize with Loader url, model_name, vector_store_config"""
self.file_path = file_path
self.vector_store_config = vector_store_config
self.embedding_args = embedding_args
self.embeddings = vector_store_config["embeddings"]
@abstractmethod
@register
def read(self) -> List[ABC]:
"""read datasource into document objects."""
@register
def data_process(self, text):
"""pre process data."""
@register
def text_split(self, text):
"""text split chunk"""
pass
@register
def text_to_vector(self, docs):
"""transform vector"""
pass
@register
def index_to_store(self, docs):
"""index to vector store"""
self.vector_client = VectorStoreConnector(
CFG.VECTOR_STORE_TYPE, self.vector_store_config
)
self.vector_client.load_document(docs)
@register
def similar_search(self, doc, topk):
"""vector store similarity_search"""
self.vector_client = VectorStoreConnector(
CFG.VECTOR_STORE_TYPE, self.vector_store_config
)
try:
ans = self.vector_client.similar_search(doc, topk)
except NotEnoughElementsException:
ans = self.vector_client.similar_search(doc, 1)
return ans
def vector_name_exist(self):
self.vector_client = VectorStoreConnector(
CFG.VECTOR_STORE_TYPE, self.vector_store_config
)
return self.vector_client.vector_name_exists()
def source_embedding(self):
if "read" in registered_methods:
text = self.read()
if "data_process" in registered_methods:
text = self.data_process(text)
if "text_split" in registered_methods:
self.text_split(text)
if "text_to_vector" in registered_methods:
self.text_to_vector(text)
if "index_to_store" in registered_methods:
self.index_to_store(text)
def read_batch(self):
if "read" in registered_methods:
text = self.read()
if "data_process" in registered_methods:
text = self.data_process(text)
if "text_split" in registered_methods:
self.text_split(text)
return text

View File

@ -1,29 +0,0 @@
from typing import List
from langchain.schema import Document
from pilot import SourceEmbedding, register
class StringEmbedding(SourceEmbedding):
"""string embedding for read string document."""
def __init__(self, file_path, vector_store_config):
"""Initialize with pdf path."""
super().__init__(file_path, vector_store_config)
self.file_path = file_path
self.vector_store_config = vector_store_config
@register
def read(self):
"""Load from String path."""
metadata = {"source": "db_summary"}
return [Document(page_content=self.file_path, metadata=metadata)]
@register
def data_process(self, documents: List[Document]):
i = 0
for d in documents:
documents[i].page_content = d.page_content.replace("\n", "")
i += 1
return documents

View File

@ -1,49 +0,0 @@
from typing import List
from bs4 import BeautifulSoup
from langchain.document_loaders import WebBaseLoader
from langchain.schema import Document
from langchain.text_splitter import CharacterTextSplitter
from pilot.configs.config import Config
from pilot.configs.model_config import KNOWLEDGE_CHUNK_SPLIT_SIZE
from pilot.source_embedding import SourceEmbedding, register
from pilot.source_embedding.chn_document_splitter import CHNDocumentSplitter
CFG = Config()
class URLEmbedding(SourceEmbedding):
"""url embedding for read url document."""
def __init__(self, file_path, vector_store_config):
"""Initialize with url path."""
super().__init__(file_path, vector_store_config)
self.file_path = file_path
self.vector_store_config = vector_store_config
@register
def read(self):
"""Load from url path."""
loader = WebBaseLoader(web_path=self.file_path)
if CFG.LANGUAGE == "en":
text_splitter = CharacterTextSplitter(
chunk_size=CFG.KNOWLEDGE_CHUNK_SIZE,
chunk_overlap=20,
length_function=len,
)
else:
text_splitter = CHNDocumentSplitter(pdf=True, sentence_size=1000)
return loader.load_and_split(text_splitter)
@register
def data_process(self, documents: List[Document]):
i = 0
for d in documents:
content = d.page_content.replace("\n", "")
soup = BeautifulSoup(content, "html.parser")
for tag in soup(["!doctype", "meta"]):
tag.extract()
documents[i].page_content = soup.get_text()
i += 1
return documents

View File

@ -1,39 +0,0 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from typing import List
from langchain.document_loaders import PyPDFLoader, UnstructuredWordDocumentLoader
from langchain.schema import Document
from pilot.configs.config import Config
from pilot.source_embedding import SourceEmbedding, register
from pilot.source_embedding.chn_document_splitter import CHNDocumentSplitter
CFG = Config()
class WordEmbedding(SourceEmbedding):
"""word embedding for read word document."""
def __init__(self, file_path, vector_store_config):
"""Initialize with word path."""
super().__init__(file_path, vector_store_config)
self.file_path = file_path
self.vector_store_config = vector_store_config
@register
def read(self):
"""Load from word path."""
loader = UnstructuredWordDocumentLoader(self.file_path)
textsplitter = CHNDocumentSplitter(
pdf=True, sentence_size=CFG.KNOWLEDGE_CHUNK_SIZE
)
return loader.load_and_split(textsplitter)
@register
def data_process(self, documents: List[Document]):
i = 0
for d in documents:
documents[i].page_content = d.page_content.replace("\n", "")
i += 1
return documents

View File

@ -49,6 +49,7 @@ class LocalKnowledgeInit:
space = KnowledgeSpaceRequest
space.name = self.vector_store_config["vector_store_name"]
space.desc = "knowledge_init.py"
space.vector_type = CFG.VECTOR_STORE_TYPE
space.owner = "DB-GPT"
knowledge_space_service.create_knowledge_space(space)