refactor: Update model variable names and improve code readability in AmazonBedrockModel, AnthropicModel, BaiduQianfanChatModel, and GroqModel
This commit is contained in:
parent
d8bd09661a
commit
ae3170101b
4 changed files with 14 additions and 16 deletions
|
|
@ -15,7 +15,7 @@ class AmazonBedrockComponent(LCModelComponent):
|
|||
MessageInput(name="input_value", display_name="Input"),
|
||||
DropdownInput(
|
||||
name="model_id",
|
||||
display_name="Model Id",
|
||||
display_name="Model ID",
|
||||
options=[
|
||||
"amazon.titan-text-express-v1",
|
||||
"amazon.titan-text-lite-v1",
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ from pydantic.v1 import SecretStr
|
|||
from langflow.base.constants import STREAM_INFO_TEXT
|
||||
from langflow.base.models.model import LCModelComponent
|
||||
from langflow.field_typing import BaseLanguageModel, Text
|
||||
from langflow.io import BoolInput, DropdownInput, FloatInput, IntInput, Output, SecretStrInput, StrInput
|
||||
from langflow.io import BoolInput, DropdownInput, FloatInput, IntInput, Output, SecretStrInput, TextInput
|
||||
|
||||
|
||||
class AnthropicModelComponent(LCModelComponent):
|
||||
|
|
@ -13,7 +13,7 @@ class AnthropicModelComponent(LCModelComponent):
|
|||
icon = "Anthropic"
|
||||
|
||||
inputs = [
|
||||
StrInput(name="input_value", display_name="Input", input_types=["Text", "Data", "Prompt", "Message"]),
|
||||
TextInput(name="input_value", display_name="Input"),
|
||||
IntInput(
|
||||
name="max_tokens",
|
||||
display_name="Max Tokens",
|
||||
|
|
@ -42,20 +42,20 @@ class AnthropicModelComponent(LCModelComponent):
|
|||
info="Your Anthropic API key.",
|
||||
),
|
||||
FloatInput(name="temperature", display_name="Temperature", value=0.1),
|
||||
StrInput(
|
||||
TextInput(
|
||||
name="anthropic_api_url",
|
||||
display_name="Anthropic API URL",
|
||||
advanced=True,
|
||||
info="Endpoint of the Anthropic API. Defaults to 'https://api.anthropic.com' if not specified.",
|
||||
),
|
||||
BoolInput(name="stream", display_name="Stream", info=STREAM_INFO_TEXT, advanced=True),
|
||||
StrInput(
|
||||
TextInput(
|
||||
name="system_message",
|
||||
display_name="System Message",
|
||||
info="System message to pass to the model.",
|
||||
advanced=True,
|
||||
),
|
||||
StrInput(
|
||||
TextInput(
|
||||
name="prefill",
|
||||
display_name="Prefill",
|
||||
info="Prefill text to guide the model's response.",
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ from pydantic.v1 import SecretStr
|
|||
from langflow.base.constants import STREAM_INFO_TEXT
|
||||
from langflow.base.models.model import LCModelComponent
|
||||
from langflow.field_typing import BaseLanguageModel, Text
|
||||
from langflow.io import BoolInput, FloatInput, Output, SecretStrInput, StrInput, DropdownInput
|
||||
from langflow.io import BoolInput, FloatInput, Output, SecretStrInput, TextInput, DropdownInput
|
||||
|
||||
|
||||
class QianfanChatEndpointComponent(LCModelComponent):
|
||||
|
|
@ -14,10 +14,9 @@ class QianfanChatEndpointComponent(LCModelComponent):
|
|||
icon = "BaiduQianfan"
|
||||
|
||||
inputs = [
|
||||
StrInput(
|
||||
TextInput(
|
||||
name="input_value",
|
||||
display_name="Input",
|
||||
input_types=["Text", "Data", "Prompt"],
|
||||
),
|
||||
DropdownInput(
|
||||
name="model",
|
||||
|
|
@ -67,7 +66,7 @@ class QianfanChatEndpointComponent(LCModelComponent):
|
|||
value=1.0,
|
||||
advanced=True,
|
||||
),
|
||||
StrInput(
|
||||
TextInput(
|
||||
name="endpoint",
|
||||
display_name="Endpoint",
|
||||
info="Endpoint of the Qianfan LLM, required if custom model used.",
|
||||
|
|
@ -78,7 +77,7 @@ class QianfanChatEndpointComponent(LCModelComponent):
|
|||
info=STREAM_INFO_TEXT,
|
||||
advanced=True,
|
||||
),
|
||||
StrInput(
|
||||
TextInput(
|
||||
name="system_message",
|
||||
display_name="System Message",
|
||||
info="System message to pass to the model.",
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ from langflow.base.constants import STREAM_INFO_TEXT
|
|||
from langflow.base.models.groq_constants import MODEL_NAMES
|
||||
from langflow.base.models.model import LCModelComponent
|
||||
from langflow.field_typing import BaseLanguageModel, Text
|
||||
from langflow.io import BoolInput, DropdownInput, FloatInput, IntInput, Output, SecretStrInput, StrInput
|
||||
from langflow.io import BoolInput, DropdownInput, FloatInput, IntInput, Output, SecretStrInput, TextInput
|
||||
|
||||
|
||||
class GroqModel(LCModelComponent):
|
||||
|
|
@ -19,7 +19,7 @@ class GroqModel(LCModelComponent):
|
|||
display_name="Groq API Key",
|
||||
info="API key for the Groq API.",
|
||||
),
|
||||
StrInput(
|
||||
TextInput(
|
||||
name="groq_api_base",
|
||||
display_name="Groq API Base",
|
||||
info="Base URL path for API requests, leave blank if not using a proxy or service emulator.",
|
||||
|
|
@ -49,11 +49,10 @@ class GroqModel(LCModelComponent):
|
|||
info="The name of the model to use.",
|
||||
options=MODEL_NAMES,
|
||||
),
|
||||
StrInput(
|
||||
TextInput(
|
||||
name="input_value",
|
||||
display_name="Input",
|
||||
info="The input to the model.",
|
||||
input_types=["Text", "Data", "Prompt"],
|
||||
),
|
||||
BoolInput(
|
||||
name="stream",
|
||||
|
|
@ -61,7 +60,7 @@ class GroqModel(LCModelComponent):
|
|||
info=STREAM_INFO_TEXT,
|
||||
advanced=True,
|
||||
),
|
||||
StrInput(
|
||||
TextInput(
|
||||
name="system_message",
|
||||
display_name="System Message",
|
||||
info="System message to pass to the model.",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue