Public/Azure/Runs/Get-AzureThreadRun.ps1
function Get-AzureThreadRun { [CmdletBinding(DefaultParameterSetName = 'List')] [OutputType([pscustomobject])] param ( [Parameter(ParameterSetName = 'Get', Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [Alias('run_id')] [ValidateNotNullOrEmpty()] [string][UrlEncodeTransformation()]$RunId, [Parameter(Mandatory = $true, Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] [Alias('thread_id')] [Alias('Thread')] [ValidateScript({ ($_ -is [string] -and $_.StartsWith('thread_')) -or ` ($_.id -is [string]) -or ` ($_.thread_id -is [string] -and $_.thread_id.StartsWith('thread_')) })] [Object]$InputObject, [Parameter(ParameterSetName = 'List')] [ValidateRange(1, 100)] [int]$Limit = 20, [Parameter(ParameterSetName = 'ListAll')] [switch]$All, [Parameter(ParameterSetName = 'ListAll', DontShow = $true)] [string]$After, [Parameter(ParameterSetName = 'ListAll', DontShow = $true)] [string]$Before, [Parameter(ParameterSetName = 'List')] [Parameter(ParameterSetName = 'ListAll')] [ValidateSet('asc', 'desc')] [string][LowerCaseTransformation()]$Order = 'asc', [Parameter()] [int]$TimeoutSec = 0, [Parameter()] [ValidateRange(0, 100)] [int]$MaxRetryCount = 0, [Parameter(DontShow = $true)] [switch]$Primitive, [Parameter()] [System.Uri]$ApiBase, [Parameter()] [string]$ApiVersion, [Parameter()] [ValidateSet('azure', 'azure_ad')] [string]$AuthType = 'azure', [Parameter()] [securestring][SecureStringTransformation()]$ApiKey ) begin { # Construct parameters $Parameters = $PSBoundParameters $Parameters.ApiType = [OpenAIApiType]::Azure $Parameters.AuthType = $AuthType # Invoke $steppablePipeline = { PSOpenAI\Get-ThreadRun @Parameters }.GetSteppablePipeline($myInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } process { $steppablePipeline.Process($PSItem) } end { $steppablePipeline.End() } } |