-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
🔍 fix: Display File Search Citations Based on Permissions #9454
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
Conversation
|
thanks for the PR! |
…cluding it in artifact
| * @param {IUser} options.user - The user object | ||
| * @param {AppConfig} options.appConfig - The app configuration object | ||
| * @param {GraphRunnableConfig['configurable']} options.metadata - The metadata | ||
| * @param {any} options.toolArtifact - The tool artifact containing structured data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@danny-avila was this intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did intentionally add the JSDoc typing on the right-hand side of the git diff i.e.
* @param {{ [Tools.file_search]: { sources: Object[]; fileCitations: boolean } }} options.toolArtifact - The tool artifact containing structured dataThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I was confused, thinking there was a mismatch in naming, but I see now that the toolArtifact contains the file_search 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no worries, thanks for inspecting the code!
…a#9454) * Make file search citations conditional * refactor: improve permission handling to avoid redundant checks by including it in artifact * chore: reorder imports for better organization and clarity --------- Co-authored-by: Danny Avila <[email protected]>
…a#9454) * Make file search citations conditional * refactor: improve permission handling to avoid redundant checks by including it in artifact * chore: reorder imports for better organization and clarity --------- Co-authored-by: Danny Avila <[email protected]>
…a#9454) * Make file search citations conditional * refactor: improve permission handling to avoid redundant checks by including it in artifact * chore: reorder imports for better organization and clarity --------- Co-authored-by: Danny Avila <[email protected]>
…a#9454) * Make file search citations conditional * refactor: improve permission handling to avoid redundant checks by including it in artifact * chore: reorder imports for better organization and clarity --------- Co-authored-by: Danny Avila <[email protected]>
…a#9454) * Make file search citations conditional * refactor: improve permission handling to avoid redundant checks by including it in artifact * chore: reorder imports for better organization and clarity --------- Co-authored-by: Danny Avila <[email protected]>
Summary
This PR fixes an issue where file search citation markers were being output in file_search results, and the file_search tool description included instructions on using the citation markers for all users regardless of their permissions or configuration settings. The changes make citation functionality conditional based on both the user's
FILE_CITATIONSpermission and whether file citations are enabled in the configuration.Key Changes:
fileCitationsparameter tocreateFileSearchToolfunction to control citation marker outputcheckAccessto verifyFILE_CITATIONSpermission\ue202turn0file${index}) conditional in search resultsProblem Fixed:
The file search tool was including citation anchor markers (e.g.,
\ue202turn0file0,\ue202turn0file1) in file_search results, regardless of permissions or configuration settings. However, the actual UI components that would render these markers as clickable links to documents are only displayed for users with proper permissions and when fileCitations were enabled. This resulted in raw, non-functional citation markers in responses when file citations were disabled in the configuration.Change Type
Testing
Test Process:
Test Configuration:
Checklist
Please delete any irrelevant options.