Commit Graph

897 Commits

Author SHA1 Message Date
wizardchen 8f1237d64f feat(agent): enhance event emission for final answers and fallback handling
- Updated the AgentEngine to emit final answer events even when the LLM stops without calling the final_answer tool, ensuring the frontend can render responses correctly.
- Added fallback logic in the AgentStreamHandler to emit final answers as fallback events when no answer events are streamed, improving robustness in edge cases.
2026-03-19 18:20:09 +08:00
wizardchen c25741673c feat(chunk): implement batch deletion for chunks to avoid MySQL placeholder limit
- Updated DeleteChunks method to split IDs into batches of 5000 to prevent MySQL Error 1390.
- Added unit tests for CalculateFAQContentHash to ensure consistent hashing behavior across various scenarios, including normalization and case sensitivity.
2026-03-19 18:20:09 +08:00
wizardchen 8db4b6cdea fix(chunk): update timestamp function in UpdateChunks method to use NOW() for consistency 2026-03-19 18:20:09 +08:00
wizardchen 4c3f083642 refactor(agent): streamline document info retrieval and enhance chunk search logic
- Removed the validation for a maximum of 10 knowledge IDs in GetDocumentInfoTool to allow more flexibility.
- Adjusted pagination settings in chunk retrieval to limit results to 1 per request for more granular control.
- Updated the searchChunks method to use case-insensitive matching based on the database type, improving compatibility across different systems.
- Enhanced query structure for better readability and maintainability.
2026-03-19 18:20:09 +08:00
joeyczheng b4f3ad71ad Docs(IM): add docs for slack im channel
Signed-off-by: joeyczheng <joeyczheng@tencent.com>
2026-03-19 14:45:54 +08:00
wizardchen 2a63b58deb feat(im): enhance message handling and formatting for Feishu compatibility
- Updated the message streaming logic to handle <think> blocks more effectively, ensuring proper formatting for Feishu.
- Introduced a new transformThinkBlocks function to convert <think> content into Feishu-compatible markdown blockquotes.
- Improved the handling of tool call events to prevent duplicate processing and ensure correct message formatting.
- Enhanced documentation for permission configuration in the IM channel setup.
2026-03-18 21:56:34 +08:00
wizardchen 3de78dc3e8 refactor(im): improve tool invocation and result formatting
- Updated formatToolCallStart and formatToolCallResult functions to return plain-text lines instead of Markdown snippets for better integration within <think> blocks.
- Introduced briefToolSummary function to extract concise summaries from tool output.
- Enhanced handleMessageStream to manage <think> blocks more effectively during agent interactions.
- Added handling for server-side events in WeCom long connection management to improve reconnection logic.
2026-03-18 21:56:34 +08:00
wizardchen f3a3c72a4f fix(docparser): handle nested linked images and url parens 2026-03-18 21:56:34 +08:00
wizardchen 3450ed5e41 feat(knowledge): offload manual processing to async tasks 2026-03-18 21:56:34 +08:00
joeyczheng 49b5f1a739 feat(IM): support both websocket/webhook mode im channel for slack
Signed-off-by: joeyczheng <joeyczheng@tencent.com>
2026-03-18 21:26:53 +08:00
Suroy 5c6b710bae Update rerank_server_demo.py
1. Added CUDA debugging support
2. Improved memory management during model inference.
3. Fixed logits output

Test Device: Windows WSL Ubuntu 20.04 (python3.10 CUDA 5090 32G)
2026-03-18 18:25:05 +08:00
wizardchen 5506956e87 fix: update session title word count requirement
- Adjusted the session title generation template to require 4-10 words instead of 3-8 words for improved clarity and consistency in title generation.
2026-03-17 22:23:24 +08:00
wizardchen 4e2583e58d feat: add language support to summary generation payload
- Enhanced the SummaryGenerationPayload struct to include a Language field for better localization.
- Updated enqueueSummaryGenerationTask and ProcessSummaryGeneration methods to handle language context in summary generation tasks.
2026-03-17 22:23:24 +08:00
wizardchen 17da967f92 refactor: update session title generation and language context handling
- Modified the session title generation template to focus on extracting only the intent of the user's question.
- Enhanced the session service to include language context when generating titles.
- Updated middleware to inject language into the request context.
- Added a new test suite for validating SSRF safety of URLs.
2026-03-17 22:23:24 +08:00
wizardchen f7750d65c1 fix: update default language setting to Chinese 2026-03-17 22:23:24 +08:00
wizardchen 2ad1faf85f chore: update fallback templates
- Added critical language rules to fallback response templates to ensure consistent language usage in responses.
- Updated logger context to include language and session-related keys for improved context management.
2026-03-17 22:23:24 +08:00
wizardchen 139a9c40ff feat: enhance localization and configuration support
- Added timezone and language settings to the environment configuration.
- Introduced built-in agent configurations with multilingual support for various agents.
- Updated Docker Compose to utilize new environment variables for timezone and language.
- Created new prompt templates for question generation, summary generation, and keywords extraction.
2026-03-17 22:23:24 +08:00
wizardchen 09d9fe5ddb feat(im): add file support and knowledge base integration 2026-03-17 22:23:24 +08:00
ChenRussell d89e5db0f6 git commit -m "fix: clarify MinIO endpoint format error message
Add specific error handling for 'Endpoint url cannot have fully qualified paths'
to guide users to remove http:// or https:// prefix from endpoint URL."
2026-03-16 21:50:07 +08:00
lyingbug 32a364f2cb Merge pull request #764 from lyingbug/main
feat: enhance storage engine configuration and user notifications
2026-03-16 21:46:34 +08:00
wizardchen 1c752ff059 chore: remove chrome-extension from tracking and add to gitignore 2026-03-16 21:34:03 +08:00
wizardchen 56a0840aa4 fix: adjust margins in AgentStreamDisplay component for improved layout
- Reduced the bottom margin of the tree container from 16px to 10px for better spacing.
- Increased the top margin of the answer toolbar from 4px to 10px to enhance visual separation.
2026-03-16 21:30:43 +08:00
wizardchen 37633f89ef feat: enhance IM channel panel with platform hints and localization updates
- Added hints for WeCom and Feishu platforms in the IM channel panel to guide users in obtaining credentials.
- Included a recommendation for using WebSocket for easier setup.
- Updated localization files for English, Korean, Russian, and Chinese to support new hints and console links.
2026-03-16 21:00:37 +08:00
wizardchen d4e14235a6 fix: update storage engine warning display and styling
- Changed the storage engine warning from a div to a paragraph for better semantic structure.
- Updated the warning icon from 'error-circle' to 'info-circle' to better reflect the message.
- Adjusted CSS styles for the storage engine warning, including reduced gap and margin, and modified font size for improved readability.
2026-03-16 20:27:15 +08:00
wizardchen 0b8a71fb6d feat: enhance IM channel panel and localization support
- Added a new integration guide link in the IM channel panel description for better user guidance.
- Updated localization files for English, Korean, Russian, and Chinese to include the new 'docLink' key for the integration guide.
- Improved styling for the add button in the IM channel panel to enhance visual alignment and user experience.
2026-03-16 20:22:38 +08:00
wizardchen f7ec47306c refactor: unify dropdown menu styles across components
- Removed redundant dropdown menu styles from various components and centralized them in a new `dropdown-menu.less` file.
- Updated components to use the unified styles, ensuring consistency in appearance and behavior across the application.

This change simplifies maintenance and enhances the visual coherence of dropdown menus.
2026-03-16 20:13:30 +08:00
wizardchen 452db9f5c3 feat: add unit tests for InjectAndConditions function 2026-03-16 19:21:35 +08:00
wizardchen 795f615b5e fix: consistent aria-label and neutral background for manual download button
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-16 18:33:25 +08:00
wizardchen e609bd2c4c fix: fix manual download button layout and polish
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-16 18:29:59 +08:00
wizardchen 70b73cd257 feat: add download button for manual knowledge in doc-content
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-16 18:25:41 +08:00
wizardchen 2fd6e226a5 fix: sanitize tab chars and avoid double .md extension in manual download filename
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-16 18:18:23 +08:00
wizardchen 66c384823b test: add unit tests for manual knowledge download filename logic
Table-driven tests for sanitizeManualDownloadFilename covering normal titles,
each dangerous character replacement (/  \  "  \n  \r), blank/whitespace-only
titles falling back to "untitled.md", and safe passthrough of = ; characters.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-16 18:01:16 +08:00
wizardchen e0c1b77b70 fix: quote Content-Disposition filename and add empty-title fallback
- Use mime.FormatMediaType for both attachment and inline Content-Disposition
  headers in DownloadKnowledgeFile and the preview handler, preventing header
  injection via a user-controlled knowledge title (e.g. containing ';' or '=')
- Extract inline sanitize logic into sanitizeManualDownloadFilename helper and
  add a blank/whitespace-only title fallback to "untitled" so the download
  never produces a degenerate ".md" filename

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-16 18:01:07 +08:00
wizardchen 63caf564ee feat: support manual knowledge download in GetKnowledgeFile
Add an early-return branch that streams manual knowledge content
(stored as Markdown in Metadata.content) directly as a .md file,
avoiding the runtime error that occurred when FilePath is empty.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-16 17:49:45 +08:00
wizardchen c95db5743c docs: add implementation plan for manual knowledge download
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-16 17:46:34 +08:00
wizardchen 160672ea9c feat: enhance message structure to support multi-content messages
- Introduced MessageContentPart and ImageURL types to allow for multi-content messages that can include both text and images.
- Updated the Message struct to include a MultiContent field for handling multiple message parts.
- Modified the ConvertMessages function to prioritize processing of multi-content messages, improving the handling of user messages with images.

These changes enhance the flexibility and functionality of chat messages, enabling richer content delivery.
2026-03-16 17:33:50 +08:00
wizardchen 309b0f7b3c docs: update manual download spec with reviewer fixes
- Guard nil ManualMetadata return
- Fix link.download .md extension
- Add filename sanitization (newlines, path separators, double quotes)
- Document non-ASCII Content-Disposition as known limitation
- Flesh out frontend template diff
- Document PreviewKnowledgeFile side effect

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-16 16:55:09 +08:00
wizardchen 832577eaac docs: add design spec for manual knowledge download
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-16 16:49:45 +08:00
wizardchen 6a7eb420a9 refactor: update conversation handling and image description requirements
- Removed outdated instructions regarding the `skip_kb_search` field in the conversation configuration.
- Clarified requirements for `image_description` to ensure it is non-empty when images are present.
- Adjusted the handling of message parts in the chat pipeline to improve image processing.
- Deleted unused migration files related to image handling in the database schema.

These changes enhance the clarity and functionality of the conversation and image processing logic.
2026-03-16 15:15:24 +08:00
wizardchen b6cbc412ba Merge remote-tracking branch 'wizard/main' 2026-03-16 11:13:53 +08:00
wizardchen 8b1febbe99 feat: implement IM channel sessions and update message handling 2026-03-16 02:40:42 +08:00
wizardchen 6159e8e3f7 feat: implement IM channel management in agent editor
- Introduced a new IMChannelPanel component for managing WeCom and Feishu channels.
- Added CRUD operations for IM channels, including create, update, delete, and list functionalities.
- Enhanced the backend with new API endpoints for IM channel management.
- Updated documentation to reflect changes in IM integration and channel management.
- Improved localization support for new IM-related UI elements across multiple languages.
2026-03-16 02:28:10 +08:00
wizardchen e5a397faeb feat: add loading indicator for non-Agent mode in botmsg component 2026-03-16 02:26:47 +08:00
wizardchen c27740f739 feat: enhance input field and agent stream display with improved handling and sanitization
- Added blur handling for the textarea in the Input-field component to prevent errors when navigating away from the component.
- Improved the sanitization process in the AgentStreamDisplay component to preserve specific tags during markdown processing, ensuring accurate content display.
- Introduced new methods for handling FAQ-specific post-processing in the knowledge base service, optimizing retrieval and filtering of search results.

These changes enhance user experience by improving input handling and content rendering in the chat interface.
2026-03-16 02:26:47 +08:00
wizardchen 2984b21731 refactor: consolidate QA request handling and improve session service interface
- Introduced a new `QARequest` type to streamline parameters for KnowledgeQA and AgentQA service calls, replacing multiple parameters with a single structured request.
- Updated the `KnowledgeQA` and `AgentQA` methods in the session service interface to accept the new `QARequest` type, enhancing clarity and maintainability.
- Refactored the request parsing logic to utilize the new `buildQARequest` method, improving code organization and reducing redundancy.
- Implemented a new `resolveAgent` method to simplify custom agent resolution logic, enhancing readability and maintainability.

These changes improve the overall structure and usability of the QA request handling, facilitating easier updates and better code organization.
2026-03-16 02:26:47 +08:00
wizardchen eb7299b5ec feat: add pulsing animation to stop button and improve loading indicator styling
- Introduced a pulsing animation for the stop button in the Input-field component, enhancing visual feedback.
- Updated the loading indicator in the AgentStreamDisplay component to clarify its purpose and improve overall styling.

These changes enhance user interaction and visual appeal in the chat interface.
2026-03-16 02:26:47 +08:00
wizardchen 37847b04b2 feat: enhance AgentStreamDisplay with auto-scrolling and improved styling
- Added a streaming steps container to the AgentStreamDisplay component, allowing for better organization of streaming events.
- Implemented auto-scrolling functionality to keep the latest events in view during streaming.
- Enhanced CSS styles for the streaming steps container and event items, including custom scrollbar styles for improved user experience.

These changes improve the usability and visual appeal of the AgentStreamDisplay, facilitating a smoother interaction during event streaming.
2026-03-16 02:26:47 +08:00
wizardchen 6896c7795d feat: add web search option to AgentQA functionality
- Introduced a new parameter `webSearchEnabled` to the `AgentQA` method, allowing for conditional web search capabilities.
- Updated the session service interface and handler to accommodate the new parameter, enhancing the flexibility of the AgentQA process.
- Adjusted the configuration to ensure that web search functionality can be toggled based on the provided input.

These changes improve the AgentQA feature by enabling users to control web search integration, enhancing the overall user experience.
2026-03-16 02:26:47 +08:00
wizardchen 9face5920b feat: enhance knowledge search by resolving embedding model keys
- Introduced a new method to resolve embedding model IDs to their actual identity keys (name + endpoint), enabling optimal grouping of knowledge bases across different tenants.
- Updated the concurrent search functionality to utilize the resolved model keys, improving the efficiency of query embedding computations.
- Refactored search target grouping to reduce redundant API calls and enhance performance during hybrid searches.

These changes significantly improve the knowledge search process by ensuring that embeddings are computed efficiently and reused across multiple knowledge bases sharing the same underlying model.
2026-03-16 02:26:47 +08:00
wizardchen fc92b494b0 feat: optimize hybrid search by grouping targets and reusing query embeddings
- Enhanced the concurrent search functionality to group search targets by their embedding model, allowing for a single computation of query embeddings per model.
- Implemented batch fetching of knowledge base records to improve efficiency and reduce redundant API calls.
- Updated the HybridSearch method to support multiple knowledge base IDs, enabling combined retrieval for full-KB targets and improving overall search performance.
- Added a new GetQueryEmbedding method to compute embeddings for queries, facilitating reuse across multiple knowledge bases sharing the same model.

These changes significantly enhance the performance and efficiency of the knowledge search process, reducing API calls and improving response times.
2026-03-16 02:26:47 +08:00