from os import getenv

from dotenv import load_dotenv
from openai import OpenAI

from srs2std.llms.llm import LLM

load_dotenv()
client = OpenAI(api_key=getenv("OPENAI_API_KEY"), timeout=30)


class GPT_5(LLM):
    client = client
    model = "gpt-5-2025-08-07"
    max_completion_tokens = 128_000
    max_retries = 5
    temperature = 1  # GPT-5 only support this temperature


class GPT_5_mini(LLM):
    client = client
    model = "gpt-5-mini-2025-08-07"
    max_completion_tokens = 128_000
    max_retries = 5
    temperature = 1  # GPT-5 only support this temperature


class GPT_4o(LLM):
    client = client
    model = "gpt-4o-2024-08-06"
    max_completion_tokens = 16_384
    max_retries = 5
    temperature = 0
    reasoning_effort = None  # GPT-4o do not support reasoning
