File tree 2 files changed +17
-2
lines changed
2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -577,7 +577,10 @@ export class AzureOpenAI extends OpenAI {
577
577
this . _deployment = deployment ;
578
578
}
579
579
580
- override buildRequest ( options : Core . FinalRequestOptions < unknown > ) : {
580
+ override buildRequest (
581
+ options : Core . FinalRequestOptions < unknown > ,
582
+ props : { retryCount ?: number } = { } ,
583
+ ) : {
581
584
req : RequestInit ;
582
585
url : string ;
583
586
timeout : number ;
@@ -591,7 +594,7 @@ export class AzureOpenAI extends OpenAI {
591
594
options . path = `/deployments/${ model } ${ options . path } ` ;
592
595
}
593
596
}
594
- return super . buildRequest ( options ) ;
597
+ return super . buildRequest ( options , props ) ;
595
598
}
596
599
597
600
private async _getAzureADToken ( ) : Promise < string | undefined > {
Original file line number Diff line number Diff line change @@ -51,6 +51,18 @@ describe('instantiate azure client', () => {
51
51
} ) ;
52
52
expect ( req . headers as Headers ) . not . toHaveProperty ( 'x-my-default-header' ) ;
53
53
} ) ;
54
+
55
+ test ( 'includes retry count' , ( ) => {
56
+ const { req } = client . buildRequest (
57
+ {
58
+ path : '/foo' ,
59
+ method : 'post' ,
60
+ headers : { 'X-My-Default-Header' : null } ,
61
+ } ,
62
+ { retryCount : 1 } ,
63
+ ) ;
64
+ expect ( ( req . headers as Headers ) [ 'x-stainless-retry-count' ] ) . toEqual ( '1' ) ;
65
+ } ) ;
54
66
} ) ;
55
67
56
68
describe ( 'defaultQuery' , ( ) => {
You can’t perform that action at this time.
0 commit comments