Skip to content

Commit

Permalink
remove underscore_attrs_are_private
Browse files Browse the repository at this point in the history
Signed-off-by: ssbuild <[email protected]>
  • Loading branch information
ssbuild committed Nov 17, 2023
1 parent 6bf1283 commit 0639350
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions serving/openai_api/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# @Time : 2023/8/11 15:31
from typing import Optional, Union, List, Dict, Any
from pydantic import BaseModel
from pydantic.v1 import PrivateAttr

__all__ = [
'CustomChatParams'
Expand Down Expand Up @@ -45,10 +46,11 @@ class CustomChatParams(BaseModel):
functions: Optional[List[Dict[str, Any]]] = None
function_call: Union[str, Dict[str, str]] = "auto"

class Config:
underscore_attrs_are_private = True
# 私有成员
_model_type: Optional[str] = None
# class Config:
# underscore_attrs_are_private = True
# _model_type: Optional[str] = None

_model_type: Optional[str] = PrivateAttr(default=None)

@property
def model_type(self):
Expand Down

0 comments on commit 0639350

Please sign in to comment.