Skip to content

Commit bcd60a9

Browse files
committed
Cleanup
1 parent 2fa61f5 commit bcd60a9

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

instrumentation/openai/openai-java-1.1/library/src/main/java/io/opentelemetry/instrumentation/openai/v1_1/ChatCompletionEventsHelper.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ private static String contentToString(ChatCompletionToolMessageParam.Content con
9999
} else if (content.isArrayOfContentParts()) {
100100
return joinContentParts(content.asArrayOfContentParts());
101101
} else {
102-
throw new IllegalStateException("Unhandled content type for " + content);
102+
return "";
103103
}
104104
}
105105

@@ -121,7 +121,7 @@ private static String contentToString(ChatCompletionAssistantMessageParam.Conten
121121
.filter(Objects::nonNull)
122122
.collect(Collectors.joining());
123123
} else {
124-
throw new IllegalStateException("Unhandled content type for " + content);
124+
return "";
125125
}
126126
}
127127

@@ -131,7 +131,7 @@ private static String contentToString(ChatCompletionSystemMessageParam.Content c
131131
} else if (content.isArrayOfContentParts()) {
132132
return joinContentParts(content.asArrayOfContentParts());
133133
} else {
134-
throw new IllegalStateException("Unhandled content type for " + content);
134+
return "";
135135
}
136136
}
137137

@@ -141,7 +141,7 @@ private static String contentToString(ChatCompletionDeveloperMessageParam.Conten
141141
} else if (content.isArrayOfContentParts()) {
142142
return joinContentParts(content.asArrayOfContentParts());
143143
} else {
144-
throw new IllegalStateException("Unhandled content type for " + content);
144+
return "";
145145
}
146146
}
147147

@@ -154,7 +154,7 @@ private static String contentToString(ChatCompletionUserMessageParam.Content con
154154
.filter(Objects::nonNull)
155155
.collect(Collectors.joining());
156156
} else {
157-
throw new IllegalStateException("Unhandled content type for " + content);
157+
return "";
158158
}
159159
}
160160

testing/wiremock-shaded-for-testing/build.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ plugins {
44
}
55

66
dependencies {
7+
// If tests fail when updating this, update the list of relocate based on any
8+
// class conflict reported in the failure.
79
implementation("com.github.tomakehurst:wiremock-jre8:2.35.2")
810
implementation("com.google.errorprone:error_prone_annotations")
911
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.18.2")

0 commit comments

Comments
 (0)