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.
This commit is contained in:
@@ -6,6 +6,7 @@ class ProcessRequest_chat(BaseModel):
|
||||
timeStamp: str = Field(..., max_length=32)
|
||||
text: str = Field(...)
|
||||
needFormUpdate: bool = False
|
||||
useTextChunk: bool = False
|
||||
|
||||
class ProcessResponse_chat(BaseModel):
|
||||
sessionId: str = Field(..., max_length=64)
|
||||
|
||||
Reference in New Issue
Block a user