import sys
import os

sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))

from trim import TrimClient
from dotenv import load_dotenv

load_dotenv()  # load OPENAI_API_KEY to the environment

# Instantiate the OpenAI-client-based router LLM
client = TrimClient()

# Way 1 to call the OpenAI-client-based router LLM
completion = client.responses.create(
    model="gpt-4.1",
    input="Write a one-sentence bedtime story about a unicorn."
)

print(completion.output_text)

# Way 2 to call the OpenAI-client-based router LLM
completion = client.chat.completions.create(
    model="gpt-4.1",
    messages=[
        {
            "role": "user",
            "content": "Write a one-sentence bedtime story about bears"
        }
    ]
)

print(completion.choices[0].message.content)
