Skip to content

Commit 985b7f8

Browse files
committed
Fix unit test of openai
Change-Id: I265e7f65dfd7694a4d8623daca5eabc8a6f49574
1 parent ad3b597 commit 985b7f8

File tree

1 file changed

+3
-0
lines changed
  • instrumentation/openai/openai-java-1.1/library/src/test/java/io/opentelemetry/instrumentation/openai/v1_1

1 file changed

+3
-0
lines changed

instrumentation/openai/openai-java-1.1/library/src/test/java/io/opentelemetry/instrumentation/openai/v1_1/ChatTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.satisfies;
1010
import static io.opentelemetry.semconv.incubating.GenAiIncubatingAttributes.GEN_AI_OPERATION_NAME;
1111
import static io.opentelemetry.semconv.incubating.GenAiIncubatingAttributes.GEN_AI_PROVIDER_NAME;
12+
import static io.opentelemetry.semconv.incubating.GenAiIncubatingAttributes.GEN_AI_REQUEST_CHOICE_COUNT;
1213
import static io.opentelemetry.semconv.incubating.GenAiIncubatingAttributes.GEN_AI_REQUEST_MODEL;
1314
import static io.opentelemetry.semconv.incubating.GenAiIncubatingAttributes.GEN_AI_RESPONSE_FINISH_REASONS;
1415
import static io.opentelemetry.semconv.incubating.GenAiIncubatingAttributes.GEN_AI_RESPONSE_ID;
@@ -215,6 +216,7 @@ void multipleChoicesNoCaptureContent() {
215216
equalTo(GEN_AI_REQUEST_MODEL, TEST_CHAT_MODEL),
216217
satisfies(GEN_AI_RESPONSE_ID, id -> id.startsWith("chatcmpl-")),
217218
equalTo(GEN_AI_RESPONSE_MODEL, TEST_CHAT_RESPONSE_MODEL),
219+
equalTo(GEN_AI_REQUEST_CHOICE_COUNT, 2L),
218220
satisfies(
219221
GEN_AI_RESPONSE_FINISH_REASONS,
220222
reasons -> reasons.containsExactly("stop", "stop")),
@@ -711,6 +713,7 @@ void streamMultipleChoicesNoCaptureContent() {
711713
equalTo(GEN_AI_REQUEST_MODEL, TEST_CHAT_MODEL),
712714
satisfies(GEN_AI_RESPONSE_ID, id -> id.startsWith("chatcmpl-")),
713715
equalTo(GEN_AI_RESPONSE_MODEL, TEST_CHAT_RESPONSE_MODEL),
716+
equalTo(GEN_AI_REQUEST_CHOICE_COUNT, 2L),
714717
satisfies(
715718
GEN_AI_RESPONSE_FINISH_REASONS,
716719
reasons -> reasons.containsExactly("stop", "stop"))))));

0 commit comments

Comments
 (0)