fix: get config from config value first then environment variable (#1815)

This commit is contained in:
Mathew Shen
2024-09-05 17:35:52 +08:00
committed by GitHub
parent 8099d60e0e
commit 136b5545ec
7 changed files with 16 additions and 16 deletions

View File

@@ -30,7 +30,7 @@ class GroqLLM(LLMBase):
self.config.model = "llama3-70b-8192"
self.client = Groq()
api_key = os.getenv("GROQ_API_KEY") or self.config.api_key
api_key = self.config.api_key or os.getenv("GROQ_API_KEY")
self.client = Groq(api_key=api_key)
def _parse_response(self, response, tools):