Skip to content

Commit c9c8c26

Browse files
committed
revert samples changes
1 parent 1e4f061 commit c9c8c26

File tree

2 files changed

+6
-49
lines changed

2 files changed

+6
-49
lines changed

openai-java-example/src/main/java/com/openai/example/AzureApiKeyExample.java

Lines changed: 0 additions & 37 deletions
This file was deleted.

openai-java-example/src/main/java/com/openai/example/AzureEntraIdExample.java

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,16 @@ public final class AzureEntraIdExample {
1212
private AzureEntraIdExample() {}
1313

1414
public static void main(String[] args) {
15-
OpenAIOkHttpClient.Builder clientBuilder = OpenAIOkHttpClient.builder();
16-
17-
/* Azure-specific code starts here */
18-
// You can either set 'endpoint' directly in the builder.
19-
// or set the env var "AZURE_OPENAI_ENDPOINT" and use fromEnv() method instead
20-
clientBuilder
21-
.baseUrl(System.getenv("AZURE_OPENAI_ENDPOINT"))
15+
OpenAIClient client = OpenAIOkHttpClient.builder()
16+
// Gets the API key from the `AZURE_OPENAI_KEY` environment variable
17+
.fromEnv()
2218
// Set the Azure Entra ID
2319
.credential(BearerTokenCredential.create(AuthenticationUtil.getBearerTokenSupplier(
24-
new DefaultAzureCredentialBuilder().build(), "https://cognitiveservices.azure.com/.default")));
25-
/* Azure-specific code ends here */
26-
27-
OpenAIClient client = clientBuilder.build();
20+
new DefaultAzureCredentialBuilder().build(), "https://cognitiveservices.azure.com/.default")))
21+
.build();
2822

2923
ChatCompletionCreateParams createParams = ChatCompletionCreateParams.builder()
30-
.model(ChatModel.GPT_4O)
24+
.model(ChatModel.GPT_3_5_TURBO)
3125
.maxCompletionTokens(2048)
3226
.addDeveloperMessage("Make sure you mention Stainless!")
3327
.addUserMessage("Tell me a story about building the best SDK!")

0 commit comments

Comments
 (0)