diff --git a/docs/docs/integrations/tools/azure_content_safety.ipynb b/docs/docs/integrations/tools/azure_content_safety.ipynb index 80392f351a232..15012d6f0dec2 100644 --- a/docs/docs/integrations/tools/azure_content_safety.ipynb +++ b/docs/docs/integrations/tools/azure_content_safety.ipynb @@ -77,7 +77,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ @@ -94,7 +94,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 5, "metadata": {}, "outputs": [], "source": [ @@ -121,7 +121,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 7, "metadata": {}, "outputs": [], "source": [ @@ -145,7 +145,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 8, "metadata": {}, "outputs": [], "source": [ @@ -157,7 +157,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 9, "metadata": {}, "outputs": [], "source": [ @@ -180,7 +180,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 10, "metadata": {}, "outputs": [], "source": [ @@ -207,7 +207,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 11, "metadata": {}, "outputs": [], "source": [ @@ -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})" ] }, { @@ -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", @@ -278,7 +325,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 18, "metadata": {}, "outputs": [], "source": [ @@ -320,7 +367,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.12.7" + "version": "3.11.4" } }, "nbformat": 4,