# @tshio/prompt-test

> Tool to automate test for prompts

Latest version **0.2.1** (published 2024-03-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install @tshio/prompt-test
pnpm add @tshio/prompt-test
yarn add @tshio/prompt-test
bun add @tshio/prompt-test
```

Provides the command `prompt-test`.

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.1 |
| Published | 2024-03-14 |
| First published | 2024-03-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 16 |
| Unpacked size | 202.1 KB |
| Known vulnerabilities | 0 (+6 in 3 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Aleksander Patschek |
| Maintainers | vviktor, aherok, sethii, barograf |

## Links

- npm: https://www.npmjs.com/package/@tshio/prompt-test
- Repository: https://github.com/TheSoftwareHouse/prompt-test
- Homepage: https://github.com/TheSoftwareHouse/prompt-test#readme
- Issues: https://github.com/TheSoftwareHouse/prompt-test/issues
- npm.io page: https://npm.io/package/@tshio/prompt-test

## Dependencies (16)

- [axios](https://npm.io/package/axios.md) ^1.6.7
- [commander](https://npm.io/package/commander.md) ^11.1.0
- [langchain](https://npm.io/package/langchain.md) ^0.1.7
- [@nestjs/core](https://npm.io/package/@nestjs/core.md) ^10.3.3
- [@nestjs/axios](https://npm.io/package/@nestjs/axios.md) ^3.0.2
- [@aws-sdk/types](https://npm.io/package/@aws-sdk/types.md) ^3.496.0
- [@nestjs/common](https://npm.io/package/@nestjs/common.md) ^10.3.3
- [nest-commander](https://npm.io/package/nest-commander.md) ^3.12.5
- [@langchain/openai](https://npm.io/package/@langchain/openai.md) ^0.0.13
- [@smithy/util-utf8](https://npm.io/package/@smithy/util-utf8.md) ^2.1.1
- [@langchain/community](https://npm.io/package/@langchain/community.md) ^0.0.20
- [@smithy/signature-v4](https://npm.io/package/@smithy/signature-v4.md) ^2.1.1
- [@aws-crypto/sha256-js](https://npm.io/package/@aws-crypto/sha256-js.md) ^5.2.0
- [@smithy/protocol-http](https://npm.io/package/@smithy/protocol-http.md) ^3.1.1
- [@smithy/eventstream-codec](https://npm.io/package/@smithy/eventstream-codec.md) ^2.1.1
- [@aws-sdk/credential-provider-node](https://npm.io/package/@aws-sdk/credential-provider-node.md) ^3.499.0

## Recent versions

- 0.2.1 (latest) — 2024-03-14
- 0.1.0 — 2024-03-06

## README

## Usage

```
npx @tshio/prompt-test <command>
```

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

### Test
Command:  test <filename>  
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;
```

---
_Source: https://npm.io/package/@tshio/prompt-test · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
