From ebe9cfc8a4a33932e3661b8237ce6981fd3c5720 Mon Sep 17 00:00:00 2001 From: carlosrcoelho Date: Wed, 10 Jan 2024 11:13:04 -0300 Subject: [PATCH] Update AnthropicComponent configuration --- src/backend/langflow/components/llms/Anthropic.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/backend/langflow/components/llms/Anthropic.py b/src/backend/langflow/components/llms/Anthropic.py index 327afc6e4..e6327dbab 100644 --- a/src/backend/langflow/components/llms/Anthropic.py +++ b/src/backend/langflow/components/llms/Anthropic.py @@ -12,7 +12,8 @@ class AnthropicComponent(CustomComponent): return { "anthropic_api_key": { "display_name": "Anthropic API Key", - "type": SecretStr, + "type": str, + "password": True, }, "anthropic_api_url": { "display_name": "Anthropic API URL", @@ -20,7 +21,7 @@ class AnthropicComponent(CustomComponent): }, "model_kwargs": { "display_name": "Model Kwargs", - "type": Dict[str, Any], + "field_type": 'dict', "advanced": True, }, "temperature": { @@ -31,7 +32,7 @@ class AnthropicComponent(CustomComponent): def build( self, - anthropic_api_key: Optional[SecretStr], + anthropic_api_key: Optional[str], anthropic_api_url: Optional[str], model_kwargs: Optional[Dict[str, Any]], temperature: Optional[float] = None, @@ -42,7 +43,7 @@ class AnthropicComponent(CustomComponent): class Anthropic(BaseLanguageModel): def __init__( self, - api_key: Optional[SecretStr], + api_key: Optional[str], api_url: Optional[str], model_kwargs: Optional[Dict[str, Any]] = None, temperature: Optional[float] = None, @@ -64,4 +65,4 @@ class AnthropicComponent(CustomComponent): api_url=anthropic_api_url, model_kwargs=model_kwargs, temperature=temperature, - ) + ) \ No newline at end of file