Skip to content

Commit 97dfceb

Browse files
christsoclaude
andauthored
fix(pi-cli): set AZURE_OPENAI_BASE_URL for full URLs, AZURE_OPENAI_RESOURCE_NAME for bare names (#1367)
Closes #1366 Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent a46dc26 commit 97dfceb

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

  • packages/core/src/evaluation/providers

packages/core/src/evaluation/providers/pi-cli.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,13 +254,19 @@ export class PiCliProvider implements Provider {
254254
const provider = this.config.subprovider?.toLowerCase() ?? 'google';
255255

256256
if (provider === 'azure') {
257-
// Pi CLI uses azure-openai-responses with AZURE_OPENAI_RESOURCE_NAME.
258-
// Extract the resource name from base_url (or use it as-is if already a name).
257+
// Pi CLI uses azure-openai-responses with either AZURE_OPENAI_RESOURCE_NAME
258+
// (short name, pi constructs the URL) or AZURE_OPENAI_BASE_URL (full URL used as-is).
259259
if (this.config.apiKey) {
260260
env.AZURE_OPENAI_API_KEY = this.config.apiKey;
261261
}
262262
if (this.config.baseUrl) {
263-
env.AZURE_OPENAI_RESOURCE_NAME = extractAzureResourceName(this.config.baseUrl);
263+
if (/^https?:\/\//.test(this.config.baseUrl)) {
264+
// Full URL — pass directly so pi uses it as-is
265+
env.AZURE_OPENAI_BASE_URL = this.config.baseUrl;
266+
} else {
267+
// Bare resource name — existing behaviour, pi constructs the URL
268+
env.AZURE_OPENAI_RESOURCE_NAME = extractAzureResourceName(this.config.baseUrl);
269+
}
264270
}
265271
} else {
266272
if (this.config.apiKey) {

0 commit comments

Comments
 (0)