Set API keysos.environ['OPAQUEPROMPTS_API_KEY'] = "<OPAQUEPROMPTS_API_KEY>"os.environ['OPENAI_API_KEY'] = "<OPENAI_API_KEY>"Use OpaquePrompts LLM WrapperApplying OpaquePrompts to your application could be as simple as wrapping your LLM using the OpaquePrompts class by replace llm=OpenAI() with llm=OpaquePrompts(base_llm=OpenAI()).from langchain.chains import LLMChainfrom langchain.prompts import PromptTemplatefrom langchain.callbacks.stdout import StdOutCallbackHandlerfrom langchain.llms import OpenAIfrom langchain.memory import ConversationBufferWindowMemoryfrom langchain.llms import OpaquePromptsfrom langchain.globals import set_debug, set_verboseset_debug(True)set_verbose(True)prompt_template = """As an AI assistant, you will answer questions according to given context.Sensitive personal information in the question is masked for privacy.For instance, if the original text says "Giana is good," it will be changedto "PERSON_998 is good." Here's how to handle these changes:* Consider these masked phrases just as placeholders, but still refer tothem in a relevant way when answering.* It's possible that different masked terms might mean the same thing.Stick with the given term and don't modify it.* All masked terms follow the "TYPE_ID" pattern.* Please don't invent new masked terms. For instance, if you see "PERSON_998,"don't come up with "PERSON_997" or "PERSON_999" unless they're already in the question.Conversation History: ```{history}```Context : ```During our recent meeting on February 23, 2023, at 10:30 AM,John Doe provided me with his personal details. His email is johndoe@example.comand his contact number is 650-456-7890. He lives in New York City, USA, andbelongs to the American nationality with Christian beliefs and a leaning towardsthe Democratic party. He mentioned that he recently made a transaction using hiscredit card 4111 1111 1111 1111 and transferred bitcoins to the wallet address1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa. While discussing his European
OpaquePrompts is a service that enables applications to leverage the power of language models without compromising user privacy. Designed for composability and ease of integration into existing applications and services, OpaquePrompts is consumable via a simple Python library as well as through LangChain. Perhaps more importantly, OpaquePrompts leverages the power of confidential computing to ensure that even the OpaquePrompts service itself cannot access the data it is protecting.
OpaquePrompts is a service that enables applications to leverage the power of language models without compromising user privacy. Designed for composability and ease of integration into existing applications and services, OpaquePrompts is consumable via a simple Python library as well as through LangChain. Perhaps more importantly, OpaquePrompts leverages the power of confidential computing to ensure that even the OpaquePrompts service itself cannot access the data it is protecting. ->: Set API keysos.environ['OPAQUEPROMPTS_API_KEY'] = "<OPAQUEPROMPTS_API_KEY>"os.environ['OPENAI_API_KEY'] = "<OPENAI_API_KEY>"Use OpaquePrompts LLM WrapperApplying OpaquePrompts to your application could be as simple as wrapping your LLM using the OpaquePrompts class by replace llm=OpenAI() with llm=OpaquePrompts(base_llm=OpenAI()).from langchain.chains import LLMChainfrom langchain.prompts import PromptTemplatefrom langchain.callbacks.stdout import StdOutCallbackHandlerfrom langchain.llms import OpenAIfrom langchain.memory import ConversationBufferWindowMemoryfrom langchain.llms import OpaquePromptsfrom langchain.globals import set_debug, set_verboseset_debug(True)set_verbose(True)prompt_template = """As an AI assistant, you will answer questions according to given context.Sensitive personal information in the question is masked for privacy.For instance, if the original text says "Giana is good," it will be changedto "PERSON_998 is good." Here's how to handle these changes:* Consider these masked phrases just as placeholders, but still refer tothem in a relevant way when answering.* It's possible that different masked terms might mean the same thing.Stick with the given term and don't modify it.* All masked terms follow the "TYPE_ID" pattern.* Please don't invent new masked terms. For instance, if you see "PERSON_998,"don't come up with "PERSON_997" or "PERSON_999" unless they're already in the question.Conversation History: ```{history}```Context : ```During our recent meeting on February 23, 2023, at 10:30 AM,John Doe provided me with his personal details. His email is johndoe@example.comand his contact number is 650-456-7890. He lives in New York City, USA, andbelongs to the American nationality with Christian beliefs and a leaning towardsthe Democratic party. He mentioned that he recently made a transaction using hiscredit card 4111 1111 1111 1111 and transferred bitcoins to the wallet address1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa. While discussing his European