From af6a972cba580e76c69c5746882ad0bcc406941a Mon Sep 17 00:00:00 2001 From: Dani Acosta Date: Tue, 5 Sep 2023 00:15:21 +0200 Subject: [PATCH] Add OPENAI_MODEL env var Adds a env variable OPENAI_MODEL to be able to use different models to GPT-4 --- pilot/utils/llm_connection.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pilot/utils/llm_connection.py b/pilot/utils/llm_connection.py index c191d8e..58f4b6a 100644 --- a/pilot/utils/llm_connection.py +++ b/pilot/utils/llm_connection.py @@ -94,7 +94,7 @@ def create_gpt_chat_completion(messages: List[dict], req_type, min_tokens=MIN_TO raise ValueError(f'Too many tokens in messages: {tokens_in_messages}. Please try a different test.') gpt_data = { - 'model': 'gpt-4', + 'model': os.getenv('OPENAI_MODEL', 'gpt-4'), 'n': 1, 'max_tokens': min(4096, MAX_GPT_MODEL_TOKENS - tokens_in_messages), 'temperature': 1,