Skip to content

Commit ba193b4

Browse files
committed
update quickstart to be verbose about API key requirement and cli configuration
1 parent 4f45a04 commit ba193b4

File tree

1 file changed

+25
-8
lines changed

1 file changed

+25
-8
lines changed

docs/getting_started/quickstart.md

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,40 @@ First, install Guardrails for your desired language:
1616
pip install guardrails-ai
1717
```
1818

19+
### Generate an API Key (required)
20+
Next, get a free API key from [Guardrails Hub](https://hub.guardrailsai.com/keys). Copy and keep track of this API key because you'll use it in the next step to configure the CLI.
21+
1922
### Configure the Guardrails CLI (required)
2023

21-
First, get a free auth key from [Guardrails Hub](https://hub.guardrailsai.com/keys). Then, configure the Guardrails CLI with the auth key.
24+
Configure the Guardrails CLI with the command:
2225

2326
```bash
2427
guardrails configure
2528
```
2629

27-
## Usage
30+
The configuration process will ask you three questions:
31+
32+
1. Whether you want to enable metrics reporting.
33+
2. Whether you want to use our hosted remote inference endpoints for validators that utilize large ML models.
34+
3. To enter the API key you generated in the previous step. This is required in order to install validators in the next step.
2835

29-
1. Install a guardrail from [Guardrails Hub](https://hub.guardrailsai.com).
3036

37+
### Install a Validator from the Guardrails Hub
38+
In order to perform any validation on LLM output with Guardrails, you will need to install an appropriate validator for your use case from the [Guardrails Hub](https://hub.guardrailsai.com). Each validator has a unique and identifying Hub URI that can be used in the Guardrails CLI to install it into your current environment. You can find the exact install command for a validator on it's details page in the [Guardrails Hub](https://hub.guardrailsai.com). For example, the [Detect PII](https://hub.guardrailsai.com/validator/guardrails/detect_pii) validator can be installed via:
39+
40+
```bash
41+
guardrails hub install hub://guardrails/detect_pii
42+
```
43+
44+
## Usage
45+
1. Create a Guard with an installed validator.
46+
First, install the validator you want to use from the Guardrails Hub:
47+
3148
```bash
3249
guardrails hub install hub://guardrails/regex_match --quiet
3350
```
34-
2. Create a Guard from the installed guardrail.
3551

52+
Next, you can import this validator from the `guardrails.hub` module and use it to construct a Guard.
3653
```python
3754
# Import Guard and Validator
3855
from guardrails.hub import RegexMatch
@@ -49,14 +66,14 @@ guardrails configure
4966
.validation_passed
5067
) # Guardrail Fails
5168
```
52-
3. Run multiple guardrails within a Guard.
53-
First, install the necessary guardrails from Guardrails Hub.
69+
2. Run multiple validators within a Guard.
70+
First, install the necessary validators from Guardrails Hub.
5471

5572
```bash
56-
guardrails hub install hub://guardrails/valid_length --quiet
73+
guardrails hub install hub://guardrails/regex_match hub://guardrails/valid_length --quiet
5774
```
5875

59-
Then, create a Guard from the installed guardrails.
76+
Then, create a Guard from the installed validators.
6077

6178
```python
6279
from guardrails.hub import RegexMatch, ValidLength

0 commit comments

Comments
 (0)