MCPcopy
hub / github.com/promptfoo/promptfoo / getEnvFloat

Function getEnvFloat

src/envars.ts:528–538  ·  view source on GitHub ↗
(key: EnvVarKey, defaultValue?: number)

Source from the content-addressed store, hash-verified

526export function getEnvFloat(key: EnvVarKey): number | undefined;
527export function getEnvFloat(key: EnvVarKey, defaultValue: number): number;
528export function getEnvFloat(key: EnvVarKey, defaultValue?: number): number | undefined {
529 const str = getEnvString(key);
530 if (str === undefined || str === '') {
531 return defaultValue;
532 }
533 const parsedValue = Number.parseFloat(str);
534 if (!Number.isNaN(parsedValue)) {
535 return parsedValue;
536 }
537 return defaultValue;
538}
539
540/**
541 * Get the timeout in milliseconds for each individual test case/provider API call.

Callers 15

envars.test.tsFile · 0.90
callApiMethod · 0.90
callApiMethod · 0.90
callApiInternalMethod · 0.90
formatPayloadMethod · 0.90
buildInferenceConfigMethod · 0.90
index.tsFile · 0.90
getLlamaModelHandlerFunction · 0.90
getOpenAiBodyMethod · 0.90
callApiMethod · 0.90
getAzureResponsesBodyMethod · 0.90
callApiMethod · 0.90

Calls 1

getEnvStringFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…