diff --git a/src/backend/model_deployments/cohere_platform.py b/src/backend/model_deployments/cohere_platform.py index 15a0c5e2f9..1787ce84fd 100644 --- a/src/backend/model_deployments/cohere_platform.py +++ b/src/backend/model_deployments/cohere_platform.py @@ -5,6 +5,7 @@ import time from typing import Any, AsyncGenerator, Dict, List +from backend.services.logger import get_logger, send_log_message import cohere import requests from cohere.core.api_error import ApiError @@ -27,6 +28,8 @@ DEFAULT_RERANK_MODEL = "rerank-english-v2.0" +logger = get_logger() + class CohereDeployment(BaseDeployment): """Cohere Platform Deployment.""" @@ -85,6 +88,13 @@ async def invoke_chat_stream( ) for event in stream: + send_log_message( + logger, + f"Chat event: {to_dict(event)}", + level="info", + conversation_id=kwargs.get("conversation_id"), + user_id=kwargs.get("user_id"), + ) yield to_dict(event) @collect_metrics_rerank