change Message init type annotation to support other roles (#11942)

This commit is contained in:
Alessandro Marrella 2025-06-28 03:12:13 +02:00 committed by GitHub
parent 9ab7d97b85
commit 0e10ae1cf1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -623,7 +623,7 @@ class Message(OpenAIObject):
def __init__(
self,
content: Optional[str] = None,
role: Literal["assistant"] = "assistant",
role: Literal["assistant", "user", "system", "tool", "function"] = "assistant",
function_call=None,
tool_calls: Optional[list] = None,
audio: Optional[ChatCompletionAudioResponse] = None,