-
Notifications
You must be signed in to change notification settings - Fork 9
Add support for specifying response file location #30
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
base: main
Are you sure you want to change the base?
Conversation
Currently, the response goes to a temp location and subsequent inference requests overwrite. This change adds a new input that will allow the user to specify where the response file should be located.
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 pull request adds support for specifying a custom response file location so that subsequent inference requests do not overwrite previous responses. Key changes include:
- Updating the token validation to check for empty strings.
- Adding a new input (response-file) and logic to use a custom file path with directory creation if needed.
- Extending tests to cover scenarios for both custom and default response file paths.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
src/main.ts | Added custom response file input and directory creation. |
action.yml | Defined the new input for specifying the response file. |
tests/main.test.ts | Updated tests to verify the new response file behavior. |
Why should someone be interested in setting the path to the response file? 🤔 What is the use case for this? |
I have a workflow where I am doing inference a few times: selecting an area label, a regression label, etc and each time I need a new location. I could (I am now) running the inference, then copying the output, then running again. But, having the copy is messy when I could just run the inference a few times and then collect all the files and post as a single comment. |
Looks reasonable enough to me. I can see why you might want to specify the file location if you're plugging this into other workflows that might expect particular files to be in particular places. |
This pull request introduces a new feature for handling custom response file paths in the AI inference action, along with improvements to error handling and test coverage. The changes include updates to the
README.md
documentation, theaction.yml
file, the main action logic insrc/main.ts
, and the test suite in__tests__/main.test.ts
.New Feature: Custom Response File Paths
README.md
explaining how to use a custom response file path (response-file
) in workflows.response-file
input inaction.yml
to specify the file path where the model's response should be saved.getResponseFilePath
helper function insrc/main.ts
to handle custom response file paths, ensuring directories are created if necessary. Updated the main logic to use this function. [1] [2]Improved Error Handling
src/main.ts
to gracefully manage bothError
and non-Error
exceptions, providing clearer feedback in workflow runs. [1] [2]Test Suite Enhancements
__tests__/main.test.ts
to verify:Error
and non-Error
exceptions.fs.writeFileSync
andfs.mkdirSync
to support testing file system operations. [1] [2]These changes collectively improve the flexibility, reliability, and testability of the action.