Remove fallback conditions for LLM tracing
This commit is contained in:
@@ -399,11 +399,6 @@ def traced_llm(func: Optional[Callable] = None, *, name: Optional[str] = None) -
|
|||||||
if hasattr(self, "get_llm_adapter"):
|
if hasattr(self, "get_llm_adapter"):
|
||||||
adapter = self.get_llm_adapter()
|
adapter = self.get_llm_adapter()
|
||||||
messages = adapter.get_messages_for_logging(context)
|
messages = adapter.get_messages_for_logging(context)
|
||||||
elif hasattr(context, "get_messages"):
|
|
||||||
# Fallback for unknown context types
|
|
||||||
messages = context.get_messages()
|
|
||||||
elif hasattr(context, "messages"):
|
|
||||||
messages = context.messages
|
|
||||||
|
|
||||||
# Serialize messages if available
|
# Serialize messages if available
|
||||||
if messages:
|
if messages:
|
||||||
@@ -424,9 +419,6 @@ def traced_llm(func: Optional[Callable] = None, *, name: Optional[str] = None) -
|
|||||||
if hasattr(self, "get_llm_adapter") and hasattr(context, "tools"):
|
if hasattr(self, "get_llm_adapter") and hasattr(context, "tools"):
|
||||||
adapter = self.get_llm_adapter()
|
adapter = self.get_llm_adapter()
|
||||||
tools = adapter.from_standard_tools(context.tools)
|
tools = adapter.from_standard_tools(context.tools)
|
||||||
elif hasattr(context, "tools"):
|
|
||||||
# Fallback for unknown context types
|
|
||||||
tools = context.tools
|
|
||||||
|
|
||||||
# Serialize and count tools if available
|
# Serialize and count tools if available
|
||||||
# Check if tools is not None and not NOT_GIVEN (using attribute check as fallback)
|
# Check if tools is not None and not NOT_GIVEN (using attribute check as fallback)
|
||||||
|
|||||||
Reference in New Issue
Block a user