We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7d690f6 commit b38c89bCopy full SHA for b38c89b
newrelic/api/llm_custom_attributes.py
@@ -24,8 +24,8 @@
24
class WithLlmCustomAttributes(object):
25
def __init__(self, custom_attr_dict):
26
transaction = current_transaction()
27
- if not isinstance(custom_attr_dict, dict) or custom_attr_dict is None:
28
- raise TypeError("custom_attr_dict must be a dictionary. Received type: %s" % type(custom_attr_dict))
+ if not custom_attr_dict or not isinstance(custom_attr_dict, dict):
+ raise TypeError("custom_attr_dict must be a non-empty dictionary. Received type: %s" % type(custom_attr_dict))
29
30
# Add "llm." prefix to all keys in attribute dictionary
31
context_attrs = {k if k.startswith("llm.") else f"llm.{k}": v for k, v in custom_attr_dict.items()}
0 commit comments