refactor temperature/top-p parsing for clarity

This commit is contained in:
Paulo Santos
2026-02-04 12:20:53 +00:00
committed by GitHub
parent 71c69d42b5
commit 1171309110
3 changed files with 5 additions and 5 deletions
Generated Vendored
+2 -2
View File
@@ -61551,8 +61551,8 @@ async function run() {
// Get temperature and topP (prompt YAML modelParameters takes precedence over action inputs)
const temperatureInput = coreExports.getInput('temperature');
const topPInput = coreExports.getInput('top-p');
const temperature = promptConfig?.modelParameters?.temperature ?? (temperatureInput !== '' ? parseFloat(temperatureInput) : undefined);
const topP = promptConfig?.modelParameters?.topP ?? (topPInput !== '' ? parseFloat(topPInput) : undefined);
const temperature = promptConfig?.modelParameters?.temperature ?? (temperatureInput ? parseFloat(temperatureInput) : undefined);
const topP = promptConfig?.modelParameters?.topP ?? (topPInput ? parseFloat(topPInput) : undefined);
// Parse custom headers
const customHeadersInput = coreExports.getInput('custom-headers');
const customHeaders = parseCustomHeaders(customHeadersInput);
Generated Vendored
+1 -1
View File
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -69,8 +69,8 @@ export async function run(): Promise<void> {
const temperatureInput = core.getInput('temperature')
const topPInput = core.getInput('top-p')
const temperature =
promptConfig?.modelParameters?.temperature ?? (temperatureInput !== '' ? parseFloat(temperatureInput) : undefined)
const topP = promptConfig?.modelParameters?.topP ?? (topPInput !== '' ? parseFloat(topPInput) : undefined)
promptConfig?.modelParameters?.temperature ?? (temperatureInput ? parseFloat(temperatureInput) : undefined)
const topP = promptConfig?.modelParameters?.topP ?? (topPInput ? parseFloat(topPInput) : undefined)
// Parse custom headers
const customHeadersInput = core.getInput('custom-headers')