feat: support modelParameters in prompt.yaml files#148
Merged
sgoedecke merged 3 commits intoactions:mainfrom Nov 24, 2025
Merged
feat: support modelParameters in prompt.yaml files#148sgoedecke merged 3 commits intoactions:mainfrom
sgoedecke merged 3 commits intoactions:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds support for the modelParameters configuration in prompt.yaml files, allowing users to specify maxTokens, temperature, and topP parameters directly in their prompt configuration files. When maxTokens is defined in modelParameters, it takes precedence over the max-tokens action input.
Key changes:
- Added
ModelParametersinterface with optionalmaxTokens,temperature, andtopPproperties - Updated
PromptConfigto include optionalmodelParametersfield - Modified parameter extraction logic to prioritize
modelParametersvalues over action inputs
Reviewed changes
Copilot reviewed 5 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/prompt.ts | Defines the new ModelParameters interface and integrates it into PromptConfig |
| src/main.ts | Implements precedence logic for maxTokens and extracts temperature and topP from modelParameters |
| src/inference.ts | Adds temperature and topP to the InferenceRequest interface and passes temperature to API calls |
| src/helpers.ts | Updates buildInferenceRequest signature to accept and pass through temperature and topP parameters |
| dist/index.js | Compiled output reflecting the source code changes |
| tests/helpers-inference.test.ts | Updates existing tests to include undefined values for the new temperature and topP parameters |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
972c98e to
48f0ede
Compare
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
sgoedecke
approved these changes
Nov 24, 2025
Contributor
|
LGTM, thanks! |
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.
Adds support for the
modelParametersproperty as shown in https://github.com/github/gh-models/blob/main/examples/advanced_template_prompt.yml, and defined here.I made it so that if
maxTokensis defined inmodelParameters, it takes precedence over the inputmax-tokensinput for the action.cc @sgoedecke