From 307de7e054bc81bdbfdecc7ae47e8435f365544b Mon Sep 17 00:00:00 2001 From: mkht Date: Sun, 31 Mar 2024 00:28:05 +0900 Subject: [PATCH] Sync API spec updates openai/openai-openapi#211 --- Docs/Add-ThreadMessage.md | 2 +- Docs/Start-ThreadRun.md | 11 +++++++++++ Public/Runs/Start-ThreadRun.ps1 | 8 ++++++++ Public/Threads/Add-ThreadMessage.ps1 | 1 + 4 files changed, 21 insertions(+), 1 deletion(-) diff --git a/Docs/Add-ThreadMessage.md b/Docs/Add-ThreadMessage.md index ae1c645..231fbcd 100644 --- a/Docs/Add-ThreadMessage.md +++ b/Docs/Add-ThreadMessage.md @@ -71,7 +71,7 @@ Position: 0 ``` ### -Role -The role of the entity that is creating the message. Currently only `user` is supported. +The role of the entity that is creating the message. One of `user` or `assistant` ```yaml Type: String diff --git a/Docs/Start-ThreadRun.md b/Docs/Start-ThreadRun.md index 44ba5b2..59044e9 100644 --- a/Docs/Start-ThreadRun.md +++ b/Docs/Start-ThreadRun.md @@ -23,6 +23,7 @@ Start-ThreadRun [-UseCodeInterpreter] [-UseRetrieval] [-MetaData ] + [-Temperature ] [-Stream] [-Format ] [-TimeoutSec ] @@ -107,6 +108,16 @@ Required: False Position: Named ``` +### -Temperature +What sampling temperature to use, between `0` and `2`. +Higher values like `0.8` will make the output more random, while lower values like `0.2` will make it more focused and deterministic. + +```yaml +Type: Double +Required: False +Position: Named +``` + ### -Tools Override the tools the assistant can use for this run. diff --git a/Public/Runs/Start-ThreadRun.ps1 b/Public/Runs/Start-ThreadRun.ps1 index 3fed033..ec08279 100644 --- a/Public/Runs/Start-ThreadRun.ps1 +++ b/Public/Runs/Start-ThreadRun.ps1 @@ -60,6 +60,7 @@ function Start-ThreadRun { [Parameter(ParameterSetName = 'ThreadAndRun')] [Parameter(ParameterSetName = 'ThreadAndRun_Stream')] + [Completions('user', 'assistant')] [string][LowerCaseTransformation()]$Role = 'user', [Parameter(ParameterSetName = 'ThreadAndRun')] @@ -82,6 +83,10 @@ function Start-ThreadRun { [Parameter()] [System.Collections.IDictionary]$MetaData, + [Parameter()] + [ValidateRange(0.0, 2.0)] + [double]$Temperature, + [Parameter(Mandatory = $true, ParameterSetName = 'Run_Stream')] [Parameter(Mandatory = $true, ParameterSetName = 'ThreadAndRun_Stream')] [switch]$Stream, @@ -218,6 +223,9 @@ function Start-ThreadRun { if ($PSBoundParameters.ContainsKey('Metadata')) { $PostBody.metadata = $Metadata } + if ($PSBoundParameters.ContainsKey('Temperature')) { + $PostBody.temperature = $Temperature + } if (($Tools.Count -gt 0) -or $PSBoundParameters.ContainsKey('Tools')) { $PostBody.tools = $Tools } diff --git a/Public/Threads/Add-ThreadMessage.ps1 b/Public/Threads/Add-ThreadMessage.ps1 index 1b7bb6b..324cb0e 100644 --- a/Public/Threads/Add-ThreadMessage.ps1 +++ b/Public/Threads/Add-ThreadMessage.ps1 @@ -19,6 +19,7 @@ function Add-ThreadMessage { [string]$Message, [Parameter()] + [Completions('user', 'assistant')] [string][LowerCaseTransformation()]$Role = 'user', [Parameter()]