Public/Azure/Runs/Start-AzureThreadRun.ps1
function Start-AzureThreadRun { [CmdletBinding()] [OutputType([pscustomobject])] param ( [Parameter(Mandatory, Position = 0, ValueFromPipeline, ValueFromPipelineByPropertyName)] [Alias('thread_id')] [Alias('Thread')] [ValidateScript({ [bool](Get-ThreadIdFromInputObject $_) })] [Object]$InputObject, [Parameter(Mandatory, ValueFromPipelineByPropertyName)] [Alias('assistant_id')] [ValidateScript({ [bool](Get-AssistantIdFromInputObject $_) })] [Object]$Assistant, [Parameter()] [Alias('Model')] [string]$Deployment, [Parameter()] [ValidateLength(0, 32768)] [string]$Instructions, [Parameter()] [Alias('additional_instructions')] [string]$AdditionalInstructions, [Parameter()] [AllowEmptyCollection()] [System.Collections.IDictionary[]]$Tools, [Parameter()] [switch]$UseCodeInterpreter, [Parameter()] [switch]$UseRetrieval, [Parameter()] [System.Collections.IDictionary]$MetaData, [Parameter()] [int]$TimeoutSec = 0, [Parameter()] [ValidateRange(0, 100)] [int]$MaxRetryCount = 0, [Parameter()] [System.Uri]$ApiBase, [Parameter()] [string]$ApiVersion, [Parameter()] [ValidateSet('azure', 'azure_ad')] [string]$AuthType = 'azure', [Parameter()] [securestring][SecureStringTransformation()]$ApiKey, [Parameter()] [System.Collections.IDictionary]$AdditionalQuery, [Parameter()] [System.Collections.IDictionary]$AdditionalHeaders, [Parameter()] [object]$AdditionalBody ) begin { # Construct parameters $Parameters = $PSBoundParameters $Parameters.ApiType = [OpenAIApiType]::Azure $Parameters.AuthType = $AuthType if ($PSBoundParameters.ContainsKey('Deployment')) { $Parameters.Model = $Deployment $null = $Parameters.Remove('Deployment') } # Invoke $steppablePipeline = { PSOpenAI\Start-ThreadRun @Parameters }.GetSteppablePipeline($myInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } process { $steppablePipeline.Process($PSItem) } end { $steppablePipeline.End() } } |