Files
microsoft--semantic-kernel/python/semantic_kernel/utils/chat.py
T
wehub-resource-sync b957a53def
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
chore: import upstream snapshot with attribution
2026-07-13 13:21:23 +08:00

24 lines
767 B
Python

# Copyright (c) Microsoft. All rights reserved.
from typing import TYPE_CHECKING
from semantic_kernel.contents.chat_history import ChatHistory
if TYPE_CHECKING:
from semantic_kernel.contents.chat_message_content import ChatMessageContent
def store_results(chat_history: ChatHistory, results: list["ChatMessageContent"]) -> ChatHistory:
"""Stores specific results in the context and chat prompt.
Args:
chat_history(ChatHistory): The current chat history instance.
results(list["ChatMessageContent"]): Messages to be stored in the history.
Returns:
ChatHistory: Updated chat history containing the new messages.
"""
for message in results:
chat_history.add_message(message=message)
return chat_history