11import  importlib .metadata 
22from  enum  import  Enum 
33from  pathlib  import  Path 
4- from  typing  import  Any ,  List ,  Optional ,  Union 
4+ from  typing  import  Any 
55
66from  pydantic  import  BaseModel , ConfigDict , field_validator 
77from  pydantic_settings  import  BaseSettings 
@@ -23,8 +23,8 @@ class OpenAIChatCompletionRequest(BaseModel):
2323        This class accepts extra fields that are not validated. 
2424    """ 
2525
26-     messages : List [dict [str , Union [ str ,  List [dict [str , Union [ str ,  dict [str , Any ]] ]]]]]
27-     tools : Optional [ List [ dict [str , Any ]]]  =  None 
26+     messages : list [dict [str , str   |   list [dict [str , str   |   dict [str , Any ]]]]]
27+     tools : list [ dict [str , Any ]]  |   None  =  None 
2828
2929    # Allow extra fields as the `from_openai` method will handle them. 
3030    # We never validate the input, so we don't need to worry about the extra fields. 
@@ -83,16 +83,16 @@ def _validate_engine_url(cls, value: str) -> str:
8383
8484    @field_validator ("engine_backend" , mode = "before" ) 
8585    @classmethod  
86-     def  _validate_backend (cls , value : Union [ str ,  EngineBackend ] ) ->  EngineBackend :
86+     def  _validate_backend (cls , value : str   |   EngineBackend ) ->  EngineBackend :
8787        if  isinstance (value , str ):
8888            value  =  EngineBackend (value )
8989        return  value 
9090
9191    def  model_post_init (self , context : Any ) ->  None :
9292        super ().model_post_init (context )
93-         self ._tokenizer : Optional [ MistralTokenizer ]  =  None 
93+         self ._tokenizer : MistralTokenizer   |   None  =  None 
9494
95-     def  _load_tokenizer (self , tokenizer_path : Union [ str ,  Path ] , validation_mode : ValidationMode ) ->  None :
95+     def  _load_tokenizer (self , tokenizer_path : str   |   Path , validation_mode : ValidationMode ) ->  None :
9696        if  tokenizer_path  ==  "" :
9797            raise  ValueError ("Tokenizer path must be set via the environment variable `TOKENIZER_PATH`." )
9898        elif  self ._tokenizer  is  not None :
0 commit comments