-
Notifications
You must be signed in to change notification settings - Fork 854
chore: Replace placeholder with file name in prompt template #2456
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
|
/azp run |
|
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. |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2456 +/- ##
==========================================
- Coverage 84.35% 84.31% -0.04%
==========================================
Files 335 335
Lines 17729 17734 +5
Branches 1621 1602 -19
==========================================
- Hits 14955 14953 -2
- Misses 2774 2781 +7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
/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 modifies the OpenAIPrompt transformer to replace path placeholders in prompt templates with actual filenames instead of generic attachment notices. Previously, path columns referenced in templates like {image_path} were replaced with text like "[Content for column 'image_path' will be provided later as an attachment.]". Now they are replaced with the actual filename (e.g., "photo.jpg") extracted from the path.
Key changes:
- Removed
applyPathPlaceholdersandattachmentPlaceholdermethods that generated generic placeholder text - Added new
processPathColumnsmethod that extracts filenames from path columns and creates temporary filename columns - Updated
transformmethod to use filename references in templates and clean up temporary columns after processing
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| OpenAIPrompt.scala | Refactored path column handling to extract and use actual filenames in prompt templates instead of placeholder text |
| OpenAIPromptSuite.scala | Removed test for deprecated applyPathPlaceholders method and reformatted unrelated test code |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
cognitive/src/main/scala/com/microsoft/azure/synapse/ml/services/openai/OpenAIPrompt.scala
Show resolved
Hide resolved
cognitive/src/main/scala/com/microsoft/azure/synapse/ml/services/openai/OpenAIPrompt.scala
Show resolved
Hide resolved
cognitive/src/main/scala/com/microsoft/azure/synapse/ml/services/openai/OpenAIPrompt.scala
Outdated
Show resolved
Hide resolved
…es/openai/OpenAIPrompt.scala Co-authored-by: Copilot <[email protected]>
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
cognitive/src/main/scala/com/microsoft/azure/synapse/ml/services/openai/OpenAIPrompt.scala
Show resolved
Hide resolved
cognitive/src/main/scala/com/microsoft/azure/synapse/ml/services/openai/OpenAIPrompt.scala
Show resolved
Hide resolved
cognitive/src/main/scala/com/microsoft/azure/synapse/ml/services/openai/OpenAIPrompt.scala
Show resolved
Hide resolved
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Related Issues/PRs
#xxx
What changes are proposed in this pull request?
Replaced the placeholder s"[Content for column '$columnName' will be provided later as an attachment.]" with simply the file names in the message. For example:
Template: "Analyze this image: {image_path}"
Path column image_path with value /some/folder/photo.jpg
Previous result will be: "Analyze this image: [Content for column 'image_path' will be provided later as an attachment.]"
The result now will be: "Analyze this image: photo.jpg"
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.