Using Ollama with AgentOps
⚠️ Important: Make sure you have Ollama installed and running locally before running this notebook. You can install it from ollama.ai.
init()
function will look for an environment variable named AGENTOPS_API_KEY
. Or…<your_agentops_key>
below and pass in the optional api_key
parameter to the AgentOps init(api_key=...)
function. Remember not to commit your API key to a public repo!
💡 Note: In production environments, you should add proper error handling around the Ollama calls and use agentops.end_session("Error")
when exceptions occur.
Finally, let’s end our AgentOps session