Fix anthropic_api_key handling in AnthropicLLM.py

This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-12-04 14:55:32 -03:00
commit 98d5351d87

View file

@ -64,7 +64,7 @@ class AnthropicLLM(CustomComponent):
try:
output = ChatAnthropic(
model_name=model,
anthropic_api_key=SecretStr(anthropic_api_key),
anthropic_api_key=SecretStr(anthropic_api_key) if anthropic_api_key else None,
max_tokens_to_sample=max_tokens, # type: ignore
temperature=temperature,
anthropic_api_url=api_endpoint,