From 129159c372e06aa71726a57c49ee8d83ad8c6357 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 15 Jul 2025 09:50:22 +0000 Subject: [PATCH] Add AgentOps integration to LiteLLM for API call monitoring --- python/src/reag/client.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/python/src/reag/client.py b/python/src/reag/client.py index b7d4a3e..778052b 100644 --- a/python/src/reag/client.py +++ b/python/src/reag/client.py @@ -5,6 +5,7 @@ from typing import List, Optional, TypeVar, Dict, Union from pydantic import BaseModel from litellm import acompletion +import litellm from reag.prompt import REAG_SYSTEM_PROMPT from reag.schema import ResponseSchemaMessage @@ -50,6 +51,9 @@ def __init__( self.schema = schema or ResponseSchemaMessage self.model_kwargs = model_kwargs or {} self._http_client = None + + # Configure LiteLLM to use AgentOps + litellm.success_callback = ["agentops"] async def __aenter__(self): self._http_client = httpx.AsyncClient()