File: video.py

package info (click to toggle)
python-openai 2.10.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,528 kB
  • sloc: python: 68,384; sh: 161; makefile: 7
file content (22 lines) | stat: -rw-r--r-- 474 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env -S poetry run python

import asyncio

from openai import AsyncOpenAI

client = AsyncOpenAI()


async def main() -> None:
    video = await client.videos.create_and_poll(
        model="sora-2",
        prompt="A video of the words 'Thank you' in sparkling letters",
    )

    if video.status == "completed":
        print("Video successfully completed: ", video)
    else:
        print("Video creation failed. Status: ", video.status)


asyncio.run(main())