-
Notifications
You must be signed in to change notification settings - Fork 123
Azure example doesn't recognize endpoint URL #467
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I see it says |
Hi, no, that's exactly my point. Seems the client is using that URL which is typically used when no URL is set for |
Hi @mzattera, have you tried enabling logging? I was able to hit an azure endpoint using the sample. Admittedly, I had to add also the OpenAIClient client = OpenAIOkHttpClient.builder()
// Gets the API key from the `AZURE_OPENAI_KEY` environment variable
.fromEnv()
// Set the Azure Entra ID
.credential(BearerTokenCredential.create(AuthenticationUtil.getBearerTokenSupplier(
new DefaultAzureCredentialBuilder().build(), "https://cognitiveservices.azure.com/.default")))
.azureServiceVersion(AzureOpenAIServiceVersion.getV2025_01_01_PREVIEW())
.build();
ChatCompletionCreateParams createParams = ChatCompletionCreateParams.builder()
.model(ChatModel.of("Your deployment name"))
.maxCompletionTokens(2048)
.addDeveloperMessage("Make sure you mention Stainless!")
.addUserMessage("Tell me a story about building the best SDK!")
.build(); I am setting the following environment variables: AZURE_OPENAI_KEY=<your key value>
OPENAI_BASE_URL=<your endpoint value>
OPENAI_LOG=debug I would triple check that you are passing a URL that parses correctly in the I would also recommend updating to the latest version of the SDK in your |
When running the Azure example provided in example folder, I get the below exception.
It seems base URL is not properly recognized.
I have provided both AZURE_OPENAI_KEY and OPENAI_BASE_URL in my environment and I am testing they are read correctly by my app, I get the same error even if I specify the endpoint using:
If it helps, my POM file is below:
The text was updated successfully, but these errors were encountered: