File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
testcases/company-research-agent/src Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 1+ import logging
2+ from typing import Any
3+
14from langchain .agents import create_agent
25from langchain_community .tools import DuckDuckGoSearchResults
36from langgraph .graph import END , START , MessagesState , StateGraph
47from pydantic import BaseModel
8+ from uipath_langchain_client .clients .normalized .chat_models import UiPathChat as _NormalizedChat
59
610from uipath_langchain .chat import UiPathChat
711
12+ logger = logging .getLogger (__name__ )
13+
14+ # Monkey-patch to log raw response on failure
15+ _original_postprocess = _NormalizedChat ._postprocess_response
16+
17+ def _debug_postprocess (self : Any , response : dict [str , Any ]) -> Any :
18+ if "choices" not in response :
19+ logger .error ("RAW RESPONSE (no 'choices' key): %s" , response )
20+ print (f"DEBUG RAW RESPONSE: { response } " )
21+ return _original_postprocess (self , response )
22+
23+ _NormalizedChat ._postprocess_response = _debug_postprocess
24+
825# Configuration constants
926
1027
You can’t perform that action at this time.
0 commit comments