It's important to stay secure online, so don't forget to do it!Use OpaquePrompts in LangChain expressionThere are functions that can be used with LangChain expression as well if a drop-in replacement doesn't offer the flexibility you need. import langchain.utilities.opaqueprompts as opfrom langchain.schema.runnable import RunnablePassthroughfrom langchain.schema.output_parser import StrOutputParserprompt=PromptTemplate.from_template(prompt_template),    llm = OpenAI()pg_chain = (    op.sanitize    | RunnablePassthrough.assign(        response=(lambda x: x["sanitized_input"])            | prompt            | llm            | StrOutputParser(),    )    | (lambda x: op.desanitize(x["response"], x["secure_context"])))pg_chain.invoke({"question": "Write a text message to remind John to do password reset for his website through his email to stay secure.", "history": ""})PreviousOllamaNextOpenAICommunityDiscordTwitterGitHubPythonJS/TSMoreHomepageBlogCopyright ¬© 2023 LangChain, Inc.
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. ->: It's important to stay secure online, so don't forget to do it!Use OpaquePrompts in LangChain expressionThere are functions that can be used with LangChain expression as well if a drop-in replacement doesn't offer the flexibility you need. import langchain.utilities.opaqueprompts as opfrom langchain.schema.runnable import RunnablePassthroughfrom langchain.schema.output_parser import StrOutputParserprompt=PromptTemplate.from_template(prompt_template),    llm = OpenAI()pg_chain = (    op.sanitize    | RunnablePassthrough.assign(        response=(lambda x: x["sanitized_input"])            | prompt            | llm            | StrOutputParser(),    )    | (lambda x: op.desanitize(x["response"], x["secure_context"])))pg_chain.invoke({"question": "Write a text message to remind John to do password reset for his website through his email to stay secure.", "history": ""})PreviousOllamaNextOpenAICommunityDiscordTwitterGitHubPythonJS/TSMoreHomepageBlogCopyright ¬© 2023 LangChain, Inc.