Skip to content

ProviderFactoryOptions

PromptScript API


Defined in: eval/src/provider-setup.ts:23

Options of createProviderFactory.

Extends

Properties

allowedHosts?

optional allowedHosts?: readonly string[]

Defined in: eval/src/provider-setup.ts:29

Hosts allowed besides the built-in defaults, from --allow-host


allowLocal?

optional allowLocal?: boolean

Defined in: eval/src/provider-setup.ts:31

Allow loopback hosts and plain http for them, from --allow-local


config?

optional config?: EvalConfig

Defined in: eval/src/provider-setup.ts:25

The eval section of promptscript.yaml


env

env: Readonly<Record<string, string | undefined>>

Defined in: eval/src/provider-setup.ts:27

Environment the key variables are read from, at call time


fetch?

optional fetch?: (input, init?) => Promise<Response>

Defined in: eval/src/http-provider.ts:35

Fetch to use instead of the global one

Parameters

input

string | URL | Request

init?

RequestInit

Returns

Promise<Response>

Inherited from

ProviderDeps.fetch


onUse?

optional onUse?: (use) => void

Defined in: eval/src/provider-setup.ts:37

Called once per provider before it is used, so the CLI can print where the key goes. The config names the variable in apiKeyEnvVar, so it decides which secret of the environment is sent: review that key like code.

Parameters

use

ProviderUse

Returns

void