Remove unnecessary comments and improve result handling in ConversationChainComponent
This commit is contained in:
parent
176f6b1640
commit
9192d50e72
1 changed files with 0 additions and 2 deletions
|
|
@ -32,8 +32,6 @@ class ConversationChainComponent(CustomComponent):
|
||||||
else:
|
else:
|
||||||
chain = ConversationChain(llm=llm, memory=memory)
|
chain = ConversationChain(llm=llm, memory=memory)
|
||||||
result = chain.invoke(inputs)
|
result = chain.invoke(inputs)
|
||||||
# result is an AIMessage which is a subclass of BaseMessage
|
|
||||||
# We need to check if it is a string or a BaseMessage
|
|
||||||
if hasattr(result, "content") and isinstance(result.content, str):
|
if hasattr(result, "content") and isinstance(result.content, str):
|
||||||
result = result.content
|
result = result.content
|
||||||
elif isinstance(result, str):
|
elif isinstance(result, str):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue