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

Feature/add timeout to client requests #141

Conversation

mdr223
Copy link
Collaborator

@mdr223 mdr223 commented Nov 7, 2023

This feature adds timeout functionality to the client and server-sides of our chat application. On the client side we timeout the request after a specified duration (default 120s). Once the timeout occurs, the client will display the "Oops!" error message.

We also need to handle request timeouts at the server. Simply timing out a request from the client does not stop the server from trying to process the request (and calling OpenAI), only to produce a result that will be in vain. Thus, right before we call the Chain, we check to see if the timeout has already occurred. If so, we return an error instead of executing the request.

I also made some minor changes to the front-end:

  • Updated the CSS to add the same padding for "Oops!" messages as we have in regular messages (previously, the "Oops!" messages had no space between the A2rchi profile pic and the start of the text, which looked bad)
  • I added a try-catch block around our fetch calls for likeResponse and dislikeResponse, as these methods will currently fail if/when a user likes/dislikes an "Oops!" message.

@mdr223 mdr223 linked an issue Nov 7, 2023 that may be closed by this pull request
Copy link
Collaborator

@julius-heitkoetter julius-heitkoetter left a comment

Choose a reason for hiding this comment

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

LGTM

@mdr223 mdr223 changed the base branch from main to feature/staging-timeout-timing-grafana November 13, 2023 19:04
@mdr223 mdr223 merged commit 97517b6 into feature/staging-timeout-timing-grafana Nov 14, 2023
@mdr223 mdr223 deleted the feature/add-timeout-to-client-requests branch November 14, 2023 20:12
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.

Post-Mortem: Changes to Prepare for Next Week
2 participants