refactor: Update PromptComponent to return Message instead of Prompt
This commit is contained in:
parent
791c55c2db
commit
84e1d39b71
1 changed files with 1 additions and 2 deletions
|
|
@ -1,5 +1,4 @@
|
|||
from langflow.custom import Component
|
||||
from langflow.field_typing.prompt import Prompt
|
||||
from langflow.inputs import PromptInput
|
||||
from langflow.schema.message import Message
|
||||
from langflow.template import Output
|
||||
|
|
@ -27,7 +26,7 @@ class PromptComponent(Component):
|
|||
|
||||
async def build_prompt(
|
||||
self,
|
||||
) -> Prompt:
|
||||
) -> Message:
|
||||
kwargs = {k: v for k, v in self._arguments.items() if k != "template"}
|
||||
prompt = await Message.from_template_and_variables(self.template, kwargs)
|
||||
self.status = prompt.format_text()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue