Peter
05/30/2024, 4:50 PMTestSuiteConfig object in TypeScript which includes a custom HTTP provider for my service, but I'm struggling to find examples of that. The type of `ProviderOptions`:
ts
export interface ProviderOptions {
id?: ProviderId;
label?: ProviderLabel;
config?: any;
prompts?: string[];
transform?: string;
delay?: number;
env?: EnvOverrides;
}
Is not clear what config should look like. What would the equivalent of
yml
providers:
- id: 'https://example.com/generate'
config:
method: 'POST'
headers:
'Content-Type': 'application/json'
body:
myPrompt: '{{prompt}}'
responseParser: 'json.output'
Look like in TS?ian
05/30/2024, 4:54 PMian
05/30/2024, 4:55 PMjs
{
// ...
providers: [{
id: 'https://example.com/generate',
config: {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: {
foo: '{{bar}}',
},
responseParser: (json) => json.output,
}
}],
}Peter
05/30/2024, 6:30 PMPeter
05/30/2024, 6:30 PMian
05/30/2024, 6:36 PMian
05/30/2024, 6:36 PMPeter
05/30/2024, 7:11 PM