@tablestore/tablestore-agent-cli 0.2.3 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/kb/create.d.ts.map +1 -1
- package/dist/commands/kb/create.js +9 -0
- package/dist/commands/kb/create.js.map +1 -1
- package/dist/commands/kb/retrieve.d.ts.map +1 -1
- package/dist/commands/kb/retrieve.js +40 -3
- package/dist/commands/kb/retrieve.js.map +1 -1
- package/dist/dashboard-runtime/dashboard/.next/BUILD_ID +1 -1
- package/dist/dashboard-runtime/dashboard/.next/build-manifest.json +3 -3
- package/dist/dashboard-runtime/dashboard/.next/prerender-manifest.json +3 -3
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/chat/page.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/chat/page_client-reference-manifest.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/documents/page.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/documents/page_client-reference-manifest.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/page.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/page_client-reference-manifest.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/qa/page.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/qa/page_client-reference-manifest.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/retrieval/page.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/retrieval/page_client-reference-manifest.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/settings/page.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/settings/page_client-reference-manifest.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/create/page.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/create/page_client-reference-manifest.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/page.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/page_client-reference-manifest.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/[id]/page.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/[id]/page_client-reference-manifest.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/new/page.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/new/page_client-reference-manifest.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/page.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/page_client-reference-manifest.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/messages/page.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/messages/page_client-reference-manifest.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/page.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/page_client-reference-manifest.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/requests/page.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/requests/page_client-reference-manifest.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/search/page.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/search/page_client-reference-manifest.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/settings/page.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/settings/page_client-reference-manifest.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/units/page.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/units/page_client-reference-manifest.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/create/page.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/create/page_client-reference-manifest.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/page.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/page_client-reference-manifest.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/projects/page.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/projects/page_client-reference-manifest.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.html +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.rsc +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.html +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.rsc +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/auth/status/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/auth/token/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/[name]/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/[name]/token/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/[name]/use/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/chunks/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/[docId]/chunks/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/[docId]/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/upload/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/retrieve/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/chat/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/[id]/models/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/[id]/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/[id]/test/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/logs/client/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/messages/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/requests/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/search/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/units/[memoryId]/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/units/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/oss/list/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/runtime/context/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/index.html +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/index.rsc +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/index.segments/_full.segment.rsc +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/index.segments/_index.segment.rsc +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.html +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.rsc +3 -3
- package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.segments/_full.segment.rsc +3 -3
- package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.segments/_head.segment.rsc +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.segments/_index.segment.rsc +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.segments/_tree.segment.rsc +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.segments/onboarding/__PAGE__.segment.rsc +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.segments/onboarding.segment.rsc +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/page_client-reference-manifest.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/0p91_next_dist_esm_build_templates_app-route_0n~ec7s.js +6 -6
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/0b1r_app_(dashboard)_knowledge-base_[name]_documents_documents-client_tsx_0g2uxmt._.js +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/0e95_src_app_(dashboard)_knowledge-base_[name]_settings_settings-client_tsx_13312zk._.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__08faq-z._.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0c94d.y._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0jb9ccl._.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__00uh_im._.js → [root-of-the-server]__0lgg04c._.js} +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_01-2v37._.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_01ag-vl._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0atzifq._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0f4u0.1._.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0gbt~hy._.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0gl7kh7._.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0j-q~ro._.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0jghj2_._.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0jlyg05._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0n4gd_6._.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/{_0l~-9i0._.js → _0tdjkbc._.js} +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0tej2s.._.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_10u~-xc._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_12r9c8h._.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_0.glq39._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_00ofp7q._.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_05.qn9h._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_065m1.j._.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_0xf3ffa._.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_0y49vhd._.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_10dsqx~._.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_app_(dashboard)_knowledge-base_create_page_tsx_0916~g-._.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_app_(dashboard)_memory_[store]_units_page_tsx_0.6xnei._.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_components_0ls1exu._.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_components_0ugdjlb._.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/middleware-build-manifest.js +3 -3
- package/dist/dashboard-runtime/dashboard/.next/server/pages/404.html +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/pages/500.html +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/server-reference-manifest.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/server-reference-manifest.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/00wmf85833643.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/02tj1_rhgobzv.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/{0mea2ylxe.umh.js → 02zf3qddfaw~u.js} +1 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/039i70t10axdd.css +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/04bfame9rk.3d.js +5 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/07ygw8215kyvc.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0b5hr027rat4w.js +138 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/{0__g1ogrdh412.js → 0bkm-5yza5~d2.js} +1 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/{0lrw.bnws62y9.js → 0d7d.b.v9noym.js} +1 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/{0cto67_iw~p9z.js → 0fdofp-3kkc4g.js} +1 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/{18d_i28~jrf91.js → 0i8hdbek9j-fu.js} +1 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0ioivx4pbmayb.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/{0lp2g_27uyhuz.js → 0je7fmsrz2vok.js} +1 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0jukioxtp1mn3.js +138 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0klidr2i6cd.g.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0k~bkh1586r2i.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0nakvv2p1kjnf.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0un~rqes29pcr.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0v.u57bsjppd_.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0x3w~yxvm1xsq.js +4 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0x5gol39unrgb.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/12s59v_sk0q-z.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/{06uuhz24tvdt..js → 14~eqof4660i3.js} +1 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/16y3764x-fh1n.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/17mcnyr~1j7ih.js +1 -0
- package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/knowledge-base/[name]/documents/documents-client.tsx +1 -1
- package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/knowledge-base/[name]/layout-client.tsx +62 -26
- package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/messages/page.tsx +8 -4
- package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/requests/page.tsx +6 -2
- package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/requests/request-detail-dialog.tsx +9 -9
- package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/requests/requests-table.tsx +2 -2
- package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/search/page.tsx +5 -1
- package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/units/page.tsx +11 -7
- package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/create/page.tsx +1 -1
- package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/page.tsx +1 -1
- package/dist/dashboard-runtime/dashboard/src/app/api/v1/llm/chat/route.ts +124 -13
- package/dist/dashboard-runtime/dashboard/src/app/globals.css +23 -0
- package/dist/dashboard-runtime/dashboard/src/components/chat/chat-config-context.tsx +39 -17
- package/dist/dashboard-runtime/dashboard/src/components/chat/chat-mount-config.tsx +1 -0
- package/dist/dashboard-runtime/dashboard/src/components/chat/memory-bind-section.tsx +15 -15
- package/dist/dashboard-runtime/dashboard/src/components/chat/mount-retrieval-dialog.tsx +360 -0
- package/dist/dashboard-runtime/dashboard/src/components/chat/mount-row.tsx +49 -5
- package/dist/dashboard-runtime/dashboard/src/components/chat/unified-retrieval-section.tsx +61 -26
- package/dist/dashboard-runtime/dashboard/src/components/documents/doc-chunks-dialog.tsx +72 -20
- package/dist/dashboard-runtime/dashboard/src/components/instance/connect-instance-form.tsx +5 -0
- package/dist/dashboard-runtime/dashboard/src/components/knowledge-base/embedding-config-form.tsx +16 -2
- package/dist/dashboard-runtime/dashboard/src/components/knowledge-base/kb-card.tsx +37 -24
- package/dist/dashboard-runtime/dashboard/src/components/knowledge-base/kb-create-form.tsx +173 -86
- package/dist/dashboard-runtime/dashboard/src/components/knowledge-base/kb-settings-form.tsx +319 -280
- package/dist/dashboard-runtime/dashboard/src/components/layout/detail-sidebar.tsx +47 -18
- package/dist/dashboard-runtime/dashboard/src/components/layout/sidebar-instance-card.tsx +2 -2
- package/dist/dashboard-runtime/dashboard/src/components/memory/memory-add-dialog.tsx +2 -2
- package/dist/dashboard-runtime/dashboard/src/components/memory/memory-edit-dialog.tsx +2 -2
- package/dist/dashboard-runtime/dashboard/src/components/memory/memory-messages-table.tsx +3 -3
- package/dist/dashboard-runtime/dashboard/src/components/memory/memory-requests-table.tsx +12 -12
- package/dist/dashboard-runtime/dashboard/src/components/memory/memory-scope-bar.tsx +20 -11
- package/dist/dashboard-runtime/dashboard/src/components/memory/memory-search-form.tsx +7 -7
- package/dist/dashboard-runtime/dashboard/src/components/memory/memory-search-results.tsx +6 -6
- package/dist/dashboard-runtime/dashboard/src/components/memory/memory-store-card.tsx +1 -1
- package/dist/dashboard-runtime/dashboard/src/components/memory/memory-store-list.tsx +1 -1
- package/dist/dashboard-runtime/dashboard/src/components/memory/memory-unit-detail-panel.tsx +4 -4
- package/dist/dashboard-runtime/dashboard/src/components/memory/memory-unit-table.tsx +2 -2
- package/dist/dashboard-runtime/dashboard/src/components/qa/qa-message.tsx +104 -7
- package/dist/dashboard-runtime/dashboard/src/components/retrieval/retrieval-form.tsx +241 -24
- package/dist/dashboard-runtime/dashboard/src/components/retrieval/retrieval-rerank-fields.tsx +1 -0
- package/dist/dashboard-runtime/dashboard/src/components/retrieval/retrieval-result-card.tsx +52 -4
- package/dist/dashboard-runtime/dashboard/src/components/shared/status-badge.tsx +10 -5
- package/dist/dashboard-runtime/dashboard/src/components/ui/nav-tab-bar.tsx +1 -1
- package/dist/dashboard-runtime/dashboard/src/hooks/use-chat-history.ts +9 -5
- package/dist/dashboard-runtime/dashboard/src/lib/constants.ts +8 -0
- package/dist/dashboard-runtime/dashboard/src/lib/server/llm-client.ts +19 -1
- package/dist/dashboard-runtime/dashboard/src/schemas/knowledge-base.ts +6 -0
- package/dist/dashboard-runtime/dashboard/src/schemas/retrieval.ts +46 -27
- package/dist/dashboard-runtime/dashboard/src/types/knowledge-base.ts +10 -0
- package/dist/dashboard-runtime/dashboard/src/types/retrieval.ts +9 -4
- package/dist/dashboard-runtime/dashboard/tailwind.config.ts +4 -0
- package/dist/dashboard-runtime/dashboard/vitest.config.mjs +5 -2
- package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-shared/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-shared/dist/types.d.ts +21 -5
- package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-shared/dist/types.d.ts.map +1 -1
- package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/node_modules/@tablestore/tablestore-agent-shared/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/node_modules/@tablestore/tablestore-agent-shared/dist/types.d.ts +21 -5
- package/dist/node_modules/@tablestore/tablestore-agent-shared/dist/types.d.ts.map +1 -1
- package/dist/utils/read-image-input.d.ts +47 -0
- package/dist/utils/read-image-input.d.ts.map +1 -0
- package/dist/utils/read-image-input.js +89 -0
- package/dist/utils/read-image-input.js.map +1 -0
- package/package.json +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0hozzu6._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0tr8-3u._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0uu1sjh._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0vasoy6._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_12~3vfk._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_13_lb.o._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_0ejgygh._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_components_ui_0-tuf-h._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0535h0pr4~.-1.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/062k9jbtd9.lv.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/06aj_c5rwvkut.js +0 -4
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/07t_2t_-s9aq_.js +0 -5
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0bs_w1~xt92db.js +0 -138
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0d29.l~3ip181.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0gjg-rd.ybcga.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0jc31diex030o.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0m6zpy2h1p2vp.js +0 -138
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0rm8~7jovs879.css +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0t0yqi68~eil6.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0th7u6qvdy3x2.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0tmwptel_4y0o.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0u6_s-0w8.yr..js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0v9d5wl9nsva3.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/14.dp0-y_mhjo.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/15bzqpm440jvz.js +0 -1
- /package/dist/dashboard-runtime/dashboard/.next/static/{Vhp9IA5UJNqZzEyFxakjw → EIbKHHti0Z1ephKfJzCKH}/_buildManifest.js +0 -0
- /package/dist/dashboard-runtime/dashboard/.next/static/{Vhp9IA5UJNqZzEyFxakjw → EIbKHHti0Z1ephKfJzCKH}/_clientMiddlewareManifest.js +0 -0
- /package/dist/dashboard-runtime/dashboard/.next/static/{Vhp9IA5UJNqZzEyFxakjw → EIbKHHti0Z1ephKfJzCKH}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useEffect, useMemo, useRef } from "react";
|
|
4
|
+
import { useForm } from "react-hook-form";
|
|
5
|
+
import { zodResolver } from "@hookform/resolvers/zod";
|
|
6
|
+
import { Info, RotateCcw, Pencil } from "lucide-react";
|
|
7
|
+
|
|
8
|
+
import { Button } from "@/components/ui/button";
|
|
9
|
+
import {
|
|
10
|
+
Dialog,
|
|
11
|
+
DialogContent,
|
|
12
|
+
DialogDescription,
|
|
13
|
+
DialogFooter,
|
|
14
|
+
DialogHeader,
|
|
15
|
+
DialogTitle,
|
|
16
|
+
} from "@/components/ui/dialog";
|
|
17
|
+
import { Form } from "@/components/ui/form";
|
|
18
|
+
import type { FilterBuilderHandle } from "@/components/retrieval/filter-builder";
|
|
19
|
+
import { RetrievalParamsFields } from "@/components/retrieval/retrieval-params-fields";
|
|
20
|
+
import { retrievalSchema, type RetrievalInput } from "@/schemas/retrieval";
|
|
21
|
+
import {
|
|
22
|
+
DEFAULT_PER_KB_TOP_K,
|
|
23
|
+
useChatConfig,
|
|
24
|
+
type MountItem,
|
|
25
|
+
} from "@/components/chat/chat-config-context";
|
|
26
|
+
import type { ChatRetrievalConfig } from "@/hooks/use-chat-history";
|
|
27
|
+
import type { KnowledgeBase } from "@/types/knowledge-base";
|
|
28
|
+
|
|
29
|
+
/* -------------------------------------------------------------------------- */
|
|
30
|
+
/* Pure helpers (also unit-tested in __tests__/mount-retrieval-dialog.test.tsx)
|
|
31
|
+
/* -------------------------------------------------------------------------- */
|
|
32
|
+
|
|
33
|
+
/** A mount is in "inherit-from-global" mode iff it has no per-KB override at all. */
|
|
34
|
+
export function isInheritMode(mount: MountItem): boolean {
|
|
35
|
+
return mount.retrieval === undefined && mount.topK === undefined;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Compute the initial form snapshot when the user explicitly switches the
|
|
40
|
+
* mount from inherit-mode to custom-mode. Mount-local override (when present)
|
|
41
|
+
* wins over the global session defaults; otherwise the global defaults are
|
|
42
|
+
* shallow-copied so subsequent form mutation cannot leak back into the
|
|
43
|
+
* shared `cfg.retrieval` reference.
|
|
44
|
+
*/
|
|
45
|
+
export function deriveCustomDefaults(
|
|
46
|
+
mount: MountItem,
|
|
47
|
+
globalRetrieval: ChatRetrievalConfig,
|
|
48
|
+
globalPerKbTopK: number,
|
|
49
|
+
): { retrieval: ChatRetrievalConfig; topK: number } {
|
|
50
|
+
return {
|
|
51
|
+
retrieval: mount.retrieval ?? { ...globalRetrieval },
|
|
52
|
+
topK: mount.topK ?? globalPerKbTopK,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Multimodal KBs only have one supported MODEL-rerank model: `qwen3-vl-rerank`
|
|
58
|
+
* served by the Bailian provider. RRF / WEIGHT remain unrestricted because
|
|
59
|
+
* they don't load a rerank model at all.
|
|
60
|
+
*/
|
|
61
|
+
export function lockMultimodalRerank(
|
|
62
|
+
retrieval: ChatRetrievalConfig,
|
|
63
|
+
isMultimodal: boolean,
|
|
64
|
+
): ChatRetrievalConfig {
|
|
65
|
+
if (!isMultimodal) return retrieval;
|
|
66
|
+
if (retrieval.rerankType !== "MODEL") return retrieval;
|
|
67
|
+
return {
|
|
68
|
+
...retrieval,
|
|
69
|
+
modelProvider: "bailian",
|
|
70
|
+
modelName: "qwen3-vl-rerank",
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/* -------------------------------------------------------------------------- */
|
|
75
|
+
/* Component */
|
|
76
|
+
/* -------------------------------------------------------------------------- */
|
|
77
|
+
|
|
78
|
+
/** Subset of `RetrievalInput` keys persisted back to a `ChatRetrievalConfig`. */
|
|
79
|
+
const RETRIEVAL_CFG_KEYS = [
|
|
80
|
+
"searchType",
|
|
81
|
+
"rerankType",
|
|
82
|
+
"rrfK",
|
|
83
|
+
"rrfDenseWeight",
|
|
84
|
+
"rrfFullTextWeight",
|
|
85
|
+
"weightDense",
|
|
86
|
+
"weightFullText",
|
|
87
|
+
"modelName",
|
|
88
|
+
"modelProvider",
|
|
89
|
+
] as const satisfies readonly (keyof RetrievalInput &
|
|
90
|
+
keyof ChatRetrievalConfig)[];
|
|
91
|
+
|
|
92
|
+
export interface MountRetrievalDialogProps {
|
|
93
|
+
mount: MountItem;
|
|
94
|
+
knowledgeBase: KnowledgeBase;
|
|
95
|
+
open: boolean;
|
|
96
|
+
onOpenChange: (open: boolean) => void;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Per-KB retrieval parameter editor. Opens from the gear icon on a `MountRow`.
|
|
101
|
+
*
|
|
102
|
+
* Behavior contract:
|
|
103
|
+
* - When `mount.retrieval` and `mount.topK` are both undefined the form
|
|
104
|
+
* renders read-only and the header advertises 「当前:继承全局默认」.
|
|
105
|
+
* Switching to custom-mode requires an explicit click on
|
|
106
|
+
* 「使用自定义配置」 — no implicit drift.
|
|
107
|
+
* - In custom-mode, the form is seeded from the current global defaults
|
|
108
|
+
* (or the existing override) and auto-commits on field blur via
|
|
109
|
+
* `cfg.updateMount(...)`.
|
|
110
|
+
* - Multimodal KBs lock the MODEL rerank to `qwen3-vl-rerank` via
|
|
111
|
+
* `lockMultimodalRerank`; the rest of the form is unconstrained.
|
|
112
|
+
* - Metadata FilterBuilder is *not* rendered here (we deliberately skip
|
|
113
|
+
* `knowledgeBase` to `RetrievalParamsFields` to suppress it).
|
|
114
|
+
*/
|
|
115
|
+
export function MountRetrievalDialog({
|
|
116
|
+
mount,
|
|
117
|
+
knowledgeBase,
|
|
118
|
+
open,
|
|
119
|
+
onOpenChange,
|
|
120
|
+
}: MountRetrievalDialogProps) {
|
|
121
|
+
const cfg = useChatConfig();
|
|
122
|
+
const inherit = isInheritMode(mount);
|
|
123
|
+
const isMultimodal = !!knowledgeBase.multimodal;
|
|
124
|
+
|
|
125
|
+
// FilterBuilder is structurally required by RetrievalParamsFields' API even
|
|
126
|
+
// though we don't render it here.
|
|
127
|
+
const filterRef = useRef<FilterBuilderHandle | null>(null);
|
|
128
|
+
|
|
129
|
+
// Effective values used to populate the form: mount override falls back to
|
|
130
|
+
// the global session defaults so the UI shows what would actually be sent
|
|
131
|
+
// for this KB even in inherit-mode.
|
|
132
|
+
const effective = useMemo(
|
|
133
|
+
() => deriveCustomDefaults(mount, cfg.retrieval, cfg.perKbTopK),
|
|
134
|
+
[mount, cfg.retrieval, cfg.perKbTopK],
|
|
135
|
+
);
|
|
136
|
+
|
|
137
|
+
const form = useForm<RetrievalInput>({
|
|
138
|
+
resolver: zodResolver(retrievalSchema),
|
|
139
|
+
defaultValues: {
|
|
140
|
+
knowledgeBaseName: knowledgeBase.knowledgeBaseName,
|
|
141
|
+
queryType: "TEXT" as const,
|
|
142
|
+
query: "__mount_dialog_placeholder__",
|
|
143
|
+
subspace: [],
|
|
144
|
+
topK: effective.topK,
|
|
145
|
+
searchType: effective.retrieval.searchType ?? ["DENSE_VECTOR", "FULL_TEXT"],
|
|
146
|
+
rerankType: effective.retrieval.rerankType,
|
|
147
|
+
rrfK: effective.retrieval.rrfK,
|
|
148
|
+
rrfDenseWeight: effective.retrieval.rrfDenseWeight,
|
|
149
|
+
rrfFullTextWeight: effective.retrieval.rrfFullTextWeight,
|
|
150
|
+
weightDense: effective.retrieval.weightDense,
|
|
151
|
+
weightFullText: effective.retrieval.weightFullText,
|
|
152
|
+
modelName: effective.retrieval.modelName,
|
|
153
|
+
modelProvider: effective.retrieval.modelProvider,
|
|
154
|
+
},
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
// RHF does not observe defaultValues after mount; mirror context updates
|
|
158
|
+
// and inherit/custom transitions through reset() so the form always
|
|
159
|
+
// reflects what would actually be sent.
|
|
160
|
+
useEffect(() => {
|
|
161
|
+
form.reset({
|
|
162
|
+
knowledgeBaseName: knowledgeBase.knowledgeBaseName,
|
|
163
|
+
queryType: "TEXT" as const,
|
|
164
|
+
query: "__mount_dialog_placeholder__",
|
|
165
|
+
subspace: [],
|
|
166
|
+
topK: effective.topK,
|
|
167
|
+
searchType: effective.retrieval.searchType ?? ["DENSE_VECTOR", "FULL_TEXT"],
|
|
168
|
+
rerankType: effective.retrieval.rerankType,
|
|
169
|
+
rrfK: effective.retrieval.rrfK,
|
|
170
|
+
rrfDenseWeight: effective.retrieval.rrfDenseWeight,
|
|
171
|
+
rrfFullTextWeight: effective.retrieval.rrfFullTextWeight,
|
|
172
|
+
weightDense: effective.retrieval.weightDense,
|
|
173
|
+
weightFullText: effective.retrieval.weightFullText,
|
|
174
|
+
modelName: effective.retrieval.modelName,
|
|
175
|
+
modelProvider: effective.retrieval.modelProvider,
|
|
176
|
+
});
|
|
177
|
+
// form is stable; we want this to fire whenever the effective payload
|
|
178
|
+
// changes, including when the user toggles inherit -> custom.
|
|
179
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
180
|
+
}, [effective, knowledgeBase.knowledgeBaseName]);
|
|
181
|
+
|
|
182
|
+
// Persist the current form snapshot back to the mount as a custom override.
|
|
183
|
+
// No-op while we're still in inherit-mode (the form is read-only then).
|
|
184
|
+
const commit = () => {
|
|
185
|
+
if (inherit) return;
|
|
186
|
+
const values = form.getValues();
|
|
187
|
+
let next: ChatRetrievalConfig = {};
|
|
188
|
+
for (const k of RETRIEVAL_CFG_KEYS) {
|
|
189
|
+
const v = values[k];
|
|
190
|
+
if (v !== undefined && !(Array.isArray(v) && v.length === 0)) {
|
|
191
|
+
(next as Record<string, unknown>)[k] = v;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
next = lockMultimodalRerank(next, isMultimodal);
|
|
195
|
+
cfg.updateMount(mount.id, {
|
|
196
|
+
retrieval: next,
|
|
197
|
+
topK:
|
|
198
|
+
typeof values.topK === "number" && values.topK >= 0
|
|
199
|
+
? values.topK
|
|
200
|
+
: DEFAULT_PER_KB_TOP_K,
|
|
201
|
+
});
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
// When the user switches to MODEL on a multimodal KB, immediately lock the
|
|
205
|
+
// provider/model. Mirrors the unified-section auto-fill but with the
|
|
206
|
+
// multimodal constraint applied.
|
|
207
|
+
const watchedRerank = form.watch("rerankType");
|
|
208
|
+
useEffect(() => {
|
|
209
|
+
if (inherit) return;
|
|
210
|
+
if (watchedRerank !== "MODEL") return;
|
|
211
|
+
let touched = false;
|
|
212
|
+
if (isMultimodal) {
|
|
213
|
+
if (form.getValues("modelProvider") !== "bailian") {
|
|
214
|
+
form.setValue("modelProvider", "bailian");
|
|
215
|
+
touched = true;
|
|
216
|
+
}
|
|
217
|
+
if (form.getValues("modelName") !== "qwen3-vl-rerank") {
|
|
218
|
+
form.setValue("modelName", "qwen3-vl-rerank");
|
|
219
|
+
touched = true;
|
|
220
|
+
}
|
|
221
|
+
} else {
|
|
222
|
+
if (!form.getValues("modelProvider")) {
|
|
223
|
+
form.setValue("modelProvider", "bailian");
|
|
224
|
+
touched = true;
|
|
225
|
+
}
|
|
226
|
+
if (!form.getValues("modelName")) {
|
|
227
|
+
form.setValue("modelName", "gte-rerank-v2");
|
|
228
|
+
touched = true;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
if (touched) commit();
|
|
232
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
233
|
+
}, [watchedRerank, isMultimodal, inherit]);
|
|
234
|
+
|
|
235
|
+
const handleSwitchToCustom = () => {
|
|
236
|
+
const seeds = deriveCustomDefaults(mount, cfg.retrieval, cfg.perKbTopK);
|
|
237
|
+
const sealed = lockMultimodalRerank(seeds.retrieval, isMultimodal);
|
|
238
|
+
cfg.updateMount(mount.id, { retrieval: sealed, topK: seeds.topK });
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
const handleResetToDefault = () => {
|
|
242
|
+
cfg.resetMountRetrieval(mount.id);
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
return (
|
|
246
|
+
<Dialog open={open} onOpenChange={onOpenChange}>
|
|
247
|
+
<DialogContent
|
|
248
|
+
// 项目规范:所有 Dialog 必须禁用全部动画,做到即时显示/隐藏。
|
|
249
|
+
className="sm:max-w-[560px] max-h-[85vh] overflow-y-auto data-[state=open]:animate-none data-[state=closed]:animate-none duration-0"
|
|
250
|
+
>
|
|
251
|
+
<DialogHeader>
|
|
252
|
+
<DialogTitle className="pr-8">检索参数</DialogTitle>
|
|
253
|
+
<DialogDescription className="break-all">
|
|
254
|
+
{knowledgeBase.knowledgeBaseName}
|
|
255
|
+
{isMultimodal ? (
|
|
256
|
+
<span className="ml-2 inline-flex items-center rounded bg-[hsl(var(--secondary))] px-1.5 py-0.5 text-[10px] font-medium tracking-wide text-[hsl(var(--secondary-foreground))]">
|
|
257
|
+
多模态
|
|
258
|
+
</span>
|
|
259
|
+
) : null}
|
|
260
|
+
</DialogDescription>
|
|
261
|
+
</DialogHeader>
|
|
262
|
+
|
|
263
|
+
<div
|
|
264
|
+
className={
|
|
265
|
+
"flex items-start gap-2 rounded-md px-3 py-2 text-xs " +
|
|
266
|
+
(inherit
|
|
267
|
+
? "border border-dashed border-[hsl(var(--border))] bg-[hsl(var(--muted)/0.4)] text-muted-foreground"
|
|
268
|
+
: "border border-[hsl(var(--primary)/0.3)] bg-[hsl(var(--primary)/0.06)] text-[hsl(var(--foreground))]")
|
|
269
|
+
}
|
|
270
|
+
>
|
|
271
|
+
<Info className="mt-0.5 h-3.5 w-3.5 shrink-0" />
|
|
272
|
+
<div className="flex-1 leading-relaxed">
|
|
273
|
+
{inherit ? (
|
|
274
|
+
<span>
|
|
275
|
+
当前:<span className="font-medium">继承全局默认</span>
|
|
276
|
+
;下方为只读预览。如需偏离全局配置,请点击「使用自定义配置」。
|
|
277
|
+
</span>
|
|
278
|
+
) : (
|
|
279
|
+
<span>
|
|
280
|
+
当前:<span className="font-medium">使用自定义配置</span>
|
|
281
|
+
;字段失焦后自动保存。
|
|
282
|
+
</span>
|
|
283
|
+
)}
|
|
284
|
+
</div>
|
|
285
|
+
</div>
|
|
286
|
+
|
|
287
|
+
{isMultimodal && !inherit && form.watch("rerankType") === "MODEL" ? (
|
|
288
|
+
<div className="flex items-start gap-2 rounded-md border border-[hsl(var(--border))] bg-[hsl(var(--muted)/0.5)] px-3 py-2 text-xs text-muted-foreground">
|
|
289
|
+
<Info className="mt-0.5 h-3.5 w-3.5 shrink-0" />
|
|
290
|
+
<span>
|
|
291
|
+
多模态知识库的 Model Rerank 已锁定为{" "}
|
|
292
|
+
<span className="font-medium text-[hsl(var(--foreground))]">
|
|
293
|
+
qwen3-vl-rerank
|
|
294
|
+
</span>
|
|
295
|
+
(Provider:bailian),暂不支持其他模型。
|
|
296
|
+
</span>
|
|
297
|
+
</div>
|
|
298
|
+
) : null}
|
|
299
|
+
|
|
300
|
+
<Form {...form}>
|
|
301
|
+
<form
|
|
302
|
+
onSubmit={(e) => e.preventDefault()}
|
|
303
|
+
onBlur={commit}
|
|
304
|
+
// 继承模式:整个表单只读 + 灰态预览。
|
|
305
|
+
className={
|
|
306
|
+
"space-y-4 " +
|
|
307
|
+
(inherit ? "pointer-events-none select-none opacity-60" : "")
|
|
308
|
+
}
|
|
309
|
+
aria-disabled={inherit}
|
|
310
|
+
>
|
|
311
|
+
<fieldset disabled={inherit} className="space-y-4 contents">
|
|
312
|
+
<RetrievalParamsFields
|
|
313
|
+
form={form}
|
|
314
|
+
// 故意不传 knowledgeBase,避免触发 FilterBuilder。
|
|
315
|
+
filterRef={filterRef}
|
|
316
|
+
topKLabel="TopK"
|
|
317
|
+
topKHint="检索返回条数,不设置则继承全局默认"
|
|
318
|
+
topKMode="single"
|
|
319
|
+
/>
|
|
320
|
+
</fieldset>
|
|
321
|
+
</form>
|
|
322
|
+
</Form>
|
|
323
|
+
|
|
324
|
+
<DialogFooter className="sm:justify-between">
|
|
325
|
+
<Button
|
|
326
|
+
type="button"
|
|
327
|
+
variant="ghost"
|
|
328
|
+
size="sm"
|
|
329
|
+
onClick={handleResetToDefault}
|
|
330
|
+
disabled={inherit}
|
|
331
|
+
className="gap-1.5"
|
|
332
|
+
>
|
|
333
|
+
<RotateCcw className="h-3.5 w-3.5" />
|
|
334
|
+
重置为默认
|
|
335
|
+
</Button>
|
|
336
|
+
{inherit ? (
|
|
337
|
+
<Button
|
|
338
|
+
type="button"
|
|
339
|
+
size="sm"
|
|
340
|
+
onClick={handleSwitchToCustom}
|
|
341
|
+
className="gap-1.5"
|
|
342
|
+
>
|
|
343
|
+
<Pencil className="h-3.5 w-3.5" />
|
|
344
|
+
使用自定义配置
|
|
345
|
+
</Button>
|
|
346
|
+
) : (
|
|
347
|
+
<Button
|
|
348
|
+
type="button"
|
|
349
|
+
variant="secondary"
|
|
350
|
+
size="sm"
|
|
351
|
+
onClick={() => onOpenChange(false)}
|
|
352
|
+
>
|
|
353
|
+
完成
|
|
354
|
+
</Button>
|
|
355
|
+
)}
|
|
356
|
+
</DialogFooter>
|
|
357
|
+
</DialogContent>
|
|
358
|
+
</Dialog>
|
|
359
|
+
);
|
|
360
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { useState } from "react";
|
|
4
|
-
import { Trash2 } from "lucide-react";
|
|
4
|
+
import { Settings2, Trash2 } from "lucide-react";
|
|
5
5
|
|
|
6
6
|
import { Button } from "@/components/ui/button";
|
|
7
7
|
import { Input } from "@/components/ui/input";
|
|
@@ -9,17 +9,25 @@ import {
|
|
|
9
9
|
useChatConfig,
|
|
10
10
|
type MountItem,
|
|
11
11
|
} from "@/components/chat/chat-config-context";
|
|
12
|
+
import { MountRetrievalDialog } from "./mount-retrieval-dialog";
|
|
13
|
+
import type { KnowledgeBase } from "@/types/knowledge-base";
|
|
12
14
|
|
|
13
15
|
interface MountRowProps {
|
|
14
16
|
mount: MountItem;
|
|
15
17
|
subspaceEnabled: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* 该挂载行对应的 KnowledgeBase 详情。仅用于透传给
|
|
20
|
+
* `MountRetrievalDialog`,由父组件按需注入;缺省时设置入口被禁用,
|
|
21
|
+
* 因为 Dialog 渲染依赖 `KnowledgeBase` 上的 `multimodal` / 名称等字段。
|
|
22
|
+
*/
|
|
23
|
+
knowledgeBase?: KnowledgeBase;
|
|
16
24
|
}
|
|
17
25
|
|
|
18
26
|
/**
|
|
19
27
|
* Single-line representation of a mounted KB: name + (optional) subspace
|
|
20
|
-
* editor +
|
|
21
|
-
* `UnifiedRetrievalSection
|
|
22
|
-
*
|
|
28
|
+
* editor + per-KB retrieval settings + remove. The session-wide defaults
|
|
29
|
+
* still live in `UnifiedRetrievalSection`; this row exposes the per-KB
|
|
30
|
+
* override entry via the gear icon (opens `MountRetrievalDialog`).
|
|
23
31
|
*
|
|
24
32
|
* `subspaceEnabled` controls whether the subspace input is shown; when the
|
|
25
33
|
* KB was created without subspace support we hide the input entirely so the
|
|
@@ -27,12 +35,21 @@ interface MountRowProps {
|
|
|
27
35
|
* Any residual `mount.subspace` from prior sessions is left untouched — if
|
|
28
36
|
* it's a non-empty array it still gets sent; in practice this path is cold
|
|
29
37
|
* because a KB's subspace flag is immutable post-creation.
|
|
38
|
+
*
|
|
39
|
+
* 当 `mount.retrieval` 存在(即该 KB 已切换为自定义配置)时,齿轮按钮
|
|
40
|
+
* 右上角显示一个小色点作为视觉提示,便于用户在不打开 Dialog 的情况下
|
|
41
|
+
* 区分继承全局 / 自定义配置。
|
|
30
42
|
*/
|
|
31
|
-
export function MountRow({
|
|
43
|
+
export function MountRow({
|
|
44
|
+
mount,
|
|
45
|
+
subspaceEnabled,
|
|
46
|
+
knowledgeBase,
|
|
47
|
+
}: MountRowProps) {
|
|
32
48
|
const cfg = useChatConfig();
|
|
33
49
|
const [subspaceText, setSubspaceText] = useState(
|
|
34
50
|
(mount.subspace ?? []).join(", "),
|
|
35
51
|
);
|
|
52
|
+
const [dialogOpen, setDialogOpen] = useState<boolean>(false);
|
|
36
53
|
|
|
37
54
|
const commitSubspace = () => {
|
|
38
55
|
const next = subspaceText
|
|
@@ -70,6 +87,25 @@ export function MountRow({ mount, subspaceEnabled }: MountRowProps) {
|
|
|
70
87
|
className="h-8 w-44 text-xs"
|
|
71
88
|
/>
|
|
72
89
|
) : null}
|
|
90
|
+
<div className="relative">
|
|
91
|
+
<Button
|
|
92
|
+
type="button"
|
|
93
|
+
variant="ghost"
|
|
94
|
+
size="icon"
|
|
95
|
+
className="h-7 w-7"
|
|
96
|
+
onClick={() => setDialogOpen(true)}
|
|
97
|
+
disabled={!knowledgeBase}
|
|
98
|
+
title={knowledgeBase ? "检索参数" : "知识库信息加载中"}
|
|
99
|
+
>
|
|
100
|
+
<Settings2 className="h-3.5 w-3.5 text-muted-foreground" />
|
|
101
|
+
</Button>
|
|
102
|
+
{mount.retrieval ? (
|
|
103
|
+
<span
|
|
104
|
+
aria-hidden
|
|
105
|
+
className="pointer-events-none absolute -top-0.5 -right-0.5 h-2 w-2 rounded-full bg-primary"
|
|
106
|
+
/>
|
|
107
|
+
) : null}
|
|
108
|
+
</div>
|
|
73
109
|
<Button
|
|
74
110
|
type="button"
|
|
75
111
|
variant="ghost"
|
|
@@ -80,6 +116,14 @@ export function MountRow({ mount, subspaceEnabled }: MountRowProps) {
|
|
|
80
116
|
>
|
|
81
117
|
<Trash2 className="h-3.5 w-3.5 text-muted-foreground" />
|
|
82
118
|
</Button>
|
|
119
|
+
{knowledgeBase ? (
|
|
120
|
+
<MountRetrievalDialog
|
|
121
|
+
mount={mount}
|
|
122
|
+
knowledgeBase={knowledgeBase}
|
|
123
|
+
open={dialogOpen}
|
|
124
|
+
onOpenChange={setDialogOpen}
|
|
125
|
+
/>
|
|
126
|
+
) : null}
|
|
83
127
|
</div>
|
|
84
128
|
);
|
|
85
129
|
}
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import { useEffect, useRef } from "react";
|
|
3
|
+
import { useEffect, useRef, useState } from "react";
|
|
4
4
|
import { useForm } from "react-hook-form";
|
|
5
5
|
import { zodResolver } from "@hookform/resolvers/zod";
|
|
6
|
-
import { Info } from "lucide-react";
|
|
6
|
+
import { ChevronDown, Info } from "lucide-react";
|
|
7
7
|
|
|
8
|
+
import {
|
|
9
|
+
Collapsible,
|
|
10
|
+
CollapsibleContent,
|
|
11
|
+
CollapsibleTrigger,
|
|
12
|
+
} from "@/components/ui/collapsible";
|
|
8
13
|
import { Form } from "@/components/ui/form";
|
|
9
14
|
import { Label } from "@/components/ui/label";
|
|
10
15
|
import type { FilterBuilderHandle } from "@/components/retrieval/filter-builder";
|
|
@@ -60,6 +65,7 @@ export function UnifiedRetrievalSection({
|
|
|
60
65
|
// `knowledgeBaseName` is structurally required by the schema but unused
|
|
61
66
|
// here; a placeholder keeps Zod quiet without leaking into persistence.
|
|
62
67
|
knowledgeBaseName: singleKb?.knowledgeBaseName ?? "__unified__",
|
|
68
|
+
queryType: "TEXT" as const,
|
|
63
69
|
query: "__unified_placeholder__",
|
|
64
70
|
subspace: [],
|
|
65
71
|
topK: cfg.perKbTopK,
|
|
@@ -81,6 +87,7 @@ export function UnifiedRetrievalSection({
|
|
|
81
87
|
useEffect(() => {
|
|
82
88
|
form.reset({
|
|
83
89
|
knowledgeBaseName: singleKb?.knowledgeBaseName ?? "__unified__",
|
|
90
|
+
queryType: "TEXT" as const,
|
|
84
91
|
query: "__unified_placeholder__",
|
|
85
92
|
subspace: [],
|
|
86
93
|
topK: cfg.perKbTopK,
|
|
@@ -141,44 +148,72 @@ export function UnifiedRetrievalSection({
|
|
|
141
148
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
142
149
|
}, [rerankType]);
|
|
143
150
|
|
|
151
|
+
// 默认折叠:现在的角色从“统一应用”降格为“默认 fallback”,绝大部分
|
|
152
|
+
// 用户在 KB 自定义参数后无需展开此区域。disabled 状态下隐藏触发器,
|
|
153
|
+
// 避免用户在没有挂载 KB 时点开一个内容为空的折叠区。
|
|
154
|
+
const [open, setOpen] = useState(false);
|
|
155
|
+
|
|
144
156
|
return (
|
|
145
|
-
<
|
|
157
|
+
<Collapsible
|
|
158
|
+
open={disabled ? false : open}
|
|
159
|
+
onOpenChange={(next) => {
|
|
160
|
+
if (disabled) return;
|
|
161
|
+
setOpen(next);
|
|
162
|
+
}}
|
|
146
163
|
className={
|
|
147
164
|
"space-y-3 border-t border-[hsl(var(--border))] pt-4" +
|
|
148
165
|
(disabled ? " pointer-events-none opacity-50" : "")
|
|
149
166
|
}
|
|
150
167
|
aria-disabled={disabled}
|
|
151
168
|
>
|
|
152
|
-
<div>
|
|
153
|
-
<
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
169
|
+
<div className="flex items-start justify-between gap-3">
|
|
170
|
+
<div className="min-w-0">
|
|
171
|
+
<Label className="text-sm font-medium">全局默认检索参数</Label>
|
|
172
|
+
<p className="mt-0.5 text-xs text-muted-foreground">
|
|
173
|
+
未单独配置的知识库将使用此默认参数
|
|
174
|
+
</p>
|
|
175
|
+
</div>
|
|
176
|
+
{!disabled && (
|
|
177
|
+
<CollapsibleTrigger
|
|
178
|
+
type="button"
|
|
179
|
+
aria-label={open ? "收起全局默认检索参数" : "展开全局默认检索参数"}
|
|
180
|
+
className="inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--accent-foreground))]"
|
|
181
|
+
>
|
|
182
|
+
<ChevronDown
|
|
183
|
+
className={
|
|
184
|
+
"h-4 w-4 transition-transform duration-150" +
|
|
185
|
+
(open ? " rotate-180" : "")
|
|
186
|
+
}
|
|
187
|
+
/>
|
|
188
|
+
</CollapsibleTrigger>
|
|
189
|
+
)}
|
|
157
190
|
</div>
|
|
158
191
|
|
|
159
192
|
{disabled ? (
|
|
160
193
|
<div className="flex items-start gap-2 rounded-md border border-dashed border-[hsl(var(--border))] bg-[hsl(var(--muted)/0.4)] px-3 py-3 text-xs text-muted-foreground">
|
|
161
194
|
<Info className="mt-0.5 h-3.5 w-3.5 shrink-0" />
|
|
162
|
-
<span
|
|
195
|
+
<span>挂载至少一个知识库后即可配置全局默认检索参数</span>
|
|
163
196
|
</div>
|
|
164
197
|
) : (
|
|
165
|
-
<
|
|
166
|
-
<form
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
198
|
+
<CollapsibleContent>
|
|
199
|
+
<Form {...form}>
|
|
200
|
+
<form
|
|
201
|
+
onSubmit={(e) => e.preventDefault()}
|
|
202
|
+
onBlur={commit}
|
|
203
|
+
className="space-y-4"
|
|
204
|
+
>
|
|
205
|
+
<RetrievalParamsFields
|
|
206
|
+
form={form}
|
|
207
|
+
knowledgeBase={singleKb}
|
|
208
|
+
filterRef={filterRef}
|
|
209
|
+
topKLabel="TopK"
|
|
210
|
+
topKHint="单库检索条数,默认 20"
|
|
211
|
+
topKMode="single"
|
|
212
|
+
/>
|
|
213
|
+
</form>
|
|
214
|
+
</Form>
|
|
215
|
+
</CollapsibleContent>
|
|
181
216
|
)}
|
|
182
|
-
</
|
|
217
|
+
</Collapsible>
|
|
183
218
|
);
|
|
184
219
|
}
|