feat: support history, norms and goals for LLM
ref: N25B-299
This commit is contained in:
@@ -17,9 +17,9 @@ class LLMInstructions:
|
||||
Try to learn the user's name during conversation.
|
||||
""".strip()
|
||||
|
||||
def __init__(self, norms: str | None = None, goals: str | None = None):
|
||||
self.norms = norms if norms is not None else self.default_norms()
|
||||
self.goals = goals if goals is not None else self.default_goals()
|
||||
def __init__(self, norms: list[str] = None, goals: list[str] = None):
|
||||
self.norms = norms or self.default_norms()
|
||||
self.goals = goals or self.default_goals()
|
||||
|
||||
def build_developer_instruction(self) -> str:
|
||||
"""
|
||||
@@ -35,12 +35,14 @@ class LLMInstructions:
|
||||
|
||||
if self.norms:
|
||||
sections.append("Norms to follow:")
|
||||
sections.append(self.norms)
|
||||
for norm in self.norms:
|
||||
sections.append("- " + norm)
|
||||
sections.append("")
|
||||
|
||||
if self.goals:
|
||||
sections.append("Goals to reach:")
|
||||
sections.append(self.goals)
|
||||
for goal in self.goals:
|
||||
sections.append("- " + goal)
|
||||
sections.append("")
|
||||
|
||||
return "\n".join(sections).strip()
|
||||
|
||||
Reference in New Issue
Block a user