Enable easier debugging of Azure Image and Audio Transcription tests
This commit is contained in:
@@ -36,7 +36,7 @@ import org.springframework.core.io.Resource;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
/**
|
||||
* NOTE - Use deployment name "whisper
|
||||
* NOTE - Use deployment name "whisper"
|
||||
*
|
||||
* @author Piotr Olaszewski
|
||||
*/
|
||||
@@ -87,13 +87,15 @@ class AzureOpenAiAudioTranscriptionModelIT {
|
||||
|
||||
@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();
|
||||
}
|
||||
|
||||
|
||||
@@ -87,9 +87,14 @@ public class AzureOpenAiImageModelIT {
|
||||
|
||||
@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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user