import os

from dotenv import load_dotenv
from together import Together  # type: ignore

load_dotenv()
TOGETHER_API_KEY = os.getenv("TOGETHER_API_KEY")
client = Together(api_key=TOGETHER_API_KEY)

# Replace with your actual fine-tuning job ID
job_id = "ft-faee5c22-5edf"

# Get the job status
job_status = client.fine_tuning.retrieve(job_id)

# Print the status
print("Status:", job_status.status)
print("Model Name:", job_status.output_name)

# This loop will print the logs of the job thus far
for event in client.fine_tuning.list_events(id=job_id).data:
    print(event.message)
