We will cover all these ways in this walkthrough.We'll show:How to run any piece of text through a moderation chain.How to append a Moderation chain to an LLMChain.from langchain.llms import OpenAIfrom langchain.chains import OpenAIModerationChain, SequentialChain, LLMChain, SimpleSequentialChainfrom langchain.prompts import PromptTemplateHow to use the moderation chain‚ÄãHere's an example of using the moderation chain with default settings (will return a string
This notebook walks through examples of how to use a moderation chain, and several common ways for doing so.
This notebook walks through examples of how to use a moderation chain, and several common ways for doing so. ->: We will cover all these ways in this walkthrough.We'll show:How to run any piece of text through a moderation chain.How to append a Moderation chain to an LLMChain.from langchain.llms import OpenAIfrom langchain.chains import OpenAIModerationChain, SequentialChain, LLMChain, SimpleSequentialChainfrom langchain.prompts import PromptTemplateHow to use the moderation chain‚ÄãHere's an example of using the moderation chain with default settings (will return a string