Skip to content

Commit 9c71fab

Browse files
committed
cohere notebook
1 parent 98b4652 commit 9c71fab

File tree

1 file changed

+111
-8
lines changed

1 file changed

+111
-8
lines changed

docs/examples/generate_structured_data_cohere.ipynb

Lines changed: 111 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,119 @@
3333
},
3434
{
3535
"cell_type": "markdown",
36-
"id": "c062d098",
36+
"id": "3b9f4250",
3737
"metadata": {},
3838
"source": [
39-
"We have to install the necessary validators from Guardrails Hub: \n",
40-
"\n",
41-
"1. ValidLength: ```guardrails hub install hub://reflex/valid_python```\n",
42-
"\n",
43-
"2. TwoWords: ```guardrails hub install hub://guardrails/two_words```\n",
44-
"\n",
45-
"3. ValidRange: ```guardrails hub install hub://guardrails/valid_range```"
39+
"Install validators"
40+
]
41+
},
42+
{
43+
"cell_type": "code",
44+
"execution_count": 4,
45+
"id": "6a7c7d4a",
46+
"metadata": {},
47+
"outputs": [
48+
{
49+
"name": "stdout",
50+
"output_type": "stream",
51+
"text": [
52+
"\u001b[32m2024-03-25 16:13:45\u001b[0m \u001b[35mzmac\u001b[0m \u001b[34mguardrails-cli[96111]\u001b[0m \u001b[1;30mNOTICE\u001b[0m \u001b[1;36mInstalling hub://guardrails/valid_length...\u001b[0m\n",
53+
" Running command git clone --filter=blob:none --quiet https://github.com/guardrails-ai/valid_length.git /private/var/folders/c8/jqt82fpx785dpwpp36ljkgm40000gn/T/pip-req-build-y3acxka5\n",
54+
"\u001b[33mWARNING: Target directory /Users/zaydsimjee/workspace/guardrails/.venv/lib/python3.11/site-packages/guardrails/hub/guardrails/valid_length/validator already exists. Specify --upgrade to force replacement.\u001b[0m\u001b[33m\n",
55+
"\u001b[0m\u001b[33mWARNING: Target directory /Users/zaydsimjee/workspace/guardrails/.venv/lib/python3.11/site-packages/guardrails/hub/guardrails/valid_length/valid_length-0.0.0.dist-info already exists. Specify --upgrade to force replacement.\u001b[0m\u001b[33m\n",
56+
"\u001b[0m\u001b[32m2024-03-25 16:13:52\u001b[0m \u001b[35mzmac\u001b[0m \u001b[34mguardrails-cli[96111]\u001b[0m \u001b[1;30mINFO\u001b[0m Collecting git+https://github.com/guardrails-ai/valid_length.git\n",
57+
" Cloning https://github.com/guardrails-ai/valid_length.git to /private/var/folders/c8/jqt82fpx785dpwpp36ljkgm40000gn/T/pip-req-build-y3acxka5\n",
58+
" Resolved https://github.com/guardrails-ai/valid_length.git to commit 4b59a5fc1ae2106a585881784e3c2086f1fe8b9b\n",
59+
" Installing build dependencies: started\n",
60+
" Installing build dependencies: finished with status 'done'\n",
61+
" Getting requirements to build wheel: started\n",
62+
" Getting requirements to build wheel: finished with status 'done'\n",
63+
" Installing backend dependencies: started\n",
64+
" Installing backend dependencies: finished with status 'done'\n",
65+
" Preparing metadata (pyproject.toml): started\n",
66+
" Preparing metadata (pyproject.toml): finished with status 'done'\n",
67+
"Building wheels for collected packages: valid_length\n",
68+
" Building wheel for valid_length (pyproject.toml): started\n",
69+
" Building wheel for valid_length (pyproject.toml): finished with status 'done'\n",
70+
" Created wheel for valid_length: filename=valid_length-0.0.0-py3-none-any.whl size=12348 sha256=98e297c72fa6bc34b9c52e2ce3b87365ce925225b0792d1a72096baf11b4e792\n",
71+
" Stored in directory: /private/var/folders/c8/jqt82fpx785dpwpp36ljkgm40000gn/T/pip-ephem-wheel-cache-odhptidc/wheels/48/9f/75/34a76a1e575dafaf9df180a2074f698d77193d5d3670823f69\n",
72+
"Successfully built valid_length\n",
73+
"Installing collected packages: valid_length\n",
74+
"Successfully installed valid_length-0.0.0\n",
75+
"\n",
76+
"\u001b[32m2024-03-25 16:13:52\u001b[0m \u001b[35mzmac\u001b[0m \u001b[34mguardrails-cli[96111]\u001b[0m \u001b[1;30mSUCCESS\u001b[0m \u001b[1;32m\n",
77+
"\n",
78+
" Successfully installed guardrails/valid_length!\n",
79+
"\n",
80+
" See how to use it here: https://hub.guardrailsai.com/validator/guardrails/valid_length\n",
81+
" \u001b[0m\n",
82+
"\u001b[32m2024-03-25 16:13:53\u001b[0m \u001b[35mzmac\u001b[0m \u001b[34mguardrails-cli[96229]\u001b[0m \u001b[1;30mNOTICE\u001b[0m \u001b[1;36mInstalling hub://guardrails/two_words...\u001b[0m\n",
83+
" Running command git clone --filter=blob:none --quiet https://github.com/guardrails-ai/two_words.git /private/var/folders/c8/jqt82fpx785dpwpp36ljkgm40000gn/T/pip-req-build-c9bdjnpk\n",
84+
"\u001b[33mWARNING: Target directory /Users/zaydsimjee/workspace/guardrails/.venv/lib/python3.11/site-packages/guardrails/hub/guardrails/two_words/validator already exists. Specify --upgrade to force replacement.\u001b[0m\u001b[33m\n",
85+
"\u001b[0m\u001b[33mWARNING: Target directory /Users/zaydsimjee/workspace/guardrails/.venv/lib/python3.11/site-packages/guardrails/hub/guardrails/two_words/two_words-0.0.0.dist-info already exists. Specify --upgrade to force replacement.\u001b[0m\u001b[33m\n",
86+
"\u001b[0m\u001b[32m2024-03-25 16:13:59\u001b[0m \u001b[35mzmac\u001b[0m \u001b[34mguardrails-cli[96229]\u001b[0m \u001b[1;30mINFO\u001b[0m Collecting git+https://github.com/guardrails-ai/two_words.git\n",
87+
" Cloning https://github.com/guardrails-ai/two_words.git to /private/var/folders/c8/jqt82fpx785dpwpp36ljkgm40000gn/T/pip-req-build-c9bdjnpk\n",
88+
" Resolved https://github.com/guardrails-ai/two_words.git to commit e7f682c0b8d45a9407e966028d72682cd909601e\n",
89+
" Installing build dependencies: started\n",
90+
" Installing build dependencies: finished with status 'done'\n",
91+
" Getting requirements to build wheel: started\n",
92+
" Getting requirements to build wheel: finished with status 'done'\n",
93+
" Installing backend dependencies: started\n",
94+
" Installing backend dependencies: finished with status 'done'\n",
95+
" Preparing metadata (pyproject.toml): started\n",
96+
" Preparing metadata (pyproject.toml): finished with status 'done'\n",
97+
"Building wheels for collected packages: two_words\n",
98+
" Building wheel for two_words (pyproject.toml): started\n",
99+
" Building wheel for two_words (pyproject.toml): finished with status 'done'\n",
100+
" Created wheel for two_words: filename=two_words-0.0.0-py3-none-any.whl size=11227 sha256=a10ae6f93738a3223ec28db3712fdc288547689235606516c589caff1f84889c\n",
101+
" Stored in directory: /private/var/folders/c8/jqt82fpx785dpwpp36ljkgm40000gn/T/pip-ephem-wheel-cache-b_l3rvkp/wheels/36/68/76/f184dbc7d9cea0daec56ec1394537018f2ddeb660f9ad79ce6\n",
102+
"Successfully built two_words\n",
103+
"Installing collected packages: two_words\n",
104+
"Successfully installed two_words-0.0.0\n",
105+
"\n",
106+
"\u001b[32m2024-03-25 16:14:00\u001b[0m \u001b[35mzmac\u001b[0m \u001b[34mguardrails-cli[96229]\u001b[0m \u001b[1;30mSUCCESS\u001b[0m \u001b[1;32m\n",
107+
"\n",
108+
" Successfully installed guardrails/two_words!\n",
109+
"\n",
110+
" See how to use it here: https://hub.guardrailsai.com/validator/guardrails/two_words\n",
111+
" \u001b[0m\n",
112+
"\u001b[32m2024-03-25 16:14:01\u001b[0m \u001b[35mzmac\u001b[0m \u001b[34mguardrails-cli[96313]\u001b[0m \u001b[1;30mNOTICE\u001b[0m \u001b[1;36mInstalling hub://guardrails/valid_range...\u001b[0m\n",
113+
" Running command git clone --filter=blob:none --quiet https://github.com/guardrails-ai/valid_range.git /private/var/folders/c8/jqt82fpx785dpwpp36ljkgm40000gn/T/pip-req-build-_ndib8nc\n",
114+
"\u001b[33mWARNING: Target directory /Users/zaydsimjee/workspace/guardrails/.venv/lib/python3.11/site-packages/guardrails/hub/guardrails/valid_range/validator already exists. Specify --upgrade to force replacement.\u001b[0m\u001b[33m\n",
115+
"\u001b[0m\u001b[33mWARNING: Target directory /Users/zaydsimjee/workspace/guardrails/.venv/lib/python3.11/site-packages/guardrails/hub/guardrails/valid_range/valid_range-0.0.0.dist-info already exists. Specify --upgrade to force replacement.\u001b[0m\u001b[33m\n",
116+
"\u001b[0m\u001b[32m2024-03-25 16:14:07\u001b[0m \u001b[35mzmac\u001b[0m \u001b[34mguardrails-cli[96313]\u001b[0m \u001b[1;30mINFO\u001b[0m Collecting git+https://github.com/guardrails-ai/valid_range.git\n",
117+
" Cloning https://github.com/guardrails-ai/valid_range.git to /private/var/folders/c8/jqt82fpx785dpwpp36ljkgm40000gn/T/pip-req-build-_ndib8nc\n",
118+
" Resolved https://github.com/guardrails-ai/valid_range.git to commit d01ad21d73d753ad224fd395bce18428196951c5\n",
119+
" Installing build dependencies: started\n",
120+
" Installing build dependencies: finished with status 'done'\n",
121+
" Getting requirements to build wheel: started\n",
122+
" Getting requirements to build wheel: finished with status 'done'\n",
123+
" Installing backend dependencies: started\n",
124+
" Installing backend dependencies: finished with status 'done'\n",
125+
" Preparing metadata (pyproject.toml): started\n",
126+
" Preparing metadata (pyproject.toml): finished with status 'done'\n",
127+
"Building wheels for collected packages: valid_range\n",
128+
" Building wheel for valid_range (pyproject.toml): started\n",
129+
" Building wheel for valid_range (pyproject.toml): finished with status 'done'\n",
130+
" Created wheel for valid_range: filename=valid_range-0.0.0-py3-none-any.whl size=11575 sha256=ca6ffe0537e7a64c74332398596451c01395a6fa8086f98e514d0a1cfad5fff9\n",
131+
" Stored in directory: /private/var/folders/c8/jqt82fpx785dpwpp36ljkgm40000gn/T/pip-ephem-wheel-cache-7zrcqsov/wheels/0c/66/c0/f9ea25da535775c4ffca5bbd385863945a6397fd1863f6abe8\n",
132+
"Successfully built valid_range\n",
133+
"Installing collected packages: valid_range\n",
134+
"Successfully installed valid_range-0.0.0\n",
135+
"\n",
136+
"\u001b[32m2024-03-25 16:14:07\u001b[0m \u001b[35mzmac\u001b[0m \u001b[34mguardrails-cli[96313]\u001b[0m \u001b[1;30mSUCCESS\u001b[0m \u001b[1;32m\n",
137+
"\n",
138+
" Successfully installed guardrails/valid_range!\n",
139+
"\n",
140+
" See how to use it here: https://hub.guardrailsai.com/validator/guardrails/valid_range\n",
141+
" \u001b[0m\n"
142+
]
143+
}
144+
],
145+
"source": [
146+
"!guardrails hub install hub://guardrails/valid_length\n",
147+
"!guardrails hub install hub://guardrails/two_words\n",
148+
"!guardrails hub install hub://guardrails/valid_range"
46149
]
47150
},
48151
{

0 commit comments

Comments
 (0)