Skip to content

Commit cc7fce6

Browse files
committed
Update to use final
1 parent 8851a1e commit cc7fce6

File tree

1 file changed

+4
-4
lines changed
  • foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai

1 file changed

+4
-4
lines changed

foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/OpenAiClient.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,13 @@ public OpenAiClient withApiVersion(@Nonnull final String apiVersion) {
9494
@Beta
9595
@Nonnull
9696
public static OpenAiClient withCustomDestination(@Nonnull final Destination destination) {
97-
OpenAiClient client = new OpenAiClient(destination);
97+
final OpenAiClient client = new OpenAiClient(destination);
9898

99-
if (!destination.get("URL.queries.api-version").isDefined()) {
100-
client = client.withApiVersion(DEFAULT_API_VERSION);
99+
if (destination.get("URL.queries.api-version").isDefined()) {
100+
return client;
101101
}
102102

103-
return client;
103+
return client.withApiVersion(DEFAULT_API_VERSION);
104104
}
105105

106106
/**

0 commit comments

Comments
 (0)