Skip to content

Commit 0c879ba

Browse files
committed
Fix format
1 parent a3051e3 commit 0c879ba

File tree

3 files changed

+18
-12
lines changed

3 files changed

+18
-12
lines changed

dd-java-agent/instrumentation/openai-java/openai-java-3.0/src/main/java/datadog/trace/instrumentation/openai_java/ResponseDecorator.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -710,6 +710,10 @@ private List<LLMObs.LLMMessage> extractInputMessagesForPromptTracking(
710710
}
711711
}
712712

713+
if (!messages.isEmpty()) {
714+
return messages;
715+
}
716+
713717
Object inputTag = span.getTag(CommonTags.INPUT);
714718
if (inputTag instanceof List) {
715719
for (Object messageObj : (List<?>) inputTag) {

dd-java-agent/instrumentation/openai-java/openai-java-3.0/src/test/groovy/ResponseServiceTest.groovy

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -224,13 +224,13 @@ class ResponseServiceTest extends OpenAiTest {
224224
}
225225
226226
private void assertResponseTrace(
227-
boolean isStreaming,
228-
String reqModel,
229-
String respModel,
230-
Map reasoning,
231-
List inputTagsOut,
232-
List outputTagsOut,
233-
Map<String, Object> metadataOut) {
227+
boolean isStreaming,
228+
String reqModel,
229+
String respModel,
230+
Map reasoning,
231+
List inputTagsOut,
232+
List outputTagsOut,
233+
Map<String, Object> metadataOut) {
234234
assertTraces(1) {
235235
trace(3) {
236236
sortSpansByStart()

dd-trace-core/src/test/groovy/datadog/trace/llmobs/writer/ddintake/LLMObsSpanMapperTest.groovy

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,13 @@ class LLMObsSpanMapperTest extends DDCoreSpecification {
5858
])
5959
llmSpan.setTag("_ml_obs_tag.output", outputMessages)
6060
llmSpan.setTag("_ml_obs_tag.metadata", [temperature: 0.7, max_tokens: 100])
61-
llmSpan.setTag("_ml_obs_tag.tool_definitions", [[
62-
name: "get_weather",
63-
description: "Get weather by city",
64-
schema: [type: "object", properties: [city: [type: "string"]]]
65-
]])
61+
llmSpan.setTag("_ml_obs_tag.tool_definitions", [
62+
[
63+
name: "get_weather",
64+
description: "Get weather by city",
65+
schema: [type: "object", properties: [city: [type: "string"]]]
66+
]
67+
])
6668
llmSpan.setError(true)
6769
llmSpan.setTag(DDTags.ERROR_MSG, "boom")
6870
llmSpan.setTag(DDTags.ERROR_TYPE, "java.lang.IllegalStateException")

0 commit comments

Comments
 (0)