Conversation
- No real checks yet
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Owner
Author
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces robust capability gating for AI models, ensuring that features like image (vision) and tool support are only available if the selected model supports them. The changes affect both backend request handling and frontend UI, enhancing user experience and preventing unsupported actions. Additionally, tests are added to verify model capability logic.
Capability Gating and Enforcement
app/api/chat/route.ts) now filters out image attachments and disables tool usage for models that do not support the "vision" or "tool-calling" capabilities, logging warnings when users attempt to use unsupported features. [1] [2]components/chat/chat-input.tsxandcomponents/chat/attachments-menu.tsx) disables or visually marks unsupported attachments and tool selections, and prevents uploading images if the model lacks vision support. [1] [2] [3] [4] [5] [6] [7] [8]UI/UX Improvements
components/shared/model-selector.tsx) is improved to group models by provider and includes additional UI components for clarity. [1] [2]hasCapabilityhelper for accuracy and maintainability. [1] [2] [3]Testing
__tests__/lib/chat/capability-gating.test.ts,__tests__/lib/chat/has-capability.test.ts). [1] [2]These changes collectively ensure that users are guided toward features their selected model supports, reducing errors and improving the overall user experience.