File tree Expand file tree Collapse file tree 2 files changed +18
-4
lines changed
dd-java-agent/agent-llmobs/src/main/java/datadog/trace/llmobs Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,11 @@ public void SubmitEvaluation(
70
70
Map <String , Object > tags ) {
71
71
if (llmObsSpan == null ) {
72
72
LOGGER .error ("null llm obs span provided, eval not recorded" );
73
+ return ;
74
+ }
75
+
76
+ if (mlApp == null || mlApp .isEmpty ()) {
77
+ mlApp = defaultMLApp ;
73
78
}
74
79
String traceID = llmObsSpan .getTraceId ().toHexString ();
75
80
long spanID = llmObsSpan .getSpanId ();
@@ -101,6 +106,11 @@ public void SubmitEvaluation(
101
106
Map <String , Object > tags ) {
102
107
if (llmObsSpan == null ) {
103
108
LOGGER .error ("null llm obs span provided, eval not recorded" );
109
+ return ;
110
+ }
111
+
112
+ if (mlApp == null || mlApp .isEmpty ()) {
113
+ mlApp = defaultMLApp ;
104
114
}
105
115
String traceID = llmObsSpan .getTraceId ().toHexString ();
106
116
long spanID = llmObsSpan .getSpanId ();
Original file line number Diff line number Diff line change @@ -37,11 +37,15 @@ public LLMObsEval(
37
37
this .ml_app = mlApp ;
38
38
this .metric_type = metricType ;
39
39
this .label = label ;
40
- List <String > tagsList = new ArrayList <>(tags .size ());
41
- for (Map .Entry <String , Object > entry : tags .entrySet ()) {
42
- tagsList .add (entry .getKey () + ":" + entry .getValue ());
40
+ if (tags != null ) {
41
+ List <String > tagsList = new ArrayList <>(tags .size ());
42
+ for (Map .Entry <String , Object > entry : tags .entrySet ()) {
43
+ tagsList .add (entry .getKey () + ":" + entry .getValue ());
44
+ }
45
+ this .tags = tagsList ;
46
+ } else {
47
+ this .tags = null ;
43
48
}
44
- this .tags = tagsList ;
45
49
}
46
50
47
51
public static final class Adapter extends JsonAdapter <LLMObsEval > {
You can’t perform that action at this time.
0 commit comments