0.2.1 • Published 2 months ago

@tshio/prompt-test v0.2.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

Available commands:

Create

Command: create
Description: Create config file for tests
Options:

Test

Command: test
Description: Run test declared in filename

Example file structure

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;