Skip to content

Commit 06af848

Browse files
committed
MINDSQL-24: Popped model param from config and added to llm instance
1 parent eb27ee2 commit 06af848

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

mindsql/llms/open_ai.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ def __init__(self, config=None, client=None):
2525

2626
if 'api_key' not in config:
2727
raise ValueError(OPENAI_VALUE_ERROR)
28+
if 'model' in config:
29+
self.model = config.pop('model')
30+
2831
api_key = config.pop('api_key')
2932
self.client = OpenAI(api_key=api_key, **config)
3033

@@ -79,7 +82,7 @@ def invoke(self, prompt, **kwargs) -> str:
7982
if prompt is None or len(prompt) == 0:
8083
raise Exception(PROMPT_EMPTY_EXCEPTION)
8184

82-
model = self.config.get("model", "gpt-3.5-turbo")
85+
model = self.model if self.model is not None else "gpt-5-2025-08-07"
8386
temperature = kwargs.get("temperature", 0.1)
8487
max_tokens = kwargs.get("max_tokens", 500)
8588
response = self.client.chat.completions.create(model=model, messages=[{"role": "user", "content": prompt}],

0 commit comments

Comments
 (0)