Commit Graph
69 Commits
Author SHA1 Message Date
Eric Wang fb9271efc5 fix(workflow): bind collection states to actions and relax eval wording 2026-10-21 16:51:19 +08:00
Eric Wang 248eb41c78 fix(workflow): align non-motor accident extraction and evaluations 2026-10-21 15:34:11 +08:00
Eric Wang 3fe99e71fd remove root dir .env 2026-10-16 17:02:02 +08:00
Eric Wang dea2ea5b71 feat(workflow): add new workflow for accident information collection
- Introduced a comprehensive JSON configuration for a new workflow that includes user guidance, input handling, and AI chat integration.
- The workflow features nodes for system configuration, workflow start, and accident information collection, enhancing user interaction and data collection capabilities.
- Implemented various input types and configurations to support dynamic user interactions and improve overall workflow efficiency.
2026-10-16 17:01:47 +08:00
Eric Wang 6b8a548df3 fix(workflow): offer photo button guidance only when needed 2026-10-16 15:58:41 +08:00
Eric Wang 22853f1b5a fix(workflow): skip known accident details and guide off-topic replies 2026-10-16 15:16:16 +08:00
Eric Wang 4787d6eb79 fix(workflow): skip plate confirmation after photos and guide driver verification 2026-10-16 14:21:45 +08:00
Eric Wang ee7bff32dd feat(workflow): add October 16 accident information collection workflow 2026-10-16 11:33:04 +08:00
Eric Wang f179d9ffb0 fix(prompt): 新增状态码语义权威规则与不在现场分支
- 1002 状态下正文严禁出现转人工表述,以状态码为准
- 补全步骤6'不在现场'分支:记录后保持1002继续收集
- 最终输出自检增加状态码-正文一致性检查
2026-10-14 18:05:54 +08:00
Eric Wang e26e724a53 Add new prompt file for traffic accident reporting AI
- Introduced a comprehensive prompt file detailing the role and operational guidelines for a traffic accident reporting AI.
- Established strict output formatting rules to ensure clarity in user interactions, including state management and response protocols.
- Emphasized safety prioritization and robust handling of user inputs, particularly regarding the assessment of potential injuries and the transition to human assistance.
2026-10-12 10:42:28 +08:00
Xin Wang e261e97916 Update form extraction logic in endpoints.py
- Changed the module name for form extraction to "更新表单" for clarity.
- Enhanced the extraction process to accommodate various output formats from nodes, ensuring compatibility with different structures.
- Improved handling of empty or invalid form updates, returning an empty object when necessary to maintain robustness.
2026-08-11 14:58:47 +08:00
Xin Wang bfc91b6f66 Remove outdated document for version 1.0.10 of accident reporting AI, streamlining the repository and eliminating unnecessary files. 2026-07-30 14:20:21 +08:00
Xin Wang f40643dd87 Refine prompts and evaluation cases for accident reporting AI
- Updated prompts to enhance clarity and consistency in user interactions, particularly focusing on safety prioritization and accurate information collection.
- Introduced new YAML evaluation cases to test various user input scenarios, ensuring robust handling of short, ambiguous, or irrelevant responses.
- Enhanced guidelines for transitioning to human assistance, emphasizing strict conditions for triggering state changes based on user responses.
2026-07-30 14:19:57 +08:00
Xin Wang be35e48686 Add user interaction guidelines for online confirmation in accident reporting prompts
- Introduced new section for user inputs that confirm system availability, detailing specific phrases that indicate active engagement.
- Clarified response protocol for such inputs, ensuring the system maintains its current state and provides brief confirmations.
- Enhanced overall user experience by addressing common interaction scenarios in the accident reporting process.
2026-07-29 12:43:03 +08:00
Xin Wang 4e621e2f0c Enhance evaluation runner with transcript handling and new case formats
- Updated the evaluation runner to support live dialogue printing and transcript saving in both Markdown and JSON formats.
- Introduced new data classes for managing transcripts and their components, improving structure and readability.
- Modified existing YAML case files to align with the new direct client mode and updated stage codes.
- Added new test cases for the direct client mode, ensuring comprehensive coverage of user interactions.
2026-07-29 11:13:07 +08:00
Xin Wang e6437ab332 Move workflow evaluations to standalone runner 2026-07-29 10:35:45 +08:00
Xin Wang 3187713bfe Enhance client mode handling in ProcessRequest_chat
- Introduced a normalization function for client mode to default to "direct" when input is empty or None.
- Updated the clientMode field to use a new type with BeforeValidator for improved validation.
- Added a test to ensure empty client mode inputs correctly default to "direct".
2026-07-29 10:02:35 +08:00
Xin Wang 473fffd2f0 Add new prompts for traffic accident reporting AI
- Introduced two new prompt files for traffic accident reporting, detailing the interaction protocol and state management for both single and dual vehicle scenarios.
- Established strict output formatting rules to ensure clarity and consistency in user interactions, including handling of user responses.
- Enhanced guidelines for safety prioritization and accurate information collection during the accident reporting process.
2026-07-28 17:34:22 +08:00
Xin Wang 08e290bcdf Update prompts for vehicle accident reporting
- Revised state codes to enhance clarity in user interactions, replacing previous codes with new ones indicating successful verification and transition to human assistance.
- Adjusted output messages to reflect the updated state management, ensuring a smoother user experience during the information confirmation phase.
- Improved guidelines for handling user responses, emphasizing accurate information collection and efficient transition to human support.
2026-07-28 15:41:21 +08:00
Xin Wang f99c171418 Add new prompts for dual vehicle accident scene guidance
- Introduced a detailed prompt file for dual vehicle accident photo capture and verification, outlining the interaction protocol and state management.
- Established strict output formatting rules to ensure clarity and consistency in user interactions.
- Included comprehensive guidelines for handling various user responses, prioritizing accurate information collection during dual vehicle accident reporting.
2026-07-28 15:19:23 +08:00
Xin Wang 5501913779 Add new prompt for traffic accident reporting AI
- Introduced a detailed prompt file for a traffic accident reporting AI, outlining the interaction protocol and state management.
- Established strict output formatting rules to ensure clarity and consistency in user interactions.
- Included comprehensive guidelines for handling various user responses, prioritizing safety and accurate information collection during accident reporting.
2026-07-28 15:18:53 +08:00
Xin Wang 7ed45089ec Add new prompt for traffic accident reporting AI
- Introduced a comprehensive prompt file for a traffic accident reporting AI, detailing the interaction protocol and state management.
- Established strict output formatting rules to ensure clarity and consistency in user interactions.
- Included guidelines for handling various user responses, emphasizing safety and accurate information collection during accident reporting.
2026-07-28 15:08:18 +08:00
Xin Wang 9301507b08 Add live stage-code golden tests 2026-07-28 13:45:43 +08:00
Xin Wang 776f6e82b3 Add new documentation for version 1.0.10
- Introduced a comprehensive document detailing the interaction interface design for the intelligent information collection robot.
- Updated version history with new features, including the addition of the clientMode parameter and its impact on output formatting.
- Enhanced clarity in the API request and response structures, including examples for better understanding of the interaction flow.
2026-07-28 11:10:50 +08:00
Xin Wang be6af046ca Simplify client mode to single FastGPT app 2026-07-28 10:38:01 +08:00
Xin Wang 3e9385b0ca Add client-mode FastGPT routing 2026-07-28 08:41:34 +08:00
Eric Wang 88ba48ac77 Update docs 2026-07-24 17:33:34 +08:00
Eric Wang ce97a16f5b Add new prompts for accident scene photo guidance
- Introduced new files for single and dual vehicle accident photo guidance, detailing step-by-step instructions and state management protocols.
- Implemented strict output formatting and error handling for user interactions during the photo capture process.
- Enhanced the overall structure to ensure clarity and consistency in guiding users through the accident documentation process.
2026-07-24 08:17:14 +08:00
Eric Wang 6f91f45065 Add new state code for photo recognition failure in chat stream mode
- Updated documentation and API endpoint to include a new state code '0005' for handling cases where photo recognition fails consecutively, directing to human assistance.
- Ensured consistency between documentation and code for improved clarity in state management.
2026-07-23 23:34:13 +08:00
Xin Wang 5706c112e5 Merge branch 'main' of https://gitea.xiaowang.eu.org/wx44wx/ZNJJ-api-server 2026-06-18 17:10:16 +08:00
Xin Wang 569dae4446 Refactor state extraction and content cleaning in chat endpoint
- Introduced a new function to extract the first state code and clean content by removing state tags.
- Updated the chat endpoint to utilize the new extraction function, improving state handling and content processing.
- Enhanced logging to provide clearer insights into extracted state codes and cleaned content.
2026-06-18 17:10:02 +08:00
Xin Wang 3836b443b1 Update structured form update content in documentation for version 1.0.8
- Revised the formUpdate section to clarify the conditions under which structured updates are pushed.
- Added specific examples for accident vehicle count and cause of the incident to enhance understanding.
- Adjusted text_delta examples for improved clarity in response handling.
2026-06-18 11:07:20 +08:00
Xin Wang aa2768acc0 Update API request structure in fastapi.http
- Replaced hardcoded URLs with a base URL variable for better configurability.
- Updated request payloads to use sessionId and timeStamp variables.
- Enhanced the chat request with new parameters: needFormUpdate and useTextChunk.
- Adjusted response content types and lengths for consistency.
- Updated timestamps in response headers for accuracy.
2026-06-18 10:45:33 +08:00
Xin Wang 83353c54d1 Remove outdated document for version 1.0.8 and replace it with an updated version containing comprehensive interface design details and enhancements. The new document includes additional parameters and examples for improved clarity on the chat interface and structured information handling. 2026-06-18 10:27:52 +08:00
Xin Wang c1f469409d Add new document for version 1.0.8
- Introduced a new binary document file for version 1.0.8, containing updated content relevant to the project.
2026-06-18 10:21:49 +08:00
Xin Wang cf0a8b71fd Refactor text chunking implementation and update configuration
- Moved SentenceTextChunker and SentenceTextChunkerConfig to the utils module for better organization.
- Updated pytest.ini to include the current directory in the Python path.
- Added a new utils module with shared utility helpers.
- Adjusted import paths in the test files to reflect the new location of text chunking classes.
2026-06-18 10:15:07 +08:00
Xin Wang a6777a827b Add text chunking functionality to chat endpoint
- Introduced SentenceTextChunker and SentenceTextChunkerConfig for improved text processing in chat responses.
- Updated chat endpoint to conditionally use text chunking based on the new 'useTextChunk' parameter from the request.
- Enhanced logging to include 'useTextChunk' status and adjusted text delta handling to support chunked responses.
- Modified ProcessRequest_chat model to include 'useTextChunk' field for request handling.
- Added unit tests for SentenceTextChunker to ensure correct chunking behavior and edge case handling.
2026-06-17 14:18:24 +08:00
Xin Wang 084e13e03c Enhance logging and performance tracking in chat endpoint
- Added detailed logging for chat request processing, including session ID, input text length, and latency measurements.
- Implemented performance tracking for streaming events, capturing first event and text delta timings.
- Improved error handling logging to include session context and duration on failures.
- Updated non-stream response logging to include latency and output details for better debugging.
2026-06-17 13:46:32 +08:00
Xin Wang 7666759121 Merge branch 'main' of https://gitea.xiaowang.eu.org/wx44wx/ZNJJ-api-server 2026-06-17 13:33:23 +08:00
Xin Wang 6ff23e433b Refactor form update handling in API endpoints and models
- Introduced a new function to parse JSON values in endpoints.py for improved data handling.
- Updated extract_form_update_from_flow_nodes to return structured data instead of strings.
- Changed formUpdate field in ProcessResponse_chat model to use Any type with a default empty dictionary for better flexibility in handling updates.
2026-06-17 13:29:50 +08:00
Xin Wang edf85e21cc Update base URL in API configuration for deployment 2026-06-17 12:36:46 +08:00
Xin Wang ffd3bf0385 Update environment configuration and enhance API endpoints
- Changed ANALYSIS_SERVICE_URL to localhost for local development.
- Updated ANALYSIS_AUTH_TOKEN and APP_ID for improved security.
- Added new functions in endpoints.py for form extraction and stage code normalization.
- Enhanced chat handling to support form updates and improved event streaming.
- Updated models to include new fields for form update handling.
2026-06-17 11:36:42 +08:00
Xin Wang 1ea1d86d5a Update continue greeting 2026-06-03 12:52:38 +08:00
Xin Wang 705a63dd25 Sync with engine v5 2026-06-03 12:36:18 +08:00
Xin Wang 056a8a4ad8 Update example for ssl problem 2026-06-02 17:28:49 +08:00
Xin Wang 30c413b6d4 Refactor voice websocket documentation to clarify input handling and remove deprecated sections. Updated the demo process to indicate that image uploads are no longer required, streamlining user interaction with the voice service. 2026-06-01 11:24:31 +08:00
Xin Wang 0ef5de399a Add voice ws docs 2026-06-01 11:18:41 +08:00
Xin Wang 00c1bbdc6b Sync voice chatId session handling 2026-06-01 10:08:15 +08:00
Xin Wang 6df6c16e1d Implement UserStartedSpeakingFrame handling in voice pipeline
- Added support for UserStartedSpeakingFrame to enhance user interaction tracking.
- Updated the pipeline to reset idle prompt count when a user starts speaking, improving responsiveness during conversations.
- Integrated new event handlers for better management of user turn events and upstream frame processing.
2026-05-29 16:51:51 +08:00
Xin Wang 13f5f44f61 Enhance voice configuration with idle prompt features and new TTS settings
- Added idle prompt timeout, maximum count, and text to multiple voice configuration files to improve user interaction during idle periods.
- Updated greeting mode to 'fastgpt_opener' in relevant configurations for a more dynamic greeting experience.
- Introduced a new voice configuration file for xfyun TTS, including detailed service settings and parameters.
- Refactored the pipeline to handle idle prompts and user turn events, ensuring smoother interaction flow.
- Adjusted the VAD and turn configurations to accommodate new idle prompt features.
2026-05-29 16:27:05 +08:00