Update LLMChainComponent signature
This commit is contained in:
parent
f232efe179
commit
5eb2e7f979
1 changed files with 3 additions and 2 deletions
|
|
@ -1,8 +1,9 @@
|
||||||
from typing import Callable, Optional, Union
|
from typing import Callable, Optional, Union
|
||||||
|
|
||||||
from langchain.chains import LLMChain
|
from langchain.chains import LLMChain
|
||||||
|
|
||||||
from langflow import CustomComponent
|
from langflow import CustomComponent
|
||||||
from langflow.field_typing import BaseLanguageModel, BaseMemory, BasePromptTemplate, Chain
|
from langflow.field_typing import BaseLanguageModel, BaseMemory, BasePromptTemplate, Chain, Text
|
||||||
|
|
||||||
|
|
||||||
class LLMChainComponent(CustomComponent):
|
class LLMChainComponent(CustomComponent):
|
||||||
|
|
@ -22,5 +23,5 @@ class LLMChainComponent(CustomComponent):
|
||||||
prompt: BasePromptTemplate,
|
prompt: BasePromptTemplate,
|
||||||
llm: BaseLanguageModel,
|
llm: BaseLanguageModel,
|
||||||
memory: Optional[BaseMemory] = None,
|
memory: Optional[BaseMemory] = None,
|
||||||
) -> Union[Chain, Callable]:
|
) -> Union[Chain, Callable, Text]:
|
||||||
return LLMChain(prompt=prompt, llm=llm, memory=memory)
|
return LLMChain(prompt=prompt, llm=llm, memory=memory)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue