forked from phoenix/litellm-mirror
fix(router.py): handle id being passed in as int
This commit is contained in:
parent
12e5118367
commit
2236f283fe
7 changed files with 29 additions and 4 deletions
|
@ -37,9 +37,11 @@ class ModelInfo(BaseModel):
|
|||
str
|
||||
] # Allow id to be optional on input, but it will always be present as a str in the model instance
|
||||
|
||||
def __init__(self, id: Optional[str] = None, **params):
|
||||
def __init__(self, id: Optional[Union[str, int]] = None, **params):
|
||||
if id is None:
|
||||
id = str(uuid.uuid4()) # Generate a UUID if id is None or not provided
|
||||
elif isinstance(id, int):
|
||||
id = str(id)
|
||||
super().__init__(id=id, **params)
|
||||
|
||||
class Config:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue