-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Issue]: FSM response not in real time #12
Comments
@wi0lono Can you please share more details regarding the issue? Do you mean output returned to channel? |
Yes. self.send_message("message1")
# long running process
self.send_message("message2") Ideally |
At the moment this should be handled in FSM design. If you break this into 2 different states:
|
We should create a separate item for streaming version of JB-Manager that can work with custom channels that support streaming interface. My sense is that this is going to be a significant change in architecture (creating a v3) and therefore we should do this as a prototype outside of this repo first. |
The suggested approach won't work as currently output from FSM reaches flow main process only when
Dividing into separate state won't solve the issue of getting FSM output in real time as the output buffers before going to flow. One way to solve this issue would be to use FIFO pipe to communicate between FSM runner process and flow main process. |
I understand it better now. Thanks Let's look at this in a bit |
@sameersegal and @shreypandey, could you please provide an update on this? |
Need more information to be converted to C4GT issue template. |
The below issue can also be fixed with this fix: Describe the bug: In any state, send more than one message to the bot. Bot should ideally terminate earlier request and resend request with new context/messages and process once. |
This is a big/complex Architectural change. Design needs to be done. So will need further detailed discussions on the way forward. |
Varun suggested another option with thinking of Time as a Delimiter - take all requests from the User until the user stops and then process everything together as a single message. @KaranrajM and @DevvStrange to brainstorm and get back with their thoughts by this Friday (18th Oct) |
@DevvStrange , You were brainstorming on this topic, isnt it? Any update? |
@Lekhanrao Yes we did analyse on the solution that was shared by Varun, the takeaway was like setting the time as a delimiter would not be a good user experience, as every request waits for certain time say 10 seconds after which it starts the processing. Also this time of 10 seconds might not be ideal for sending a followup message from user's perspective as well. So we should brainstorm further for a better solution. |
Hi @DevvStrange, process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
# Stream the output
try:
for line in iter(process.stdout.readline, ''):
print(line, end='') # Output in real-time
finally:
process.stdout.close()
process.stderr.close()
process.wait() |
@DevvStrange, wanted to check if you have been look into Shrey's comments above? And based on that what would be our next steps? |
We will have an internal catchup and if required will connect with Shrey and take this further. |
@DevvStrange do we have a plan now? |
Describe the issue
The FSM doesn't stream output (return it in real time). Output is returned only when the fsm waits for input or after it has exited.
Steps to reproduce
No response
Screenshots and logs
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: