mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-27 22:37:46 +00:00
core[minor], langchain[patch], experimental[patch]: Added missing py.typed
to langchain_core
(#14143)
See PR title. From what I can see, `poetry` will auto-include this. Please let me know if I am missing something here. --------- Co-authored-by: Bagatur <baskaryan@gmail.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import uuid
|
||||
from typing import Any, Callable, Optional
|
||||
from typing import Any, Callable, Optional, cast
|
||||
|
||||
from langchain.callbacks.manager import CallbackManagerForChainRun
|
||||
from langchain.schema import AIMessage, HumanMessage
|
||||
@@ -54,10 +54,10 @@ class BaseModeration:
|
||||
message = prompt.messages[-1]
|
||||
self.chat_message_index = len(prompt.messages) - 1
|
||||
if isinstance(message, HumanMessage):
|
||||
input_text = message.content
|
||||
input_text = cast(str, message.content)
|
||||
|
||||
if isinstance(message, AIMessage):
|
||||
input_text = message.content
|
||||
input_text = cast(str, message.content)
|
||||
else:
|
||||
raise ValueError(
|
||||
f"Invalid input type {type(input_text)}. "
|
||||
|
Reference in New Issue
Block a user