mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-08-06 02:32:40 +00:00
work with all types
This commit is contained in:
parent
e84d3966c4
commit
21c185403a
1 changed files with 11 additions and 1 deletions
|
@ -481,7 +481,17 @@ class ChatAgent(ShieldRunnerMixin):
|
||||||
contexts.append(raw_document_text)
|
contexts.append(raw_document_text)
|
||||||
|
|
||||||
attached_context = "\n".join(contexts)
|
attached_context = "\n".join(contexts)
|
||||||
input_messages[-1].content += attached_context
|
if isinstance(input_messages[-1].content, str):
|
||||||
|
input_messages[-1].content += attached_context
|
||||||
|
elif isinstance(input_messages[-1].content, list):
|
||||||
|
input_messages[-1].content.append(
|
||||||
|
TextContentItem(text=attached_context)
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
input_messages[-1].content = [
|
||||||
|
input_messages[-1].content,
|
||||||
|
TextContentItem(text=attached_context),
|
||||||
|
]
|
||||||
|
|
||||||
session_info = await self.storage.get_session_info(session_id)
|
session_info = await self.storage.get_session_info(session_id)
|
||||||
# if the session has a memory bank id, let the memory tool use it
|
# if the session has a memory bank id, let the memory tool use it
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue