Commit Graph
27 Commits
Author SHA1 Message Date
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 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 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 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 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 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 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 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 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
Xin WangandCursor 9e2374f492 Add voice state tags, SuperTTS configs, and demo WS log groups.
Parse leading <state> tags from LLM replies and emit response.state over the product websocket while stripping tags from TTS/text streams. Add FastGPT+Xfyun voice configs (including state-enabled preset), SuperTTS support, and context sync for interrupted turns. Refresh the voice demo with a state indicator and collapsible audio delta websocket log groups.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-28 11:32:20 +08:00
Xin Wang b14ef64665 Add configuration files for FastGPT and Xfyun voice services, enhancing LLM service capabilities. Update LLMConfig to include chat_id, variables, detail, and timeout settings. Refactor create_llm_service to support FastGPT integration and adjust pipeline to handle chat_id and greeting prompts. Implement context synchronization for interrupted assistant turns in text streaming. 2026-05-26 10:56:38 +08:00
Xin Wang e4e47f637e Refactor pipeline to correctly include assistant_aggregator in the run_pipeline_with_serializer function. 2026-05-23 00:19:34 +08:00
Xin WangandCursor a10f0a586b Add VOICE_CONFIG env var to select the voice pipeline config file.
Defaults to config/voice.json; relative paths resolve from project root.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-22 16:29:27 +08:00
Xin WangandCursor bc2aa5b133 Integrate product-ws voice demo on port 8000 alongside REST API.
Add src/voice Pipecat pipeline, browser demo at /voice-demo, and config/voice.json.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-22 16:26:06 +08:00
Xin WangandCursor 0b6b40aba4 Add set_info logging for key/value updates
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-22 14:29:42 +08:00
Xin Wang 30306addee Add stream text output 2026-02-02 17:54:55 +08:00
Xin Wang 32c491cd3f fix delete chat bug and update fastapi http file 2026-01-08 17:32:06 +08:00
Xin Wang d5f81ef79f use fastgpt python sdk 2026-01-08 16:22:25 +08:00
Xin Wang 2a490edff5 Add env and entrypoint 2025-06-20 10:03:39 +08:00
Xin Wang a1a4bceb9a Add api server code and workflow 2025-04-29 15:03:02 +08:00