Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

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

Alessandro Marrella0e10ae1cf188
diff --git a/litellm/types/utils.py b/litellm/types/utils.py
index b28977e7e58..5e38402031b 100644
--- a/litellm/types/utils.py
+++ b/litellm/types/utils.py
@@ -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,