File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11[project ]
22name = " uipath-langchain"
3- version = " 0.0.82 "
3+ version = " 0.0.83 "
44description = " UiPath Langchain"
55readme = { file = " README.md" , content-type = " text/markdown" }
66requires-python = " >=3.9"
Original file line number Diff line number Diff line change 1313from langchain_core .tracers .schemas import Run
1414from pydantic import PydanticDeprecationWarning
1515
16- from ._utils import _simple_serialize_defaults
16+ from ._utils import _setup_tracer_httpx_logging , _simple_serialize_defaults
1717
1818logger = logging .getLogger (__name__ )
1919
20+ _setup_tracer_httpx_logging ("/llmops_/api/Agent/trace/" )
21+
2022
2123class Status :
2224 SUCCESS = 1
Original file line number Diff line number Diff line change 11import datetime
2+ import logging
23from zoneinfo import ZoneInfo
34
45
6+ class IgnoreSpecificUrl (logging .Filter ):
7+ def __init__ (self , url_to_ignore ):
8+ super ().__init__ ()
9+ self .url_to_ignore = url_to_ignore
10+
11+ def filter (self , record ):
12+ try :
13+ if record .msg == 'HTTP Request: %s %s "%s %d %s"' :
14+ # Ignore the log if the URL matches the one we want to ignore
15+ method = record .args [0 ]
16+ url = record .args [1 ]
17+
18+ if method == "POST" and url .path .endswith (self .url_to_ignore ):
19+ # Check if the URL contains the specific path we want to ignore
20+ return True
21+ return False
22+
23+ except Exception :
24+ return False
25+
26+
27+ def _setup_tracer_httpx_logging (url : str ):
28+ # Create a custom logger for httpx
29+ # Add the custom filter to the root logger
30+ logging .getLogger ("httpx" ).addFilter (IgnoreSpecificUrl (url ))
31+
32+
533def _simple_serialize_defaults (obj ):
634 if hasattr (obj , "model_dump" ):
735 return obj .model_dump (exclude_none = True , mode = "json" )
You can’t perform that action at this time.
0 commit comments