An open API service indexing awesome lists of open source software.

https://github.com/thesoftwarehouse/prompt-test


https://github.com/thesoftwarehouse/prompt-test

Last synced: 11 months ago
JSON representation

Awesome Lists containing this project

README

          

## Usage

```
npx @tshio/prompt-test
```

## Available commands:
### Create
Command: create
Description: Create config file for tests
Options:
- --model, -m - to select model. Available options: ['openai', 'bedrock', 'api']

### Test
Command: test
Description: Run test declared in filename

## Example file structure

```javascript
const config = {
model: {
type: 'openai',
config: {
model: "gpt-3.5-turbo-1106",
temperature: 0,
openAIApiKey: ''
},
},
prompt: `If user ask for a joke answer no`,
testGroups: [
{
name: 'Message in context',
testCases: [
{input: `Tell me a story`, result: 'yes'},
],
},
{
name: 'Message out of context',
testCases: [
{input: 'Tell me joke', result: 'no'},
],
},
],

preparePrompt: (prompt, input) => prompt,
parseResult: (result) => result.toLowerCase().trim(),
}

module.exports = config;
```