from openai import OpenAI

client = OpenAI()


def recommend_book(genre: str) -> str:
    # [!code highlight:6]
    completion = client.chat.completions.create(
        model="gpt-4o-mini",
        messages=[{"role": "user", "content": f"Recommend a {genre} book"}],
    )
    return str(completion.choices[0].message.content)


output = recommend_book("fantasy")
print(output)
