File tree Expand file tree Collapse file tree
packages/core/src/evaluation/providers Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ( / ^ h t t p s ? : \/ \/ / . 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 ) {
You can’t perform that action at this time.
0 commit comments