Skip to content

Commit b4c74bf

Browse files
committed
fix(types): make assistant message name optional
- Mark the assistant message `name` field as `NotRequired[Optional[str]]` to match the optional nature of assistant message metadata and avoid requiring callers to provide `name` in typed chat completion requests. Signed-off-by: JamePeng <jame_peng@sina.com>
1 parent 169d5e1 commit b4c74bf

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎llama_cpp/llama_types.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ class ChatCompletionRequestAssistantMessageFunctionCall(TypedDict):
427427
class ChatCompletionRequestAssistantMessage(TypedDict):
428428
"""Messages sent by the model in response to user messages."""
429429
role: Literal["assistant"]
430-
name: Optional[str]
430+
name: NotRequired[Optional[str]]
431431
content: NotRequired[Optional[str]]
432432
refusal: NotRequired[Optional[str]]
433433
tool_calls: NotRequired[ChatCompletionMessageToolCalls]

0 commit comments

Comments
 (0)