Skip to content

Commit

Permalink
Warning fix for Pydantic 2.0 (#5679) (#5707)
Browse files Browse the repository at this point in the history
* Fixed UserWarning: Valid config keys have changed in V2 underscore_attrs_are_private

* Trying different method

Co-authored-by: CyanideByte <[email protected]>
  • Loading branch information
ishaan-jaff and CyanideByte committed Sep 16, 2024
1 parent aa64c34 commit 3a5039e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions litellm/rerank_api/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from typing import List, Optional, Union

from pydantic import BaseModel
from pydantic import BaseModel, PrivateAttr


class RerankRequest(BaseModel):
Expand All @@ -23,7 +23,9 @@ class RerankResponse(BaseModel):
id: str
results: List[dict] # Contains index and relevance_score
meta: dict # Contains api_version and billed_units
_hidden_params: dict = {}

# Define private attributes using PrivateAttr
_hidden_params: dict = PrivateAttr(default_factory=dict)

def __getitem__(self, key):
return self.__dict__[key]
Expand Down

0 comments on commit 3a5039e

Please sign in to comment.