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: Avatar Handling for Agents and Assistants #4507

Merged
merged 1 commit into from
Oct 22, 2024

Conversation

danny-avila
Copy link
Owner

Summary

  • Refactored the agent controller to fetch avatar data from the agent object using the agent ID, removing the need to parse avatar metadata from the request body.
  • Updated the assistant controller to retrieve metadata from the assistant object using the assistant ID, eliminating the parsing of metadata from the request body.
  • Enhanced error logging in both controllers to provide more accurate information when fetching agents or assistants.
  • Modified the deleteFileByFilter function in both controllers to include the user ID when deleting old avatar files, improving security and file management.
  • Updated the Local file crud service to implement stricter file path validation, preventing potential security vulnerabilities.
  • Removed unnecessary metadata parsing from the frontend components (AgentAvatar and AssistantAvatar), simplifying the avatar upload process.
  • Improved type safety in the AssistantAvatar component when working with query data.

The changes include:
- In the agent controller:
  - Removed the parsing of the avatar metadata from the request body.
  - Fetched the avatar data from the agent object using the agent ID.
  - Updated the error logging when fetching the agent.
  - Updated the deleteFileByFilter function to include the user ID when deleting the old avatar file.

- In the assistant controller:
  - Removed the parsing of the metadata from the request body.
  - Fetched the metadata from the assistant object using the assistant ID.
  - Updated the error logging when fetching the assistant.
  - Updated the deleteFileByFilter function to include the user ID when deleting the old avatar file.
@danny-avila danny-avila merged commit ebe3e7f into main Oct 22, 2024
4 checks passed
@danny-avila danny-avila deleted the fix/agents-asst-avatars branch October 22, 2024 18:53
owengo pushed a commit to openwengo/LibreChat that referenced this pull request Oct 25, 2024
The changes include:
- In the agent controller:
  - Removed the parsing of the avatar metadata from the request body.
  - Fetched the avatar data from the agent object using the agent ID.
  - Updated the error logging when fetching the agent.
  - Updated the deleteFileByFilter function to include the user ID when deleting the old avatar file.

- In the assistant controller:
  - Removed the parsing of the metadata from the request body.
  - Fetched the metadata from the assistant object using the assistant ID.
  - Updated the error logging when fetching the assistant.
  - Updated the deleteFileByFilter function to include the user ID when deleting the old avatar file.
danny-avila added a commit that referenced this pull request Oct 27, 2024
The changes include:
- In the agent controller:
  - Removed the parsing of the avatar metadata from the request body.
  - Fetched the avatar data from the agent object using the agent ID.
  - Updated the error logging when fetching the agent.
  - Updated the deleteFileByFilter function to include the user ID when deleting the old avatar file.

- In the assistant controller:
  - Removed the parsing of the metadata from the request body.
  - Fetched the metadata from the assistant object using the assistant ID.
  - Updated the error logging when fetching the assistant.
  - Updated the deleteFileByFilter function to include the user ID when deleting the old avatar file.
BertKiv pushed a commit to BertKiv/LibreChat that referenced this pull request Dec 10, 2024
The changes include:
- In the agent controller:
  - Removed the parsing of the avatar metadata from the request body.
  - Fetched the avatar data from the agent object using the agent ID.
  - Updated the error logging when fetching the agent.
  - Updated the deleteFileByFilter function to include the user ID when deleting the old avatar file.

- In the assistant controller:
  - Removed the parsing of the metadata from the request body.
  - Fetched the metadata from the assistant object using the assistant ID.
  - Updated the error logging when fetching the assistant.
  - Updated the deleteFileByFilter function to include the user ID when deleting the old avatar file.
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.

1 participant