Add memory info to ConversationChainComponent
This commit is contained in:
parent
12cc665566
commit
1a8825f491
1 changed files with 6 additions and 1 deletions
|
|
@ -12,7 +12,10 @@ class ConversationChainComponent(CustomComponent):
|
||||||
return {
|
return {
|
||||||
"prompt": {"display_name": "Prompt"},
|
"prompt": {"display_name": "Prompt"},
|
||||||
"llm": {"display_name": "LLM"},
|
"llm": {"display_name": "LLM"},
|
||||||
"memory": {"display_name": "Memory"},
|
"memory": {
|
||||||
|
"display_name": "Memory",
|
||||||
|
"info": "Memory to load context from. If none is provided, a ConversationBufferMemory will be used.",
|
||||||
|
},
|
||||||
"code": {"show": False},
|
"code": {"show": False},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -21,4 +24,6 @@ class ConversationChainComponent(CustomComponent):
|
||||||
llm: BaseLanguageModel,
|
llm: BaseLanguageModel,
|
||||||
memory: Optional[BaseMemory] = None,
|
memory: Optional[BaseMemory] = None,
|
||||||
) -> Union[Chain, Callable]:
|
) -> Union[Chain, Callable]:
|
||||||
|
if memory is None:
|
||||||
|
return ConversationChain(llm=llm)
|
||||||
return ConversationChain(llm=llm, memory=memory)
|
return ConversationChain(llm=llm, memory=memory)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue