disabled ouput parser streaming

This commit is contained in:
Henry
2023-10-31 14:07:29 +00:00
parent 8857530f29
commit f57a08f59b
11 changed files with 32 additions and 28 deletions
+1 -4
View File
@@ -152,15 +152,13 @@ export class CustomChainHandler extends BaseCallbackHandler {
skipK = 0 // Skip streaming for first K numbers of handleLLMStart
returnSourceDocuments = false
cachedResponse = true
isOutputParser = false
constructor(socketIO: Server, socketIOClientId: string, skipK?: number, returnSourceDocuments?: boolean, isOutputParser?: boolean) {
constructor(socketIO: Server, socketIOClientId: string, skipK?: number, returnSourceDocuments?: boolean) {
super()
this.socketIO = socketIO
this.socketIOClientId = socketIOClientId
this.skipK = skipK ?? this.skipK
this.returnSourceDocuments = returnSourceDocuments ?? this.returnSourceDocuments
this.isOutputParser = isOutputParser ?? this.isOutputParser
}
handleLLMStart() {
@@ -173,7 +171,6 @@ export class CustomChainHandler extends BaseCallbackHandler {
if (!this.isLLMStarted) {
this.isLLMStarted = true
this.socketIO.to(this.socketIOClientId).emit('start', token)
if (this.isOutputParser) this.socketIO.to(this.socketIOClientId).emit('token', '```json')
}
this.socketIO.to(this.socketIOClientId).emit('token', token)
}