mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-06-28 02:53:30 +00:00
Respect user sent instructions in agent config and add them to system prompt
This commit is contained in:
parent
06abd7e6c8
commit
8bf8c07eb3
1 changed files with 3 additions and 3 deletions
|
@ -127,14 +127,14 @@ class ChatAgent(ShieldRunnerMixin):
|
||||||
session = self.sessions[request.session_id]
|
session = self.sessions[request.session_id]
|
||||||
|
|
||||||
messages = []
|
messages = []
|
||||||
|
if len(session.turns) == 0 and self.agent_config.instructions != "":
|
||||||
|
messages.append(SystemMessage(content=self.agent_config.instructions))
|
||||||
|
|
||||||
for i, turn in enumerate(session.turns):
|
for i, turn in enumerate(session.turns):
|
||||||
messages.extend(self.turn_to_messages(turn))
|
messages.extend(self.turn_to_messages(turn))
|
||||||
|
|
||||||
messages.extend(request.messages)
|
messages.extend(request.messages)
|
||||||
|
|
||||||
# print("processed dialog ======== ")
|
|
||||||
# print_dialog(messages)
|
|
||||||
|
|
||||||
turn_id = str(uuid.uuid4())
|
turn_id = str(uuid.uuid4())
|
||||||
start_time = datetime.now()
|
start_time = datetime.now()
|
||||||
yield AgentTurnResponseStreamChunk(
|
yield AgentTurnResponseStreamChunk(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue