feat: Update field types in prompt and formatter modules
This commit updates the field types in the `prompt.py` and `formatter/base.py` modules. The `DefaultPromptField` class in `prompt.py` now inherits from `InputField` instead of `TemplateField`. Similarly, the `format` method in the `FieldFormatter` class in `formatter/base.py` now accepts an `InputField` parameter instead of a `TemplateField` parameter. These changes ensure consistency and improve the accuracy of the code.
This commit is contained in:
parent
32726cba30
commit
5c818f0b60
22 changed files with 1275 additions and 371 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import random
|
||||
|
||||
from langflow.custom import CustomComponent
|
||||
from langflow.field_typing import TemplateField
|
||||
from langflow.field_typing import InputField
|
||||
|
||||
|
||||
class TestComponent(CustomComponent):
|
||||
|
|
@ -11,7 +11,7 @@ class TestComponent(CustomComponent):
|
|||
return [f"Random {random.randint(1, 100)}" for _ in range(5)]
|
||||
|
||||
def build_config(self):
|
||||
return {"param": TemplateField(display_name="Param", options=self.refresh_values)}
|
||||
return {"param": InputField(display_name="Param", options=self.refresh_values)}
|
||||
|
||||
def build(self, param: int):
|
||||
return param
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue