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

@@ -31,7 +31,7 @@ class TogetherLLM(LLMBase):
self.config.model = "mistralai/Mixtral-8x7B-Instruct-v0.1"
self.client = Together()
api_key = os.getenv("TOGETHER_API_KEY") or self.config.api_key
api_key = self.config.api_key or os.getenv("TOGETHER_API_KEY")
self.client = Together(api_key=api_key)
def _parse_response(self, response, tools):