mirror of
https://github.com/theroyallab/tabbyAPI.git
synced 2026-04-20 14:28:54 +00:00
API: Fix typing for chat templates in CC requests
Tools must be None by default. Chat completion message content can be None, a string, or a list, so default to None. Exclude all None values from a CC message since the template can say the variable "exists" despite being None, causing an error. Signed-off-by: kingbri <8082010+kingbri1@users.noreply.github.com>
This commit is contained in:
@@ -238,7 +238,7 @@ async def format_messages_with_template(
|
||||
# store the list of dicts rather than the ToolCallProcessor object.
|
||||
message.tool_calls = ToolCallProcessor.dump(message.tool_calls)
|
||||
|
||||
message_dicts.append(message.model_dump())
|
||||
message_dicts.append(message.model_dump(exclude_none=True))
|
||||
|
||||
# Get all special tokens
|
||||
special_tokens_dict = model.container.get_special_tokens()
|
||||
|
||||
Reference in New Issue
Block a user