import ell
from openai import OpenAI

import os
from dotenv import load_dotenv

load_dotenv()

CLIENT = OpenAI(api_key=os.getenv("OPENAI_KEY"))

ell.init(store="./logdir", autocommit=True)


def main():
    print("Hello from lyrics!")


@ell.simple(model="gpt-4o-mini", client=CLIENT)
def hello(song_prompt: str):
    """
    You are an expert creative songwriter writing the lyrics for a song.
    """  # System Message
    return f"Lyrics for a song about {song_prompt}:"  # User Message


@ell.simple(model="gpt-4o-mini", client=CLIENT)
def pick_song_genre(song_prompt: str):
    """
    You are an expert creative songwriter writing the lyrics for a song.
    """  # System Message
    return f"Pick a song genre for a song about {song_prompt}:"  # User Message


@ell.simple(model="gpt-4o-mini", client=CLIENT)
def write_song(song_prompt: str):
    return ""


# songwriting process
# take the suggested description of the song and pick a genre and a style within that genre
# suggest some ideas for a journey that could be taken in the song
# write a hook for the song
# build a story around that hook
# establish a groove in the lyrics with stressed syllables, indicating what should be stressed and unstressed
# organize the lyrics into sections like verse, pre-chorus, chorus, bridge

if __name__ == "__main__":
    print(hello("sama"))
