File tree Expand file tree Collapse file tree 3 files changed +9
-9
lines changed 
mistralai_azure/src/mistralai_azure/_hooks 
mistralai_gcp/src/mistralai_gcp/_hooks Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 55
66from  .types  import  BeforeRequestContext , BeforeRequestHook 
77
8- prefix  =  "mistral-client-python/" 
8+ PREFIX  =  "mistral-client-python/" 
99
1010class  CustomUserAgentHook (BeforeRequestHook ):
1111    def  before_request (
1212        self , hook_ctx : BeforeRequestContext , request : httpx .Request 
1313    ) ->  Union [httpx .Request , Exception ]:
1414        current  =  request .headers ["user-agent" ]
15-         if  current .startswith (prefix ):
15+         if  current .startswith (PREFIX ):
1616            return  request 
1717
1818        request .headers ["user-agent" ] =  (
19-             prefix  +  current .split (" " )[1 ]
19+             PREFIX  +  current .split (" " )[1 ]
2020        )
2121
2222        return  request 
Original file line number Diff line number Diff line change 55
66from  .types  import  BeforeRequestContext , BeforeRequestHook 
77
8- prefix  =  "mistral-client-python/" 
8+ PREFIX  =  "mistral-client-python/" 
99
1010class  CustomUserAgentHook (BeforeRequestHook ):
1111    def  before_request (
1212        self , hook_ctx : BeforeRequestContext , request : httpx .Request 
1313    ) ->  Union [httpx .Request , Exception ]:
1414        current  =  request .headers ["user-agent" ]
15-         if  current .startswith (prefix ):
15+         if  current .startswith (PREFIX ):
1616            return  request 
1717
1818        request .headers ["user-agent" ] =  (
19-             prefix  +  current .split (" " )[1 ]
19+             PREFIX  +  current .split (" " )[1 ]
2020        )
2121
2222        return  request 
Original file line number Diff line number Diff line change 55
66from  .types  import  BeforeRequestContext , BeforeRequestHook 
77
8- prefix  =  "mistral-client-python/" 
8+ PREFIX  =  "mistral-client-python/" 
99
1010class  CustomUserAgentHook (BeforeRequestHook ):
1111    def  before_request (
1212        self , hook_ctx : BeforeRequestContext , request : httpx .Request 
1313    ) ->  Union [httpx .Request , Exception ]:
1414        current  =  request .headers ["user-agent" ]
15-         if  current .startswith (prefix ):
15+         if  current .startswith (PREFIX ):
1616            return  request 
1717
1818        request .headers ["user-agent" ] =  (
19-             prefix  +  current .split (" " )[1 ]
19+             PREFIX  +  current .split (" " )[1 ]
2020        )
2121
2222        return  request 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments