Add workaround for shared field_names in pydantic model class (#13925)

Signed-off-by: Max de Bayser <mbayser@br.ibm.com>
This commit is contained in:
Maximilien de Bayser
2025-03-25 17:31:08 -03:00
committed by GitHub
parent 5f063a80bd
commit e977c11111

View File

@ -1238,6 +1238,9 @@ class ChatCompletionLogProb(OpenAIBaseModel):
class ChatCompletionLogProbsContent(ChatCompletionLogProb):
# Workaround: redefine fields name cache so that it's not
# shared with the super class.
field_names: ClassVar[Optional[set[str]]] = None
top_logprobs: list[ChatCompletionLogProb] = Field(default_factory=list)