Skip to content

Commit b96be50

Browse files
authored
Add documentation for video cmdlets (#45)
1 parent f5ffe1b commit b96be50

File tree

7 files changed

+761
-2
lines changed

7 files changed

+761
-2
lines changed

Docs/Get-Video.md

Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
---
2+
external help file: PSOpenAI-help.xml
3+
Module Name: PSOpenAI
4+
online version: https://github.com/mkht/PSOpenAI/blob/main/Docs/Get-Video.md
5+
schema: 2.0.0
6+
---
7+
8+
# Get-Video
9+
10+
## SYNOPSIS
11+
Retrieves one or more video generation jobs.
12+
13+
## SYNTAX
14+
15+
### Get
16+
```
17+
Get-Video
18+
[-VideoId] <String>
19+
[-TimeoutSec <Int32>]
20+
[-MaxRetryCount <Int32>]
21+
[-ApiBase <Uri>]
22+
[-ApiKey <SecureString>]
23+
[-Organization <String>]
24+
[<CommonParameters>]
25+
```
26+
27+
### List
28+
```
29+
Get-Video
30+
[-All]
31+
[-Limit <Int32>]
32+
[-Order <String>]
33+
[-TimeoutSec <Int32>]
34+
[-MaxRetryCount <Int32>]
35+
[-ApiBase <Uri>]
36+
[-ApiKey <SecureString>]
37+
[-Organization <String>]
38+
[<CommonParameters>]
39+
```
40+
41+
## DESCRIPTION
42+
Retrieves a specific video generation job or lists recent jobs. Use the job metadata to track progress or to download video content once processing finishes.
43+
44+
## EXAMPLES
45+
46+
### Example 1
47+
```powershell
48+
PS C:\> Get-Video -VideoId 'video_fb4e'
49+
```
50+
51+
Gets the job details for the specified video ID.
52+
53+
### Example 2
54+
```powershell
55+
PS C:\> Get-Video -Limit 5 -Order desc
56+
```
57+
58+
Lists the five most recent video jobs.
59+
60+
### Example 3
61+
```powershell
62+
PS C:\> Get-Video -All
63+
```
64+
65+
Lists all available video jobs by paging through the API.
66+
67+
## PARAMETERS
68+
69+
### -VideoId
70+
The identifier of the video to retrieve.
71+
72+
```yaml
73+
Type: String
74+
Parameter Sets: Get
75+
Aliases: video_id, Id
76+
Required: True
77+
Position: 0
78+
Accept pipeline input: True (ByPropertyName, ByValue)
79+
```
80+
81+
### -Limit
82+
A number of items to retrieve. Limit can range between 1 and 100, and the default is 20.
83+
84+
```yaml
85+
Type: Int32
86+
Parameter Sets: List
87+
Required: False
88+
Position: Named
89+
Default value: 20
90+
```
91+
92+
### -Order
93+
Sort order by the created timestamp of the objects. `asc` for ascending order and `desc` for descending order. The default is `asc`.
94+
95+
```yaml
96+
Type: String
97+
Parameter Sets: List
98+
Accepted values: asc, desc
99+
Required: False
100+
Position: Named
101+
Default value: asc
102+
```
103+
104+
### -All
105+
When this switch is specified, all video jobs will be retrieved.
106+
107+
```yaml
108+
Type: SwitchParameter
109+
Parameter Sets: List
110+
Required: False
111+
Position: Named
112+
```
113+
114+
### -TimeoutSec
115+
Specifies how long the request can be pending before it times out.
116+
The default value is `0` (infinite).
117+
118+
```yaml
119+
Type: Int32
120+
Required: False
121+
Position: Named
122+
Default value: 0
123+
```
124+
125+
### -MaxRetryCount
126+
Number between `0` and `100`.
127+
Specifies the maximum number of retries if the request fails.
128+
The default value is `0` (No retry).
129+
Note : Retries will only be performed if the request fails with a `429 (Rate limit reached)` or `5xx (Server side errors)` error. Other errors (e.g., authentication failure) will not be performed.
130+
131+
```yaml
132+
Type: Int32
133+
Required: False
134+
Position: Named
135+
Default value: 0
136+
```
137+
138+
### -ApiBase
139+
Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1`
140+
If not specified, it will use `https://api.openai.com/v1`
141+
142+
```yaml
143+
Type: System.Uri
144+
Required: False
145+
Position: Named
146+
Default value: https://api.openai.com/v1
147+
```
148+
149+
### -ApiKey
150+
Specifies API key for authentication.
151+
The type of data should `[string]` or `[securestring]`.
152+
If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY`
153+
154+
```yaml
155+
Type: Object
156+
Required: False
157+
Position: Named
158+
```
159+
160+
### -Organization
161+
Specifies Organization ID which used for an API request.
162+
If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION`
163+
164+
```yaml
165+
Type: string
166+
Aliases: OrgId
167+
Required: False
168+
Position: Named
169+
```
170+
171+
## INPUTS
172+
173+
## OUTPUTS
174+
175+
### PSCustomObject
176+
177+
## NOTES
178+
179+
## RELATED LINKS
180+
181+
[https://platform.openai.com/docs/api-reference/videos/retrieve](https://platform.openai.com/docs/api-reference/videos/retrieve)
182+
[https://platform.openai.com/docs/api-reference/videos/list](https://platform.openai.com/docs/api-reference/videos/list)

Docs/Get-VideoContent.md

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
---
2+
external help file: PSOpenAI-help.xml
3+
Module Name: PSOpenAI
4+
online version: https://github.com/mkht/PSOpenAI/blob/main/Docs/Get-VideoContent.md
5+
schema: 2.0.0
6+
---
7+
8+
# Get-VideoContent
9+
10+
## SYNOPSIS
11+
Downloads generated video content.
12+
13+
## SYNTAX
14+
15+
```
16+
Get-VideoContent
17+
[-VideoId] <String>
18+
[-OutFile <String>]
19+
[-Variant <String>]
20+
[-WaitForCompletion]
21+
[-TimeoutSec <Int32>]
22+
[-MaxRetryCount <Int32>]
23+
[-ApiBase <Uri>]
24+
[-ApiKey <SecureString>]
25+
[-Organization <String>]
26+
[<CommonParameters>]
27+
```
28+
29+
## DESCRIPTION
30+
Retrieves the binary content for a generated video. You can save the response to a file or work with the bytes in memory. Use the `-WaitForCompletion` switch to wait for the associated job to succeed before downloading its assets.
31+
32+
## EXAMPLES
33+
34+
### Example 1
35+
```powershell
36+
PS C:\> Get-VideoContent -VideoId 'video_abc123' -OutFile C:\videos\demo.mp4
37+
```
38+
39+
Saves the video content for the specified job to `C:\videos\demo.mp4`.
40+
41+
### Example 2
42+
```powershell
43+
PS C:\> $Bytes = Get-VideoContent -VideoId 'video_abc123'
44+
```
45+
46+
Returns the video bytes for further processing.
47+
48+
### Example 3
49+
```powershell
50+
PS C:\> Get-VideoContent -VideoId 'video_abc123' -Variant thumbnail -WaitForCompletion -OutFile C:\videos\demo.webp
51+
```
52+
53+
Waits for the job to finish and then downloads the thumbnail asset.
54+
55+
## PARAMETERS
56+
57+
### -VideoId
58+
The identifier of the video whose media to download.
59+
60+
```yaml
61+
Type: String
62+
Aliases: video_id, Id
63+
Required: True
64+
Position: 0
65+
Accept pipeline input: True (ByPropertyName, ByValue)
66+
```
67+
68+
### -OutFile
69+
Path to the file where the content should be saved. If omitted, the cmdlet returns the byte array instead of writing to disk.
70+
71+
```yaml
72+
Type: String
73+
Required: False
74+
Position: Named
75+
```
76+
77+
### -Variant
78+
Which downloadable asset to return. Supported values are `video`, `thumbnail`, and `spritesheet`. The default value is `video`.
79+
80+
```yaml
81+
Type: String
82+
Required: False
83+
Position: Named
84+
Default value: video
85+
```
86+
87+
### -WaitForCompletion
88+
When specified, waits for the job to reach a completed state before downloading the content.
89+
90+
```yaml
91+
Type: SwitchParameter
92+
Required: False
93+
Position: Named
94+
```
95+
96+
### -TimeoutSec
97+
Specifies how long the request can be pending before it times out.
98+
The default value is `0` (infinite).
99+
100+
```yaml
101+
Type: Int32
102+
Required: False
103+
Position: Named
104+
Default value: 0
105+
```
106+
107+
### -MaxRetryCount
108+
Number between `0` and `100`.
109+
Specifies the maximum number of retries if the request fails.
110+
The default value is `0` (No retry).
111+
Note : Retries will only be performed if the request fails with a `429 (Rate limit reached)` or `5xx (Server side errors)` error. Other errors (e.g., authentication failure) will not be performed.
112+
113+
```yaml
114+
Type: Int32
115+
Required: False
116+
Position: Named
117+
Default value: 0
118+
```
119+
120+
### -ApiBase
121+
Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1`
122+
If not specified, it will use `https://api.openai.com/v1`
123+
124+
```yaml
125+
Type: System.Uri
126+
Required: False
127+
Position: Named
128+
Default value: https://api.openai.com/v1
129+
```
130+
131+
### -ApiKey
132+
Specifies API key for authentication.
133+
The type of data should `[string]` or `[securestring]`.
134+
If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY`
135+
136+
```yaml
137+
Type: Object
138+
Required: False
139+
Position: Named
140+
```
141+
142+
### -Organization
143+
Specifies Organization ID which used for an API request.
144+
If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION`
145+
146+
```yaml
147+
Type: string
148+
Aliases: OrgId
149+
Required: False
150+
Position: Named
151+
```
152+
153+
## INPUTS
154+
155+
## OUTPUTS
156+
157+
### System.Byte[]
158+
159+
## NOTES
160+
161+
## RELATED LINKS
162+
163+
[https://platform.openai.com/docs/api-reference/videos/content](https://platform.openai.com/docs/api-reference/videos/content)

0 commit comments

Comments
 (0)