@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
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { useRef, useState } from "react";
|
|
4
4
|
import { useForm } from "react-hook-form";
|
|
5
5
|
import { zodResolver } from "@hookform/resolvers/zod";
|
|
6
|
-
import { Check, Code2, Copy, Search } from "lucide-react";
|
|
6
|
+
import { Check, Code2, Copy, ImageIcon, Search, Upload, X } from "lucide-react";
|
|
7
7
|
import { toast } from "sonner";
|
|
8
8
|
import { Button } from "@/components/ui/button";
|
|
9
9
|
import { Input } from "@/components/ui/input";
|
|
@@ -26,12 +26,13 @@ import {
|
|
|
26
26
|
TooltipProvider,
|
|
27
27
|
TooltipTrigger,
|
|
28
28
|
} from "@/components/ui/tooltip";
|
|
29
|
+
import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group";
|
|
29
30
|
import { type FilterBuilderHandle } from "./filter-builder";
|
|
30
31
|
import { RetrievalParamsFields } from "./retrieval-params-fields";
|
|
31
32
|
import { assembleRetrievalConfiguration } from "./assemble-retrieval-configuration";
|
|
32
33
|
import { retrievalSchema, type RetrievalInput } from "@/schemas/retrieval";
|
|
33
34
|
import type { KnowledgeBase } from "@/types/knowledge-base";
|
|
34
|
-
import type { RetrievalRequest } from "@/types/retrieval";
|
|
35
|
+
import type { RetrievalQuery, RetrievalRequest } from "@/types/retrieval";
|
|
35
36
|
|
|
36
37
|
interface RetrievalFormProps {
|
|
37
38
|
knowledgeBaseName: string;
|
|
@@ -59,9 +60,18 @@ export function assembleRetrievalRequest(
|
|
|
59
60
|
const config = assembleRetrievalConfiguration(v, undefined) ?? {};
|
|
60
61
|
if (filter) config.filter = filter;
|
|
61
62
|
|
|
63
|
+
const retrievalQuery: RetrievalQuery =
|
|
64
|
+
v.queryType === "IMAGE" && v.imageInput
|
|
65
|
+
? {
|
|
66
|
+
type: "IMAGE" as const,
|
|
67
|
+
imageBase64: v.imageInput,
|
|
68
|
+
...(v.query ? { text: v.query } : {}),
|
|
69
|
+
}
|
|
70
|
+
: { type: "TEXT" as const, text: v.query ?? "" };
|
|
71
|
+
|
|
62
72
|
const req: RetrievalRequest = {
|
|
63
73
|
knowledgeBaseName,
|
|
64
|
-
retrievalQuery
|
|
74
|
+
retrievalQuery,
|
|
65
75
|
};
|
|
66
76
|
if (v.subspace?.length) req.subspace = v.subspace;
|
|
67
77
|
if (Object.keys(config).length > 0) req.retrievalConfiguration = config;
|
|
@@ -100,7 +110,9 @@ export function retrievalDefaultsFromKB(
|
|
|
100
110
|
|
|
101
111
|
return {
|
|
102
112
|
knowledgeBaseName,
|
|
113
|
+
queryType: "TEXT" as const,
|
|
103
114
|
query: "",
|
|
115
|
+
imageInput: "",
|
|
104
116
|
subspace: [],
|
|
105
117
|
topK: kbRerankTopK,
|
|
106
118
|
denseTopK: kbDenseTopK,
|
|
@@ -214,6 +226,9 @@ export function RetrievalForm({
|
|
|
214
226
|
isLoading,
|
|
215
227
|
}: RetrievalFormProps) {
|
|
216
228
|
const filterRef = useRef<FilterBuilderHandle>(null);
|
|
229
|
+
const fileInputRef = useRef<HTMLInputElement>(null);
|
|
230
|
+
const [fileName, setFileName] = useState("");
|
|
231
|
+
const [isDragging, setIsDragging] = useState(false);
|
|
217
232
|
|
|
218
233
|
const form = useForm<RetrievalInput>({
|
|
219
234
|
resolver: zodResolver(retrievalSchema),
|
|
@@ -234,6 +249,12 @@ export function RetrievalForm({
|
|
|
234
249
|
return assembleRetrievalRequest(knowledgeBaseName, values, filter) as unknown as Record<string, unknown>;
|
|
235
250
|
};
|
|
236
251
|
|
|
252
|
+
const isMultimodal = knowledgeBase?.multimodal === true;
|
|
253
|
+
const queryType = form.watch("queryType") ?? "TEXT";
|
|
254
|
+
|
|
255
|
+
// Force TEXT mode for non-multimodal KBs
|
|
256
|
+
const effectiveQueryType = isMultimodal ? queryType : "TEXT";
|
|
257
|
+
|
|
237
258
|
return (
|
|
238
259
|
<Form {...form}>
|
|
239
260
|
<form
|
|
@@ -245,27 +266,223 @@ export function RetrievalForm({
|
|
|
245
266
|
<RequestPreviewButton buildRequestJson={buildRequestJson} />
|
|
246
267
|
</div>
|
|
247
268
|
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
<
|
|
254
|
-
|
|
255
|
-
<
|
|
256
|
-
<
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
+
{isMultimodal && (
|
|
270
|
+
<FormField
|
|
271
|
+
control={form.control}
|
|
272
|
+
name="queryType"
|
|
273
|
+
render={({ field }) => (
|
|
274
|
+
<FormItem>
|
|
275
|
+
<FormLabel>查询类型</FormLabel>
|
|
276
|
+
<FormControl>
|
|
277
|
+
<ToggleGroup
|
|
278
|
+
type="single"
|
|
279
|
+
value={field.value ?? "TEXT"}
|
|
280
|
+
onValueChange={(v) => {
|
|
281
|
+
if (v && v !== field.value) {
|
|
282
|
+
field.onChange(v);
|
|
283
|
+
// Clear both inputs on type switch to avoid stale values
|
|
284
|
+
form.setValue("query", "");
|
|
285
|
+
form.setValue("imageInput", "");
|
|
286
|
+
}
|
|
287
|
+
}}
|
|
288
|
+
className="grid w-full grid-cols-2 gap-0 overflow-hidden rounded-lg border border-border bg-[hsl(var(--muted)/0.4)] p-0 sm:max-w-md"
|
|
289
|
+
>
|
|
290
|
+
<ToggleGroupItem value="TEXT" className="h-9">
|
|
291
|
+
TEXT
|
|
292
|
+
</ToggleGroupItem>
|
|
293
|
+
<ToggleGroupItem value="IMAGE" className="h-9">
|
|
294
|
+
IMAGE
|
|
295
|
+
</ToggleGroupItem>
|
|
296
|
+
</ToggleGroup>
|
|
297
|
+
</FormControl>
|
|
298
|
+
</FormItem>
|
|
299
|
+
)}
|
|
300
|
+
/>
|
|
301
|
+
)}
|
|
302
|
+
|
|
303
|
+
{effectiveQueryType === "TEXT" ? (
|
|
304
|
+
<FormField
|
|
305
|
+
control={form.control}
|
|
306
|
+
name="query"
|
|
307
|
+
render={({ field }) => (
|
|
308
|
+
<FormItem>
|
|
309
|
+
<FormLabel>查询内容</FormLabel>
|
|
310
|
+
<FormControl>
|
|
311
|
+
<div className="relative">
|
|
312
|
+
<Search className="absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-[hsl(var(--muted-foreground))]" />
|
|
313
|
+
<Input
|
|
314
|
+
placeholder="输入检索查询..."
|
|
315
|
+
className="pl-9"
|
|
316
|
+
maxLength={128}
|
|
317
|
+
{...field}
|
|
318
|
+
/>
|
|
319
|
+
</div>
|
|
320
|
+
</FormControl>
|
|
321
|
+
<FormMessage />
|
|
322
|
+
</FormItem>
|
|
323
|
+
)}
|
|
324
|
+
/>
|
|
325
|
+
) : (
|
|
326
|
+
<>
|
|
327
|
+
{/* Image file upload */}
|
|
328
|
+
<FormField
|
|
329
|
+
control={form.control}
|
|
330
|
+
name="imageInput"
|
|
331
|
+
render={({ field }) => {
|
|
332
|
+
const acceptedTypes = ["image/jpeg", "image/png", "image/webp", "image/bmp", "image/tiff"];
|
|
333
|
+
|
|
334
|
+
const handleFile = (file: File) => {
|
|
335
|
+
if (!acceptedTypes.includes(file.type)) {
|
|
336
|
+
toast.error("不支持的图片格式,请选择 JPG/PNG/WebP/BMP/TIFF 格式");
|
|
337
|
+
return;
|
|
338
|
+
}
|
|
339
|
+
const reader = new FileReader();
|
|
340
|
+
reader.onload = () => {
|
|
341
|
+
field.onChange(reader.result as string);
|
|
342
|
+
setFileName(file.name || "pasted-image");
|
|
343
|
+
};
|
|
344
|
+
reader.onerror = () => {
|
|
345
|
+
toast.error("图片读取失败,请重试");
|
|
346
|
+
};
|
|
347
|
+
reader.readAsDataURL(file);
|
|
348
|
+
};
|
|
349
|
+
|
|
350
|
+
const handleRemove = () => {
|
|
351
|
+
field.onChange("");
|
|
352
|
+
setFileName("");
|
|
353
|
+
if (fileInputRef.current) {
|
|
354
|
+
fileInputRef.current.value = "";
|
|
355
|
+
}
|
|
356
|
+
};
|
|
357
|
+
|
|
358
|
+
const handlePaste = (e: React.ClipboardEvent) => {
|
|
359
|
+
const items = e.clipboardData?.items;
|
|
360
|
+
if (!items) return;
|
|
361
|
+
|
|
362
|
+
for (const item of Array.from(items)) {
|
|
363
|
+
if (item.type.startsWith("image/")) {
|
|
364
|
+
e.preventDefault();
|
|
365
|
+
const file = item.getAsFile();
|
|
366
|
+
if (file) handleFile(file);
|
|
367
|
+
return;
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
};
|
|
371
|
+
|
|
372
|
+
return (
|
|
373
|
+
<FormItem>
|
|
374
|
+
<FormLabel>图片输入</FormLabel>
|
|
375
|
+
<FormControl>
|
|
376
|
+
<div
|
|
377
|
+
key={queryType}
|
|
378
|
+
onPaste={handlePaste}
|
|
379
|
+
tabIndex={0}
|
|
380
|
+
className="outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 rounded-md"
|
|
381
|
+
>
|
|
382
|
+
<input
|
|
383
|
+
ref={fileInputRef}
|
|
384
|
+
type="file"
|
|
385
|
+
accept="image/jpeg,image/png,image/webp,image/bmp,image/tiff"
|
|
386
|
+
className="hidden"
|
|
387
|
+
onChange={(e) => {
|
|
388
|
+
const file = e.target.files?.[0];
|
|
389
|
+
if (file) handleFile(file);
|
|
390
|
+
}}
|
|
391
|
+
/>
|
|
392
|
+
|
|
393
|
+
{!field.value ? (
|
|
394
|
+
<div
|
|
395
|
+
onClick={() => fileInputRef.current?.click()}
|
|
396
|
+
onDragOver={(e) => {
|
|
397
|
+
e.preventDefault();
|
|
398
|
+
setIsDragging(true);
|
|
399
|
+
}}
|
|
400
|
+
onDragLeave={() => setIsDragging(false)}
|
|
401
|
+
onDrop={(e) => {
|
|
402
|
+
e.preventDefault();
|
|
403
|
+
setIsDragging(false);
|
|
404
|
+
const file = e.dataTransfer.files[0];
|
|
405
|
+
if (file) handleFile(file);
|
|
406
|
+
}}
|
|
407
|
+
className={`border-2 border-dashed rounded-lg p-8 flex flex-col items-center gap-3 cursor-pointer transition-colors ${
|
|
408
|
+
isDragging
|
|
409
|
+
? "border-primary bg-accent/50"
|
|
410
|
+
: "border-border hover:border-primary/50 hover:bg-accent/50"
|
|
411
|
+
}`}
|
|
412
|
+
>
|
|
413
|
+
<Upload className="w-8 h-8 text-muted-foreground" />
|
|
414
|
+
<p className="text-sm text-muted-foreground">
|
|
415
|
+
点击、拖拽或粘贴图片到此处
|
|
416
|
+
</p>
|
|
417
|
+
<p className="text-xs text-muted-foreground/70">
|
|
418
|
+
支持 JPG/PNG/WebP/BMP/TIFF
|
|
419
|
+
</p>
|
|
420
|
+
</div>
|
|
421
|
+
) : (
|
|
422
|
+
/* 已选择态 - 悬停遮罩式 */
|
|
423
|
+
<div className="group border border-border rounded-md overflow-hidden">
|
|
424
|
+
{/* 图片预览区域 */}
|
|
425
|
+
<div className="relative flex justify-center bg-muted/30 p-3">
|
|
426
|
+
<img
|
|
427
|
+
src={field.value}
|
|
428
|
+
alt="已选择的图片预览"
|
|
429
|
+
className="max-h-[200px] max-w-full rounded object-contain"
|
|
430
|
+
/>
|
|
431
|
+
{/* 悬停遮罩 + 操作按钮 */}
|
|
432
|
+
<div className="absolute inset-0 bg-black/40 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center gap-3">
|
|
433
|
+
<button
|
|
434
|
+
type="button"
|
|
435
|
+
onClick={() => fileInputRef.current?.click()}
|
|
436
|
+
className="px-3 py-1.5 rounded bg-white/90 text-sm font-medium text-foreground hover:bg-white flex items-center gap-1.5"
|
|
437
|
+
>
|
|
438
|
+
<Upload className="w-3.5 h-3.5" />
|
|
439
|
+
重新选择
|
|
440
|
+
</button>
|
|
441
|
+
<button
|
|
442
|
+
type="button"
|
|
443
|
+
onClick={handleRemove}
|
|
444
|
+
className="px-3 py-1.5 rounded bg-white/90 text-sm font-medium text-destructive hover:bg-white flex items-center gap-1.5"
|
|
445
|
+
>
|
|
446
|
+
<X className="w-3.5 h-3.5" />
|
|
447
|
+
删除
|
|
448
|
+
</button>
|
|
449
|
+
</div>
|
|
450
|
+
</div>
|
|
451
|
+
{/* 底部文件信息栏 */}
|
|
452
|
+
<div className="px-3 py-2 border-t border-border flex items-center gap-2 text-sm text-muted-foreground">
|
|
453
|
+
<ImageIcon className="w-3.5 h-3.5" />
|
|
454
|
+
<span className="truncate">{fileName}</span>
|
|
455
|
+
</div>
|
|
456
|
+
</div>
|
|
457
|
+
)}
|
|
458
|
+
</div>
|
|
459
|
+
</FormControl>
|
|
460
|
+
<FormMessage />
|
|
461
|
+
</FormItem>
|
|
462
|
+
);
|
|
463
|
+
}}
|
|
464
|
+
/>
|
|
465
|
+
|
|
466
|
+
{/* Supplementary text */}
|
|
467
|
+
<FormField
|
|
468
|
+
control={form.control}
|
|
469
|
+
name="query"
|
|
470
|
+
render={({ field }) => (
|
|
471
|
+
<FormItem>
|
|
472
|
+
<FormLabel>补充文本(可选)</FormLabel>
|
|
473
|
+
<FormControl>
|
|
474
|
+
<Input
|
|
475
|
+
placeholder="补充文本描述..."
|
|
476
|
+
maxLength={128}
|
|
477
|
+
{...field}
|
|
478
|
+
/>
|
|
479
|
+
</FormControl>
|
|
480
|
+
<FormMessage />
|
|
481
|
+
</FormItem>
|
|
482
|
+
)}
|
|
483
|
+
/>
|
|
484
|
+
</>
|
|
485
|
+
)}
|
|
269
486
|
|
|
270
487
|
<RetrievalParamsFields
|
|
271
488
|
form={form}
|
package/dist/dashboard-runtime/dashboard/src/components/retrieval/retrieval-rerank-fields.tsx
CHANGED
|
@@ -175,6 +175,7 @@ const PROVIDER_OPTIONS: { value: string; label: string }[] = [
|
|
|
175
175
|
const BAILIAN_MODEL_OPTIONS: { value: string; label: string }[] = [
|
|
176
176
|
{ value: "gte-rerank-v2", label: "gte-rerank-v2" },
|
|
177
177
|
{ value: "qwen3-rerank", label: "qwen3-rerank" },
|
|
178
|
+
{ value: "qwen3-vl-rerank", label: "qwen3-vl-rerank (多模态)" },
|
|
178
179
|
];
|
|
179
180
|
|
|
180
181
|
function ModelFields({ form }: { form: UseFormReturn<RetrievalInput> }) {
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
1
2
|
import { Card, CardContent } from "@/components/ui/card";
|
|
2
3
|
import { Badge } from "@/components/ui/badge";
|
|
4
|
+
import { Dialog, DialogContent, DialogTitle } from "@/components/ui/dialog";
|
|
3
5
|
import type { RetrievalResult } from "@/types/retrieval";
|
|
6
|
+
import { IMAGE_FALLBACK_DATA_PREFIX } from "@/lib/constants";
|
|
4
7
|
|
|
5
8
|
interface RetrievalResultCardProps {
|
|
6
9
|
result: RetrievalResult;
|
|
@@ -8,12 +11,24 @@ interface RetrievalResultCardProps {
|
|
|
8
11
|
}
|
|
9
12
|
|
|
10
13
|
export function RetrievalResultCard({ result, rank }: RetrievalResultCardProps) {
|
|
14
|
+
const [zoomedImage, setZoomedImage] = useState<string | null>(null);
|
|
11
15
|
const fileName = result.ossKey?.split("/").pop() || result.ossKey || "未知文件";
|
|
12
16
|
|
|
17
|
+
const isImageChunk = result.chunkType?.toLowerCase() === "image";
|
|
18
|
+
const chunkBadgeVariant = isImageChunk ? "default" : "secondary";
|
|
19
|
+
|
|
20
|
+
// 当后端只返回裸 base64(无 data URL 前缀)时,补充通用 MIME 兜底。
|
|
21
|
+
// 浏览器会按内容嗅探解码,这里只需是合法 image/* 类型以避免 CSP 拒绝渲染。
|
|
22
|
+
const imageSrc = result.imageBase64
|
|
23
|
+
? result.imageBase64.startsWith("data:")
|
|
24
|
+
? result.imageBase64
|
|
25
|
+
: `${IMAGE_FALLBACK_DATA_PREFIX}${result.imageBase64}`
|
|
26
|
+
: undefined;
|
|
27
|
+
|
|
13
28
|
return (
|
|
14
29
|
<Card className="transition-shadow hover:shadow-sm">
|
|
15
30
|
<CardContent className="p-4 space-y-3">
|
|
16
|
-
{/* 头部: 排名 + Score */}
|
|
31
|
+
{/* 头部: 排名 + Score + chunkType */}
|
|
17
32
|
<div className="flex items-center justify-between">
|
|
18
33
|
<div className="flex items-center gap-2">
|
|
19
34
|
<span className="flex h-6 w-6 items-center justify-center rounded-full bg-[hsl(var(--primary-50))] text-xs font-semibold text-primary">
|
|
@@ -22,6 +37,11 @@ export function RetrievalResultCard({ result, rank }: RetrievalResultCardProps)
|
|
|
22
37
|
<Badge variant="outline" className="font-mono text-xs">
|
|
23
38
|
{result.score.toFixed(4)}
|
|
24
39
|
</Badge>
|
|
40
|
+
{result.chunkType && (
|
|
41
|
+
<Badge variant={chunkBadgeVariant} className="text-xs">
|
|
42
|
+
{result.chunkType.toUpperCase()}
|
|
43
|
+
</Badge>
|
|
44
|
+
)}
|
|
25
45
|
</div>
|
|
26
46
|
{result.subspace && (
|
|
27
47
|
<Badge variant="secondary" className="text-xs">
|
|
@@ -37,9 +57,23 @@ export function RetrievalResultCard({ result, rank }: RetrievalResultCardProps)
|
|
|
37
57
|
</div>
|
|
38
58
|
|
|
39
59
|
{/* 内容片段 */}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
60
|
+
{isImageChunk && result.imageBase64 && imageSrc && (
|
|
61
|
+
<img
|
|
62
|
+
src={imageSrc}
|
|
63
|
+
alt="检索结果图片"
|
|
64
|
+
className="max-w-[200px] rounded-md cursor-pointer hover:opacity-80 transition-opacity"
|
|
65
|
+
onClick={() => setZoomedImage(imageSrc)}
|
|
66
|
+
/>
|
|
67
|
+
)}
|
|
68
|
+
{result.content && (
|
|
69
|
+
<p
|
|
70
|
+
className={`leading-relaxed text-foreground/90 whitespace-pre-wrap ${
|
|
71
|
+
isImageChunk ? "text-xs" : "text-sm line-clamp-6"
|
|
72
|
+
}`}
|
|
73
|
+
>
|
|
74
|
+
{result.content}
|
|
75
|
+
</p>
|
|
76
|
+
)}
|
|
43
77
|
|
|
44
78
|
{/* Metadata */}
|
|
45
79
|
{result.metadata && Object.keys(result.metadata).length > 0 && (
|
|
@@ -56,6 +90,20 @@ export function RetrievalResultCard({ result, rank }: RetrievalResultCardProps)
|
|
|
56
90
|
</div>
|
|
57
91
|
)}
|
|
58
92
|
</CardContent>
|
|
93
|
+
|
|
94
|
+
{/* 图片放大预览 */}
|
|
95
|
+
<Dialog open={!!zoomedImage} onOpenChange={() => setZoomedImage(null)}>
|
|
96
|
+
<DialogContent className="max-w-[90vw] max-h-[90vh] p-2 flex items-center justify-center border-none bg-black/90 data-[state=open]:animate-none data-[state=closed]:animate-none duration-0">
|
|
97
|
+
<DialogTitle className="sr-only">图片放大预览</DialogTitle>
|
|
98
|
+
{zoomedImage && (
|
|
99
|
+
<img
|
|
100
|
+
src={zoomedImage}
|
|
101
|
+
alt="放大预览"
|
|
102
|
+
className="max-w-full max-h-[85vh] object-contain"
|
|
103
|
+
/>
|
|
104
|
+
)}
|
|
105
|
+
</DialogContent>
|
|
106
|
+
</Dialog>
|
|
59
107
|
</Card>
|
|
60
108
|
);
|
|
61
109
|
}
|
|
@@ -8,12 +8,17 @@ interface StatusBadgeProps {
|
|
|
8
8
|
label?: string;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
+
// Both `success` / `success-soft` (and friends) are registered in
|
|
12
|
+
// tailwind.config.ts and back themselves with HSL CSS variables that
|
|
13
|
+
// already swap inside the `.dark` selector in globals.css, so a single
|
|
14
|
+
// utility class covers both themes. Adding a separate `dark:bg-*`
|
|
15
|
+
// override here would actually clobber the soft token in dark mode.
|
|
11
16
|
const STATUS_CLASS_MAP: Record<BadgeStatus, string> = {
|
|
12
|
-
completed: "bg-
|
|
13
|
-
pending: "bg-
|
|
14
|
-
indexing: "bg-
|
|
15
|
-
failed: "bg-
|
|
16
|
-
deleting: "bg-
|
|
17
|
+
completed: "bg-success-soft text-success",
|
|
18
|
+
pending: "bg-warning-soft text-warning",
|
|
19
|
+
indexing: "bg-info-soft text-info",
|
|
20
|
+
failed: "bg-danger-soft text-danger",
|
|
21
|
+
deleting: "bg-warning-soft text-warning",
|
|
17
22
|
};
|
|
18
23
|
|
|
19
24
|
const STATUS_LABEL_MAP: Record<BadgeStatus, string> = {
|
|
@@ -6,7 +6,7 @@ import { usePathname } from "next/navigation"
|
|
|
6
6
|
|
|
7
7
|
import { cn } from "@/lib/utils"
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
type NavTabBarProps = React.HTMLAttributes<HTMLDivElement>;
|
|
10
10
|
|
|
11
11
|
export function NavTabBar({ className, children, ...props }: NavTabBarProps) {
|
|
12
12
|
return (
|
|
@@ -32,15 +32,17 @@ const TITLE_MAX_LENGTH = 24;
|
|
|
32
32
|
* the exact retrieval setup the user had. Kept structural (not depending on
|
|
33
33
|
* the context module) so this hook remains free of UI layer imports.
|
|
34
34
|
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* aggregate ranking meaningless. The read path tolerates and migrates legacy
|
|
39
|
-
* entries silently. */
|
|
35
|
+
* Per-KB `retrieval` / `topK` 为可选 override:留空则在请求组装阶段继承会话级
|
|
36
|
+
* 全局参数,单 KB 自定义并不会破坏跨 KB 排序——上层在合并前就已经按 KB 各自
|
|
37
|
+
* 的配置打分,再由聚合 topK 统一截断。 */
|
|
40
38
|
export interface ChatSessionMount {
|
|
41
39
|
id: string;
|
|
42
40
|
knowledgeBaseName: string;
|
|
43
41
|
subspace?: string[];
|
|
42
|
+
/** Per-mount retrieval override; falls back to session-wide config when omitted. */
|
|
43
|
+
retrieval?: ChatRetrievalConfig;
|
|
44
|
+
/** Per-mount per-KB topK override; falls back to session-wide perKbTopK when omitted. */
|
|
45
|
+
topK?: number;
|
|
44
46
|
}
|
|
45
47
|
|
|
46
48
|
/** Flat retrieval configuration that mirrors a subset of `RetrievalInput`.
|
|
@@ -150,6 +152,8 @@ function sanitizeSessions(parsed: unknown): ChatSession[] {
|
|
|
150
152
|
id: m.id,
|
|
151
153
|
knowledgeBaseName: m.knowledgeBaseName,
|
|
152
154
|
...(m.subspace && m.subspace.length ? { subspace: m.subspace } : {}),
|
|
155
|
+
...(m.retrieval ? { retrieval: m.retrieval } : {}),
|
|
156
|
+
...(typeof m.topK === "number" ? { topK: m.topK } : {}),
|
|
153
157
|
})),
|
|
154
158
|
memory: sanitizeMemoryBinding(s.config?.memory),
|
|
155
159
|
},
|
|
@@ -20,3 +20,11 @@ export const METADATA_TYPES = [
|
|
|
20
20
|
] as const;
|
|
21
21
|
|
|
22
22
|
export type MetadataType = (typeof METADATA_TYPES)[number];
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* 当后端返回裸 base64(无 data URL 前缀)时,补充的 MIME 类型兜底值。
|
|
26
|
+
* 浏览器会根据实际内容嗅探真实格式,此处只需保证是合法的 image/* 类型
|
|
27
|
+
* 以避免 CSP 拒绝渲染。选用 image/jpeg 是因为知识库文档处理产出的图片
|
|
28
|
+
* 绝大多数为 JPEG 格式。
|
|
29
|
+
*/
|
|
30
|
+
export const IMAGE_FALLBACK_DATA_PREFIX = "data:image/jpeg;base64,";
|
|
@@ -8,6 +8,24 @@ import type {
|
|
|
8
8
|
ModelListItem,
|
|
9
9
|
} from "@/types/llm-provider";
|
|
10
10
|
|
|
11
|
+
// ---------------------------------------------------------------------------
|
|
12
|
+
// Multimodal content types (OpenAI-compatible)
|
|
13
|
+
// ---------------------------------------------------------------------------
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* OpenAI-compatible content part for multimodal messages.
|
|
17
|
+
* Supports text and image_url parts.
|
|
18
|
+
*/
|
|
19
|
+
export type ContentPart =
|
|
20
|
+
| { type: "text"; text: string }
|
|
21
|
+
| { type: "image_url"; image_url: { url: string; detail?: "low" | "high" | "auto" } };
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Message content can be either a plain string (text-only) or an array of
|
|
25
|
+
* content parts (multimodal). Supports text and image_url parts.
|
|
26
|
+
*/
|
|
27
|
+
export type LLMMessageContent = string | ContentPart[];
|
|
28
|
+
|
|
11
29
|
// ---------------------------------------------------------------------------
|
|
12
30
|
// OpenAI-compatible transport
|
|
13
31
|
// ---------------------------------------------------------------------------
|
|
@@ -86,7 +104,7 @@ export async function testConnectivity(
|
|
|
86
104
|
|
|
87
105
|
export interface ChatCompletionStreamParams {
|
|
88
106
|
model: string;
|
|
89
|
-
messages: Array<{ role: ChatRole; content:
|
|
107
|
+
messages: Array<{ role: ChatRole; content: LLMMessageContent }>;
|
|
90
108
|
temperature?: number;
|
|
91
109
|
signal?: AbortSignal;
|
|
92
110
|
}
|
|
@@ -80,6 +80,12 @@ export const createKBSchema = z.object({
|
|
|
80
80
|
metadata: z.array(metadataFieldSchema).max(200).optional(),
|
|
81
81
|
embeddingConfiguration: embeddingConfigSchema.optional(),
|
|
82
82
|
retrievalConfiguration: retrievalConfigSchema.optional(),
|
|
83
|
+
multimodal: z.boolean().optional(),
|
|
84
|
+
ingestConfiguration: z
|
|
85
|
+
.object({
|
|
86
|
+
enableTableFormulaCaption: z.boolean().optional(),
|
|
87
|
+
})
|
|
88
|
+
.optional(),
|
|
83
89
|
});
|
|
84
90
|
|
|
85
91
|
export const updateKBSchema = z.object({
|
|
@@ -1,31 +1,50 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
|
|
3
|
-
export const retrievalSchema = z
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
.
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
3
|
+
export const retrievalSchema = z
|
|
4
|
+
.object({
|
|
5
|
+
knowledgeBaseName: z.string().min(1),
|
|
6
|
+
queryType: z.enum(["TEXT", "IMAGE"]).optional(),
|
|
7
|
+
query: z
|
|
8
|
+
.string()
|
|
9
|
+
.max(128, "查询内容不能超过 128 个字符"),
|
|
10
|
+
imageInput: z.string().optional(),
|
|
11
|
+
subspace: z.array(z.string()).optional(),
|
|
12
|
+
topK: z.number().int().min(0).max(100).default(20).optional(),
|
|
13
|
+
denseTopK: z.number().int().min(0).max(100).default(20).optional(),
|
|
14
|
+
fullTextTopK: z.number().int().min(0).max(100).default(20).optional(),
|
|
15
|
+
rerankTopK: z.number().int().min(0).max(200).default(20).optional(),
|
|
16
|
+
searchType: z
|
|
17
|
+
.array(z.enum(["DENSE_VECTOR", "FULL_TEXT"]))
|
|
18
|
+
.optional(),
|
|
19
|
+
rerankType: z.enum(["RRF", "WEIGHT", "MODEL"]).optional(),
|
|
20
|
+
// RRF parameters
|
|
21
|
+
rrfK: z.number().int().min(1).optional(),
|
|
22
|
+
rrfDenseWeight: z.number().min(0).optional(),
|
|
23
|
+
rrfFullTextWeight: z.number().min(0).optional(),
|
|
24
|
+
// WEIGHT parameters (both clamped 0..1 since they are normalized weights)
|
|
25
|
+
weightDense: z.number().min(0).max(1).optional(),
|
|
26
|
+
weightFullText: z.number().min(0).max(1).optional(),
|
|
27
|
+
// MODEL parameters
|
|
28
|
+
modelProvider: z.string().optional(),
|
|
29
|
+
modelName: z.string().optional(),
|
|
30
|
+
filter: z.record(z.unknown()).optional(),
|
|
31
|
+
})
|
|
32
|
+
.superRefine((data, ctx) => {
|
|
33
|
+
const queryType = data.queryType ?? "TEXT";
|
|
34
|
+
if (queryType === "TEXT" && !data.query?.trim()) {
|
|
35
|
+
ctx.addIssue({
|
|
36
|
+
code: "custom",
|
|
37
|
+
path: ["query"],
|
|
38
|
+
message: "查询内容不能为空",
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
if (queryType === "IMAGE" && !data.imageInput) {
|
|
42
|
+
ctx.addIssue({
|
|
43
|
+
code: "custom",
|
|
44
|
+
path: ["imageInput"],
|
|
45
|
+
message: "请选择或输入图片",
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
});
|
|
30
49
|
|
|
31
50
|
export type RetrievalInput = z.infer<typeof retrievalSchema>;
|