feat: add new design for messages and add inline references#2020
Conversation
…and chunk overlap
…gn for assistant message
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThe PR threads parser and chunk metadata through ingestion, indexing, search, retrieval, and prompt generation, adds onboarding assistant function-call persistence, and introduces citation preprocessing with interactive assistant-message chunk rendering. ChangesCitation-aware chunk metadata flow
Estimated code review effort: 4 (Complex) | ~60 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
React Doctor found 6 new issues in 1 file · 6 warnings · score 78 / 100 (Needs work) · 3 fixed · vs 6 warnings
Reviewed by React Doctor for commit |
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (5)
frontend/app/chat/_types/types.ts (1)
40-84: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winConsider extracting a shared metadata type to reduce 4x field duplication.
embedding_model,parser,page,score,chunk_size,chunk_overlapare each declared four times (top-level,data,data.metadata,metadata). This mirrors the fallback chain inchunk-popup.tsx'sgetMetadataValue, so the shape duplication is functionally intentional, but keeping the field list in sync across four spots increases the chance of drift when new metadata fields are added.♻️ Suggested refactor
+interface ChunkMetadataFields { + embedding_model?: string; + parser?: string; + page?: number | string; + score?: number | string; + chunk_size?: number | string; + chunk_overlap?: number | string; +} + export interface ToolCallResult { text_key?: string; data?: { file_path?: string; text?: string; - page?: number | string; - score?: number | string; - embedding_model?: string; - parser?: string; - chunk_size?: number | string; - chunk_overlap?: number | string; - metadata?: { - embedding_model?: string; - parser?: string; - page?: number | string; - score?: number | string; - chunk_size?: number | string; - chunk_overlap?: number | string; - [key: string]: unknown; - }; + metadata?: ChunkMetadataFields & { [key: string]: unknown }; + [key: string]: unknown; + } & ChunkMetadataFields; + default_value?: string; + chunk_id?: string; + id?: string; + filename?: string; + source_url?: string | null; + text?: string; + metadata?: ChunkMetadataFields & { [key: string]: unknown }; + [key: string]: unknown; +}🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@frontend/app/chat/_types/types.ts` around lines 40 - 84, The ToolCallResult shape repeats the same metadata fields in four places, which makes future updates easy to drift. Extract a shared metadata type for the common fields used by chunk-popup.tsx’s getMetadataValue fallback chain, then reuse it for ToolCallResult’s top-level, data, data.metadata, and metadata properties. Keep the overall structure the same, but centralize the repeated field list so new metadata fields only need to be added once.src/services/langflow_file_service.py (1)
476-478: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winCentralize parser label strings to avoid drift.
"Docling Serve 1.20.0"and"URL Ingester"are hardcoded here, whileprocessors.pydefinesDOCLING_PARSER_LABEL/TEXT_PARSER_LABELconstants for the same values, andchat_service.pyalso hardcodes"URL Ingester"in two places. Consider moving these labels into a shared module (e.g. alongside the existing constants inprocessors.py, or a newconstants.py) and importing them everywhere they're used, so a future rename/version bump doesn't require hunting down every literal.Also applies to: 648-650
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/services/langflow_file_service.py` around lines 476 - 478, The parser labels are duplicated as hardcoded strings, so centralize them in a shared constant location and reuse those symbols everywhere. Move or reuse the existing DOCLING_PARSER_LABEL and TEXT_PARSER_LABEL definitions from processors.py, and replace the inline “Docling Serve 1.20.0” and “URL Ingester” literals in langflow_file_service.py and chat_service.py with imports from that shared source. Keep the naming consistent across the related parser/service methods so future version or label changes only need one update.src/services/chat_service.py (1)
107-128: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDuplicated
DocumentIndexContext/ingest-token construction acrosslangflow_chatandupload_context_chat.Both methods build an almost identical URL-ingest
DocumentIndexContext(now with the addedparser/chunk_size/chunk_overlapfields) and mint a token the same way. Extracting a small helper (e.g._build_url_ingest_token(...)) would prevent the two call sites from drifting as more fields are added.Also applies to: 524-545
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/services/chat_service.py` around lines 107 - 128, The URL-ingest `DocumentIndexContext` and token minting logic is duplicated in `langflow_chat` and `upload_context_chat`, so extract it into a shared helper such as `_build_url_ingest_token(...)` or a small builder used by both methods. Move the repeated `DocumentIndexContext` construction in `chat_service.py` into that helper, including the new `parser`, `chunk_size`, and `chunk_overlap` fields, and have both call sites reuse it to keep the two paths in sync.src/agent.py (1)
37-37: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚖️ Poor tradeoffSystem prompt duplicated verbatim across three files.
The identical prompt string (with the new citation rule) is hardcoded in
src/agent.py(line 37),src/config/config_manager.py(AgentConfig.system_prompt), andfrontend/lib/constants.ts(DEFAULT_AGENT_SETTINGS.system_prompt). Any future change to citation formatting or tool instructions must be kept in sync across all three, which is error-prone.Consider deriving
agent.py's in-memory default fromconfig_manager.AgentConfig.system_prompt(single backend source of truth), and having the frontend fetch it from settings rather than hardcoding a copy.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/agent.py` at line 37, The system prompt text is duplicated across multiple places, so changes to tool instructions or citation formatting will drift out of sync. Make `src/agent.py` use the single backend source of truth from `AgentConfig.system_prompt` in `src/config/config_manager.py`, and remove the hardcoded frontend copy in `DEFAULT_AGENT_SETTINGS.system_prompt` by loading it from settings instead. Keep the prompt content centralized and referenced by `agent.py`, `AgentConfig`, and `DEFAULT_AGENT_SETTINGS` so there is only one canonical prompt to update.frontend/app/chat/_components/chunk-popup.tsx (1)
63-71: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick winHardcoded fabricated parser version as fallback.
When no parser metadata is present, this falls back to a hardcoded, specific-sounding version string
"Docling Serve 1.20.0"rather than a generic label. UnlikeformatSplitConfig, which correctly falls back to actual settings values, this presents a guessed, potentially stale/incorrect version as if it were factual data.♻️ Proposed fix
const fileExt = filename.split(".").pop()?.toLowerCase() || ""; if (fileExt === "txt" || fileExt === "md") return "Text Parser"; - return "Docling Serve 1.20.0"; + return "Docling Serve";
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@frontend/app/chat/_components/assistant-message.tsx`:
- Around line 292-296: The filename derivation in assistant-message.tsx is
duplicated and diverges from citation-cards.tsx, so both consumers should use
the same shared helper. Extract the “derive display filename from data.file_path
or filename” logic into a common helper near the existing markdown-renderer.tsx
utilities (or another shared location), then update assistant-message.tsx and
citation-cards.tsx to call it so the fallback behavior and default label stay
consistent.
In `@frontend/app/chat/_components/chunk-popup.tsx`:
- Around line 176-247: The chunk popover in the popup component behaves like a
modal but is missing dialog semantics and an initial focus target. Update the
main container rendered by the chunk popup (the fixed motion.div in the chunk
popup component) to expose dialog accessibility metadata such as role="dialog"
and aria-modal="true", and ensure focus moves into the popup when isOpen becomes
true. Use a ref on the popup shell or the existing “Close chunk details” button
to set initial focus in the same chunk-popup component, and keep the Escape
handler wired through the existing onClose logic.
In `@frontend/app/chat/_components/citation-cards.tsx`:
- Around line 36-90: In the citation card rendering inside citedSources.map, the
page label only checks page !== null, so undefined still renders as “page
undefined”. Update the page handling to treat undefined as absent and, if
available, fall back to item.data?.page before displaying it. Keep the existing
filename fallback pattern consistent in the same component so the page text is
only shown when a real value exists.
In `@src/services/document_index_writer.py`:
- Around line 224-237: The `chunk_size`/`chunk_overlap` coercion in
`document_index_writer.py` is silently falling back to the raw value when
`int(value)` fails, which can create OpenSearch mapping conflicts. Update the
loop in the document-building logic so that invalid non-numeric values are
skipped instead of assigned to `doc[field_name]`, keeping the indexed type
consistent with the existing numeric mapping. Use the existing `context` and
`metadata` lookup flow around `parser`, `chunk_size`, and `chunk_overlap` to
locate the fix.
---
Nitpick comments:
In `@frontend/app/chat/_types/types.ts`:
- Around line 40-84: The ToolCallResult shape repeats the same metadata fields
in four places, which makes future updates easy to drift. Extract a shared
metadata type for the common fields used by chunk-popup.tsx’s getMetadataValue
fallback chain, then reuse it for ToolCallResult’s top-level, data,
data.metadata, and metadata properties. Keep the overall structure the same, but
centralize the repeated field list so new metadata fields only need to be added
once.
In `@src/agent.py`:
- Line 37: The system prompt text is duplicated across multiple places, so
changes to tool instructions or citation formatting will drift out of sync. Make
`src/agent.py` use the single backend source of truth from
`AgentConfig.system_prompt` in `src/config/config_manager.py`, and remove the
hardcoded frontend copy in `DEFAULT_AGENT_SETTINGS.system_prompt` by loading it
from settings instead. Keep the prompt content centralized and referenced by
`agent.py`, `AgentConfig`, and `DEFAULT_AGENT_SETTINGS` so there is only one
canonical prompt to update.
In `@src/services/chat_service.py`:
- Around line 107-128: The URL-ingest `DocumentIndexContext` and token minting
logic is duplicated in `langflow_chat` and `upload_context_chat`, so extract it
into a shared helper such as `_build_url_ingest_token(...)` or a small builder
used by both methods. Move the repeated `DocumentIndexContext` construction in
`chat_service.py` into that helper, including the new `parser`, `chunk_size`,
and `chunk_overlap` fields, and have both call sites reuse it to keep the two
paths in sync.
In `@src/services/langflow_file_service.py`:
- Around line 476-478: The parser labels are duplicated as hardcoded strings, so
centralize them in a shared constant location and reuse those symbols
everywhere. Move or reuse the existing DOCLING_PARSER_LABEL and
TEXT_PARSER_LABEL definitions from processors.py, and replace the inline
“Docling Serve 1.20.0” and “URL Ingester” literals in langflow_file_service.py
and chat_service.py with imports from that shared source. Keep the naming
consistent across the related parser/service methods so future version or label
changes only need one update.
🪄 Autofix (Beta)
✅ Autofix completed
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: f0be1b9c-eec0-4b2a-808c-c6d0d230a818
📒 Files selected for processing (29)
flows/components/opensearch_multimodal.pyflows/ingestion_flow.jsonflows/openrag_agent.jsonflows/openrag_nudges.jsonflows/openrag_url_mcp.jsonfrontend/app/api/mutations/useUpdateOnboardingStateMutation.tsfrontend/app/api/queries/useGetSearchQuery.tsfrontend/app/api/queries/useGetSettingsQuery.tsfrontend/app/chat/_components/assistant-message.tsxfrontend/app/chat/_components/chunk-popup.tsxfrontend/app/chat/_components/citation-cards.tsxfrontend/app/chat/_components/function-calls/result.tsxfrontend/app/chat/_components/message-actions.tsxfrontend/app/chat/_components/message.tsxfrontend/app/chat/_types/types.tsfrontend/app/globals.cssfrontend/app/onboarding/_components/onboarding-content.tsxfrontend/components/markdown-renderer.tsxfrontend/lib/constants.tsfrontend/tailwind.config.tssrc/agent.pysrc/api/settings/models.pysrc/config/config_manager.pysrc/models/processors.pysrc/services/chat_service.pysrc/services/document_index_writer.pysrc/services/langflow_file_service.pysrc/services/langflow_ingest_token_service.pysrc/services/search_service.py
|
Note Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it. Fixes Applied SuccessfullyFixed 5 file(s) based on 4 unresolved review comments. Files modified:
Commit: The changes have been pushed to the Time taken: |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
src/api/settings/models.py (1)
81-86: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueValidator silently drops malformed
resultpayloads.
ignore_non_list_resultconverts any non-list, non-Noneresultvalue toNonewithout logging, so malformed onboarding payloads fail silently instead of surfacing an error. Givensrc/**/*.pyshould useget_loggerfor diagnostics rather than staying silent, consider logging a warning when discarding an unexpected shape.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/api/settings/models.py` around lines 81 - 86, The ignore_non_list_result validator in the settings model is silently discarding unexpected result payloads by turning any non-list, non-None value into None. Update this validator to use get_logger and emit a warning whenever it drops a malformed result shape, while still preserving the current fallback behavior. Keep the change localized to the validator on the result field so onboarding payload issues are visible in diagnostics instead of failing silently.frontend/app/onboarding/_components/onboarding-content.tsx (1)
59-68: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDuplicate
hasNestedResultstype guard.This is byte-for-byte identical to
hasNestedResultsinfrontend/app/chat/_components/assistant-message.tsx(Lines 59-68 per the graph context). Consider extracting to a shared module (e.g. alongsideToolCallResult/FunctionCalltypes or a smallcitation-utils.ts) to avoid drift between the two copies.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@frontend/app/onboarding/_components/onboarding-content.tsx` around lines 59 - 68, The hasNestedResults type guard is duplicated in onboarding-content.tsx and assistant-message.tsx, so move this logic into a shared helper module and import it from both places to prevent drift. Keep the existing hasNestedResults behavior unchanged, but centralize it near the related ToolCallResult/FunctionCall types or in a small shared utility file. Update both onboarding-content and AssistantMessage to use the shared implementation instead of maintaining two copies.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@frontend/app/onboarding/_components/onboarding-content.tsx`:
- Around line 59-68: The hasNestedResults type guard is duplicated in
onboarding-content.tsx and assistant-message.tsx, so move this logic into a
shared helper module and import it from both places to prevent drift. Keep the
existing hasNestedResults behavior unchanged, but centralize it near the related
ToolCallResult/FunctionCall types or in a small shared utility file. Update both
onboarding-content and AssistantMessage to use the shared implementation instead
of maintaining two copies.
In `@src/api/settings/models.py`:
- Around line 81-86: The ignore_non_list_result validator in the settings model
is silently discarding unexpected result payloads by turning any non-list,
non-None value into None. Update this validator to use get_logger and emit a
warning whenever it drops a malformed result shape, while still preserving the
current fallback behavior. Keep the change localized to the validator on the
result field so onboarding payload issues are visible in diagnostics instead of
failing silently.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 255f0a5f-68f0-42a9-924f-c1e8541d803b
📒 Files selected for processing (6)
frontend/app/chat/_components/assistant-message.tsxfrontend/app/chat/_components/citation-cards.tsxfrontend/app/onboarding/_components/onboarding-content.tsxfrontend/components/markdown-citations.tsfrontend/components/markdown-renderer.tsxsrc/api/settings/models.py
🚧 Files skipped from review as they are similar to previous changes (3)
- frontend/components/markdown-citations.ts
- frontend/components/markdown-renderer.tsx
- frontend/app/chat/_components/assistant-message.tsx
|
Approved by the design team |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@frontend/app/chat/_components/chunk-popup.tsx`:
- Around line 110-112: The popup’s initial focus is being handled with a
mount-only useEffect in chunk-popup’s PopoverContent, so it won’t refocus
correctly when reopening different citations. Move the close button focusing
logic into PopoverContent’s onOpenAutoFocus handler, call
event.preventDefault(), and focus closeButtonRef.current there instead of
relying on the existing effect.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 2986af33-4f4c-4d76-b21f-1b8da4d8a98d
📒 Files selected for processing (3)
frontend/app/chat/_components/assistant-message.tsxfrontend/app/chat/_components/chunk-popup.tsxfrontend/app/chat/_components/citation-cards.tsx
🚧 Files skipped from review as they are similar to previous changes (2)
- frontend/app/chat/_components/citation-cards.tsx
- frontend/app/chat/_components/assistant-message.tsx
…model option (#2031) * fix: remediate image_scan CVEs in backend, frontend, and langflow images (#2000) * fix light color text catergory chips in light mode (#2013) Co-authored-by: Olfa Maslah <[email protected]> * fix: upgraded version of docling (#1995) * changed version of docling * fix logs not being the correct ones * go back to sequential building to save space * add cache to builds * remove single use results from docling manager * revert single use results * change the ray tenant id header * added env * changed cache to hit if no changes were made * fix hash for cache * style: ruff autofix (auto) * fixed coderabbit * style: ruff autofix (auto) * added comment on docling manager * style: ruff autofix (auto) --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * feat: add chunk level page source (#2015) * Changed export docling document to append page number * update result on frontend to append page number * document how to get page number in readmes * Update flows/components/export_docling_document.py Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update flows/components/export_docling_document.py Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * fix: apply CodeRabbit auto-fixes Fixed 1 file(s) based on 1 unresolved review comment. Co-authored-by: CodeRabbit <[email protected]> * update component code --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: CodeRabbit <[email protected]> * fix: error in skip duplicates functionality for folder ingest for connectors (backport of #1941) (#2018) * fix: error in skip duplicates functionality for folder ingest for connectors 75616(#1842) (#1941) * fix: enhance duplicate handling and indexing for connector file uploads * style: ruff autofix (auto) * fix: improve duplicate handling in connector sync functionality * chore: trigger CodeRabbit --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> (cherry picked from commit effaf02) * style: ruff autofix (auto) * fix: remove duplicate test definitions from main merge The automated merge-from-main on this branch concatenated two tests (test_connector_processor_indexes_cleaned_filename, test_langflow_connector_processor_uses_cleaned_filename) that already existed under both names, tripping ruff F811. Keep one copy of each, preferring the version wired with connector_id_exists=True to match current check_document_exists behavior. --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * fix: Ingestion of buckets not working right after connection is tested - CPD #75506 (#1942) (#2019) * fix: update bucket ingestion messages for clarity and consistency * fix: guard bucket pre-selection against connection ID mismatch The defaults query returns the first S3/COS connection regardless of active status. Only pre-select saved bucket_names when the defaults connection_id matches the current connector.connectionId to avoid seeding the wrong buckets if a stale connection exists alongside the active one. * fix: prevent defaults from overwriting user bucket selections Two issues in the initial-selection effect: 1. hasAppliedInitial was only set when valid buckets were found, leaving the effect live across bucket refreshes and allowing stale defaults to overwrite selections made after a refetch. 2. No guard against the async race where buckets loads before initialSelectedBuckets: user clicks buckets, defaults arrive later and silently overwrite them. Fix: mark hasAppliedInitial unconditionally on first evaluation, and only apply defaults when selectedBuckets is still empty (user hasn't acted yet). --------- (cherry picked from commit f3823b8) Co-authored-by: Claude Sonnet 4.6 <[email protected]> * fix: handle orphan files and return appropriate responses when syncing connectors (#1785) (#2016) * feat: handle orphan files and return appropriate responses when syncing connectors * feat: refactor GoogleDriveOAuth to separate required scopes and add handling for missing optional group scopes in tests * style: ruff autofix (auto) * feat: add handling for skipped files and warnings in task processing and UI components --------- (cherry picked from commit aca865a) Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * fix: enhance error handling for document processing and add OCR requirement check for image files (#1859) (#2017) * fix: enhance error handling for document processing and add OCR requirement check for image files * style: ruff autofix (auto) * remove clickhouse connect from langflow image (#1801) * chore: fix ci (#1889) * Update processors.py * test fix * fix ci --------- (cherry picked from commit a286581) Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Lucas Oliveira <[email protected]> Co-authored-by: Edwin Jose <[email protected]> * fix: bump golang.org/x/net to v0.55.0 to remediate CVE-2026-25680 and CVE-2026-39821 (#2014) * feat: add new design for messages and add inline references (#2020) * update opensearch multimodal and flows to support parser, chunk size and chunk overlap * update backend to support citations and chunk metadata * update frontend to support citations and metadata, implement new design for assistant message * changed the prompt for the agent * changed the prompt for the agent * remove hallucinated chunk references * adjust design of citations and where popover appears * adjusted design for message, popover and cards * fix React Doctor picks * fix: apply CodeRabbit auto-fixes Fixed 5 file(s) based on 4 unresolved review comments. Co-authored-by: CodeRabbit <[email protected]> * style: apply biome auto-fixes [skip ci] * updated colors in ibm mode * fixed react doctor picks * added correct type and validation for function calls * remove style for message when on onboarding * fix message not being w full * remove search query in end of the message * change popup to use shadcn popover * fix coderabbit's suggestion * increase prompt limit --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: CodeRabbit <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * apply new settings on retry (#2010) * fix: preserve HTTPException status in update_docling_preset (#1586) (#2004) * fix: report actual synced connection count in connector_sync (#1547) (#2006) * fix: restore LLM model values in reapply_all_settings fallback (#1587) (#2008) * fix: prevent partial matches for exact token searches (#2003) * fix: prevent partial matches for exact token searches (#1937) * style: ruff autofix (auto) * chore: remove unused json import --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * fix: target agent component when updating chat flow system prompt (#2001) * fix: target langflow agent component for system prompt update instead of provider LLM component Signed-off-by: vchen7629 <[email protected]> * fix: removed unused llm_provider arg from _update_langflow_system_prompt Signed-off-by: vchen7629 <[email protected]> * test: add unit tests for update_chat_flow_system_prompt Signed-off-by: vchen7629 <[email protected]> * style: ruff autofix (auto) * fix(test): resolve flow path relative to repo root in test_langflow_agent_system_prompt Signed-off-by: vchen7629 <[email protected]> * style: ruff autofix (auto) --------- Signed-off-by: vchen7629 <[email protected]> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * fix: replaced hardcoded docker.io prefix with a env variable prefix for private repo compatibility (#2002) Signed-off-by: vchen7629 <[email protected]> * fix: resolve Pydantic delta serialization warnings in agent streaming (#2005) * fix: updated agent model dump to exclude delta field Signed-off-by: vchen7629 <[email protected]> * test: added regression unit test to verify response field + no warnings * style: ruff autofix (auto) * test: added additional unit test to verify that model_dump without exclusion raises the warning Signed-off-by: vchen7629 <[email protected]> * style: ruff autofix (auto) * test: tighten delta warning assertion to match specific Pydantic error Signed-off-by: vchen7629 <[email protected]> * style: ruff autofix (auto) --------- Signed-off-by: vchen7629 <[email protected]> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * fix: prevent exception details from leaking in API error responses (#2007) * fix: removed str(e) in exceptions to prevent internals from leaking Signed-off-by: vchen7629 <[email protected]> * style: ruff autofix (auto) * fix: added missing status_code Signed-off-by: vchen7629 <[email protected]> * style: ruff autofix (auto) --------- Signed-off-by: vchen7629 <[email protected]> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * Changed docling options to include local support and be shown in the Langflow tab * style: ruff autofix (auto) * enable ollama and delete unused file * fix next lint --------- Signed-off-by: vchen7629 <[email protected]> Co-authored-by: Gautham N Pai <[email protected]> Co-authored-by: Wallgau <[email protected]> Co-authored-by: Olfa Maslah <[email protected]> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: CodeRabbit <[email protected]> Co-authored-by: Rico Furtado <[email protected]> Co-authored-by: Claude Sonnet 4.6 <[email protected]> Co-authored-by: Edwin Jose <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Mike Fortman <[email protected]> Co-authored-by: hunterxtang <[email protected]> Co-authored-by: NishadA05 <[email protected]> Co-authored-by: Zephyrus <[email protected]>
This pull request introduces significant improvements to the chat assistant's user experience by adding detailed popovers for retrieved search result "chunks" (citations) and enhancing metadata handling across both frontend and backend. The main changes include new UI components for chunk details, improved citation handling in assistant messages, and expanded metadata support throughout the data flow.
Enhanced Citation Display and Chunk Details:
ChunkPopupcomponent that displays detailed information about a cited chunk, including source text, parser, chunking configuration, embedding model, score, and a link to the original document. This popover appears when a user clicks on a citation in the assistant message.AssistantMessageto support citation click handling, manage popover state, preprocess citations, and renderCitationCardsand the newChunkPopupfor interactive chunk exploration. [1] [2] [3] [4] [5] [6]Improved Metadata Flow and Types:
opensearch_multimodal.py) and frontend (useGetSearchQuery.ts, related types) to include additional metadata fields for each chunk:parser,chunk_size, andchunk_overlap, ensuring this information is available for display in the UI. [1] [2]chunk_id,id, andscorefields for more precise chunk identification and scoring in the UI.Type and API Consistency:
These changes collectively provide users with a richer, more interactive experience when reviewing AI-generated responses and their supporting sources.
Most Important Changes:
1. User Interface Enhancements
ChunkPopupcomponent for detailed chunk/citation popovers, including metadata and source text, accessible from assistant messages.AssistantMessageto support citation click events, manage popover state, preprocess citations, and renderCitationCardsandChunkPopup. [1] [2] [3] [4] [5] [6]2. Metadata and Backend Support
parser,chunk_size, andchunk_overlapfields for each chunk, and addedchunk_id,id, andscoreto chunk metadata. [1] [2]3. TypeScript Types and API Consistency
Summary by CodeRabbit
Summary of changes