Skip to content

Commit cd8911f

Browse files
committed
Fix merge
1 parent 57418b4 commit cd8911f

File tree

2 files changed

+0
-83
lines changed
  • instrumentation/openai/openai-java-1.1

2 files changed

+0
-83
lines changed

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,4 @@ public OpenAIClientAsync wrap(OpenAIClientAsync client) {
6161
client, chatInstrumenter, embeddingsInstrumenter, eventLogger, captureMessageContent)
6262
.createProxy();
6363
}
64-
65-
/** Wraps the provided OpenAIClientAsync, enabling telemetry for it. */
66-
public OpenAIClientAsync wrap(OpenAIClientAsync client) {
67-
return new InstrumentedOpenAiClientAsync(
68-
client, chatInstrumenter, eventLogger, captureMessageContent)
69-
.createProxy();
70-
}
7164
}

instrumentation/openai/openai-java-1.1/testing/src/main/java/io/opentelemetry/instrumentation/openai/v1_1/AbstractChatTest.java

Lines changed: 0 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -155,82 +155,6 @@ protected final List<ChatCompletionChunk> doCompletionsStreaming(
155155
throw new AssertionError();
156156
}
157157

158-
@Parameter TestType testType;
159-
160-
protected final ChatCompletion doCompletions(ChatCompletionCreateParams params) {
161-
return doCompletions(params, getClient(), getClientAsync());
162-
}
163-
164-
protected final ChatCompletion doCompletions(
165-
ChatCompletionCreateParams params, OpenAIClient client, OpenAIClientAsync clientAsync) {
166-
switch (testType) {
167-
case SYNC:
168-
return client.chat().completions().create(params);
169-
case SYNC_FROM_ASYNC:
170-
return clientAsync.sync().chat().completions().create(params);
171-
case ASYNC:
172-
case ASYNC_FROM_SYNC:
173-
OpenAIClientAsync cl = testType == TestType.ASYNC ? clientAsync : client.async();
174-
try {
175-
return cl.chat()
176-
.completions()
177-
.create(params)
178-
.thenApply(
179-
res -> {
180-
assertThat(Span.fromContextOrNull(Context.current())).isNull();
181-
return res;
182-
})
183-
.join();
184-
} catch (CompletionException e) {
185-
if (e.getCause() instanceof OpenAIIoException) {
186-
throw ((OpenAIIoException) e.getCause());
187-
}
188-
throw e;
189-
}
190-
}
191-
throw new AssertionError();
192-
}
193-
194-
protected final List<ChatCompletionChunk> doCompletionsStreaming(
195-
ChatCompletionCreateParams params) {
196-
return doCompletionsStreaming(params, getClient(), getClientAsync());
197-
}
198-
199-
protected final List<ChatCompletionChunk> doCompletionsStreaming(
200-
ChatCompletionCreateParams params, OpenAIClient client, OpenAIClientAsync clientAsync) {
201-
switch (testType) {
202-
case SYNC:
203-
try (StreamResponse<ChatCompletionChunk> result =
204-
client.chat().completions().createStreaming(params)) {
205-
return result.stream().collect(Collectors.toList());
206-
}
207-
case SYNC_FROM_ASYNC:
208-
try (StreamResponse<ChatCompletionChunk> result =
209-
clientAsync.sync().chat().completions().createStreaming(params)) {
210-
return result.stream().collect(Collectors.toList());
211-
}
212-
case ASYNC:
213-
case ASYNC_FROM_SYNC:
214-
{
215-
OpenAIClientAsync cl = testType == TestType.ASYNC ? clientAsync : client.async();
216-
AsyncStreamResponse<ChatCompletionChunk> stream =
217-
cl.chat().completions().createStreaming(params);
218-
List<ChatCompletionChunk> result = new ArrayList<>();
219-
stream.subscribe(result::add);
220-
try {
221-
stream.onCompleteFuture().join();
222-
} catch (CompletionException e) {
223-
if (e.getCause() instanceof OpenAIIoException) {
224-
throw ((OpenAIIoException) e.getCause());
225-
}
226-
throw e;
227-
}
228-
return result;
229-
}
230-
}
231-
throw new AssertionError();
232-
}
233-
234158
@Test
235159
void basic() {
236160
ChatCompletionCreateParams params =

0 commit comments

Comments
 (0)