Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion mindsql/llms/open_ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ def __init__(self, config=None, client=None):
if 'api_key' not in config:
raise ValueError(OPENAI_VALUE_ERROR)
api_key = config.pop('api_key')
if 'model' in config:
self.model = config.pop('model')
self.client = OpenAI(api_key=api_key, **config)

def system_message(self, message: str) -> any:
Expand Down Expand Up @@ -79,7 +81,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 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}],
Expand Down