Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,54 @@ The LLMWhisperer provides the following methods:
- `whisper(options)`: Performs a whisper operation.
- `whisperStatus(whisperHash)`: Retrieves the status of a whisper operation.
- `whisperRetrieve(whisperHash)`: Retrieves the result of a whisper operation.
- `whisperDetail(whisperHash)`: Retrieves metadata/details about a completed extraction job.
- `highlightData(whisperHash, searchText)`: Highlights the specified text in the result of a whisper operation.
Comment thread
johnyrahul marked this conversation as resolved.

## Running Tests

### Environment Setup

Copy the sample environment file and fill in your API key:

```bash
cp sample.env .env
```

Then edit `.env` and set the required values:

```
LLMWHISPERER_API_KEY=<your API key>
LLMWHISPERER_BASE_URL_V2=https://llmwhisperer-api.us-central.unstract.com/api/v2
LLMWHISPERER_LOGGING_LEVEL=DEBUG
```

`LLMWHISPERER_API_KEY` is required for integration tests. The other variables are optional and have sensible defaults.

### Run All Tests

```bash
npm install
npm test
```

### Run a Specific Test File

```bash
npx jest --runInBand test/retry.test.js
npx jest --runInBand test/test.js
```

### Run a Specific Test by Name

```bash
npx jest --runInBand -t "test name pattern"
```

The test suite includes:

- **`test/test.js`** — Integration tests that call the live LLMWhisperer API (requires a valid `LLMWHISPERER_API_KEY`)
- **`test/retry.test.js`** — Unit tests for retry behavior (mocked, no API key needed)

## Error Handling

Errors are handled by the LLMWhispererClientException class. This class extends the built-in Error class and adds a `statusCode` property.
Expand Down
Loading
Loading