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 issue #4303: Check output type if it is a string before performing .toLowerCase() #4324

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hanna-daoud
Copy link

Pull Request Template

⚠️ Before Submitting a PR, Please Review:

  • Please ensure that you have thoroughly read and understood the Contributing Docs before submitting your Pull Request.

⚠️ Documentation Updates Notice:

  • Kindly note that documentation updates are managed in this repository: librechat.ai

Summary

Fixes issue #4303: This PR adds a type check for output before calling .toLowerCase() to ensure it is a string. This prevents potential runtime errors when output is undefined or not a string.

Change Type

Please delete any irrelevant options.

  • Bug fix (non-breaking change which fixes an issue)

Testing

Create an assistant action, and let the assistant call it. It used to throw errors and break the UI, now it works perfectly.

Test Configuration:

Checklist

Please delete any irrelevant options.

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • My changes do not introduce new warnings

@danny-avila
Copy link
Owner

danny-avila commented Oct 4, 2024

Are you sure that your custom endpoint is even being used? looking at the code, it should actually fail, and maybe another configured endpoint is being used

Or is this fix exclusively for use with Assistants, not Agents?

@hanna-daoud
Copy link
Author

hanna-daoud commented Oct 4, 2024

This fix is only tested on Assistants and not agents. Also, I created a fresh assistant and added only 1 endpoint for the sake of test. My endpoint is a local one so I added logging to make sure it is being accessed and yes, it is being accessed and the function is running to the end.

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