Skip to content

Commit

Permalink
Add outputs to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Sheepsta300 committed Oct 15, 2024
1 parent e5fb363 commit 4915fe0
Showing 1 changed file with 62 additions and 15 deletions.
77 changes: 62 additions & 15 deletions docs/docs/integrations/tools/azure_content_safety.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -94,7 +94,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -121,7 +121,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -145,7 +145,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -157,7 +157,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -180,7 +180,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -207,7 +207,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 11,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -230,11 +230,22 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 12,
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"text/plain": [
"'Hate: 2\\nSelfHarm: 0\\nSexual: 0\\nViolence: 0\\n'"
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"cs._run(input)"
"cs.invoke({\"query\": input})"
]
},
{
Expand All @@ -253,9 +264,45 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"execution_count": 17,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"\n",
"\u001b[1m> Entering new AgentExecutor chain...\u001b[0m\n",
"\u001b[32;1m\u001b[1;3m{\n",
" \"action\": \"azure_content_safety_tool\",\n",
" \"action_input\": {\n",
" \"query\": \"I hate you\"\n",
" }\n",
"}\u001b[0m\u001b[36;1m\u001b[1;3mHate: 2\n",
"SelfHarm: 0\n",
"Sexual: 0\n",
"Violence: 0\n",
"\u001b[0m\u001b[32;1m\u001b[1;3m{\n",
" \"action\": \"Final Answer\",\n",
" \"action_input\": \"The text contains hate sentiment with a severity level of 2. There is no indication of self-harm, sexual content, or violence.\"\n",
"}\u001b[0m\n",
"\n",
"\u001b[1m> Finished chain.\u001b[0m\n"
]
},
{
"data": {
"text/plain": [
"{'input': 'Can you check the following text for harmful content : I hate you',\n",
" 'output': 'The text contains hate sentiment with a severity level of 2. There is no indication of self-harm, sexual content, or violence.'}"
]
},
"execution_count": 17,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"agent_executor.invoke(\n",
" {\"input\": f\"Can you check the following text for harmful content : {input}\"}\n",
Expand All @@ -278,7 +325,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 18,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -320,7 +367,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.7"
"version": "3.11.4"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 4915fe0

Please sign in to comment.