diff --git a/src/vanna/anthropic/anthropic_chat.py b/src/vanna/anthropic/anthropic_chat.py index fd2333ee..442b7ef9 100644 --- a/src/vanna/anthropic/anthropic_chat.py +++ b/src/vanna/anthropic/anthropic_chat.py @@ -8,15 +8,7 @@ class Anthropic_Chat(VannaBase): def __init__(self, client=None, config=None): VannaBase.__init__(self, config=config) - - if client is not None: - self.client = client - return - - if config is None and client is None: - self.client = anthropic.Anthropic(api_key=os.getenv("ANTHROPIC_API_KEY")) - return - + # default parameters - can be overrided using config self.temperature = 0.7 self.max_tokens = 500 @@ -27,6 +19,14 @@ def __init__(self, client=None, config=None): if "max_tokens" in config: self.max_tokens = config["max_tokens"] + if client is not None: + self.client = client + return + + if config is None and client is None: + self.client = anthropic.Anthropic(api_key=os.getenv("ANTHROPIC_API_KEY")) + return + if "api_key" in config: self.client = anthropic.Anthropic(api_key=config["api_key"])