AgentOps Langchain Agent Implementation
Using AgentOps monitoring with Langchain is simple. We’ve created a LangchainCallbackHandler that will do all of the heavy lifting! First let’s install the required packages-
Create an environment variable in a .env file or other method. By default, the AgentOps
init()
function will look for an environment variable namedAGENTOPS_API_KEY
. Or… -
Replace
<your_agentops_key>
below and pass in the optionalapi_key
parameter to the AgentOpsinit(api_key=...)
function. Remember not to commit your API key to a public repo!
session_id
of the newly created session.