import os
from openai import OpenAI
client = OpenAI()

file = open("sample.wav", "rb")

transcript = client.audio.transcriptions.create(
    model="whisper-1",
    file=file,
)

# ChatGPTで要約する
summary = client.chat.completions.create(
    model="gpt-4o-mini",
    messages=[
        {
            "role": "system",
            "content": f"以下の文章を3行の箇条書きで要約してください:\n{transcript}"
        }
    ]
)

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