Commit graph

5205 commits

Author SHA1 Message Date
yangdx
0d694962ff Merge branch 'feat/retry-failed-documents-upstream' 2025-10-05 09:24:40 +08:00
yangdx
7b1f8e0f6f Update scan tooltip to clarify it also reprocesses failed documents 2025-10-05 09:23:56 +08:00
yangdx
bf6ca9dd97 Add retry failed button translations and standardize button text
- Add missing AR/FR/TW translations
- Shorten EN/ZH button text to "Retry"
2025-10-05 09:20:33 +08:00
Jon
cf2a024e37 feat: Add endpoint and UI to retry failed documents
Add a new `/documents/reprocess_failed` API endpoint and corresponding
UI button to retry processing of failed and pending documents. This
addresses a common recovery scenario when document processing fails due
to server crashes, network errors, or LLM service outages.

Backend changes:
- Add ReprocessResponse model with status, message, and track_id fields
- Add POST /documents/reprocess_failed endpoint that triggers background
  reprocessing of FAILED, PENDING, and interrupted PROCESSING documents
- Reuses existing apipeline_process_enqueue_documents for consistency
- Includes comprehensive docstring and logging for observability

Frontend changes:
- Add TypeScript types and API function for the new endpoint
- Add retry handler with intelligent polling (fast refresh → normal)
- Add "Retry Failed" button in Documents page toolbar
- Button disabled when pipeline is busy to prevent duplicate operations
- Complete i18n support (English and Chinese translations)

This feature provides a convenient way to recover from processing
failures without requiring a full filesystem rescan.
2025-10-04 16:46:29 -04:00
yangdx
b9c37bd937 Fix linting 2025-10-03 02:10:02 +08:00
yangdx
112349ed5b Modernize type hints and remove Python 3.8 compatibility code
• Use collections.abc.AsyncIterator only
• Remove sys.version_info checks
• Use union syntax for None types
• Simplify string emptiness checks
2025-10-02 23:15:42 +08:00
yangdx
cec784f60e Update webui assets 2025-10-02 22:02:42 +08:00
yangdx
181525ffc2 Merge branch 'main' into zl7261/main 2025-10-02 22:01:16 +08:00
yangdx
19a4158419 Fix linting 2025-10-02 22:01:00 +08:00
yangdx
a250d881f2 Update webui assets 2025-10-02 21:24:39 +08:00
yangdx
f6b71536da Merge branch 'main' into fix/dark-mode-graph-text-colors 2025-10-02 21:21:54 +08:00
yangdx
b1a4e7d7f0 Fix linting 2025-10-02 21:21:33 +08:00
yangdx
d4abe70411 Hide dev options in production builds 2025-10-02 21:21:16 +08:00
yangdx
1f07d4b160 Remove .env_example from .gitignore 2025-10-02 21:20:24 +08:00
yangdx
d2196a4e70 Merge remote-tracking branch 'origin/main' 2025-10-02 13:28:11 +08:00
Roman Marchuk
1bd84f0005
Merge branch 'main' into fix/dark-mode-graph-text-colors 2025-10-01 17:41:28 -04:00
Roman Marchuk
7297ca1d5c Fix dark mode graph labels for system theme and improve colors
- Fix dark mode detection to work when theme is set to 'system'
- Add real-time system theme change detection
- Update label colors from cyan to white for better readability
- Update edge colors to medium gray (#888888) for better contrast
- Add development feature: random graph generator button in settings
- Enhance random graph with edge attributes and labels
- Install missing graphology layout dependencies
2025-10-01 17:36:50 -04:00
yangdx
6bf6f43d96 Remove bold formatting from instruction headers in prompts 2025-10-02 00:58:03 +08:00
yangdx
bb6138e748 fix(prompt): Clarify reference section restrictions in prompt templates 2025-10-01 22:35:26 +08:00
yangdx
37e8898cf6 Simplify reference formatting in LLM context generation
- Remove extra newlines in reference lists
- Change code block type from text to generic
2025-10-01 22:20:58 +08:00
yangdx
f83cde14df fix(prompt): Improve markdown formatting requirements and reference style 2025-10-01 21:41:12 +08:00
yangdx
83d99e1424 fix(OllamaAPI): Add validation to ensure last message is from user role
• Validate last message role is "user"
• Raise 400 error for invalid role
• Improve API request validation
• Prevent invalid message sequences
2025-10-01 20:48:37 +08:00
yangdx
19073319c1 Add @tanstack/react-table dependency for table functionality
• Add react-table v8.21.3
• Include table-core dependency
• Update package.json
• Update bun.lock file
2025-10-01 00:32:19 +08:00
zl7261
ffcd75a408
decalre targetNode after check sourceNode 2025-09-29 15:24:35 +08:00
zl7261
6a8de2edb2
web_ui: check node source and target 2025-09-29 15:22:24 +08:00
yangdx
86195c613e Fix linting 2025-09-29 13:10:25 +08:00
yangdx
df43afc89b Relax conversation history role validation requirements
• Remove strict role value checking
• Allow any non-empty string roles
2025-09-29 13:10:15 +08:00
yangdx
ba216787c1 Update webui assets 2025-09-28 22:51:06 +08:00
yangdx
924d459420 feat(webui): Enhance KaTeX rendering and add robust error handling
- Differentiates between inline ($...$) and display ($$..$$) math for proper styling and layout.
- Adds custom CSS to ensure formulas correctly inherit text color, fixing issues in dark/light themes.
- Implements responsive handling for long formulas by allowing horizontal scrolling, preventing page overflow.
- Introduces a silent `errorCallback` for KaTeX to suppress console errors from invalid LaTeX syntax in production, while retaining warnings in development.
- Refactors KaTeX plugin loading to be more robust and simplifies CSS import by moving it to `main.tsx`.
2025-09-28 22:50:33 +08:00
yangdx
6e3e67fc24 Update webui assets 2025-09-28 21:34:09 +08:00
yangdx
b18c7d85ef Improve text contrast and visibility in dark theme for chat messages
• Enhanced border visibility in dark mode
• Improved thinking progress text contrast
• Added explicit text color classes
• Better user/assistant message distinction
• Fixed dark theme readability issues
2025-09-28 21:33:19 +08:00
yangdx
4a4a57034f Merge branch 'latex-loading' 2025-09-28 21:06:08 +08:00
yangdx
81bc1ba025 Update webui assets and bump API version to 0235 2025-09-28 21:05:40 +08:00
Daniel.y
37bc012273
Merge pull request #2155 from danielaskdd/latex-loading
Feat(webui): Prevent LaTeX Parsing Errors During Streaming
2025-09-28 21:04:01 +08:00
yangdx
b6a1832324 feat: prevent LaTeX parsing errors during streaming by implementing completeness detection
- Add latexRendered flag to control KaTeX plugin application
- Implement detectLatexCompleteness function to check formula closure
- Maintain backward compatibility for historical messages
2025-09-28 20:59:56 +08:00
yangdx
42d1d04147 Fix boolean parser problem for for LLM environment variable
• Add custom boolean parser for argparse in BindingOptions
2025-09-28 19:23:57 +08:00
yangdx
6d1393716f Merge branch 'mhchem' 2025-09-28 15:25:44 +08:00
yangdx
4957f4f017 Bump core version to 1.4.9.1 2025-09-28 15:25:02 +08:00
Daniel.y
57bbce6d1e
Merge pull request #2154 from danielaskdd/mhchem
Feature(webui): Add KaTeX chemical formula rendering by supporting mhchem extension
2025-09-28 15:23:08 +08:00
yangdx
978f154680 Update webui assets and bump API version to 0234 2025-09-28 15:14:05 +08:00
yangdx
335114fd7e Add KaTeX mhchem extension support and improve math rendering
- Import mhchem globally
- Add TypeScript declarations
- Fix KaTeX overflow styling
- Change p tags to div in markdown
- Update tsconfig includes
2025-09-28 15:13:04 +08:00
yangdx
16e574a083 Fix query mode prefix regex to handle multiline queries in WebUI
- Allow newlines in query text
- Change `.+` to `[\s\S]+` in regex
- Support multiline input parsing
- Fix prefix matching edge case
2025-09-28 14:56:05 +08:00
yangdx
0fd0186414 Improve prompt clarity by standardizing terminology and formatting
• Replace "Source Data" with "Context"
• Add bold formatting for key sections
• Clarify reference_id usage
• Improve JSON/text block formatting
• Standardize data source naming
2025-09-28 13:31:55 +08:00
yangdx
7cba458f22 Limit deprecated documents endpoint to 1000 records with fair distribution 2025-09-28 11:18:10 +08:00
yangdx
fcbab77613 docs: add API key usage example and security guidance 2025-09-28 10:56:52 +08:00
yangdx
2ce6a022ac Fix documentation for user_prompt parameter in QueryParam 2025-09-27 23:41:17 +08:00
yangdx
91be53ffd2 Fix linting 2025-09-27 22:36:38 +08:00
yangdx
e0ac05db90 Simplify query route documentation and clarify conversation history 2025-09-27 22:36:16 +08:00
yangdx
f66a0aad8b Update query streaming endpoint docs to clarify behavior 2025-09-27 22:27:49 +08:00
yangdx
46187b2507 Fix conditional logic in streaming response parser of unit test
• Change elif to if for response field
• Change elif to if for error field
• Allow multiple data types per chunk
• Fix mutually exclusive conditions
• Enable concurrent field processing
2025-09-27 21:43:46 +08:00