Skip to content

Commit 3c3afea

Browse files
committed
Misc API updates.
1 parent e474490 commit 3c3afea

14 files changed

Lines changed: 270 additions & 63 deletions

Docs/Request-RealtimeSessionResponse.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Instruct the server to generate a response.
1616
Request-RealtimeSessionResponse
1717
[-EventId <String>]
1818
[-Instructions <String>]
19-
[-Modalities <String[]>]
19+
[-OutputModalities <String[]>]
2020
[-Voice <String>]
2121
[-OutputAudioFormat <String>]
2222
[-Temperature <Single>]
@@ -63,7 +63,7 @@ Position: Named
6363
Default value: -1
6464
```
6565
66-
### -Modalities
66+
### -OutputModalities
6767
The set of modalities the model can respond with.
6868
6969
```yaml

Docs/Request-Response.md

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ Request-Response
3737
[-FileSearchVectorStoreIds <String[]>]
3838
[-FileSearchMaxNumberOfResults <Int32>]
3939
[-FileSearchRanker <String>]
40-
[-FileSearchScoreThreshold <Double>]
40+
[-FileSearchScoreThreshold <Float>]
41+
[-FileSearchHybridSearchEmbeddingWeight <Float>]
42+
[-FileSearchHybridSearchTextWeight <Float>]
4143
[-UseWebSearch]
4244
[-WebSearchType <String>]
4345
[-WebSearchContextSize <String>]
@@ -64,6 +66,7 @@ Request-Response
6466
[-ConnectorRequireApproval <String>]
6567
[-ConnectorAuthorization <String>]
6668
[-UseCodeInterpreter]
69+
[-CodeInterpreterMemoryLimit <String>]
6770
[-ContainerId <String>]
6871
[-ContainerFileIds <String[]>]
6972
[-UseImageGeneration]
@@ -79,9 +82,9 @@ Request-Response
7982
[-UseLocalShell]
8083
[-Include <String[]>]
8184
[-Truncation <String>]
82-
[-Temperature <Double>]
85+
[-Temperature <Float>]
8386
[-TopLogprobs <Int32>]
84-
[-TopP <Double>]
87+
[-TopP <Float>]
8588
[-Store <Boolean>]
8689
[-Background]
8790
[-Stream]
@@ -373,7 +376,25 @@ Position: Named
373376
The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
374377

375378
```yaml
376-
Type: Double
379+
Type: Float
380+
Required: False
381+
Position: Named
382+
```
383+
384+
### -FileSearchHybridSearchEmbeddingWeight
385+
The weight of the embedding in the reciprocal ranking fusion.
386+
387+
```yaml
388+
Type: Float
389+
Required: False
390+
Position: Named
391+
```
392+
393+
### -FileSearchHybridSearchTextWeight
394+
The weight of the text in the reciprocal ranking fusion.
395+
396+
```yaml
397+
Type: Float
377398
Required: False
378399
Position: Named
379400
```
@@ -623,6 +644,15 @@ Required: False
623644
Position: Named
624645
```
625646

647+
### -CodeInterpreterMemoryLimit
648+
{{No description provided}}
649+
650+
```yaml
651+
Type: String
652+
Required: False
653+
Position: Named
654+
```
655+
626656
### -ContainerId
627657
The code interpreter container. Can be a container ID or `auto` to use the default container.
628658

@@ -769,7 +799,7 @@ Default value: disabled
769799
What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random.
770800

771801
```yaml
772-
Type: Double
802+
Type: Float
773803
Required: False
774804
Position: Named
775805
```
@@ -788,7 +818,7 @@ Position: Named
788818
An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
789819

790820
```yaml
791-
Type: Double
821+
Type: Float
792822
Aliases: top_p
793823
Required: False
794824
Position: Named

Docs/Set-RealtimeSessionConfiguration.md

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Set-RealtimeSessionConfiguration
1919
[-PromptId <String>]
2020
[-PromptVariables <IDictionary>]
2121
[-PromptVersion <String>]
22-
[-Modalities <String[]>]
22+
[-OutputModalities <String[]>]
2323
[-Voice <String>]
2424
[-Speed <Double>]
2525
[-InputAudioFormat <String>]
@@ -46,6 +46,9 @@ Set-RealtimeSessionConfiguration
4646
[-TracingGroupId <String>]
4747
[-TracingMetadata <IDictionary>]
4848
[-TracingWorkflowName <String>]
49+
[-Truncation <String>]
50+
[-TruncationRetentionRatio <Float>]
51+
[-TruncationTokenLimitsPostInstructions <Int32>]
4952
```
5053

5154
## DESCRIPTION
@@ -56,7 +59,7 @@ Set the realtime session's configuration.
5659
### Example 1
5760
```powershell
5861
PS C:\> Set-RealtimeSessionConfiguration `
59-
-Modalities 'audio' `
62+
-OutputModalities 'audio' `
6063
-Voice 'marin' `
6164
-EnableInputAudioTranscription $true `
6265
-EnableTurnDetection $true
@@ -183,7 +186,7 @@ Position: Named
183186
Default value: -1
184187
```
185188

186-
### -Modalities
189+
### -OutputModalities
187190
The set of modalities the model can respond with.
188191

189192
```yaml
@@ -350,6 +353,33 @@ Required: False
350353
Position: Named
351354
```
352355

356+
### -Truncation
357+
The truncation strategy to use for the session. `auto` is the default truncation strategy. `disabled` will disable truncation and emit errors when the conversation exceeds the input token limit.
358+
359+
```yaml
360+
Type: String
361+
Required: False
362+
Position: Named
363+
```
364+
365+
### -TruncationRetentionRatio
366+
Fraction of post-instruction conversation tokens to retain (`0.0` - `1.0`) when the conversation exceeds the input token limit.
367+
368+
```yaml
369+
Type: Float
370+
Required: False
371+
Position: Named
372+
```
373+
374+
### -TruncationTokenLimitsPostInstructions
375+
Maximum tokens allowed in the conversation after instructions (which including tool definitions).
376+
377+
```yaml
378+
Type: Int32
379+
Required: False
380+
Position: Named
381+
```
382+
353383
## INPUTS
354384

355385
## OUTPUTS

Docs/Set-RealtimeTranscriptionSessionConfiguration.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ Set the realtime transcription session's configuration.
1515
```
1616
Set-RealtimeTranscriptionSessionConfiguration
1717
[-EventId <String>]
18-
[-Modalities <String[]>]
1918
[-InputAudioFormat <String>]
2019
[-InputAudioNoiseReductionType <String>]
2120
[-InputAudioTranscriptionModel <String>]
@@ -113,16 +112,6 @@ Required: False
113112
Position: Named
114113
```
115114

116-
### -Modalities
117-
The set of modalities the model can respond with.
118-
119-
```yaml
120-
Type: String[]
121-
Accepted values: text, audio
122-
Required: False
123-
Position: Named
124-
```
125-
126115
### -TurnDetectionPrefixPadding
127116
Amount of audio to include before the VAD detected speech (in milliseconds).
128117

Docs/Start-VectorStoreFileBatch.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ Create and run vector store file batch.
1515
```
1616
Start-VectorStoreFileBatch
1717
[-VectorStoreId] <String>
18-
[-FileId] <Object[]>
18+
[-Attributes <Hashtable>]
19+
[-Files] <Object[]>
1920
[-ChunkingStrategy <String>]
2021
[-MaxChunkSizeTokens <Int32>]
2122
[-ChunkOverlapTokens <Int32>]
@@ -34,7 +35,7 @@ Create and run vector store file batch.
3435

3536
### Example 1
3637
```powershell
37-
PS C:\> Start-VectorStoreFileBatch -VectorStoreId 'vs_abc123' -FileId ('file-abc123', 'file-def456', 'file-ghi789')
38+
PS C:\> Start-VectorStoreFileBatch -VectorStoreId 'vs_abc123' -Files ('file-abc123', 'file-def456', 'file-ghi789')
3839
```
3940

4041
Start a batch for adding 3 files to the vector store with ID `vs_abc123`
@@ -52,12 +53,21 @@ Position: 0
5253
Accept pipeline input: True (ByValue, ByPropertyName)
5354
```
5455
55-
### -FileId
56+
### -Attributes
57+
Set of 16 key-value pairs that can be attached to an object.
58+
59+
```yaml
60+
Type: Hashtable
61+
Required: False
62+
Position: Named
63+
```
64+
65+
### -Files
5666
A list of File IDs that the vector store should use.
5767
5868
```yaml
5969
Type: object[]
60-
Aliases: file_ids
70+
Aliases: file_ids, FileId
6171
Required: True
6272
Position: 1
6373
```

Docs/Wait-VectorStoreFileBatch.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Waits until the vector store file batch is completed.
3434

3535
### Example 1
3636
```powershell
37-
PS C:\> Start-VectorStoreFileBatch -VectorStoreId 'vs_abc123' -FileId ('file-abc123', 'file-def456', 'file-ghi789') | Wait-VectorStoreFileBatch
37+
PS C:\> Start-VectorStoreFileBatch -VectorStoreId 'vs_abc123' -Files ('file-abc123', 'file-def456', 'file-ghi789') | Wait-VectorStoreFileBatch
3838
```
3939

4040
Start a batch and wait for completes.

Guides/How_to_use_Realtime_API.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Then, configure session settings as needed.
6868
```powershell
6969
# Configure system message, output type, etc.
7070
Set-RealtimeSessionConfiguration `
71-
-Modalities 'text' `
71+
-OutputModalities 'text' `
7272
-Instructions 'You are a assistant for children. Always choose words that are easy for the child to understand.' `
7373
-Temperature 0.6
7474
```
@@ -150,7 +150,7 @@ $env:OPENAI_API_KEY = '<Put your API key here>'
150150
Connect-RealtimeSession
151151
152152
# Enables audio response with automatic turn detection.
153-
Set-RealtimeSessionConfiguration -Modalities audio -EnableTurnDetection $true
153+
Set-RealtimeSessionConfiguration -OutputModalities audio -EnableTurnDetection $true
154154
155155
# Activates speaker output.
156156
Start-RealtimeSessionAudioOutput

Public/Realtime/Request-RealtimeSessionResponse.ps1

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ function Request-RealtimeSessionResponse {
99
[string]$Instructions,
1010

1111
[Parameter()]
12+
[Alias('Modalities')] # for backward compatibility
1213
[ValidateSet('text', 'audio')]
13-
[string[]]$Modalities = @('text'),
14+
[string[]]$OutputModalities = @('text'),
1415

1516
[Parameter()]
1617
[Completions('alloy', 'ash', 'ballad', 'coral', 'echo', 'sage', 'shimmer', 'verse', 'marin', 'cedar')]
@@ -69,8 +70,8 @@ function Request-RealtimeSessionResponse {
6970
if ($PSBoundParameters.ContainsKey('Instructions')) {
7071
$MessageObject.response.instructions = $Instructions
7172
}
72-
if ($PSBoundParameters.ContainsKey('Modalities')) {
73-
$MessageObject.response.output_modalities = $Modalities
73+
if ($PSBoundParameters.ContainsKey('OutputModalities')) {
74+
$MessageObject.response.output_modalities = $OutputModalities
7475
}
7576
if ($PSBoundParameters.ContainsKey('Tools')) {
7677
$MessageObject.response.tools = $Tools

Public/Realtime/Set-RealtimeSessionConfiguration.ps1

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ function Set-RealtimeSessionConfiguration {
1818
[string]$PromptVersion,
1919

2020
[Parameter()]
21+
[Alias('Modalities')] # for backward compatibility
2122
[ValidateSet('text', 'audio')]
22-
[string[]]$Modalities = @('text'),
23+
[string[]]$OutputModalities = @('text'),
2324

2425
[Parameter()]
2526
[Completions('alloy', 'ash', 'ballad', 'coral', 'echo', 'sage', 'shimmer', 'verse', 'marin', 'cedar')]
@@ -121,7 +122,22 @@ function Set-RealtimeSessionConfiguration {
121122
[System.Collections.IDictionary]$TracingMetadata,
122123

123124
[Parameter()]
124-
[string]$TracingWorkflowName
125+
[string]$TracingWorkflowName,
126+
127+
[Parameter()]
128+
[Completions('auto', 'disabled')]
129+
[string]$Truncation = 'auto',
130+
131+
[Parameter()]
132+
[ValidateRange(0.0, 1.0)]
133+
[float]$TruncationRetentionRatio,
134+
135+
[Parameter(DontShow)]
136+
[string]$TruncationRetentionRatioType = 'retention_ratio',
137+
138+
[Parameter()]
139+
[int]$TruncationTokenLimitsPostInstructions
140+
125141
)
126142

127143
begin {
@@ -135,8 +151,8 @@ function Set-RealtimeSessionConfiguration {
135151
if ($PSBoundParameters.ContainsKey('Instructions')) {
136152
$MessageObject.session.instructions = $Instructions
137153
}
138-
if ($PSBoundParameters.ContainsKey('Modalities')) {
139-
$MessageObject.session.output_modalities = $Modalities
154+
if ($PSBoundParameters.ContainsKey('OutputModalities')) {
155+
$MessageObject.session.output_modalities = $OutputModalities
140156
}
141157
if ($PSBoundParameters.ContainsKey('Temperature')) {
142158
$MessageObject.session.temperature = $Temperature
@@ -187,6 +203,25 @@ function Set-RealtimeSessionConfiguration {
187203
}
188204
}
189205

206+
$TruncationObject = @{'type' = $TruncationRetentionRatioType }
207+
if ($PSBoundParameters.ContainsKey('TruncationRetentionRatio')) {
208+
$TruncationObject.TruncationRetentionRatio = $TruncationRetentionRatio
209+
}
210+
if ($PSBoundParameters.ContainsKey('TruncationTokenLimitsPostInstructions')) {
211+
$TruncationObject.token_limits = @{
212+
'post_instructions' = $TruncationTokenLimitsPostInstructions
213+
}
214+
}
215+
216+
if ($TruncationObject.Keys.Count -gt 1) {
217+
$MessageObject.session.truncation = $TruncationObject
218+
}
219+
else {
220+
if ($Truncation) {
221+
$MessageObject.session.truncation = $Truncation
222+
}
223+
}
224+
190225
# Input audio settings
191226
$InputAudioSettings = @{}
192227
if ($PSBoundParameters.ContainsKey('InputAudioFormat')) {

0 commit comments

Comments
 (0)