Using Protect In Chains
Galileo Protect can also be used within your Langchain workflows. You can use Protect to validate inputs and outputs at different stages of your workflow. We provide a tool
that allows you to easily integrate Protect into your Langchain workflows.
Example
Here’s an example of how you can use Protect with Langchain:
Note: If your previous node’s output is not with the keys input
and output
, you will need to insert a Python function before the protected_chain
to format the output to match the expected input of the ProtectTool.
Logging Protect With Galileo Evaluate and Galileo Observe
Protect supports Galileo Evaluate and Galileo Observe. You can log Protect’s actions and responses in your Galileo Evaluate and Galileo Observe dashboards. To show your protect outputs in the Galileo Evaluate and Galileo Observe dashboards, simply include the Evaluate and Observe’s langchain
callbacks when you invoke your protected_chain
.
Was this page helpful?