feat: improve model input fields for perplexity component (#5709)
1. Make api_key field required 2. Convert temperature to SliderInput with range 0-2 Co-authored-by: Eric Hare <ericrhare@gmail.com>
This commit is contained in:
parent
4bdc8ea83f
commit
518c5fe3fb
1 changed files with 6 additions and 2 deletions
|
|
@ -3,7 +3,8 @@ from pydantic.v1 import SecretStr
|
||||||
|
|
||||||
from langflow.base.models.model import LCModelComponent
|
from langflow.base.models.model import LCModelComponent
|
||||||
from langflow.field_typing import LanguageModel
|
from langflow.field_typing import LanguageModel
|
||||||
from langflow.io import DropdownInput, FloatInput, IntInput, SecretStrInput
|
from langflow.field_typing.range_spec import RangeSpec
|
||||||
|
from langflow.io import DropdownInput, FloatInput, IntInput, SecretStrInput, SliderInput
|
||||||
|
|
||||||
|
|
||||||
class PerplexityComponent(LCModelComponent):
|
class PerplexityComponent(LCModelComponent):
|
||||||
|
|
@ -38,8 +39,11 @@ class PerplexityComponent(LCModelComponent):
|
||||||
display_name="Perplexity API Key",
|
display_name="Perplexity API Key",
|
||||||
info="The Perplexity API Key to use for the Perplexity model.",
|
info="The Perplexity API Key to use for the Perplexity model.",
|
||||||
advanced=False,
|
advanced=False,
|
||||||
|
required=True,
|
||||||
|
),
|
||||||
|
SliderInput(
|
||||||
|
name="temperature", display_name="Temperature", value=0.75, range_spec=RangeSpec(min=0, max=2, step=0.05)
|
||||||
),
|
),
|
||||||
FloatInput(name="temperature", display_name="Temperature", value=0.75),
|
|
||||||
FloatInput(
|
FloatInput(
|
||||||
name="top_p",
|
name="top_p",
|
||||||
display_name="Top P",
|
display_name="Top P",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue