From 538a83fdc03fcc3870593b33211920b482dcf1d0 Mon Sep 17 00:00:00 2001 From: Shreya Rajpal Date: Wed, 13 Mar 2024 19:15:17 -0700 Subject: [PATCH 1/3] docs polish --- docs/how_to_guides/logs.md | 2 +- docs/how_to_guides/streaming.ipynb | 2 +- docs/the_guard.md | 2 +- docusaurus/sidebars.js | 38 +++++++++++++++--------------- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/docs/how_to_guides/logs.md b/docs/how_to_guides/logs.md index 567e555eb..13b4bc1ea 100644 --- a/docs/how_to_guides/logs.md +++ b/docs/how_to_guides/logs.md @@ -1,4 +1,4 @@ -# Inspect Guard Run History and Logs +# Inspect logs from a Guard All `Guard` calls are logged internally, and can be accessed via the guard history. diff --git a/docs/how_to_guides/streaming.ipynb b/docs/how_to_guides/streaming.ipynb index 63f9a4bf1..2f24b6551 100644 --- a/docs/how_to_guides/streaming.ipynb +++ b/docs/how_to_guides/streaming.ipynb @@ -16,7 +16,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "# Validate Streamed LLM Responses\n" + "# Real-time stream Validated LLM Responses\n" ] }, { diff --git a/docs/the_guard.md b/docs/the_guard.md index e8c26b2bd..9c1c51c95 100644 --- a/docs/the_guard.md +++ b/docs/the_guard.md @@ -1,4 +1,4 @@ -# The Guard +# What is a Guard? The guard object is the main interface for GuardRails. It is seeded with a RailSpec, and then used to run the GuardRails AI engine. It is the object that accepts changing prompts, wraps LLM prompts, and keeps track of call history. diff --git a/docusaurus/sidebars.js b/docusaurus/sidebars.js index d45e10872..664d9f373 100644 --- a/docusaurus/sidebars.js +++ b/docusaurus/sidebars.js @@ -32,29 +32,29 @@ const sidebars = { }, { type: "doc", - label: "Installation", - id: "guardrails_ai/installation", + label: "Getting Started", + id: "guardrails_ai/getting_started", }, { type: "doc", - label: "Getting Started", - id: "guardrails_ai/getting_started", + label: "Installation", + id: "guardrails_ai/installation", }, + "the_guard", { type: "category", label: "How-to Guides", collapsed: true, items: [ - "how_to_guides/logs", - "how_to_guides/streaming", "how_to_guides/llm_api_wrappers", + "how_to_guides/streaming", + "how_to_guides/structured_data_with_guardrails", + "how_to_guides/logs", "how_to_guides/rail", "how_to_guides/envvars", - "how_to_guides/structured_data_with_guardrails", "how_to_guides/telemetry", ], }, - "the_guard", { type: "category", label: "API Reference", @@ -67,17 +67,17 @@ const sidebars = { ], }, examples, - { - type: "category", - label: "Integrations", - collapsed: true, - items: [ - { - type: "autogenerated", - dirName: "integrations", - }, - ], - }, + // { + // type: "category", + // label: "Integrations", + // collapsed: true, + // items: [ + // { + // type: "autogenerated", + // dirName: "integrations", + // }, + // ], + // }, { type: "category", label: "Migration Guides", From 639159fdce42851a67c2a7a2aa86b030a1348917 Mon Sep 17 00:00:00 2001 From: Shreya Rajpal Date: Wed, 13 Mar 2024 19:17:20 -0700 Subject: [PATCH 2/3] rename docs --- docs/how_to_guides/envvars.md | 2 +- docs/how_to_guides/rail.md | 2 +- docs/how_to_guides/streaming.ipynb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/how_to_guides/envvars.md b/docs/how_to_guides/envvars.md index c451c9b29..d9f715faa 100644 --- a/docs/how_to_guides/envvars.md +++ b/docs/how_to_guides/envvars.md @@ -1,4 +1,4 @@ -# Set API Keys and other Environment Variables +# Set API Keys and other EnvVars Guardrails recognize a handful of environment variables that can be used at runtime. Most of these correlate to envinronment variables used or expected by the various LLM clients. Below you can find a list of these and their uses. diff --git a/docs/how_to_guides/rail.md b/docs/how_to_guides/rail.md index 68ab91eed..feb508310 100644 --- a/docs/how_to_guides/rail.md +++ b/docs/how_to_guides/rail.md @@ -1,4 +1,4 @@ -# Use Guardrails with Markup +# Use Guardrails via RAIL ## What is `RAIL`? diff --git a/docs/how_to_guides/streaming.ipynb b/docs/how_to_guides/streaming.ipynb index 2f24b6551..d436338a5 100644 --- a/docs/how_to_guides/streaming.ipynb +++ b/docs/how_to_guides/streaming.ipynb @@ -16,7 +16,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "# Real-time stream Validated LLM Responses\n" + "# Stream validated LLM responses in real-time\n" ] }, { From 316d4bbea9f05b8e9c5110bb4d999a186650fc90 Mon Sep 17 00:00:00 2001 From: Shreya Rajpal Date: Thu, 4 Apr 2024 15:06:35 -0700 Subject: [PATCH 3/3] more polish --- docs/how_to_guides/envvars.md | 2 +- docs/how_to_guides/llm_api_wrappers.md | 2 +- docs/how_to_guides/streaming.ipynb | 30 +++++++++++-------- .../structured_data_with_guardrails.mdx | 2 +- docusaurus/sidebars.js | 2 +- 5 files changed, 21 insertions(+), 17 deletions(-) diff --git a/docs/how_to_guides/envvars.md b/docs/how_to_guides/envvars.md index d9f715faa..cbc33c539 100644 --- a/docs/how_to_guides/envvars.md +++ b/docs/how_to_guides/envvars.md @@ -1,6 +1,6 @@ # Set API Keys and other EnvVars -Guardrails recognize a handful of environment variables that can be used at runtime. Most of these correlate to envinronment variables used or expected by the various LLM clients. Below you can find a list of these and their uses. +Guardrails recognizes a handful of environment variables that can be used at runtime. Most of these correlate to environment variables used or expected by the various LLM clients. Below you can find a list of these and their uses. ### `OPENAI_API_KEY` This environment variable can be used to set your api key credentials for Open AI models. It will be used wherever Open AI is called if an api_key kwarg is not passed to `__call__` or `parse`. diff --git a/docs/how_to_guides/llm_api_wrappers.md b/docs/how_to_guides/llm_api_wrappers.md index 4edb02f99..d6a0ed658 100644 --- a/docs/how_to_guides/llm_api_wrappers.md +++ b/docs/how_to_guides/llm_api_wrappers.md @@ -1,7 +1,7 @@ import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; -# Use Guardrails with any LLMs +# Use Guardrails with any LLM Guardrails' `Guard` wrappers provide a simple way to add Guardrails to your LLM API calls. The wrappers are designed to be used with any LLM API. diff --git a/docs/how_to_guides/streaming.ipynb b/docs/how_to_guides/streaming.ipynb index d436338a5..1e3254120 100644 --- a/docs/how_to_guides/streaming.ipynb +++ b/docs/how_to_guides/streaming.ipynb @@ -1,22 +1,10 @@ { "cells": [ - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "!guardrails hub install hub://guardrails/valid_range\n", - "!guardrails hub install hub://guardrails/uppercase\n", - "!guardrails hub install hub://guardrails/lowercase\n", - "!guardrails hub install hub://guardrails/one_line" - ] - }, { "cell_type": "markdown", "metadata": {}, "source": [ - "# Stream validated LLM responses in real-time\n" + "# Stream-validate LLM responses\n" ] }, { @@ -33,6 +21,22 @@ "import time" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Setup\n", + "\n", + "Install the necessary validators from Guardrails hub in your CLI.\n", + "\n", + "```bash\n", + "!guardrails hub install hub://guardrails/valid_range\n", + "!guardrails hub install hub://guardrails/uppercase\n", + "!guardrails hub install hub://guardrails/lowercase\n", + "!guardrails hub install hub://guardrails/one_line\n", + "```" + ] + }, { "cell_type": "markdown", "metadata": {}, diff --git a/docs/how_to_guides/structured_data_with_guardrails.mdx b/docs/how_to_guides/structured_data_with_guardrails.mdx index 644392929..32d8aef8c 100644 --- a/docs/how_to_guides/structured_data_with_guardrails.mdx +++ b/docs/how_to_guides/structured_data_with_guardrails.mdx @@ -1,7 +1,7 @@ import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; -# Generate structured data with Guardrails AI +# Generate structured data Guardrails AI is effective for generating structured data across from a variety of LLMs. This guide contains the following: diff --git a/docusaurus/sidebars.js b/docusaurus/sidebars.js index 664d9f373..87b99057d 100644 --- a/docusaurus/sidebars.js +++ b/docusaurus/sidebars.js @@ -81,7 +81,7 @@ const sidebars = { { type: "category", label: "Migration Guides", - collapsed: false, + collapsed: true, items: [ "migration_guides/0-4-migration", "migration_guides/0-3-migration",