Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion agentfly/templates/templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ def _encode_system_tools(self, tools: List[Dict]) -> str:
return "\n".join([json.dumps(tool) for tool in tools])

def _encode_system_message_default(self, tools=None) -> str:
Logger.debug(f"[Template] Encoding system message default for template: {self.name}")
if not self.system_policy.use_system_without_system_message:
if tools is None:
return ""
Expand All @@ -345,6 +346,7 @@ def _encode_system_message_default(self, tools=None) -> str:

def _encode_system_message(self, content, tools=None) -> str:
# Handle both string content and list content formats
Logger.debug(f"[Template] Encoding system message for template: {self.name}")
if isinstance(content, str):
system_message = content
else:
Expand Down Expand Up @@ -1485,6 +1487,7 @@ def get_template(name: str) -> Template:
register_template(
Template(
name="deepseek-r1-distill-qwen",
system_template="{system_message}",
user_template="<|User|>{content}",
assistant_template="<|Assistant|>{content}<|end▁of▁sentence|>",
stop_words=["<|end▁of▁sentence|>"],
Expand All @@ -1493,7 +1496,7 @@ def get_template(name: str) -> Template:
prefix="<|begin▁of▁sentence|>"
),
system_policy=SystemPolicy(
use_system=False,
use_system=True,
use_system_without_system_message=False,
),
)
Expand Down