Skip to content
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

fix: handle partial prompt response and add unit tests #185

Merged
merged 1 commit into from
Jul 4, 2022

Conversation

sitaram-kalluri
Copy link
Member

@sitaram-kalluri sitaram-kalluri commented Jun 28, 2022

With the current logic in messageHandler, if a partial prompt response is received, then the partial responses gets appended to subsequent responses.

- What I did

  1. Refactor the messageHandler code as follows:
    • Add data to the buffer until we encounter a terminating character (new line character - \n)
    • Decode the data to the String format.
    • Trim the prompt the from the String format
    • Check if response as partial prompt appended from the previous responses. If yes trim it as well

@sitaram-kalluri sitaram-kalluri requested a review from gkc June 29, 2022 09:05
Copy link
Contributor

@gkc gkc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we're good to go, here; we need a solid block of apps testing now and need to be on the lookout for situations we hadn't anticipated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants