File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Expand file tree Collapse file tree 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 {
577577 this . _deployment = deployment ;
578578 }
579579
580- override buildRequest ( options : Core . FinalRequestOptions < unknown > ) : {
580+ override buildRequest (
581+ options : Core . FinalRequestOptions < unknown > ,
582+ props : { retryCount ?: number } = { } ,
583+ ) : {
581584 req : RequestInit ;
582585 url : string ;
583586 timeout : number ;
@@ -591,7 +594,7 @@ export class AzureOpenAI extends OpenAI {
591594 options . path = `/deployments/${ model } ${ options . path } ` ;
592595 }
593596 }
594- return super . buildRequest ( options ) ;
597+ return super . buildRequest ( options , props ) ;
595598 }
596599
597600 private async _getAzureADToken ( ) : Promise < string | undefined > {
Original file line number Diff line number Diff line change @@ -51,6 +51,18 @@ describe('instantiate azure client', () => {
5151 } ) ;
5252 expect ( req . headers as Headers ) . not . toHaveProperty ( 'x-my-default-header' ) ;
5353 } ) ;
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+ } ) ;
5466 } ) ;
5567
5668 describe ( 'defaultQuery' , ( ) => {
You can’t perform that action at this time.
0 commit comments