feat: improve model input fields for sambanova component (#5708)
* feat: improve model input fields for sambanova component 1. Make api_key field required 2. Convert temperature to SliderInput with range 0-2 Co-authored-by: Vinícios Batista da Silva <vinicios.batsi@gmail.com> * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * feat: improve model input fields for sambanova component 1. Make api_key field required 2. Convert temperature to SliderInput with range 0-2 Co-authored-by: Vinícios Batista da Silva <vinicios.batsi@gmail.com> * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
36b3289da2
commit
5848b11caa
1 changed files with 6 additions and 2 deletions
|
|
@ -4,7 +4,8 @@ from pydantic.v1 import SecretStr
|
|||
from langflow.base.models.model import LCModelComponent
|
||||
from langflow.base.models.sambanova_constants import SAMBANOVA_MODEL_NAMES
|
||||
from langflow.field_typing import LanguageModel
|
||||
from langflow.io import DropdownInput, FloatInput, IntInput, SecretStrInput, StrInput
|
||||
from langflow.field_typing.range_spec import RangeSpec
|
||||
from langflow.io import DropdownInput, IntInput, SecretStrInput, SliderInput, StrInput
|
||||
|
||||
|
||||
class SambaNovaComponent(LCModelComponent):
|
||||
|
|
@ -37,6 +38,7 @@ class SambaNovaComponent(LCModelComponent):
|
|||
info="The Sambanova API Key to use for the Sambanova model.",
|
||||
advanced=False,
|
||||
value="SAMBANOVA_API_KEY",
|
||||
required=True,
|
||||
),
|
||||
IntInput(
|
||||
name="max_tokens",
|
||||
|
|
@ -45,7 +47,9 @@ class SambaNovaComponent(LCModelComponent):
|
|||
value=4096,
|
||||
info="The maximum number of tokens to generate. Set to 0 for unlimited tokens.",
|
||||
),
|
||||
FloatInput(name="temperature", display_name="Temperature", value=0.07),
|
||||
SliderInput(
|
||||
name="temperature", display_name="Temperature", value=0.1, range_spec=RangeSpec(min=0, max=2, step=0.01)
|
||||
),
|
||||
]
|
||||
|
||||
def build_model(self) -> LanguageModel: # type: ignore[type-var]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue