Skip to content

Commit 88f1075

Browse files
committed
fix broken links
1 parent bb59dbc commit 88f1075

File tree

13 files changed

+21
-19
lines changed

13 files changed

+21
-19
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
docs/api_reference_markdown/
12
openai_api_key.txt
23
*__pycache__*
34
data/*

docs/concepts/instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ In addition to any static text describing the context of the task, instructions
99
| Component | Syntax | Description |
1010
|-------------------|--------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
1111
| Variables | `${variable_name}` | These are provided by the user at runtime, and substituted in the instructions. |
12-
| Output Schema | `${output_schema}` | This is the schema of the expected output, and is compiled based on the `output` element. For more information on how the output schema is compiled for the instructions, check out [`output` element compilation](../output/#adding-compiled-output-element-to-prompt). |
12+
| Output Schema | `${output_schema}` | This is the schema of the expected output, and is compiled based on the `output` element. For more information on how the output schema is compiled for the instructions, check out [`output` element compilation](/docs/concepts/output/#adding-compiled-output-element-to-prompt) |
1313
| Prompt Primitives | `${gr.prompt_primitive_name}` | These are pre-constructed blocks of text that are useful for common tasks. E.g., some primitives may contain information that helps the LLM understand the output schema better. To see the full list of prompt primitives, check out [`guardrails/constants.xml`](https://github.com/guardrails-ai/guardrails/blob/main/guardrails/constants.xml). |
1414

1515

docs/concepts/logs.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ All `Guard` calls are logged internally, and can be accessed via the guard histo
44

55
## 🇻🇦 Accessing logs via `Guard.history`
66

7-
`history` is an attribute of the `Guard` class. It implements a standard `Stack` interface with a few extra helper methods and properties. For more information on our `Stack` implementation see the [Helper Classes](/api_reference/helper_classes) page.
7+
`history` is an attribute of the `Guard` class. It implements a standard `Stack` interface with a few extra helper methods and properties. For more information on our `Stack` implementation see the [Helper Classes](/docs/api_reference_markdown/helper_classes) page.
88

99
Each entry in the history stack is a `Call` log which will contain information specific to a particular `Guard.__call__` or `Guard.parse` call in the order that they were executed within the current session.
1010

@@ -188,4 +188,4 @@ completion token usage: 16
188188
token usage for this step: 633
189189
```
190190

191-
For more information on the properties available on `Iteration`, ee the [History & Logs](/api_reference/history_and_logs/#guardrails.classes.history.Iteration) page.
191+
For more information on the properties available on `Iteration`, see the [History & Logs](/docs/api_reference_markdown/history_and_logs/#guardrails.classes.history.Iteration) page.

docs/concepts/output.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ At the heart of the `RAIL` specification is the use of elements. Each element's
196196

197197
Guardrails supports many data types, including:, `string`, `integer`, `float`, `bool`, `list`, `object`, `url`, `email` and many more.
198198

199-
Check out the [RAIL Data Types](../data_types.md) page for a list of supported data types.
199+
Check out the [RAIL Data Types](/docs/api_reference_markdown/datatypes) page for a list of supported data types.
200200

201201

202202
#### Scalar vs Non-scalar types
@@ -300,7 +300,7 @@ Each quality criteria is then checked against the generated output. If the quali
300300
### Supported criteria
301301

302302
- Each quality critera is relevant to a specific data type. For example, the `two-words` quality criteria is only relevant to strings, and the `positive` quality criteria is only relevant to integers and floats.
303-
- To see the full list of supported quality criteria, check out the [Validation](../api_reference/validators.md) page.
303+
- To see the full list of supported quality criteria, check out the [Validation](/docs/api_reference_markdown/validators) page.
304304

305305

306306
## 🛠️ Specifying corrective actions

docs/concepts/prompt.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ In addition to the high level task description, the prompt also contains the fol
99
| Component | Syntax | Description |
1010
|-------------------|--------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
1111
| Variables | `${variable_name}` | These are provided by the user at runtime, and substituted in the prompt. |
12-
| Output Schema | `${output_schema}` | This is the schema of the expected output, and is compiled based on the `output` element. For more information on how the output schema is compiled for the prompt, check out [`output` element compilation](../output/#adding-compiled-output-element-to-prompt). |
12+
| Output Schema | `${output_schema}` | This is the schema of the expected output, and is compiled based on the `output` element. For more information on how the output schema is compiled for the prompt, check out [`output` element compilation](/docs/concepts/output/#adding-compiled-output-element-to-prompt). |
1313
| Prompt Primitives | `${gr.prompt_primitive_name}` | These are pre-constructed prompts that are useful for common tasks. E.g., some primitives may contain information that helps the LLM understand the output schema better. To see the full list of prompt primitives, check out [`guardrails/constants.xml`](https://github.com/guardrails-ai/guardrails/blob/main/guardrails/constants.xml). |
1414

1515
```xml

docs/concepts/validators.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Validators are how we apply quality controls to the schemas specified in our `RAIL` specs. They specify the criteria to measure whether an output is valid, as well as what actions to take when an output does not meet those criteria.
44

55
## How do Validators work?
6-
When a validator is applied to a property on a schema, and output is provided for that schema, either by wrapping the LLM call or passing in the LLM output, the validators are executed against the values for the properties they were applied to. If the value for the property passes the criteria defined, a `PassResult` is returned from the validator. This `PassResult` tells Guardrails to treat the value as if it is valid. In most cases this means returning that value for that property at the end; other advanced cases, like using a value override, will be covered in other sections. If, however, the value for the property does not pass the criteria, a `FailResult` is returned. This in turn tells Guardrails to take any corrective actions defined for the property and validation. Corrective actions are defined by the `on-fail-...` attributes in a `RAIL` spec. You can read more about what corrective actions are available [here](/concepts/output/#specifying-corrective-actions).
6+
When a validator is applied to a property on a schema, and output is provided for that schema, either by wrapping the LLM call or passing in the LLM output, the validators are executed against the values for the properties they were applied to. If the value for the property passes the criteria defined, a `PassResult` is returned from the validator. This `PassResult` tells Guardrails to treat the value as if it is valid. In most cases this means returning that value for that property at the end; other advanced cases, like using a value override, will be covered in other sections. If, however, the value for the property does not pass the criteria, a `FailResult` is returned. This in turn tells Guardrails to take any corrective actions defined for the property and validation. Corrective actions are defined by the `on-fail-...` attributes in a `RAIL` spec. You can read more about what corrective actions are available [here](/docs/concepts/output#%EF%B8%8F-specifying-corrective-actions).
77

88
## Validator Structure
99
### Arguments
@@ -49,14 +49,14 @@ raw_output, guarded_output, *rest = guard(
4949
```
5050

5151
#### How do I know what metadata is required?
52-
First step is to check the docs. Each validator has an API reference that documents both its initialization arguments and any required metadata that must be supplied at runtime. Continuing with the example used above, `ExtractedSummarySentencesMatch` accepts an optional threshold argument which defaults to `0.7`; it also requires an entry in the metadata called `filepaths` which is an array of strings specifying which documents to use for the similarity comparison. You can see an example of a Validator's metadata documentation [here](../api_reference/validators.md/#guardrails.validators.ExtractedSummarySentencesMatch).
52+
First step is to check the docs. Each validator has an API reference that documents both its initialization arguments and any required metadata that must be supplied at runtime. Continuing with the example used above, `ExtractedSummarySentencesMatch` accepts an optional threshold argument which defaults to `0.7`; it also requires an entry in the metadata called `filepaths` which is an array of strings specifying which documents to use for the similarity comparison. You can see an example of a Validator's metadata documentation [here](/docs/api_reference_markdown/validators#extractedsummarysentencesmatch).
5353

5454
Secondly, if a piece of metadata is required and not present, a `RuntimeError` will be raised. For example, if the metadata requirements are not met for the above validator, an `RuntimeError` will be raised with the following message:
5555

5656
> extracted-sentences-summary-match validator expects `filepaths` key in metadata
5757
5858
## Custom Validators
59-
If you need to perform a validation that is not currently supported by the [validators](../api_reference/validators.md) included in guardrails, you can create your own custom validators to be used in your local python environment.
59+
If you need to perform a validation that is not currently supported by the [validators](/docs/api_reference_markdown/validators) included in guardrails, you can create your own custom validators to be used in your local python environment.
6060

6161
A custom validator can be as simple as a single function if you do not require addtional arguments:
6262
```py

docs/defining_guards/pydantic.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"metadata": {},
2424
"source": [
2525
"## Structured outputs\n",
26-
"Guardrails uses pydantic to describe and validate structured output. For unstructured output, see <a href='/defining_guards/strings'>Strings</a>.\n",
26+
"Guardrails uses pydantic to describe and validate structured output. For unstructured output, see <a href='/docs/defining_guards/strings'>Strings</a>.\n",
2727
"\n",
2828
"Let's say you want an LLM to generate fake pets. We can model a Pet as class that inherits from <a href=\"https://docs.pydantic.dev/latest/api/base_model/\">BaseModel</a>. Each field can take descriptions and validators."
2929
]
@@ -92,7 +92,7 @@
9292
"metadata": {},
9393
"source": [
9494
"### Structured output with validation\n",
95-
"Now that we have our LLM responding to us in JSON with the structured information we're asking for, we can add validations and corrective actions. Below, we've added a validator to the 'name' field that ensures the name cannot be null. We've also added an on_fail action of \"reask\" if the name is null. What this does is reasks the LLM if the validation fails. Check the <a href=\"api_reference/validators\">Validators API Spec</a> for a list of standard validators, or you can write your own."
95+
"Now that we have our LLM responding to us in JSON with the structured information we're asking for, we can add validations and corrective actions. Below, we've added a validator to the 'name' field that ensures the name cannot be null. We've also added an on_fail action of \"reask\" if the name is null. What this does is reasks the LLM if the validation fails. Check the <a href=\"/docs/api_reference_markdown/validators\">Validators API Spec</a> for a list of standard validators, or you can write your own."
9696
]
9797
},
9898
{

docs/defining_guards/strings.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"\n",
1313
"Guardrails additionally supports single-field, string outputs. This is useful for running validations on simple, single-value outputs.\n",
1414
"\n",
15-
"The specification for writing up validators and including failure modes is identical to what we see in <a href='/defining_guards/pydantic'>pydantic</a>.\n",
15+
"The specification for writing up validators and including failure modes is identical to what we see in <a href='/docs/defining_guards/pydantic'>pydantic</a>.\n",
1616
"\n",
1717
"### Simple Example\n",
1818
"\n",

docs/guardrails_ai/getting_started.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,9 @@
154154
"source": [
155155
"#### Specifying quality criteria\n",
156156
"\n",
157-
"Next, we want to specify the quality criteria for the output to be valid and corrective actions to be taken if the output is invalid. We can do this by adding a `format` tag to each field in the output schema. Format tags can either be enforced by Guardrails, or they can only be suggetions to the LLM. You can see the list of validators enforced by Guardrails [here](../api_reference/validators.md). Additionally, you can create your own custom validators, see examples here [1](../examples/no_secrets_in_generated_text/pydantic), [2](../examples/recipe_generation/pydantic), [3](../examples/valid_chess_moves/pydantic).\n",
157+
"Next, we want to specify the quality criteria for the output to be valid and corrective actions to be taken if the output is invalid. We can do this by adding a `format` tag to each field in the output schema. Format tags can either be enforced by Guardrails, or they can only be suggetions to the LLM. You can see the list of validators enforced by Guardrails [here](../api_reference_markdown/validators.md). Additionally, you can create your own custom validators, see examples here [1](../examples/no_secrets_in_generated_text), [2](../examples/recipe_generation), [3](../examples/valid_chess_moves).\n",
158158
"\n",
159-
"As an example, for our use case we specify that the `affected_area` of `symptoms` should be one of the following: `['head', 'neck', 'chest']`. For this, we use the [`valid-choices` validator](https://docs.guardrailsai.com/api_reference/validators/#guardrails.validators.ValidChoices).\n",
159+
"As an example, for our use case we specify that the `affected_area` of `symptoms` should be one of the following: `['head', 'neck', 'chest']`. For this, we use the [`valid-choices` validator](https://www.guardrailsai.com/docs/api_reference_markdown/validators#validchoices).\n",
160160
"\n",
161161
"\n",
162162
"#### Specifying corrective actions\n",
@@ -165,7 +165,7 @@
165165
"\n",
166166
"For example, we can specify that if the `affected_area` of a symptom is not one of the valid choices, we should re-prompt the LLM to correct its output.\n",
167167
"\n",
168-
"We do this by adding the `on-fail-valid-choices='reask'` attribute to the `affected_area` field. To see the full list of corrective actions, see [here](https://docs.guardrailsai.com/concepts/output/#specifying-corrective-actions).\n",
168+
"We do this by adding the `on-fail-valid-choices='reask'` attribute to the `affected_area` field. To see the full list of corrective actions, see [here](https://www.guardrailsai.com/docs/concepts/output#%EF%B8%8F-specifying-corrective-actions).\n",
169169
"\n",
170170
"\n",
171171
"Finally, our updated output schema looks like:"

docs/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Guardrails AI is the leading open-source framework to define and enforce assuran
1818

1919
Guardrails provides an object definition called a `Rail` for enforcing a specification on an LLM output, and a lightweight wrapper called a `Guard` around LLM API calls to implement this spec.
2020

21-
1. `rail` (**R**eliable **AI** markup **L**anguage) files for specifying structure and type information, validators and corrective actions over LLM outputs. The concept of a Rail has evolved from markup - Rails can be defined in either <a href='/defining_guards/pydantic'>Pydantic</a> or <a href='/defining_guards/rail'>RAIL</a> for structured outputs, or directly in <a href='/defining_guards/strings'>Python</a> for string outputs.
21+
1. `rail` (**R**eliable **AI** markup **L**anguage) files for specifying structure and type information, validators and corrective actions over LLM outputs. The concept of a Rail has evolved from markup - Rails can be defined in either <a href='/docs/defining_guards/pydantic'>Pydantic</a> or <a href='/docs/defining_guards/rail'>RAIL</a> for structured outputs, or directly in <a href='/docs/defining_guards/strings'>Python</a> for string outputs.
2222
2. `Guard` wraps around LLM API calls to structure, validate and correct the outputs.
2323

2424
```mermaid
@@ -27,7 +27,7 @@ graph LR
2727
B --> C["Wrap LLM API call with `guard`"];
2828
```
2929

30-
Check out the [Getting Started](guardrails_ai/getting_started) guide to learn how to use Guardrails.
30+
Check out the [Getting Started](/docs/guardrails_ai/getting_started) guide to learn how to use Guardrails.
3131

3232
## 📍 Roadmap
3333

0 commit comments

Comments
 (0)