forked from microsoft/semantic-kernel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchat.py
More file actions
23 lines (16 loc) · 767 Bytes
/
chat.py
File metadata and controls
23 lines (16 loc) · 767 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# 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