mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-07-29 15:23:51 +00:00
Respect user sent instructions in agent config and add them to system prompt
This commit is contained in:
parent
d29405da52
commit
8e757ed274
1 changed files with 3 additions and 3 deletions
|
@ -126,14 +126,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