diff --git a/README.md b/README.md index 659ecc391..c88e42503 100644 --- a/README.md +++ b/README.md @@ -147,7 +147,7 @@ prompt = """ ${gr.complete_json_suffix_v2} """ -guard = Guard.from_pydantic(output_class=Pet, prompt=prompt) +guard = Guard.for_pydantic(output_class=Pet, prompt=prompt) raw_output, validated_output, *rest = guard( llm_api=openai.completions.create, diff --git a/docs/api_reference/async_guard.md b/docs/api_reference/async_guard.md index f34af71e5..00c3bf55c 100644 --- a/docs/api_reference/async_guard.md +++ b/docs/api_reference/async_guard.md @@ -5,10 +5,10 @@ options: members: - "__init__" - - "from_rail" - - "from_rail_string" - - "from_pydantic" - - "from_string" + - "for_rail" + - "for_rail_string" + - "for_pydantic" + - "for_string" - "configure" - "use" - "use_many" diff --git a/docs/api_reference/guard.md b/docs/api_reference/guard.md index 57036e557..a70961f9f 100644 --- a/docs/api_reference/guard.md +++ b/docs/api_reference/guard.md @@ -5,10 +5,10 @@ options: members: - "__init__" - - "from_rail" - - "from_rail_string" - - "from_pydantic" - - "from_string" + - "for_rail" + - "for_rail_string" + - "for_pydantic" + - "for_string" - "configure" - "use" - "use_many" diff --git a/docs/concepts/logs.md b/docs/concepts/logs.md index 80cd5fc38..4a3e41b5a 100644 --- a/docs/concepts/logs.md +++ b/docs/concepts/logs.md @@ -9,7 +9,7 @@ Calls can be further decomposed into a stack of `Iteration` objects. These are s ## General Access Given: ```py -my_guard = Guard.from_pydantic(...) +my_guard = Guard.for_pydantic(...) response_1 = my_guard(...) diff --git a/docs/concepts/streaming_structured_data.ipynb b/docs/concepts/streaming_structured_data.ipynb index 976543aa9..f2f30e8e2 100644 --- a/docs/concepts/streaming_structured_data.ipynb +++ b/docs/concepts/streaming_structured_data.ipynb @@ -9,7 +9,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 4, "metadata": {}, "outputs": [], "source": [ @@ -27,14 +27,23 @@ "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", - "```" + "Install and import the necessary validators from Guardrails hub" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [], + "source": [ + "try:\n", + " from guardrails.hub import LowerCase, UpperCase, ValidRange, OneLine\n", + "except ImportError:\n", + " gd.install(\"hub://guardrails/valid_range\")\n", + " gd.install(\"hub://guardrails/uppercase\")\n", + " gd.install(\"hub://guardrails/lowercase\")\n", + " gd.install(\"hub://guardrails/one_line\")\n", + " from guardrails.hub import LowerCase, UpperCase, ValidRange, OneLine\n" ] }, { @@ -53,12 +62,11 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 6, "metadata": {}, "outputs": [], "source": [ "from pydantic import BaseModel, Field\n", - "from guardrails.hub import LowerCase, UpperCase, ValidRange, OneLine\n", "from typing import List\n", "\n", "prompt = \"\"\"\n", @@ -118,11 +126,11 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 7, "metadata": {}, "outputs": [], "source": [ - "guard = gd.Guard.from_pydantic(output_class=PatientInfo)" + "guard = gd.Guard.for_pydantic(output_class=PatientInfo)" ] }, { @@ -136,14 +144,15 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 8, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ - "HTTP Request: POST https://api.openai.com/v1/chat/completions \"HTTP/1.1 200 OK\"\n" + "/home/zayd/workspace/guardrails/docs/.venv/lib/python3.11/site-packages/guardrails/validator_service/__init__.py:85: UserWarning: Could not obtain an event loop. Falling back to synchronous validation.\n", + " warnings.warn(\n" ] }, { @@ -153,13 +162,13 @@ " 'gender': 'female',\n", " 'age': 100,\n", " 'symptoms': [\n", - " {'symptom': 'chronic macular rash', 'affected_area': 'face and hair, worse in beard, eyebrows and nares'},\n", - " {'symptom': 'itchy', 'affected_area': 'whole body'},\n", - " {'symptom': 'flaky', 'affected_area': 'whole body'},\n", - " {'symptom': 'slightly scaly', 'affected_area': 'whole body'}\n", + " {'symptom': 'chronic macular rash', 'affected_area': 'face'},\n", + " {'symptom': 'itchy', 'affected_area': 'beard'},\n", + " {'symptom': 'flaky', 'affected_area': 'eyebrows'},\n", + " {'symptom': 'slightly scaly', 'affected_area': 'nares'}\n", " ],\n", - " 'current_meds': [{'medication': 'OTC STEROID CREAM', 'response': 'moderate response'}],\n", - " 'miscellaneous': 'patient has been using cream for 2 weeks and also suffers from diabetes'\n", + " 'current_meds': [{'medication': 'OTC STEROID CREAM', 'response': 'Moderate'}],\n", + " 'miscellaneous': 'patient also suffers from diabetes'\n", "}\n", "\n" ], @@ -168,13 +177,13 @@ " \u001b[32m'gender'\u001b[0m: \u001b[32m'female'\u001b[0m,\n", " \u001b[32m'age'\u001b[0m: \u001b[1;36m100\u001b[0m,\n", " \u001b[32m'symptoms'\u001b[0m: \u001b[1m[\u001b[0m\n", - " \u001b[1m{\u001b[0m\u001b[32m'symptom'\u001b[0m: \u001b[32m'chronic macular rash'\u001b[0m, \u001b[32m'affected_area'\u001b[0m: \u001b[32m'face and hair, worse in beard, eyebrows and nares'\u001b[0m\u001b[1m}\u001b[0m,\n", - " \u001b[1m{\u001b[0m\u001b[32m'symptom'\u001b[0m: \u001b[32m'itchy'\u001b[0m, \u001b[32m'affected_area'\u001b[0m: \u001b[32m'whole body'\u001b[0m\u001b[1m}\u001b[0m,\n", - " \u001b[1m{\u001b[0m\u001b[32m'symptom'\u001b[0m: \u001b[32m'flaky'\u001b[0m, \u001b[32m'affected_area'\u001b[0m: \u001b[32m'whole body'\u001b[0m\u001b[1m}\u001b[0m,\n", - " \u001b[1m{\u001b[0m\u001b[32m'symptom'\u001b[0m: \u001b[32m'slightly scaly'\u001b[0m, \u001b[32m'affected_area'\u001b[0m: \u001b[32m'whole body'\u001b[0m\u001b[1m}\u001b[0m\n", + " \u001b[1m{\u001b[0m\u001b[32m'symptom'\u001b[0m: \u001b[32m'chronic macular rash'\u001b[0m, \u001b[32m'affected_area'\u001b[0m: \u001b[32m'face'\u001b[0m\u001b[1m}\u001b[0m,\n", + " \u001b[1m{\u001b[0m\u001b[32m'symptom'\u001b[0m: \u001b[32m'itchy'\u001b[0m, \u001b[32m'affected_area'\u001b[0m: \u001b[32m'beard'\u001b[0m\u001b[1m}\u001b[0m,\n", + " \u001b[1m{\u001b[0m\u001b[32m'symptom'\u001b[0m: \u001b[32m'flaky'\u001b[0m, \u001b[32m'affected_area'\u001b[0m: \u001b[32m'eyebrows'\u001b[0m\u001b[1m}\u001b[0m,\n", + " \u001b[1m{\u001b[0m\u001b[32m'symptom'\u001b[0m: \u001b[32m'slightly scaly'\u001b[0m, \u001b[32m'affected_area'\u001b[0m: \u001b[32m'nares'\u001b[0m\u001b[1m}\u001b[0m\n", " \u001b[1m]\u001b[0m,\n", - " \u001b[32m'current_meds'\u001b[0m: \u001b[1m[\u001b[0m\u001b[1m{\u001b[0m\u001b[32m'medication'\u001b[0m: \u001b[32m'OTC STEROID CREAM'\u001b[0m, \u001b[32m'response'\u001b[0m: \u001b[32m'moderate response'\u001b[0m\u001b[1m}\u001b[0m\u001b[1m]\u001b[0m,\n", - " \u001b[32m'miscellaneous'\u001b[0m: \u001b[32m'patient has been using cream for 2 weeks and also suffers from diabetes'\u001b[0m\n", + " \u001b[32m'current_meds'\u001b[0m: \u001b[1m[\u001b[0m\u001b[1m{\u001b[0m\u001b[32m'medication'\u001b[0m: \u001b[32m'OTC STEROID CREAM'\u001b[0m, \u001b[32m'response'\u001b[0m: \u001b[32m'Moderate'\u001b[0m\u001b[1m}\u001b[0m\u001b[1m]\u001b[0m,\n", + " \u001b[32m'miscellaneous'\u001b[0m: \u001b[32m'patient also suffers from diabetes'\u001b[0m\n", "\u001b[1m}\u001b[0m\n" ] }, @@ -199,7 +208,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 9, "metadata": {}, "outputs": [ { @@ -207,7 +216,7 @@ "text/html": [ "
Logs\n",
        "└── ╭────────────────────────────────────────────────── Step 0 ───────────────────────────────────────────────────╮\n",
-       "    │ ╭──────────────────────────────────────────────── Prompt ─────────────────────────────────────────────────╮ │\n",
+       "    │ ╭──────────────────────────────────────────────── Prompt ─────────────────────────────────────────────────╮ │\n",
        "    │ │                                                                                                         │ │\n",
        "    │ │ Given the following doctor's notes about a patient, please extract a dictionary that contains the       │ │\n",
        "    │ │ patient's information.                                                                                  │ │\n",
@@ -221,29 +230,32 @@
        "    │ │ it into.                                                                                                │ │\n",
        "    │ │                                                                                                         │ │\n",
        "    │ │ <output>                                                                                                │ │\n",
-       "    │ │     <string name=\"gender\" description=\"Patient's gender\"/>                                              │ │\n",
-       "    │ │     <integer name=\"age\" description=\"Patient's age\" format=\"valid-range: min=0 max=100\"/>               │ │\n",
-       "    │ │     <list name=\"symptoms\" description=\"Symptoms that the patient is currently experiencing. Each        │ │\n",
-       "    │ │ symptom should be classified into  separate item in the list.\">                                         │ │\n",
-       "    │ │         <object>                                                                                        │ │\n",
-       "    │ │             <string name=\"symptom\" description=\"Symptom that a patient is experiencing\"/>               │ │\n",
-       "    │ │             <string name=\"affected_area\" description=\"What part of the body the symptom is affecting\"   │ │\n",
-       "    │ │ format=\"lower-case\"/>                                                                                   │ │\n",
-       "    │ │         </object>                                                                                       │ │\n",
-       "    │ │     </list>                                                                                             │ │\n",
-       "    │ │     <list name=\"current_meds\" description=\"Medications the patient is currently taking and their        │ │\n",
-       "    │ │ response\">                                                                                              │ │\n",
-       "    │ │         <object>                                                                                        │ │\n",
-       "    │ │             <string name=\"medication\" description=\"Name of the medication the patient is taking\"        │ │\n",
-       "    │ │ format=\"upper-case\"/>                                                                                   │ │\n",
-       "    │ │             <string name=\"response\" description=\"How the patient is responding to the medication\"/>     │ │\n",
-       "    │ │         </object>                                                                                       │ │\n",
-       "    │ │     </list>                                                                                             │ │\n",
-       "    │ │     <string name=\"miscellaneous\" description=\"Any other information that is relevant to the patient's   │ │\n",
-       "    │ │ health; something that doesn't fit into the other categories.\" format=\"lower-case; one-line\"/>          │ │\n",
+       "    │ │   <string description=\"Patient's gender\" name=\"gender\" required=\"true\"></string>                        │ │\n",
+       "    │ │   <integer description=\"Patient's age\" format=\"guardrails/valid_range: 0 100\" name=\"age\"                │ │\n",
+       "    │ │ required=\"true\"></integer>                                                                              │ │\n",
+       "    │ │   <list description=\"Symptoms that the patient is currently experiencing. Each symptom should be        │ │\n",
+       "    │ │ classified into  separate item in the list.\" name=\"symptoms\" required=\"true\">                           │ │\n",
+       "    │ │     <object required=\"true\">                                                                            │ │\n",
+       "    │ │       <string description=\"Symptom that a patient is experiencing\" name=\"symptom\"                       │ │\n",
+       "    │ │ required=\"true\"></string>                                                                               │ │\n",
+       "    │ │       <string description=\"What part of the body the symptom is affecting\"                              │ │\n",
+       "    │ │ format=\"guardrails/lowercase\" name=\"affected_area\" required=\"true\"></string>                            │ │\n",
+       "    │ │     </object>                                                                                           │ │\n",
+       "    │ │   </list>                                                                                               │ │\n",
+       "    │ │   <list description=\"Medications the patient is currently taking and their response\"                    │ │\n",
+       "    │ │ name=\"current_meds\" required=\"true\">                                                                    │ │\n",
+       "    │ │     <object required=\"true\">                                                                            │ │\n",
+       "    │ │       <string description=\"Name of the medication the patient is taking\" format=\"guardrails/uppercase\"  │ │\n",
+       "    │ │ name=\"medication\" required=\"true\"></string>                                                             │ │\n",
+       "    │ │       <string description=\"How the patient is responding to the medication\" name=\"response\"             │ │\n",
+       "    │ │ required=\"true\"></string>                                                                               │ │\n",
+       "    │ │     </object>                                                                                           │ │\n",
+       "    │ │   </list>                                                                                               │ │\n",
+       "    │ │   <string description=\"Any other information that is relevant to the patient's health; something that   │ │\n",
+       "    │ │ doesn't fit into the other categories.\" format=\"guardrails/lowercase; guardrails/one_line\"              │ │\n",
+       "    │ │ name=\"miscellaneous\" required=\"true\"></string>                                                          │ │\n",
        "    │ │ </output>                                                                                               │ │\n",
        "    │ │                                                                                                         │ │\n",
-       "    │ │                                                                                                         │ │\n",
        "    │ │ ONLY return a valid JSON object (no other text is necessary), where the key of the field in JSON is the │ │\n",
        "    │ │ `name` attribute of the corresponding XML, and the value is of the type specified by the corresponding  │ │\n",
        "    │ │ XML's tag. The JSON MUST conform to the XML format, including any types and format requests e.g.        │ │\n",
@@ -258,38 +270,54 @@
        "    │ │                                                                                                         │ │\n",
        "    │ │                                                                                                         │ │\n",
        "    │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │\n",
-       "    │ ╭───────────────────────────────────────────── Instructions ──────────────────────────────────────────────╮ │\n",
-       "    │ │ You are a helpful assistant, able to express yourself purely through JSON, strictly and precisely       │ │\n",
-       "    │ │ adhering to the provided XML schemas.                                                                   │ │\n",
-       "    │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │\n",
-       "    │ ╭──────────────────────────────────────────── Message History ────────────────────────────────────────────╮ │\n",
+       "    │ ╭──────────────────────────────────────────── Message History ────────────────────────────────────────────╮ │\n",
        "    │ │ No message history.                                                                                     │ │\n",
        "    │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │\n",
-       "    │ ╭──────────────────────────────────────────── Raw LLM Output ─────────────────────────────────────────────╮ │\n",
-       "    │ │ {\"gender\":\"female\",\"age\":152,\"symptoms\":[{\"symptom\":\"chronic macular rash\",\"affected_area\":\"face and    │ │\n",
-       "    │ │ hair, worse in beard, eyebrows and nares\"},{\"symptom\":\"itchy\",\"affected_area\":\"whole                    │ │\n",
-       "    │ │ body\"},{\"symptom\":\"flaky\",\"affected_area\":\"whole body\"},{\"symptom\":\"slightly                            │ │\n",
-       "    │ │ scaly\",\"affected_area\":\"whole body\"}],\"current_meds\":[{\"medication\":\"OTC steroid                        │ │\n",
-       "    │ │ cream\",\"response\":\"moderate response\"}],\"miscellaneous\":\"patient has been using cream for 2 weeks and   │ │\n",
-       "    │ │ also suffers from diabetes\"}                                                                            │ │\n",
+       "    │ ╭──────────────────────────────────────────── Raw LLM Output ─────────────────────────────────────────────╮ │\n",
+       "    │ │ {                                                                                                       │ │\n",
+       "    │ │     \"gender\": \"female\",                                                                                 │ │\n",
+       "    │ │     \"age\": 152,                                                                                         │ │\n",
+       "    │ │     \"symptoms\": [                                                                                       │ │\n",
+       "    │ │         {                                                                                               │ │\n",
+       "    │ │             \"symptom\": \"chronic macular rash\",                                                          │ │\n",
+       "    │ │             \"affected_area\": \"face\"                                                                     │ │\n",
+       "    │ │         },                                                                                              │ │\n",
+       "    │ │         {                                                                                               │ │\n",
+       "    │ │             \"symptom\": \"itchy\",                                                                         │ │\n",
+       "    │ │             \"affected_area\": \"beard\"                                                                    │ │\n",
+       "    │ │         },                                                                                              │ │\n",
+       "    │ │         {                                                                                               │ │\n",
+       "    │ │             \"symptom\": \"flaky\",                                                                         │ │\n",
+       "    │ │             \"affected_area\": \"eyebrows\"                                                                 │ │\n",
+       "    │ │         },                                                                                              │ │\n",
+       "    │ │         {                                                                                               │ │\n",
+       "    │ │             \"symptom\": \"slightly scaly\",                                                                │ │\n",
+       "    │ │             \"affected_area\": \"nares\"                                                                    │ │\n",
+       "    │ │         }                                                                                               │ │\n",
+       "    │ │     ],                                                                                                  │ │\n",
+       "    │ │     \"current_meds\": [                                                                                   │ │\n",
+       "    │ │         {                                                                                               │ │\n",
+       "    │ │             \"medication\": \"OTC steroid cream\",                                                          │ │\n",
+       "    │ │             \"response\": \"Moderate\"                                                                      │ │\n",
+       "    │ │         }                                                                                               │ │\n",
+       "    │ │     ],                                                                                                  │ │\n",
+       "    │ │     \"miscellaneous\": \"patient also suffers from diabetes\"                                               │ │\n",
+       "    │ │ }                                                                                                       │ │\n",
        "    │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │\n",
-       "    │ ╭─────────────────────────────────────────── Validated Output ────────────────────────────────────────────╮ │\n",
+       "    │ ╭─────────────────────────────────────────── Validated Output ────────────────────────────────────────────╮ │\n",
        "    │ │ {                                                                                                       │ │\n",
        "    │ │     'gender': 'female',                                                                                 │ │\n",
        "    │ │     'age': 100,                                                                                         │ │\n",
        "    │ │     'symptoms': [                                                                                       │ │\n",
-       "    │ │         {                                                                                               │ │\n",
-       "    │ │             'symptom': 'chronic macular rash',                                                          │ │\n",
-       "    │ │             'affected_area': 'face and hair, worse in beard, eyebrows and nares'                        │ │\n",
-       "    │ │         },                                                                                              │ │\n",
-       "    │ │         {'symptom': 'itchy', 'affected_area': 'whole body'},                                            │ │\n",
-       "    │ │         {'symptom': 'flaky', 'affected_area': 'whole body'},                                            │ │\n",
-       "    │ │         {'symptom': 'slightly scaly', 'affected_area': 'whole body'}                                    │ │\n",
+       "    │ │         {'symptom': 'chronic macular rash', 'affected_area': 'face'},                                   │ │\n",
+       "    │ │         {'symptom': 'itchy', 'affected_area': 'beard'},                                                 │ │\n",
+       "    │ │         {'symptom': 'flaky', 'affected_area': 'eyebrows'},                                              │ │\n",
+       "    │ │         {'symptom': 'slightly scaly', 'affected_area': 'nares'}                                         │ │\n",
        "    │ │     ],                                                                                                  │ │\n",
        "    │ │     'current_meds': [                                                                                   │ │\n",
-       "    │ │         {'medication': 'OTC STEROID CREAM', 'response': 'moderate response'}                            │ │\n",
+       "    │ │         {'medication': 'OTC STEROID CREAM', 'response': 'Moderate'}                                     │ │\n",
        "    │ │     ],                                                                                                  │ │\n",
-       "    │ │     'miscellaneous': 'patient has been using cream for 2 weeks and also suffers from diabetes'          │ │\n",
+       "    │ │     'miscellaneous': 'patient also suffers from diabetes'                                               │ │\n",
        "    │ │ }                                                                                                       │ │\n",
        "    │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │\n",
        "    ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n",
@@ -298,7 +326,7 @@
       "text/plain": [
        "Logs\n",
        "└── ╭────────────────────────────────────────────────── Step 0 ───────────────────────────────────────────────────╮\n",
-       "    │ \u001b[48;2;240;248;255m╭─\u001b[0m\u001b[48;2;240;248;255m───────────────────────────────────────────────\u001b[0m\u001b[48;2;240;248;255m Prompt \u001b[0m\u001b[48;2;240;248;255m────────────────────────────────────────────────\u001b[0m\u001b[48;2;240;248;255m─╮\u001b[0m │\n",
+       "    │ \u001b[48;2;240;248;255m╭─\u001b[0m\u001b[48;2;240;248;255m───────────────────────────────────────────────\u001b[0m Prompt \u001b[48;2;240;248;255m────────────────────────────────────────────────\u001b[0m\u001b[48;2;240;248;255m─╮\u001b[0m │\n",
        "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m                                                                                                       \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
        "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255mGiven the following doctor's notes about a patient, please extract a dictionary that contains the \u001b[0m\u001b[48;2;240;248;255m     \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
        "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255mpatient's information.\u001b[0m\u001b[48;2;240;248;255m                                                                                 \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
@@ -312,29 +340,32 @@
        "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255mit into.\u001b[0m\u001b[48;2;240;248;255m                                                                                               \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
        "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m                                                                                                       \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
        "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m\u001b[0m\u001b[48;2;240;248;255m                                                                                               \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
-       "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m    \u001b[0m\u001b[48;2;240;248;255m                                             \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
-       "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m    \u001b[0m\u001b[48;2;240;248;255m              \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
-       "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m    \u001b[0m\u001b[48;2;240;248;255m                                        \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
-       "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m        \u001b[0m\u001b[48;2;240;248;255m                                                                                       \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
-       "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m            \u001b[0m\u001b[48;2;240;248;255m              \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
-       "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m            \u001b[0m\u001b[48;2;240;248;255m                                                                                  \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
-       "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m        \u001b[0m\u001b[48;2;240;248;255m                                                                                      \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
-       "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m    \u001b[0m\u001b[48;2;240;248;255m                                                                                            \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
-       "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m    \u001b[0m\u001b[48;2;240;248;255m                                                                                             \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
-       "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m        \u001b[0m\u001b[48;2;240;248;255m                                                                                       \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
-       "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m            \u001b[0m\u001b[48;2;240;248;255m                                                                                  \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
-       "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m            \u001b[0m\u001b[48;2;240;248;255m    \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
-       "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m        \u001b[0m\u001b[48;2;240;248;255m                                                                                      \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
-       "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m    \u001b[0m\u001b[48;2;240;248;255m                                                                                            \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
-       "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m    \u001b[0m\u001b[48;2;240;248;255m         \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
+       "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m  \u001b[0m\u001b[48;2;240;248;255m                       \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
+       "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m  \u001b[0m\u001b[48;2;240;248;255m                                                                             \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
+       "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m  \u001b[0m\u001b[48;2;240;248;255m                          \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
+       "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m    \u001b[0m\u001b[48;2;240;248;255m                                                                           \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
+       "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m      \u001b[0m\u001b[48;2;240;248;255m                                                                              \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
+       "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m      \u001b[0m\u001b[48;2;240;248;255m                           \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
+       "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m    \u001b[0m\u001b[48;2;240;248;255m                                                                                          \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
+       "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m  \u001b[0m\u001b[48;2;240;248;255m                                                                                              \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
+       "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m  \u001b[0m\u001b[48;2;240;248;255m                                                                   \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
+       "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m    \u001b[0m\u001b[48;2;240;248;255m                                                                           \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
+       "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m      \u001b[0m\u001b[48;2;240;248;255m                                                            \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
+       "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m      \u001b[0m\u001b[48;2;240;248;255m                                                                              \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
+       "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m    \u001b[0m\u001b[48;2;240;248;255m                                                                                          \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
+       "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m  \u001b[0m\u001b[48;2;240;248;255m                                                                                              \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
+       "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m  \u001b[0m\u001b[48;2;240;248;255m                                                         \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
        "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m\u001b[0m\u001b[48;2;240;248;255m                                                                                              \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
        "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m                                                                                                       \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
-       "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m                                                                                                       \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
        "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255mONLY return a valid JSON object (no other text is necessary), where the key of the field in JSON is the\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
        "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m`name` attribute of the corresponding XML, and the value is of the type specified by the corresponding \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
        "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255mXML's tag. The JSON MUST conform to the XML format, including any types and format requests e.g. \u001b[0m\u001b[48;2;240;248;255m      \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
@@ -349,38 +380,54 @@
        "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m                                                                                                       \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
        "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m                                                                                                       \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
        "    │ \u001b[48;2;240;248;255m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m │\n",
-       "    │ \u001b[48;2;255;240;242m╭─\u001b[0m\u001b[48;2;255;240;242m────────────────────────────────────────────\u001b[0m\u001b[48;2;255;240;242m Instructions \u001b[0m\u001b[48;2;255;240;242m─────────────────────────────────────────────\u001b[0m\u001b[48;2;255;240;242m─╮\u001b[0m │\n",
-       "    │ \u001b[48;2;255;240;242m│\u001b[0m\u001b[48;2;255;240;242m \u001b[0m\u001b[48;2;255;240;242mYou are a helpful assistant, able to express yourself purely through JSON, strictly and precisely \u001b[0m\u001b[48;2;255;240;242m     \u001b[0m\u001b[48;2;255;240;242m \u001b[0m\u001b[48;2;255;240;242m│\u001b[0m │\n",
-       "    │ \u001b[48;2;255;240;242m│\u001b[0m\u001b[48;2;255;240;242m \u001b[0m\u001b[48;2;255;240;242madhering to the provided XML schemas.\u001b[0m\u001b[48;2;255;240;242m                                                                  \u001b[0m\u001b[48;2;255;240;242m \u001b[0m\u001b[48;2;255;240;242m│\u001b[0m │\n",
-       "    │ \u001b[48;2;255;240;242m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m │\n",
-       "    │ \u001b[48;2;231;223;235m╭─\u001b[0m\u001b[48;2;231;223;235m───────────────────────────────────────────\u001b[0m\u001b[48;2;231;223;235m Message History \u001b[0m\u001b[48;2;231;223;235m───────────────────────────────────────────\u001b[0m\u001b[48;2;231;223;235m─╮\u001b[0m │\n",
+       "    │ \u001b[48;2;231;223;235m╭─\u001b[0m\u001b[48;2;231;223;235m───────────────────────────────────────────\u001b[0m Message History \u001b[48;2;231;223;235m───────────────────────────────────────────\u001b[0m\u001b[48;2;231;223;235m─╮\u001b[0m │\n",
        "    │ \u001b[48;2;231;223;235m│\u001b[0m\u001b[48;2;231;223;235m \u001b[0m\u001b[48;2;231;223;235mNo message history.\u001b[0m\u001b[48;2;231;223;235m                                                                                    \u001b[0m\u001b[48;2;231;223;235m \u001b[0m\u001b[48;2;231;223;235m│\u001b[0m │\n",
        "    │ \u001b[48;2;231;223;235m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m │\n",
-       "    │ \u001b[48;2;245;245;220m╭─\u001b[0m\u001b[48;2;245;245;220m───────────────────────────────────────────\u001b[0m\u001b[48;2;245;245;220m Raw LLM Output \u001b[0m\u001b[48;2;245;245;220m────────────────────────────────────────────\u001b[0m\u001b[48;2;245;245;220m─╮\u001b[0m │\n",
-       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m{\"gender\":\"female\",\"age\":152,\"symptoms\":[{\"symptom\":\"chronic macular rash\",\"affected_area\":\"face and \u001b[0m\u001b[48;2;245;245;220m  \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
-       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220mhair, worse in beard, eyebrows and nares\"},{\"symptom\":\"itchy\",\"affected_area\":\"whole \u001b[0m\u001b[48;2;245;245;220m                  \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
-       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220mbody\"},{\"symptom\":\"flaky\",\"affected_area\":\"whole body\"},{\"symptom\":\"slightly \u001b[0m\u001b[48;2;245;245;220m                          \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
-       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220mscaly\",\"affected_area\":\"whole body\"}],\"current_meds\":[{\"medication\":\"OTC steroid \u001b[0m\u001b[48;2;245;245;220m                      \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
-       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220mcream\",\"response\":\"moderate response\"}],\"miscellaneous\":\"patient has been using cream for 2 weeks and \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
-       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220malso suffers from diabetes\"}\u001b[0m\u001b[48;2;245;245;220m                                                                           \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
+       "    │ \u001b[48;2;245;245;220m╭─\u001b[0m\u001b[48;2;245;245;220m───────────────────────────────────────────\u001b[0m Raw LLM Output \u001b[48;2;245;245;220m────────────────────────────────────────────\u001b[0m\u001b[48;2;245;245;220m─╮\u001b[0m │\n",
+       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m{\u001b[0m\u001b[48;2;245;245;220m                                                                                                      \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
+       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m    \"gender\": \"female\",\u001b[0m\u001b[48;2;245;245;220m                                                                                \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
+       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m    \"age\": 152,\u001b[0m\u001b[48;2;245;245;220m                                                                                        \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
+       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m    \"symptoms\": [\u001b[0m\u001b[48;2;245;245;220m                                                                                      \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
+       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m        {\u001b[0m\u001b[48;2;245;245;220m                                                                                              \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
+       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m            \"symptom\": \"chronic macular rash\",\u001b[0m\u001b[48;2;245;245;220m                                                         \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
+       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m            \"affected_area\": \"face\"\u001b[0m\u001b[48;2;245;245;220m                                                                    \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
+       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m        },\u001b[0m\u001b[48;2;245;245;220m                                                                                             \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
+       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m        {\u001b[0m\u001b[48;2;245;245;220m                                                                                              \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
+       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m            \"symptom\": \"itchy\",\u001b[0m\u001b[48;2;245;245;220m                                                                        \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
+       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m            \"affected_area\": \"beard\"\u001b[0m\u001b[48;2;245;245;220m                                                                   \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
+       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m        },\u001b[0m\u001b[48;2;245;245;220m                                                                                             \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
+       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m        {\u001b[0m\u001b[48;2;245;245;220m                                                                                              \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
+       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m            \"symptom\": \"flaky\",\u001b[0m\u001b[48;2;245;245;220m                                                                        \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
+       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m            \"affected_area\": \"eyebrows\"\u001b[0m\u001b[48;2;245;245;220m                                                                \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
+       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m        },\u001b[0m\u001b[48;2;245;245;220m                                                                                             \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
+       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m        {\u001b[0m\u001b[48;2;245;245;220m                                                                                              \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
+       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m            \"symptom\": \"slightly scaly\",\u001b[0m\u001b[48;2;245;245;220m                                                               \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
+       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m            \"affected_area\": \"nares\"\u001b[0m\u001b[48;2;245;245;220m                                                                   \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
+       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m        }\u001b[0m\u001b[48;2;245;245;220m                                                                                              \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
+       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m    ],\u001b[0m\u001b[48;2;245;245;220m                                                                                                 \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
+       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m    \"current_meds\": [\u001b[0m\u001b[48;2;245;245;220m                                                                                  \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
+       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m        {\u001b[0m\u001b[48;2;245;245;220m                                                                                              \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
+       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m            \"medication\": \"OTC steroid cream\",\u001b[0m\u001b[48;2;245;245;220m                                                         \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
+       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m            \"response\": \"Moderate\"\u001b[0m\u001b[48;2;245;245;220m                                                                     \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
+       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m        }\u001b[0m\u001b[48;2;245;245;220m                                                                                              \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
+       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m    ],\u001b[0m\u001b[48;2;245;245;220m                                                                                                 \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
+       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m    \"miscellaneous\": \"patient also suffers from diabetes\"\u001b[0m\u001b[48;2;245;245;220m                                              \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
+       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m}\u001b[0m\u001b[48;2;245;245;220m                                                                                                      \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
        "    │ \u001b[48;2;245;245;220m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m │\n",
-       "    │ \u001b[48;2;240;255;240m╭─\u001b[0m\u001b[48;2;240;255;240m──────────────────────────────────────────\u001b[0m\u001b[48;2;240;255;240m Validated Output \u001b[0m\u001b[48;2;240;255;240m───────────────────────────────────────────\u001b[0m\u001b[48;2;240;255;240m─╮\u001b[0m │\n",
+       "    │ \u001b[48;2;240;255;240m╭─\u001b[0m\u001b[48;2;240;255;240m──────────────────────────────────────────\u001b[0m Validated Output \u001b[48;2;240;255;240m───────────────────────────────────────────\u001b[0m\u001b[48;2;240;255;240m─╮\u001b[0m │\n",
        "    │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m{\u001b[0m\u001b[48;2;240;255;240m                                                                                                      \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
        "    │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m    'gender': 'female',\u001b[0m\u001b[48;2;240;255;240m                                                                                \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
        "    │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m    'age': 100,\u001b[0m\u001b[48;2;240;255;240m                                                                                        \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
        "    │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m    'symptoms': [\u001b[0m\u001b[48;2;240;255;240m                                                                                      \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
-       "    │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m        {\u001b[0m\u001b[48;2;240;255;240m                                                                                              \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
-       "    │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m            'symptom': 'chronic macular rash',\u001b[0m\u001b[48;2;240;255;240m                                                         \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
-       "    │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m            'affected_area': 'face and hair, worse in beard, eyebrows and nares'\u001b[0m\u001b[48;2;240;255;240m                       \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
-       "    │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m        },\u001b[0m\u001b[48;2;240;255;240m                                                                                             \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
-       "    │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m        {'symptom': 'itchy', 'affected_area': 'whole body'},\u001b[0m\u001b[48;2;240;255;240m                                           \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
-       "    │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m        {'symptom': 'flaky', 'affected_area': 'whole body'},\u001b[0m\u001b[48;2;240;255;240m                                           \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
-       "    │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m        {'symptom': 'slightly scaly', 'affected_area': 'whole body'}\u001b[0m\u001b[48;2;240;255;240m                                   \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
+       "    │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m        {'symptom': 'chronic macular rash', 'affected_area': 'face'},\u001b[0m\u001b[48;2;240;255;240m                                  \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
+       "    │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m        {'symptom': 'itchy', 'affected_area': 'beard'},\u001b[0m\u001b[48;2;240;255;240m                                                \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
+       "    │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m        {'symptom': 'flaky', 'affected_area': 'eyebrows'},\u001b[0m\u001b[48;2;240;255;240m                                             \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
+       "    │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m        {'symptom': 'slightly scaly', 'affected_area': 'nares'}\u001b[0m\u001b[48;2;240;255;240m                                        \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
        "    │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m    ],\u001b[0m\u001b[48;2;240;255;240m                                                                                                 \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
        "    │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m    'current_meds': [\u001b[0m\u001b[48;2;240;255;240m                                                                                  \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
-       "    │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m        {'medication': 'OTC STEROID CREAM', 'response': 'moderate response'}\u001b[0m\u001b[48;2;240;255;240m                           \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
+       "    │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m        {'medication': 'OTC STEROID CREAM', 'response': 'Moderate'}\u001b[0m\u001b[48;2;240;255;240m                                    \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
        "    │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m    ],\u001b[0m\u001b[48;2;240;255;240m                                                                                                 \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
-       "    │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m    'miscellaneous': 'patient has been using cream for 2 weeks and also suffers from diabetes'\u001b[0m\u001b[48;2;240;255;240m         \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
+       "    │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m    'miscellaneous': 'patient also suffers from diabetes'\u001b[0m\u001b[48;2;240;255;240m                                              \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
        "    │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m}\u001b[0m\u001b[48;2;240;255;240m                                                                                                      \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
        "    │ \u001b[48;2;240;255;240m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m │\n",
        "    ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n"
@@ -406,39 +453,32 @@
   },
   {
    "cell_type": "code",
-   "execution_count": null,
+   "execution_count": 10,
    "metadata": {},
    "outputs": [
     {
      "data": {
       "text/html": [
        "
ValidationOutcome(\n",
-       "    raw_llm_output='{\\n    \"gender\": \"female\",\\n    \"age\": 52,\\n    \"symptoms\": [\\n        {\\n            \n",
+       "    call_id='129880225863456',\n",
+       "    raw_llm_output='{\\n    \"gender\": \"female\",\\n    \"age\": 152,\\n    \"symptoms\": [\\n        {\\n            \n",
        "\"symptom\": \"chronic macular rash\",\\n            \"affected_area\": \"face\"\\n        },\\n        {\\n            \n",
-       "\"symptom\": \"chronic macular rash\",\\n            \"affected_area\": \"hair\"\\n        },\\n        {\\n            \n",
-       "\"symptom\": \"itchy rash\",\\n            \"affected_area\": \"beard\"\\n        },\\n        {\\n            \"symptom\": \n",
-       "\"itchy rash\",\\n            \"affected_area\": \"eyebrows\"\\n        },\\n        {\\n            \"symptom\": \"itchy \n",
-       "rash\",\\n            \"affected_area\": \"nares\"\\n        },\\n        {\\n            \"symptom\": \"flaky rash\",\\n        \n",
-       "\"affected_area\": \"face\"\\n        },\\n        {\\n            \"symptom\": \"flaky rash\",\\n            \"affected_area\": \n",
-       "\"hair\"\\n        },\\n        {\\n            \"symptom\": \"slightly scaly rash\",\\n            \"affected_area\": \"face\"\\n\n",
-       "},\\n        {\\n            \"symptom\": \"slightly scaly rash\",\\n            \"affected_area\": \"hair\"\\n        }\\n    \n",
-       "],\\n    \"current_meds\": [\\n        {\\n            \"medication\": \"OTC STEROID CREAM\",\\n            \"response\": \n",
-       "\"moderate response\"\\n        }\\n    ],\\n    \"miscellaneous\": \"patient also suffers from diabetes\"\\n}',\n",
+       "\"symptom\": \"itchy\",\\n            \"affected_area\": \"beard\"\\n        },\\n        {\\n            \"symptom\": \"flaky\",\\n\n",
+       "\"affected_area\": \"eyebrows\"\\n        },\\n        {\\n            \"symptom\": \"slightly scaly\",\\n            \n",
+       "\"affected_area\": \"nares\"\\n        }\\n    ],\\n    \"current_meds\": [\\n        {\\n            \"medication\": \"OTC \n",
+       "steroid cream\",\\n            \"response\": \"Moderate\"\\n        }\\n    ],\\n    \"miscellaneous\": \"patient also suffers \n",
+       "from diabetes\"\\n}',\n",
+       "    validation_summaries=None,\n",
        "    validated_output={\n",
        "        'gender': 'female',\n",
-       "        'age': 52,\n",
+       "        'age': 100,\n",
        "        'symptoms': [\n",
        "            {'symptom': 'chronic macular rash', 'affected_area': 'face'},\n",
-       "            {'symptom': 'chronic macular rash', 'affected_area': 'hair'},\n",
-       "            {'symptom': 'itchy rash', 'affected_area': 'beard'},\n",
-       "            {'symptom': 'itchy rash', 'affected_area': 'eyebrows'},\n",
-       "            {'symptom': 'itchy rash', 'affected_area': 'nares'},\n",
-       "            {'symptom': 'flaky rash', 'affected_area': 'face'},\n",
-       "            {'symptom': 'flaky rash', 'affected_area': 'hair'},\n",
-       "            {'symptom': 'slightly scaly rash', 'affected_area': 'face'},\n",
-       "            {'symptom': 'slightly scaly rash', 'affected_area': 'hair'}\n",
+       "            {'symptom': 'itchy', 'affected_area': 'beard'},\n",
+       "            {'symptom': 'flaky', 'affected_area': 'eyebrows'},\n",
+       "            {'symptom': 'slightly scaly', 'affected_area': 'nares'}\n",
        "        ],\n",
-       "        'current_meds': [{'medication': 'OTC STEROID CREAM', 'response': 'moderate response'}],\n",
+       "        'current_meds': [{'medication': 'OTC STEROID CREAM', 'response': 'Moderate'}],\n",
        "        'miscellaneous': 'patient also suffers from diabetes'\n",
        "    },\n",
        "    reask=None,\n",
@@ -449,32 +489,25 @@
       ],
       "text/plain": [
        "\u001b[1;35mValidationOutcome\u001b[0m\u001b[1m(\u001b[0m\n",
-       "    \u001b[33mraw_llm_output\u001b[0m=\u001b[32m'\u001b[0m\u001b[32m{\u001b[0m\u001b[32m\\n    \"gender\": \"female\",\\n    \"age\": 52,\\n    \"symptoms\": \u001b[0m\u001b[32m[\u001b[0m\u001b[32m\\n        \u001b[0m\u001b[32m{\u001b[0m\u001b[32m\\n            \u001b[0m\n",
+       "    \u001b[33mcall_id\u001b[0m=\u001b[32m'129880225863456'\u001b[0m,\n",
+       "    \u001b[33mraw_llm_output\u001b[0m=\u001b[32m'\u001b[0m\u001b[32m{\u001b[0m\u001b[32m\\n    \"gender\": \"female\",\\n    \"age\": 152,\\n    \"symptoms\": \u001b[0m\u001b[32m[\u001b[0m\u001b[32m\\n        \u001b[0m\u001b[32m{\u001b[0m\u001b[32m\\n            \u001b[0m\n",
        "\u001b[32m\"symptom\": \"chronic macular rash\",\\n            \"affected_area\": \"face\"\\n        \u001b[0m\u001b[32m}\u001b[0m\u001b[32m,\\n        \u001b[0m\u001b[32m{\u001b[0m\u001b[32m\\n            \u001b[0m\n",
-       "\u001b[32m\"symptom\": \"chronic macular rash\",\\n            \"affected_area\": \"hair\"\\n        \u001b[0m\u001b[32m}\u001b[0m\u001b[32m,\\n        \u001b[0m\u001b[32m{\u001b[0m\u001b[32m\\n            \u001b[0m\n",
-       "\u001b[32m\"symptom\": \"itchy rash\",\\n            \"affected_area\": \"beard\"\\n        \u001b[0m\u001b[32m}\u001b[0m\u001b[32m,\\n        \u001b[0m\u001b[32m{\u001b[0m\u001b[32m\\n            \"symptom\": \u001b[0m\n",
-       "\u001b[32m\"itchy rash\",\\n            \"affected_area\": \"eyebrows\"\\n        \u001b[0m\u001b[32m}\u001b[0m\u001b[32m,\\n        \u001b[0m\u001b[32m{\u001b[0m\u001b[32m\\n            \"symptom\": \"itchy \u001b[0m\n",
-       "\u001b[32mrash\",\\n            \"affected_area\": \"nares\"\\n        \u001b[0m\u001b[32m}\u001b[0m\u001b[32m,\\n        \u001b[0m\u001b[32m{\u001b[0m\u001b[32m\\n            \"symptom\": \"flaky rash\",\\n        \u001b[0m\n",
-       "\u001b[32m\"affected_area\": \"face\"\\n        \u001b[0m\u001b[32m}\u001b[0m\u001b[32m,\\n        \u001b[0m\u001b[32m{\u001b[0m\u001b[32m\\n            \"symptom\": \"flaky rash\",\\n            \"affected_area\": \u001b[0m\n",
-       "\u001b[32m\"hair\"\\n        \u001b[0m\u001b[32m}\u001b[0m\u001b[32m,\\n        \u001b[0m\u001b[32m{\u001b[0m\u001b[32m\\n            \"symptom\": \"slightly scaly rash\",\\n            \"affected_area\": \"face\"\\n\u001b[0m\n",
-       "\u001b[32m}\u001b[0m\u001b[32m,\\n        \u001b[0m\u001b[32m{\u001b[0m\u001b[32m\\n            \"symptom\": \"slightly scaly rash\",\\n            \"affected_area\": \"hair\"\\n        \u001b[0m\u001b[32m}\u001b[0m\u001b[32m\\n    \u001b[0m\n",
-       "\u001b[32m]\u001b[0m\u001b[32m,\\n    \"current_meds\": \u001b[0m\u001b[32m[\u001b[0m\u001b[32m\\n        \u001b[0m\u001b[32m{\u001b[0m\u001b[32m\\n            \"medication\": \"OTC STEROID CREAM\",\\n            \"response\": \u001b[0m\n",
-       "\u001b[32m\"moderate response\"\\n        \u001b[0m\u001b[32m}\u001b[0m\u001b[32m\\n    \u001b[0m\u001b[32m]\u001b[0m\u001b[32m,\\n    \"miscellaneous\": \"patient also suffers from diabetes\"\\n\u001b[0m\u001b[32m}\u001b[0m\u001b[32m'\u001b[0m,\n",
+       "\u001b[32m\"symptom\": \"itchy\",\\n            \"affected_area\": \"beard\"\\n        \u001b[0m\u001b[32m}\u001b[0m\u001b[32m,\\n        \u001b[0m\u001b[32m{\u001b[0m\u001b[32m\\n            \"symptom\": \"flaky\",\\n\u001b[0m\n",
+       "\u001b[32m\"affected_area\": \"eyebrows\"\\n        \u001b[0m\u001b[32m}\u001b[0m\u001b[32m,\\n        \u001b[0m\u001b[32m{\u001b[0m\u001b[32m\\n            \"symptom\": \"slightly scaly\",\\n            \u001b[0m\n",
+       "\u001b[32m\"affected_area\": \"nares\"\\n        \u001b[0m\u001b[32m}\u001b[0m\u001b[32m\\n    \u001b[0m\u001b[32m]\u001b[0m\u001b[32m,\\n    \"current_meds\": \u001b[0m\u001b[32m[\u001b[0m\u001b[32m\\n        \u001b[0m\u001b[32m{\u001b[0m\u001b[32m\\n            \"medication\": \"OTC \u001b[0m\n",
+       "\u001b[32msteroid cream\",\\n            \"response\": \"Moderate\"\\n        \u001b[0m\u001b[32m}\u001b[0m\u001b[32m\\n    \u001b[0m\u001b[32m]\u001b[0m\u001b[32m,\\n    \"miscellaneous\": \"patient also suffers \u001b[0m\n",
+       "\u001b[32mfrom diabetes\"\\n\u001b[0m\u001b[32m}\u001b[0m\u001b[32m'\u001b[0m,\n",
+       "    \u001b[33mvalidation_summaries\u001b[0m=\u001b[3;35mNone\u001b[0m,\n",
        "    \u001b[33mvalidated_output\u001b[0m=\u001b[1m{\u001b[0m\n",
        "        \u001b[32m'gender'\u001b[0m: \u001b[32m'female'\u001b[0m,\n",
-       "        \u001b[32m'age'\u001b[0m: \u001b[1;36m52\u001b[0m,\n",
+       "        \u001b[32m'age'\u001b[0m: \u001b[1;36m100\u001b[0m,\n",
        "        \u001b[32m'symptoms'\u001b[0m: \u001b[1m[\u001b[0m\n",
        "            \u001b[1m{\u001b[0m\u001b[32m'symptom'\u001b[0m: \u001b[32m'chronic macular rash'\u001b[0m, \u001b[32m'affected_area'\u001b[0m: \u001b[32m'face'\u001b[0m\u001b[1m}\u001b[0m,\n",
-       "            \u001b[1m{\u001b[0m\u001b[32m'symptom'\u001b[0m: \u001b[32m'chronic macular rash'\u001b[0m, \u001b[32m'affected_area'\u001b[0m: \u001b[32m'hair'\u001b[0m\u001b[1m}\u001b[0m,\n",
-       "            \u001b[1m{\u001b[0m\u001b[32m'symptom'\u001b[0m: \u001b[32m'itchy rash'\u001b[0m, \u001b[32m'affected_area'\u001b[0m: \u001b[32m'beard'\u001b[0m\u001b[1m}\u001b[0m,\n",
-       "            \u001b[1m{\u001b[0m\u001b[32m'symptom'\u001b[0m: \u001b[32m'itchy rash'\u001b[0m, \u001b[32m'affected_area'\u001b[0m: \u001b[32m'eyebrows'\u001b[0m\u001b[1m}\u001b[0m,\n",
-       "            \u001b[1m{\u001b[0m\u001b[32m'symptom'\u001b[0m: \u001b[32m'itchy rash'\u001b[0m, \u001b[32m'affected_area'\u001b[0m: \u001b[32m'nares'\u001b[0m\u001b[1m}\u001b[0m,\n",
-       "            \u001b[1m{\u001b[0m\u001b[32m'symptom'\u001b[0m: \u001b[32m'flaky rash'\u001b[0m, \u001b[32m'affected_area'\u001b[0m: \u001b[32m'face'\u001b[0m\u001b[1m}\u001b[0m,\n",
-       "            \u001b[1m{\u001b[0m\u001b[32m'symptom'\u001b[0m: \u001b[32m'flaky rash'\u001b[0m, \u001b[32m'affected_area'\u001b[0m: \u001b[32m'hair'\u001b[0m\u001b[1m}\u001b[0m,\n",
-       "            \u001b[1m{\u001b[0m\u001b[32m'symptom'\u001b[0m: \u001b[32m'slightly scaly rash'\u001b[0m, \u001b[32m'affected_area'\u001b[0m: \u001b[32m'face'\u001b[0m\u001b[1m}\u001b[0m,\n",
-       "            \u001b[1m{\u001b[0m\u001b[32m'symptom'\u001b[0m: \u001b[32m'slightly scaly rash'\u001b[0m, \u001b[32m'affected_area'\u001b[0m: \u001b[32m'hair'\u001b[0m\u001b[1m}\u001b[0m\n",
+       "            \u001b[1m{\u001b[0m\u001b[32m'symptom'\u001b[0m: \u001b[32m'itchy'\u001b[0m, \u001b[32m'affected_area'\u001b[0m: \u001b[32m'beard'\u001b[0m\u001b[1m}\u001b[0m,\n",
+       "            \u001b[1m{\u001b[0m\u001b[32m'symptom'\u001b[0m: \u001b[32m'flaky'\u001b[0m, \u001b[32m'affected_area'\u001b[0m: \u001b[32m'eyebrows'\u001b[0m\u001b[1m}\u001b[0m,\n",
+       "            \u001b[1m{\u001b[0m\u001b[32m'symptom'\u001b[0m: \u001b[32m'slightly scaly'\u001b[0m, \u001b[32m'affected_area'\u001b[0m: \u001b[32m'nares'\u001b[0m\u001b[1m}\u001b[0m\n",
        "        \u001b[1m]\u001b[0m,\n",
-       "        \u001b[32m'current_meds'\u001b[0m: \u001b[1m[\u001b[0m\u001b[1m{\u001b[0m\u001b[32m'medication'\u001b[0m: \u001b[32m'OTC STEROID CREAM'\u001b[0m, \u001b[32m'response'\u001b[0m: \u001b[32m'moderate response'\u001b[0m\u001b[1m}\u001b[0m\u001b[1m]\u001b[0m,\n",
+       "        \u001b[32m'current_meds'\u001b[0m: \u001b[1m[\u001b[0m\u001b[1m{\u001b[0m\u001b[32m'medication'\u001b[0m: \u001b[32m'OTC STEROID CREAM'\u001b[0m, \u001b[32m'response'\u001b[0m: \u001b[32m'Moderate'\u001b[0m\u001b[1m}\u001b[0m\u001b[1m]\u001b[0m,\n",
        "        \u001b[32m'miscellaneous'\u001b[0m: \u001b[32m'patient also suffers from diabetes'\u001b[0m\n",
        "    \u001b[1m}\u001b[0m,\n",
        "    \u001b[33mreask\u001b[0m=\u001b[3;35mNone\u001b[0m,\n",
@@ -507,7 +540,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": null,
+   "execution_count": 11,
    "metadata": {},
    "outputs": [
     {
@@ -515,7 +548,7 @@
       "text/html": [
        "
Logs\n",
        "└── ╭────────────────────────────────────────────────── Step 0 ───────────────────────────────────────────────────╮\n",
-       "    │ ╭──────────────────────────────────────────────── Prompt ─────────────────────────────────────────────────╮ │\n",
+       "    │ ╭──────────────────────────────────────────────── Prompt ─────────────────────────────────────────────────╮ │\n",
        "    │ │                                                                                                         │ │\n",
        "    │ │ Given the following doctor's notes about a patient, please extract a dictionary that contains the       │ │\n",
        "    │ │ patient's information.                                                                                  │ │\n",
@@ -529,29 +562,32 @@
        "    │ │ it into.                                                                                                │ │\n",
        "    │ │                                                                                                         │ │\n",
        "    │ │ <output>                                                                                                │ │\n",
-       "    │ │     <string name=\"gender\" description=\"Patient's gender\"/>                                              │ │\n",
-       "    │ │     <integer name=\"age\" description=\"Patient's age\" format=\"valid-range: min=0 max=100\"/>               │ │\n",
-       "    │ │     <list name=\"symptoms\" description=\"Symptoms that the patient is currently experiencing. Each        │ │\n",
-       "    │ │ symptom should be classified into  separate item in the list.\">                                         │ │\n",
-       "    │ │         <object>                                                                                        │ │\n",
-       "    │ │             <string name=\"symptom\" description=\"Symptom that a patient is experiencing\"/>               │ │\n",
-       "    │ │             <string name=\"affected_area\" description=\"What part of the body the symptom is affecting\"   │ │\n",
-       "    │ │ format=\"lower-case\"/>                                                                                   │ │\n",
-       "    │ │         </object>                                                                                       │ │\n",
-       "    │ │     </list>                                                                                             │ │\n",
-       "    │ │     <list name=\"current_meds\" description=\"Medications the patient is currently taking and their        │ │\n",
-       "    │ │ response\">                                                                                              │ │\n",
-       "    │ │         <object>                                                                                        │ │\n",
-       "    │ │             <string name=\"medication\" description=\"Name of the medication the patient is taking\"        │ │\n",
-       "    │ │ format=\"upper-case\"/>                                                                                   │ │\n",
-       "    │ │             <string name=\"response\" description=\"How the patient is responding to the medication\"/>     │ │\n",
-       "    │ │         </object>                                                                                       │ │\n",
-       "    │ │     </list>                                                                                             │ │\n",
-       "    │ │     <string name=\"miscellaneous\" description=\"Any other information that is relevant to the patient's   │ │\n",
-       "    │ │ health; something that doesn't fit into the other categories.\" format=\"lower-case; one-line\"/>          │ │\n",
+       "    │ │   <string description=\"Patient's gender\" name=\"gender\" required=\"true\"></string>                        │ │\n",
+       "    │ │   <integer description=\"Patient's age\" format=\"guardrails/valid_range: 0 100\" name=\"age\"                │ │\n",
+       "    │ │ required=\"true\"></integer>                                                                              │ │\n",
+       "    │ │   <list description=\"Symptoms that the patient is currently experiencing. Each symptom should be        │ │\n",
+       "    │ │ classified into  separate item in the list.\" name=\"symptoms\" required=\"true\">                           │ │\n",
+       "    │ │     <object required=\"true\">                                                                            │ │\n",
+       "    │ │       <string description=\"Symptom that a patient is experiencing\" name=\"symptom\"                       │ │\n",
+       "    │ │ required=\"true\"></string>                                                                               │ │\n",
+       "    │ │       <string description=\"What part of the body the symptom is affecting\"                              │ │\n",
+       "    │ │ format=\"guardrails/lowercase\" name=\"affected_area\" required=\"true\"></string>                            │ │\n",
+       "    │ │     </object>                                                                                           │ │\n",
+       "    │ │   </list>                                                                                               │ │\n",
+       "    │ │   <list description=\"Medications the patient is currently taking and their response\"                    │ │\n",
+       "    │ │ name=\"current_meds\" required=\"true\">                                                                    │ │\n",
+       "    │ │     <object required=\"true\">                                                                            │ │\n",
+       "    │ │       <string description=\"Name of the medication the patient is taking\" format=\"guardrails/uppercase\"  │ │\n",
+       "    │ │ name=\"medication\" required=\"true\"></string>                                                             │ │\n",
+       "    │ │       <string description=\"How the patient is responding to the medication\" name=\"response\"             │ │\n",
+       "    │ │ required=\"true\"></string>                                                                               │ │\n",
+       "    │ │     </object>                                                                                           │ │\n",
+       "    │ │   </list>                                                                                               │ │\n",
+       "    │ │   <string description=\"Any other information that is relevant to the patient's health; something that   │ │\n",
+       "    │ │ doesn't fit into the other categories.\" format=\"guardrails/lowercase; guardrails/one_line\"              │ │\n",
+       "    │ │ name=\"miscellaneous\" required=\"true\"></string>                                                          │ │\n",
        "    │ │ </output>                                                                                               │ │\n",
        "    │ │                                                                                                         │ │\n",
-       "    │ │                                                                                                         │ │\n",
        "    │ │ ONLY return a valid JSON object (no other text is necessary), where the key of the field in JSON is the │ │\n",
        "    │ │ `name` attribute of the corresponding XML, and the value is of the type specified by the corresponding  │ │\n",
        "    │ │ XML's tag. The JSON MUST conform to the XML format, including any types and format requests e.g.        │ │\n",
@@ -566,81 +602,24 @@
        "    │ │                                                                                                         │ │\n",
        "    │ │                                                                                                         │ │\n",
        "    │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │\n",
-       "    │ ╭───────────────────────────────────────────── Instructions ──────────────────────────────────────────────╮ │\n",
-       "    │ │ You are a helpful assistant, able to express yourself purely through JSON, strictly and precisely       │ │\n",
-       "    │ │ adhering to the provided XML schemas.                                                                   │ │\n",
-       "    │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │\n",
-       "    │ ╭──────────────────────────────────────────── Message History ────────────────────────────────────────────╮ │\n",
+       "    │ ╭──────────────────────────────────────────── Message History ────────────────────────────────────────────╮ │\n",
        "    │ │ No message history.                                                                                     │ │\n",
        "    │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │\n",
-       "    │ ╭──────────────────────────────────────────── Raw LLM Output ─────────────────────────────────────────────╮ │\n",
-       "    │ │ {                                                                                                       │ │\n",
-       "    │ │     \"gender\": \"female\",                                                                                 │ │\n",
-       "    │ │     \"age\": 52,                                                                                          │ │\n",
-       "    │ │     \"symptoms\": [                                                                                       │ │\n",
-       "    │ │         {                                                                                               │ │\n",
-       "    │ │             \"symptom\": \"chronic macular rash\",                                                          │ │\n",
-       "    │ │             \"affected_area\": \"face\"                                                                     │ │\n",
-       "    │ │         },                                                                                              │ │\n",
-       "    │ │         {                                                                                               │ │\n",
-       "    │ │             \"symptom\": \"chronic macular rash\",                                                          │ │\n",
-       "    │ │             \"affected_area\": \"hair\"                                                                     │ │\n",
-       "    │ │         },                                                                                              │ │\n",
-       "    │ │         {                                                                                               │ │\n",
-       "    │ │             \"symptom\": \"itchy rash\",                                                                    │ │\n",
-       "    │ │             \"affected_area\": \"beard\"                                                                    │ │\n",
-       "    │ │         },                                                                                              │ │\n",
-       "    │ │         {                                                                                               │ │\n",
-       "    │ │             \"symptom\": \"itchy rash\",                                                                    │ │\n",
-       "    │ │             \"affected_area\": \"eyebrows\"                                                                 │ │\n",
-       "    │ │         },                                                                                              │ │\n",
-       "    │ │         {                                                                                               │ │\n",
-       "    │ │             \"symptom\": \"itchy rash\",                                                                    │ │\n",
-       "    │ │             \"affected_area\": \"nares\"                                                                    │ │\n",
-       "    │ │         },                                                                                              │ │\n",
-       "    │ │         {                                                                                               │ │\n",
-       "    │ │             \"symptom\": \"flaky rash\",                                                                    │ │\n",
-       "    │ │             \"affected_area\": \"face\"                                                                     │ │\n",
-       "    │ │         },                                                                                              │ │\n",
-       "    │ │         {                                                                                               │ │\n",
-       "    │ │             \"symptom\": \"flaky rash\",                                                                    │ │\n",
-       "    │ │             \"affected_area\": \"hair\"                                                                     │ │\n",
-       "    │ │         },                                                                                              │ │\n",
-       "    │ │         {                                                                                               │ │\n",
-       "    │ │             \"symptom\": \"slightly scaly rash\",                                                           │ │\n",
-       "    │ │             \"affected_area\": \"face\"                                                                     │ │\n",
-       "    │ │         },                                                                                              │ │\n",
-       "    │ │         {                                                                                               │ │\n",
-       "    │ │             \"symptom\": \"slightly scaly rash\",                                                           │ │\n",
-       "    │ │             \"affected_area\": \"hair\"                                                                     │ │\n",
-       "    │ │         }                                                                                               │ │\n",
-       "    │ │     ],                                                                                                  │ │\n",
-       "    │ │     \"current_meds\": [                                                                                   │ │\n",
-       "    │ │         {                                                                                               │ │\n",
-       "    │ │             \"medication\": \"OTC STEROID CREAM\",                                                          │ │\n",
-       "    │ │             \"response\": \"moderate response\"                                                             │ │\n",
-       "    │ │         }                                                                                               │ │\n",
-       "    │ │     ],                                                                                                  │ │\n",
-       "    │ │     \"miscellaneous\": \"patient also suffers from diabetes\"                                               │ │\n",
-       "    │ │ }                                                                                                       │ │\n",
+       "    │ ╭──────────────────────────────────────────── Raw LLM Output ─────────────────────────────────────────────╮ │\n",
+       "    │ │                                                                                                         │ │\n",
        "    │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │\n",
-       "    │ ╭─────────────────────────────────────────── Validated Output ────────────────────────────────────────────╮ │\n",
+       "    │ ╭─────────────────────────────────────────── Validated Output ────────────────────────────────────────────╮ │\n",
        "    │ │ {                                                                                                       │ │\n",
        "    │ │     'gender': 'female',                                                                                 │ │\n",
-       "    │ │     'age': 52,                                                                                          │ │\n",
+       "    │ │     'age': 100,                                                                                         │ │\n",
        "    │ │     'symptoms': [                                                                                       │ │\n",
        "    │ │         {'symptom': 'chronic macular rash', 'affected_area': 'face'},                                   │ │\n",
-       "    │ │         {'symptom': 'chronic macular rash', 'affected_area': 'hair'},                                   │ │\n",
-       "    │ │         {'symptom': 'itchy rash', 'affected_area': 'beard'},                                            │ │\n",
-       "    │ │         {'symptom': 'itchy rash', 'affected_area': 'eyebrows'},                                         │ │\n",
-       "    │ │         {'symptom': 'itchy rash', 'affected_area': 'nares'},                                            │ │\n",
-       "    │ │         {'symptom': 'flaky rash', 'affected_area': 'face'},                                             │ │\n",
-       "    │ │         {'symptom': 'flaky rash', 'affected_area': 'hair'},                                             │ │\n",
-       "    │ │         {'symptom': 'slightly scaly rash', 'affected_area': 'face'},                                    │ │\n",
-       "    │ │         {'symptom': 'slightly scaly rash', 'affected_area': 'hair'}                                     │ │\n",
+       "    │ │         {'symptom': 'itchy', 'affected_area': 'beard'},                                                 │ │\n",
+       "    │ │         {'symptom': 'flaky', 'affected_area': 'eyebrows'},                                              │ │\n",
+       "    │ │         {'symptom': 'slightly scaly', 'affected_area': 'nares'}                                         │ │\n",
        "    │ │     ],                                                                                                  │ │\n",
        "    │ │     'current_meds': [                                                                                   │ │\n",
-       "    │ │         {'medication': 'OTC STEROID CREAM', 'response': 'moderate response'}                            │ │\n",
+       "    │ │         {'medication': 'OTC STEROID CREAM', 'response': 'Moderate'}                                     │ │\n",
        "    │ │     ],                                                                                                  │ │\n",
        "    │ │     'miscellaneous': 'patient also suffers from diabetes'                                               │ │\n",
        "    │ │ }                                                                                                       │ │\n",
@@ -651,7 +630,7 @@
       "text/plain": [
        "Logs\n",
        "└── ╭────────────────────────────────────────────────── Step 0 ───────────────────────────────────────────────────╮\n",
-       "    │ \u001b[48;2;240;248;255m╭─\u001b[0m\u001b[48;2;240;248;255m───────────────────────────────────────────────\u001b[0m\u001b[48;2;240;248;255m Prompt \u001b[0m\u001b[48;2;240;248;255m────────────────────────────────────────────────\u001b[0m\u001b[48;2;240;248;255m─╮\u001b[0m │\n",
+       "    │ \u001b[48;2;240;248;255m╭─\u001b[0m\u001b[48;2;240;248;255m───────────────────────────────────────────────\u001b[0m Prompt \u001b[48;2;240;248;255m────────────────────────────────────────────────\u001b[0m\u001b[48;2;240;248;255m─╮\u001b[0m │\n",
        "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m                                                                                                       \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
        "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255mGiven the following doctor's notes about a patient, please extract a dictionary that contains the \u001b[0m\u001b[48;2;240;248;255m     \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
        "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255mpatient's information.\u001b[0m\u001b[48;2;240;248;255m                                                                                 \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
@@ -665,29 +644,32 @@
        "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255mit into.\u001b[0m\u001b[48;2;240;248;255m                                                                                               \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
        "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m                                                                                                       \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
        "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m\u001b[0m\u001b[48;2;240;248;255m                                                                                               \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
-       "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m    \u001b[0m\u001b[48;2;240;248;255m                                             \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
-       "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m    \u001b[0m\u001b[48;2;240;248;255m              \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
-       "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m    \u001b[0m\u001b[48;2;240;248;255m                                        \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
-       "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m        \u001b[0m\u001b[48;2;240;248;255m                                                                                       \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
-       "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m            \u001b[0m\u001b[48;2;240;248;255m              \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
-       "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m            \u001b[0m\u001b[48;2;240;248;255m                                                                                  \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
-       "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m        \u001b[0m\u001b[48;2;240;248;255m                                                                                      \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
-       "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m    \u001b[0m\u001b[48;2;240;248;255m                                                                                            \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
-       "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m    \u001b[0m\u001b[48;2;240;248;255m                                                                                             \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
-       "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m        \u001b[0m\u001b[48;2;240;248;255m                                                                                       \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
-       "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m            \u001b[0m\u001b[48;2;240;248;255m                                                                                  \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
-       "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m            \u001b[0m\u001b[48;2;240;248;255m    \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
-       "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m        \u001b[0m\u001b[48;2;240;248;255m                                                                                      \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
-       "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m    \u001b[0m\u001b[48;2;240;248;255m                                                                                            \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
-       "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m    \u001b[0m\u001b[48;2;240;248;255m         \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
+       "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m  \u001b[0m\u001b[48;2;240;248;255m                       \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
+       "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m  \u001b[0m\u001b[48;2;240;248;255m                                                                             \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
+       "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m  \u001b[0m\u001b[48;2;240;248;255m                          \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
+       "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m    \u001b[0m\u001b[48;2;240;248;255m                                                                           \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
+       "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m      \u001b[0m\u001b[48;2;240;248;255m                                                                              \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
+       "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m      \u001b[0m\u001b[48;2;240;248;255m                           \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
+       "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m    \u001b[0m\u001b[48;2;240;248;255m                                                                                          \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
+       "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m  \u001b[0m\u001b[48;2;240;248;255m                                                                                              \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
+       "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m  \u001b[0m\u001b[48;2;240;248;255m                                                                   \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
+       "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m    \u001b[0m\u001b[48;2;240;248;255m                                                                           \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
+       "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m      \u001b[0m\u001b[48;2;240;248;255m                                                            \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
+       "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m      \u001b[0m\u001b[48;2;240;248;255m                                                                              \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
+       "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m    \u001b[0m\u001b[48;2;240;248;255m                                                                                          \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
+       "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m  \u001b[0m\u001b[48;2;240;248;255m                                                                                              \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
+       "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m  \u001b[0m\u001b[48;2;240;248;255m                                                         \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
        "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m\u001b[0m\u001b[48;2;240;248;255m                                                                                              \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
        "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m                                                                                                       \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
-       "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m                                                                                                       \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
        "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255mONLY return a valid JSON object (no other text is necessary), where the key of the field in JSON is the\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
        "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m`name` attribute of the corresponding XML, and the value is of the type specified by the corresponding \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
        "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255mXML's tag. The JSON MUST conform to the XML format, including any types and format requests e.g. \u001b[0m\u001b[48;2;240;248;255m      \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
@@ -702,81 +684,24 @@
        "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m                                                                                                       \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
        "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m                                                                                                       \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
        "    │ \u001b[48;2;240;248;255m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m │\n",
-       "    │ \u001b[48;2;255;240;242m╭─\u001b[0m\u001b[48;2;255;240;242m────────────────────────────────────────────\u001b[0m\u001b[48;2;255;240;242m Instructions \u001b[0m\u001b[48;2;255;240;242m─────────────────────────────────────────────\u001b[0m\u001b[48;2;255;240;242m─╮\u001b[0m │\n",
-       "    │ \u001b[48;2;255;240;242m│\u001b[0m\u001b[48;2;255;240;242m \u001b[0m\u001b[48;2;255;240;242mYou are a helpful assistant, able to express yourself purely through JSON, strictly and precisely \u001b[0m\u001b[48;2;255;240;242m     \u001b[0m\u001b[48;2;255;240;242m \u001b[0m\u001b[48;2;255;240;242m│\u001b[0m │\n",
-       "    │ \u001b[48;2;255;240;242m│\u001b[0m\u001b[48;2;255;240;242m \u001b[0m\u001b[48;2;255;240;242madhering to the provided XML schemas.\u001b[0m\u001b[48;2;255;240;242m                                                                  \u001b[0m\u001b[48;2;255;240;242m \u001b[0m\u001b[48;2;255;240;242m│\u001b[0m │\n",
-       "    │ \u001b[48;2;255;240;242m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m │\n",
-       "    │ \u001b[48;2;231;223;235m╭─\u001b[0m\u001b[48;2;231;223;235m───────────────────────────────────────────\u001b[0m\u001b[48;2;231;223;235m Message History \u001b[0m\u001b[48;2;231;223;235m───────────────────────────────────────────\u001b[0m\u001b[48;2;231;223;235m─╮\u001b[0m │\n",
+       "    │ \u001b[48;2;231;223;235m╭─\u001b[0m\u001b[48;2;231;223;235m───────────────────────────────────────────\u001b[0m Message History \u001b[48;2;231;223;235m───────────────────────────────────────────\u001b[0m\u001b[48;2;231;223;235m─╮\u001b[0m │\n",
        "    │ \u001b[48;2;231;223;235m│\u001b[0m\u001b[48;2;231;223;235m \u001b[0m\u001b[48;2;231;223;235mNo message history.\u001b[0m\u001b[48;2;231;223;235m                                                                                    \u001b[0m\u001b[48;2;231;223;235m \u001b[0m\u001b[48;2;231;223;235m│\u001b[0m │\n",
        "    │ \u001b[48;2;231;223;235m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m │\n",
-       "    │ \u001b[48;2;245;245;220m╭─\u001b[0m\u001b[48;2;245;245;220m───────────────────────────────────────────\u001b[0m\u001b[48;2;245;245;220m Raw LLM Output \u001b[0m\u001b[48;2;245;245;220m────────────────────────────────────────────\u001b[0m\u001b[48;2;245;245;220m─╮\u001b[0m │\n",
-       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m{\u001b[0m\u001b[48;2;245;245;220m                                                                                                      \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
-       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m    \"gender\": \"female\",\u001b[0m\u001b[48;2;245;245;220m                                                                                \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
-       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m    \"age\": 52,\u001b[0m\u001b[48;2;245;245;220m                                                                                         \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
-       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m    \"symptoms\": [\u001b[0m\u001b[48;2;245;245;220m                                                                                      \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
-       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m        {\u001b[0m\u001b[48;2;245;245;220m                                                                                              \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
-       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m            \"symptom\": \"chronic macular rash\",\u001b[0m\u001b[48;2;245;245;220m                                                         \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
-       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m            \"affected_area\": \"face\"\u001b[0m\u001b[48;2;245;245;220m                                                                    \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
-       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m        },\u001b[0m\u001b[48;2;245;245;220m                                                                                             \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
-       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m        {\u001b[0m\u001b[48;2;245;245;220m                                                                                              \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
-       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m            \"symptom\": \"chronic macular rash\",\u001b[0m\u001b[48;2;245;245;220m                                                         \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
-       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m            \"affected_area\": \"hair\"\u001b[0m\u001b[48;2;245;245;220m                                                                    \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
-       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m        },\u001b[0m\u001b[48;2;245;245;220m                                                                                             \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
-       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m        {\u001b[0m\u001b[48;2;245;245;220m                                                                                              \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
-       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m            \"symptom\": \"itchy rash\",\u001b[0m\u001b[48;2;245;245;220m                                                                   \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
-       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m            \"affected_area\": \"beard\"\u001b[0m\u001b[48;2;245;245;220m                                                                   \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
-       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m        },\u001b[0m\u001b[48;2;245;245;220m                                                                                             \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
-       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m        {\u001b[0m\u001b[48;2;245;245;220m                                                                                              \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
-       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m            \"symptom\": \"itchy rash\",\u001b[0m\u001b[48;2;245;245;220m                                                                   \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
-       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m            \"affected_area\": \"eyebrows\"\u001b[0m\u001b[48;2;245;245;220m                                                                \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
-       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m        },\u001b[0m\u001b[48;2;245;245;220m                                                                                             \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
-       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m        {\u001b[0m\u001b[48;2;245;245;220m                                                                                              \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
-       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m            \"symptom\": \"itchy rash\",\u001b[0m\u001b[48;2;245;245;220m                                                                   \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
-       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m            \"affected_area\": \"nares\"\u001b[0m\u001b[48;2;245;245;220m                                                                   \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
-       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m        },\u001b[0m\u001b[48;2;245;245;220m                                                                                             \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
-       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m        {\u001b[0m\u001b[48;2;245;245;220m                                                                                              \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
-       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m            \"symptom\": \"flaky rash\",\u001b[0m\u001b[48;2;245;245;220m                                                                   \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
-       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m            \"affected_area\": \"face\"\u001b[0m\u001b[48;2;245;245;220m                                                                    \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
-       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m        },\u001b[0m\u001b[48;2;245;245;220m                                                                                             \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
-       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m        {\u001b[0m\u001b[48;2;245;245;220m                                                                                              \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
-       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m            \"symptom\": \"flaky rash\",\u001b[0m\u001b[48;2;245;245;220m                                                                   \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
-       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m            \"affected_area\": \"hair\"\u001b[0m\u001b[48;2;245;245;220m                                                                    \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
-       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m        },\u001b[0m\u001b[48;2;245;245;220m                                                                                             \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
-       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m        {\u001b[0m\u001b[48;2;245;245;220m                                                                                              \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
-       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m            \"symptom\": \"slightly scaly rash\",\u001b[0m\u001b[48;2;245;245;220m                                                          \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
-       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m            \"affected_area\": \"face\"\u001b[0m\u001b[48;2;245;245;220m                                                                    \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
-       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m        },\u001b[0m\u001b[48;2;245;245;220m                                                                                             \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
-       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m        {\u001b[0m\u001b[48;2;245;245;220m                                                                                              \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
-       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m            \"symptom\": \"slightly scaly rash\",\u001b[0m\u001b[48;2;245;245;220m                                                          \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
-       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m            \"affected_area\": \"hair\"\u001b[0m\u001b[48;2;245;245;220m                                                                    \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
-       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m        }\u001b[0m\u001b[48;2;245;245;220m                                                                                              \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
-       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m    ],\u001b[0m\u001b[48;2;245;245;220m                                                                                                 \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
-       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m    \"current_meds\": [\u001b[0m\u001b[48;2;245;245;220m                                                                                  \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
-       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m        {\u001b[0m\u001b[48;2;245;245;220m                                                                                              \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
-       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m            \"medication\": \"OTC STEROID CREAM\",\u001b[0m\u001b[48;2;245;245;220m                                                         \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
-       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m            \"response\": \"moderate response\"\u001b[0m\u001b[48;2;245;245;220m                                                            \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
-       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m        }\u001b[0m\u001b[48;2;245;245;220m                                                                                              \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
-       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m    ],\u001b[0m\u001b[48;2;245;245;220m                                                                                                 \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
-       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m    \"miscellaneous\": \"patient also suffers from diabetes\"\u001b[0m\u001b[48;2;245;245;220m                                              \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
-       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m}\u001b[0m\u001b[48;2;245;245;220m                                                                                                      \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
+       "    │ \u001b[48;2;245;245;220m╭─\u001b[0m\u001b[48;2;245;245;220m───────────────────────────────────────────\u001b[0m Raw LLM Output \u001b[48;2;245;245;220m────────────────────────────────────────────\u001b[0m\u001b[48;2;245;245;220m─╮\u001b[0m │\n",
+       "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m                                                                                                       \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
        "    │ \u001b[48;2;245;245;220m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m │\n",
-       "    │ \u001b[48;2;240;255;240m╭─\u001b[0m\u001b[48;2;240;255;240m──────────────────────────────────────────\u001b[0m\u001b[48;2;240;255;240m Validated Output \u001b[0m\u001b[48;2;240;255;240m───────────────────────────────────────────\u001b[0m\u001b[48;2;240;255;240m─╮\u001b[0m │\n",
+       "    │ \u001b[48;2;240;255;240m╭─\u001b[0m\u001b[48;2;240;255;240m──────────────────────────────────────────\u001b[0m Validated Output \u001b[48;2;240;255;240m───────────────────────────────────────────\u001b[0m\u001b[48;2;240;255;240m─╮\u001b[0m │\n",
        "    │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m{\u001b[0m\u001b[48;2;240;255;240m                                                                                                      \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
        "    │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m    'gender': 'female',\u001b[0m\u001b[48;2;240;255;240m                                                                                \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
-       "    │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m    'age': 52,\u001b[0m\u001b[48;2;240;255;240m                                                                                         \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
+       "    │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m    'age': 100,\u001b[0m\u001b[48;2;240;255;240m                                                                                        \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
        "    │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m    'symptoms': [\u001b[0m\u001b[48;2;240;255;240m                                                                                      \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
        "    │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m        {'symptom': 'chronic macular rash', 'affected_area': 'face'},\u001b[0m\u001b[48;2;240;255;240m                                  \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
-       "    │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m        {'symptom': 'chronic macular rash', 'affected_area': 'hair'},\u001b[0m\u001b[48;2;240;255;240m                                  \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
-       "    │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m        {'symptom': 'itchy rash', 'affected_area': 'beard'},\u001b[0m\u001b[48;2;240;255;240m                                           \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
-       "    │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m        {'symptom': 'itchy rash', 'affected_area': 'eyebrows'},\u001b[0m\u001b[48;2;240;255;240m                                        \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
-       "    │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m        {'symptom': 'itchy rash', 'affected_area': 'nares'},\u001b[0m\u001b[48;2;240;255;240m                                           \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
-       "    │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m        {'symptom': 'flaky rash', 'affected_area': 'face'},\u001b[0m\u001b[48;2;240;255;240m                                            \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
-       "    │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m        {'symptom': 'flaky rash', 'affected_area': 'hair'},\u001b[0m\u001b[48;2;240;255;240m                                            \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
-       "    │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m        {'symptom': 'slightly scaly rash', 'affected_area': 'face'},\u001b[0m\u001b[48;2;240;255;240m                                   \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
-       "    │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m        {'symptom': 'slightly scaly rash', 'affected_area': 'hair'}\u001b[0m\u001b[48;2;240;255;240m                                    \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
+       "    │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m        {'symptom': 'itchy', 'affected_area': 'beard'},\u001b[0m\u001b[48;2;240;255;240m                                                \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
+       "    │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m        {'symptom': 'flaky', 'affected_area': 'eyebrows'},\u001b[0m\u001b[48;2;240;255;240m                                             \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
+       "    │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m        {'symptom': 'slightly scaly', 'affected_area': 'nares'}\u001b[0m\u001b[48;2;240;255;240m                                        \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
        "    │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m    ],\u001b[0m\u001b[48;2;240;255;240m                                                                                                 \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
        "    │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m    'current_meds': [\u001b[0m\u001b[48;2;240;255;240m                                                                                  \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
-       "    │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m        {'medication': 'OTC STEROID CREAM', 'response': 'moderate response'}\u001b[0m\u001b[48;2;240;255;240m                           \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
+       "    │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m        {'medication': 'OTC STEROID CREAM', 'response': 'Moderate'}\u001b[0m\u001b[48;2;240;255;240m                                    \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
        "    │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m    ],\u001b[0m\u001b[48;2;240;255;240m                                                                                                 \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
        "    │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m    'miscellaneous': 'patient also suffers from diabetes'\u001b[0m\u001b[48;2;240;255;240m                                              \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
        "    │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m}\u001b[0m\u001b[48;2;240;255;240m                                                                                                      \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
@@ -816,7 +741,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": null,
+   "execution_count": 12,
    "metadata": {},
    "outputs": [],
    "source": [
@@ -826,7 +751,7 @@
     "Generate a short description of large language models. Each new sentence should be on another line.\n",
     "\"\"\"\n",
     "\n",
-    "guard = gd.Guard.from_string(\n",
+    "guard = gd.Guard.for_string(\n",
     "    validators=[\n",
     "        UpperCase(on_fail=\"fix\"),\n",
     "        OneLine(on_fail=\"fix\"),\n",
@@ -847,31 +772,24 @@
   },
   {
    "cell_type": "code",
-   "execution_count": null,
+   "execution_count": 13,
    "metadata": {},
    "outputs": [
-    {
-     "name": "stderr",
-     "output_type": "stream",
-     "text": [
-      "HTTP Request: POST https://api.openai.com/v1/chat/completions \"HTTP/1.1 200 OK\"\n"
-     ]
-    },
     {
      "data": {
       "text/html": [
        "
Raw output:\n",
-       "Large language models are powerful artificial intelligence systems that can generate human-like text. \n",
-       "They are trained on vast amounts of data to understand and generate language. \n",
-       "These models have the ability to complete sentences, write stories, and even engage in conversations. \n",
+       "Large language models are advanced artificial intelligence systems that can generate human-like text. \n",
+       "They are trained on vast amounts of data to understand and mimic natural language patterns. \n",
+       "These models have the ability to generate coherent and contextually relevant responses to prompts. \n",
        "\n",
        "
\n" ], "text/plain": [ "Raw output:\n", - "Large language models are powerful artificial intelligence systems that can generate human-like text. \n", - "They are trained on vast amounts of data to understand and generate language. \n", - "These models have the ability to complete sentences, write stories, and even engage in conversations. \n", + "Large language models are advanced artificial intelligence systems that can generate human-like text. \n", + "They are trained on vast amounts of data to understand and mimic natural language patterns. \n", + "These models have the ability to generate coherent and contextually relevant responses to prompts. \n", "\n" ] }, @@ -882,12 +800,12 @@ "data": { "text/html": [ "
Validated output:\n",
-       "LARGE LANGUAGE MODELS ARE POWERFUL ARTIFICIAL INTELLIGENCE SYSTEMS THAT CAN GENERATE HUMAN-LIKE TEXT. \n",
+       "LARGE LANGUAGE MODELS ARE ADVANCED ARTIFICIAL INTELLIGENCE SYSTEMS THAT CAN GENERATE HUMAN-LIKE TEXT. \n",
        "
\n" ], "text/plain": [ "Validated output:\n", - "LARGE LANGUAGE MODELS ARE POWERFUL ARTIFICIAL INTELLIGENCE SYSTEMS THAT CAN GENERATE HUMAN-LIKE TEXT. \n" + "LARGE LANGUAGE MODELS ARE ADVANCED ARTIFICIAL INTELLIGENCE SYSTEMS THAT CAN GENERATE HUMAN-LIKE TEXT. \n" ] }, "metadata": {}, @@ -919,33 +837,33 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 14, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
ValidationOutcome(\n",
-       "    raw_llm_output='Large language models are advanced artificial intelligence systems that can generate human-like\n",
-       "text. \\nThey are trained on vast amounts of data to understand and produce language. \\nThese models have the \n",
-       "ability to complete sentences, write stories, and even engage in conversations. \\n',\n",
-       "    validated_output='LARGE LANGUAGE MODELS ARE ADVANCED ARTIFICIAL INTELLIGENCE SYSTEMS THAT CAN GENERATE \n",
-       "HUMAN-LIKE TEXT. ',\n",
+       "    call_id='129880225974544',\n",
+       "    raw_llm_output=' questions',\n",
+       "    validation_summaries=None,\n",
+       "    validated_output=' HEY HAVE THE ABILITY TO GENERATE COHERENT AND CONTEXTUALLY RELEVANT RESPONSES TO PROMPTS OR \n",
+       "QUESTIONS',\n",
        "    reask=None,\n",
-       "    validation_passed=True,\n",
+       "    validation_passed=False,\n",
        "    error=None\n",
        ")\n",
        "
\n" ], "text/plain": [ "\u001b[1;35mValidationOutcome\u001b[0m\u001b[1m(\u001b[0m\n", - " \u001b[33mraw_llm_output\u001b[0m=\u001b[32m'Large language models are advanced artificial intelligence systems that can generate human-like\u001b[0m\n", - "\u001b[32mtext. \\nThey are trained on vast amounts of data to understand and produce language. \\nThese models have the \u001b[0m\n", - "\u001b[32mability to complete sentences, write stories, and even engage in conversations. \\n'\u001b[0m,\n", - " \u001b[33mvalidated_output\u001b[0m=\u001b[32m'LARGE LANGUAGE MODELS ARE ADVANCED ARTIFICIAL INTELLIGENCE SYSTEMS THAT CAN GENERATE \u001b[0m\n", - "\u001b[32mHUMAN-LIKE TEXT. '\u001b[0m,\n", + " \u001b[33mcall_id\u001b[0m=\u001b[32m'129880225974544'\u001b[0m,\n", + " \u001b[33mraw_llm_output\u001b[0m=\u001b[32m' questions'\u001b[0m,\n", + " \u001b[33mvalidation_summaries\u001b[0m=\u001b[3;35mNone\u001b[0m,\n", + " \u001b[33mvalidated_output\u001b[0m=\u001b[32m' HEY HAVE THE ABILITY TO GENERATE COHERENT AND CONTEXTUALLY RELEVANT RESPONSES TO PROMPTS OR \u001b[0m\n", + "\u001b[32mQUESTIONS'\u001b[0m,\n", " \u001b[33mreask\u001b[0m=\u001b[3;35mNone\u001b[0m,\n", - " \u001b[33mvalidation_passed\u001b[0m=\u001b[3;92mTrue\u001b[0m,\n", + " \u001b[33mvalidation_passed\u001b[0m=\u001b[3;91mFalse\u001b[0m,\n", " \u001b[33merror\u001b[0m=\u001b[3;35mNone\u001b[0m\n", "\u001b[1m)\u001b[0m\n" ] @@ -972,7 +890,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 15, "metadata": {}, "outputs": [ { @@ -980,26 +898,20 @@ "text/html": [ "
Logs\n",
        "└── ╭────────────────────────────────────────────────── Step 0 ───────────────────────────────────────────────────╮\n",
-       "    │ ╭──────────────────────────────────────────────── Prompt ─────────────────────────────────────────────────╮ │\n",
+       "    │ ╭──────────────────────────────────────────────── Prompt ─────────────────────────────────────────────────╮ │\n",
        "    │ │                                                                                                         │ │\n",
        "    │ │ Generate a short description of large language models. Each new sentence should be on another line.     │ │\n",
        "    │ │                                                                                                         │ │\n",
        "    │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │\n",
-       "    │ ╭───────────────────────────────────────────── Instructions ──────────────────────────────────────────────╮ │\n",
-       "    │ │ You are a helpful assistant, expressing yourself through a string.                                      │ │\n",
-       "    │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │\n",
-       "    │ ╭──────────────────────────────────────────── Message History ────────────────────────────────────────────╮ │\n",
+       "    │ ╭──────────────────────────────────────────── Message History ────────────────────────────────────────────╮ │\n",
        "    │ │ No message history.                                                                                     │ │\n",
        "    │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │\n",
-       "    │ ╭──────────────────────────────────────────── Raw LLM Output ─────────────────────────────────────────────╮ │\n",
-       "    │ │ Large language models are advanced artificial intelligence systems that can generate human-like text.   │ │\n",
-       "    │ │ They are trained on vast amounts of data to understand and produce language.                            │ │\n",
-       "    │ │ These models have the ability to complete sentences, write stories, and even engage in conversations.   │ │\n",
+       "    │ ╭──────────────────────────────────────────── Raw LLM Output ─────────────────────────────────────────────╮ │\n",
        "    │ │                                                                                                         │ │\n",
        "    │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │\n",
-       "    │ ╭─────────────────────────────────────────── Validated Output ────────────────────────────────────────────╮ │\n",
+       "    │ ╭─────────────────────────────────────────── Validated Output ────────────────────────────────────────────╮ │\n",
        "    │ │ 'LARGE LANGUAGE MODELS ARE ADVANCED ARTIFICIAL INTELLIGENCE SYSTEMS THAT CAN GENERATE HUMAN-LIKE TEXT.  │ │\n",
-       "    │ │ '                                                                                                       │ │\n",
+       "    │ │ HEY HAVE THE ABILITY TO GENERATE COHERENT AND CONTEXTUALLY RELEVANT RESPONSES TO PROMPTS OR QUESTIONS'  │ │\n",
        "    │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │\n",
        "    ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n",
        "
\n" @@ -1007,26 +919,20 @@ "text/plain": [ "Logs\n", "└── ╭────────────────────────────────────────────────── Step 0 ───────────────────────────────────────────────────╮\n", - " │ \u001b[48;2;240;248;255m╭─\u001b[0m\u001b[48;2;240;248;255m───────────────────────────────────────────────\u001b[0m\u001b[48;2;240;248;255m Prompt \u001b[0m\u001b[48;2;240;248;255m────────────────────────────────────────────────\u001b[0m\u001b[48;2;240;248;255m─╮\u001b[0m │\n", + " │ \u001b[48;2;240;248;255m╭─\u001b[0m\u001b[48;2;240;248;255m───────────────────────────────────────────────\u001b[0m Prompt \u001b[48;2;240;248;255m────────────────────────────────────────────────\u001b[0m\u001b[48;2;240;248;255m─╮\u001b[0m │\n", " │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n", " │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255mGenerate a short description of large language models. Each new sentence should be on another line.\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n", " │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n", " │ \u001b[48;2;240;248;255m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m │\n", - " │ \u001b[48;2;255;240;242m╭─\u001b[0m\u001b[48;2;255;240;242m────────────────────────────────────────────\u001b[0m\u001b[48;2;255;240;242m Instructions \u001b[0m\u001b[48;2;255;240;242m─────────────────────────────────────────────\u001b[0m\u001b[48;2;255;240;242m─╮\u001b[0m │\n", - " │ \u001b[48;2;255;240;242m│\u001b[0m\u001b[48;2;255;240;242m \u001b[0m\u001b[48;2;255;240;242mYou are a helpful assistant, expressing yourself through a string.\u001b[0m\u001b[48;2;255;240;242m \u001b[0m\u001b[48;2;255;240;242m \u001b[0m\u001b[48;2;255;240;242m│\u001b[0m │\n", - " │ \u001b[48;2;255;240;242m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m │\n", - " │ \u001b[48;2;231;223;235m╭─\u001b[0m\u001b[48;2;231;223;235m───────────────────────────────────────────\u001b[0m\u001b[48;2;231;223;235m Message History \u001b[0m\u001b[48;2;231;223;235m───────────────────────────────────────────\u001b[0m\u001b[48;2;231;223;235m─╮\u001b[0m │\n", + " │ \u001b[48;2;231;223;235m╭─\u001b[0m\u001b[48;2;231;223;235m───────────────────────────────────────────\u001b[0m Message History \u001b[48;2;231;223;235m───────────────────────────────────────────\u001b[0m\u001b[48;2;231;223;235m─╮\u001b[0m │\n", " │ \u001b[48;2;231;223;235m│\u001b[0m\u001b[48;2;231;223;235m \u001b[0m\u001b[48;2;231;223;235mNo message history.\u001b[0m\u001b[48;2;231;223;235m \u001b[0m\u001b[48;2;231;223;235m \u001b[0m\u001b[48;2;231;223;235m│\u001b[0m │\n", " │ \u001b[48;2;231;223;235m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m │\n", - " │ \u001b[48;2;245;245;220m╭─\u001b[0m\u001b[48;2;245;245;220m───────────────────────────────────────────\u001b[0m\u001b[48;2;245;245;220m Raw LLM Output \u001b[0m\u001b[48;2;245;245;220m────────────────────────────────────────────\u001b[0m\u001b[48;2;245;245;220m─╮\u001b[0m │\n", - " │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220mLarge language models are advanced artificial intelligence systems that can generate human-like text. \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n", - " │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220mThey are trained on vast amounts of data to understand and produce language. \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n", - " │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220mThese models have the ability to complete sentences, write stories, and even engage in conversations. \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n", + " │ \u001b[48;2;245;245;220m╭─\u001b[0m\u001b[48;2;245;245;220m───────────────────────────────────────────\u001b[0m Raw LLM Output \u001b[48;2;245;245;220m────────────────────────────────────────────\u001b[0m\u001b[48;2;245;245;220m─╮\u001b[0m │\n", " │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n", " │ \u001b[48;2;245;245;220m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m │\n", - " │ \u001b[48;2;240;255;240m╭─\u001b[0m\u001b[48;2;240;255;240m──────────────────────────────────────────\u001b[0m\u001b[48;2;240;255;240m Validated Output \u001b[0m\u001b[48;2;240;255;240m───────────────────────────────────────────\u001b[0m\u001b[48;2;240;255;240m─╮\u001b[0m │\n", + " │ \u001b[48;2;240;255;240m╭─\u001b[0m\u001b[48;2;240;255;240m──────────────────────────────────────────\u001b[0m Validated Output \u001b[48;2;240;255;240m───────────────────────────────────────────\u001b[0m\u001b[48;2;240;255;240m─╮\u001b[0m │\n", " │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m'LARGE LANGUAGE MODELS ARE ADVANCED ARTIFICIAL INTELLIGENCE SYSTEMS THAT CAN GENERATE HUMAN-LIKE TEXT. \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n", - " │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m'\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n", + " │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240mHEY HAVE THE ABILITY TO GENERATE COHERENT AND CONTEXTUALLY RELEVANT RESPONSES TO PROMPTS OR QUESTIONS'\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n", " │ \u001b[48;2;240;255;240m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m │\n", " ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n" ] @@ -1064,7 +970,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.8" + "version": "3.11.7" } }, "nbformat": 4, diff --git a/docs/concepts/validators.md b/docs/concepts/validators.md index 9d0cb9ff6..eab1225c7 100644 --- a/docs/concepts/validators.md +++ b/docs/concepts/validators.md @@ -15,7 +15,7 @@ Occasionally, validators need additional metadata that is only available during As an example, the `ExtractedSummarySentencesMatch` validator accepts a `filepaths` property in the metadata dictionary to specify what source files to compare the summary against to ensure similarity. Unlike arguments which are specified at validator initialization, metadata is specified when calling `guard.validate` or `guard.__call__` (this is the `guard()` function). ```python -guard = Guard.from_rail("my_railspec.rail") +guard = Guard.for_rail("my_railspec.rail") outcome = guard( llm_api=openai.chat.completions.create, diff --git a/docs/examples/constrained_decoding.ipynb b/docs/examples/constrained_decoding.ipynb index 12782c093..8805fae26 100644 --- a/docs/examples/constrained_decoding.ipynb +++ b/docs/examples/constrained_decoding.ipynb @@ -1,93 +1,93 @@ { - "cells": [ - { - "cell_type": "code", - "execution_count": 4, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\n", - "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m A new release of pip is available: \u001b[0m\u001b[31;49m24.0\u001b[0m\u001b[39;49m -> \u001b[0m\u001b[32;49m24.1\u001b[0m\n", - "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m To update, run: \u001b[0m\u001b[32;49mpip install --upgrade pip\u001b[0m\n", - "\n", - "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m A new release of pip is available: \u001b[0m\u001b[31;49m24.0\u001b[0m\u001b[39;49m -> \u001b[0m\u001b[32;49m24.1\u001b[0m\n", - "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m To update, run: \u001b[0m\u001b[32;49mpip install --upgrade pip\u001b[0m\n" - ] - } - ], - "source": [ - "! pip install ipywidgets -q" - ] - }, - { - "cell_type": "code", - "execution_count": 1, - "metadata": {}, - "outputs": [ - { - "data": { - "application/vnd.jupyter.widget-view+json": { - "model_id": "81b91198c45249a2b0a7075d13ebf838", - "version_major": 2, - "version_minor": 0 - }, - "text/plain": [ - "model.safetensors: 0%| | 10.5M/2.20G [00:00 \u001b[0m\u001b[32;49m24.1\u001b[0m\n", + "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m To update, run: \u001b[0m\u001b[32;49mpip install --upgrade pip\u001b[0m\n", + "\n", + "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m A new release of pip is available: \u001b[0m\u001b[31;49m24.0\u001b[0m\u001b[39;49m -> \u001b[0m\u001b[32;49m24.1\u001b[0m\n", + "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m To update, run: \u001b[0m\u001b[32;49mpip install --upgrade pip\u001b[0m\n" + ] + } + ], + "source": [ + "! pip install ipywidgets -q" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "81b91198c45249a2b0a7075d13ebf838", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "model.safetensors: 0%| | 10.5M/2.20G [00:00\n", "\"\"\"\n", "\n", - "guard = Guard.from_rail_string(rail_spec)" + "guard = Guard.for_rail_string(rail_spec)" ] }, { @@ -123,7 +123,7 @@ " age: int\n", "\n", "\n", - "guard = Guard.from_pydantic(Pet)\n", + "guard = Guard.for_pydantic(Pet)\n", "guard.use(TwoWords(on_fail=\"exception\"), on=\"prompt\")\n", "\n", "try:\n", diff --git a/docs/examples/json_function_calling_tools.ipynb b/docs/examples/json_function_calling_tools.ipynb index 65ecb9d1c..ebb7a8bae 100644 --- a/docs/examples/json_function_calling_tools.ipynb +++ b/docs/examples/json_function_calling_tools.ipynb @@ -215,7 +215,7 @@ "class Schedule(BaseModel):\n", " deliveries: List[Delivery]\n", "\n", - "pydantic_guard = Guard.from_pydantic(Schedule)\n", + "pydantic_guard = Guard.for_pydantic(Schedule)\n", "\n", "# Generate the function calling tool and add it to the list\n", "pydantic_guard_tools = pydantic_guard.json_function_calling_tool([])\n", @@ -246,7 +246,7 @@ "\n", "\"\"\"\n", "\n", - "rail_guard = Guard.from_rail_string(rail)\n", + "rail_guard = Guard.for_rail_string(rail)\n", "\n", "\n", "# Generate the function calling tool and add it to the list\n", diff --git a/docs/examples/llamaindex-output-parsing.ipynb b/docs/examples/llamaindex-output-parsing.ipynb index 80fbfd2aa..e69d30ecc 100644 --- a/docs/examples/llamaindex-output-parsing.ipynb +++ b/docs/examples/llamaindex-output-parsing.ipynb @@ -190,8 +190,8 @@ "metadata": {}, "outputs": [], "source": [ - "# You can either define a RailSpec and initialise a Guard object from_rail_string()\n", - "# OR define Pydantic classes and initialise a Guard object from_pydantic()\n", + "# You can either define a RailSpec and initialise a Guard object for_rail_string()\n", + "# OR define Pydantic classes and initialise a Guard object for_pydantic()\n", "# For more info: https://docs.guardrailsai.com/defining_guards/pydantic/\n", "# Guardrails recommends Pydantic\n", "\n", @@ -237,7 +237,7 @@ "outputs": [], "source": [ "# Create a guard object\n", - "guard = gd.Guard.from_pydantic(output_class=BulletPoints, prompt=prompt)\n", + "guard = gd.Guard.for_pydantic(output_class=BulletPoints, prompt=prompt)\n", "\n", "# Create output parse object\n", "output_parser = GuardrailsOutputParser(guard, llm=llm_predictor.llm.complete)" diff --git a/docs/examples/no_secrets_in_generated_text.ipynb b/docs/examples/no_secrets_in_generated_text.ipynb index 8be7ef687..ec82302c0 100644 --- a/docs/examples/no_secrets_in_generated_text.ipynb +++ b/docs/examples/no_secrets_in_generated_text.ipynb @@ -175,7 +175,7 @@ "metadata": {}, "outputs": [], "source": [ - "guard = gd.Guard.from_rail_string(rail_str)" + "guard = gd.Guard.for_rail_string(rail_str)" ] }, { @@ -191,7 +191,7 @@ "metadata": {}, "outputs": [], "source": [ - "guard = gd.Guard.from_pydantic(output_class=ScrubbedCode)" + "guard = gd.Guard.for_pydantic(output_class=ScrubbedCode)" ] }, { diff --git a/docs/examples/provenance.ipynb b/docs/examples/provenance.ipynb index 3297601c0..4d0f8faca 100644 --- a/docs/examples/provenance.ipynb +++ b/docs/examples/provenance.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 2, + "execution_count": 1, "metadata": {}, "outputs": [ { @@ -10,13 +10,13 @@ "output_type": "stream", "text": [ "Installing hub:\u001b[35m/\u001b[0m\u001b[35m/guardrails/\u001b[0m\u001b[95mprovenance_embeddings...\u001b[0m\n", - "/Users/calebcourier/Projects/gr-mono/guardrails/docs/examples/.venv/lib/python3.12/site-packages/huggingface_hub/file_download.py:1132: FutureWarning: `resume_download` is deprecated and will be removed in version 1.0.0. Downloads always resume when possible. If you want to force a new download, use `force_download=True`.\n", + "/home/zayd/workspace/guardrails/docs/.venv/lib/python3.11/site-packages/transformers/tokenization_utils_base.py:1617: FutureWarning: `clean_up_tokenization_spaces` was not set. It will be set to `True` by default. This behavior will be deprecated in transformers v4.45, and will be then set to `False` by default. For more details check this issue: https://github.com/huggingface/transformers/issues/31884\n", " warnings.warn(\n", "✅Successfully installed guardrails/provenance_embeddings!\n", "\n", "\n", "Installing hub:\u001b[35m/\u001b[0m\u001b[35m/guardrails/\u001b[0m\u001b[95mprovenance_llm...\u001b[0m\n", - "/Users/calebcourier/Projects/gr-mono/guardrails/docs/examples/.venv/lib/python3.12/site-packages/huggingface_hub/file_download.py:1132: FutureWarning: `resume_download` is deprecated and will be removed in version 1.0.0. Downloads always resume when possible. If you want to force a new download, use `force_download=True`.\n", + "/home/zayd/workspace/guardrails/docs/.venv/lib/python3.11/site-packages/transformers/tokenization_utils_base.py:1617: FutureWarning: `clean_up_tokenization_spaces` was not set. It will be set to `True` by default. This behavior will be deprecated in transformers v4.45, and will be then set to `False` by default. For more details check this issue: https://github.com/huggingface/transformers/issues/31884\n", " warnings.warn(\n", "✅Successfully installed guardrails/provenance_llm!\n", "\n", @@ -76,7 +76,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ @@ -288,14 +288,14 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ - "/Users/calebcourier/Projects/gr-mono/guardrails/docs/examples/.venv/lib/python3.12/site-packages/sentence_transformers/cross_encoder/CrossEncoder.py:11: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n", + "/home/zayd/workspace/guardrails/docs/.venv/lib/python3.11/site-packages/sentence_transformers/cross_encoder/CrossEncoder.py:13: TqdmExperimentalWarning: Using `tqdm.autonotebook.tqdm` in notebook mode. Use `tqdm.tqdm` instead to force console mode (e.g. in jupyter console)\n", " from tqdm.autonotebook import tqdm, trange\n" ] } @@ -338,16 +338,13 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "# Initialize the guard object\n", - "guard = Guard.from_string(\n", - " validators=[\n", - " ProvenanceEmbeddings(threshold=0.3, validation_method=\"sentence\", on_fail=\"fix\")\n", - " ],\n", - " description=\"testmeout\",\n", + "guard = Guard().use(\n", + " ProvenanceEmbeddings(threshold=0.3, validation_method=\"sentence\", on_fail=\"fix\")\n", ")" ] }, @@ -360,28 +357,36 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 5, "metadata": {}, "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/home/zayd/workspace/guardrails/docs/.venv/lib/python3.11/site-packages/guardrails/validator_service/__init__.py:85: UserWarning: Could not obtain an event loop. Falling back to synchronous validation.\n", + " warnings.warn(\n" + ] + }, { "data": { "text/html": [ "
Logs\n",
        "└── ╭────────────────────────────────────────────────── Step 0 ───────────────────────────────────────────────────╮\n",
-       "    │ ╭──────────────────────────────────────────────── Prompt ─────────────────────────────────────────────────╮ │\n",
+       "    │ ╭──────────────────────────────────────────────── Prompt ─────────────────────────────────────────────────╮ │\n",
        "    │ │ No prompt                                                                                               │ │\n",
        "    │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │\n",
-       "    │ ╭──────────────────────────────────────────── Message History ────────────────────────────────────────────╮ │\n",
+       "    │ ╭──────────────────────────────────────────── Message History ────────────────────────────────────────────╮ │\n",
        "    │ │ No message history.                                                                                     │ │\n",
        "    │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │\n",
-       "    │ ╭──────────────────────────────────────────── Raw LLM Output ─────────────────────────────────────────────╮ │\n",
+       "    │ ╭──────────────────────────────────────────── Raw LLM Output ─────────────────────────────────────────────╮ │\n",
        "    │ │ To retrain a cat to use the litter box, put its litter box in a low traffic area with at least 2 exits  │ │\n",
        "    │ │ so the cat doesn’t feel cornered. Find the right litterbox for your cat, as well as the right litter.   │ │\n",
        "    │ │ Place the litterbox in a good spot, away from heavily trafficked and noisy areas. Keep the litterbox    │ │\n",
        "    │ │ very clean, and do not punish the cat or confine her to just one room. Once training is complete, it is │ │\n",
        "    │ │ important to clean the litter box regularly and to provide a safe and healthy environment for the cat.  │ │\n",
        "    │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │\n",
-       "    │ ╭─────────────────────────────────────────── Validated Output ────────────────────────────────────────────╮ │\n",
+       "    │ ╭─────────────────────────────────────────── Validated Output ────────────────────────────────────────────╮ │\n",
        "    │ │ 'To retrain a cat to use the litter box, put its litter box in a low traffic area with at least 2 exits │ │\n",
        "    │ │ so the cat doesn’t feel cornered.\\nFind the right litterbox for your cat, as well as the right          │ │\n",
        "    │ │ litter.\\nKeep the litterbox very clean, and do not punish the cat or confine her to just one            │ │\n",
@@ -394,20 +399,20 @@
       "text/plain": [
        "Logs\n",
        "└── ╭────────────────────────────────────────────────── Step 0 ───────────────────────────────────────────────────╮\n",
-       "    │ \u001b[48;2;240;248;255m╭─\u001b[0m\u001b[48;2;240;248;255m───────────────────────────────────────────────\u001b[0m\u001b[48;2;240;248;255m Prompt \u001b[0m\u001b[48;2;240;248;255m────────────────────────────────────────────────\u001b[0m\u001b[48;2;240;248;255m─╮\u001b[0m │\n",
+       "    │ \u001b[48;2;240;248;255m╭─\u001b[0m\u001b[48;2;240;248;255m───────────────────────────────────────────────\u001b[0m Prompt \u001b[48;2;240;248;255m────────────────────────────────────────────────\u001b[0m\u001b[48;2;240;248;255m─╮\u001b[0m │\n",
        "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255mNo prompt\u001b[0m\u001b[48;2;240;248;255m                                                                                              \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
        "    │ \u001b[48;2;240;248;255m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m │\n",
-       "    │ \u001b[48;2;231;223;235m╭─\u001b[0m\u001b[48;2;231;223;235m───────────────────────────────────────────\u001b[0m\u001b[48;2;231;223;235m Message History \u001b[0m\u001b[48;2;231;223;235m───────────────────────────────────────────\u001b[0m\u001b[48;2;231;223;235m─╮\u001b[0m │\n",
+       "    │ \u001b[48;2;231;223;235m╭─\u001b[0m\u001b[48;2;231;223;235m───────────────────────────────────────────\u001b[0m Message History \u001b[48;2;231;223;235m───────────────────────────────────────────\u001b[0m\u001b[48;2;231;223;235m─╮\u001b[0m │\n",
        "    │ \u001b[48;2;231;223;235m│\u001b[0m\u001b[48;2;231;223;235m \u001b[0m\u001b[48;2;231;223;235mNo message history.\u001b[0m\u001b[48;2;231;223;235m                                                                                    \u001b[0m\u001b[48;2;231;223;235m \u001b[0m\u001b[48;2;231;223;235m│\u001b[0m │\n",
        "    │ \u001b[48;2;231;223;235m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m │\n",
-       "    │ \u001b[48;2;245;245;220m╭─\u001b[0m\u001b[48;2;245;245;220m───────────────────────────────────────────\u001b[0m\u001b[48;2;245;245;220m Raw LLM Output \u001b[0m\u001b[48;2;245;245;220m────────────────────────────────────────────\u001b[0m\u001b[48;2;245;245;220m─╮\u001b[0m │\n",
+       "    │ \u001b[48;2;245;245;220m╭─\u001b[0m\u001b[48;2;245;245;220m───────────────────────────────────────────\u001b[0m Raw LLM Output \u001b[48;2;245;245;220m────────────────────────────────────────────\u001b[0m\u001b[48;2;245;245;220m─╮\u001b[0m │\n",
        "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220mTo retrain a cat to use the litter box, put its litter box in a low traffic area with at least 2 exits \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
        "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220mso the cat doesn’t feel cornered. Find the right litterbox for your cat, as well as the right litter. \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
        "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220mPlace the litterbox in a good spot, away from heavily trafficked and noisy areas. Keep the litterbox \u001b[0m\u001b[48;2;245;245;220m  \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
        "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220mvery clean, and do not punish the cat or confine her to just one room. Once training is complete, it is\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
        "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220mimportant to clean the litter box regularly and to provide a safe and healthy environment for the cat.\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
        "    │ \u001b[48;2;245;245;220m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m │\n",
-       "    │ \u001b[48;2;240;255;240m╭─\u001b[0m\u001b[48;2;240;255;240m──────────────────────────────────────────\u001b[0m\u001b[48;2;240;255;240m Validated Output \u001b[0m\u001b[48;2;240;255;240m───────────────────────────────────────────\u001b[0m\u001b[48;2;240;255;240m─╮\u001b[0m │\n",
+       "    │ \u001b[48;2;240;255;240m╭─\u001b[0m\u001b[48;2;240;255;240m──────────────────────────────────────────\u001b[0m Validated Output \u001b[48;2;240;255;240m───────────────────────────────────────────\u001b[0m\u001b[48;2;240;255;240m─╮\u001b[0m │\n",
        "    │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m'To retrain a cat to use the litter box, put its litter box in a low traffic area with at least 2 exits\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
        "    │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240mso the cat doesn’t feel cornered.\\nFind the right litterbox for your cat, as well as the right \u001b[0m\u001b[48;2;240;255;240m        \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
        "    │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240mlitter.\\nKeep the litterbox very clean, and do not punish the cat or confine her to just one \u001b[0m\u001b[48;2;240;255;240m          \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
@@ -417,7 +422,7 @@
        "    ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n"
       ]
      },
-     "execution_count": 7,
+     "execution_count": 5,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -442,7 +447,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 8,
+   "execution_count": 6,
    "metadata": {},
    "outputs": [
     {
@@ -450,17 +455,17 @@
       "text/html": [
        "
Logs\n",
        "└── ╭────────────────────────────────────────────────── Step 0 ───────────────────────────────────────────────────╮\n",
-       "    │ ╭──────────────────────────────────────────────── Prompt ─────────────────────────────────────────────────╮ │\n",
+       "    │ ╭──────────────────────────────────────────────── Prompt ─────────────────────────────────────────────────╮ │\n",
        "    │ │ No prompt                                                                                               │ │\n",
        "    │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │\n",
-       "    │ ╭──────────────────────────────────────────── Message History ────────────────────────────────────────────╮ │\n",
+       "    │ ╭──────────────────────────────────────────── Message History ────────────────────────────────────────────╮ │\n",
        "    │ │ No message history.                                                                                     │ │\n",
        "    │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │\n",
-       "    │ ╭──────────────────────────────────────────── Raw LLM Output ─────────────────────────────────────────────╮ │\n",
+       "    │ ╭──────────────────────────────────────────── Raw LLM Output ─────────────────────────────────────────────╮ │\n",
        "    │ │ Cats love lollipops and other sweet and sour foods. Cats can be retrained to use a litter box. Reward   │ │\n",
        "    │ │ them when they do with lots of candy.                                                                   │ │\n",
        "    │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │\n",
-       "    │ ╭─────────────────────────────────────────── Validated Output ────────────────────────────────────────────╮ │\n",
+       "    │ ╭─────────────────────────────────────────── Validated Output ────────────────────────────────────────────╮ │\n",
        "    │ │ 'Cats can be retrained to use a litter box.'                                                            │ │\n",
        "    │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │\n",
        "    ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n",
@@ -469,23 +474,23 @@
       "text/plain": [
        "Logs\n",
        "└── ╭────────────────────────────────────────────────── Step 0 ───────────────────────────────────────────────────╮\n",
-       "    │ \u001b[48;2;240;248;255m╭─\u001b[0m\u001b[48;2;240;248;255m───────────────────────────────────────────────\u001b[0m\u001b[48;2;240;248;255m Prompt \u001b[0m\u001b[48;2;240;248;255m────────────────────────────────────────────────\u001b[0m\u001b[48;2;240;248;255m─╮\u001b[0m │\n",
+       "    │ \u001b[48;2;240;248;255m╭─\u001b[0m\u001b[48;2;240;248;255m───────────────────────────────────────────────\u001b[0m Prompt \u001b[48;2;240;248;255m────────────────────────────────────────────────\u001b[0m\u001b[48;2;240;248;255m─╮\u001b[0m │\n",
        "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255mNo prompt\u001b[0m\u001b[48;2;240;248;255m                                                                                              \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
        "    │ \u001b[48;2;240;248;255m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m │\n",
-       "    │ \u001b[48;2;231;223;235m╭─\u001b[0m\u001b[48;2;231;223;235m───────────────────────────────────────────\u001b[0m\u001b[48;2;231;223;235m Message History \u001b[0m\u001b[48;2;231;223;235m───────────────────────────────────────────\u001b[0m\u001b[48;2;231;223;235m─╮\u001b[0m │\n",
+       "    │ \u001b[48;2;231;223;235m╭─\u001b[0m\u001b[48;2;231;223;235m───────────────────────────────────────────\u001b[0m Message History \u001b[48;2;231;223;235m───────────────────────────────────────────\u001b[0m\u001b[48;2;231;223;235m─╮\u001b[0m │\n",
        "    │ \u001b[48;2;231;223;235m│\u001b[0m\u001b[48;2;231;223;235m \u001b[0m\u001b[48;2;231;223;235mNo message history.\u001b[0m\u001b[48;2;231;223;235m                                                                                    \u001b[0m\u001b[48;2;231;223;235m \u001b[0m\u001b[48;2;231;223;235m│\u001b[0m │\n",
        "    │ \u001b[48;2;231;223;235m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m │\n",
-       "    │ \u001b[48;2;245;245;220m╭─\u001b[0m\u001b[48;2;245;245;220m───────────────────────────────────────────\u001b[0m\u001b[48;2;245;245;220m Raw LLM Output \u001b[0m\u001b[48;2;245;245;220m────────────────────────────────────────────\u001b[0m\u001b[48;2;245;245;220m─╮\u001b[0m │\n",
+       "    │ \u001b[48;2;245;245;220m╭─\u001b[0m\u001b[48;2;245;245;220m───────────────────────────────────────────\u001b[0m Raw LLM Output \u001b[48;2;245;245;220m────────────────────────────────────────────\u001b[0m\u001b[48;2;245;245;220m─╮\u001b[0m │\n",
        "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220mCats love lollipops and other sweet and sour foods. Cats can be retrained to use a litter box. Reward \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
        "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220mthem when they do with lots of candy.\u001b[0m\u001b[48;2;245;245;220m                                                                  \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
        "    │ \u001b[48;2;245;245;220m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m │\n",
-       "    │ \u001b[48;2;240;255;240m╭─\u001b[0m\u001b[48;2;240;255;240m──────────────────────────────────────────\u001b[0m\u001b[48;2;240;255;240m Validated Output \u001b[0m\u001b[48;2;240;255;240m───────────────────────────────────────────\u001b[0m\u001b[48;2;240;255;240m─╮\u001b[0m │\n",
+       "    │ \u001b[48;2;240;255;240m╭─\u001b[0m\u001b[48;2;240;255;240m──────────────────────────────────────────\u001b[0m Validated Output \u001b[48;2;240;255;240m───────────────────────────────────────────\u001b[0m\u001b[48;2;240;255;240m─╮\u001b[0m │\n",
        "    │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m'Cats can be retrained to use a litter box.'\u001b[0m\u001b[48;2;240;255;240m                                                           \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
        "    │ \u001b[48;2;240;255;240m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m │\n",
        "    ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n"
       ]
      },
-     "execution_count": 8,
+     "execution_count": 6,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -524,14 +529,14 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 9,
+   "execution_count": 7,
    "metadata": {},
    "outputs": [],
    "source": [
     "# Initialize the guard object\n",
     "from guardrails.hub import ProvenanceLLM\n",
     "\n",
-    "guard_1 = Guard.from_string(\n",
+    "guard_1 = Guard.for_string(\n",
     "    validators=[\n",
     "        ProvenanceLLM(\n",
     "            validation_method=\"sentence\",  # can be \"sentence\" or \"full\"\n",
@@ -546,7 +551,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 10,
+   "execution_count": 8,
    "metadata": {},
    "outputs": [
     {
@@ -554,25 +559,25 @@
       "text/html": [
        "
Logs\n",
        "└── ╭────────────────────────────────────────────────── Step 0 ───────────────────────────────────────────────────╮\n",
-       "    │ ╭──────────────────────────────────────────────── Prompt ─────────────────────────────────────────────────╮ │\n",
+       "    │ ╭──────────────────────────────────────────────── Prompt ─────────────────────────────────────────────────╮ │\n",
        "    │ │ No prompt                                                                                               │ │\n",
        "    │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │\n",
-       "    │ ╭──────────────────────────────────────────── Message History ────────────────────────────────────────────╮ │\n",
+       "    │ ╭──────────────────────────────────────────── Message History ────────────────────────────────────────────╮ │\n",
        "    │ │ No message history.                                                                                     │ │\n",
        "    │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │\n",
-       "    │ ╭──────────────────────────────────────────── Raw LLM Output ─────────────────────────────────────────────╮ │\n",
+       "    │ ╭──────────────────────────────────────────── Raw LLM Output ─────────────────────────────────────────────╮ │\n",
        "    │ │ To retrain a cat to use the litter box, put its litter box in a low traffic area with at least 2 exits  │ │\n",
        "    │ │ so the cat doesn’t feel cornered. Find the right litterbox for your cat, as well as the right litter.   │ │\n",
        "    │ │ Place the litterbox in a good spot, away from heavily trafficked and noisy areas. Keep the litterbox    │ │\n",
        "    │ │ very clean, and do not punish the cat or confine her to just one room. Once training is complete, it is │ │\n",
        "    │ │ important to clean the litter box regularly and to provide a safe and healthy environment for the cat.  │ │\n",
        "    │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │\n",
-       "    │ ╭─────────────────────────────────────────── Validated Output ────────────────────────────────────────────╮ │\n",
-       "    │ │ To retrain a cat to use the litter box, put its litter box in a low traffic area with at least 2 exits  │ │\n",
-       "    │ │ so the cat doesn’t feel cornered. Find the right litterbox for your cat, as well as the right litter.   │ │\n",
-       "    │ │ Place the litterbox in a good spot, away from heavily trafficked and noisy areas. Keep the litterbox    │ │\n",
-       "    │ │ very clean, and do not punish the cat or confine her to just one room. Once training is complete, it is │ │\n",
-       "    │ │ important to clean the litter box regularly and to provide a safe and healthy environment for the cat.  │ │\n",
+       "    │ ╭─────────────────────────────────────────── Validated Output ────────────────────────────────────────────╮ │\n",
+       "    │ │ 'To retrain a cat to use the litter box, put its litter box in a low traffic area with at least 2 exits │ │\n",
+       "    │ │ so the cat doesn’t feel cornered.\\nFind the right litterbox for your cat, as well as the right          │ │\n",
+       "    │ │ litter.\\nPlace the litterbox in a good spot, away from heavily trafficked and noisy areas.\\nOnce        │ │\n",
+       "    │ │ training is complete, it is important to clean the litter box regularly and to provide a safe and       │ │\n",
+       "    │ │ healthy environment for the cat.'                                                                       │ │\n",
        "    │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │\n",
        "    ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n",
        "
\n" @@ -580,30 +585,30 @@ "text/plain": [ "Logs\n", "└── ╭────────────────────────────────────────────────── Step 0 ───────────────────────────────────────────────────╮\n", - " │ \u001b[48;2;240;248;255m╭─\u001b[0m\u001b[48;2;240;248;255m───────────────────────────────────────────────\u001b[0m\u001b[48;2;240;248;255m Prompt \u001b[0m\u001b[48;2;240;248;255m────────────────────────────────────────────────\u001b[0m\u001b[48;2;240;248;255m─╮\u001b[0m │\n", + " │ \u001b[48;2;240;248;255m╭─\u001b[0m\u001b[48;2;240;248;255m───────────────────────────────────────────────\u001b[0m Prompt \u001b[48;2;240;248;255m────────────────────────────────────────────────\u001b[0m\u001b[48;2;240;248;255m─╮\u001b[0m │\n", " │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255mNo prompt\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n", " │ \u001b[48;2;240;248;255m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m │\n", - " │ \u001b[48;2;231;223;235m╭─\u001b[0m\u001b[48;2;231;223;235m───────────────────────────────────────────\u001b[0m\u001b[48;2;231;223;235m Message History \u001b[0m\u001b[48;2;231;223;235m───────────────────────────────────────────\u001b[0m\u001b[48;2;231;223;235m─╮\u001b[0m │\n", + " │ \u001b[48;2;231;223;235m╭─\u001b[0m\u001b[48;2;231;223;235m───────────────────────────────────────────\u001b[0m Message History \u001b[48;2;231;223;235m───────────────────────────────────────────\u001b[0m\u001b[48;2;231;223;235m─╮\u001b[0m │\n", " │ \u001b[48;2;231;223;235m│\u001b[0m\u001b[48;2;231;223;235m \u001b[0m\u001b[48;2;231;223;235mNo message history.\u001b[0m\u001b[48;2;231;223;235m \u001b[0m\u001b[48;2;231;223;235m \u001b[0m\u001b[48;2;231;223;235m│\u001b[0m │\n", " │ \u001b[48;2;231;223;235m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m │\n", - " │ \u001b[48;2;245;245;220m╭─\u001b[0m\u001b[48;2;245;245;220m───────────────────────────────────────────\u001b[0m\u001b[48;2;245;245;220m Raw LLM Output \u001b[0m\u001b[48;2;245;245;220m────────────────────────────────────────────\u001b[0m\u001b[48;2;245;245;220m─╮\u001b[0m │\n", + " │ \u001b[48;2;245;245;220m╭─\u001b[0m\u001b[48;2;245;245;220m───────────────────────────────────────────\u001b[0m Raw LLM Output \u001b[48;2;245;245;220m────────────────────────────────────────────\u001b[0m\u001b[48;2;245;245;220m─╮\u001b[0m │\n", " │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220mTo retrain a cat to use the litter box, put its litter box in a low traffic area with at least 2 exits \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n", " │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220mso the cat doesn’t feel cornered. Find the right litterbox for your cat, as well as the right litter. \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n", " │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220mPlace the litterbox in a good spot, away from heavily trafficked and noisy areas. Keep the litterbox \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n", " │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220mvery clean, and do not punish the cat or confine her to just one room. Once training is complete, it is\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n", " │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220mimportant to clean the litter box regularly and to provide a safe and healthy environment for the cat.\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n", " │ \u001b[48;2;245;245;220m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m │\n", - " │ \u001b[48;2;240;255;240m╭─\u001b[0m\u001b[48;2;240;255;240m──────────────────────────────────────────\u001b[0m\u001b[48;2;240;255;240m Validated Output \u001b[0m\u001b[48;2;240;255;240m───────────────────────────────────────────\u001b[0m\u001b[48;2;240;255;240m─╮\u001b[0m │\n", - " │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240mTo retrain a cat to use the litter box, put its litter box in a low traffic area with at least 2 exits \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n", - " │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240mso the cat doesn’t feel cornered. Find the right litterbox for your cat, as well as the right litter. \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n", - " │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240mPlace the litterbox in a good spot, away from heavily trafficked and noisy areas. Keep the litterbox \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n", - " │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240mvery clean, and do not punish the cat or confine her to just one room. Once training is complete, it is\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n", - " │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240mimportant to clean the litter box regularly and to provide a safe and healthy environment for the cat.\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n", + " │ \u001b[48;2;240;255;240m╭─\u001b[0m\u001b[48;2;240;255;240m──────────────────────────────────────────\u001b[0m Validated Output \u001b[48;2;240;255;240m───────────────────────────────────────────\u001b[0m\u001b[48;2;240;255;240m─╮\u001b[0m │\n", + " │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m'To retrain a cat to use the litter box, put its litter box in a low traffic area with at least 2 exits\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n", + " │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240mso the cat doesn’t feel cornered.\\nFind the right litterbox for your cat, as well as the right \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n", + " │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240mlitter.\\nPlace the litterbox in a good spot, away from heavily trafficked and noisy areas.\\nOnce \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n", + " │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240mtraining is complete, it is important to clean the litter box regularly and to provide a safe and \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n", + " │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240mhealthy environment for the cat.'\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n", " │ \u001b[48;2;240;255;240m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m │\n", " ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n" ] }, - "execution_count": 10, + "execution_count": 8, "metadata": {}, "output_type": "execute_result" } @@ -622,7 +627,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 9, "metadata": {}, "outputs": [ { @@ -630,17 +635,17 @@ "text/html": [ "
Logs\n",
        "└── ╭────────────────────────────────────────────────── Step 0 ───────────────────────────────────────────────────╮\n",
-       "    │ ╭──────────────────────────────────────────────── Prompt ─────────────────────────────────────────────────╮ │\n",
+       "    │ ╭──────────────────────────────────────────────── Prompt ─────────────────────────────────────────────────╮ │\n",
        "    │ │ No prompt                                                                                               │ │\n",
        "    │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │\n",
-       "    │ ╭──────────────────────────────────────────── Message History ────────────────────────────────────────────╮ │\n",
+       "    │ ╭──────────────────────────────────────────── Message History ────────────────────────────────────────────╮ │\n",
        "    │ │ No message history.                                                                                     │ │\n",
        "    │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │\n",
-       "    │ ╭──────────────────────────────────────────── Raw LLM Output ─────────────────────────────────────────────╮ │\n",
+       "    │ ╭──────────────────────────────────────────── Raw LLM Output ─────────────────────────────────────────────╮ │\n",
        "    │ │ Cats love lollipops and other sweet and sour foods. Cats can be retrained to use a litter box. Reward   │ │\n",
        "    │ │ them when they do with lots of candy.                                                                   │ │\n",
        "    │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │\n",
-       "    │ ╭─────────────────────────────────────────── Validated Output ────────────────────────────────────────────╮ │\n",
+       "    │ ╭─────────────────────────────────────────── Validated Output ────────────────────────────────────────────╮ │\n",
        "    │ │ 'Cats can be retrained to use a litter box.'                                                            │ │\n",
        "    │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │\n",
        "    ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n",
@@ -649,23 +654,23 @@
       "text/plain": [
        "Logs\n",
        "└── ╭────────────────────────────────────────────────── Step 0 ───────────────────────────────────────────────────╮\n",
-       "    │ \u001b[48;2;240;248;255m╭─\u001b[0m\u001b[48;2;240;248;255m───────────────────────────────────────────────\u001b[0m\u001b[48;2;240;248;255m Prompt \u001b[0m\u001b[48;2;240;248;255m────────────────────────────────────────────────\u001b[0m\u001b[48;2;240;248;255m─╮\u001b[0m │\n",
+       "    │ \u001b[48;2;240;248;255m╭─\u001b[0m\u001b[48;2;240;248;255m───────────────────────────────────────────────\u001b[0m Prompt \u001b[48;2;240;248;255m────────────────────────────────────────────────\u001b[0m\u001b[48;2;240;248;255m─╮\u001b[0m │\n",
        "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255mNo prompt\u001b[0m\u001b[48;2;240;248;255m                                                                                              \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
        "    │ \u001b[48;2;240;248;255m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m │\n",
-       "    │ \u001b[48;2;231;223;235m╭─\u001b[0m\u001b[48;2;231;223;235m───────────────────────────────────────────\u001b[0m\u001b[48;2;231;223;235m Message History \u001b[0m\u001b[48;2;231;223;235m───────────────────────────────────────────\u001b[0m\u001b[48;2;231;223;235m─╮\u001b[0m │\n",
+       "    │ \u001b[48;2;231;223;235m╭─\u001b[0m\u001b[48;2;231;223;235m───────────────────────────────────────────\u001b[0m Message History \u001b[48;2;231;223;235m───────────────────────────────────────────\u001b[0m\u001b[48;2;231;223;235m─╮\u001b[0m │\n",
        "    │ \u001b[48;2;231;223;235m│\u001b[0m\u001b[48;2;231;223;235m \u001b[0m\u001b[48;2;231;223;235mNo message history.\u001b[0m\u001b[48;2;231;223;235m                                                                                    \u001b[0m\u001b[48;2;231;223;235m \u001b[0m\u001b[48;2;231;223;235m│\u001b[0m │\n",
        "    │ \u001b[48;2;231;223;235m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m │\n",
-       "    │ \u001b[48;2;245;245;220m╭─\u001b[0m\u001b[48;2;245;245;220m───────────────────────────────────────────\u001b[0m\u001b[48;2;245;245;220m Raw LLM Output \u001b[0m\u001b[48;2;245;245;220m────────────────────────────────────────────\u001b[0m\u001b[48;2;245;245;220m─╮\u001b[0m │\n",
+       "    │ \u001b[48;2;245;245;220m╭─\u001b[0m\u001b[48;2;245;245;220m───────────────────────────────────────────\u001b[0m Raw LLM Output \u001b[48;2;245;245;220m────────────────────────────────────────────\u001b[0m\u001b[48;2;245;245;220m─╮\u001b[0m │\n",
        "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220mCats love lollipops and other sweet and sour foods. Cats can be retrained to use a litter box. Reward \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
        "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220mthem when they do with lots of candy.\u001b[0m\u001b[48;2;245;245;220m                                                                  \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
        "    │ \u001b[48;2;245;245;220m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m │\n",
-       "    │ \u001b[48;2;240;255;240m╭─\u001b[0m\u001b[48;2;240;255;240m──────────────────────────────────────────\u001b[0m\u001b[48;2;240;255;240m Validated Output \u001b[0m\u001b[48;2;240;255;240m───────────────────────────────────────────\u001b[0m\u001b[48;2;240;255;240m─╮\u001b[0m │\n",
+       "    │ \u001b[48;2;240;255;240m╭─\u001b[0m\u001b[48;2;240;255;240m──────────────────────────────────────────\u001b[0m Validated Output \u001b[48;2;240;255;240m───────────────────────────────────────────\u001b[0m\u001b[48;2;240;255;240m─╮\u001b[0m │\n",
        "    │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m'Cats can be retrained to use a litter box.'\u001b[0m\u001b[48;2;240;255;240m                                                           \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
        "    │ \u001b[48;2;240;255;240m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m │\n",
        "    ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n"
       ]
      },
-     "execution_count": 11,
+     "execution_count": 9,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -705,7 +710,7 @@
    "name": "python",
    "nbconvert_exporter": "python",
    "pygments_lexer": "ipython3",
-   "version": "3.12.3"
+   "version": "3.11.7"
   },
   "orig_nbformat": 4
  },
diff --git a/docs/examples/recipe_generation.ipynb b/docs/examples/recipe_generation.ipynb
index 1b62610bd..286888aba 100644
--- a/docs/examples/recipe_generation.ipynb
+++ b/docs/examples/recipe_generation.ipynb
@@ -201,7 +201,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "guard = gd.Guard.from_rail_string(rail_str)"
+    "guard = gd.Guard.for_rail_string(rail_str)"
    ]
   },
   {
@@ -230,7 +230,7 @@
     }
    ],
    "source": [
-    "guard = gd.Guard.from_pydantic(output_class=Recipe)"
+    "guard = gd.Guard.for_pydantic(output_class=Recipe)"
    ]
   },
   {
diff --git a/docs/examples/regex_validation.ipynb b/docs/examples/regex_validation.ipynb
index 4b5c598bb..6ab79b98d 100644
--- a/docs/examples/regex_validation.ipynb
+++ b/docs/examples/regex_validation.ipynb
@@ -58,7 +58,16 @@
    "cell_type": "code",
    "execution_count": 3,
    "metadata": {},
-   "outputs": [],
+   "outputs": [
+    {
+     "name": "stderr",
+     "output_type": "stream",
+     "text": [
+      "/home/zayd/workspace/guardrails/docs/.venv/lib/python3.11/site-packages/sentence_transformers/cross_encoder/CrossEncoder.py:13: TqdmExperimentalWarning: Using `tqdm.autonotebook.tqdm` in notebook mode. Use `tqdm.tqdm` instead to force console mode (e.g. in jupyter console)\n",
+      "  from tqdm.autonotebook import tqdm, trange\n"
+     ]
+    }
+   ],
    "source": [
     "from guardrails import Guard\n",
     "from guardrails.hub import RegexMatch\n",
@@ -80,32 +89,40 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 21,
+   "execution_count": 4,
    "metadata": {},
    "outputs": [
+    {
+     "name": "stderr",
+     "output_type": "stream",
+     "text": [
+      "/home/zayd/workspace/guardrails/docs/.venv/lib/python3.11/site-packages/guardrails/validator_service/__init__.py:85: UserWarning: Could not obtain an event loop. Falling back to synchronous validation.\n",
+      "  warnings.warn(\n"
+     ]
+    },
     {
      "data": {
       "text/html": [
        "
Logs\n",
        "├── ╭────────────────────────────────────────────────── Step 0 ───────────────────────────────────────────────────╮\n",
-       "│   │ ╭──────────────────────────────────────────────── Prompt ─────────────────────────────────────────────────╮ │\n",
+       "│   │ ╭──────────────────────────────────────────────── Prompt ─────────────────────────────────────────────────╮ │\n",
        "│   │ │ I am writing a movie and need a fake phone number. Generate a fake phone number. Do not write anything  │ │\n",
        "│   │ │ other than the phone number.                                                                            │ │\n",
        "│   │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │\n",
-       "│   │ ╭──────────────────────────────────────────── Message History ────────────────────────────────────────────╮ │\n",
+       "│   │ ╭──────────────────────────────────────────── Message History ────────────────────────────────────────────╮ │\n",
        "│   │ │ No message history.                                                                                     │ │\n",
        "│   │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │\n",
-       "│   │ ╭──────────────────────────────────────────── Raw LLM Output ─────────────────────────────────────────────╮ │\n",
+       "│   │ ╭──────────────────────────────────────────── Raw LLM Output ─────────────────────────────────────────────╮ │\n",
        "│   │ │ (555) 012-3456                                                                                          │ │\n",
        "│   │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │\n",
-       "│   │ ╭─────────────────────────────────────────── Validated Output ────────────────────────────────────────────╮ │\n",
+       "│   │ ╭─────────────────────────────────────────── Validated Output ────────────────────────────────────────────╮ │\n",
        "│   │ │ FieldReAsk(                                                                                             │ │\n",
        "│   │ │     incorrect_value='(555) 012-3456',                                                                   │ │\n",
        "│   │ │     fail_results=[                                                                                      │ │\n",
        "│   │ │         FailResult(                                                                                     │ │\n",
        "│   │ │             outcome='fail',                                                                             │ │\n",
        "│   │ │             error_message='Result must match \\\\d{3}-\\\\d{3}-\\\\d{4}',                                     │ │\n",
-       "│   │ │             fix_value='ah300-632-4603ah',                                                               │ │\n",
+       "│   │ │             fix_value='sh406-649-2143sh',                                                               │ │\n",
        "│   │ │             error_spans=None,                                                                           │ │\n",
        "│   │ │             metadata=None,                                                                              │ │\n",
        "│   │ │             validated_chunk=None                                                                        │ │\n",
@@ -117,7 +134,7 @@
        "│   │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │\n",
        "│   ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n",
        "└── ╭────────────────────────────────────────────────── Step 1 ───────────────────────────────────────────────────╮\n",
-       "    │ ╭──────────────────────────────────────────────── Prompt ─────────────────────────────────────────────────╮ │\n",
+       "    │ ╭──────────────────────────────────────────────── Prompt ─────────────────────────────────────────────────╮ │\n",
        "    │ │ This was a previous response you generated:                                                             │ │\n",
        "    │ │                                                                                                         │ │\n",
        "    │ │ ======                                                                                                  │ │\n",
@@ -135,13 +152,13 @@
        "    │ │ Don't talk; just go.                                                                                    │ │\n",
        "    │ │                                                                                                         │ │\n",
        "    │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │\n",
-       "    │ ╭──────────────────────────────────────────── Message History ────────────────────────────────────────────╮ │\n",
+       "    │ ╭──────────────────────────────────────────── Message History ────────────────────────────────────────────╮ │\n",
        "    │ │ No message history.                                                                                     │ │\n",
        "    │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │\n",
-       "    │ ╭──────────────────────────────────────────── Raw LLM Output ─────────────────────────────────────────────╮ │\n",
+       "    │ ╭──────────────────────────────────────────── Raw LLM Output ─────────────────────────────────────────────╮ │\n",
        "    │ │ 555-012-3456                                                                                            │ │\n",
        "    │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │\n",
-       "    │ ╭─────────────────────────────────────────── Validated Output ────────────────────────────────────────────╮ │\n",
+       "    │ ╭─────────────────────────────────────────── Validated Output ────────────────────────────────────────────╮ │\n",
        "    │ │ '555-012-3456'                                                                                          │ │\n",
        "    │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │\n",
        "    ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n",
@@ -150,24 +167,24 @@
       "text/plain": [
        "Logs\n",
        "├── ╭────────────────────────────────────────────────── Step 0 ───────────────────────────────────────────────────╮\n",
-       "│   │ \u001b[48;2;240;248;255m╭─\u001b[0m\u001b[48;2;240;248;255m───────────────────────────────────────────────\u001b[0m\u001b[48;2;240;248;255m Prompt \u001b[0m\u001b[48;2;240;248;255m────────────────────────────────────────────────\u001b[0m\u001b[48;2;240;248;255m─╮\u001b[0m │\n",
+       "│   │ \u001b[48;2;240;248;255m╭─\u001b[0m\u001b[48;2;240;248;255m───────────────────────────────────────────────\u001b[0m Prompt \u001b[48;2;240;248;255m────────────────────────────────────────────────\u001b[0m\u001b[48;2;240;248;255m─╮\u001b[0m │\n",
        "│   │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255mI am writing a movie and need a fake phone number. Generate a fake phone number. Do not write anything \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
        "│   │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255mother than the phone number.\u001b[0m\u001b[48;2;240;248;255m                                                                           \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
        "│   │ \u001b[48;2;240;248;255m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m │\n",
-       "│   │ \u001b[48;2;231;223;235m╭─\u001b[0m\u001b[48;2;231;223;235m───────────────────────────────────────────\u001b[0m\u001b[48;2;231;223;235m Message History \u001b[0m\u001b[48;2;231;223;235m───────────────────────────────────────────\u001b[0m\u001b[48;2;231;223;235m─╮\u001b[0m │\n",
+       "│   │ \u001b[48;2;231;223;235m╭─\u001b[0m\u001b[48;2;231;223;235m───────────────────────────────────────────\u001b[0m Message History \u001b[48;2;231;223;235m───────────────────────────────────────────\u001b[0m\u001b[48;2;231;223;235m─╮\u001b[0m │\n",
        "│   │ \u001b[48;2;231;223;235m│\u001b[0m\u001b[48;2;231;223;235m \u001b[0m\u001b[48;2;231;223;235mNo message history.\u001b[0m\u001b[48;2;231;223;235m                                                                                    \u001b[0m\u001b[48;2;231;223;235m \u001b[0m\u001b[48;2;231;223;235m│\u001b[0m │\n",
        "│   │ \u001b[48;2;231;223;235m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m │\n",
-       "│   │ \u001b[48;2;245;245;220m╭─\u001b[0m\u001b[48;2;245;245;220m───────────────────────────────────────────\u001b[0m\u001b[48;2;245;245;220m Raw LLM Output \u001b[0m\u001b[48;2;245;245;220m────────────────────────────────────────────\u001b[0m\u001b[48;2;245;245;220m─╮\u001b[0m │\n",
+       "│   │ \u001b[48;2;245;245;220m╭─\u001b[0m\u001b[48;2;245;245;220m───────────────────────────────────────────\u001b[0m Raw LLM Output \u001b[48;2;245;245;220m────────────────────────────────────────────\u001b[0m\u001b[48;2;245;245;220m─╮\u001b[0m │\n",
        "│   │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m(555) 012-3456\u001b[0m\u001b[48;2;245;245;220m                                                                                         \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
        "│   │ \u001b[48;2;245;245;220m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m │\n",
-       "│   │ \u001b[48;2;240;255;240m╭─\u001b[0m\u001b[48;2;240;255;240m──────────────────────────────────────────\u001b[0m\u001b[48;2;240;255;240m Validated Output \u001b[0m\u001b[48;2;240;255;240m───────────────────────────────────────────\u001b[0m\u001b[48;2;240;255;240m─╮\u001b[0m │\n",
+       "│   │ \u001b[48;2;240;255;240m╭─\u001b[0m\u001b[48;2;240;255;240m──────────────────────────────────────────\u001b[0m Validated Output \u001b[48;2;240;255;240m───────────────────────────────────────────\u001b[0m\u001b[48;2;240;255;240m─╮\u001b[0m │\n",
        "│   │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240mFieldReAsk(\u001b[0m\u001b[48;2;240;255;240m                                                                                            \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
        "│   │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m    incorrect_value='(555) 012-3456',\u001b[0m\u001b[48;2;240;255;240m                                                                  \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
        "│   │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m    fail_results=[\u001b[0m\u001b[48;2;240;255;240m                                                                                     \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
        "│   │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m        FailResult(\u001b[0m\u001b[48;2;240;255;240m                                                                                    \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
        "│   │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m            outcome='fail',\u001b[0m\u001b[48;2;240;255;240m                                                                            \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
        "│   │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m            error_message='Result must match \\\\d{3}-\\\\d{3}-\\\\d{4}',\u001b[0m\u001b[48;2;240;255;240m                                    \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
-       "│   │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m            fix_value='ah300-632-4603ah',\u001b[0m\u001b[48;2;240;255;240m                                                              \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
+       "│   │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m            fix_value='sh406-649-2143sh',\u001b[0m\u001b[48;2;240;255;240m                                                              \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
        "│   │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m            error_spans=None,\u001b[0m\u001b[48;2;240;255;240m                                                                          \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
        "│   │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m            metadata=None,\u001b[0m\u001b[48;2;240;255;240m                                                                             \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
        "│   │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m            validated_chunk=None\u001b[0m\u001b[48;2;240;255;240m                                                                       \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
@@ -179,7 +196,7 @@
        "│   │ \u001b[48;2;240;255;240m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m │\n",
        "│   ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n",
        "└── ╭────────────────────────────────────────────────── Step 1 ───────────────────────────────────────────────────╮\n",
-       "    │ \u001b[48;2;240;248;255m╭─\u001b[0m\u001b[48;2;240;248;255m───────────────────────────────────────────────\u001b[0m\u001b[48;2;240;248;255m Prompt \u001b[0m\u001b[48;2;240;248;255m────────────────────────────────────────────────\u001b[0m\u001b[48;2;240;248;255m─╮\u001b[0m │\n",
+       "    │ \u001b[48;2;240;248;255m╭─\u001b[0m\u001b[48;2;240;248;255m───────────────────────────────────────────────\u001b[0m Prompt \u001b[48;2;240;248;255m────────────────────────────────────────────────\u001b[0m\u001b[48;2;240;248;255m─╮\u001b[0m │\n",
        "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255mThis was a previous response you generated:\u001b[0m\u001b[48;2;240;248;255m                                                            \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
        "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m                                                                                                       \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
        "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m======\u001b[0m\u001b[48;2;240;248;255m                                                                                                 \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
@@ -197,13 +214,13 @@
        "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255mDon't talk; just go.\u001b[0m\u001b[48;2;240;248;255m                                                                                   \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
        "    │ \u001b[48;2;240;248;255m│\u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m                                                                                                       \u001b[0m\u001b[48;2;240;248;255m \u001b[0m\u001b[48;2;240;248;255m│\u001b[0m │\n",
        "    │ \u001b[48;2;240;248;255m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m │\n",
-       "    │ \u001b[48;2;231;223;235m╭─\u001b[0m\u001b[48;2;231;223;235m───────────────────────────────────────────\u001b[0m\u001b[48;2;231;223;235m Message History \u001b[0m\u001b[48;2;231;223;235m───────────────────────────────────────────\u001b[0m\u001b[48;2;231;223;235m─╮\u001b[0m │\n",
+       "    │ \u001b[48;2;231;223;235m╭─\u001b[0m\u001b[48;2;231;223;235m───────────────────────────────────────────\u001b[0m Message History \u001b[48;2;231;223;235m───────────────────────────────────────────\u001b[0m\u001b[48;2;231;223;235m─╮\u001b[0m │\n",
        "    │ \u001b[48;2;231;223;235m│\u001b[0m\u001b[48;2;231;223;235m \u001b[0m\u001b[48;2;231;223;235mNo message history.\u001b[0m\u001b[48;2;231;223;235m                                                                                    \u001b[0m\u001b[48;2;231;223;235m \u001b[0m\u001b[48;2;231;223;235m│\u001b[0m │\n",
        "    │ \u001b[48;2;231;223;235m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m │\n",
-       "    │ \u001b[48;2;245;245;220m╭─\u001b[0m\u001b[48;2;245;245;220m───────────────────────────────────────────\u001b[0m\u001b[48;2;245;245;220m Raw LLM Output \u001b[0m\u001b[48;2;245;245;220m────────────────────────────────────────────\u001b[0m\u001b[48;2;245;245;220m─╮\u001b[0m │\n",
+       "    │ \u001b[48;2;245;245;220m╭─\u001b[0m\u001b[48;2;245;245;220m───────────────────────────────────────────\u001b[0m Raw LLM Output \u001b[48;2;245;245;220m────────────────────────────────────────────\u001b[0m\u001b[48;2;245;245;220m─╮\u001b[0m │\n",
        "    │ \u001b[48;2;245;245;220m│\u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m555-012-3456\u001b[0m\u001b[48;2;245;245;220m                                                                                           \u001b[0m\u001b[48;2;245;245;220m \u001b[0m\u001b[48;2;245;245;220m│\u001b[0m │\n",
        "    │ \u001b[48;2;245;245;220m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m │\n",
-       "    │ \u001b[48;2;240;255;240m╭─\u001b[0m\u001b[48;2;240;255;240m──────────────────────────────────────────\u001b[0m\u001b[48;2;240;255;240m Validated Output \u001b[0m\u001b[48;2;240;255;240m───────────────────────────────────────────\u001b[0m\u001b[48;2;240;255;240m─╮\u001b[0m │\n",
+       "    │ \u001b[48;2;240;255;240m╭─\u001b[0m\u001b[48;2;240;255;240m──────────────────────────────────────────\u001b[0m Validated Output \u001b[48;2;240;255;240m───────────────────────────────────────────\u001b[0m\u001b[48;2;240;255;240m─╮\u001b[0m │\n",
        "    │ \u001b[48;2;240;255;240m│\u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m'555-012-3456'\u001b[0m\u001b[48;2;240;255;240m                                                                                         \u001b[0m\u001b[48;2;240;255;240m \u001b[0m\u001b[48;2;240;255;240m│\u001b[0m │\n",
        "    │ \u001b[48;2;240;255;240m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m │\n",
        "    ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n"
@@ -214,7 +231,7 @@
     }
    ],
    "source": [
-    "guard = Guard.from_string(\n",
+    "guard = Guard.for_string(\n",
     "    validators=[RegexMatch(regex=regex, match_type='search', on_fail='reask')]\n",
     ")\n",
     "\n",
@@ -243,7 +260,7 @@
    "name": "python",
    "nbconvert_exporter": "python",
    "pygments_lexer": "ipython3",
-   "version": "3.12.1"
+   "version": "3.11.7"
   },
   "orig_nbformat": 4
  },
diff --git a/docs/examples/response_is_on_topic.ipynb b/docs/examples/response_is_on_topic.ipynb
index 2432c508d..627457f25 100644
--- a/docs/examples/response_is_on_topic.ipynb
+++ b/docs/examples/response_is_on_topic.ipynb
@@ -58,7 +58,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 6,
+   "execution_count": 2,
    "metadata": {},
    "outputs": [],
    "source": [
@@ -136,14 +136,24 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 7,
+   "execution_count": 5,
    "metadata": {},
    "outputs": [
+    {
+     "name": "stderr",
+     "output_type": "stream",
+     "text": [
+      "/home/zayd/workspace/guardrails/docs/.venv/lib/python3.11/site-packages/sentence_transformers/cross_encoder/CrossEncoder.py:13: TqdmExperimentalWarning: Using `tqdm.autonotebook.tqdm` in notebook mode. Use `tqdm.tqdm` instead to force console mode (e.g. in jupyter console)\n",
+      "  from tqdm.autonotebook import tqdm, trange\n",
+      "/home/zayd/workspace/guardrails/docs/.venv/lib/python3.11/site-packages/guardrails/validator_service/__init__.py:85: UserWarning: Could not obtain an event loop. Falling back to synchronous validation.\n",
+      "  warnings.warn(\n"
+     ]
+    },
     {
      "name": "stdout",
      "output_type": "stream",
      "text": [
-      "Validation failed for field with errors: Invalid topics found: ['tablet', 'phone', 'computer']\n"
+      "Validation failed for field with errors: Invalid topics found: ['tablet', 'computer', 'phone']\n"
      ]
     }
    ],
@@ -153,7 +163,7 @@
     "from guardrails.errors import ValidationError\n",
     "\n",
     "# Create the Guard with the OnTopic Validator\n",
-    "guard = gd.Guard.from_string(\n",
+    "guard = gd.Guard.for_string(\n",
     "    validators=[\n",
     "        RestrictToTopic(\n",
     "            valid_topics=valid_topics,\n",
@@ -187,7 +197,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 8,
+   "execution_count": 6,
    "metadata": {},
    "outputs": [
     {
@@ -233,7 +243,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 9,
+   "execution_count": 7,
    "metadata": {},
    "outputs": [
     {
@@ -246,7 +256,7 @@
    ],
    "source": [
     "# Create the Guard with the OnTopic Validator\n",
-    "guard = gd.Guard.from_string(\n",
+    "guard = gd.Guard.for_string(\n",
     "    validators=[\n",
     "        RestrictToTopic(\n",
     "            valid_topics=valid_topics,\n",
@@ -285,7 +295,7 @@
    "name": "python",
    "nbconvert_exporter": "python",
    "pygments_lexer": "ipython3",
-   "version": "3.12.1"
+   "version": "3.11.7"
   }
  },
  "nbformat": 4,
diff --git a/docs/examples/secrets_detection.ipynb b/docs/examples/secrets_detection.ipynb
index 738ea8a18..fe2467ee6 100644
--- a/docs/examples/secrets_detection.ipynb
+++ b/docs/examples/secrets_detection.ipynb
@@ -41,7 +41,7 @@
      "output_type": "stream",
      "text": [
       "\n",
-      "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m A new release of pip is available: \u001b[0m\u001b[31;49m23.2.1\u001b[0m\u001b[39;49m -> \u001b[0m\u001b[32;49m24.1.1\u001b[0m\n",
+      "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m A new release of pip is available: \u001b[0m\u001b[31;49m23.2.1\u001b[0m\u001b[39;49m -> \u001b[0m\u001b[32;49m24.2\u001b[0m\n",
       "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m To update, run: \u001b[0m\u001b[32;49mpip install --upgrade pip\u001b[0m\n"
      ]
     }
@@ -55,7 +55,16 @@
    "cell_type": "code",
    "execution_count": 3,
    "metadata": {},
-   "outputs": [],
+   "outputs": [
+    {
+     "name": "stderr",
+     "output_type": "stream",
+     "text": [
+      "/home/zayd/workspace/guardrails/docs/.venv/lib/python3.11/site-packages/sentence_transformers/cross_encoder/CrossEncoder.py:13: TqdmExperimentalWarning: Using `tqdm.autonotebook.tqdm` in notebook mode. Use `tqdm.tqdm` instead to force console mode (e.g. in jupyter console)\n",
+      "  from tqdm.autonotebook import tqdm, trange\n"
+     ]
+    }
+   ],
    "source": [
     "# Import the guardrails package\n",
     "# and import the SecretsPresent validator\n",
@@ -75,7 +84,7 @@
     "# Here, we'll specify that we want to fix\n",
     "# if the validator detects secrets\n",
     "\n",
-    "guard = gd.Guard.from_string(\n",
+    "guard = gd.Guard.for_string(\n",
     "    validators=[SecretsPresent(on_fail=\"fix\")],\n",
     "    description=\"testmeout\",\n",
     ")"
@@ -86,6 +95,14 @@
    "execution_count": 5,
    "metadata": {},
    "outputs": [
+    {
+     "name": "stderr",
+     "output_type": "stream",
+     "text": [
+      "/home/zayd/workspace/guardrails/docs/.venv/lib/python3.11/site-packages/guardrails/validator_service/__init__.py:85: UserWarning: Could not obtain an event loop. Falling back to synchronous validation.\n",
+      "  warnings.warn(\n"
+     ]
+    },
     {
      "data": {
       "text/html": [
@@ -239,7 +256,7 @@
    "name": "python",
    "nbconvert_exporter": "python",
    "pygments_lexer": "ipython3",
-   "version": "3.12.1"
+   "version": "3.11.7"
   }
  },
  "nbformat": 4,
diff --git a/docs/examples/select_choice_based_on_action.ipynb b/docs/examples/select_choice_based_on_action.ipynb
index 17a106318..b77107ecf 100644
--- a/docs/examples/select_choice_based_on_action.ipynb
+++ b/docs/examples/select_choice_based_on_action.ipynb
@@ -171,7 +171,7 @@
     "\n",
     "from rich import print\n",
     "\n",
-    "guard = gd.Guard.from_rail_string(rail_str)"
+    "guard = gd.Guard.for_rail_string(rail_str)"
    ]
   },
   {
@@ -191,7 +191,7 @@
     "\n",
     "from rich import print\n",
     "\n",
-    "guard = gd.Guard.from_pydantic(output_class=FightOrFlight)"
+    "guard = gd.Guard.for_pydantic(output_class=FightOrFlight)"
    ]
   },
   {
diff --git a/docs/examples/summarizer.ipynb b/docs/examples/summarizer.ipynb
index 24c40eb17..d71565f9a 100644
--- a/docs/examples/summarizer.ipynb
+++ b/docs/examples/summarizer.ipynb
@@ -132,7 +132,7 @@
     "import guardrails as gd\n",
     "from guardrails.errors import ValidationError\n",
     "\n",
-    "guard = gd.Guard().from_pydantic(TextSummary)"
+    "guard = gd.Guard().for_pydantic(TextSummary)"
    ]
   },
   {
diff --git a/docs/examples/syntax_error_free_sql.ipynb b/docs/examples/syntax_error_free_sql.ipynb
index b8a944a79..4cf763b78 100644
--- a/docs/examples/syntax_error_free_sql.ipynb
+++ b/docs/examples/syntax_error_free_sql.ipynb
@@ -199,7 +199,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "guard = gd.Guard.from_rail_string(rail_str)"
+    "guard = gd.Guard.for_rail_string(rail_str)"
    ]
   },
   {
@@ -215,7 +215,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "guard = gd.Guard.from_pydantic(output_class=ValidSql)"
+    "guard = gd.Guard.for_pydantic(output_class=ValidSql)"
    ]
   },
   {
diff --git a/docs/examples/text_summarization_quality.ipynb b/docs/examples/text_summarization_quality.ipynb
index 0daf1f509..38b4bd8f4 100644
--- a/docs/examples/text_summarization_quality.ipynb
+++ b/docs/examples/text_summarization_quality.ipynb
@@ -197,7 +197,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "guard = gd.Guard.from_rail_string(rail_str)"
+    "guard = gd.Guard.for_rail_string(rail_str)"
    ]
   },
   {
@@ -213,7 +213,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "guard = gd.Guard.from_pydantic(output_class=DocumentSummary)"
+    "guard = gd.Guard.for_pydantic(output_class=DocumentSummary)"
    ]
   },
   {
diff --git a/docs/examples/translation_to_specific_language.ipynb b/docs/examples/translation_to_specific_language.ipynb
index 26f3a345d..6847296ed 100644
--- a/docs/examples/translation_to_specific_language.ipynb
+++ b/docs/examples/translation_to_specific_language.ipynb
@@ -214,7 +214,7 @@
    },
    "outputs": [],
    "source": [
-    "guard = gd.Guard.from_rail_string(rail_str)"
+    "guard = gd.Guard.for_rail_string(rail_str)"
    ]
   },
   {
@@ -230,7 +230,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "guard = gd.Guard.from_pydantic(output_class=Translation)"
+    "guard = gd.Guard.for_pydantic(output_class=Translation)"
    ]
   },
   {
diff --git a/docs/examples/valid_chess_moves.ipynb b/docs/examples/valid_chess_moves.ipynb
index 40a7880b5..194f8c0e8 100644
--- a/docs/examples/valid_chess_moves.ipynb
+++ b/docs/examples/valid_chess_moves.ipynb
@@ -184,7 +184,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "guard = gd.Guard.from_rail_string(rail_str)"
+    "guard = gd.Guard.for_rail_string(rail_str)"
    ]
   },
   {
@@ -200,7 +200,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "guard = gd.Guard.from_pydantic(output_class=ChessMove)"
+    "guard = gd.Guard.for_pydantic(output_class=ChessMove)"
    ]
   },
   {
diff --git a/docs/examples/value_within_distribution.ipynb b/docs/examples/value_within_distribution.ipynb
index 8f3730e7c..58ab87f6b 100644
--- a/docs/examples/value_within_distribution.ipynb
+++ b/docs/examples/value_within_distribution.ipynb
@@ -62,7 +62,7 @@
     "class MyModel(BaseModel):\n",
     "    value: int = Field(validators=[SimilarToPreviousValues(standard_deviations=2, threshold=0.8, on_fail=\"fix\")])\n",
     "\n",
-    "guard = Guard.from_pydantic(MyModel)"
+    "guard = Guard.for_pydantic(MyModel)"
    ]
   },
   {
diff --git a/docs/getting_started/quickstart.md b/docs/getting_started/quickstart.md
index 359bb4958..c29a5ed49 100644
--- a/docs/getting_started/quickstart.md
+++ b/docs/getting_started/quickstart.md
@@ -106,7 +106,7 @@ prompt = """
 
     ${gr.complete_json_suffix_v2}
 """
-guard = Guard.from_pydantic(output_class=Pet)
+guard = Guard.for_pydantic(output_class=Pet)
 
 res = guard(
     model="gpt-3.5-turbo",
diff --git a/docs/guardrails_ai/getting_started.md b/docs/guardrails_ai/getting_started.md
index 4c6cbb621..cdfa53f7c 100644
--- a/docs/guardrails_ai/getting_started.md
+++ b/docs/guardrails_ai/getting_started.md
@@ -84,7 +84,7 @@ prompt = """
 
     ${gr.complete_xml_suffix_v2}
 """
-guard = Guard.from_pydantic(output_class=Pet)
+guard = Guard.for_pydantic(output_class=Pet)
 
 res = guard(
     messages=[{"role": "user", "content": prompt}],
diff --git a/docs/how_to_guides/custom_validators.md b/docs/how_to_guides/custom_validators.md
index 5c5446605..141d530d8 100644
--- a/docs/how_to_guides/custom_validators.md
+++ b/docs/how_to_guides/custom_validators.md
@@ -286,7 +286,7 @@ class MyModel(BaseModel):
     a_string: Field(validators=[toxic_words()])
     custom_string: Field(validators=[ToxicLanguage(threshold=0.8)])
 
-guard = Guard.from_pydantic(MyModel)
+guard = Guard.for_pydantic(MyModel)
 ```
 
 ### RAIL Example
diff --git a/docs/how_to_guides/generate_structured_data.md b/docs/how_to_guides/generate_structured_data.md
index a3447f239..38147189e 100644
--- a/docs/how_to_guides/generate_structured_data.md
+++ b/docs/how_to_guides/generate_structured_data.md
@@ -29,7 +29,7 @@ class Delivery(BaseModel):
 class Schedule(BaseModel):
     deliveries: List[Delivery]
 
-guard = Guard.from_pydantic(Schedule)
+guard = Guard.for_pydantic(Schedule)
 chat_history="""
 nelson and murdock: i need a pickup 797 9th Avenue, manila envelope, June 3 10:00am with dropoff 10:30am Courthouse, 61 Center Street C/O frank james
 operator: quote - $23.00
@@ -101,7 +101,7 @@ response = guard(
 For Hugging Face models structured JSON output maybe returned utilizing constrained decoding. Constrained decoding is a technique that allows you to guide the model to generate a specific type of output, a little bit like JSON ad-libs. Learn more about constrained decoding [here](https://www.guardrailsai.com/blog/json-with-open-source-models).
 
 ```python
-g = Guard.from_pydantic(NewFriends, output_formatter="jsonformer")
+g = Guard.for_pydantic(NewFriends, output_formatter="jsonformer")
 
 # JSONFormer is only compatible with HF Pipelines and HF Models:
 from transformers import pipeline
diff --git a/docs/how_to_guides/rail.md b/docs/how_to_guides/rail.md
index 3024a211c..68d4db21f 100644
--- a/docs/how_to_guides/rail.md
+++ b/docs/how_to_guides/rail.md
@@ -97,7 +97,7 @@ After creating a `RAIL` specification, you can use it to get corrected output fr
 import guardrails as gd
 
 # Create a Guard object
-guard = gd.Guard.from_rail('path/to/rail/spec.xml')  # (1)!
+guard = gd.Guard.for_rail('path/to/rail/spec.xml')  # (1)!
 _, validated_output, *rest = guard(
     openai.Completion.create,  # (2)!
     **prompt_args,
diff --git a/docs/how_to_guides/structured_data_with_guardrails.mdx b/docs/how_to_guides/structured_data_with_guardrails.mdx
index f7559deb6..3be84bc6c 100644
--- a/docs/how_to_guides/structured_data_with_guardrails.mdx
+++ b/docs/how_to_guides/structured_data_with_guardrails.mdx
@@ -33,7 +33,7 @@ Below is the syntax for generating structured data with Guardrails AI using `Pyd
     ```python
     from guardrails import Guard
 
-    guard = Guard.from_pydantic(Person)
+    guard = Guard.for_pydantic(Person)
     ```
 
     Finally, call the LLM of your choice with the `guard` object to generate structured data.
@@ -62,7 +62,7 @@ Below is the syntax for generating structured data with Guardrails AI using `Pyd
     ```python
     from guardrails import Guard
 
-    guard = Guard.from_rail_string("""
+    guard = Guard.for_rail_string("""
       
         
           
diff --git a/docs/how_to_guides/telemetry.mdx b/docs/how_to_guides/telemetry.mdx
index d3a0b6724..7975b5804 100644
--- a/docs/how_to_guides/telemetry.mdx
+++ b/docs/how_to_guides/telemetry.mdx
@@ -61,7 +61,7 @@ import openai
 # use a descriptive name that will differentiate where your metrics are stored
 default_otlp_tracer("petname_guard")
 
-guard = Guard.from_string(
+guard = Guard.for_string(
   validators=[ValidLength(min=1, max=10, on_fail=OnFailAction.EXCEPTION)],
 )
 
@@ -133,7 +133,7 @@ import openai
 # use a descriptive name that will differentiate where your metrics are stored
 default_otel_collector_tracer("petname_guard")
 
-guard = Guard.from_string(
+guard = Guard.for_string(
   validators=[ValidLength(min=1, max=10, on_fail=OnFailAction.EXCEPTION)],
 )
 
diff --git a/docs/how_to_guides/using_llms.md b/docs/how_to_guides/using_llms.md
index 6ec4641da..e6b26a3b8 100644
--- a/docs/how_to_guides/using_llms.md
+++ b/docs/how_to_guides/using_llms.md
@@ -58,7 +58,7 @@ class Fruit(BaseModel):
 class Basket(BaseModel):
     fruits: List[Fruit]
     
-guard = Guard.from_pydantic(Basket)
+guard = Guard.for_pydantic(Basket)
 
 result = guard(
     messages=[{"role":"user", "content":"Generate a basket of 5 fruits"}],
@@ -170,7 +170,7 @@ class Fruit(BaseModel):
 class Basket(BaseModel):
     fruits: List[Fruit]
     
-guard = Guard.from_pydantic(Basket)
+guard = Guard.for_pydantic(Basket)
 
 result = guard(
     messages=[{"role":"user", "content":"Generate a basket of 5 fruits"}],
@@ -235,7 +235,7 @@ class Fruit(BaseModel):
 class Basket(BaseModel):
     fruits: List[Fruit]
     
-guard = Guard.from_pydantic(Basket)
+guard = Guard.for_pydantic(Basket)
 
 result = guard(
     messages=[{"role":"user", "content":"Generate a basket of 5 fruits"}],
diff --git a/docs/hub/concepts/validators.md b/docs/hub/concepts/validators.md
index 1530ec1a7..9b20f499a 100644
--- a/docs/hub/concepts/validators.md
+++ b/docs/hub/concepts/validators.md
@@ -15,7 +15,7 @@ Occasionally, validators need addtional metadata that is only available during r
 As an example, the `ExtractedSummarySentencesMatch` validator accepts a `filepaths` property in the metadata dictionary to specify what source files to compare the summary against to ensure similarity.  Unlike arguments which are specified at validator initialization, metadata is specified when calling `guard.validate`. For more information on how to use metadata, see [How to use Metadata](/docs/hub/how_to_guides/metadata.md).
 
 ```python
-guard = Guard.from_rail("my_railspec.rail")
+guard = Guard.for_rail("my_railspec.rail")
 
 outcome = guard(
     llm_api=openai.chat.completions.create,
diff --git a/docs/hub/how_to_guides/metadata.md b/docs/hub/how_to_guides/metadata.md
index 606d61f30..070165f78 100644
--- a/docs/hub/how_to_guides/metadata.md
+++ b/docs/hub/how_to_guides/metadata.md
@@ -28,7 +28,7 @@ val = ProvenanceLLM(
 )
 
 # Setup Guard
-guard = Guard.from_string(validators=[val])
+guard = Guard.for_string(validators=[val])
 ```
 
 Below, we show how to pass the metadata to the `guard.validate` method.
diff --git a/docs/hub/how_to_guides/structured_data_validation.md b/docs/hub/how_to_guides/structured_data_validation.md
index 7a28e3e56..1f8c7b0e9 100644
--- a/docs/hub/how_to_guides/structured_data_validation.md
+++ b/docs/hub/how_to_guides/structured_data_validation.md
@@ -44,7 +44,7 @@ Create a Pydantic `Guard` object and pass the `Data` model to it.
 ```py
 from guardrails import Guard
 
-guard = Guard.from_pydantic(Data)
+guard = Guard.for_pydantic(Data)
 ```
 
 ## Validate the Structured Data
diff --git a/docs/integrations/azure_openai.ipynb b/docs/integrations/azure_openai.ipynb
index 9040ef06e..f451decb3 100644
--- a/docs/integrations/azure_openai.ipynb
+++ b/docs/integrations/azure_openai.ipynb
@@ -93,7 +93,7 @@
    "source": [
     "import guardrails as gr\n",
     "\n",
-    "guard = gr.Guard.from_rail_string(rail)"
+    "guard = gr.Guard.for_rail_string(rail)"
    ]
   },
   {
diff --git a/docs/integrations/openai_functions.ipynb b/docs/integrations/openai_functions.ipynb
index e66d440aa..0141f91bc 100644
--- a/docs/integrations/openai_functions.ipynb
+++ b/docs/integrations/openai_functions.ipynb
@@ -76,7 +76,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "guard = gd.Guard.from_pydantic(Director, prompt=\"Generate data about a movie director.\")\n",
+    "guard = gd.Guard.for_pydantic(Director, prompt=\"Generate data about a movie director.\")\n",
     "\n",
     "raw_llm_output, validated_output, *rest = guard(\n",
     "    openai.chat.completions.create,\n",
diff --git a/docs/integrations/telemetry/grafana.mdx b/docs/integrations/telemetry/grafana.mdx
index 694b0c285..d5f5e96c1 100644
--- a/docs/integrations/telemetry/grafana.mdx
+++ b/docs/integrations/telemetry/grafana.mdx
@@ -52,7 +52,7 @@ import openai
 # use a descriptive name that will differentiate where your metrics are stored
 default_otlp_tracer("petname_guard")
 
-guard = Guard.from_string(
+guard = Guard.for_string(
   validators=[ValidLength(min=1, max=10, on_fail=OnFailAction.EXCEPTION)],
 )
 
diff --git a/docs/llm_api_wrappers.md b/docs/llm_api_wrappers.md
index c62f6e090..3c78e145d 100644
--- a/docs/llm_api_wrappers.md
+++ b/docs/llm_api_wrappers.md
@@ -15,7 +15,7 @@ import guardrails as gd
 
 
 # Create a Guard class
-guard = gd.Guard.from_rail(...)
+guard = gd.Guard.for_rail(...)
 
 # Wrap openai API call
 raw_llm_output, guardrail_output, *rest = guard(
@@ -34,7 +34,7 @@ import openai
 import guardrails as gd
 
 # Create a Guard class
-guard = gd.Guard.from_rail(...)
+guard = gd.Guard.for_rail(...)
 
 # Wrap openai API call
 raw_llm_output, guardrail_output, *rest = guard(
@@ -56,7 +56,7 @@ import cohere
 import guardrails as gd
 
 # Create a Guard class
-guard = gd.Guard.from_rail(...)
+guard = gd.Guard.for_rail(...)
 
 # Create a Cohere client
 cohere_client = cohere.Client(api_key="my_api_key")
@@ -80,7 +80,7 @@ from anthropic import Anthropic
 import guardrails as gd
 
 # Create a Guard class
-guard = gd.Guard.from_rail(...)
+guard = gd.Guard.for_rail(...)
 
 # Create an Anthropic client
 anthropic_client = Anthropic(api_key="my_api_key")
@@ -130,7 +130,7 @@ model_inputs = tokenizer(prompt, return_tensors="pt").to(torch_device)
 
 
 # Create the Guard
-guard = Guard.from_string(
+guard = Guard.for_string(
     validators=[
         ValidLength(
             min=48,
@@ -175,7 +175,7 @@ generator = pipeline("text-generation", model="facebook/opt-350m")
 
 
 # Create the Guard
-guard = Guard.from_string(
+guard = Guard.for_string(
     validators=[
         ValidLength(
             min=48,
@@ -210,7 +210,7 @@ import guardrails as gd
 import manifest
 
 # Create a Guard class
-guard = gd.Guard.from_rail(...)
+guard = gd.Guard.for_rail(...)
 
 # Create a Manifest client - this one points to GPT-4
 # and caches responses in SQLLite
@@ -237,7 +237,7 @@ raw_llm_output, guardrail_output, *rest = guard(
 import guardrails as gd
 
 # Create a Guard class
-guard = gd.Guard.from_rail(...)
+guard = gd.Guard.for_rail(...)
 
 # Function that takes the prompt as a string and returns the LLM output as string
 def my_llm_api(prompt: str, **kwargs) -> str:
diff --git a/docs/pydocs/api_reference/guards.py b/docs/pydocs/api_reference/guards.py
index 6cdb1a36c..fd7ce34ad 100644
--- a/docs/pydocs/api_reference/guards.py
+++ b/docs/pydocs/api_reference/guards.py
@@ -11,10 +11,10 @@
         "guardrails.guard",
         "guard",
         "__init__",
-        "from_rail",
-        "from_rail_string",
-        "from_pydantic",
-        "from_string",
+        "for_rail",
+        "for_rail_string",
+        "for_pydantic",
+        "for_string",
         "configure",
         "use",
         "use_many",
@@ -32,10 +32,10 @@
         "guardrails.async_guard",
         "async_guard",
         "__init__",
-        "from_rail",
-        "from_rail_string",
-        "from_pydantic",
-        "from_string",
+        "for_rail",
+        "for_rail_string",
+        "for_pydantic",
+        "for_string",
         "configure",
         "use",
         "use_many",
diff --git a/guardrails/applications/text2sql.py b/guardrails/applications/text2sql.py
index 8c97b7d12..8bb117fe1 100644
--- a/guardrails/applications/text2sql.py
+++ b/guardrails/applications/text2sql.py
@@ -139,7 +139,7 @@ def _init_guard(
         if rail_params is not None:
             rail_spec_str = Template(rail_spec_str).safe_substitute(**rail_params)
 
-        guard = Guard.from_rail_string(rail_spec_str)
+        guard = Guard.for_rail_string(rail_spec_str)
         guard._exec_opts.reask_prompt = reask_prompt
 
         return guard
diff --git a/guardrails/async_guard.py b/guardrails/async_guard.py
index 9af740711..d66a24e92 100644
--- a/guardrails/async_guard.py
+++ b/guardrails/async_guard.py
@@ -51,10 +51,10 @@ class AsyncGuard(Guard, Generic[OT]):
     This class one of the main entry point for using Guardrails. It is
     initialized from one of the following class methods:
 
-    - `from_rail`
-    - `from_rail_string`
-    - `from_pydantic`
-    - `from_string`
+    - `for_rail`
+    - `for_rail_string`
+    - `for_pydantic`
+    - `for_string`
 
     The `__call__`
     method functions as a wrapper around LLM APIs. It takes in an Async LLM
@@ -63,7 +63,7 @@ class AsyncGuard(Guard, Generic[OT]):
     """
 
     @classmethod
-    def _from_rail_schema(
+    def _for_rail_schema(
         cls,
         schema: ProcessedSchema,
         rail: str,
@@ -73,7 +73,7 @@ def _from_rail_schema(
         name: Optional[str] = None,
         description: Optional[str] = None,
     ):
-        guard = super()._from_rail_schema(
+        guard = super()._for_rail_schema(
             schema,
             rail,
             num_reasks=num_reasks,
@@ -89,7 +89,7 @@ def _from_rail_schema(
             return cast(AsyncGuard[Dict], guard)
 
     @classmethod
-    def from_pydantic(
+    def for_pydantic(
         cls,
         output_class: ModelOrListOfModels,
         *,
@@ -103,7 +103,7 @@ def from_pydantic(
         name: Optional[str] = None,
         description: Optional[str] = None,
     ):
-        guard = super().from_pydantic(
+        guard = super().for_pydantic(
             output_class,
             prompt=prompt,
             instructions=instructions,
@@ -121,7 +121,7 @@ def from_pydantic(
             return cast(AsyncGuard[Dict], guard)
 
     @classmethod
-    def from_string(
+    def for_string(
         cls,
         validators: Sequence[Validator],
         *,
@@ -135,7 +135,7 @@ def from_string(
         name: Optional[str] = None,
         description: Optional[str] = None,
     ):
-        guard = super().from_string(
+        guard = super().for_string(
             validators,
             string_description=string_description,
             prompt=prompt,
diff --git a/guardrails/cli/validate.py b/guardrails/cli/validate.py
index 958b4083a..314515987 100644
--- a/guardrails/cli/validate.py
+++ b/guardrails/cli/validate.py
@@ -10,7 +10,7 @@
 
 def validate_llm_output(rail: str, llm_output: str) -> Union[str, Dict, List, None]:
     """Validate guardrails.yml file."""
-    guard = Guard.from_rail(rail)
+    guard = Guard.for_rail(rail)
     result = guard.parse(llm_output)
     return result.validated_output
 
diff --git a/guardrails/guard.py b/guardrails/guard.py
index 8f3fd4332..95ae6567b 100644
--- a/guardrails/guard.py
+++ b/guardrails/guard.py
@@ -16,6 +16,7 @@
     cast,
     overload,
 )
+from typing_extensions import deprecated
 import warnings
 from langchain_core.runnables import Runnable
 
@@ -105,10 +106,10 @@ class Guard(IGuard, Generic[OT]):
 
     - `Guard().use(...)`
     - `Guard().use_many(...)`
-    - `Guard.from_string(...)`
-    - `Guard.from_pydantic(...)`
-    - `Guard.from_rail(...)`
-    - `Guard.from_rail_string(...)`
+    - `Guard.for_string(...)`
+    - `Guard.for_pydantic(...)`
+    - `Guard.for_rail(...)`
+    - `Guard.for_rail_string(...)`
 
     The `__call__`
     method functions as a wrapper around LLM APIs. It takes in an LLM
@@ -369,7 +370,7 @@ def _fill_exec_opts(
             self._exec_opts.reask_instructions = reask_instructions
 
     @classmethod
-    def _from_rail_schema(
+    def _for_rail_schema(
         cls,
         schema: ProcessedSchema,
         rail: str,
@@ -399,8 +400,15 @@ def _from_rail_schema(
         guard._fill_validators()
         return guard
 
+    @deprecated(
+        "Use `for_rail` instead. This method will be removed in 0.6.x.", category=None
+    )
     @classmethod
-    def from_rail(
+    def from_rail(cls, rail_file: str, *args, **kwargs):
+        return cls.for_rail(rail_file, *args, **kwargs)
+
+    @classmethod
+    def for_rail(
         cls,
         rail_file: str,
         *,
@@ -439,7 +447,7 @@ def from_rail(
         cls._set_tracer(cls, tracer)  # type: ignore
 
         schema = rail_file_to_schema(rail_file)
-        return cls._from_rail_schema(
+        return cls._for_rail_schema(
             schema,
             rail=rail_file,
             num_reasks=num_reasks,
@@ -448,8 +456,21 @@ def from_rail(
             description=description,
         )
 
+    @deprecated(
+        "Use `for_rail_string` instead. This method will be removed in 0.6.x.",
+        category=None,
+    )
     @classmethod
     def from_rail_string(
+        cls,
+        rail_string: str,
+        *args,
+        **kwargs,
+    ):
+        return cls.for_rail_string(rail_string, *args, **kwargs)
+
+    @classmethod
+    def for_rail_string(
         cls,
         rail_string: str,
         *,
@@ -488,7 +509,7 @@ def from_rail_string(
         cls._set_tracer(cls, tracer)  # type: ignore
 
         schema = rail_string_to_schema(rail_string)
-        return cls._from_rail_schema(
+        return cls._for_rail_schema(
             schema,
             rail=rail_string,
             num_reasks=num_reasks,
@@ -497,8 +518,16 @@ def from_rail_string(
             description=description,
         )
 
+    @deprecated(
+        "Use `for_pydantic` instead. This method will be removed in 0.6.x.",
+        category=None,
+    )
     @classmethod
-    def from_pydantic(
+    def from_pydantic(cls, output_class: ModelOrListOfModels, *args, **kwargs):
+        return cls.for_pydantic(output_class, **kwargs)
+
+    @classmethod
+    def for_pydantic(
         cls,
         output_class: ModelOrListOfModels,
         *,
@@ -597,8 +626,22 @@ def from_pydantic(
         guard._fill_validators()
         return guard
 
+    @deprecated(
+        """Use `use`, `use_many`, or `for_string` instead.
+                This method will be removed in 0.6.x.""",
+        category=None,
+    )
     @classmethod
     def from_string(
+        cls,
+        validators: Sequence[Validator],
+        *args,
+        **kwargs,
+    ):
+        return cls.for_string(validators, *args, **kwargs)
+
+    @classmethod
+    def for_string(
         cls,
         validators: Sequence[Validator],
         *,
diff --git a/guardrails/utils/validator_utils.py b/guardrails/utils/validator_utils.py
index b6d60ba02..cc14f694e 100644
--- a/guardrails/utils/validator_utils.py
+++ b/guardrails/utils/validator_utils.py
@@ -126,7 +126,7 @@ def get_validator(
     # Guard.use syntax
     elif isinstance(validator, Type) and issubclass(validator, Validator):
         return validator(*args, **kwargs)
-    # Guard.useMany or Guard.from_pydantic syntax
+    # Guard.useMany or Guard.for_pydantic syntax
     elif isinstance(validator, Tuple):
         first_arg = safe_get(validator, 0)
         # useMany Tuple Syntax
@@ -140,7 +140,7 @@ def get_validator(
             if v:
                 return v
         raise invalid_error
-    # Guard.from_rail or Guard.from_rail_string syntax
+    # Guard.for_rail or Guard.for_rail_string syntax
     elif isinstance(validator, str):
         v = parse_rail_validator(validator)
         if v:
diff --git a/tests/integration_tests/test_async.py b/tests/integration_tests/test_async.py
index 9766a1322..a7cdb516b 100644
--- a/tests/integration_tests/test_async.py
+++ b/tests/integration_tests/test_async.py
@@ -35,7 +35,7 @@ async def test_entity_extraction_with_reask(mocker):
     ]
 
     content = docs_utils.read_pdf("docs/examples/data/chase_card_agreement.pdf")
-    guard = AsyncGuard.from_rail_string(entity_extraction.RAIL_SPEC_WITH_REASK)
+    guard = AsyncGuard.for_rail_string(entity_extraction.RAIL_SPEC_WITH_REASK)
 
     from guardrails.run import async_runner
 
@@ -99,7 +99,7 @@ async def test_entity_extraction_with_noop(mocker):
         )
     ]
     content = docs_utils.read_pdf("docs/examples/data/chase_card_agreement.pdf")
-    guard = AsyncGuard.from_rail_string(entity_extraction.RAIL_SPEC_WITH_NOOP)
+    guard = AsyncGuard.for_rail_string(entity_extraction.RAIL_SPEC_WITH_NOOP)
     final_output = await guard(
         llm_api=mock_async_llm,
         prompt_params={"document": content[:6000]},
@@ -143,7 +143,7 @@ async def test_entity_extraction_with_noop_pydantic(mocker):
         )
     ]
     content = docs_utils.read_pdf("docs/examples/data/chase_card_agreement.pdf")
-    guard = AsyncGuard.from_pydantic(
+    guard = AsyncGuard.for_pydantic(
         entity_extraction.PYDANTIC_RAIL_WITH_NOOP,
         prompt=entity_extraction.PYDANTIC_PROMPT,
     )
@@ -187,7 +187,7 @@ async def test_entity_extraction_with_filter(mocker):
     ]
 
     content = docs_utils.read_pdf("docs/examples/data/chase_card_agreement.pdf")
-    guard = AsyncGuard.from_rail_string(entity_extraction.RAIL_SPEC_WITH_FILTER)
+    guard = AsyncGuard.for_rail_string(entity_extraction.RAIL_SPEC_WITH_FILTER)
     final_output = await guard(
         llm_api=mock_async_llm,
         prompt_params={"document": content[:6000]},
@@ -227,7 +227,7 @@ async def test_entity_extraction_with_fix(mocker):
     ]
 
     content = docs_utils.read_pdf("docs/examples/data/chase_card_agreement.pdf")
-    guard = AsyncGuard.from_rail_string(entity_extraction.RAIL_SPEC_WITH_FIX)
+    guard = AsyncGuard.for_rail_string(entity_extraction.RAIL_SPEC_WITH_FIX)
     final_output = await guard(
         llm_api=mock_async_llm,
         prompt_params={"document": content[:6000]},
@@ -264,7 +264,7 @@ async def test_entity_extraction_with_refrain(mocker):
     ]
 
     content = docs_utils.read_pdf("docs/examples/data/chase_card_agreement.pdf")
-    guard = AsyncGuard.from_rail_string(entity_extraction.RAIL_SPEC_WITH_REFRAIN)
+    guard = AsyncGuard.for_rail_string(entity_extraction.RAIL_SPEC_WITH_REFRAIN)
     final_output = await guard(
         llm_api=mock_async_llm,
         prompt_params={"document": content[:6000]},
@@ -289,7 +289,7 @@ async def test_entity_extraction_with_refrain(mocker):
 @pytest.mark.asyncio
 async def test_rail_spec_output_parse(rail_spec, llm_output, validated_output):
     """Test that the rail_spec fixture is working."""
-    guard = AsyncGuard.from_rail_string(rail_spec)
+    guard = AsyncGuard.for_rail_string(rail_spec)
     output = await guard.parse(
         llm_output,
         llm_api=mock_async_llm,
@@ -328,7 +328,7 @@ async def test_string_rail_spec_output_parse(
     string_rail_spec, string_llm_output, validated_string_output
 ):
     """Test that the string_rail_spec fixture is working."""
-    guard: AsyncGuard = AsyncGuard.from_rail_string(string_rail_spec)
+    guard: AsyncGuard = AsyncGuard.for_rail_string(string_rail_spec)
     output = await guard.parse(
         string_llm_output,
         llm_api=mock_async_llm,
diff --git a/tests/integration_tests/test_data_validation.py b/tests/integration_tests/test_data_validation.py
index 8a4c32865..72cad869e 100644
--- a/tests/integration_tests/test_data_validation.py
+++ b/tests/integration_tests/test_data_validation.py
@@ -67,7 +67,7 @@ def test_choice_validation(llm_output, raises, fails, has_error):
 
 
 """
-    guard = Guard.from_rail_string(rail_spec)
+    guard = Guard.for_rail_string(rail_spec)
 
     # If raises is True, then the test should raise an exception.
     # For our existing test cases this will always be a ValidationError
@@ -117,7 +117,7 @@ class Flight(BaseModel):
     class Choice(BaseModel):
         choice: Union[Fight, Flight] = Field(..., discriminator="action")
 
-    guard = Guard.from_pydantic(output_class=Choice, prompt="Dummy prompt.")
+    guard = Guard.for_pydantic(output_class=Choice, prompt="Dummy prompt.")
 
     # If raises is True, then the test should raise an exception.
     # For our existing test cases this will always be a ValidationError
diff --git a/tests/integration_tests/test_datatypes.py b/tests/integration_tests/test_datatypes.py
index 05a842ca0..2be91e67b 100644
--- a/tests/integration_tests/test_datatypes.py
+++ b/tests/integration_tests/test_datatypes.py
@@ -21,7 +21,7 @@ def test_passed_date_format():
 
 """
 
-    guard = Guard.from_rail_string(rail_spec)
+    guard = Guard.for_rail_string(rail_spec)
     guard.parse(llm_output='{"name": "John Doe", "dob": "2021-01-01"}', num_reasks=0)
 
 
@@ -50,7 +50,7 @@ def test_defaulted_date_parser(date_string: str):
 
 """
 
-    guard = Guard.from_rail_string(rail_spec)
+    guard = Guard.for_rail_string(rail_spec)
     # This should not raise an exception
     guard.parse(
         llm_output='{"name": "John Doe", "dob": "' + date_string + '"}', num_reasks=0
@@ -86,7 +86,7 @@ def test_defaulted_date_parser_unsupported_values(
 
 """
 
-    guard = Guard.from_rail_string(rail_spec)
+    guard = Guard.for_rail_string(rail_spec)
     with pytest.raises(Exception) as excinfo:
         guard.parse(
             llm_output='{"name": "John Doe", "dob": "' + date_string + '"}',
diff --git a/tests/integration_tests/test_formatters.py b/tests/integration_tests/test_formatters.py
index 48f9628b8..90cb3009a 100644
--- a/tests/integration_tests/test_formatters.py
+++ b/tests/integration_tests/test_formatters.py
@@ -24,7 +24,7 @@ class Foo(BaseModel):
         bar: str
         bez: List[str]
 
-    g = Guard.from_pydantic(Foo, output_formatter="jsonformer")
+    g = Guard.for_pydantic(Foo, output_formatter="jsonformer")
     response = g(model.generate, tokenizer=tokenizer, prompt="test")
     validated_output = response.validated_output
     assert isinstance(validated_output, dict)
@@ -44,7 +44,7 @@ class Foo(BaseModel):
         bar: str
         bez: List[str]
 
-    g = Guard.from_pydantic(Foo, output_formatter="jsonformer")
+    g = Guard.for_pydantic(Foo, output_formatter="jsonformer")
     response = g(model, prompt="Sample:")
     validated_output = response.validated_output
     assert isinstance(validated_output, dict)
@@ -68,7 +68,7 @@ class MultiNum(BaseModel):
     class Tricky(BaseModel):
         foo: MultiNum
 
-    g = Guard.from_pydantic(Tricky, output_formatter="jsonformer")
+    g = Guard.for_pydantic(Tricky, output_formatter="jsonformer")
     response = g(model, prompt="Sample:")
     out = response.validated_output
     assert isinstance(out, dict)
diff --git a/tests/integration_tests/test_guard.py b/tests/integration_tests/test_guard.py
index 4038ae18d..86a258cdb 100644
--- a/tests/integration_tests/test_guard.py
+++ b/tests/integration_tests/test_guard.py
@@ -110,14 +110,14 @@ def guard_initializer(
     """Helper function to initialize a Guard using the correct method."""
 
     if isinstance(rail, str):
-        return Guard.from_rail_string(rail)
+        return Guard.for_rail_string(rail)
     else:
-        return Guard.from_pydantic(rail, prompt=prompt, instructions=instructions)
+        return Guard.for_pydantic(rail, prompt=prompt, instructions=instructions)
 
 
 '''def test_rail_spec_output_parse(rail_spec, llm_output, validated_output):
     """Test that the rail_spec fixture is working."""
-    guard = gd.Guard.from_rail_string(rail_spec)
+    guard = gd.Guard.for_rail_string(rail_spec)
     assert guard.parse(llm_output) == validated_output'''
 
 
@@ -455,7 +455,7 @@ def test_entity_extraction_with_fix_chat_models(mocker, rail, prompt, instructio
         "guardrails.llm_providers.openai_wrapper", new=openai_completion_create
     )
 
-    guard = gd.Guard.from_rail_string(string.RAIL_SPEC_FOR_LIST)
+    guard = gd.Guard.for_rail_string(string.RAIL_SPEC_FOR_LIST)
     _, final_output, *rest = guard(
         llm_api=openai.completions.create,
         num_reasks=1,
@@ -566,7 +566,7 @@ def test_entity_extraction_with_reask_with_optional_prompts(
     mock_openai_invoke_llm.side_effect = llm_return_values
 
     content = gd.docs_utils.read_pdf("docs/examples/data/chase_card_agreement.pdf")
-    guard = Guard.from_rail_string(rail)
+    guard = Guard.for_rail_string(rail)
 
     final_output = guard(
         llm_api=llm_api,
@@ -662,7 +662,7 @@ def test_skeleton_reask(mocker):
         )
 
         content = gd.docs_utils.read_pdf("docs/examples/data/chase_card_agreement.pdf")
-        guard = gd.Guard.from_rail_string(
+        guard = gd.Guard.for_rail_string(
             entity_extraction.RAIL_SPEC_WITH_SKELETON_REASK
         )
         final_output = guard(
@@ -708,7 +708,7 @@ def test_string_with_message_history_reask(mocker):
         new=MockOpenAIChatCallable,
     )
 
-    guard = gd.Guard.from_rail_string(string.RAIL_SPEC_FOR_MSG_HISTORY)
+    guard = gd.Guard.for_rail_string(string.RAIL_SPEC_FOR_MSG_HISTORY)
     final_output = guard(
         llm_api=openai.chat.completions.create,
         msg_history=string.MOVIE_MSG_HISTORY,
@@ -764,7 +764,7 @@ def test_pydantic_with_message_history_reask(mocker):
         },
     )
 
-    guard = gd.Guard.from_pydantic(output_class=pydantic.WITH_MSG_HISTORY)
+    guard = gd.Guard.for_pydantic(output_class=pydantic.WITH_MSG_HISTORY)
     final_output = guard(
         llm_api=openai.chat.completions.create,
         msg_history=string.MOVIE_MSG_HISTORY,
@@ -898,7 +898,7 @@ def custom_llm(
         nonlocal return_value
         return return_value
 
-    guard = gd.Guard.from_pydantic(Task)
+    guard = gd.Guard.for_pydantic(Task)
     _, dict_o, *rest = guard(
         custom_llm,
         prompt="What is the status of this task?",
@@ -906,7 +906,7 @@ def custom_llm(
     assert dict_o == {"status": "not started"}
 
     return_value = pydantic.LLM_OUTPUT_ENUM_2
-    guard = gd.Guard.from_pydantic(Task)
+    guard = gd.Guard.for_pydantic(Task)
     result = guard(
         custom_llm,
         prompt="What is the status of this task REALLY?",
@@ -970,7 +970,7 @@ def test_pydantic_with_lite_llm(mocker):
             response_token_count=1234,
         ),
     ]
-    guard = gd.Guard.from_pydantic(output_class=pydantic.WITH_MSG_HISTORY)
+    guard = gd.Guard.for_pydantic(output_class=pydantic.WITH_MSG_HISTORY)
     final_output = guard(
         messages=string.MOVIE_MSG_HISTORY, model="gpt-3.5-turbo", max_tokens=10
     )
@@ -997,7 +997,7 @@ def test_string_output(mocker):
         )
     ]
 
-    guard = gd.Guard.from_rail_string(string.RAIL_SPEC_FOR_STRING)
+    guard = gd.Guard.for_rail_string(string.RAIL_SPEC_FOR_STRING)
     final_output = guard(
         llm_api=openai.completions.create,
         prompt_params={"ingredients": "tomato, cheese, sour cream"},
@@ -1058,7 +1058,7 @@ class Task(BaseModel):
     class Tasks(BaseModel):
         list: List[Task]
 
-    guard = Guard.from_pydantic(Tasks)
+    guard = Guard.for_pydantic(Tasks)
     tools = [
         {
             "type": "function",
@@ -1133,7 +1133,7 @@ def test_string_reask(mocker):
         ),
     ]
 
-    guard = gd.Guard.from_rail_string(string.RAIL_SPEC_FOR_STRING_REASK)
+    guard = gd.Guard.for_rail_string(string.RAIL_SPEC_FOR_STRING_REASK)
     final_output = guard(
         llm_api=openai.completions.create,
         prompt_params={"ingredients": "tomato, cheese, sour cream"},
@@ -1248,7 +1248,7 @@ def test_ser_deser(self):
     and not importlib.util.find_spec("torch"),
     reason="transformers or torch is not installed",
 )
-def test_guard_from_pydantic_with_mock_hf_pipeline():
+def test_guard_for_pydantic_with_mock_hf_pipeline():
     from tests.unit_tests.mocks.mock_hf_models import make_mock_pipeline
 
     pipe = make_mock_pipeline()
@@ -1261,7 +1261,7 @@ def test_guard_from_pydantic_with_mock_hf_pipeline():
     and not importlib.util.find_spec("torch"),
     reason="transformers or torch is not installed",
 )
-def test_guard_from_pydantic_with_mock_hf_model():
+def test_guard_for_pydantic_with_mock_hf_model():
     from tests.unit_tests.mocks.mock_hf_models import make_mock_model_and_tokenizer
 
     model, tokenizer = make_mock_model_and_tokenizer()
@@ -1291,10 +1291,10 @@ def test_guard_init(self, mocker):
 
         assert init_spy.call_count == 1
 
-    def test_from_rail(self, mocker):
+    def test_for_rail(self, mocker):
         init_spy = mocker.spy(LowerCase, "__init__")
 
-        guard = Guard.from_rail_string(
+        guard = Guard.for_rail_string(
             """
             
             
     """
 
-    guard = Guard.from_rail_string(rail_str)
+    guard = Guard.for_rail_string(rail_str)
 
     output = guard.parse(
         '{"greeting": "hello"}',
@@ -261,7 +261,7 @@ class Pet(BaseModel):
             pet_type: str = Field(description="Species of pet", validators=[validator])
             name: str = Field(description="a unique pet name")
 
-        guard = Guard.from_pydantic(output_class=Pet, prompt=prompt)
+        guard = Guard.for_pydantic(output_class=Pet, prompt=prompt)
 
         response = guard.parse(output, num_reasks=0)
         assert response.validation_passed is True
@@ -288,7 +288,7 @@ class Pet(BaseModel):
             pet_type: str = Field(description="Species of pet", validators=[validator])
             name: str = Field(description="a unique pet name")
 
-        guard = Guard.from_pydantic(output_class=Pet, prompt=prompt)
+        guard = Guard.for_pydantic(output_class=Pet, prompt=prompt)
 
         response = guard.parse(output, num_reasks=0)
         assert response.validation_passed is True
@@ -324,7 +324,7 @@ class Pet(BaseModel):
             pet_type: str = Field(description="Species of pet", validators=[validator])
             name: str = Field(description="a unique pet name")
 
-        guard = Guard.from_pydantic(output_class=Pet, prompt=prompt)
+        guard = Guard.for_pydantic(output_class=Pet, prompt=prompt)
 
         response = guard.parse(output, num_reasks=0)
 
@@ -353,7 +353,7 @@ class Pet(BaseModel):
             pet_type: str = Field(description="Species of pet", validators=[validator])
             name: str = Field(description="a unique pet name")
 
-        guard = Guard.from_pydantic(output_class=Pet, prompt=prompt)
+        guard = Guard.for_pydantic(output_class=Pet, prompt=prompt)
 
         with pytest.raises(ValidationError) as excinfo:
             guard.parse(output, num_reasks=0)
@@ -379,7 +379,7 @@ class Pet(BaseModel):
             pet_type: str = Field(description="Species of pet", validators=[validator])
             name: str = Field(description="a unique pet name")
 
-        guard = Guard.from_pydantic(output_class=Pet, prompt=prompt)
+        guard = Guard.for_pydantic(output_class=Pet, prompt=prompt)
 
         response = guard.parse(output, num_reasks=0)
 
@@ -408,7 +408,7 @@ class Pet(BaseModel):
             pet_type: str = Field(description="Species of pet", validators=[validator])
             name: str = Field(description="a unique pet name")
 
-        guard = Guard.from_pydantic(output_class=Pet, prompt=prompt)
+        guard = Guard.for_pydantic(output_class=Pet, prompt=prompt)
 
         response = guard.parse(output, num_reasks=0)
 
@@ -425,7 +425,7 @@ def mock_llm_api(prompt, *args, instructions=None, msg_history=None, **kwargs):
         return json.dumps({"name": "Fluffy"})
 
     # fix returns an amended value for prompt/instructions validation,
-    guard = Guard.from_pydantic(output_class=Pet)
+    guard = Guard.for_pydantic(output_class=Pet)
     guard.use(TwoWords(on_fail=OnFailAction.FIX), on="prompt")
 
     guard(
@@ -435,7 +435,7 @@ def mock_llm_api(prompt, *args, instructions=None, msg_history=None, **kwargs):
     assert (
         guard.history.first.iterations.first.outputs.validation_response == "What kind"
     )
-    guard = Guard.from_pydantic(output_class=Pet)
+    guard = Guard.for_pydantic(output_class=Pet)
     guard.use(TwoWords(on_fail=OnFailAction.FIX), on="instructions")
 
     guard(
@@ -449,7 +449,7 @@ def mock_llm_api(prompt, *args, instructions=None, msg_history=None, **kwargs):
     )
 
     # but raises for msg_history validation
-    guard = Guard.from_pydantic(output_class=Pet)
+    guard = Guard.for_pydantic(output_class=Pet)
     guard.use(TwoWords(on_fail=OnFailAction.FIX), on="msg_history")
 
     with pytest.raises(ValidationError) as excinfo:
@@ -467,7 +467,7 @@ def mock_llm_api(prompt, *args, instructions=None, msg_history=None, **kwargs):
     assert guard.history.first.exception == excinfo.value
 
     # rail prompt validation
-    guard = Guard.from_rail_string(
+    guard = Guard.for_rail_string(
         """
 
 
 
@@ -520,7 +520,7 @@ async def mock_llm_api(
         return json.dumps({"name": "Fluffy"})
 
     # fix returns an amended value for prompt/instructions validation,
-    guard = AsyncGuard.from_pydantic(output_class=Pet)
+    guard = AsyncGuard.for_pydantic(output_class=Pet)
     guard.use(TwoWords(on_fail=OnFailAction.FIX), on="prompt")
 
     await guard(
@@ -531,7 +531,7 @@ async def mock_llm_api(
         guard.history.first.iterations.first.outputs.validation_response == "What kind"
     )
 
-    guard = AsyncGuard.from_pydantic(output_class=Pet)
+    guard = AsyncGuard.for_pydantic(output_class=Pet)
     guard.use(TwoWords(on_fail=OnFailAction.FIX), on="instructions")
 
     await guard(
@@ -545,7 +545,7 @@ async def mock_llm_api(
     )
 
     # but raises for msg_history validation
-    guard = AsyncGuard.from_pydantic(output_class=Pet)
+    guard = AsyncGuard.for_pydantic(output_class=Pet)
     guard.use(TwoWords(on_fail=OnFailAction.FIX), on="msg_history")
 
     with pytest.raises(ValidationError) as excinfo:
@@ -563,7 +563,7 @@ async def mock_llm_api(
     assert guard.history.first.exception == excinfo.value
 
     # rail prompt validation
-    guard = AsyncGuard.from_rail_string(
+    guard = AsyncGuard.for_rail_string(
         """
 
 
 
@@ -659,7 +659,7 @@ def test_input_validation_fail(
     unstructured_instructions_error,
 ):
     # With Prompt Validation
-    guard = Guard.from_pydantic(output_class=Pet)
+    guard = Guard.for_pydantic(output_class=Pet)
     guard.use(TwoWords(on_fail=on_fail), on="prompt")
 
     def custom_llm(prompt, *args, instructions=None, msg_history=None, **kwargs):
@@ -678,7 +678,7 @@ def custom_llm(prompt, *args, instructions=None, msg_history=None, **kwargs):
     assert guard.history.last.exception == excinfo.value
 
     # With Instructions Validation
-    guard = Guard.from_pydantic(output_class=Pet)
+    guard = Guard.for_pydantic(output_class=Pet)
     guard.use(TwoWords(on_fail=on_fail), on="instructions")
 
     with pytest.raises(ValidationError) as excinfo:
@@ -693,7 +693,7 @@ def custom_llm(prompt, *args, instructions=None, msg_history=None, **kwargs):
     assert guard.history.last.exception == excinfo.value
 
     # With Msg History Validation
-    guard = Guard.from_pydantic(output_class=Pet)
+    guard = Guard.for_pydantic(output_class=Pet)
     guard.use(TwoWords(on_fail=on_fail), on="msg_history")
 
     with pytest.raises(ValidationError) as excinfo:
@@ -711,7 +711,7 @@ def custom_llm(prompt, *args, instructions=None, msg_history=None, **kwargs):
     assert guard.history.last.exception == excinfo.value
 
     # Rail Prompt Validation
-    guard = Guard.from_rail_string(
+    guard = Guard.for_rail_string(
         f"""
 
 
 
@@ -821,7 +821,7 @@ async def custom_llm(
         )
 
     # with_prompt_validation
-    guard = AsyncGuard.from_pydantic(output_class=Pet)
+    guard = AsyncGuard.for_pydantic(output_class=Pet)
     guard.use(TwoWords(on_fail=on_fail), on="prompt")
 
     with pytest.raises(ValidationError) as excinfo:
@@ -834,7 +834,7 @@ async def custom_llm(
     assert guard.history.last.exception == excinfo.value
 
     # with_instructions_validation
-    guard = AsyncGuard.from_pydantic(output_class=Pet)
+    guard = AsyncGuard.for_pydantic(output_class=Pet)
     guard.use(TwoWords(on_fail=on_fail), on="instructions")
 
     with pytest.raises(ValidationError) as excinfo:
@@ -848,7 +848,7 @@ async def custom_llm(
     assert guard.history.last.exception == excinfo.value
 
     # with_msg_history_validation
-    guard = AsyncGuard.from_pydantic(output_class=Pet)
+    guard = AsyncGuard.for_pydantic(output_class=Pet)
     guard.use(TwoWords(on_fail=on_fail), on="msg_history")
 
     with pytest.raises(ValidationError) as excinfo:
@@ -866,7 +866,7 @@ async def custom_llm(
     assert guard.history.last.exception == excinfo.value
 
     # with_messages_validation
-    guard = AsyncGuard.from_pydantic(output_class=Pet)
+    guard = AsyncGuard.for_pydantic(output_class=Pet)
     guard.use(TwoWords(on_fail=on_fail), on="messages")
 
     with pytest.raises(ValidationError) as excinfo:
@@ -884,7 +884,7 @@ async def custom_llm(
     assert guard.history.last.exception == excinfo.value
 
     # rail prompt validation
-    guard = AsyncGuard.from_rail_string(
+    guard = AsyncGuard.for_rail_string(
         f"""
 
 
 
@@ -935,7 +935,7 @@ async def custom_llm(
 
 def test_input_validation_mismatch_raise():
     # prompt validation, msg_history argument
-    guard = Guard.from_pydantic(output_class=Pet)
+    guard = Guard.for_pydantic(output_class=Pet)
     guard.use(TwoWords(on_fail=OnFailAction.FIX), on="prompt")
 
     with pytest.raises(ValueError):
@@ -950,7 +950,7 @@ def test_input_validation_mismatch_raise():
         )
 
     # instructions validation, msg_history argument
-    guard = Guard.from_pydantic(output_class=Pet)
+    guard = Guard.for_pydantic(output_class=Pet)
     guard.use(TwoWords(on_fail=OnFailAction.FIX), on="instructions")
 
     with pytest.raises(ValueError):
@@ -965,7 +965,7 @@ def test_input_validation_mismatch_raise():
         )
 
     # msg_history validation, prompt argument
-    guard = Guard.from_pydantic(output_class=Pet)
+    guard = Guard.for_pydantic(output_class=Pet)
     guard.use(TwoWords(on_fail=OnFailAction.FIX), on="msg_history")
 
     with pytest.raises(ValueError):