From d1588c3f087d825aecd0a1915a8a1ad55785fccc Mon Sep 17 00:00:00 2001 From: Shreya Rajpal Date: Sun, 19 Mar 2023 21:33:47 -0700 Subject: [PATCH] updated docs (#70) --- README.md | 6 +++--- docs/guard.md | 2 +- docs/index.md | 12 ++++++------ docs/integrations/pydantic_validation.ipynb | 7 ++++--- mkdocs.yml | 1 + 5 files changed, 15 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index df122a912..2c18aae46 100644 --- a/README.md +++ b/README.md @@ -15,9 +15,9 @@ _Note: Guardrails is an alpha release, so expect sharp edges and bugs._ Guardrails is a Python package that lets a user add structure, type and quality guarantees to the outputs of large language models (LLMs). Guardrails: -✅ does pydantic-style validation of LLM outputs, -✅ takes corrective actions (e.g. reasking LLM) when validation fails, -✅ enforces structure and type guarantees (e.g. JSON). +- does pydantic-style validation of LLM outputs (including semantic validation such as checking for bias in generated text, checking for bugs in generated code, etc.) +- takes corrective actions (e.g. reasking LLM) when validation fails, +- enforces structure and type guarantees (e.g. JSON). ## 🚒 Under the hood diff --git a/docs/guard.md b/docs/guard.md index b0aa4ba15..1b18fb6ba 100644 --- a/docs/guard.md +++ b/docs/guard.md @@ -1,7 +1,7 @@ -::: guardrails.guardrails.Guard +::: guardrails.guard.Guard options: members: - "from_rail" diff --git a/docs/index.md b/docs/index.md index 3b060f011..7964310ef 100644 --- a/docs/index.md +++ b/docs/index.md @@ -6,9 +6,9 @@ _Note: Guardrails is an alpha release, so expect sharp edges and bugs._ Guardrails is a Python package that lets a user add structure, type and quality guarantees to the outputs of large language models (LLMs). Guardrails: -✅ does pydantic-style validation of LLM outputs, -✅ takes corrective actions (e.g. reasking LLM) when validation fails, -✅ enforces structure and type guarantees (e.g. JSON). +- does pydantic-style validation of LLM outputs. This includes semantic validation such as checking for bias in generated text, checking for bugs in generated code, etc. +- takes corrective actions (e.g. reasking LLM) when validation fails, +- enforces structure and type guarantees (e.g. JSON). ## 🚒 Under the hood @@ -40,12 +40,12 @@ To learn more about the `rail` spec and the design decisions behind it, check ou ## 📍 Roadmap - [ ] Adding more examples, new use cases and domains -- [ ] Adding integrations with langchain, gpt-index, minichain, manifest +- [x] Adding integrations with langchain, gpt-index, minichain, manifest - [ ] Expanding validators offering - [ ] More compilers from `.rail` -> LLM prompt (e.g. `.rail` -> TypeScript) - [ ] Informative logging -- [ ] Improving reasking logic +- [x] Improving reasking logic - [ ] A guardrails.js implementation - [ ] VSCode extension for `.rail` files - [ ] Next version of `.rail` format -- [ ] Add more LLM providers +- [x] Add more LLM providers diff --git a/docs/integrations/pydantic_validation.ipynb b/docs/integrations/pydantic_validation.ipynb index f93535ef3..62e206044 100644 --- a/docs/integrations/pydantic_validation.ipynb +++ b/docs/integrations/pydantic_validation.ipynb @@ -8,7 +8,7 @@ "# Validating LLM Outputs with Pydantic\n", "\n", "!!! note\n", - " To download this example as a Jupyter notebook, click [here](https://github.com/ShreyaR/guardrails/blob/main/docs/examples/pydantic_validation.ipynb).\n", + " To download this example as a Jupyter notebook, click [here](https://github.com/ShreyaR/guardrails/blob/main/docs/integrations/pydantic_validation.ipynb).\n", "\n", "In this example, we will use Guardrails with Pydantic.\n", "\n", @@ -38,8 +38,9 @@ "Ordinarily, we would create an RAIL spec in a separate file. For the purposes of this example, we will create the spec in this notebook as a string following the RAIL syntax. For more information on RAIL, see the [RAIL documentation](../rail/output.md).\n", "\n", "Here, we define a Pydantic model for a `Person` with the following fields:\n", - "- `name`: a string\n", - "- `age`: an integer\n", + "\n", + "- `name`: a string \n", + "- `age`: an integer \n", "- `zip_code`: a string zip code\n", "\n", "and write very simple validators for the fields as an example. As a way to show how LLM reasking can be used to generate data that is consistent with the Pydantic model, we can define a validator that asks for a zip code in California (including being perversely opposed to the \"90210\" zip code). If this validator fails, the LLM will be sent the error message and will reask the question.\n", diff --git a/mkdocs.yml b/mkdocs.yml index a16436fd0..f4a317209 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -43,6 +43,7 @@ nav: # - 'SFW tutoring system for kids': examples/sfw_tutoring.md - 'Integrations': - 'LangChain': integrations/langchain.ipynb + - 'Pydantic': integrations/pydantic_validation.ipynb theme: