Last active
May 23, 2025 07:46
-
-
Save billybonks/987cbc432f8ac4e7a8b1a7b81f6f119f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# yaml-language-server: $schema=https://promptfoo.dev/config-schema.json | |
description: "Custom Provider" | |
prompts: | |
- "say {{item}}" | |
providers: | |
- id: file://./provider.js | |
tests: | |
- vars: | |
item: bananas | |
assert: | |
- type: contains | |
value: "banana" | |
- vars: | |
item: apples | |
assert: | |
- type: contains | |
value: "apple" | |
provider: | |
id: file://./provider2.js |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# yaml-language-server: $schema=https://promptfoo.dev/config-schema.json | |
description: "Custom Provider" | |
prompts: | |
- "say {{item}}" | |
providers: | |
- id: file://./provider.js | |
tests: | |
- vars: | |
item: bananas | |
assert: | |
- type: contains | |
value: "banana" | |
- vars: | |
item: apples | |
assert: | |
- type: contains | |
value: "apple" | |
provider: | |
id: file://./provider.js |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default class BananaProvider { | |
providerId = "banana"; | |
constructor(options) { | |
this.providerId = options.id || "langchain"; | |
} | |
id() { | |
return this.providerId; | |
} | |
callApi = async () => { | |
return { | |
output: "banana", | |
}; | |
}; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default class BananaProvider { | |
providerId = "banana"; | |
constructor(options) { | |
this.providerId = options.id || "langchain"; | |
} | |
id() { | |
return this.providerId; | |
} | |
callApi = async () => { | |
return { | |
output: "banana", | |
}; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment