From 8fc4c09792f0b0d261e4abfd923ce75ada7f0932 Mon Sep 17 00:00:00 2001 From: Shroominic Date: Sat, 15 Jun 2024 14:51:31 -0700 Subject: [PATCH] =?UTF-8?q?=E2=86=97=EF=B8=8F=20update=20chat=20handler=20?= =?UTF-8?q?type?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/funcchain/schema/types.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/funcchain/schema/types.py b/src/funcchain/schema/types.py index 1c2cf12..0bd26df 100644 --- a/src/funcchain/schema/types.py +++ b/src/funcchain/schema/types.py @@ -1,14 +1,12 @@ -from typing import Callable, Optional, Union +from typing import Callable, Union from langchain_core.chat_history import BaseChatMessageHistory from langchain_core.language_models import BaseChatModel -from langchain_core.messages import AIMessage, HumanMessage +from langchain_core.messages import AIMessage, BaseMessage from langchain_core.runnables import Runnable UniversalChatModel = Union[BaseChatModel, str, None] -ChatHandler = Runnable[HumanMessage, AIMessage] +ChatRunnable = Runnable[list[BaseMessage], AIMessage] ChatHistoryFactory = Callable[..., BaseChatMessageHistory] - -OptionalChatHistoryFactory = Optional[ChatHistoryFactory]