-
Notifications
You must be signed in to change notification settings - Fork 854
chore: Remove redundant text message for file input in OpenAIPrompt #2448
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
|
Hey @levscaut 👋! We use semantic commit messages to streamline the release process. Examples of commit messages with semantic prefixes:
To test your commit locally, please follow our guild on building from source. |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
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.
Pull request overview
This PR removes a redundant text message that was previously sent along with file inputs in the OpenAIPrompt class. The removed message contained the filename and an introductory text, which could leak sensitive information and unnecessarily consume tokens. The change simplifies the file attachment logic by directly including the file content without the wrapper message.
- Removed the
multiModalTextPromptconstant and its usage - Modified
wrapFileToMessagesListto return only the file message content - Eliminates potential filename information leakage and reduces token consumption
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2448 +/- ##
==========================================
- Coverage 84.38% 83.07% -1.31%
==========================================
Files 335 335
Lines 17690 17688 -2
Branches 1619 1610 -9
==========================================
- Hits 14928 14695 -233
- Misses 2762 2993 +231 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Related Issues/PRs
#xxx
What changes are proposed in this pull request?
When using file input in
OpenAIPromptbefore, a text message will be sent along:The name of the file to analyze is %s.\nHere is the content:\n, this will cause info leak in file name, as long as extra token used. So it's for the best to remove this piece of message.How is this patch tested?
Does this PR change any dependencies?
Does this PR add a new feature? If so, have you added samples on website?
website/docs/documentationfolder.Make sure you choose the correct class
estimators/transformersand namespace.DocTablepoints to correct API link.yarn run startto make sure the website renders correctly.<!--pytest-codeblocks:cont-->before each python code blocks to enable auto-tests for python samples.WebsiteSamplesTestsjob pass in the pipeline.