Skip to content

Commit

Permalink
Enable easier debugging of Azure Image and Audio Transcription tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Pollack committed Nov 25, 2024
1 parent d030b82 commit d173572
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
import static org.assertj.core.api.Assertions.assertThat;

/**
* NOTE - Use deployment name "whisper
* NOTE - Use deployment name "whisper"
*
* @author Piotr Olaszewski
*/
Expand Down Expand Up @@ -87,13 +87,15 @@ public static class TestConfiguration {

@Bean
public OpenAIClient openAIClient() {
return new OpenAIClientBuilder()
.credential(new AzureKeyCredential(System.getenv("AZURE_OPENAI_TRANSCRIPTION_API_KEY")))
.endpoint(System.getenv("AZURE_OPENAI_TRANSCRIPTION_ENDPOINT"))
// new
// AzureKeyCredential("2FsJHcxEoyIMWlhT882lUYx6D1ovQeTHNyQjHKsBYtX9Pf9TynrAJQQJ99AKACfhMk5XJ3w3AAAAACOGDOWA"))
// .endpoint("https://mpoll-m3ot7gc7-swedencentral.cognitiveservices.azure.com/")
.serviceVersion(OpenAIServiceVersion.V2024_02_15_PREVIEW)
String apiKey = System.getenv("AZURE_OPENAI_TRANSCRIPTION_API_KEY");
String endpoint = System.getenv("AZURE_OPENAI_TRANSCRIPTION_ENDPOINT");

// System.out.println("API Key: " + apiKey);
// System.out.println("Endpoint: " + endpoint);

return new OpenAIClientBuilder().credential(new AzureKeyCredential(apiKey))
.endpoint(endpoint)
// .serviceVersion(OpenAIServiceVersion.V2024_02_15_PREVIEW)
.buildClient();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,14 @@ public static class TestConfiguration {

@Bean
public OpenAIClient openAIClient() {
return new OpenAIClientBuilder()
.credential(new AzureKeyCredential(System.getenv("AZURE_OPENAI_IMAGE_API_KEY")))
.endpoint(System.getenv("AZURE_OPENAI_IMAGE_ENDPOINT"))
String apiKey = System.getenv("AZURE_OPENAI_IMAGE_API_KEY");
String endpoint = System.getenv("AZURE_OPENAI_IMAGE_ENDPOINT");

// System.out.println("API Key: " + apiKey);
// System.out.println("Endpoint: " + endpoint);

return new OpenAIClientBuilder().credential(new AzureKeyCredential(apiKey))
.endpoint(endpoint)
.buildClient();
}

Expand Down

0 comments on commit d173572

Please sign in to comment.