feat: support modelParameters in prompt.yaml files

This commit is contained in:
David Sanders
2025-11-04 10:47:18 -08:00
parent 36ea1371dc
commit 48f0edec4d
7 changed files with 45 additions and 5 deletions

View File

@@ -53,7 +53,11 @@ export async function run(): Promise<void> {
// Get common parameters
const modelName = promptConfig?.model || core.getInput('model')
const maxTokens = parseInt(core.getInput('max-tokens'), 10)
let maxTokens = promptConfig?.modelParameters?.maxTokens || core.getInput('max-tokens')
if (typeof maxTokens === 'string') {
maxTokens = parseInt(maxTokens, 10)
}
const token = process.env['GITHUB_TOKEN'] || core.getInput('token')
if (token === undefined) {
@@ -71,6 +75,8 @@ export async function run(): Promise<void> {
systemPrompt,
prompt,
modelName,
promptConfig?.modelParameters?.temperature,
promptConfig?.modelParameters?.topP,
maxTokens,
endpoint,
token,