From c79e859f6bbf41ca23d32b95e7b08d2aff65973b Mon Sep 17 00:00:00 2001 From: Abdul-Rahman Aslam Date: Thu, 21 May 2026 13:58:26 +0500 Subject: [PATCH 1/2] MINDSQL-24: Popped model param from config and added it to llm instance --- mindsql/llms/open_ai.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mindsql/llms/open_ai.py b/mindsql/llms/open_ai.py index b9bd4f9..ea70fef 100644 --- a/mindsql/llms/open_ai.py +++ b/mindsql/llms/open_ai.py @@ -25,6 +25,9 @@ def __init__(self, config=None, client=None): if 'api_key' not in config: raise ValueError(OPENAI_VALUE_ERROR) + + if 'model' in config: + self.model = config.pop('model') api_key = config.pop('api_key') self.client = OpenAI(api_key=api_key, **config) @@ -79,7 +82,7 @@ def invoke(self, prompt, **kwargs) -> str: if prompt is None or len(prompt) == 0: raise Exception(PROMPT_EMPTY_EXCEPTION) - model = self.config.get("model", "gpt-3.5-turbo") + model = self.model if self.model is not None else "gpt-5-2025-08-07" temperature = kwargs.get("temperature", 0.1) max_tokens = kwargs.get("max_tokens", 500) response = self.client.chat.completions.create(model=model, messages=[{"role": "user", "content": prompt}], From d8425dc5dc15d7350b04bb5a95e6ac20176c9716 Mon Sep 17 00:00:00 2001 From: Aslam Abdul-Rahman <87591056+aslam07-debug@users.noreply.github.com> Date: Thu, 21 May 2026 14:21:26 +0500 Subject: [PATCH 2/2] Revert "MINDSQL-24: Popped model param from config and added it to llm instance" --- mindsql/llms/open_ai.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/mindsql/llms/open_ai.py b/mindsql/llms/open_ai.py index ea70fef..b9bd4f9 100644 --- a/mindsql/llms/open_ai.py +++ b/mindsql/llms/open_ai.py @@ -25,9 +25,6 @@ def __init__(self, config=None, client=None): if 'api_key' not in config: raise ValueError(OPENAI_VALUE_ERROR) - - if 'model' in config: - self.model = config.pop('model') api_key = config.pop('api_key') self.client = OpenAI(api_key=api_key, **config) @@ -82,7 +79,7 @@ def invoke(self, prompt, **kwargs) -> str: if prompt is None or len(prompt) == 0: raise Exception(PROMPT_EMPTY_EXCEPTION) - model = self.model if self.model is not None else "gpt-5-2025-08-07" + model = self.config.get("model", "gpt-3.5-turbo") temperature = kwargs.get("temperature", 0.1) max_tokens = kwargs.get("max_tokens", 500) response = self.client.chat.completions.create(model=model, messages=[{"role": "user", "content": prompt}],