Open
Conversation
修复预制件搜索功能:添加智能关键词提取和多关键词回退搜索 问题: - LLM 传递完整句子(如"视频处理、格式转换、视频编辑") - LocalPrefabSearcher 使用简单子字符串匹配无法匹配完整句子 - 导致用户查询返回 0 个预制件 解决方案: - 添加 _extract_keywords_from_query() 函数处理中文和英文标点 - 修改 _execute_search_prefabs() 实现多关键词回退搜索机制 - 支持中文逗号(,)、顿号(、)等标点符号 - 添加结果去重逻辑(基于 prefab ID) - 添加调试日志便于故障排查 测试验证: ✅ "视频处理、格式转换、视频编辑" → 成功找到 1 个预制件 ✅ "文件处理,支持pdf和word文档" → 成功找到 1 个预制件 ✅ "视频处理、格式转换" → 成功找到 1 个预制件 ✅ 简单关键词查询(如"视频")仍然正常工作 同时初始化 OpenSpec 工作流: - 添加 openspec/project.md 项目上下文文档 - 创建 fix-prefab-search 变更提案 - 包含完整的 spec deltas、tasks.md 和 design.md Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
归档预制件搜索修复变更到 OpenSpec archive - 移动 changes/fix-prefab-search/ → changes/archive/2026-01-17-fix-prefab-search/ - 保留完整的 proposal.md、tasks.md、design.md 和 spec deltas - 使用 --skip-specs 跳过 specs/ 更新(bug 修复不需要) - 任务完成度:13/15 (87%) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…search This commit resolves critical issues with prefab vector search and adds support for Chinese text queries. ## Vector Search Fixes - Change request parameter from "query" to "question" to match API - Add "businesstype" parameter for proper index isolation - Adapt response parsing for vector service format - Implement 4-layer JSON extraction strategy for chunked responses - Fix bug where only first prefab was extracted from chunks - Add field mapping for "name" → "summary" ## Local Search Enhancements - Add Chinese substring extraction (2-4 characters) for continuous text - Implement smart keyword splitting for long queries without spaces - Improve matching for technical terms and compound keywords - Support multi-word queries like "反作弊 归因分析" ## Index Building Script - Refactor to use /add endpoint instead of deprecated APIs - Fix chunk_size parameter (5000 → 2000) to meet service limits - Add proper delimiter >>>PREFAB<<< for prefab separation ## New Prefab - Add anti-cheat attribution analyzer prefab - Supports multi-dimensional query engine, correlation analysis, AI diagnosis, and customizable data export ## Testing - Verified with short queries: "反作弊归因分析" ✅ - Verified with long queries (322 chars) ✅ - Verified with English keywords: "fraud detection" ✅ - All query patterns now work correctly Fixes issues where prefab search returned 0 results due to API contract mismatches and inadequate Chinese text handling. Related: #prefab-search-refactor
实现完整的后台管理功能,支持会话管理、实时对话和系统监控。 核心功能: - MySQL 数据库集成(SQLAlchemy ORM) - 会话管理(创建、查看、更新、删除) - 实时聊天界面(SSE 流式响应) - 系统仪表盘和日志查看 - 配置管理和监控 技术实现: - 数据库层:DBSession 和 Message 模型,支持连接池和自动重连 - API 层:RESTful API 设计,支持会话 CRUD 操作 - 前端界面:Bootstrap 5 + 原生 JavaScript,响应式设计 - SSE 流处理:Buffer 累积机制,支持跨行 JSON 解析 - 事件处理:修复 event_type 字段匹配,支持所有事件类型 文件变更: - 新增 gtplanner/admin/ 模块(database.py, routes.py, __init__.py) - 新增 6 个模板文件(base, dashboard, sessions, chat, logs, settings) - 新增静态资源(CSS 样式和 JS 交互逻辑) - 修改 fastapi_main.py(集成 admin 路由和静态文件服务)
|
|
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within 7 days. If this PR is still relevant, please update it and request review. Thank you for your contributions! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Choose the Right Template
For better organization and review process, please use the appropriate specialized template:
Description
Summary of changes:
Provide a clear and concise description of what this PR does.
Related issue(s):
Fixes #(issue number) or Closes #(issue number)
Motivation and context:
Why is this change required? What problem does it solve?
Type of Change
Please mark the relevant option(s):
Changes Made
Files modified:
file1.py- Description of changesfile2.py- Description of changesKey changes:
Testing Performed
Manual testing completed:
Test commands used:
Test scenarios covered:
Sample input/output:
Environment Tested
Breaking Changes
Are there any breaking changes?
If yes, describe the breaking changes:
Documentation
Dependencies
New dependencies added:
If new dependencies were added:
dependency-name==version- Reason for addingPerformance Impact
Performance notes:
Describe any performance considerations or measurements.
Security Considerations
Security notes:
Describe any security-related changes or considerations.
Reviewer Checklist
For reviewers to complete:
Code Quality:
Functionality:
Testing:
Documentation:
Additional Notes
Anything else reviewers should know:
Add any additional context, concerns, or notes for reviewers.
Follow-up tasks:
List any tasks that should be done after this PR is merged.
Checklist for submitter: