Add advanced options for various model components
This commit is contained in:
parent
f789591c4e
commit
a247a07c17
9 changed files with 49 additions and 10 deletions
|
|
@ -16,6 +16,7 @@ class CohereEmbeddingsComponent(CustomComponent):
|
|||
"truncate": {"display_name": "Truncate", "advanced": True},
|
||||
"max_retries": {"display_name": "Max Retries", "advanced": True},
|
||||
"user_agent": {"display_name": "User Agent", "advanced": True},
|
||||
"request_timeout": {"display_name": "Request Timeout", "advanced": True},
|
||||
}
|
||||
|
||||
def build(
|
||||
|
|
|
|||
|
|
@ -45,12 +45,24 @@ class OpenAIEmbeddingsComponent(CustomComponent):
|
|||
"model": {
|
||||
"display_name": "Model",
|
||||
"advanced": False,
|
||||
"options": ["text-embedding-3-small", "text-embedding-3-large", "text-embedding-ada-002"],
|
||||
"options": [
|
||||
"text-embedding-3-small",
|
||||
"text-embedding-3-large",
|
||||
"text-embedding-ada-002",
|
||||
],
|
||||
},
|
||||
"model_kwargs": {"display_name": "Model Kwargs", "advanced": True},
|
||||
"openai_api_base": {"display_name": "OpenAI API Base", "password": True, "advanced": True},
|
||||
"openai_api_base": {
|
||||
"display_name": "OpenAI API Base",
|
||||
"password": True,
|
||||
"advanced": True,
|
||||
},
|
||||
"openai_api_key": {"display_name": "OpenAI API Key", "password": True},
|
||||
"openai_api_type": {"display_name": "OpenAI API Type", "advanced": True, "password": True},
|
||||
"openai_api_type": {
|
||||
"display_name": "OpenAI API Type",
|
||||
"advanced": True,
|
||||
"password": True,
|
||||
},
|
||||
"openai_api_version": {
|
||||
"display_name": "OpenAI API Version",
|
||||
"advanced": True,
|
||||
|
|
@ -66,8 +78,11 @@ class OpenAIEmbeddingsComponent(CustomComponent):
|
|||
"advanced": True,
|
||||
},
|
||||
"skip_empty": {"display_name": "Skip Empty", "advanced": True},
|
||||
"tiktoken_model_name": {"display_name": "TikToken Model Name"},
|
||||
"tikToken_enable": {"display_name": "TikToken Enable", "advanced": True},
|
||||
"tiktoken_model_name": {
|
||||
"display_name": "TikToken Model Name",
|
||||
"advanced": True,
|
||||
},
|
||||
"tiktoken_enable": {"display_name": "TikToken Enable", "advanced": True},
|
||||
}
|
||||
|
||||
def build(
|
||||
|
|
|
|||
|
|
@ -55,10 +55,15 @@ class AmazonBedrockComponent(LCModelComponent):
|
|||
"model_kwargs": {"display_name": "Model Kwargs"},
|
||||
"cache": {"display_name": "Cache"},
|
||||
"input_value": {"display_name": "Input"},
|
||||
"system_message": {"display_name": "System Message", "info": "System message to pass to the model."},
|
||||
"system_message": {
|
||||
"display_name": "System Message",
|
||||
"info": "System message to pass to the model.",
|
||||
"advanced": True,
|
||||
},
|
||||
"stream": {
|
||||
"display_name": "Stream",
|
||||
"info": "Stream the response from the model.",
|
||||
"advanced": True,
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -49,25 +49,29 @@ class AnthropicLLM(LCModelComponent):
|
|||
"max_tokens": {
|
||||
"display_name": "Max Tokens",
|
||||
"field_type": "int",
|
||||
"advanced": True,
|
||||
"value": 256,
|
||||
},
|
||||
"temperature": {
|
||||
"display_name": "Temperature",
|
||||
"field_type": "float",
|
||||
"value": 0.7,
|
||||
"value": 0.1,
|
||||
},
|
||||
"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.",
|
||||
},
|
||||
"code": {"show": False},
|
||||
"input_value": {"display_name": "Input"},
|
||||
"stream": {
|
||||
"display_name": "Stream",
|
||||
"advanced": True,
|
||||
"info": "Stream the response from the model.",
|
||||
},
|
||||
"system_message": {
|
||||
"display_name": "System Message",
|
||||
"advanced": True,
|
||||
"info": "System message to pass to the model.",
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,9 +29,11 @@ class CohereComponent(LCModelComponent):
|
|||
"display_name": "Cohere API Key",
|
||||
"type": "password",
|
||||
"password": True,
|
||||
"required": True,
|
||||
},
|
||||
"max_tokens": {
|
||||
"display_name": "Max Tokens",
|
||||
"advanced": True,
|
||||
"default": 256,
|
||||
"type": "int",
|
||||
"show": True,
|
||||
|
|
@ -46,10 +48,12 @@ class CohereComponent(LCModelComponent):
|
|||
"stream": {
|
||||
"display_name": "Stream",
|
||||
"info": "Stream the response from the model.",
|
||||
"advanced": True,
|
||||
},
|
||||
"system_message": {
|
||||
"display_name": "System Message",
|
||||
"info": "System message to pass to the model.",
|
||||
"advanced": True,
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ class GoogleGenerativeAIComponent(LCModelComponent):
|
|||
"max_output_tokens": {
|
||||
"display_name": "Max Output Tokens",
|
||||
"info": "The maximum number of tokens to generate.",
|
||||
"advanced": True,
|
||||
},
|
||||
"temperature": {
|
||||
"display_name": "Temperature",
|
||||
|
|
@ -67,10 +68,12 @@ class GoogleGenerativeAIComponent(LCModelComponent):
|
|||
"stream": {
|
||||
"display_name": "Stream",
|
||||
"info": "Stream the response from the model.",
|
||||
"advanced": True,
|
||||
},
|
||||
"system_message": {
|
||||
"display_name": "System Message",
|
||||
"info": "System message to pass to the model.",
|
||||
"advanced": True,
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,16 +33,19 @@ class HuggingFaceEndpointsComponent(LCModelComponent):
|
|||
"model_kwargs": {
|
||||
"display_name": "Model Keyword Arguments",
|
||||
"field_type": "code",
|
||||
"advanced": True,
|
||||
},
|
||||
"code": {"show": False},
|
||||
"input_value": {"display_name": "Input"},
|
||||
"stream": {
|
||||
"display_name": "Stream",
|
||||
"info": "Stream the response from the model.",
|
||||
"advanced": True,
|
||||
},
|
||||
"system_message": {
|
||||
"display_name": "System Message",
|
||||
"info": "System message to pass to the model.",
|
||||
"advanced": True,
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ class ChatOllamaComponent(LCModelComponent):
|
|||
"base_url": {
|
||||
"display_name": "Base URL",
|
||||
"info": "Endpoint of the Ollama API. Defaults to 'http://localhost:11434' if not specified.",
|
||||
"advanced": True,
|
||||
},
|
||||
"model": {
|
||||
"display_name": "Model Name",
|
||||
|
|
@ -205,6 +206,7 @@ class ChatOllamaComponent(LCModelComponent):
|
|||
"system_message": {
|
||||
"display_name": "System Message",
|
||||
"info": "System message to pass to the model.",
|
||||
"advanced": True,
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ class OpenAIModelComponent(LCModelComponent):
|
|||
"input_value": {"display_name": "Input"},
|
||||
"max_tokens": {
|
||||
"display_name": "Max Tokens",
|
||||
"advanced": False,
|
||||
"advanced": True,
|
||||
"required": False,
|
||||
},
|
||||
"model_kwargs": {
|
||||
|
|
@ -51,7 +51,7 @@ class OpenAIModelComponent(LCModelComponent):
|
|||
},
|
||||
"openai_api_base": {
|
||||
"display_name": "OpenAI API Base",
|
||||
"advanced": False,
|
||||
"advanced": True,
|
||||
"required": False,
|
||||
"info": (
|
||||
"The base URL of the OpenAI API. Defaults to https://api.openai.com/v1.\n\n"
|
||||
|
|
@ -61,7 +61,7 @@ class OpenAIModelComponent(LCModelComponent):
|
|||
"openai_api_key": {
|
||||
"display_name": "OpenAI API Key",
|
||||
"advanced": False,
|
||||
"required": False,
|
||||
"required": True,
|
||||
"password": True,
|
||||
},
|
||||
"temperature": {
|
||||
|
|
@ -73,10 +73,12 @@ class OpenAIModelComponent(LCModelComponent):
|
|||
"stream": {
|
||||
"display_name": "Stream",
|
||||
"info": "Stream the response from the model.",
|
||||
"advanced": True,
|
||||
},
|
||||
"system_message": {
|
||||
"display_name": "System Message",
|
||||
"info": "System message to pass to the model.",
|
||||
"advanced": True,
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue