diff --git a/Docs/Add-AgentEnvironmentFile.md b/Docs/Add-AgentEnvironmentFile.md new file mode 100644 index 0000000..55fa532 --- /dev/null +++ b/Docs/Add-AgentEnvironmentFile.md @@ -0,0 +1,245 @@ +--- +external help file: PSOpenAI-help.xml +Module Name: PSOpenAI +online version: https://github.com/mkht/PSOpenAI/blob/v5/Docs/Add-AgentEnvironmentFile.md +schema: 2.0.0 +--- + +# Add-AgentEnvironmentFile + +## SYNOPSIS +Uploads a file definition to a live agent environment. + +## SYNTAX + +``` +Add-AgentEnvironmentFile [-EnvironmentId] [-Body] [[-TimeoutSec] ] + [[-MaxRetryCount] ] [[-ApiType] ] [[-ApiBase] ] [[-AuthType] ] + [[-ApiKey] ] [[-Organization] ] [[-AdditionalQuery] ] + [[-AdditionalHeaders] ] [[-AdditionalBody] ] [-ProgressAction ] + [] +``` + +## DESCRIPTION +Uploads a file definition to a live agent environment. This command uses the OpenAI Agents API public beta and sends the required `OpenAI-Beta: agents=v1` header. Nested, evolving request schemas are accepted through `-Body` where applicable. + +## EXAMPLES + +### Example 1 +```powershell +Add-AgentEnvironmentFile -EnvironmentId 'env_123' -Body @{ type = 'inline'; path = '/workspace/README.md'; data = '' } +``` + +Adds an inline file to a live agent environment. + +## PARAMETERS + +### -AdditionalBody +Additional JSON properties to merge into the request body. + +```yaml +Type: Object +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AdditionalHeaders +Additional HTTP headers to include in the request. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AdditionalQuery +Additional query parameters to include in the request. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiBase +The base URI for the OpenAI API. + +```yaml +Type: Uri +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiKey +The OpenAI API key as a secure string. + +```yaml +Type: SecureString +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiType +The API provider. Agents API commands support OpenAI only. + +```yaml +Type: OpenAIApiType +Parameter Sets: (All) +Aliases: +Accepted values: OpenAI, Azure + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AuthType +The authentication type. Use openai for the Agents API. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: +Accepted values: openai, azure, azure_ad + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Body +The request body as a dictionary. Use the fields defined by the corresponding OpenAI Agents API operation. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EnvironmentId +The live agent environment ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: environment_id + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -MaxRetryCount +The maximum number of retries for transient API failures. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Organization +The OpenAI organization ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: OrgId + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TimeoutSec +The request timeout in seconds. Zero uses the module default. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProgressAction +Controls how PowerShell responds to progress updates. + +```yaml +Type: ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[OpenAI Agents API](https://developers.openai.com/api/reference/typescript/resources/beta/subresources/agents) diff --git a/Docs/Add-AgentSessionEvent.md b/Docs/Add-AgentSessionEvent.md new file mode 100644 index 0000000..acde8c3 --- /dev/null +++ b/Docs/Add-AgentSessionEvent.md @@ -0,0 +1,260 @@ +--- +external help file: PSOpenAI-help.xml +Module Name: PSOpenAI +online version: https://github.com/mkht/PSOpenAI/blob/v5/Docs/Add-AgentSessionEvent.md +schema: 2.0.0 +--- + +# Add-AgentSessionEvent + +## SYNOPSIS +Adds one or more input events to an agent session. + +## SYNTAX + +``` +Add-AgentSessionEvent [-SessionId] [-Event] [[-IdempotencyKey] ] + [[-TimeoutSec] ] [[-MaxRetryCount] ] [[-ApiType] ] [[-ApiBase] ] + [[-AuthType] ] [[-ApiKey] ] [[-Organization] ] + [[-AdditionalQuery] ] [[-AdditionalHeaders] ] [[-AdditionalBody] ] + [-ProgressAction ] [] +``` + +## DESCRIPTION +Adds one or more input events to an agent session. This command uses the OpenAI Agents API public beta and sends the required `OpenAI-Beta: agents=v1` header. Nested, evolving request schemas are accepted through `-Body` where applicable. + +## EXAMPLES + +### Example 1 +```powershell +Add-AgentSessionEvent -SessionId 'session_123' -Event @{ type = 'message'; role = 'user'; content = @(@{ type = 'input_text'; text = 'Continue.' }) } +``` + +Submits a user input event to an existing session. + +## PARAMETERS + +### -AdditionalBody +Additional JSON properties to merge into the request body. + +```yaml +Type: Object +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AdditionalHeaders +Additional HTTP headers to include in the request. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AdditionalQuery +Additional query parameters to include in the request. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiBase +The base URI for the OpenAI API. + +```yaml +Type: Uri +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiKey +The OpenAI API key as a secure string. + +```yaml +Type: SecureString +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiType +The API provider. Agents API commands support OpenAI only. + +```yaml +Type: OpenAIApiType +Parameter Sets: (All) +Aliases: +Accepted values: OpenAI, Azure + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AuthType +The authentication type. Use openai for the Agents API. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: +Accepted values: openai, azure, azure_ad + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Event +One or more input event objects to submit to the session. + +```yaml +Type: Object[] +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IdempotencyKey +An idempotency key sent in the Idempotency-Key request header. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MaxRetryCount +The maximum number of retries for transient API failures. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Organization +The OpenAI organization ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: OrgId + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SessionId +The managed agent session ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: session_id + +Required: True +Position: 0 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TimeoutSec +The request timeout in seconds. Zero uses the module default. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProgressAction +Controls how PowerShell responds to progress updates. + +```yaml +Type: ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[OpenAI Agents API](https://developers.openai.com/api/reference/typescript/resources/beta/subresources/agents) diff --git a/Docs/Get-Agent.md b/Docs/Get-Agent.md new file mode 100644 index 0000000..2c35ddf --- /dev/null +++ b/Docs/Get-Agent.md @@ -0,0 +1,300 @@ +--- +external help file: PSOpenAI-help.xml +Module Name: PSOpenAI +online version: https://github.com/mkht/PSOpenAI/blob/v5/Docs/Get-Agent.md +schema: 2.0.0 +--- + +# Get-Agent + +## SYNOPSIS +Retrieves or lists reusable agents. + +## SYNTAX + +### List (Default) +``` +Get-Agent [[-Limit] ] [-All] [[-After] ] [[-Order] ] [[-TimeoutSec] ] + [[-MaxRetryCount] ] [[-ApiType] ] [[-ApiBase] ] [[-AuthType] ] + [[-ApiKey] ] [[-Organization] ] [[-AdditionalQuery] ] + [[-AdditionalHeaders] ] [[-AdditionalBody] ] [-ProgressAction ] + [] +``` + +### Get +``` +Get-Agent [-AgentId] [[-TimeoutSec] ] [[-MaxRetryCount] ] [[-ApiType] ] + [[-ApiBase] ] [[-AuthType] ] [[-ApiKey] ] [[-Organization] ] + [[-AdditionalQuery] ] [[-AdditionalHeaders] ] [[-AdditionalBody] ] + [-ProgressAction ] [] +``` + +## DESCRIPTION +Retrieves or lists reusable agents. This command uses the OpenAI Agents API public beta and sends the required `OpenAI-Beta: agents=v1` header. Nested, evolving request schemas are accepted through `-Body` where applicable. + +## EXAMPLES + +### Example 1 +```powershell +Get-Agent -AgentId 'agent_123' +``` + +Retrieves a reusable agent by ID. + +## PARAMETERS + +### -AdditionalBody +Additional JSON properties to merge into the request body. + +```yaml +Type: Object +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AdditionalHeaders +Additional HTTP headers to include in the request. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AdditionalQuery +Additional query parameters to include in the request. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -After +Cursor identifying the item after which to continue a cursor-based listing. + +```yaml +Type: String +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AgentId +The reusable agent ID. + +```yaml +Type: String +Parameter Sets: Get +Aliases: agent_id + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName, ByValue) +Accept wildcard characters: False +``` + +### -All +Retrieves all available cursor-based pages. + +```yaml +Type: SwitchParameter +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiBase +The base URI for the OpenAI API. + +```yaml +Type: Uri +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiKey +The OpenAI API key as a secure string. + +```yaml +Type: SecureString +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiType +The API provider. Agents API commands support OpenAI only. + +```yaml +Type: OpenAIApiType +Parameter Sets: (All) +Aliases: +Accepted values: OpenAI, Azure + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AuthType +The authentication type. Use openai for the Agents API. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: +Accepted values: openai, azure, azure_ad + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Limit +The maximum number of items to return in one page. + +```yaml +Type: Int32 +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MaxRetryCount +The maximum number of retries for transient API failures. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Order +The order in which items are returned. + +```yaml +Type: String +Parameter Sets: List +Aliases: +Accepted values: asc, desc + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Organization +The OpenAI organization ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: OrgId + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TimeoutSec +The request timeout in seconds. Zero uses the module default. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProgressAction +Controls how PowerShell responds to progress updates. + +```yaml +Type: ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[OpenAI Agents API](https://developers.openai.com/api/reference/typescript/resources/beta/subresources/agents) diff --git a/Docs/Get-AgentEnvironment.md b/Docs/Get-AgentEnvironment.md new file mode 100644 index 0000000..ce5ccfa --- /dev/null +++ b/Docs/Get-AgentEnvironment.md @@ -0,0 +1,229 @@ +--- +external help file: PSOpenAI-help.xml +Module Name: PSOpenAI +online version: https://github.com/mkht/PSOpenAI/blob/v5/Docs/Get-AgentEnvironment.md +schema: 2.0.0 +--- + +# Get-AgentEnvironment + +## SYNOPSIS +Retrieves a live agent environment. + +## SYNTAX + +``` +Get-AgentEnvironment [-EnvironmentId] [[-TimeoutSec] ] [[-MaxRetryCount] ] + [[-ApiType] ] [[-ApiBase] ] [[-AuthType] ] [[-ApiKey] ] + [[-Organization] ] [[-AdditionalQuery] ] [[-AdditionalHeaders] ] + [[-AdditionalBody] ] [-ProgressAction ] [] +``` + +## DESCRIPTION +Retrieves a live agent environment. This command uses the OpenAI Agents API public beta and sends the required `OpenAI-Beta: agents=v1` header. Nested, evolving request schemas are accepted through `-Body` where applicable. + +## EXAMPLES + +### Example 1 +```powershell +Get-AgentEnvironment -EnvironmentId 'env_123' +``` + +Retrieves the current state of a live agent environment. + +## PARAMETERS + +### -AdditionalBody +Additional JSON properties to merge into the request body. + +```yaml +Type: Object +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AdditionalHeaders +Additional HTTP headers to include in the request. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AdditionalQuery +Additional query parameters to include in the request. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiBase +The base URI for the OpenAI API. + +```yaml +Type: Uri +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiKey +The OpenAI API key as a secure string. + +```yaml +Type: SecureString +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiType +The API provider. Agents API commands support OpenAI only. + +```yaml +Type: OpenAIApiType +Parameter Sets: (All) +Aliases: +Accepted values: OpenAI, Azure + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AuthType +The authentication type. Use openai for the Agents API. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: +Accepted values: openai, azure, azure_ad + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EnvironmentId +The live agent environment ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: environment_id + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -MaxRetryCount +The maximum number of retries for transient API failures. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Organization +The OpenAI organization ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: OrgId + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TimeoutSec +The request timeout in seconds. Zero uses the module default. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProgressAction +Controls how PowerShell responds to progress updates. + +```yaml +Type: ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[OpenAI Agents API](https://developers.openai.com/api/reference/typescript/resources/beta/subresources/agents) diff --git a/Docs/Get-AgentEnvironmentFile.md b/Docs/Get-AgentEnvironmentFile.md new file mode 100644 index 0000000..60ec0eb --- /dev/null +++ b/Docs/Get-AgentEnvironmentFile.md @@ -0,0 +1,291 @@ +--- +external help file: PSOpenAI-help.xml +Module Name: PSOpenAI +online version: https://github.com/mkht/PSOpenAI/blob/v5/Docs/Get-AgentEnvironmentFile.md +schema: 2.0.0 +--- + +# Get-AgentEnvironmentFile + +## SYNOPSIS +Lists files in a live agent environment. + +## SYNTAX + +``` +Get-AgentEnvironmentFile [-EnvironmentId] [[-Limit] ] [[-Order] ] [[-Page] ] + [[-Path] ] [[-TimeoutSec] ] [[-MaxRetryCount] ] [[-ApiType] ] + [[-ApiBase] ] [[-AuthType] ] [[-ApiKey] ] [[-Organization] ] + [[-AdditionalQuery] ] [[-AdditionalHeaders] ] [[-AdditionalBody] ] + [-ProgressAction ] [] +``` + +## DESCRIPTION +Lists files in a live agent environment. This command uses the OpenAI Agents API public beta and sends the required `OpenAI-Beta: agents=v1` header. Nested, evolving request schemas are accepted through `-Body` where applicable. + +## EXAMPLES + +### Example 1 +```powershell +Get-AgentEnvironmentFile -EnvironmentId 'env_123' -Path '/workspace' +``` + +Lists files in the specified workspace directory. + +## PARAMETERS + +### -AdditionalBody +Additional JSON properties to merge into the request body. + +```yaml +Type: Object +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AdditionalHeaders +Additional HTTP headers to include in the request. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AdditionalQuery +Additional query parameters to include in the request. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiBase +The base URI for the OpenAI API. + +```yaml +Type: Uri +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiKey +The OpenAI API key as a secure string. + +```yaml +Type: SecureString +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiType +The API provider. Agents API commands support OpenAI only. + +```yaml +Type: OpenAIApiType +Parameter Sets: (All) +Aliases: +Accepted values: OpenAI, Azure + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AuthType +The authentication type. Use openai for the Agents API. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: +Accepted values: openai, azure, azure_ad + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EnvironmentId +The live agent environment ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: environment_id + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Limit +The maximum number of items to return in one page. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MaxRetryCount +The maximum number of retries for transient API failures. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Order +The order in which items are returned. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: +Accepted values: asc, desc + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Organization +The OpenAI organization ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: OrgId + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Page +The opaque environment-file page token returned by the preceding request. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Path +Restricts environment-file results to this absolute workspace path. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TimeoutSec +The request timeout in seconds. Zero uses the module default. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProgressAction +Controls how PowerShell responds to progress updates. + +```yaml +Type: ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[OpenAI Agents API](https://developers.openai.com/api/reference/typescript/resources/beta/subresources/agents) diff --git a/Docs/Get-AgentEnvironmentTemplate.md b/Docs/Get-AgentEnvironmentTemplate.md new file mode 100644 index 0000000..171d116 --- /dev/null +++ b/Docs/Get-AgentEnvironmentTemplate.md @@ -0,0 +1,301 @@ +--- +external help file: PSOpenAI-help.xml +Module Name: PSOpenAI +online version: https://github.com/mkht/PSOpenAI/blob/v5/Docs/Get-AgentEnvironmentTemplate.md +schema: 2.0.0 +--- + +# Get-AgentEnvironmentTemplate + +## SYNOPSIS +Retrieves or lists reusable agent environment templates. + +## SYNTAX + +### List (Default) +``` +Get-AgentEnvironmentTemplate [[-Limit] ] [-All] [[-After] ] [[-Order] ] + [[-TimeoutSec] ] [[-MaxRetryCount] ] [[-ApiType] ] [[-ApiBase] ] + [[-AuthType] ] [[-ApiKey] ] [[-Organization] ] + [[-AdditionalQuery] ] [[-AdditionalHeaders] ] [[-AdditionalBody] ] + [-ProgressAction ] [] +``` + +### Get +``` +Get-AgentEnvironmentTemplate [-EnvironmentTemplateId] [[-TimeoutSec] ] + [[-MaxRetryCount] ] [[-ApiType] ] [[-ApiBase] ] [[-AuthType] ] + [[-ApiKey] ] [[-Organization] ] [[-AdditionalQuery] ] + [[-AdditionalHeaders] ] [[-AdditionalBody] ] [-ProgressAction ] + [] +``` + +## DESCRIPTION +Retrieves or lists reusable agent environment templates. This command uses the OpenAI Agents API public beta and sends the required `OpenAI-Beta: agents=v1` header. Nested, evolving request schemas are accepted through `-Body` where applicable. + +## EXAMPLES + +### Example 1 +```powershell +Get-AgentEnvironmentTemplate -EnvironmentTemplateId 'envtpl_123' +``` + +Retrieves a reusable environment template by ID. + +## PARAMETERS + +### -AdditionalBody +Additional JSON properties to merge into the request body. + +```yaml +Type: Object +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AdditionalHeaders +Additional HTTP headers to include in the request. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AdditionalQuery +Additional query parameters to include in the request. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -After +Cursor identifying the item after which to continue a cursor-based listing. + +```yaml +Type: String +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -All +Retrieves all available cursor-based pages. + +```yaml +Type: SwitchParameter +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiBase +The base URI for the OpenAI API. + +```yaml +Type: Uri +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiKey +The OpenAI API key as a secure string. + +```yaml +Type: SecureString +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiType +The API provider. Agents API commands support OpenAI only. + +```yaml +Type: OpenAIApiType +Parameter Sets: (All) +Aliases: +Accepted values: OpenAI, Azure + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AuthType +The authentication type. Use openai for the Agents API. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: +Accepted values: openai, azure, azure_ad + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EnvironmentTemplateId +The reusable agent environment template ID. + +```yaml +Type: String +Parameter Sets: Get +Aliases: environment_template_id + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Limit +The maximum number of items to return in one page. + +```yaml +Type: Int32 +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MaxRetryCount +The maximum number of retries for transient API failures. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Order +The order in which items are returned. + +```yaml +Type: String +Parameter Sets: List +Aliases: +Accepted values: asc, desc + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Organization +The OpenAI organization ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: OrgId + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TimeoutSec +The request timeout in seconds. Zero uses the module default. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProgressAction +Controls how PowerShell responds to progress updates. + +```yaml +Type: ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[OpenAI Agents API](https://developers.openai.com/api/reference/typescript/resources/beta/subresources/agents) diff --git a/Docs/Get-AgentSession.md b/Docs/Get-AgentSession.md new file mode 100644 index 0000000..6328b06 --- /dev/null +++ b/Docs/Get-AgentSession.md @@ -0,0 +1,315 @@ +--- +external help file: PSOpenAI-help.xml +Module Name: PSOpenAI +online version: https://github.com/mkht/PSOpenAI/blob/v5/Docs/Get-AgentSession.md +schema: 2.0.0 +--- + +# Get-AgentSession + +## SYNOPSIS +Retrieves or lists agent sessions. + +## SYNTAX + +### List (Default) +``` +Get-AgentSession [[-AgentId] ] [[-Limit] ] [-All] [[-After] ] [[-Order] ] + [[-TimeoutSec] ] [[-MaxRetryCount] ] [[-ApiType] ] [[-ApiBase] ] + [[-AuthType] ] [[-ApiKey] ] [[-Organization] ] + [[-AdditionalQuery] ] [[-AdditionalHeaders] ] [[-AdditionalBody] ] + [-ProgressAction ] [] +``` + +### Get +``` +Get-AgentSession [-SessionId] [[-TimeoutSec] ] [[-MaxRetryCount] ] + [[-ApiType] ] [[-ApiBase] ] [[-AuthType] ] [[-ApiKey] ] + [[-Organization] ] [[-AdditionalQuery] ] [[-AdditionalHeaders] ] + [[-AdditionalBody] ] [-ProgressAction ] [] +``` + +## DESCRIPTION +Retrieves or lists agent sessions. This command uses the OpenAI Agents API public beta and sends the required `OpenAI-Beta: agents=v1` header. Nested, evolving request schemas are accepted through `-Body` where applicable. + +## EXAMPLES + +### Example 1 +```powershell +Get-AgentSession -SessionId 'session_123' +``` + +Retrieves a managed agent session by ID. + +## PARAMETERS + +### -AdditionalBody +Additional JSON properties to merge into the request body. + +```yaml +Type: Object +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AdditionalHeaders +Additional HTTP headers to include in the request. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AdditionalQuery +Additional query parameters to include in the request. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -After +Cursor identifying the item after which to continue a cursor-based listing. + +```yaml +Type: String +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AgentId +The reusable agent ID. + +```yaml +Type: String +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -All +Retrieves all available cursor-based pages. + +```yaml +Type: SwitchParameter +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiBase +The base URI for the OpenAI API. + +```yaml +Type: Uri +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiKey +The OpenAI API key as a secure string. + +```yaml +Type: SecureString +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiType +The API provider. Agents API commands support OpenAI only. + +```yaml +Type: OpenAIApiType +Parameter Sets: (All) +Aliases: +Accepted values: OpenAI, Azure + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AuthType +The authentication type. Use openai for the Agents API. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: +Accepted values: openai, azure, azure_ad + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Limit +The maximum number of items to return in one page. + +```yaml +Type: Int32 +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MaxRetryCount +The maximum number of retries for transient API failures. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Order +The order in which items are returned. + +```yaml +Type: String +Parameter Sets: List +Aliases: +Accepted values: asc, desc + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Organization +The OpenAI organization ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: OrgId + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SessionId +The managed agent session ID. + +```yaml +Type: String +Parameter Sets: Get +Aliases: session_id + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -TimeoutSec +The request timeout in seconds. Zero uses the module default. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProgressAction +Controls how PowerShell responds to progress updates. + +```yaml +Type: ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[OpenAI Agents API](https://developers.openai.com/api/reference/typescript/resources/beta/subresources/agents) diff --git a/Docs/Get-AgentSessionArtifact.md b/Docs/Get-AgentSessionArtifact.md new file mode 100644 index 0000000..7c960b4 --- /dev/null +++ b/Docs/Get-AgentSessionArtifact.md @@ -0,0 +1,322 @@ +--- +external help file: PSOpenAI-help.xml +Module Name: PSOpenAI +online version: https://github.com/mkht/PSOpenAI/blob/v5/Docs/Get-AgentSessionArtifact.md +schema: 2.0.0 +--- + +# Get-AgentSessionArtifact + +## SYNOPSIS +Retrieves or lists immutable session artifacts. + +## SYNTAX + +``` +Get-AgentSessionArtifact [-SessionId] [[-ArtifactId] ] [[-EnvironmentId] ] + [[-Limit] ] [-All] [[-After] ] [[-Order] ] [[-TimeoutSec] ] + [[-MaxRetryCount] ] [[-ApiType] ] [[-ApiBase] ] [[-AuthType] ] + [[-ApiKey] ] [[-Organization] ] [[-AdditionalQuery] ] + [[-AdditionalHeaders] ] [[-AdditionalBody] ] [-ProgressAction ] + [] +``` + +## DESCRIPTION +Retrieves or lists immutable session artifacts. This command uses the OpenAI Agents API public beta and sends the required `OpenAI-Beta: agents=v1` header. Nested, evolving request schemas are accepted through `-Body` where applicable. + +## EXAMPLES + +### Example 1 +```powershell +Get-AgentSessionArtifact -SessionId 'session_123' -ArtifactId 'artifact_123' +``` + +Retrieves artifact metadata from a managed session. + +## PARAMETERS + +### -AdditionalBody +Additional JSON properties to merge into the request body. + +```yaml +Type: Object +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AdditionalHeaders +Additional HTTP headers to include in the request. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AdditionalQuery +Additional query parameters to include in the request. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -After +Cursor identifying the item after which to continue a cursor-based listing. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -All +Retrieves all available cursor-based pages. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiBase +The base URI for the OpenAI API. + +```yaml +Type: Uri +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiKey +The OpenAI API key as a secure string. + +```yaml +Type: SecureString +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiType +The API provider. Agents API commands support OpenAI only. + +```yaml +Type: OpenAIApiType +Parameter Sets: (All) +Aliases: +Accepted values: OpenAI, Azure + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ArtifactId +The session artifact ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AuthType +The authentication type. Use openai for the Agents API. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: +Accepted values: openai, azure, azure_ad + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EnvironmentId +The live agent environment ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Limit +The maximum number of items to return in one page. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MaxRetryCount +The maximum number of retries for transient API failures. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Order +The order in which items are returned. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: +Accepted values: asc, desc + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Organization +The OpenAI organization ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: OrgId + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SessionId +The managed agent session ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: session_id + +Required: True +Position: 0 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TimeoutSec +The request timeout in seconds. Zero uses the module default. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProgressAction +Controls how PowerShell responds to progress updates. + +```yaml +Type: ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[OpenAI Agents API](https://developers.openai.com/api/reference/typescript/resources/beta/subresources/agents) diff --git a/Docs/Get-AgentSessionArtifactContent.md b/Docs/Get-AgentSessionArtifactContent.md new file mode 100644 index 0000000..674ab0f --- /dev/null +++ b/Docs/Get-AgentSessionArtifactContent.md @@ -0,0 +1,245 @@ +--- +external help file: PSOpenAI-help.xml +Module Name: PSOpenAI +online version: https://github.com/mkht/PSOpenAI/blob/v5/Docs/Get-AgentSessionArtifactContent.md +schema: 2.0.0 +--- + +# Get-AgentSessionArtifactContent + +## SYNOPSIS +Downloads the binary content of a session artifact. + +## SYNTAX + +``` +Get-AgentSessionArtifactContent [-SessionId] [-ArtifactId] [[-OutFile] ] + [[-TimeoutSec] ] [[-MaxRetryCount] ] [[-ApiType] ] [[-ApiBase] ] + [[-AuthType] ] [[-ApiKey] ] [[-Organization] ] + [[-AdditionalQuery] ] [[-AdditionalHeaders] ] [-ProgressAction ] + [] +``` + +## DESCRIPTION +Downloads the binary content of a session artifact. This command uses the OpenAI Agents API public beta and sends the required `OpenAI-Beta: agents=v1` header. Nested, evolving request schemas are accepted through `-Body` where applicable. + +## EXAMPLES + +### Example 1 +```powershell +Get-AgentSessionArtifactContent -SessionId 'session_123' -ArtifactId 'artifact_123' -OutFile './artifact.bin' +``` + +Downloads an immutable session artifact. + +## PARAMETERS + +### -AdditionalHeaders +Additional HTTP headers to include in the request. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AdditionalQuery +Additional query parameters to include in the request. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiBase +The base URI for the OpenAI API. + +```yaml +Type: Uri +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiKey +The OpenAI API key as a secure string. + +```yaml +Type: SecureString +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiType +The API provider. Agents API commands support OpenAI only. + +```yaml +Type: OpenAIApiType +Parameter Sets: (All) +Aliases: +Accepted values: OpenAI, Azure + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ArtifactId +The session artifact ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: artifact_id + +Required: True +Position: 1 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -AuthType +The authentication type. Use openai for the Agents API. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: +Accepted values: openai, azure, azure_ad + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MaxRetryCount +The maximum number of retries for transient API failures. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Organization +The OpenAI organization ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: OrgId + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -OutFile +The local path where downloaded artifact content is saved. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SessionId +The managed agent session ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: session_id + +Required: True +Position: 0 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TimeoutSec +The request timeout in seconds. Zero uses the module default. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProgressAction +Controls how PowerShell responds to progress updates. + +```yaml +Type: ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[OpenAI Agents API](https://developers.openai.com/api/reference/typescript/resources/beta/subresources/agents) diff --git a/Docs/Get-AgentSessionEvent.md b/Docs/Get-AgentSessionEvent.md new file mode 100644 index 0000000..4a4eca4 --- /dev/null +++ b/Docs/Get-AgentSessionEvent.md @@ -0,0 +1,214 @@ +--- +external help file: PSOpenAI-help.xml +Module Name: PSOpenAI +online version: https://github.com/mkht/PSOpenAI/blob/v5/Docs/Get-AgentSessionEvent.md +schema: 2.0.0 +--- + +# Get-AgentSessionEvent + +## SYNOPSIS +Streams server-sent events from an agent session. + +## SYNTAX + +``` +Get-AgentSessionEvent [-SessionId] [[-TimeoutSec] ] [[-MaxRetryCount] ] + [[-ApiType] ] [[-ApiBase] ] [[-AuthType] ] [[-ApiKey] ] + [[-Organization] ] [[-AdditionalQuery] ] [[-AdditionalHeaders] ] + [-ProgressAction ] [] +``` + +## DESCRIPTION +Streams server-sent events from an agent session. This command uses the OpenAI Agents API public beta and sends the required `OpenAI-Beta: agents=v1` header. Nested, evolving request schemas are accepted through `-Body` where applicable. + +## EXAMPLES + +### Example 1 +```powershell +Get-AgentSessionEvent -SessionId 'session_123' +``` + +Streams server-sent events from a managed session. + +## PARAMETERS + +### -AdditionalHeaders +Additional HTTP headers to include in the request. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AdditionalQuery +Additional query parameters to include in the request. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiBase +The base URI for the OpenAI API. + +```yaml +Type: Uri +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiKey +The OpenAI API key as a secure string. + +```yaml +Type: SecureString +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiType +The API provider. Agents API commands support OpenAI only. + +```yaml +Type: OpenAIApiType +Parameter Sets: (All) +Aliases: +Accepted values: OpenAI, Azure + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AuthType +The authentication type. Use openai for the Agents API. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: +Accepted values: openai, azure, azure_ad + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MaxRetryCount +The maximum number of retries for transient API failures. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Organization +The OpenAI organization ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: OrgId + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SessionId +The managed agent session ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: session_id + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -TimeoutSec +The request timeout in seconds. Zero uses the module default. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProgressAction +Controls how PowerShell responds to progress updates. + +```yaml +Type: ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[OpenAI Agents API](https://developers.openai.com/api/reference/typescript/resources/beta/subresources/agents) diff --git a/Docs/Get-AgentSessionItem.md b/Docs/Get-AgentSessionItem.md new file mode 100644 index 0000000..47ecae8 --- /dev/null +++ b/Docs/Get-AgentSessionItem.md @@ -0,0 +1,321 @@ +--- +external help file: PSOpenAI-help.xml +Module Name: PSOpenAI +online version: https://github.com/mkht/PSOpenAI/blob/v5/Docs/Get-AgentSessionItem.md +schema: 2.0.0 +--- + +# Get-AgentSessionItem + +## SYNOPSIS +Lists items from a session, subagent, or subagent turn. + +## SYNTAX + +``` +Get-AgentSessionItem [-SessionId] [[-SubagentId] ] [[-TurnId] ] [[-Limit] ] + [-All] [[-After] ] [[-Order] ] [[-TimeoutSec] ] [[-MaxRetryCount] ] + [[-ApiType] ] [[-ApiBase] ] [[-AuthType] ] [[-ApiKey] ] + [[-Organization] ] [[-AdditionalQuery] ] [[-AdditionalHeaders] ] + [[-AdditionalBody] ] [-ProgressAction ] [] +``` + +## DESCRIPTION +Lists items from a session, subagent, or subagent turn. This command uses the OpenAI Agents API public beta and sends the required `OpenAI-Beta: agents=v1` header. Nested, evolving request schemas are accepted through `-Body` where applicable. + +## EXAMPLES + +### Example 1 +```powershell +Get-AgentSessionItem -SessionId 'session_123' -All +``` + +Lists every item associated with a managed session. + +## PARAMETERS + +### -AdditionalBody +Additional JSON properties to merge into the request body. + +```yaml +Type: Object +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AdditionalHeaders +Additional HTTP headers to include in the request. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AdditionalQuery +Additional query parameters to include in the request. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -After +Cursor identifying the item after which to continue a cursor-based listing. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -All +Retrieves all available cursor-based pages. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiBase +The base URI for the OpenAI API. + +```yaml +Type: Uri +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiKey +The OpenAI API key as a secure string. + +```yaml +Type: SecureString +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiType +The API provider. Agents API commands support OpenAI only. + +```yaml +Type: OpenAIApiType +Parameter Sets: (All) +Aliases: +Accepted values: OpenAI, Azure + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AuthType +The authentication type. Use openai for the Agents API. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: +Accepted values: openai, azure, azure_ad + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Limit +The maximum number of items to return in one page. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MaxRetryCount +The maximum number of retries for transient API failures. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Order +The order in which items are returned. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: +Accepted values: asc, desc + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Organization +The OpenAI organization ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: OrgId + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SessionId +The managed agent session ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: session_id + +Required: True +Position: 0 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubagentId +The session subagent ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TimeoutSec +The request timeout in seconds. Zero uses the module default. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TurnId +The agent or subagent turn ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProgressAction +Controls how PowerShell responds to progress updates. + +```yaml +Type: ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[OpenAI Agents API](https://developers.openai.com/api/reference/typescript/resources/beta/subresources/agents) diff --git a/Docs/Get-AgentSessionSubagent.md b/Docs/Get-AgentSessionSubagent.md new file mode 100644 index 0000000..5053519 --- /dev/null +++ b/Docs/Get-AgentSessionSubagent.md @@ -0,0 +1,306 @@ +--- +external help file: PSOpenAI-help.xml +Module Name: PSOpenAI +online version: https://github.com/mkht/PSOpenAI/blob/v5/Docs/Get-AgentSessionSubagent.md +schema: 2.0.0 +--- + +# Get-AgentSessionSubagent + +## SYNOPSIS +Retrieves or lists subagents in a session. + +## SYNTAX + +``` +Get-AgentSessionSubagent [-SessionId] [[-SubagentId] ] [[-Limit] ] [-All] + [[-After] ] [[-Order] ] [[-TimeoutSec] ] [[-MaxRetryCount] ] + [[-ApiType] ] [[-ApiBase] ] [[-AuthType] ] [[-ApiKey] ] + [[-Organization] ] [[-AdditionalQuery] ] [[-AdditionalHeaders] ] + [[-AdditionalBody] ] [-ProgressAction ] [] +``` + +## DESCRIPTION +Retrieves or lists subagents in a session. This command uses the OpenAI Agents API public beta and sends the required `OpenAI-Beta: agents=v1` header. Nested, evolving request schemas are accepted through `-Body` where applicable. + +## EXAMPLES + +### Example 1 +```powershell +Get-AgentSessionSubagent -SessionId 'session_123' -SubagentId 'subagent_123' +``` + +Retrieves a subagent created within a managed session. + +## PARAMETERS + +### -AdditionalBody +Additional JSON properties to merge into the request body. + +```yaml +Type: Object +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AdditionalHeaders +Additional HTTP headers to include in the request. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AdditionalQuery +Additional query parameters to include in the request. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -After +Cursor identifying the item after which to continue a cursor-based listing. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -All +Retrieves all available cursor-based pages. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiBase +The base URI for the OpenAI API. + +```yaml +Type: Uri +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiKey +The OpenAI API key as a secure string. + +```yaml +Type: SecureString +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiType +The API provider. Agents API commands support OpenAI only. + +```yaml +Type: OpenAIApiType +Parameter Sets: (All) +Aliases: +Accepted values: OpenAI, Azure + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AuthType +The authentication type. Use openai for the Agents API. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: +Accepted values: openai, azure, azure_ad + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Limit +The maximum number of items to return in one page. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MaxRetryCount +The maximum number of retries for transient API failures. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Order +The order in which items are returned. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: +Accepted values: asc, desc + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Organization +The OpenAI organization ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: OrgId + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SessionId +The managed agent session ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: session_id + +Required: True +Position: 0 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubagentId +The session subagent ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TimeoutSec +The request timeout in seconds. Zero uses the module default. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProgressAction +Controls how PowerShell responds to progress updates. + +```yaml +Type: ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[OpenAI Agents API](https://developers.openai.com/api/reference/typescript/resources/beta/subresources/agents) diff --git a/Docs/Get-AgentSessionTurn.md b/Docs/Get-AgentSessionTurn.md new file mode 100644 index 0000000..dcbe821 --- /dev/null +++ b/Docs/Get-AgentSessionTurn.md @@ -0,0 +1,321 @@ +--- +external help file: PSOpenAI-help.xml +Module Name: PSOpenAI +online version: https://github.com/mkht/PSOpenAI/blob/v5/Docs/Get-AgentSessionTurn.md +schema: 2.0.0 +--- + +# Get-AgentSessionTurn + +## SYNOPSIS +Retrieves or lists turns from a session or subagent. + +## SYNTAX + +``` +Get-AgentSessionTurn [-SessionId] [[-SubagentId] ] [[-TurnId] ] [[-Limit] ] + [-All] [[-After] ] [[-Order] ] [[-TimeoutSec] ] [[-MaxRetryCount] ] + [[-ApiType] ] [[-ApiBase] ] [[-AuthType] ] [[-ApiKey] ] + [[-Organization] ] [[-AdditionalQuery] ] [[-AdditionalHeaders] ] + [[-AdditionalBody] ] [-ProgressAction ] [] +``` + +## DESCRIPTION +Retrieves or lists turns from a session or subagent. This command uses the OpenAI Agents API public beta and sends the required `OpenAI-Beta: agents=v1` header. Nested, evolving request schemas are accepted through `-Body` where applicable. + +## EXAMPLES + +### Example 1 +```powershell +Get-AgentSessionTurn -SessionId 'session_123' -TurnId 'turn_123' +``` + +Retrieves a turn from a managed session. + +## PARAMETERS + +### -AdditionalBody +Additional JSON properties to merge into the request body. + +```yaml +Type: Object +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AdditionalHeaders +Additional HTTP headers to include in the request. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AdditionalQuery +Additional query parameters to include in the request. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -After +Cursor identifying the item after which to continue a cursor-based listing. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -All +Retrieves all available cursor-based pages. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiBase +The base URI for the OpenAI API. + +```yaml +Type: Uri +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiKey +The OpenAI API key as a secure string. + +```yaml +Type: SecureString +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiType +The API provider. Agents API commands support OpenAI only. + +```yaml +Type: OpenAIApiType +Parameter Sets: (All) +Aliases: +Accepted values: OpenAI, Azure + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AuthType +The authentication type. Use openai for the Agents API. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: +Accepted values: openai, azure, azure_ad + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Limit +The maximum number of items to return in one page. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MaxRetryCount +The maximum number of retries for transient API failures. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Order +The order in which items are returned. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: +Accepted values: asc, desc + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Organization +The OpenAI organization ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: OrgId + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SessionId +The managed agent session ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: session_id + +Required: True +Position: 0 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubagentId +The session subagent ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TimeoutSec +The request timeout in seconds. Zero uses the module default. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TurnId +The agent or subagent turn ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProgressAction +Controls how PowerShell responds to progress updates. + +```yaml +Type: ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[OpenAI Agents API](https://developers.openai.com/api/reference/typescript/resources/beta/subresources/agents) diff --git a/Docs/Get-AgentVault.md b/Docs/Get-AgentVault.md new file mode 100644 index 0000000..e0bbc7e --- /dev/null +++ b/Docs/Get-AgentVault.md @@ -0,0 +1,316 @@ +--- +external help file: PSOpenAI-help.xml +Module Name: PSOpenAI +online version: https://github.com/mkht/PSOpenAI/blob/v5/Docs/Get-AgentVault.md +schema: 2.0.0 +--- + +# Get-AgentVault + +## SYNOPSIS +Retrieves or lists agent credential vaults. + +## SYNTAX + +### List (Default) +``` +Get-AgentVault [[-Status] ] [[-Limit] ] [-All] [[-After] ] [[-Order] ] + [[-TimeoutSec] ] [[-MaxRetryCount] ] [[-ApiType] ] [[-ApiBase] ] + [[-AuthType] ] [[-ApiKey] ] [[-Organization] ] + [[-AdditionalQuery] ] [[-AdditionalHeaders] ] [[-AdditionalBody] ] + [-ProgressAction ] [] +``` + +### Get +``` +Get-AgentVault [-VaultId] [[-TimeoutSec] ] [[-MaxRetryCount] ] + [[-ApiType] ] [[-ApiBase] ] [[-AuthType] ] [[-ApiKey] ] + [[-Organization] ] [[-AdditionalQuery] ] [[-AdditionalHeaders] ] + [[-AdditionalBody] ] [-ProgressAction ] [] +``` + +## DESCRIPTION +Retrieves or lists agent credential vaults. This command uses the OpenAI Agents API public beta and sends the required `OpenAI-Beta: agents=v1` header. Nested, evolving request schemas are accepted through `-Body` where applicable. + +## EXAMPLES + +### Example 1 +```powershell +Get-AgentVault -VaultId 'vault_123' +``` + +Retrieves an agent vault by ID. + +## PARAMETERS + +### -AdditionalBody +Additional JSON properties to merge into the request body. + +```yaml +Type: Object +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AdditionalHeaders +Additional HTTP headers to include in the request. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AdditionalQuery +Additional query parameters to include in the request. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -After +Cursor identifying the item after which to continue a cursor-based listing. + +```yaml +Type: String +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -All +Retrieves all available cursor-based pages. + +```yaml +Type: SwitchParameter +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiBase +The base URI for the OpenAI API. + +```yaml +Type: Uri +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiKey +The OpenAI API key as a secure string. + +```yaml +Type: SecureString +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiType +The API provider. Agents API commands support OpenAI only. + +```yaml +Type: OpenAIApiType +Parameter Sets: (All) +Aliases: +Accepted values: OpenAI, Azure + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AuthType +The authentication type. Use openai for the Agents API. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: +Accepted values: openai, azure, azure_ad + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Limit +The maximum number of items to return in one page. + +```yaml +Type: Int32 +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MaxRetryCount +The maximum number of retries for transient API failures. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Order +The order in which items are returned. + +```yaml +Type: String +Parameter Sets: List +Aliases: +Accepted values: asc, desc + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Organization +The OpenAI organization ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: OrgId + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Status +One or more lifecycle statuses used to filter results. + +```yaml +Type: String[] +Parameter Sets: List +Aliases: +Accepted values: active, archived + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TimeoutSec +The request timeout in seconds. Zero uses the module default. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -VaultId +The agent vault ID. + +```yaml +Type: String +Parameter Sets: Get +Aliases: vault_id + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -ProgressAction +Controls how PowerShell responds to progress updates. + +```yaml +Type: ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[OpenAI Agents API](https://developers.openai.com/api/reference/typescript/resources/beta/subresources/agents) diff --git a/Docs/Get-AgentVaultCredential.md b/Docs/Get-AgentVaultCredential.md new file mode 100644 index 0000000..ee44e91 --- /dev/null +++ b/Docs/Get-AgentVaultCredential.md @@ -0,0 +1,323 @@ +--- +external help file: PSOpenAI-help.xml +Module Name: PSOpenAI +online version: https://github.com/mkht/PSOpenAI/blob/v5/Docs/Get-AgentVaultCredential.md +schema: 2.0.0 +--- + +# Get-AgentVaultCredential + +## SYNOPSIS +Retrieves or lists credentials in an agent vault. + +## SYNTAX + +``` +Get-AgentVaultCredential [-VaultId] [[-CredentialId] ] [[-Status] ] + [[-Limit] ] [-All] [[-After] ] [[-Order] ] [[-TimeoutSec] ] + [[-MaxRetryCount] ] [[-ApiType] ] [[-ApiBase] ] [[-AuthType] ] + [[-ApiKey] ] [[-Organization] ] [[-AdditionalQuery] ] + [[-AdditionalHeaders] ] [[-AdditionalBody] ] [-ProgressAction ] + [] +``` + +## DESCRIPTION +Retrieves or lists credentials in an agent vault. This command uses the OpenAI Agents API public beta and sends the required `OpenAI-Beta: agents=v1` header. Nested, evolving request schemas are accepted through `-Body` where applicable. + +## EXAMPLES + +### Example 1 +```powershell +Get-AgentVaultCredential -VaultId 'vault_123' -CredentialId 'credential_123' +``` + +Retrieves non-secret metadata for a vault credential. + +## PARAMETERS + +### -AdditionalBody +Additional JSON properties to merge into the request body. + +```yaml +Type: Object +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AdditionalHeaders +Additional HTTP headers to include in the request. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AdditionalQuery +Additional query parameters to include in the request. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -After +Cursor identifying the item after which to continue a cursor-based listing. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -All +Retrieves all available cursor-based pages. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiBase +The base URI for the OpenAI API. + +```yaml +Type: Uri +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiKey +The OpenAI API key as a secure string. + +```yaml +Type: SecureString +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiType +The API provider. Agents API commands support OpenAI only. + +```yaml +Type: OpenAIApiType +Parameter Sets: (All) +Aliases: +Accepted values: OpenAI, Azure + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AuthType +The authentication type. Use openai for the Agents API. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: +Accepted values: openai, azure, azure_ad + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -CredentialId +The vault credential ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Limit +The maximum number of items to return in one page. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MaxRetryCount +The maximum number of retries for transient API failures. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Order +The order in which items are returned. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: +Accepted values: asc, desc + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Organization +The OpenAI organization ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: OrgId + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Status +One or more lifecycle statuses used to filter results. + +```yaml +Type: String[] +Parameter Sets: (All) +Aliases: +Accepted values: active, archived + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TimeoutSec +The request timeout in seconds. Zero uses the module default. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -VaultId +The agent vault ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: vault_id + +Required: True +Position: 0 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProgressAction +Controls how PowerShell responds to progress updates. + +```yaml +Type: ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[OpenAI Agents API](https://developers.openai.com/api/reference/typescript/resources/beta/subresources/agents) diff --git a/Docs/New-Agent.md b/Docs/New-Agent.md new file mode 100644 index 0000000..c273ba6 --- /dev/null +++ b/Docs/New-Agent.md @@ -0,0 +1,229 @@ +--- +external help file: PSOpenAI-help.xml +Module Name: PSOpenAI +online version: https://github.com/mkht/PSOpenAI/blob/v5/Docs/New-Agent.md +schema: 2.0.0 +--- + +# New-Agent + +## SYNOPSIS +Creates a reusable agent. + +## SYNTAX + +``` +New-Agent [-Body] [[-TimeoutSec] ] [[-MaxRetryCount] ] [[-ApiType] ] + [[-ApiBase] ] [[-AuthType] ] [[-ApiKey] ] [[-Organization] ] + [[-AdditionalQuery] ] [[-AdditionalHeaders] ] [[-AdditionalBody] ] + [-ProgressAction ] [] +``` + +## DESCRIPTION +Creates a reusable agent. This command uses the OpenAI Agents API public beta and sends the required `OpenAI-Beta: agents=v1` header. Nested, evolving request schemas are accepted through `-Body` where applicable. + +## EXAMPLES + +### Example 1 +```powershell +New-Agent -Body @{ model = 'gpt-5.6'; name = 'Repository assistant' } +``` + +Creates a reusable agent configuration. + +## PARAMETERS + +### -AdditionalBody +Additional JSON properties to merge into the request body. + +```yaml +Type: Object +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AdditionalHeaders +Additional HTTP headers to include in the request. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AdditionalQuery +Additional query parameters to include in the request. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiBase +The base URI for the OpenAI API. + +```yaml +Type: Uri +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiKey +The OpenAI API key as a secure string. + +```yaml +Type: SecureString +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiType +The API provider. Agents API commands support OpenAI only. + +```yaml +Type: OpenAIApiType +Parameter Sets: (All) +Aliases: +Accepted values: OpenAI, Azure + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AuthType +The authentication type. Use openai for the Agents API. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: +Accepted values: openai, azure, azure_ad + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Body +The request body as a dictionary. Use the fields defined by the corresponding OpenAI Agents API operation. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MaxRetryCount +The maximum number of retries for transient API failures. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Organization +The OpenAI organization ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: OrgId + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TimeoutSec +The request timeout in seconds. Zero uses the module default. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProgressAction +Controls how PowerShell responds to progress updates. + +```yaml +Type: ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[OpenAI Agents API](https://developers.openai.com/api/reference/typescript/resources/beta/subresources/agents) diff --git a/Docs/New-AgentEnvironmentTemplate.md b/Docs/New-AgentEnvironmentTemplate.md new file mode 100644 index 0000000..1ef9185 --- /dev/null +++ b/Docs/New-AgentEnvironmentTemplate.md @@ -0,0 +1,229 @@ +--- +external help file: PSOpenAI-help.xml +Module Name: PSOpenAI +online version: https://github.com/mkht/PSOpenAI/blob/v5/Docs/New-AgentEnvironmentTemplate.md +schema: 2.0.0 +--- + +# New-AgentEnvironmentTemplate + +## SYNOPSIS +Creates a reusable agent environment template. + +## SYNTAX + +``` +New-AgentEnvironmentTemplate [[-Body] ] [[-TimeoutSec] ] [[-MaxRetryCount] ] + [[-ApiType] ] [[-ApiBase] ] [[-AuthType] ] [[-ApiKey] ] + [[-Organization] ] [[-AdditionalQuery] ] [[-AdditionalHeaders] ] + [[-AdditionalBody] ] [-ProgressAction ] [] +``` + +## DESCRIPTION +Creates a reusable agent environment template. This command uses the OpenAI Agents API public beta and sends the required `OpenAI-Beta: agents=v1` header. Nested, evolving request schemas are accepted through `-Body` where applicable. + +## EXAMPLES + +### Example 1 +```powershell +New-AgentEnvironmentTemplate -Body @{ name = 'Development environment' } +``` + +Creates a reusable hosted environment template. + +## PARAMETERS + +### -AdditionalBody +Additional JSON properties to merge into the request body. + +```yaml +Type: Object +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AdditionalHeaders +Additional HTTP headers to include in the request. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AdditionalQuery +Additional query parameters to include in the request. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiBase +The base URI for the OpenAI API. + +```yaml +Type: Uri +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiKey +The OpenAI API key as a secure string. + +```yaml +Type: SecureString +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiType +The API provider. Agents API commands support OpenAI only. + +```yaml +Type: OpenAIApiType +Parameter Sets: (All) +Aliases: +Accepted values: OpenAI, Azure + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AuthType +The authentication type. Use openai for the Agents API. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: +Accepted values: openai, azure, azure_ad + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Body +The request body as a dictionary. Use the fields defined by the corresponding OpenAI Agents API operation. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: 0 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MaxRetryCount +The maximum number of retries for transient API failures. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Organization +The OpenAI organization ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: OrgId + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TimeoutSec +The request timeout in seconds. Zero uses the module default. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProgressAction +Controls how PowerShell responds to progress updates. + +```yaml +Type: ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[OpenAI Agents API](https://developers.openai.com/api/reference/typescript/resources/beta/subresources/agents) diff --git a/Docs/New-AgentSession.md b/Docs/New-AgentSession.md new file mode 100644 index 0000000..dcef29a --- /dev/null +++ b/Docs/New-AgentSession.md @@ -0,0 +1,244 @@ +--- +external help file: PSOpenAI-help.xml +Module Name: PSOpenAI +online version: https://github.com/mkht/PSOpenAI/blob/v5/Docs/New-AgentSession.md +schema: 2.0.0 +--- + +# New-AgentSession + +## SYNOPSIS +Creates an agent session, optionally returning streamed events. + +## SYNTAX + +``` +New-AgentSession [-Body] [-Stream] [[-TimeoutSec] ] [[-MaxRetryCount] ] + [[-ApiType] ] [[-ApiBase] ] [[-AuthType] ] [[-ApiKey] ] + [[-Organization] ] [[-AdditionalQuery] ] [[-AdditionalHeaders] ] + [[-AdditionalBody] ] [-ProgressAction ] [] +``` + +## DESCRIPTION +Creates an agent session, optionally returning streamed events. This command uses the OpenAI Agents API public beta and sends the required `OpenAI-Beta: agents=v1` header. Nested, evolving request schemas are accepted through `-Body` where applicable. + +## EXAMPLES + +### Example 1 +```powershell +New-AgentSession -Body @{ agent_id = 'agent_123'; environment = @{ type = 'none' }; input = 'Inspect this repository.' } +``` + +Creates a managed session and submits its initial user input. + +## PARAMETERS + +### -AdditionalBody +Additional JSON properties to merge into the request body. + +```yaml +Type: Object +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AdditionalHeaders +Additional HTTP headers to include in the request. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AdditionalQuery +Additional query parameters to include in the request. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiBase +The base URI for the OpenAI API. + +```yaml +Type: Uri +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiKey +The OpenAI API key as a secure string. + +```yaml +Type: SecureString +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiType +The API provider. Agents API commands support OpenAI only. + +```yaml +Type: OpenAIApiType +Parameter Sets: (All) +Aliases: +Accepted values: OpenAI, Azure + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AuthType +The authentication type. Use openai for the Agents API. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: +Accepted values: openai, azure, azure_ad + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Body +The request body as a dictionary. Use the fields defined by the corresponding OpenAI Agents API operation. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MaxRetryCount +The maximum number of retries for transient API failures. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Organization +The OpenAI organization ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: OrgId + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Stream +Streams agent session events using server-sent events. For session creation, this also sends stream=true in the request body. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TimeoutSec +The request timeout in seconds. Zero uses the module default. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProgressAction +Controls how PowerShell responds to progress updates. + +```yaml +Type: ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[OpenAI Agents API](https://developers.openai.com/api/reference/typescript/resources/beta/subresources/agents) diff --git a/Docs/New-AgentVault.md b/Docs/New-AgentVault.md new file mode 100644 index 0000000..eab8529 --- /dev/null +++ b/Docs/New-AgentVault.md @@ -0,0 +1,229 @@ +--- +external help file: PSOpenAI-help.xml +Module Name: PSOpenAI +online version: https://github.com/mkht/PSOpenAI/blob/v5/Docs/New-AgentVault.md +schema: 2.0.0 +--- + +# New-AgentVault + +## SYNOPSIS +Creates an agent credential vault. + +## SYNTAX + +``` +New-AgentVault [[-Body] ] [[-TimeoutSec] ] [[-MaxRetryCount] ] + [[-ApiType] ] [[-ApiBase] ] [[-AuthType] ] [[-ApiKey] ] + [[-Organization] ] [[-AdditionalQuery] ] [[-AdditionalHeaders] ] + [[-AdditionalBody] ] [-ProgressAction ] [] +``` + +## DESCRIPTION +Creates an agent credential vault. This command uses the OpenAI Agents API public beta and sends the required `OpenAI-Beta: agents=v1` header. Nested, evolving request schemas are accepted through `-Body` where applicable. + +## EXAMPLES + +### Example 1 +```powershell +New-AgentVault -Body @{ name = 'Agent credentials' } +``` + +Creates a vault for agent credentials. + +## PARAMETERS + +### -AdditionalBody +Additional JSON properties to merge into the request body. + +```yaml +Type: Object +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AdditionalHeaders +Additional HTTP headers to include in the request. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AdditionalQuery +Additional query parameters to include in the request. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiBase +The base URI for the OpenAI API. + +```yaml +Type: Uri +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiKey +The OpenAI API key as a secure string. + +```yaml +Type: SecureString +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiType +The API provider. Agents API commands support OpenAI only. + +```yaml +Type: OpenAIApiType +Parameter Sets: (All) +Aliases: +Accepted values: OpenAI, Azure + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AuthType +The authentication type. Use openai for the Agents API. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: +Accepted values: openai, azure, azure_ad + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Body +The request body as a dictionary. Use the fields defined by the corresponding OpenAI Agents API operation. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: 0 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MaxRetryCount +The maximum number of retries for transient API failures. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Organization +The OpenAI organization ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: OrgId + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TimeoutSec +The request timeout in seconds. Zero uses the module default. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProgressAction +Controls how PowerShell responds to progress updates. + +```yaml +Type: ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[OpenAI Agents API](https://developers.openai.com/api/reference/typescript/resources/beta/subresources/agents) diff --git a/Docs/New-AgentVaultCredential.md b/Docs/New-AgentVaultCredential.md new file mode 100644 index 0000000..ecb0074 --- /dev/null +++ b/Docs/New-AgentVaultCredential.md @@ -0,0 +1,245 @@ +--- +external help file: PSOpenAI-help.xml +Module Name: PSOpenAI +online version: https://github.com/mkht/PSOpenAI/blob/v5/Docs/New-AgentVaultCredential.md +schema: 2.0.0 +--- + +# New-AgentVaultCredential + +## SYNOPSIS +Creates a credential in an agent vault. + +## SYNTAX + +``` +New-AgentVaultCredential [-VaultId] [-Body] [[-TimeoutSec] ] + [[-MaxRetryCount] ] [[-ApiType] ] [[-ApiBase] ] [[-AuthType] ] + [[-ApiKey] ] [[-Organization] ] [[-AdditionalQuery] ] + [[-AdditionalHeaders] ] [[-AdditionalBody] ] [-ProgressAction ] + [] +``` + +## DESCRIPTION +Creates a credential in an agent vault. This command uses the OpenAI Agents API public beta and sends the required `OpenAI-Beta: agents=v1` header. Nested, evolving request schemas are accepted through `-Body` where applicable. + +## EXAMPLES + +### Example 1 +```powershell +New-AgentVaultCredential -VaultId 'vault_123' -Body @{ name = 'MCP token'; auth = @{ type = 'static_bearer'; token = ''; mcp_server_url = 'https://mcp.example.com' } } +``` + +Stores a write-only MCP bearer credential in a vault. + +## PARAMETERS + +### -AdditionalBody +Additional JSON properties to merge into the request body. + +```yaml +Type: Object +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AdditionalHeaders +Additional HTTP headers to include in the request. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AdditionalQuery +Additional query parameters to include in the request. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiBase +The base URI for the OpenAI API. + +```yaml +Type: Uri +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiKey +The OpenAI API key as a secure string. + +```yaml +Type: SecureString +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiType +The API provider. Agents API commands support OpenAI only. + +```yaml +Type: OpenAIApiType +Parameter Sets: (All) +Aliases: +Accepted values: OpenAI, Azure + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AuthType +The authentication type. Use openai for the Agents API. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: +Accepted values: openai, azure, azure_ad + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Body +The request body as a dictionary. Use the fields defined by the corresponding OpenAI Agents API operation. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MaxRetryCount +The maximum number of retries for transient API failures. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Organization +The OpenAI organization ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: OrgId + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TimeoutSec +The request timeout in seconds. Zero uses the module default. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -VaultId +The agent vault ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: vault_id + +Required: True +Position: 0 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProgressAction +Controls how PowerShell responds to progress updates. + +```yaml +Type: ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[OpenAI Agents API](https://developers.openai.com/api/reference/typescript/resources/beta/subresources/agents) diff --git a/Docs/Remove-Agent.md b/Docs/Remove-Agent.md new file mode 100644 index 0000000..cb30a71 --- /dev/null +++ b/Docs/Remove-Agent.md @@ -0,0 +1,259 @@ +--- +external help file: PSOpenAI-help.xml +Module Name: PSOpenAI +online version: https://github.com/mkht/PSOpenAI/blob/v5/Docs/Remove-Agent.md +schema: 2.0.0 +--- + +# Remove-Agent + +## SYNOPSIS +Deletes a reusable agent. + +## SYNTAX + +``` +Remove-Agent [-AgentId] [[-TimeoutSec] ] [[-MaxRetryCount] ] + [[-ApiType] ] [[-ApiBase] ] [[-AuthType] ] [[-ApiKey] ] + [[-Organization] ] [[-AdditionalQuery] ] [[-AdditionalHeaders] ] + [[-AdditionalBody] ] [-ProgressAction ] [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION +Deletes a reusable agent. This command uses the OpenAI Agents API public beta and sends the required `OpenAI-Beta: agents=v1` header. Nested, evolving request schemas are accepted through `-Body` where applicable. + +## EXAMPLES + +### Example 1 +```powershell +Remove-Agent -AgentId 'agent_123' -WhatIf +``` + +Shows what would happen when deleting the reusable agent. + +## PARAMETERS + +### -AdditionalBody +Additional JSON properties to merge into the request body. + +```yaml +Type: Object +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AdditionalHeaders +Additional HTTP headers to include in the request. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AdditionalQuery +Additional query parameters to include in the request. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AgentId +The reusable agent ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: agent_id + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -ApiBase +The base URI for the OpenAI API. + +```yaml +Type: Uri +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiKey +The OpenAI API key as a secure string. + +```yaml +Type: SecureString +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiType +The API provider. Agents API commands support OpenAI only. + +```yaml +Type: OpenAIApiType +Parameter Sets: (All) +Aliases: +Accepted values: OpenAI, Azure + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AuthType +The authentication type. Use openai for the Agents API. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: +Accepted values: openai, azure, azure_ad + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MaxRetryCount +The maximum number of retries for transient API failures. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Organization +The OpenAI organization ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: OrgId + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TimeoutSec +The request timeout in seconds. Zero uses the module default. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProgressAction +Controls how PowerShell responds to progress updates. + +```yaml +Type: ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[OpenAI Agents API](https://developers.openai.com/api/reference/typescript/resources/beta/subresources/agents) diff --git a/Docs/Remove-AgentEnvironmentTemplate.md b/Docs/Remove-AgentEnvironmentTemplate.md new file mode 100644 index 0000000..cd78575 --- /dev/null +++ b/Docs/Remove-AgentEnvironmentTemplate.md @@ -0,0 +1,260 @@ +--- +external help file: PSOpenAI-help.xml +Module Name: PSOpenAI +online version: https://github.com/mkht/PSOpenAI/blob/v5/Docs/Remove-AgentEnvironmentTemplate.md +schema: 2.0.0 +--- + +# Remove-AgentEnvironmentTemplate + +## SYNOPSIS +Deletes an agent environment template. + +## SYNTAX + +``` +Remove-AgentEnvironmentTemplate [-EnvironmentTemplateId] [[-TimeoutSec] ] + [[-MaxRetryCount] ] [[-ApiType] ] [[-ApiBase] ] [[-AuthType] ] + [[-ApiKey] ] [[-Organization] ] [[-AdditionalQuery] ] + [[-AdditionalHeaders] ] [[-AdditionalBody] ] [-ProgressAction ] + [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION +Deletes an agent environment template. This command uses the OpenAI Agents API public beta and sends the required `OpenAI-Beta: agents=v1` header. Nested, evolving request schemas are accepted through `-Body` where applicable. + +## EXAMPLES + +### Example 1 +```powershell +Remove-AgentEnvironmentTemplate -EnvironmentTemplateId 'envtpl_123' -WhatIf +``` + +Shows what would happen when deleting the environment template. + +## PARAMETERS + +### -AdditionalBody +Additional JSON properties to merge into the request body. + +```yaml +Type: Object +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AdditionalHeaders +Additional HTTP headers to include in the request. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AdditionalQuery +Additional query parameters to include in the request. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiBase +The base URI for the OpenAI API. + +```yaml +Type: Uri +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiKey +The OpenAI API key as a secure string. + +```yaml +Type: SecureString +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiType +The API provider. Agents API commands support OpenAI only. + +```yaml +Type: OpenAIApiType +Parameter Sets: (All) +Aliases: +Accepted values: OpenAI, Azure + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AuthType +The authentication type. Use openai for the Agents API. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: +Accepted values: openai, azure, azure_ad + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EnvironmentTemplateId +The reusable agent environment template ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: environment_template_id + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -MaxRetryCount +The maximum number of retries for transient API failures. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Organization +The OpenAI organization ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: OrgId + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TimeoutSec +The request timeout in seconds. Zero uses the module default. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProgressAction +Controls how PowerShell responds to progress updates. + +```yaml +Type: ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[OpenAI Agents API](https://developers.openai.com/api/reference/typescript/resources/beta/subresources/agents) diff --git a/Docs/Remove-AgentSession.md b/Docs/Remove-AgentSession.md new file mode 100644 index 0000000..d1513e4 --- /dev/null +++ b/Docs/Remove-AgentSession.md @@ -0,0 +1,259 @@ +--- +external help file: PSOpenAI-help.xml +Module Name: PSOpenAI +online version: https://github.com/mkht/PSOpenAI/blob/v5/Docs/Remove-AgentSession.md +schema: 2.0.0 +--- + +# Remove-AgentSession + +## SYNOPSIS +Deletes an agent session. + +## SYNTAX + +``` +Remove-AgentSession [-SessionId] [[-TimeoutSec] ] [[-MaxRetryCount] ] + [[-ApiType] ] [[-ApiBase] ] [[-AuthType] ] [[-ApiKey] ] + [[-Organization] ] [[-AdditionalQuery] ] [[-AdditionalHeaders] ] + [[-AdditionalBody] ] [-ProgressAction ] [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION +Deletes an agent session. This command uses the OpenAI Agents API public beta and sends the required `OpenAI-Beta: agents=v1` header. Nested, evolving request schemas are accepted through `-Body` where applicable. + +## EXAMPLES + +### Example 1 +```powershell +Remove-AgentSession -SessionId 'session_123' -WhatIf +``` + +Shows what would happen when deleting the managed session. + +## PARAMETERS + +### -AdditionalBody +Additional JSON properties to merge into the request body. + +```yaml +Type: Object +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AdditionalHeaders +Additional HTTP headers to include in the request. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AdditionalQuery +Additional query parameters to include in the request. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiBase +The base URI for the OpenAI API. + +```yaml +Type: Uri +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiKey +The OpenAI API key as a secure string. + +```yaml +Type: SecureString +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiType +The API provider. Agents API commands support OpenAI only. + +```yaml +Type: OpenAIApiType +Parameter Sets: (All) +Aliases: +Accepted values: OpenAI, Azure + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AuthType +The authentication type. Use openai for the Agents API. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: +Accepted values: openai, azure, azure_ad + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MaxRetryCount +The maximum number of retries for transient API failures. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Organization +The OpenAI organization ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: OrgId + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SessionId +The managed agent session ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: session_id + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -TimeoutSec +The request timeout in seconds. Zero uses the module default. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProgressAction +Controls how PowerShell responds to progress updates. + +```yaml +Type: ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[OpenAI Agents API](https://developers.openai.com/api/reference/typescript/resources/beta/subresources/agents) diff --git a/Docs/Remove-AgentSessionArtifact.md b/Docs/Remove-AgentSessionArtifact.md new file mode 100644 index 0000000..62599ce --- /dev/null +++ b/Docs/Remove-AgentSessionArtifact.md @@ -0,0 +1,275 @@ +--- +external help file: PSOpenAI-help.xml +Module Name: PSOpenAI +online version: https://github.com/mkht/PSOpenAI/blob/v5/Docs/Remove-AgentSessionArtifact.md +schema: 2.0.0 +--- + +# Remove-AgentSessionArtifact + +## SYNOPSIS +Deletes an immutable session artifact. + +## SYNTAX + +``` +Remove-AgentSessionArtifact [-SessionId] [-ArtifactId] [[-TimeoutSec] ] + [[-MaxRetryCount] ] [[-ApiType] ] [[-ApiBase] ] [[-AuthType] ] + [[-ApiKey] ] [[-Organization] ] [[-AdditionalQuery] ] + [[-AdditionalHeaders] ] [[-AdditionalBody] ] [-ProgressAction ] + [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION +Deletes an immutable session artifact. This command uses the OpenAI Agents API public beta and sends the required `OpenAI-Beta: agents=v1` header. Nested, evolving request schemas are accepted through `-Body` where applicable. + +## EXAMPLES + +### Example 1 +```powershell +Remove-AgentSessionArtifact -SessionId 'session_123' -ArtifactId 'artifact_123' -WhatIf +``` + +Shows what would happen when deleting the session artifact. + +## PARAMETERS + +### -AdditionalBody +Additional JSON properties to merge into the request body. + +```yaml +Type: Object +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AdditionalHeaders +Additional HTTP headers to include in the request. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AdditionalQuery +Additional query parameters to include in the request. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiBase +The base URI for the OpenAI API. + +```yaml +Type: Uri +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiKey +The OpenAI API key as a secure string. + +```yaml +Type: SecureString +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiType +The API provider. Agents API commands support OpenAI only. + +```yaml +Type: OpenAIApiType +Parameter Sets: (All) +Aliases: +Accepted values: OpenAI, Azure + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ArtifactId +The session artifact ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: artifact_id + +Required: True +Position: 1 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -AuthType +The authentication type. Use openai for the Agents API. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: +Accepted values: openai, azure, azure_ad + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MaxRetryCount +The maximum number of retries for transient API failures. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Organization +The OpenAI organization ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: OrgId + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SessionId +The managed agent session ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: session_id + +Required: True +Position: 0 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TimeoutSec +The request timeout in seconds. Zero uses the module default. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProgressAction +Controls how PowerShell responds to progress updates. + +```yaml +Type: ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[OpenAI Agents API](https://developers.openai.com/api/reference/typescript/resources/beta/subresources/agents) diff --git a/Docs/Remove-AgentVault.md b/Docs/Remove-AgentVault.md new file mode 100644 index 0000000..176d7f3 --- /dev/null +++ b/Docs/Remove-AgentVault.md @@ -0,0 +1,259 @@ +--- +external help file: PSOpenAI-help.xml +Module Name: PSOpenAI +online version: https://github.com/mkht/PSOpenAI/blob/v5/Docs/Remove-AgentVault.md +schema: 2.0.0 +--- + +# Remove-AgentVault + +## SYNOPSIS +Deletes an agent credential vault. + +## SYNTAX + +``` +Remove-AgentVault [-VaultId] [[-TimeoutSec] ] [[-MaxRetryCount] ] + [[-ApiType] ] [[-ApiBase] ] [[-AuthType] ] [[-ApiKey] ] + [[-Organization] ] [[-AdditionalQuery] ] [[-AdditionalHeaders] ] + [[-AdditionalBody] ] [-ProgressAction ] [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION +Deletes an agent credential vault. This command uses the OpenAI Agents API public beta and sends the required `OpenAI-Beta: agents=v1` header. Nested, evolving request schemas are accepted through `-Body` where applicable. + +## EXAMPLES + +### Example 1 +```powershell +Remove-AgentVault -VaultId 'vault_123' -WhatIf +``` + +Shows what would happen when deleting the vault. + +## PARAMETERS + +### -AdditionalBody +Additional JSON properties to merge into the request body. + +```yaml +Type: Object +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AdditionalHeaders +Additional HTTP headers to include in the request. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AdditionalQuery +Additional query parameters to include in the request. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiBase +The base URI for the OpenAI API. + +```yaml +Type: Uri +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiKey +The OpenAI API key as a secure string. + +```yaml +Type: SecureString +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiType +The API provider. Agents API commands support OpenAI only. + +```yaml +Type: OpenAIApiType +Parameter Sets: (All) +Aliases: +Accepted values: OpenAI, Azure + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AuthType +The authentication type. Use openai for the Agents API. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: +Accepted values: openai, azure, azure_ad + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MaxRetryCount +The maximum number of retries for transient API failures. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Organization +The OpenAI organization ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: OrgId + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TimeoutSec +The request timeout in seconds. Zero uses the module default. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -VaultId +The agent vault ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: vault_id + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProgressAction +Controls how PowerShell responds to progress updates. + +```yaml +Type: ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[OpenAI Agents API](https://developers.openai.com/api/reference/typescript/resources/beta/subresources/agents) diff --git a/Docs/Remove-AgentVaultCredential.md b/Docs/Remove-AgentVaultCredential.md new file mode 100644 index 0000000..ef94919 --- /dev/null +++ b/Docs/Remove-AgentVaultCredential.md @@ -0,0 +1,275 @@ +--- +external help file: PSOpenAI-help.xml +Module Name: PSOpenAI +online version: https://github.com/mkht/PSOpenAI/blob/v5/Docs/Remove-AgentVaultCredential.md +schema: 2.0.0 +--- + +# Remove-AgentVaultCredential + +## SYNOPSIS +Deletes a credential from an agent vault. + +## SYNTAX + +``` +Remove-AgentVaultCredential [-VaultId] [-CredentialId] [[-TimeoutSec] ] + [[-MaxRetryCount] ] [[-ApiType] ] [[-ApiBase] ] [[-AuthType] ] + [[-ApiKey] ] [[-Organization] ] [[-AdditionalQuery] ] + [[-AdditionalHeaders] ] [[-AdditionalBody] ] [-ProgressAction ] + [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION +Deletes a credential from an agent vault. This command uses the OpenAI Agents API public beta and sends the required `OpenAI-Beta: agents=v1` header. Nested, evolving request schemas are accepted through `-Body` where applicable. + +## EXAMPLES + +### Example 1 +```powershell +Remove-AgentVaultCredential -VaultId 'vault_123' -CredentialId 'credential_123' -WhatIf +``` + +Shows what would happen when deleting the vault credential. + +## PARAMETERS + +### -AdditionalBody +Additional JSON properties to merge into the request body. + +```yaml +Type: Object +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AdditionalHeaders +Additional HTTP headers to include in the request. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AdditionalQuery +Additional query parameters to include in the request. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiBase +The base URI for the OpenAI API. + +```yaml +Type: Uri +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiKey +The OpenAI API key as a secure string. + +```yaml +Type: SecureString +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiType +The API provider. Agents API commands support OpenAI only. + +```yaml +Type: OpenAIApiType +Parameter Sets: (All) +Aliases: +Accepted values: OpenAI, Azure + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AuthType +The authentication type. Use openai for the Agents API. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: +Accepted values: openai, azure, azure_ad + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -CredentialId +The vault credential ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: credential_id + +Required: True +Position: 1 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -MaxRetryCount +The maximum number of retries for transient API failures. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Organization +The OpenAI organization ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: OrgId + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TimeoutSec +The request timeout in seconds. Zero uses the module default. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -VaultId +The agent vault ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: vault_id + +Required: True +Position: 0 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProgressAction +Controls how PowerShell responds to progress updates. + +```yaml +Type: ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[OpenAI Agents API](https://developers.openai.com/api/reference/typescript/resources/beta/subresources/agents) diff --git a/Docs/Request-ImageEdit.md b/Docs/Request-ImageEdit.md index f565ecb..188d609 100644 --- a/Docs/Request-ImageEdit.md +++ b/Docs/Request-ImageEdit.md @@ -122,7 +122,7 @@ Position: Named ``` ### -Model -The model to use for image generation. Defaults to `gpt-image-2`. +The model to use for image generation. Defaults to `gpt-image-2`. GPT Image 2.5 models include `gpt-image-2.5-sunburst`, `gpt-image-2.5-flare`, and their `2026-09-08` snapshots. ```yaml Type: String @@ -144,7 +144,7 @@ Default value: 1 ### -Quality The quality of the image that will be generated. - `auto` (default value) will automatically select the best quality for the given model. -- `high`, `medium` and `low` are supported for the GPT image models. +- `max`, `xhigh`, `high`, `medium`, and `low` are accepted subject to model support. ```yaml Type: String @@ -154,7 +154,7 @@ Default value: auto ``` ### -Size -The size of the generated images. Must be one of `1024x1024`, `1536x1024` (landscape), `1024x1536` (portrait), or `auto` (default value) for the GPT image models, and one of `256x256`, `512x512`, or `1024x1024` for dall-e-2, and one of `1024x1024`, `1792x1024`, or `1024x1792` for `dall-e-3`. +The size of the generated images. GPT Image 2 and GPT Image 2.5 accept arbitrary supported `WIDTHxHEIGHT` resolutions or `auto`. Older image models support their documented fixed sizes. ```yaml Type: String diff --git a/Docs/Request-ImageGeneration.md b/Docs/Request-ImageGeneration.md index 2299c86..a1e0367 100644 --- a/Docs/Request-ImageGeneration.md +++ b/Docs/Request-ImageGeneration.md @@ -95,7 +95,7 @@ Accept pipeline input: True (ByValue) ``` ### -Model -The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or a GPT image model. Defaults to `dall-e-2` unless a parameter specific to the GPT image models is used. +The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or a GPT image model. GPT Image 2.5 models include `gpt-image-2.5-sunburst`, `gpt-image-2.5-flare`, and their `2026-09-08` snapshots. Defaults to `dall-e-2` unless a parameter specific to the GPT image models is used. ```yaml Type: String @@ -116,7 +116,7 @@ Default value: 1 ``` ### -Size -The size of the generated images. Must be one of `1024x1024`, `1536x1024` (landscape), `1024x1536` (portrait), or `auto` (default value) for the GPT image models, one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`, and one of `1024x1024`, `1792x1024`, or `1024x1792` for `dall-e-3`. +The size of the generated images. GPT Image 2 and GPT Image 2.5 accept arbitrary supported `WIDTHxHEIGHT` resolutions or `auto`. Older image models support their documented fixed sizes. ```yaml Type: String @@ -128,7 +128,7 @@ Default value: auto ### -Quality The quality of the image that will be generated. - `auto` (default value) will automatically select the best quality for the given model. -- `high`, `medium` and `low` are supported for the GPT image models. +- `max`, `xhigh`, `high`, `medium`, and `low` are accepted subject to model support. ```yaml Type: String diff --git a/Docs/Request-Response.md b/Docs/Request-Response.md index bd61a57..5ea73af 100644 --- a/Docs/Request-Response.md +++ b/Docs/Request-Response.md @@ -55,6 +55,7 @@ Request-Response [-UseRemoteMCPTool] [-RemoteMCPServerLabel ] [-RemoteMCPServerUrl ] + [-RemoteMCPTunnelId ] [-RemoteMCPServerDescription ] [-RemoteMCPAllowedTools ] [-RemoteMCPRequireApproval ] @@ -107,6 +108,8 @@ Request-Response [-PromptCacheKey ] [-PromptCacheMode ] [-PromptCacheTtl ] + [-PromptCacheComparisonResponseId ] + [-PromptCachePrewarm] [-PromptCacheRetention ] [-SafetyIdentifier ] [-User ] @@ -535,7 +538,16 @@ Position: Named ``` ### -RemoteMCPServerUrl -The URL for the MCP server. +The URL for the MCP server. Specify either this parameter or `-RemoteMCPTunnelId`. + +```yaml +Type: String +Required: False +Position: Named +``` + +### -RemoteMCPTunnelId +The ID of a secure MCP tunnel. Specify either this parameter or `-RemoteMCPServerUrl`. ```yaml Type: String @@ -607,7 +619,9 @@ Position: Named ``` ### -ConnectorId -The ID of the connector. Supported connector id values are: +Deprecated for models released after September 1, 2026. Use a remote MCP server URL or secure tunnel instead. The parameter remains available for compatibility with earlier models. + +The supported connector ID values are: - Dropbox: `connector_dropbox` - Gmail: `connector_gmail` - Google Calendar: `connector_googlecalendar` @@ -688,7 +702,7 @@ Position: Named ``` ### -ImageGenerationModel -The image generation model to use. Default: `gpt-image-1`. +The image generation model to use. GPT Image 2.5 models include `gpt-image-2.5-sunburst`, `gpt-image-2.5-flare`, and their `2026-09-08` snapshots. ```yaml Type: String @@ -764,7 +778,7 @@ Position: Named ``` ### -ImageGenerationQuality -The quality of the generated image. One of `low`, `medium`, `high`, or `auto`. +The quality of the generated image. One of `low`, `medium`, `high`, `xhigh`, `max`, or `auto`, subject to model support. ```yaml Type: String @@ -774,7 +788,7 @@ Default value: auto ``` ### -ImageGenerationSize -The size of the generated image. One of `1024x1024`, `1024x1536`, `1536x1024`, or `auto`. Default: `auto`. +The size of the generated image. Use `auto` or a `WIDTHxHEIGHT` value supported by the selected image model. GPT Image 2 and GPT Image 2.5 accept arbitrary supported resolutions. ```yaml Type: String @@ -1044,6 +1058,26 @@ Required: False Position: Named ``` +### -PromptCacheComparisonResponseId +The response ID to compare against when producing prompt cache diagnostics. + +```yaml +Type: String +Aliases: prompt_cache_options.comparison_response_id +Required: False +Position: Named +``` + +### -PromptCachePrewarm +Prepares the prompt cache without generating output. The option is sent to the server as `prompt_cache_options.prewarm`. + +```yaml +Type: SwitchParameter +Aliases: prompt_cache_options.prewarm +Required: False +Position: Named +``` + ### -PromptCacheRetention Deprecated. Use `-PromptCacheTtl` instead. diff --git a/Docs/Request-ResponseCompaction.md b/Docs/Request-ResponseCompaction.md index d0732f4..29d6b56 100644 --- a/Docs/Request-ResponseCompaction.md +++ b/Docs/Request-ResponseCompaction.md @@ -28,6 +28,8 @@ Request-ResponseCompaction [-PromptCacheKey ] [-PromptCacheMode ] [-PromptCacheTtl ] + [-PromptCacheComparisonResponseId ] + [-PromptCachePrewarm] [-OutputRawResponse] [-Organization ] [-TimeoutSec ] @@ -181,6 +183,26 @@ Required: False Position: Named ``` +### -PromptCacheComparisonResponseId +The response ID to compare against when producing prompt cache diagnostics. + +```yaml +Type: String +Aliases: prompt_cache_options.comparison_response_id +Required: False +Position: Named +``` + +### -PromptCachePrewarm +Prepares the prompt cache without generating output. The option is sent to the server as `prompt_cache_options.prewarm`. + +```yaml +Type: SwitchParameter +Aliases: prompt_cache_options.prewarm +Required: False +Position: Named +``` + ### -OutputRawResponse If specifies this switch, an output of this function to be a raw response value from the API. (Normally JSON formatted string.) diff --git a/Docs/Set-Agent.md b/Docs/Set-Agent.md new file mode 100644 index 0000000..5599355 --- /dev/null +++ b/Docs/Set-Agent.md @@ -0,0 +1,274 @@ +--- +external help file: PSOpenAI-help.xml +Module Name: PSOpenAI +online version: https://github.com/mkht/PSOpenAI/blob/v5/Docs/Set-Agent.md +schema: 2.0.0 +--- + +# Set-Agent + +## SYNOPSIS +Updates a reusable agent. + +## SYNTAX + +``` +Set-Agent [-AgentId] [-Body] [[-TimeoutSec] ] [[-MaxRetryCount] ] + [[-ApiType] ] [[-ApiBase] ] [[-AuthType] ] [[-ApiKey] ] + [[-Organization] ] [[-AdditionalQuery] ] [[-AdditionalHeaders] ] + [[-AdditionalBody] ] [-ProgressAction ] [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION +Updates a reusable agent. This command uses the OpenAI Agents API public beta and sends the required `OpenAI-Beta: agents=v1` header. Nested, evolving request schemas are accepted through `-Body` where applicable. + +## EXAMPLES + +### Example 1 +```powershell +Set-Agent -AgentId 'agent_123' -Body @{ instructions = 'Review PowerShell code.' } +``` + +Updates a reusable agent configuration. + +## PARAMETERS + +### -AdditionalBody +Additional JSON properties to merge into the request body. + +```yaml +Type: Object +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AdditionalHeaders +Additional HTTP headers to include in the request. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AdditionalQuery +Additional query parameters to include in the request. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AgentId +The reusable agent ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: agent_id + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -ApiBase +The base URI for the OpenAI API. + +```yaml +Type: Uri +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiKey +The OpenAI API key as a secure string. + +```yaml +Type: SecureString +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiType +The API provider. Agents API commands support OpenAI only. + +```yaml +Type: OpenAIApiType +Parameter Sets: (All) +Aliases: +Accepted values: OpenAI, Azure + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AuthType +The authentication type. Use openai for the Agents API. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: +Accepted values: openai, azure, azure_ad + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Body +The request body as a dictionary. Use the fields defined by the corresponding OpenAI Agents API operation. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MaxRetryCount +The maximum number of retries for transient API failures. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Organization +The OpenAI organization ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: OrgId + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TimeoutSec +The request timeout in seconds. Zero uses the module default. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProgressAction +Controls how PowerShell responds to progress updates. + +```yaml +Type: ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[OpenAI Agents API](https://developers.openai.com/api/reference/typescript/resources/beta/subresources/agents) diff --git a/Docs/Set-AgentEnvironmentTemplate.md b/Docs/Set-AgentEnvironmentTemplate.md new file mode 100644 index 0000000..01d160a --- /dev/null +++ b/Docs/Set-AgentEnvironmentTemplate.md @@ -0,0 +1,275 @@ +--- +external help file: PSOpenAI-help.xml +Module Name: PSOpenAI +online version: https://github.com/mkht/PSOpenAI/blob/v5/Docs/Set-AgentEnvironmentTemplate.md +schema: 2.0.0 +--- + +# Set-AgentEnvironmentTemplate + +## SYNOPSIS +Updates an agent environment template. + +## SYNTAX + +``` +Set-AgentEnvironmentTemplate [-EnvironmentTemplateId] [-Body] [[-TimeoutSec] ] + [[-MaxRetryCount] ] [[-ApiType] ] [[-ApiBase] ] [[-AuthType] ] + [[-ApiKey] ] [[-Organization] ] [[-AdditionalQuery] ] + [[-AdditionalHeaders] ] [[-AdditionalBody] ] [-ProgressAction ] + [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION +Updates an agent environment template. This command uses the OpenAI Agents API public beta and sends the required `OpenAI-Beta: agents=v1` header. Nested, evolving request schemas are accepted through `-Body` where applicable. + +## EXAMPLES + +### Example 1 +```powershell +Set-AgentEnvironmentTemplate -EnvironmentTemplateId 'envtpl_123' -Body @{ name = 'Updated environment' } +``` + +Updates a reusable environment template. + +## PARAMETERS + +### -AdditionalBody +Additional JSON properties to merge into the request body. + +```yaml +Type: Object +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AdditionalHeaders +Additional HTTP headers to include in the request. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AdditionalQuery +Additional query parameters to include in the request. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiBase +The base URI for the OpenAI API. + +```yaml +Type: Uri +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiKey +The OpenAI API key as a secure string. + +```yaml +Type: SecureString +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiType +The API provider. Agents API commands support OpenAI only. + +```yaml +Type: OpenAIApiType +Parameter Sets: (All) +Aliases: +Accepted values: OpenAI, Azure + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AuthType +The authentication type. Use openai for the Agents API. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: +Accepted values: openai, azure, azure_ad + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Body +The request body as a dictionary. Use the fields defined by the corresponding OpenAI Agents API operation. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EnvironmentTemplateId +The reusable agent environment template ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: environment_template_id + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -MaxRetryCount +The maximum number of retries for transient API failures. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Organization +The OpenAI organization ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: OrgId + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TimeoutSec +The request timeout in seconds. Zero uses the module default. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProgressAction +Controls how PowerShell responds to progress updates. + +```yaml +Type: ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[OpenAI Agents API](https://developers.openai.com/api/reference/typescript/resources/beta/subresources/agents) diff --git a/Docs/Set-AgentSession.md b/Docs/Set-AgentSession.md new file mode 100644 index 0000000..64ed972 --- /dev/null +++ b/Docs/Set-AgentSession.md @@ -0,0 +1,274 @@ +--- +external help file: PSOpenAI-help.xml +Module Name: PSOpenAI +online version: https://github.com/mkht/PSOpenAI/blob/v5/Docs/Set-AgentSession.md +schema: 2.0.0 +--- + +# Set-AgentSession + +## SYNOPSIS +Updates an agent session. + +## SYNTAX + +``` +Set-AgentSession [-SessionId] [-Body] [[-TimeoutSec] ] [[-MaxRetryCount] ] + [[-ApiType] ] [[-ApiBase] ] [[-AuthType] ] [[-ApiKey] ] + [[-Organization] ] [[-AdditionalQuery] ] [[-AdditionalHeaders] ] + [[-AdditionalBody] ] [-ProgressAction ] [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION +Updates an agent session. This command uses the OpenAI Agents API public beta and sends the required `OpenAI-Beta: agents=v1` header. Nested, evolving request schemas are accepted through `-Body` where applicable. + +## EXAMPLES + +### Example 1 +```powershell +Set-AgentSession -SessionId 'session_123' -Body @{ metadata = @{ project = 'PSOpenAI' } } +``` + +Updates mutable settings on a managed session. + +## PARAMETERS + +### -AdditionalBody +Additional JSON properties to merge into the request body. + +```yaml +Type: Object +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AdditionalHeaders +Additional HTTP headers to include in the request. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AdditionalQuery +Additional query parameters to include in the request. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiBase +The base URI for the OpenAI API. + +```yaml +Type: Uri +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiKey +The OpenAI API key as a secure string. + +```yaml +Type: SecureString +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiType +The API provider. Agents API commands support OpenAI only. + +```yaml +Type: OpenAIApiType +Parameter Sets: (All) +Aliases: +Accepted values: OpenAI, Azure + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AuthType +The authentication type. Use openai for the Agents API. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: +Accepted values: openai, azure, azure_ad + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Body +The request body as a dictionary. Use the fields defined by the corresponding OpenAI Agents API operation. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MaxRetryCount +The maximum number of retries for transient API failures. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Organization +The OpenAI organization ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: OrgId + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SessionId +The managed agent session ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: session_id + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -TimeoutSec +The request timeout in seconds. Zero uses the module default. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProgressAction +Controls how PowerShell responds to progress updates. + +```yaml +Type: ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[OpenAI Agents API](https://developers.openai.com/api/reference/typescript/resources/beta/subresources/agents) diff --git a/Docs/Set-AgentVaultCredential.md b/Docs/Set-AgentVaultCredential.md new file mode 100644 index 0000000..91bc8c1 --- /dev/null +++ b/Docs/Set-AgentVaultCredential.md @@ -0,0 +1,290 @@ +--- +external help file: PSOpenAI-help.xml +Module Name: PSOpenAI +online version: https://github.com/mkht/PSOpenAI/blob/v5/Docs/Set-AgentVaultCredential.md +schema: 2.0.0 +--- + +# Set-AgentVaultCredential + +## SYNOPSIS +Rotates the secret material for an agent vault credential. + +## SYNTAX + +``` +Set-AgentVaultCredential [-VaultId] [-CredentialId] [-Body] + [[-TimeoutSec] ] [[-MaxRetryCount] ] [[-ApiType] ] [[-ApiBase] ] + [[-AuthType] ] [[-ApiKey] ] [[-Organization] ] + [[-AdditionalQuery] ] [[-AdditionalHeaders] ] [[-AdditionalBody] ] + [-ProgressAction ] [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION +Rotates the secret material for an agent vault credential. This command uses the OpenAI Agents API public beta and sends the required `OpenAI-Beta: agents=v1` header. Nested, evolving request schemas are accepted through `-Body` where applicable. + +## EXAMPLES + +### Example 1 +```powershell +Set-AgentVaultCredential -VaultId 'vault_123' -CredentialId 'credential_123' -Body @{ auth = @{ token = '' } } +``` + +Rotates the write-only secret for a vault credential. + +## PARAMETERS + +### -AdditionalBody +Additional JSON properties to merge into the request body. + +```yaml +Type: Object +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AdditionalHeaders +Additional HTTP headers to include in the request. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AdditionalQuery +Additional query parameters to include in the request. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiBase +The base URI for the OpenAI API. + +```yaml +Type: Uri +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiKey +The OpenAI API key as a secure string. + +```yaml +Type: SecureString +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiType +The API provider. Agents API commands support OpenAI only. + +```yaml +Type: OpenAIApiType +Parameter Sets: (All) +Aliases: +Accepted values: OpenAI, Azure + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AuthType +The authentication type. Use openai for the Agents API. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: +Accepted values: openai, azure, azure_ad + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Body +The request body as a dictionary. Use the fields defined by the corresponding OpenAI Agents API operation. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: True +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -CredentialId +The vault credential ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: credential_id + +Required: True +Position: 1 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -MaxRetryCount +The maximum number of retries for transient API failures. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Organization +The OpenAI organization ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: OrgId + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TimeoutSec +The request timeout in seconds. Zero uses the module default. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -VaultId +The agent vault ID. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: vault_id + +Required: True +Position: 0 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProgressAction +Controls how PowerShell responds to progress updates. + +```yaml +Type: ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[OpenAI Agents API](https://developers.openai.com/api/reference/typescript/resources/beta/subresources/agents) diff --git a/PSOpenAI-Help.xml b/PSOpenAI-Help.xml index da08783..cfa8548 100644 --- a/PSOpenAI-Help.xml +++ b/PSOpenAI-Help.xml @@ -1,25 +1,24 @@ - + - Add-ContainerFile + Add-AgentEnvironmentFile Add - ContainerFile + AgentEnvironmentFile - Copy files to a container. + Uploads a file definition to a live agent environment. - Attach one or more files to a container. -You can send either local file , or uploaded files with file ID. + Uploads a file definition to a live agent environment. This command uses the OpenAI Agents API public beta and sends the required `OpenAI-Beta: agents=v1` header. Nested, evolving request schemas are accepted through `-Body` where applicable. - Add-ContainerFile - - ContainerId + Add-AgentEnvironmentFile + + EnvironmentId - The ID of the container to which the file(s) will be attached. + The live agent environment ID. String @@ -28,83 +27,155 @@ You can send either local file , or uploaded files with file ID. None - - File + + Body - The file(s) to attach. -Accepts file IDs (as strings), file paths, or FileInfo objects. + The request body as a dictionary. Use the fields defined by the corresponding OpenAI Agents API operation. - Object[] + IDictionary - Object[] + IDictionary None - - TimeoutSec + + AdditionalBody - Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). + Additional JSON properties to merge into the request body. - Int32 + Object - Int32 + Object - 0 + None - - MaxRetryCount + + AdditionalHeaders - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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 retried. + Additional HTTP headers to include in the request. - Int32 + IDictionary - Int32 + IDictionary - 0 + None - + + AdditionalQuery + + Additional query parameters to include in the request. + + IDictionary + + IDictionary + + + None + + ApiBase - Specifies an API endpoint URL such as: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1`. + The base URI for the OpenAI API. - System.Uri + Uri - System.Uri + Uri - https://api.openai.com/v1 + None - + ApiKey - Specifies API key for authentication. -The type of data should be `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY`. + The OpenAI API key as a secure string. - Object + SecureString - Object + SecureString None - + + ApiType + + The API provider. Agents API commands support OpenAI only. + + + OpenAI + Azure + + OpenAIApiType + + OpenAIApiType + + + None + + + AuthType + + The authentication type. Use openai for the Agents API. + + + openai + azure + azure_ad + + String + + String + + + None + + + MaxRetryCount + + The maximum number of retries for transient API failures. + + Int32 + + Int32 + + + None + + Organization - Specifies Organization ID used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION`. + The OpenAI organization ID. - string + String - string + String + + + None + + + TimeoutSec + + The request timeout in seconds. Zero uses the module default. + + Int32 + + Int32 + + + None + + + ProgressAction + + Controls how PowerShell responds to progress updates. + + ActionPreference + + ActionPreference None @@ -112,10 +183,82 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN - - ContainerId + + AdditionalBody - The ID of the container to which the file(s) will be attached. + Additional JSON properties to merge into the request body. + + Object + + Object + + + None + + + AdditionalHeaders + + Additional HTTP headers to include in the request. + + IDictionary + + IDictionary + + + None + + + AdditionalQuery + + Additional query parameters to include in the request. + + IDictionary + + IDictionary + + + None + + + ApiBase + + The base URI for the OpenAI API. + + Uri + + Uri + + + None + + + ApiKey + + The OpenAI API key as a secure string. + + SecureString + + SecureString + + + None + + + ApiType + + The API provider. Agents API commands support OpenAI only. + + OpenAIApiType + + OpenAIApiType + + + None + + + AuthType + + The authentication type. Use openai for the Agents API. String @@ -124,99 +267,81 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN None - - File + + Body - The file(s) to attach. -Accepts file IDs (as strings), file paths, or FileInfo objects. + The request body as a dictionary. Use the fields defined by the corresponding OpenAI Agents API operation. - Object[] + IDictionary - Object[] + IDictionary None - - TimeoutSec + + EnvironmentId - Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). + The live agent environment ID. - Int32 + String - Int32 + String - 0 + None - + MaxRetryCount - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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 retried. + The maximum number of retries for transient API failures. Int32 Int32 - 0 + None - - ApiBase + + Organization - Specifies an API endpoint URL such as: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1`. + The OpenAI organization ID. - System.Uri + String - System.Uri + String - https://api.openai.com/v1 + None - - ApiKey + + TimeoutSec - Specifies API key for authentication. -The type of data should be `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY`. + The request timeout in seconds. Zero uses the module default. - Object + Int32 - Object + Int32 None - - Organization + + ProgressAction - Specifies Organization ID used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION`. + Controls how PowerShell responds to progress updates. - string + ActionPreference - string + ActionPreference None - - - - PSCustomObject - - - - - - + @@ -225,50 +350,42 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN -------------------------- Example 1 -------------------------- - PS C:\> Add-ContainerFile -ContainerId 'cont_abc123' -File 'file-abc123' + Add-AgentEnvironmentFile -EnvironmentId 'env_123' -Body @{ type = 'inline'; path = '/workspace/README.md'; data = '<base64-data>' } - Attach a file with ID `file-abc123` to the container with ID `cont_abc123`. - - - - -------------------------- Example 2 -------------------------- - PS C:\> Add-ContainerFile -ContainerId 'cont_abc123' -File 'C:\data\sample.pdf' - - Upload and attach a local file to the container with ID `cont_abc123`. + Adds an inline file to a live agent environment. Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/Add-ContainerFile.md + https://github.com/mkht/PSOpenAI/blob/v5/Docs/Add-AgentEnvironmentFile.md - https://developers.openai.com/api/reference/resources/containers/subresources/files/methods/create - https://developers.openai.com/api/reference/resources/containers/subresources/files/methods/create + OpenAI Agents API + https://developers.openai.com/api/reference/typescript/resources/beta/subresources/agents - Add-ConversationItem + Add-AgentSessionEvent Add - ConversationItem + AgentSessionEvent - Adds a message to a Conversation. + Adds one or more input events to an agent session. - Adds a message, file, image, or other content to a Conversation. -Typically used to add user messages to a conversation. + Adds one or more input events to an agent session. This command uses the OpenAI Agents API public beta and sends the required `OpenAI-Beta: agents=v1` header. Nested, evolving request schemas are accepted through `-Body` where applicable. - Add-ConversationItem - - Message + Add-AgentSessionEvent + + SessionId - The content of the user message to add. + The managed agent session ID. String @@ -277,361 +394,341 @@ Typically used to add user messages to a conversation. None - - ConversationId + + Event - The ID of the conversation to add the item to. + One or more input event objects to submit to the session. - String + Object[] - String + Object[] None - - Role + + AdditionalBody - Specifies the role of the message. One of `user`, `system`, `developer`, or `assistant`. + Additional JSON properties to merge into the request body. - String + Object - String + Object - user + None - - SystemMessage + + AdditionalHeaders - Specifies one or more system messages. + Additional HTTP headers to include in the request. - String[] + IDictionary - String[] + IDictionary None - - DeveloperMessage + + AdditionalQuery - Specifies one or more developer messages. + Additional query parameters to include in the request. - String[] + IDictionary - String[] + IDictionary None - - Images + + ApiBase - Specifies the path, URL, or file ID of image files to attach. + The base URI for the OpenAI API. - String[] + Uri - String[] + Uri None - - ImageDetail + + ApiKey - Specifies the detail level of the image. One of `auto`, `low`, or `high`. + The OpenAI API key as a secure string. - String + SecureString - String + SecureString - auto + None - - Files + + ApiType - Specifies the path, URL, or file ID of files to attach. + The API provider. Agents API commands support OpenAI only. - String[] + + OpenAI + Azure + + OpenAIApiType - String[] + OpenAIApiType None - - Include + + AuthType - Additional fields to include in the response. + The authentication type. Use openai for the Agents API. - String[] + + openai + azure + azure_ad + + String - String[] + String None - - TimeoutSec + + IdempotencyKey - Specifies the request timeout in seconds. 0 means unlimited. + An idempotency key sent in the Idempotency-Key request header. - Int32 + String - Int32 + String - 0 + None - + MaxRetryCount - Number between 0 and 100. Specifies the maximum number of retries for 429/5xx errors. + The maximum number of retries for transient API failures. Int32 Int32 - 0 - - - ApiBase - - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` - - System.Uri - - System.Uri - - - https://api.openai.com/v1 + None - - ApiKey + + Organization - Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + The OpenAI organization ID. - Object + String - Object + String None - - Organization + + TimeoutSec - Specifies the organization ID. + The request timeout in seconds. Zero uses the module default. - String + Int32 - String + Int32 None - - PassThru + + ProgressAction - When specified, returns the Conversation object after adding the message. + Controls how PowerShell responds to progress updates. + ActionPreference - SwitchParameter + ActionPreference - False + None - - ConversationId + + AdditionalBody - The ID of the conversation to add the item to. + Additional JSON properties to merge into the request body. - String + Object - String + Object None - - Message + + AdditionalHeaders - The content of the user message to add. + Additional HTTP headers to include in the request. - String + IDictionary - String + IDictionary None - - Role + + AdditionalQuery - Specifies the role of the message. One of `user`, `system`, `developer`, or `assistant`. + Additional query parameters to include in the request. - String + IDictionary - String + IDictionary - user + None - - SystemMessage + + ApiBase - Specifies one or more system messages. + The base URI for the OpenAI API. - String[] + Uri - String[] + Uri None - - DeveloperMessage + + ApiKey - Specifies one or more developer messages. + The OpenAI API key as a secure string. - String[] + SecureString - String[] + SecureString None - - Images + + ApiType - Specifies the path, URL, or file ID of image files to attach. + The API provider. Agents API commands support OpenAI only. - String[] + OpenAIApiType - String[] + OpenAIApiType None - - ImageDetail + + AuthType - Specifies the detail level of the image. One of `auto`, `low`, or `high`. + The authentication type. Use openai for the Agents API. String String - auto - - - Files - - Specifies the path, URL, or file ID of files to attach. - - String[] - - String[] - - None - - Include + + Event - Additional fields to include in the response. + One or more input event objects to submit to the session. - String[] + Object[] - String[] + Object[] None - - TimeoutSec + + IdempotencyKey - Specifies the request timeout in seconds. 0 means unlimited. + An idempotency key sent in the Idempotency-Key request header. - Int32 + String - Int32 + String - 0 + None - + MaxRetryCount - Number between 0 and 100. Specifies the maximum number of retries for 429/5xx errors. + The maximum number of retries for transient API failures. Int32 Int32 - 0 + None - - ApiBase + + Organization - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` + The OpenAI organization ID. - System.Uri + String - System.Uri + String - https://api.openai.com/v1 + None - - ApiKey + + SessionId - Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + The managed agent session ID. - Object + String - Object + String None - - Organization + + TimeoutSec - Specifies the organization ID. + The request timeout in seconds. Zero uses the module default. - String + Int32 - String + Int32 None - - PassThru + + ProgressAction - When specified, returns the Conversation object after adding the message. + Controls how PowerShell responds to progress updates. - SwitchParameter + ActionPreference - SwitchParameter + ActionPreference - False + None @@ -644,202 +741,43 @@ If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_AP -------------------------- Example 1 -------------------------- - PS C:\> Add-ConversationItem -ConversationId "conv_abc1234" -Message "Hello, what's the weather today?" + Add-AgentSessionEvent -SessionId 'session_123' -Event @{ type = 'message'; role = 'user'; content = @(@{ type = 'input_text'; text = 'Continue.' }) } - Adds a message to the specified Conversation. No output by default. - - - - -------------------------- Example 2 -------------------------- - PS C:\> Add-ConversationItem -ConversationId "conv_abc1234" -Message "Please analyze this image" -Images "C:\images\sample.png" - - Adds a message with an attached image file. - - - - -------------------------- Example 3 -------------------------- - PS C:\> Add-ConversationItem -ConversationId "conv_abc1234" -Message "Please check the file" -Files "C:\docs\sample.pdf" -PassThru - - Adds a message with an attached file and returns the Conversation object when PassThru is specified. + Submits a user input event to an existing session. Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/Add-ConversationItem.md + https://github.com/mkht/PSOpenAI/blob/v5/Docs/Add-AgentSessionEvent.md - https://developers.openai.com/api/reference/resources/conversations/subresources/items/methods/create - https://developers.openai.com/api/reference/resources/conversations/subresources/items/methods/create + OpenAI Agents API + https://developers.openai.com/api/reference/typescript/resources/beta/subresources/agents - Add-OpenAIFile + Add-ContainerFile Add - OpenAIFile + ContainerFile - Upload a file that can be used across various endpoints. + Copy files to a container. - Upload a file that can be used across various endpoints. + Attach one or more files to a container. +You can send either local file , or uploaded files with file ID. - Add-OpenAIFile - - File - - The File path to be uploaded. - - String - - String - - - None - - - Purpose - - The intended purpose of the uploaded file. -You can specify `fine-tune`, `assistants` or `batch`. - - String - - String - - - None - - - ExpiresAfterSeconds - - The number of seconds after the anchor time that the file will expire. Must be between 3600 (1 hour) and 2592000 (30 days). - - Int32 - - Int32 - - - None - - - ExpiresAfterAnchor - - Anchor timestamp after which the expiration policy applies. Supported anchors: `created_at`. - - String - - String - - - None - - - TimeoutSec - - Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). - - Int32 - - Int32 - - - 0 - - - MaxRetryCount - - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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. - - - Int32 - - Int32 - - - 0 - - - ApiBase - - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` - - System.Uri - - System.Uri - - - https://api.openai.com/v1 - - - ApiKey - - Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` - - Object - - Object - - - None - - - Organization - - Specifies Organization ID which used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` - - string - - string - - - None - - - - Add-OpenAIFile - - Content - - Byte array to be uploaded. - - byte[] - - byte[] - - - None - - - Name - - The File name to be uploaded. - - String - - String - - - None - - - Purpose + Add-ContainerFile + + ContainerId - The intended purpose of the uploaded file. -You can specify `fine-tune`, `assistants` or `batch`. + The ID of the container to which the file(s) will be attached. String @@ -848,26 +786,15 @@ You can specify `fine-tune`, `assistants` or `batch`. None - - ExpiresAfterSeconds - - The number of seconds after the anchor time that the file will expire. Must be between 3600 (1 hour) and 2592000 (30 days). - - Int32 - - Int32 - - - None - - - ExpiresAfterAnchor + + File - Anchor timestamp after which the expiration policy applies. Supported anchors: `created_at`. + The file(s) to attach. +Accepts file IDs (as strings), file paths, or FileInfo objects. - String + Object[] - String + Object[] None @@ -891,8 +818,7 @@ The default value is `0` (infinite). Number between `0` and `100`. Specifies the maximum number of retries if the request fails. The default value is `0` (No retry). -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. - +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 retried. Int32 @@ -904,8 +830,8 @@ Note : Retries will only be performed if the request fails with a `429 (Rate lim ApiBase - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` + Specifies an API endpoint URL such as: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1`. System.Uri @@ -918,8 +844,8 @@ If not specified, it will use `https://api.openai.com/v1` ApiKey Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` +The type of data should be `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY`. Object @@ -931,8 +857,8 @@ If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_AP Organization - Specifies Organization ID which used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + Specifies Organization ID used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION`. string @@ -944,10 +870,10 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN - - File + + ContainerId - The File path to be uploaded. + The ID of the container to which the file(s) will be attached. String @@ -956,90 +882,41 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN None - - Content + + File - Byte array to be uploaded. + The file(s) to attach. +Accepts file IDs (as strings), file paths, or FileInfo objects. - byte[] + Object[] - byte[] + Object[] None - - Name + + TimeoutSec - The File name to be uploaded. + Specifies how long the request can be pending before it times out. +The default value is `0` (infinite). - String + Int32 - String + Int32 - None + 0 - - Purpose + + MaxRetryCount - The intended purpose of the uploaded file. -You can specify `fine-tune`, `assistants` or `batch`. + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). +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 retried. - String - - String - - - None - - - ExpiresAfterSeconds - - The number of seconds after the anchor time that the file will expire. Must be between 3600 (1 hour) and 2592000 (30 days). - - Int32 - - Int32 - - - None - - - ExpiresAfterAnchor - - Anchor timestamp after which the expiration policy applies. Supported anchors: `created_at`. - - String - - String - - - None - - - TimeoutSec - - Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). - - Int32 - - Int32 - - - 0 - - - MaxRetryCount - - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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. - - - Int32 + Int32 Int32 @@ -1049,8 +926,8 @@ Note : Retries will only be performed if the request fails with a `429 (Rate lim ApiBase - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` + Specifies an API endpoint URL such as: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1`. System.Uri @@ -1063,8 +940,8 @@ If not specified, it will use `https://api.openai.com/v1` ApiKey Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` +The type of data should be `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY`. Object @@ -1076,8 +953,8 @@ If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_AP Organization - Specifies Organization ID which used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + Specifies Organization ID used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION`. string @@ -1106,53 +983,50 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN -------------------------- Example 1 -------------------------- - PS C:\> Add-OpenAIFile -File "C:\sample.csv" -Purpose assistants + PS C:\> Add-ContainerFile -ContainerId 'cont_abc123' -File 'file-abc123' - Upload `sample.csv` file to OpenAI. + Attach a file with ID `file-abc123` to the container with ID `cont_abc123`. -------------------------- Example 2 -------------------------- - PS C:\> $ByteArray = [System.Text.Encoding]::UTF8.GetBytes('some text data') -PS C:\> Add-OpenAIFile -Content $ByteArray -Name 'filename.txt' -Purpose assistants + PS C:\> Add-ContainerFile -ContainerId 'cont_abc123' -File 'C:\data\sample.pdf' - Upload a content of bytes to OpenAI + Upload and attach a local file to the container with ID `cont_abc123`. Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/Add-OpenAIFile.md + https://github.com/mkht/PSOpenAI/blob/main/Docs/Add-ContainerFile.md - https://developers.openai.com/api/reference/resources/files/methods/create/ - https://developers.openai.com/api/reference/resources/files/methods/create/ + https://developers.openai.com/api/reference/resources/containers/subresources/files/methods/create + https://developers.openai.com/api/reference/resources/containers/subresources/files/methods/create - Add-RealtimeSessionItem + Add-ConversationItem Add - RealtimeSessionItem + ConversationItem - Add a new Item to the Conversation's context, including messages, function calls, and function call responses. + Adds a message to a Conversation. - Add a new Item to the Conversation's context, including messages, function calls, and function call responses. This event can be used both to populate a "history" of the conversation and to add new items mid-stream + Adds a message, file, image, or other content to a Conversation. +Typically used to add user messages to a conversation. - Add-RealtimeSessionItem - - Content + Add-ConversationItem + + Message - The content of the message. -For `input_text` and `text` content types, this is the text of the message. -For `input_image`, this is the path to the image file. -For `input_audio`, this is the base64-encoded audio bytes. + The content of the user message to add. String @@ -1161,10 +1035,10 @@ For `input_audio`, this is the base64-encoded audio bytes. None - - ContentTranscript + + ConversationId - The transcript of the audio, used for `input_audio` content type. + The ID of the conversation to add the item to. String @@ -1174,153 +1048,145 @@ For `input_audio`, this is the base64-encoded audio bytes. None - ContentType + Role - The content type (`input_text`, `input_image`, `input_audio`, `item_reference`, `text`). -The default value is `input_text`. + Specifies the role of the message. One of `user`, `system`, `developer`, or `assistant`. - - input_text - input_image - input_audio - item_reference - String String - input_text + user - - EventId + + SystemMessage - Optional client-generated ID used to identify this event. + Specifies one or more system messages. - String + String[] - String + String[] None - FunctionCallArguments + DeveloperMessage - The arguments of the function call (for `function_call` items). + Specifies one or more developer messages. - String + String[] - String + String[] None - FunctionCallId + Images - The ID of the function call (for `function_call` and `function_call_output` items). + Specifies the path, URL, or file ID of image files to attach. - String + String[] - String + String[] None - FunctionCallName + ImageDetail - The name of the function being called (for `function_call` items). + Specifies the detail level of the image. One of `auto`, `low`, or `high`. String String - None + auto - FunctionCallOutput + Files - The output of the function call (for `function_call_output` items). + Specifies the path, URL, or file ID of files to attach. - String + String[] - String + String[] None - ItemId + Include - The unique ID of the item, this can be generated by the client to help manage server-side context, but is not required because the server will generate one if not provided. + Additional fields to include in the response. - String + String[] - String + String[] None - ItemType + TimeoutSec - The type of the item (`message`, `function_call`, `function_call_output`). -The default is `message`. + Specifies the request timeout in seconds. 0 means unlimited. - - message - function_call - function_call_output - - String + Int32 - String + Int32 - message + 0 - PreviousItemId + MaxRetryCount - The ID of the preceding item after which the new item will be inserted. If not set, the new item will be appended to the end of the conversation. If set to `root`, the new item will be added to the beginning of the conversation. If set to an existing ID, it allows an item to be inserted mid-conversation. If the ID cannot be found, an error will be returned and the item will not be added. + Number between 0 and 100. Specifies the maximum number of retries for 429/5xx errors. - String + Int32 - String + Int32 - None + 0 - Role + ApiBase - The role of the message sender (`user`, `assistant`, `system`), only applicable for message items. + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` - - user - assistant - system - - String + System.Uri - String + System.Uri - user + https://api.openai.com/v1 - Status + ApiKey - The status of the item (`completed`, `incomplete`). These have no effect on the conversation. + Specifies API key for authentication. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + + Object + + Object + + + None + + + Organization + + Specifies the organization ID. - - completed - in_progress - incomplete - String String @@ -1329,9 +1195,9 @@ The default is `message`. None - TriggerResponse + PassThru - If specified, instructs the server to create a response after adding this item. + When specified, returns the Conversation object after adding the message. SwitchParameter @@ -1342,13 +1208,10 @@ The default is `message`. - - Content + + ConversationId - The content of the message. -For `input_text` and `text` content types, this is the text of the message. -For `input_image`, this is the path to the image file. -For `input_audio`, this is the base64-encoded audio bytes. + The ID of the conversation to add the item to. String @@ -1357,10 +1220,10 @@ For `input_audio`, this is the base64-encoded audio bytes. None - - ContentTranscript + + Message - The transcript of the audio, used for `input_audio` content type. + The content of the user message to add. String @@ -1370,131 +1233,144 @@ For `input_audio`, this is the base64-encoded audio bytes. None - ContentType + Role - The content type (`input_text`, `input_image`, `input_audio`, `item_reference`, `text`). -The default value is `input_text`. + Specifies the role of the message. One of `user`, `system`, `developer`, or `assistant`. String String - input_text + user - - EventId + + SystemMessage - Optional client-generated ID used to identify this event. + Specifies one or more system messages. - String + String[] - String + String[] None - FunctionCallArguments + DeveloperMessage - The arguments of the function call (for `function_call` items). + Specifies one or more developer messages. - String + String[] - String + String[] None - FunctionCallId + Images - The ID of the function call (for `function_call` and `function_call_output` items). + Specifies the path, URL, or file ID of image files to attach. - String + String[] - String + String[] None - FunctionCallName + ImageDetail - The name of the function being called (for `function_call` items). + Specifies the detail level of the image. One of `auto`, `low`, or `high`. String String - None + auto - FunctionCallOutput + Files - The output of the function call (for `function_call_output` items). + Specifies the path, URL, or file ID of files to attach. - String + String[] - String + String[] None - ItemId + Include - The unique ID of the item, this can be generated by the client to help manage server-side context, but is not required because the server will generate one if not provided. + Additional fields to include in the response. - String + String[] - String + String[] None - ItemType + TimeoutSec - The type of the item (`message`, `function_call`, `function_call_output`). -The default is `message`. + Specifies the request timeout in seconds. 0 means unlimited. - String + Int32 - String + Int32 - message + 0 - PreviousItemId + MaxRetryCount - The ID of the preceding item after which the new item will be inserted. If not set, the new item will be appended to the end of the conversation. If set to `root`, the new item will be added to the beginning of the conversation. If set to an existing ID, it allows an item to be inserted mid-conversation. If the ID cannot be found, an error will be returned and the item will not be added. + Number between 0 and 100. Specifies the maximum number of retries for 429/5xx errors. - String + Int32 - String + Int32 - None + 0 - Role + ApiBase - The role of the message sender (`user`, `assistant`, `system`), only applicable for message items. + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` - String + System.Uri - String + System.Uri - user + https://api.openai.com/v1 - Status + ApiKey - The status of the item (`completed`, `incomplete`). These have no effect on the conversation. + Specifies API key for authentication. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + + Object + + Object + + + None + + + Organization + + Specifies the organization ID. String @@ -1504,9 +1380,9 @@ The default is `message`. None - TriggerResponse + PassThru - If specified, instructs the server to create a response after adding this item. + When specified, returns the Conversation object after adding the message. SwitchParameter @@ -1526,56 +1402,56 @@ The default is `message`. -------------------------- Example 1 -------------------------- - PS C:\> Add-RealtimeSessionItem 'Hello. Why is the sun so bright?' + PS C:\> Add-ConversationItem -ConversationId "conv_abc1234" -Message "Hello, what's the weather today?" - This example adds a text message as an input to the conversation. + Adds a message to the specified Conversation. No output by default. -------------------------- Example 2 -------------------------- - PS C:\> Add-RealtimeSessionItem -ContentType 'input_image' -Content 'C:\path\to\image.png' + PS C:\> Add-ConversationItem -ConversationId "conv_abc1234" -Message "Please analyze this image" -Images "C:\images\sample.png" - This example adds an image as an input to the conversation. + Adds a message with an attached image file. -------------------------- Example 3 -------------------------- - PS C:\> Add-RealtimeSessionItem 'This is a great question!' -Role assistant + PS C:\> Add-ConversationItem -ConversationId "conv_abc1234" -Message "Please check the file" -Files "C:\docs\sample.pdf" -PassThru - + Adds a message with an attached file and returns the Conversation object when PassThru is specified. Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/Add-RealtimeSessionItem.md + https://github.com/mkht/PSOpenAI/blob/main/Docs/Add-ConversationItem.md - https://developers.openai.com/api/docs/guides/realtime-conversations/ - https://developers.openai.com/api/docs/guides/realtime-conversations/ + https://developers.openai.com/api/reference/resources/conversations/subresources/items/methods/create + https://developers.openai.com/api/reference/resources/conversations/subresources/items/methods/create - Add-VectorStoreFile + Add-OpenAIFile Add - VectorStoreFile + OpenAIFile - Attach a file to a vector store. + Upload a file that can be used across various endpoints. - Attach a file to a vector store. + Upload a file that can be used across various endpoints. - Add-VectorStoreFile - - VectorStoreId + Add-OpenAIFile + + File - The ID of the vector store for which to add a File. + The File path to be uploaded. String @@ -1584,10 +1460,11 @@ The default is `message`. None - - FileId + + Purpose - A File ID that the vector store should use. + The intended purpose of the uploaded file. +You can specify `fine-tune`, `assistants` or `batch`. String @@ -1596,54 +1473,29 @@ The default is `message`. None - - ChunkingStrategy + + ExpiresAfterSeconds - The chunking strategy used to chunk the file(s). If not set, will use the "auto" strategy. + The number of seconds after the anchor time that the file will expire. Must be between 3600 (1 hour) and 2592000 (30 days). - String + Int32 - String + Int32 None - - MaxChunkSizeTokens - - The maximum number of tokens in each chunk. The default value is 800. The minimum value is 100 and the maximum value is 4096. -Note that the parameter only acceptable when the ChunkingStrategy is "static". - - String - - String - - - 800 - - - ChunkOverlapTokens + + ExpiresAfterAnchor - The number of tokens that overlap between chunks. The default value is 400. The value must not exceed half of MaxChunkSizeTokens. -Note that the parameter only acceptable when the ChunkingStrategy is "static". + Anchor timestamp after which the expiration policy applies. Supported anchors: `created_at`. String String - 400 - - - PassThru - - Returns a Vector Store object that the file added. By default, this cmdlet doesn't return any output. - - - SwitchParameter - - - False + None TimeoutSec @@ -1715,81 +1567,213 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN None - - - - VectorStoreId - - The ID of the vector store for which to add a File. - - String - - String - - - None - - - FileId - - A File ID that the vector store should use. - - String - - String - - - None - - - ChunkingStrategy - - The chunking strategy used to chunk the file(s). If not set, will use the "auto" strategy. - - String - - String - - - None - - - MaxChunkSizeTokens - - The maximum number of tokens in each chunk. The default value is 800. The minimum value is 100 and the maximum value is 4096. -Note that the parameter only acceptable when the ChunkingStrategy is "static". - - String - - String - - - 800 - - - ChunkOverlapTokens - - The number of tokens that overlap between chunks. The default value is 400. The value must not exceed half of MaxChunkSizeTokens. -Note that the parameter only acceptable when the ChunkingStrategy is "static". - - String - - String - - - 400 - - - PassThru - - Returns a Vector Store object that the file added. By default, this cmdlet doesn't return any output. + + Add-OpenAIFile + + Content + + Byte array to be uploaded. + + byte[] + + byte[] + + + None + + + Name + + The File name to be uploaded. + + String + + String + + + None + + + Purpose + + The intended purpose of the uploaded file. +You can specify `fine-tune`, `assistants` or `batch`. + + String + + String + + + None + + + ExpiresAfterSeconds + + The number of seconds after the anchor time that the file will expire. Must be between 3600 (1 hour) and 2592000 (30 days). + + Int32 + + Int32 + + + None + + + ExpiresAfterAnchor + + Anchor timestamp after which the expiration policy applies. Supported anchors: `created_at`. + + String + + String + + + None + + + TimeoutSec + + Specifies how long the request can be pending before it times out. +The default value is `0` (infinite). + + Int32 + + Int32 + + + 0 + + + MaxRetryCount + + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). +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. + + + Int32 + + Int32 + + + 0 + + + ApiBase + + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` + + System.Uri + + System.Uri + + + https://api.openai.com/v1 + + + ApiKey + + Specifies API key for authentication. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + + Object + + Object + + + None + + + Organization + + Specifies Organization ID which used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + + string + + string + + + None + + + + + + File + + The File path to be uploaded. - SwitchParameter + String - SwitchParameter + String - False + None + + + Content + + Byte array to be uploaded. + + byte[] + + byte[] + + + None + + + Name + + The File name to be uploaded. + + String + + String + + + None + + + Purpose + + The intended purpose of the uploaded file. +You can specify `fine-tune`, `assistants` or `batch`. + + String + + String + + + None + + + ExpiresAfterSeconds + + The number of seconds after the anchor time that the file will expire. Must be between 3600 (1 hour) and 2592000 (30 days). + + Int32 + + Int32 + + + None + + + ExpiresAfterAnchor + + Anchor timestamp after which the expiration policy applies. Supported anchors: `created_at`. + + String + + String + + + None TimeoutSec @@ -1880,103 +1864,65 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN -------------------------- Example 1 -------------------------- - PS C:\> Add-VectorStoreFile -VectorStoreId 'vs_abc123' -FileId 'file-abc123' + PS C:\> Add-OpenAIFile -File "C:\sample.csv" -Purpose assistants - Attach a file with ID `file-abc123` to the vector store with ID `vs_abc123`. + Upload `sample.csv` file to OpenAI. -------------------------- Example 2 -------------------------- - PS C:\> $Store = Get-VectorStoreFile -VectorStoreId 'vs_abc123' -PS C:\> $Store = $Store | Add-VectorStoreFile -FileId 'file-abc123' -PassThru + PS C:\> $ByteArray = [System.Text.Encoding]::UTF8.GetBytes('some text data') +PS C:\> Add-OpenAIFile -Content $ByteArray -Name 'filename.txt' -Purpose assistants - Attach a file with ID `file-abc123` to the vector store with ID `vs_abc123`. Then, updates the object of `$Store` + Upload a content of bytes to OpenAI Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/Add-VectorStoreFile.md + https://github.com/mkht/PSOpenAI/blob/main/Docs/Add-OpenAIFile.md - https://developers.openai.com/api/reference/resources/vector_stores/subresources/files/methods/create/ - https://developers.openai.com/api/reference/resources/vector_stores/subresources/files/methods/create/ + https://developers.openai.com/api/reference/resources/files/methods/create/ + https://developers.openai.com/api/reference/resources/files/methods/create/ - Set-OpenAIContext - Set - OpenAIContext + Add-RealtimeSessionItem + Add + RealtimeSessionItem - Resets the common parameter context set by Set-OpenAIContext. + Add a new Item to the Conversation's context, including messages, function calls, and function call responses. - Resets the common parameter context set by Set-OpenAIContext. + Add a new Item to the Conversation's context, including messages, function calls, and function call responses. This event can be used both to populate a "history" of the conversation and to add new items mid-stream - Set-OpenAIContext - - - - - - - - - - - - - -------------------------- Example 1 -------------------------- - PS C:\> Set-OpenAIContext -ApiType 'Azure' -ApiKey 'API_KEY' -PS C:\> Clear-OpenAIContext -PS C:\> Get-OpenAIContext - -ApiKey : -ApiType : OpenAI -ApiBase : -ApiVersion : -AuthType : openai -Organization : -TimeoutSec : 0 -MaxRetryCount : 0 - - - - - - - - Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/Clear-OpenAIContext.md - - - - - - Connect-RealtimeSession - Connect - RealtimeSession - - Create a new OpenAI realtime conversation session. - - - - Create a new realtime conversation session. This technically means connecting to the WebSocket endpoint provided by the OpenAI Realtime API. - Once the session is opened, the connection will continue until it is disconnected from the server side or a Disconnect-RealtimeSession is executed. You always need run Disconnect-RealtimeSession when you are finished conversation. - - - - Connect-RealtimeSession + Add-RealtimeSessionItem + + Content + + The content of the message. +For `input_text` and `text` content types, this is the text of the message. +For `input_image`, this is the path to the image file. +For `input_audio`, this is the base64-encoded audio bytes. + + String + + String + + + None + - Model + ContentTranscript - It is recommended that you always specify the model you want to use. + The transcript of the audio, used for `input_audio` content type. String @@ -1986,57 +1932,152 @@ MaxRetryCount : 0 None - ApiBase + ContentType - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` + The content type (`input_text`, `input_image`, `input_audio`, `item_reference`, `text`). +The default value is `input_text`. - System.Uri + + input_text + input_image + input_audio + item_reference + + String - System.Uri + String - https://api.openai.com/v1 + input_text - ApiKey + EventId - Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + Optional client-generated ID used to identify this event. - Object + String - Object + String None - ApiType + FunctionCallArguments - Specifies API type of use. `OpenAI`(default) or `Azure` + The arguments of the function call (for `function_call` items). + + String + + String + + + None + + + FunctionCallId + + The ID of the function call (for `function_call` and `function_call_output` items). + + String + + String + + + None + + + FunctionCallName + + The name of the function being called (for `function_call` items). + + String + + String + + + None + + + FunctionCallOutput + + The output of the function call (for `function_call_output` items). + + String + + String + + + None + + + ItemId + + The unique ID of the item, this can be generated by the client to help manage server-side context, but is not required because the server will generate one if not provided. + + String + + String + + + None + + + ItemType + + The type of the item (`message`, `function_call`, `function_call_output`). +The default is `message`. - OpenAI - Azure + message + function_call + function_call_output - OpenAIApiType + String - OpenAIApiType + String - OpenAI + message - AuthType + PreviousItemId - If you wish to use Entra-ID based authentication, specifies as `azure_ad`. + The ID of the preceding item after which the new item will be inserted. If not set, the new item will be appended to the end of the conversation. If set to `root`, the new item will be added to the beginning of the conversation. If set to an existing ID, it allows an item to be inserted mid-conversation. If the ID cannot be found, an error will be returned and the item will not be added. + + String + + String + + + None + + + Role + + The role of the message sender (`user`, `assistant`, `system`), only applicable for message items. - openai - azure - azure_ad + user + assistant + system + + String + + String + + + user + + + Status + + The status of the item (`completed`, `incomplete`). These have no effect on the conversation. + + + completed + in_progress + incomplete String @@ -2045,13 +2086,39 @@ If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_AP None + + TriggerResponse + + If specified, instructs the server to create a response after adding this item. + + + SwitchParameter + + + False + + + Content + + The content of the message. +For `input_text` and `text` content types, this is the text of the message. +For `input_image`, this is the path to the image file. +For `input_audio`, this is the base64-encoded audio bytes. + + String + + String + + + None + - Model + ContentTranscript - It is recommended that you always specify the model you want to use. + The transcript of the audio, used for `input_audio` content type. String @@ -2061,48 +2128,46 @@ If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_AP None - ApiBase + ContentType - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` + The content type (`input_text`, `input_image`, `input_audio`, `item_reference`, `text`). +The default value is `input_text`. - System.Uri + String - System.Uri + String - https://api.openai.com/v1 + input_text - ApiKey + EventId - Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + Optional client-generated ID used to identify this event. - Object + String - Object + String None - ApiType + FunctionCallArguments - Specifies API type of use. `OpenAI`(default) or `Azure` + The arguments of the function call (for `function_call` items). - OpenAIApiType + String - OpenAIApiType + String - OpenAI + None - AuthType + FunctionCallId - If you wish to use Entra-ID based authentication, specifies as `azure_ad`. + The ID of the function call (for `function_call` and `function_call_output` items). String @@ -2111,156 +2176,83 @@ If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_AP None - - - - - - - - - - - -------------------------- Example 1 -------------------------- - PS C:\> Connect-RealtimeSession -Model 'gpt-realtime' - - - - - - - - Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/Connect-RealtimeSession.md - - - https://developers.openai.com/api/docs/guides/realtime/ - https://developers.openai.com/api/docs/guides/realtime/ - - - - - - Connect-RealtimeTranscriptionSession - Connect - RealtimeTranscriptionSession - - Create a new OpenAI realtime transcription session. - - - - Create a new realtime transcription session. This technically means connecting to the WebSocket endpoint provided by the OpenAI Realtime API. - Once the session is opened, the connection will continue until it is disconnected from the server side or a DisConnect-RealtimeSession is executed. You always need run DisConnect-RealtimeSession when you are finished conversation. - - - - Connect-RealtimeTranscriptionSession - - ApiBase - - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` - - System.Uri - - System.Uri - - - https://api.openai.com/v1 - - - ApiKey - - Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` - - Object - - Object - - - None - - - ApiType - - Specifies API type of use. `OpenAI`(default) or `Azure` - - - OpenAI - Azure - - OpenAIApiType - - OpenAIApiType - - - OpenAI - - - AuthType - - If you wish to use Entra-ID based authentication, specifies as `azure_ad`. - - - openai - azure - azure_ad - - String - - String - - - None - - - - - ApiBase + FunctionCallName - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` + The name of the function being called (for `function_call` items). - System.Uri + String - System.Uri + String - https://api.openai.com/v1 + None - ApiKey + FunctionCallOutput - Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + The output of the function call (for `function_call_output` items). - Object + String - Object + String None - ApiType + ItemId - Specifies API type of use. `OpenAI`(default) or `Azure` + The unique ID of the item, this can be generated by the client to help manage server-side context, but is not required because the server will generate one if not provided. - OpenAIApiType + String - OpenAIApiType + String - OpenAI + None - AuthType + ItemType - If you wish to use Entra-ID based authentication, specifies as `azure_ad`. + The type of the item (`message`, `function_call`, `function_call_output`). +The default is `message`. + + String + + String + + + message + + + PreviousItemId + + The ID of the preceding item after which the new item will be inserted. If not set, the new item will be appended to the end of the conversation. If set to `root`, the new item will be added to the beginning of the conversation. If set to an existing ID, it allows an item to be inserted mid-conversation. If the ID cannot be found, an error will be returned and the item will not be added. + + String + + String + + + None + + + Role + + The role of the message sender (`user`, `assistant`, `system`), only applicable for message items. + + String + + String + + + user + + + Status + + The status of the item (`completed`, `incomplete`). These have no effect on the conversation. String @@ -2269,6 +2261,18 @@ If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_AP None + + TriggerResponse + + If specified, instructs the server to create a response after adding this item. + + SwitchParameter + + SwitchParameter + + + False + @@ -2280,7 +2284,21 @@ If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_AP -------------------------- Example 1 -------------------------- - PS C:\> Connect-RealtimeTranscriptionSession + PS C:\> Add-RealtimeSessionItem 'Hello. Why is the sun so bright?' + + This example adds a text message as an input to the conversation. + + + + -------------------------- Example 2 -------------------------- + PS C:\> Add-RealtimeSessionItem -ContentType 'input_image' -Content 'C:\path\to\image.png' + + This example adds an image as an input to the conversation. + + + + -------------------------- Example 3 -------------------------- + PS C:\> Add-RealtimeSessionItem 'This is a great question!' -Role assistant @@ -2289,101 +2307,95 @@ If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_AP Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/Connect-RealtimeTranscriptionSession.md + https://github.com/mkht/PSOpenAI/blob/main/Docs/Add-RealtimeSessionItem.md - https://developers.openai.com/api/docs/guides/realtime-transcription - https://developers.openai.com/api/docs/guides/realtime-transcription + https://developers.openai.com/api/docs/guides/realtime-conversations/ + https://developers.openai.com/api/docs/guides/realtime-conversations/ - ConvertFrom-Token - ConvertFrom - Token + Add-VectorStoreFile + Add + VectorStoreFile - Decode tokens to original text. + Attach a file to a vector store. - Decode tokens to original text. + Attach a file to a vector store. - ConvertFrom-Token - - Token + Add-VectorStoreFile + + VectorStoreId - Specifies the token array to be decoded. + The ID of the vector store for which to add a File. - Int32[] + String - Int32[] + String None - - Encoding + + FileId - Specifies the encoding name. Currently `cl100k_base` and `o200k_base` are supported. -It cannot be specified with the model name. + A File ID that the vector store should use. - - cl100k_base - o200k_base - String String - cl100k_base + None - - AsArray + + ChunkingStrategy - If set, output as an array of strings decoded token by token. + The chunking strategy used to chunk the file(s). If not set, will use the "auto" strategy. + String - SwitchParameter + String - False + None - - - ConvertFrom-Token - - Token + + MaxChunkSizeTokens - Specifies the token array to be decoded. + The maximum number of tokens in each chunk. The default value is 800. The minimum value is 100 and the maximum value is 4096. +Note that the parameter only acceptable when the ChunkingStrategy is "static". - Int32[] + String - Int32[] + String - None + 800 - - Model + + ChunkOverlapTokens - Specifies the model name. such like `gpt-4` or `text-embedding-3-small`. -It cannot be specified with the encoding name. + The number of tokens that overlap between chunks. The default value is 400. The value must not exceed half of MaxChunkSizeTokens. +Note that the parameter only acceptable when the ChunkingStrategy is "static". String String - None + 400 - AsArray + PassThru - If set, output as an array of strings decoded token by token. + Returns a Vector Store object that the file added. By default, this cmdlet doesn't return any output. SwitchParameter @@ -2391,39 +2403,106 @@ It cannot be specified with the encoding name. False + + TimeoutSec + + Specifies how long the request can be pending before it times out. +The default value is `0` (infinite). + + Int32 + + Int32 + + + 0 + + + MaxRetryCount + + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). +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. + + + Int32 + + Int32 + + + 0 + + + ApiBase + + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` + + System.Uri + + System.Uri + + + https://api.openai.com/v1 + + + ApiKey + + Specifies API key for authentication. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + + Object + + Object + + + None + + + Organization + + Specifies Organization ID which used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + + string + + string + + + None + - - Token + + VectorStoreId - Specifies the token array to be decoded. + The ID of the vector store for which to add a File. - Int32[] + String - Int32[] + String None - - Encoding + + FileId - Specifies the encoding name. Currently `cl100k_base` and `o200k_base` are supported. -It cannot be specified with the model name. + A File ID that the vector store should use. String String - cl100k_base + None - - Model + + ChunkingStrategy - Specifies the model name. such like `gpt-4` or `text-embedding-3-small`. -It cannot be specified with the encoding name. + The chunking strategy used to chunk the file(s). If not set, will use the "auto" strategy. String @@ -2432,10 +2511,36 @@ It cannot be specified with the encoding name. None + + MaxChunkSizeTokens + + The maximum number of tokens in each chunk. The default value is 800. The minimum value is 100 and the maximum value is 4096. +Note that the parameter only acceptable when the ChunkingStrategy is "static". + + String + + String + + + 800 + + + ChunkOverlapTokens + + The number of tokens that overlap between chunks. The default value is 400. The value must not exceed half of MaxChunkSizeTokens. +Note that the parameter only acceptable when the ChunkingStrategy is "static". + + String + + String + + + 400 + - AsArray + PassThru - If set, output as an array of strings decoded token by token. + Returns a Vector Store object that the file added. By default, this cmdlet doesn't return any output. SwitchParameter @@ -2444,21 +2549,81 @@ It cannot be specified with the encoding name. False - - - + + TimeoutSec + + Specifies how long the request can be pending before it times out. +The default value is `0` (infinite). + + Int32 - System.Int32[] + Int32 + + 0 + + + MaxRetryCount - + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). +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. + - - + Int32 + + Int32 + + + 0 + + + ApiBase + + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` + + System.Uri + + System.Uri + + + https://api.openai.com/v1 + + + ApiKey + + Specifies API key for authentication. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + + Object + + Object + + + None + + + Organization + + Specifies Organization ID which used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + + string + + string + + + None + + + - System.String + PSCustomObject @@ -2473,53 +2638,103 @@ It cannot be specified with the encoding name. -------------------------- Example 1 -------------------------- - $Tokens = (9906, 11, 1917, 0) -ConvertFrom-Token -Token $Tokens -Model 'gpt-4' -# Output: Hello, world! + PS C:\> Add-VectorStoreFile -VectorStoreId 'vs_abc123' -FileId 'file-abc123' - + Attach a file with ID `file-abc123` to the vector store with ID `vs_abc123`. -------------------------- Example 2 -------------------------- - (102415, 230, 102415, 240, 102415, 239) | ConvertFrom-Token -Encoding 'o200k_base' -# Output: 🍈🍒🍑 + PS C:\> $Store = Get-VectorStoreFile -VectorStoreId 'vs_abc123' +PS C:\> $Store = $Store | Add-VectorStoreFile -FileId 'file-abc123' -PassThru - + Attach a file with ID `file-abc123` to the vector store with ID `vs_abc123`. Then, updates the object of `$Store` Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/ConvertFrom-Token.md + https://github.com/mkht/PSOpenAI/blob/main/Docs/Add-VectorStoreFile.md - https://github.com/openai/tiktoken - https://github.com/openai/tiktoken + https://developers.openai.com/api/reference/resources/vector_stores/subresources/files/methods/create/ + https://developers.openai.com/api/reference/resources/vector_stores/subresources/files/methods/create/ - ConvertTo-Token - ConvertTo - Token - - BPE tokeniser for use with OpenAI's models. + Set-OpenAIContext + Set + OpenAIContext + + Resets the common parameter context set by Set-OpenAIContext. - Encode text to tokens for use with OpenAI's models. (tokenize) -The output values are compatible with OpenAI tiktoken. + Resets the common parameter context set by Set-OpenAIContext. - ConvertTo-Token - - Text + Set-OpenAIContext + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + PS C:\> Set-OpenAIContext -ApiType 'Azure' -ApiKey 'API_KEY' +PS C:\> Clear-OpenAIContext +PS C:\> Get-OpenAIContext + +ApiKey : +ApiType : OpenAI +ApiBase : +ApiVersion : +AuthType : openai +Organization : +TimeoutSec : 0 +MaxRetryCount : 0 + + + + + + + + Online Version: + https://github.com/mkht/PSOpenAI/blob/main/Docs/Clear-OpenAIContext.md + + + + + + Connect-RealtimeSession + Connect + RealtimeSession + + Create a new OpenAI realtime conversation session. + + + + Create a new realtime conversation session. This technically means connecting to the WebSocket endpoint provided by the OpenAI Realtime API. + Once the session is opened, the connection will continue until it is disconnected from the server side or a Disconnect-RealtimeSession is executed. You always need run Disconnect-RealtimeSession when you are finished conversation. + + + + Connect-RealtimeSession + + Model - Specifies texts to be encoded. + It is recommended that you always specify the model you want to use. String @@ -2528,44 +2743,59 @@ The output values are compatible with OpenAI tiktoken. None - - Encoding + + ApiBase - Specifies the encoding name. Currently `cl100k_base` and `o200k_base` are supported. -It cannot be specified with the model name. + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` - - cl100k_base - o200k_base - - String + System.Uri - String + System.Uri - cl100k_base + https://api.openai.com/v1 - - - ConvertTo-Token - - Text + + ApiKey - Specifies texts to be encoded. + Specifies API key for authentication. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` - String + Object - String + Object None - - Model + + ApiType - Specifies the model name. such like `gpt-4` or `text-embedding-3-small`. -It cannot be specified with the encoding name. + Specifies API type of use. `OpenAI`(default) or `Azure` + + + OpenAI + Azure + + OpenAIApiType + + OpenAIApiType + + + OpenAI + + + AuthType + + If you wish to use Entra-ID based authentication, specifies as `azure_ad`. + + openai + azure + azure_ad + String String @@ -2576,10 +2806,10 @@ It cannot be specified with the encoding name. - - Text + + Model - Specifies texts to be encoded. + It is recommended that you always specify the model you want to use. String @@ -2588,53 +2818,60 @@ It cannot be specified with the encoding name. None - - Encoding + + ApiBase - Specifies the encoding name. Currently `cl100k_base` and `o200k_base` are supported. -It cannot be specified with the model name. + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` - String + System.Uri - String + System.Uri - cl100k_base + https://api.openai.com/v1 - - Model + + ApiKey - Specifies the model name. such like `gpt-4` or `text-embedding-3-small`. -It cannot be specified with the encoding name. + Specifies API key for authentication. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` - String + Object - String + Object None - - - - - System.String - + + ApiType - + Specifies API type of use. `OpenAI`(default) or `Azure` - - - - + OpenAIApiType - System.Int32[] + OpenAIApiType + + OpenAI + + + AuthType - + If you wish to use Entra-ID based authentication, specifies as `azure_ad`. - - + String + + String + + + None + + + + @@ -2643,17 +2880,7 @@ It cannot be specified with the encoding name. -------------------------- Example 1 -------------------------- - $Text = Hello, world! -ConvertTo-Token -Text $Text -Model 'gpt-4' -# Output: (9906, 11, 1917, 0) - - - - - - -------------------------- Example 2 -------------------------- - '🍈🍒🍑' | ConvertTo-Token -Encoding 'o200k_base' -# Output: (102415, 230, 102415, 240, 102415, 239) + PS C:\> Connect-RealtimeSession -Model 'gpt-realtime' @@ -2662,201 +2889,30 @@ ConvertTo-Token -Text $Text -Model 'gpt-4' Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/ConvertTo-Token.md + https://github.com/mkht/PSOpenAI/blob/main/Docs/Connect-RealtimeSession.md - https://github.com/openai/tiktoken - https://github.com/openai/tiktoken + https://developers.openai.com/api/docs/guides/realtime/ + https://developers.openai.com/api/docs/guides/realtime/ - Disconnect-RealtimeSession - Disconnect - RealtimeSession + Connect-RealtimeTranscriptionSession + Connect + RealtimeTranscriptionSession - Close realtime session. + Create a new OpenAI realtime transcription session. - Terminates a connected conversation session. If audio input/output is activated, they are also terminated. + Create a new realtime transcription session. This technically means connecting to the WebSocket endpoint provided by the OpenAI Realtime API. + Once the session is opened, the connection will continue until it is disconnected from the server side or a DisConnect-RealtimeSession is executed. You always need run DisConnect-RealtimeSession when you are finished conversation. - Disconnect-RealtimeSession - - - - - - - - - - - - - -------------------------- Example 1 -------------------------- - PS C:\> Disconnect-RealtimeSession - - - - - - - - Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/Disconnect-RealtimeSession.md - - - - - - Enter-ChatGPT - Enter - ChatGPT - - Communicate with ChatGPT interactively on the console. - - - - Communicate with ChatGPT interactively on the console. -This command will wait for user input on the terminal. You type your question to ChatGPT and press Enter twice to send the question and see the answer from ChatGPT. You may then ask additional questions. - - - - Enter-ChatGPT - - Model - - The name of model to use. The default value is `gpt-3.5-turbo`. - - String - - String - - - gpt-3.5-turbo - - - SystemMessage - - An optional text to set the behavior of the assistant. - - String - - String - - - None - - - 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. - - Double - - Double - - - None - - - TopP - - 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. - - Double - - Double - - - None - - - StopSequence - - Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence. - - String[] - - String[] - - - None - - - MaxCompletionTokens - - The maximum number of tokens allowed for the generated answer. -Maximum value depends on model. (`4096` for `gpt-3.5-turbo` or `8192` for `gpt-4`) - - Int32 - - Int32 - - - None - - - PresencePenalty - - Number between `-2.0` and `2.0`. -Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics. - - Double - - Double - - - None - - - FrequencyPenalty - - Number between `-2.0` and `2.0`. -Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. - - Double - - Double - - - None - - - TimeoutSec - - Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). - - Int32 - - Int32 - - - 0 - - - MaxRetryCount - - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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. - - - Int32 - - Int32 - - - 0 - + Connect-RealtimeTranscriptionSession ApiBase @@ -2884,227 +2940,96 @@ If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_AP None - - Organization + + ApiType - Specifies Organization ID which used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + Specifies API type of use. `OpenAI`(default) or `Azure` - string + + OpenAI + Azure + + OpenAIApiType - string + OpenAIApiType - None + OpenAI - NoHeader + AuthType - Suppresses the display of header strings + If you wish to use Entra-ID based authentication, specifies as `azure_ad`. + + openai + azure + azure_ad + + String - SwitchParameter + String - False + None - Model - - The name of model to use. The default value is `gpt-3.5-turbo`. - - String - - String - - - gpt-3.5-turbo - - - SystemMessage + ApiBase - An optional text to set the behavior of the assistant. + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` - String + System.Uri - String + System.Uri - None + https://api.openai.com/v1 - 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. - - Double - - Double - - - None - - - TopP - - 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. - - Double - - Double - - - None - - - StopSequence + ApiKey - Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence. + Specifies API key for authentication. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` - String[] + Object - String[] + Object None - - MaxCompletionTokens + + ApiType - The maximum number of tokens allowed for the generated answer. -Maximum value depends on model. (`4096` for `gpt-3.5-turbo` or `8192` for `gpt-4`) + Specifies API type of use. `OpenAI`(default) or `Azure` - Int32 + OpenAIApiType - Int32 + OpenAIApiType - None + OpenAI - - PresencePenalty + + AuthType - Number between `-2.0` and `2.0`. -Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics. + If you wish to use Entra-ID based authentication, specifies as `azure_ad`. - Double + String - Double + String None - - FrequencyPenalty - - Number between `-2.0` and `2.0`. -Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. - - Double - - Double - - - None - - - TimeoutSec - - Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). - - Int32 - - Int32 - - - 0 - - - MaxRetryCount - - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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. - - - Int32 - - Int32 - - - 0 - - - ApiBase - - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` - - System.Uri - - System.Uri - - - https://api.openai.com/v1 - - - ApiKey - - Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` - - Object - - Object - - - None - - - Organization - - Specifies Organization ID which used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` - - string - - string - - - None - - - NoHeader - - Suppresses the display of header strings - - SwitchParameter - - SwitchParameter - - - False - - - - - System.Object - - - - - - + @@ -3113,134 +3038,110 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN -------------------------- Example 1 -------------------------- - PS C:\> Enter-ChatGPT -ApiKey 'YOUR_OPENAI_APIKEY' -NoHeader + PS C:\> Connect-RealtimeTranscriptionSession - ! Interactive Chat (/Docs/images/InteractiveChat.gif) + Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/Enter-ChatGPT.md + https://github.com/mkht/PSOpenAI/blob/main/Docs/Connect-RealtimeTranscriptionSession.md + + + https://developers.openai.com/api/docs/guides/realtime-transcription + https://developers.openai.com/api/docs/guides/realtime-transcription - Get-Batch - Get - Batch + ConvertFrom-Token + ConvertFrom + Token - Retrieves a batch. + Decode tokens to original text. - Get an batch or List multiple batches + Decode tokens to original text. - Get-Batch - - BatchId + ConvertFrom-Token + + Token - The ID of the batch to retrieve. + Specifies the token array to be decoded. - String + Int32[] - String + Int32[] None - - TimeoutSec - - Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). - - Int32 - - Int32 - - - 0 - - - MaxRetryCount + + Encoding - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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. - + Specifies the encoding name. Currently `cl100k_base` and `o200k_base` are supported. +It cannot be specified with the model name. - Int32 + + cl100k_base + o200k_base + + String - Int32 + String - 0 + cl100k_base - ApiBase + AsArray - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` + If set, output as an array of strings decoded token by token. - System.Uri - System.Uri + SwitchParameter - https://api.openai.com/v1 + False - - ApiKey + + + ConvertFrom-Token + + Token - Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + Specifies the token array to be decoded. - Object + Int32[] - Object + Int32[] None - - Organization + + Model - Specifies Organization ID which used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + Specifies the model name. such like `gpt-4` or `text-embedding-3-small`. +It cannot be specified with the encoding name. - string + String - string + String None - - - Get-Batch - - Limit - - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. - - Int32 - - Int32 - - - 20 - - All + AsArray - When this switch is specified, all batch objects will be retrieved. + If set, output as an array of strings decoded token by token. SwitchParameter @@ -3248,189 +3149,74 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN False - - TimeoutSec - - Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). - - Int32 - - Int32 - - - 0 - - - MaxRetryCount - - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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. - - - Int32 - - Int32 - - - 0 - - - ApiBase - - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` - - System.Uri - - System.Uri - - - https://api.openai.com/v1 - - - ApiKey - - Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` - - Object - - Object - - - None - - - Organization - - Specifies Organization ID which used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` - - string - - string - - - None - - - BatchId + + Token - The ID of the batch to retrieve. + Specifies the token array to be decoded. - String + Int32[] - String + Int32[] None - - Limit - - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. - - Int32 - - Int32 - - - 20 - - - All - - When this switch is specified, all batch objects will be retrieved. - - SwitchParameter - - SwitchParameter - - - False - - - TimeoutSec + + Encoding - Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). + Specifies the encoding name. Currently `cl100k_base` and `o200k_base` are supported. +It cannot be specified with the model name. - Int32 + String - Int32 + String - 0 + cl100k_base - - MaxRetryCount + + Model - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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. - + Specifies the model name. such like `gpt-4` or `text-embedding-3-small`. +It cannot be specified with the encoding name. - Int32 + String - Int32 + String - 0 + None - ApiBase + AsArray - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` + If set, output as an array of strings decoded token by token. - System.Uri + SwitchParameter - System.Uri + SwitchParameter - https://api.openai.com/v1 + False - - ApiKey - - Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` - - Object + + + - Object - + System.Int32[] - None - - - Organization - Specifies Organization ID which used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + - string - - string - - - None - - - + + - PSCustomObject + System.String @@ -3445,60 +3231,53 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN -------------------------- Example 1 -------------------------- - PS C:\> Get-Batch -Limit 5 + $Tokens = (9906, 11, 1917, 0) +ConvertFrom-Token -Token $Tokens -Model 'gpt-4' +# Output: Hello, world! - Get latest 5 batches. + -------------------------- Example 2 -------------------------- - PS C:\> Get-Batch -All - - Get all batches. - - - - -------------------------- Example 3 -------------------------- - PS C:\> Get-Batch -BatchId 'batch_abc123' + (102415, 230, 102415, 240, 102415, 239) | ConvertFrom-Token -Encoding 'o200k_base' +# Output: 🍈🍒🍑 - Get a batch with ID of `batch_abc123`. + Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/Get-Batch.md - - - https://developers.openai.com/api/reference/resources/batches/methods/list/ - https://developers.openai.com/api/reference/resources/batches/methods/list/ + https://github.com/mkht/PSOpenAI/blob/main/Docs/ConvertFrom-Token.md - https://developers.openai.com/api/reference/resources/batches/methods/retrieve/ - https://developers.openai.com/api/reference/resources/batches/methods/retrieve/ + https://github.com/openai/tiktoken + https://github.com/openai/tiktoken - Get-BatchOutput - Get - BatchOutput + ConvertTo-Token + ConvertTo + Token - Retrieve batch output (result) items. + BPE tokeniser for use with OpenAI's models. - Retrieve batch output (result) items. + Encode text to tokens for use with OpenAI's models. (tokenize) +The output values are compatible with OpenAI tiktoken. - Get-BatchOutput - - BatchId + ConvertTo-Token + + Text - Specifies a Batch ID. + Specifies texts to be encoded. String @@ -3507,93 +3286,58 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN None - - Wait + + Encoding - When the Wait switch is used, it waits until that the Batch is completed and then returns the result. + Specifies the encoding name. Currently `cl100k_base` and `o200k_base` are supported. +It cannot be specified with the model name. + + cl100k_base + o200k_base + + String - SwitchParameter + String - False + cl100k_base - - TimeoutSec + + + ConvertTo-Token + + Text - Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). + Specifies texts to be encoded. - Int32 + String - Int32 + String - 0 + None - - MaxRetryCount + + Model - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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. - + Specifies the model name. such like `gpt-4` or `text-embedding-3-small`. +It cannot be specified with the encoding name. - Int32 + String - Int32 + String - 0 - - - ApiBase - - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` - - System.Uri - - System.Uri - - - https://api.openai.com/v1 - - - ApiKey - - Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` - - Object - - Object - - - None - - - Organization - - Specifies Organization ID which used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` - - string - - string - - - None + None - - BatchId + + Text - Specifies a Batch ID. + Specifies texts to be encoded. String @@ -3602,93 +3346,47 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN None - - Wait - - When the Wait switch is used, it waits until that the Batch is completed and then returns the result. - - SwitchParameter - - SwitchParameter - - - False - - - TimeoutSec - - Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). - - Int32 - - Int32 - - - 0 - - - MaxRetryCount + + Encoding - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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. - + Specifies the encoding name. Currently `cl100k_base` and `o200k_base` are supported. +It cannot be specified with the model name. - Int32 + String - Int32 + String - 0 + cl100k_base - - ApiBase + + Model - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` + Specifies the model name. such like `gpt-4` or `text-embedding-3-small`. +It cannot be specified with the encoding name. - System.Uri + String - System.Uri + String - https://api.openai.com/v1 + None - - ApiKey - - Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` - - Object + + + - Object - + System.String - None - - - Organization - Specifies Organization ID which used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + - string - - string - - - None - - - + + - PSCustomObject + System.Int32[] @@ -3697,166 +3395,196 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN - Batch output items are stored on OpenAI storage as JSONL files. This cmdlet does not delete files on the storage. + -------------------------- Example 1 -------------------------- - PS C:\> $Result = Get-BatchOutput 'batch_abc123' + $Text = Hello, world! +ConvertTo-Token -Text $Text -Model 'gpt-4' +# Output: (9906, 11, 1917, 0) - Get an output data in the specified ID of batch + + + + + -------------------------- Example 2 -------------------------- + '🍈🍒🍑' | ConvertTo-Token -Encoding 'o200k_base' +# Output: (102415, 230, 102415, 240, 102415, 239) + + Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/Get-BatchOutput.md + https://github.com/mkht/PSOpenAI/blob/main/Docs/ConvertTo-Token.md - https://developers.openai.com/api/reference/resources/batches/methods/retrieve/ - https://developers.openai.com/api/reference/resources/batches/methods/retrieve/ + https://github.com/openai/tiktoken + https://github.com/openai/tiktoken - Get-ChatCompletion - Get - ChatCompletion + Disconnect-RealtimeSession + Disconnect + RealtimeSession - Get stored chat completions. + Close realtime session. - Retrieves stored chat completions. Only chat completions that have been stored with the store parameter set to true will be returned. + Terminates a connected conversation session. If audio input/output is activated, they are also terminated. - Get-ChatCompletion - - CompletionId + Disconnect-RealtimeSession + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + PS C:\> Disconnect-RealtimeSession + + + + + + + + Online Version: + https://github.com/mkht/PSOpenAI/blob/main/Docs/Disconnect-RealtimeSession.md + + + + + + Enter-ChatGPT + Enter + ChatGPT + + Communicate with ChatGPT interactively on the console. + + + + Communicate with ChatGPT interactively on the console. +This command will wait for user input on the terminal. You type your question to ChatGPT and press Enter twice to send the question and see the answer from ChatGPT. You may then ask additional questions. + + + + Enter-ChatGPT + + Model - The ID of the chat completion to retrieve. + The name of model to use. The default value is `gpt-3.5-turbo`. String String - None + gpt-3.5-turbo - - TimeoutSec + + SystemMessage - Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). + An optional text to set the behavior of the assistant. - Int32 + String - Int32 + String - 0 + None - MaxRetryCount + Temperature - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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. - + 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. - Int32 + Double - Int32 + Double - 0 + None - - ApiBase + + TopP - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` + 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. - System.Uri + Double - System.Uri + Double - https://api.openai.com/v1 + None - - ApiKey + + StopSequence - Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` - - Object - - Object - - - None - - - Organization - - Specifies Organization ID which used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence. - string + String[] - string + String[] None - - - Get-ChatCompletion - - Limit + + MaxCompletionTokens - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + The maximum number of tokens allowed for the generated answer. +Maximum value depends on model. (`4096` for `gpt-3.5-turbo` or `8192` for `gpt-4`) Int32 Int32 - 20 + None - - All + + PresencePenalty - When this switch is specified, all objects will be retrieved. + Number between `-2.0` and `2.0`. +Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics. + Double - SwitchParameter + Double - False + None - - Order + + FrequencyPenalty - Sort order by the created timestamp of the objects. `asc` for ascending order and `desc` for descending order. The default is `asc` + Number between `-2.0` and `2.0`. +Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. - - asc - desc - - String + Double - String + Double - asc + None TimeoutSec @@ -3927,13 +3655,36 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN None + + NoHeader + + Suppresses the display of header strings + + + SwitchParameter + + + False + - - CompletionId + + Model - The ID of the chat completion to retrieve. + The name of model to use. The default value is `gpt-3.5-turbo`. + + String + + String + + + gpt-3.5-turbo + + + SystemMessage + + An optional text to set the behavior of the assistant. String @@ -3943,40 +3694,81 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN None - Limit + Temperature - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + 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. + + Double + + Double + + + None + + + TopP + + 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. + + Double + + Double + + + None + + + StopSequence + + Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence. + + String[] + + String[] + + + None + + + MaxCompletionTokens + + The maximum number of tokens allowed for the generated answer. +Maximum value depends on model. (`4096` for `gpt-3.5-turbo` or `8192` for `gpt-4`) Int32 Int32 - 20 + None - - All + + PresencePenalty - When this switch is specified, all objects will be retrieved. + Number between `-2.0` and `2.0`. +Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics. - SwitchParameter + Double - SwitchParameter + Double - False + None - - Order + + FrequencyPenalty - Sort order by the created timestamp of the objects. `asc` for ascending order and `desc` for descending order. The default is `asc` + Number between `-2.0` and `2.0`. +Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. - String + Double - String + Double - asc + None TimeoutSec @@ -4047,12 +3839,24 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN None + + NoHeader + + Suppresses the display of header strings + + SwitchParameter + + SwitchParameter + + + False + - PSCustomObject + System.Object @@ -4067,159 +3871,178 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN -------------------------- Example 1 -------------------------- - PS C:\> Get-ChatCompletion -CompletionId "chatcompl-abcd123" - - Get a completion with the specified ID. - - - - -------------------------- Example 2 -------------------------- - PS C:\> Get-ChatCompletion -All + PS C:\> Enter-ChatGPT -ApiKey 'YOUR_OPENAI_APIKEY' -NoHeader - Lists all stored completions. + ! Interactive Chat (/Docs/images/InteractiveChat.gif) Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/Get-ChatCompletion.md - - - https://developers.openai.com/api/reference/resources/chat/subresources/completions/methods/list/ - https://developers.openai.com/api/reference/resources/chat/subresources/completions/methods/list/ - - - https://developers.openai.com/api/reference/resources/chat/subresources/completions/methods/retrieve/ - https://developers.openai.com/api/reference/resources/chat/subresources/completions/methods/retrieve/ + https://github.com/mkht/PSOpenAI/blob/main/Docs/Enter-ChatGPT.md - Get-Container + Get-Agent Get - Container + Agent - Retrieves a container. + Retrieves or lists reusable agents. - Get a single container or list multiple containers. + Retrieves or lists reusable agents. This command uses the OpenAI Agents API public beta and sends the required `OpenAI-Beta: agents=v1` header. Nested, evolving request schemas are accepted through `-Body` where applicable. - Get-Container - - ContainerId + Get-Agent + + AdditionalBody - The ID of the container to retrieve. + Additional JSON properties to merge into the request body. - String + Object - String + Object None - - TimeoutSec + + AdditionalHeaders - Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). + Additional HTTP headers to include in the request. - Int32 + IDictionary - Int32 + IDictionary - 0 + None - - MaxRetryCount + + AdditionalQuery - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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 retried. + Additional query parameters to include in the request. - Int32 + IDictionary - Int32 + IDictionary - 0 + None - - ApiBase + + After - Specifies an API endpoint URL such as: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1`. + Cursor identifying the item after which to continue a cursor-based listing. - System.Uri + String - System.Uri + String - https://api.openai.com/v1 + None - - ApiKey + + All - Specifies API key for authentication. -The type of data should be `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY`. + Retrieves all available cursor-based pages. - Object - Object + SwitchParameter - None + False - - Organization + + ApiBase - Specifies Organization ID used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION`. + The base URI for the OpenAI API. - string + Uri - string + Uri None - - - Get-Container - + + ApiKey + + The OpenAI API key as a secure string. + + SecureString + + SecureString + + + None + + + ApiType + + The API provider. Agents API commands support OpenAI only. + + + OpenAI + Azure + + OpenAIApiType + + OpenAIApiType + + + None + + + AuthType + + The authentication type. Use openai for the Agents API. + + + openai + azure + azure_ad + + String + + String + + + None + + Limit - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + The maximum number of items to return in one page. Int32 Int32 - 20 + None - - All + + MaxRetryCount - When this switch is specified, all containers will be retrieved. + The maximum number of retries for transient API failures. + Int32 - SwitchParameter + Int32 - False + None - + Order - Sort order by the created timestamp of the objects. `asc` for ascending order and `desc` for descending order. The default is `asc`. + The order in which items are returned. asc @@ -4230,55 +4053,63 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN String - asc + None - + + Organization + + The OpenAI organization ID. + + String + + String + + + None + + TimeoutSec - Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). + The request timeout in seconds. Zero uses the module default. Int32 Int32 - 0 + None - - MaxRetryCount + + ProgressAction - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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 retried. + Controls how PowerShell responds to progress updates. - Int32 + ActionPreference - Int32 + ActionPreference - 0 + None - - ApiBase + + + Get-Agent + + AgentId - Specifies an API endpoint URL such as: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1`. + The reusable agent ID. - System.Uri + String - System.Uri + String - https://api.openai.com/v1 + None - - ApiKey + + AdditionalBody - Specifies API key for authentication. -The type of data should be `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY`. + Additional JSON properties to merge into the request body. Object @@ -4287,15 +4118,131 @@ If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_AP None - + + AdditionalHeaders + + Additional HTTP headers to include in the request. + + IDictionary + + IDictionary + + + None + + + AdditionalQuery + + Additional query parameters to include in the request. + + IDictionary + + IDictionary + + + None + + + ApiBase + + The base URI for the OpenAI API. + + Uri + + Uri + + + None + + + ApiKey + + The OpenAI API key as a secure string. + + SecureString + + SecureString + + + None + + + ApiType + + The API provider. Agents API commands support OpenAI only. + + + OpenAI + Azure + + OpenAIApiType + + OpenAIApiType + + + None + + + AuthType + + The authentication type. Use openai for the Agents API. + + + openai + azure + azure_ad + + String + + String + + + None + + + MaxRetryCount + + The maximum number of retries for transient API failures. + + Int32 + + Int32 + + + None + + Organization - Specifies Organization ID used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION`. + The OpenAI organization ID. - string + String - string + String + + + None + + + TimeoutSec + + The request timeout in seconds. Zero uses the module default. + + Int32 + + Int32 + + + None + + + ProgressAction + + Controls how PowerShell responds to progress updates. + + ActionPreference + + ActionPreference None @@ -4303,134 +4250,201 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN - - ContainerId + + AdditionalBody - The ID of the container to retrieve. + Additional JSON properties to merge into the request body. - String + Object - String + Object None - - Limit + + AdditionalHeaders - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + Additional HTTP headers to include in the request. - Int32 + IDictionary - Int32 + IDictionary - 20 + None - - All + + AdditionalQuery - When this switch is specified, all containers will be retrieved. + Additional query parameters to include in the request. - SwitchParameter + IDictionary - SwitchParameter + IDictionary - False + None - - Order + + After - Sort order by the created timestamp of the objects. `asc` for ascending order and `desc` for descending order. The default is `asc`. + Cursor identifying the item after which to continue a cursor-based listing. String String - asc + None - - TimeoutSec + + AgentId - Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). + The reusable agent ID. - Int32 + String - Int32 + String - 0 + None - - MaxRetryCount + + All - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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 retried. + Retrieves all available cursor-based pages. - Int32 + SwitchParameter - Int32 + SwitchParameter - 0 + False - + ApiBase - Specifies an API endpoint URL such as: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1`. + The base URI for the OpenAI API. - System.Uri + Uri - System.Uri + Uri - https://api.openai.com/v1 + None - + ApiKey - Specifies API key for authentication. -The type of data should be `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY`. + The OpenAI API key as a secure string. - Object + SecureString - Object + SecureString None - + + ApiType + + The API provider. Agents API commands support OpenAI only. + + OpenAIApiType + + OpenAIApiType + + + None + + + AuthType + + The authentication type. Use openai for the Agents API. + + String + + String + + + None + + + Limit + + The maximum number of items to return in one page. + + Int32 + + Int32 + + + None + + + MaxRetryCount + + The maximum number of retries for transient API failures. + + Int32 + + Int32 + + + None + + + Order + + The order in which items are returned. + + String + + String + + + None + + Organization - Specifies Organization ID used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION`. + The OpenAI organization ID. - string + String - string + String None - - - - + + TimeoutSec + + The request timeout in seconds. Zero uses the module default. + + Int32 - PSCustomObject + Int32 + + None + + + ProgressAction - + Controls how PowerShell responds to progress updates. - - + ActionPreference + + ActionPreference + + + None + + + + @@ -4439,60 +4453,42 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN -------------------------- Example 1 -------------------------- - PS C:\> Get-Container "cont_abc123" - - Get a container with the ID `cont_abc123`. - - - - -------------------------- Example 2 -------------------------- - PS C:\> Get-Container -Limit 5 -Order desc - - Get the latest 5 containers. - - - - -------------------------- Example 3 -------------------------- - PS C:\> Get-Container -All + Get-Agent -AgentId 'agent_123' - Get all containers. + Retrieves a reusable agent by ID. Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/Get-Container.md - - - https://developers.openai.com/api/reference/resources/containers/methods/retrieve/ - https://developers.openai.com/api/reference/resources/containers/methods/retrieve/ + https://github.com/mkht/PSOpenAI/blob/v5/Docs/Get-Agent.md - https://developers.openai.com/api/reference/resources/containers/methods/list/ - https://developers.openai.com/api/reference/resources/containers/methods/list/ + OpenAI Agents API + https://developers.openai.com/api/reference/typescript/resources/beta/subresources/agents - Get-ContainerFile + Get-AgentEnvironment Get - ContainerFile + AgentEnvironment - Retrieve Container File. + Retrieves a live agent environment. - Get a single file attached to a container, or list multiple files attached to a container. + Retrieves a live agent environment. This command uses the OpenAI Agents API public beta and sends the required `OpenAI-Beta: agents=v1` header. Nested, evolving request schemas are accepted through `-Body` where applicable. - Get-ContainerFile - - ContainerId + Get-AgentEnvironment + + EnvironmentId - The ID of the container. + The live agent environment ID. String @@ -4501,94 +4497,92 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN None - - FileId + + AdditionalBody - The ID of the file to retrieve. + Additional JSON properties to merge into the request body. - String + Object - String + Object None - - TimeoutSec + + AdditionalHeaders - Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). + Additional HTTP headers to include in the request. - Int32 + IDictionary - Int32 + IDictionary - 0 + None - - MaxRetryCount + + AdditionalQuery - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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 retried. + Additional query parameters to include in the request. - Int32 + IDictionary - Int32 + IDictionary - 0 + None - + ApiBase - Specifies an API endpoint URL such as: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1`. + The base URI for the OpenAI API. - System.Uri + Uri - System.Uri + Uri - https://api.openai.com/v1 + None - + ApiKey - Specifies API key for authentication. -The type of data should be `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY`. + The OpenAI API key as a secure string. - Object + SecureString - Object + SecureString None - - Organization + + ApiType - Specifies Organization ID used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION`. + The API provider. Agents API commands support OpenAI only. - string + + OpenAI + Azure + + OpenAIApiType - string + OpenAIApiType None - - - Get-ContainerFile - - ContainerId + + AuthType - The ID of the container. + The authentication type. Use openai for the Agents API. + + openai + azure + azure_ad + String String @@ -4596,256 +4590,204 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN None - - Limit + + MaxRetryCount - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + The maximum number of retries for transient API failures. Int32 Int32 - 20 - - - All - - When this switch is specified, all files attached to the container will be retrieved. - - - SwitchParameter - - - False + None - - Order + + Organization - Sort order by the created timestamp of the objects. `asc` for ascending order and `desc` for descending order. The default is `asc`. + The OpenAI organization ID. - - asc - desc - String String - asc + None - + TimeoutSec - Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). - - Int32 - - Int32 - - - 0 - - - MaxRetryCount - - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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 retried. + The request timeout in seconds. Zero uses the module default. Int32 Int32 - 0 + None - - ApiBase + + ProgressAction - Specifies an API endpoint URL such as: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1`. + Controls how PowerShell responds to progress updates. - System.Uri + ActionPreference - System.Uri + ActionPreference - https://api.openai.com/v1 - - - ApiKey - - Specifies API key for authentication. -The type of data should be `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY`. - - Object - - Object - - - None - - - Organization - - Specifies Organization ID used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION`. - - string - - string - - - None + None - - ContainerId + + AdditionalBody - The ID of the container. + Additional JSON properties to merge into the request body. - String + Object - String + Object None - - FileId + + AdditionalHeaders - The ID of the file to retrieve. + Additional HTTP headers to include in the request. - String + IDictionary - String + IDictionary None - - Limit + + AdditionalQuery - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + Additional query parameters to include in the request. - Int32 + IDictionary - Int32 + IDictionary - 20 + None - - All + + ApiBase - When this switch is specified, all files attached to the container will be retrieved. + The base URI for the OpenAI API. - SwitchParameter + Uri - SwitchParameter + Uri - False + None - - Order + + ApiKey - Sort order by the created timestamp of the objects. `asc` for ascending order and `desc` for descending order. The default is `asc`. + The OpenAI API key as a secure string. + + SecureString + + SecureString + + + None + + + ApiType + + The API provider. Agents API commands support OpenAI only. + + OpenAIApiType + + OpenAIApiType + + + None + + + AuthType + + The authentication type. Use openai for the Agents API. String String - asc + None - - TimeoutSec + + EnvironmentId - Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). + The live agent environment ID. - Int32 + String - Int32 + String - 0 + None - + MaxRetryCount - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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 retried. + The maximum number of retries for transient API failures. Int32 Int32 - 0 + None - - ApiBase + + Organization - Specifies an API endpoint URL such as: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1`. + The OpenAI organization ID. - System.Uri + String - System.Uri + String - https://api.openai.com/v1 + None - - ApiKey + + TimeoutSec - Specifies API key for authentication. -The type of data should be `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY`. + The request timeout in seconds. Zero uses the module default. - Object + Int32 - Object + Int32 None - - Organization + + ProgressAction - Specifies Organization ID used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION`. + Controls how PowerShell responds to progress updates. - string + ActionPreference - string + ActionPreference None - - - - PSCustomObject - - - - - - + @@ -4854,62 +4796,42 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN -------------------------- Example 1 -------------------------- - PS C:\> Get-ContainerFile -ContainerId 'cont_abc123' -FileId 'file-abc123' - - Get the file with ID `file-abc123` attached to the container with ID `cont_abc123`. - - - - -------------------------- Example 2 -------------------------- - PS C:\> Get-ContainerFile -ContainerId 'cont_abc123' -Limit 5 -Order desc + Get-AgentEnvironment -EnvironmentId 'env_123' - Get the latest 5 files attached to the container with ID `cont_abc123`. - - - - -------------------------- Example 3 -------------------------- - PS C:\> Get-ContainerFile -ContainerId 'cont_abc123' -All - - Get all files attached to the container with ID `cont_abc123`. + Retrieves the current state of a live agent environment. Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/Get-ContainerFile.md - - - https://developers.openai.com/api/reference/resources/containers/subresources/files/methods/retrieve/ - https://developers.openai.com/api/reference/resources/containers/subresources/files/methods/retrieve/ + https://github.com/mkht/PSOpenAI/blob/v5/Docs/Get-AgentEnvironment.md - https://developers.openai.com/api/reference/resources/containers/subresources/files/methods/list/ - https://developers.openai.com/api/reference/resources/containers/subresources/files/methods/list/ + OpenAI Agents API + https://developers.openai.com/api/reference/typescript/resources/beta/subresources/agents - Get-ContainerFileContent + Get-AgentEnvironmentFile Get - ContainerFileContent + AgentEnvironmentFile - Retrieve Container File Content + Lists files in a live agent environment. - Get the content of a file attached to a container. -You can specify the container and file by their IDs, or pass a ContainerFile object. -The content can be saved to a local file or output as a byte array. + Lists files in a live agent environment. This command uses the OpenAI Agents API public beta and sends the required `OpenAI-Beta: agents=v1` header. Nested, evolving request schemas are accepted through `-Body` where applicable. - Get-ContainerFileContent - - ContainerId + Get-AgentEnvironmentFile + + EnvironmentId - The ID of the container. + The live agent environment ID. String @@ -4918,120 +4840,132 @@ The content can be saved to a local file or output as a byte array. None - - FileId + + AdditionalBody - The ID of the file to retrieve. + Additional JSON properties to merge into the request body. - String + Object - String + Object None - - OutFile + + AdditionalHeaders - The path to the local file to save the content. -If not specified, the content is output as a byte array. + Additional HTTP headers to include in the request. - String + IDictionary - String + IDictionary None - - TimeoutSec + + AdditionalQuery - Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). + Additional query parameters to include in the request. - Int32 + IDictionary - Int32 + IDictionary - 0 + None - - MaxRetryCount + + ApiBase - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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 retried. + The base URI for the OpenAI API. - Int32 + Uri - Int32 + Uri - 0 + None - - ApiBase + + ApiKey - Specifies an API endpoint URL such as: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1`. + The OpenAI API key as a secure string. - System.Uri + SecureString - System.Uri + SecureString - https://api.openai.com/v1 + None - - ApiKey + + ApiType - Specifies API key for authentication. -The type of data should be `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY`. + The API provider. Agents API commands support OpenAI only. - Object + + OpenAI + Azure + + OpenAIApiType - Object + OpenAIApiType None - - Organization + + AuthType - Specifies Organization ID used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION`. + The authentication type. Use openai for the Agents API. - string + + openai + azure + azure_ad + + String - string + String None - - - Get-ContainerFileContent - - ContainerFile + + Limit - A ContainerFile object from Get-ContainerFile. + The maximum number of items to return in one page. - PSCustomObject + Int32 - PSCustomObject + Int32 None - - OutFile + + MaxRetryCount - The path to the local file to save the content. -If not specified, the content is output as a byte array. + The maximum number of retries for transient API failures. + + Int32 + + Int32 + + + None + + + Order + + The order in which items are returned. + + asc + desc + String String @@ -5039,70 +4973,62 @@ If not specified, the content is output as a byte array. None - - TimeoutSec + + Organization - Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). + The OpenAI organization ID. - Int32 + String - Int32 + String - 0 + None - - MaxRetryCount + + Page - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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 retried. + The opaque environment-file page token returned by the preceding request. - Int32 + String - Int32 + String - 0 + None - - ApiBase + + Path - Specifies an API endpoint URL such as: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1`. + Restricts environment-file results to this absolute workspace path. - System.Uri + String - System.Uri + String - https://api.openai.com/v1 + None - - ApiKey + + TimeoutSec - Specifies API key for authentication. -The type of data should be `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY`. + The request timeout in seconds. Zero uses the module default. - Object + Int32 - Object + Int32 None - - Organization + + ProgressAction - Specifies Organization ID used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION`. + Controls how PowerShell responds to progress updates. - string + ActionPreference - string + ActionPreference None @@ -5110,47 +5036,82 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN - - ContainerId + + AdditionalBody - The ID of the container. + Additional JSON properties to merge into the request body. - String + Object - String + Object None - - FileId + + AdditionalHeaders - The ID of the file to retrieve. + Additional HTTP headers to include in the request. - String + IDictionary - String + IDictionary None - - ContainerFile + + AdditionalQuery - A ContainerFile object from Get-ContainerFile. + Additional query parameters to include in the request. - PSCustomObject + IDictionary - PSCustomObject + IDictionary None - - OutFile + + ApiBase - The path to the local file to save the content. -If not specified, the content is output as a byte array. + The base URI for the OpenAI API. + + Uri + + Uri + + + None + + + ApiKey + + The OpenAI API key as a secure string. + + SecureString + + SecureString + + + None + + + ApiType + + The API provider. Agents API commands support OpenAI only. + + OpenAIApiType + + OpenAIApiType + + + None + + + AuthType + + The authentication type. Use openai for the Agents API. String @@ -5159,86 +5120,117 @@ If not specified, the content is output as a byte array. None - - TimeoutSec + + EnvironmentId - Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). + The live agent environment ID. + + String + + String + + + None + + + Limit + + The maximum number of items to return in one page. Int32 Int32 - 0 + None - + MaxRetryCount - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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 retried. + The maximum number of retries for transient API failures. Int32 Int32 - 0 + None - - ApiBase + + Order - Specifies an API endpoint URL such as: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1`. + The order in which items are returned. - System.Uri + String - System.Uri + String - https://api.openai.com/v1 + None - - ApiKey + + Organization - Specifies API key for authentication. -The type of data should be `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY`. + The OpenAI organization ID. - Object + String - Object + String None - - Organization + + Page - Specifies Organization ID used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION`. + The opaque environment-file page token returned by the preceding request. - string + String - string + String None - - - - + + Path + + Restricts environment-file results to this absolute workspace path. + + String - Byte[] + String + + None + + + TimeoutSec - If `-OutFile` is not specified, outputs the file content as a byte array. + The request timeout in seconds. Zero uses the module default. - - + Int32 + + Int32 + + + None + + + ProgressAction + + Controls how PowerShell responds to progress updates. + + ActionPreference + + ActionPreference + + + None + + + + @@ -5247,112 +5239,113 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN -------------------------- Example 1 -------------------------- - PS C:\> Get-ContainerFileContent -ContainerId 'cont_abc123' -FileId 'file-abc123' -OutFile 'C:\data\sample.pdf' - - Download the file content and save it to `C:\data\sample.pdf`. - - - - -------------------------- Example 2 -------------------------- - PS C:\> $ContentBytes = Get-ContainerFileContent -ContainerId 'cont_abc123' -FileId 'file-abc123' - - Download the file content and output as a byte array. - - - - -------------------------- Example 3 -------------------------- - PS C:\> $File = Get-ContainerFile -ContainerId 'cont_abc123' -FileId 'file-abc123' -PS C:\> Get-ContainerFileContent -ContainerFile $File -OutFile 'C:\data\sample.pdf' + Get-AgentEnvironmentFile -EnvironmentId 'env_123' -Path '/workspace' - Download the file content using a ContainerFile object and save it to a local file. + Lists files in the specified workspace directory. Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/Get-ContainerFileContent.md + https://github.com/mkht/PSOpenAI/blob/v5/Docs/Get-AgentEnvironmentFile.md - https://developers.openai.com/api/reference/resources/containers/subresources/files/subresources/content/methods/retrieve/ - https://developers.openai.com/api/reference/resources/containers/subresources/files/subresources/content/methods/retrieve/ + OpenAI Agents API + https://developers.openai.com/api/reference/typescript/resources/beta/subresources/agents - Get-Conversation + Get-AgentEnvironmentTemplate Get - Conversation + AgentEnvironmentTemplate - Get a conversation with the given ID. + Retrieves or lists reusable agent environment templates. - Get a conversation with the given ID. + Retrieves or lists reusable agent environment templates. This command uses the OpenAI Agents API public beta and sends the required `OpenAI-Beta: agents=v1` header. Nested, evolving request schemas are accepted through `-Body` where applicable. - Get-Conversation - - ConversationId + Get-AgentEnvironmentTemplate + + AdditionalBody - The unique identifier of the conversation to retrieve. + Additional JSON properties to merge into the request body. - String + Object - String + Object None - - TimeoutSec + + AdditionalHeaders - Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). + Additional HTTP headers to include in the request. - Int32 + IDictionary - Int32 + IDictionary - 0 + None - - MaxRetryCount + + AdditionalQuery - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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 retried. + Additional query parameters to include in the request. - Int32 + IDictionary - Int32 + IDictionary - 0 + None - + + After + + Cursor identifying the item after which to continue a cursor-based listing. + + String + + String + + + None + + + All + + Retrieves all available cursor-based pages. + + + SwitchParameter + + + False + + ApiBase - Specifies an API endpoint URL such as: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1`. + The base URI for the OpenAI API. - System.Uri + Uri - System.Uri + Uri - https://api.openai.com/v1 + None - + ApiKey - Specifies API key for authentication. -The type of data should be `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY`. + The OpenAI API key as a secure string. SecureString @@ -5361,146 +5354,32 @@ If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_AP None - - - - - ConversationId - - The unique identifier of the conversation to retrieve. - - String - - String - - - None - - - TimeoutSec - - Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). - - Int32 - - Int32 - - - 0 - - - MaxRetryCount - - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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 retried. - - Int32 - - Int32 - - - 0 - - - ApiBase - - Specifies an API endpoint URL such as: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1`. - - System.Uri - - System.Uri - - - https://api.openai.com/v1 - - - ApiKey - - Specifies API key for authentication. -The type of data should be `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY`. - - SecureString - - SecureString - - - None - - - - - - - PSCustomObject - - - - - - - - - - - - - - -------------------------- Example 1 -------------------------- - PS C:\> $Conversation = Get-Conversation -ConversationId 'conv_abc123' - - Retrieves a Conversation object with the ID `conv_abc123`. - - - - - - Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/Get-Conversation.md - - - https://developers.openai.com/api/reference/resources/conversations/methods/retrieve/ - https://developers.openai.com/api/reference/resources/conversations/methods/retrieve/ - - - - - - Get-ConversationItem - Get - ConversationItem - - List items or get a specific item from a conversation. - - - - Retrieves items from a conversation or a specific item by its ID. -Supports pagination, ordering, and additional query options. - - - - Get-ConversationItem - - ConversationId + + ApiType - The unique identifier of the conversation. + The API provider. Agents API commands support OpenAI only. - String + + OpenAI + Azure + + OpenAIApiType - String + OpenAIApiType None - - ItemId + + AuthType - The unique identifier of the item to retrieve. + The authentication type. Use openai for the Agents API. + + openai + azure + azure_ad + String String @@ -5508,35 +5387,39 @@ Supports pagination, ordering, and additional query options. None - + Limit - The maximum number of items to retrieve per request. -Default is `20`. Maximum is `100`. + The maximum number of items to return in one page. Int32 Int32 - 20 + None - - All + + MaxRetryCount - If specified, retrieves all items by automatically handling pagination. + The maximum number of retries for transient API failures. + Int32 - SwitchParameter + Int32 - False + None - - After + + Order - A cursor for pagination. Retrieves items after the specified item ID. + The order in which items are returned. + + asc + desc + String String @@ -5544,124 +5427,253 @@ Default is `20`. Maximum is `100`. None - - Order + + Organization - The order in which to return items. Allowed values: `asc`, `desc`. Default is `asc`. + The OpenAI organization ID. String String - asc + None - - Include + + TimeoutSec - Specify additional output data to include in the model response. + The request timeout in seconds. Zero uses the module default. - String[] + Int32 - String[] + Int32 None - - TimeoutSec + + ProgressAction - Specifies how long the request can be pending before it times out. -Default is `0` (infinite). + Controls how PowerShell responds to progress updates. - Int32 + ActionPreference - Int32 + ActionPreference - 0 + None - - MaxRetryCount + + + Get-AgentEnvironmentTemplate + + EnvironmentTemplateId - Specifies the maximum number of retries if the request fails. -Default is `0` (No retry). + The reusable agent environment template ID. - Int32 + String - Int32 + String - 0 + None - - ApiBase + + AdditionalBody - Specifies the API endpoint URL. + Additional JSON properties to merge into the request body. - System.Uri + Object - System.Uri + Object None - - ApiKey + + AdditionalHeaders - Specifies the API key for authentication. + Additional HTTP headers to include in the request. - SecureString + IDictionary - SecureString + IDictionary None - - - - - ConversationId - - The unique identifier of the conversation. - - String + + AdditionalQuery + + Additional query parameters to include in the request. + + IDictionary + + IDictionary + + + None + + + ApiBase + + The base URI for the OpenAI API. + + Uri + + Uri + + + None + + + ApiKey + + The OpenAI API key as a secure string. + + SecureString + + SecureString + + + None + + + ApiType + + The API provider. Agents API commands support OpenAI only. + + + OpenAI + Azure + + OpenAIApiType + + OpenAIApiType + + + None + + + AuthType + + The authentication type. Use openai for the Agents API. + + + openai + azure + azure_ad + + String + + String + + + None + + + MaxRetryCount + + The maximum number of retries for transient API failures. + + Int32 + + Int32 + + + None + + + Organization + + The OpenAI organization ID. + + String + + String + + + None + + + TimeoutSec + + The request timeout in seconds. Zero uses the module default. + + Int32 + + Int32 + + + None + + + ProgressAction + + Controls how PowerShell responds to progress updates. + + ActionPreference + + ActionPreference + + + None + + + + + + AdditionalBody + + Additional JSON properties to merge into the request body. + + Object - String + Object None - - ItemId + + AdditionalHeaders - The unique identifier of the item to retrieve. + Additional HTTP headers to include in the request. - String + IDictionary - String + IDictionary None - - Limit + + AdditionalQuery - The maximum number of items to retrieve per request. -Default is `20`. Maximum is `100`. + Additional query parameters to include in the request. - Int32 + IDictionary - Int32 + IDictionary - 20 + None - + + After + + Cursor identifying the item after which to continue a cursor-based listing. + + String + + String + + + None + + All - If specified, retrieves all items by automatically handling pagination. + Retrieves all available cursor-based pages. SwitchParameter @@ -5670,113 +5682,141 @@ Default is `20`. Maximum is `100`. False - - After + + ApiBase - A cursor for pagination. Retrieves items after the specified item ID. + The base URI for the OpenAI API. - String + Uri - String + Uri None - - Order + + ApiKey - The order in which to return items. Allowed values: `asc`, `desc`. Default is `asc`. + The OpenAI API key as a secure string. + + SecureString + + SecureString + + + None + + + ApiType + + The API provider. Agents API commands support OpenAI only. + + OpenAIApiType + + OpenAIApiType + + + None + + + AuthType + + The authentication type. Use openai for the Agents API. String String - asc + None - - Include + + EnvironmentTemplateId - Specify additional output data to include in the model response. + The reusable agent environment template ID. - String[] + String - String[] + String None - - TimeoutSec + + Limit - Specifies how long the request can be pending before it times out. -Default is `0` (infinite). + The maximum number of items to return in one page. Int32 Int32 - 0 + None - + MaxRetryCount - Specifies the maximum number of retries if the request fails. -Default is `0` (No retry). + The maximum number of retries for transient API failures. Int32 Int32 - 0 + None - - ApiBase + + Order - Specifies the API endpoint URL. + The order in which items are returned. - System.Uri + String - System.Uri + String None - - ApiKey + + Organization - Specifies the API key for authentication. + The OpenAI organization ID. - SecureString + String - SecureString + String None - - - - - String - + + TimeoutSec - + The request timeout in seconds. Zero uses the module default. - - - - + Int32 - PSCustomObject + Int32 + + None + + + ProgressAction - + Controls how PowerShell responds to progress updates. - - + ActionPreference + + ActionPreference + + + None + + + + @@ -5785,213 +5825,78 @@ Default is `0` (No retry). -------------------------- Example 1 -------------------------- - PS C:\> Get-ConversationItem -ConversationId 'conv_abc123' -Limit 10 - - Retrieves the list of items in the conversation with ID `conv_abc123`. Limits the result to 10 items. - - - - -------------------------- Example 2 -------------------------- - PS C:\> Get-ConversationItem -ConversationId 'conv_abc123' -ItemId 'item_xyz789' - - Retrieves a specific item with ID `item_xyz789` from the conversation `conv_abc123`. - - - - -------------------------- Example 3 -------------------------- - PS C:\> Get-ConversationItem -ConversationId 'conv_abc123' -All + Get-AgentEnvironmentTemplate -EnvironmentTemplateId 'envtpl_123' - Retrieves all items from the conversation, handling pagination automatically. + Retrieves a reusable environment template by ID. Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/Get-ConversationItem.md - - - https://developers.openai.com/api/reference/resources/conversations/subresources/items/methods/retrieve - https://developers.openai.com/api/reference/resources/conversations/subresources/items/methods/retrieve + https://github.com/mkht/PSOpenAI/blob/v5/Docs/Get-AgentEnvironmentTemplate.md - https://developers.openai.com/api/reference/resources/conversations/subresources/items/methods/list - https://developers.openai.com/api/reference/resources/conversations/subresources/items/methods/list + OpenAI Agents API + https://developers.openai.com/api/reference/typescript/resources/beta/subresources/agents - Get-CosineSimilarity + Get-AgentSession Get - CosineSimilarity + AgentSession - Calculate cosine similarity between two vectors. + Retrieves or lists agent sessions. - Calculate cosine similarity between two vectors. + Retrieves or lists agent sessions. This command uses the OpenAI Agents API public beta and sends the required `OpenAI-Beta: agents=v1` header. Nested, evolving request schemas are accepted through `-Body` where applicable. - Get-CosineSimilarity - - Vector1 + Get-AgentSession + + AdditionalBody - First vector + Additional JSON properties to merge into the request body. - Double[] + Object - Double[] + Object None - - Vector2 + + AdditionalHeaders - Second vector. The dimension is must same as first vector. + Additional HTTP headers to include in the request. - Double[] + IDictionary - Double[] + IDictionary None - - - - - Vector1 - - First vector - - Double[] - - Double[] - - - None - - - Vector2 - - Second vector. The dimension is must same as first vector. - - Double[] - - Double[] - - - None - - - - - - - System.Double - - - - - - - - - - - - - - -------------------------- Example 1 -------------------------- - PS C:\> $v1 = (-0.01302161, -0.01999075, 0.007301898) -PS C:\> $v2 = (0.01506045, -0.04311577, 0.01272033) -PS C:\> Get-CosineSimilarity $v1 $v2 -0.00144161334877118 - - - - - - - - Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/Get-CosineSimilarity.md - - - - - - Set-OpenAIContext - Set - OpenAIContext - - Gets common parameters that are implicitly used when executing functions. - - - - Gets the common parameter context that is set by Set-OpenAIContext. Note: Objects obtained with Get-OpenAIContext are read-only, and changes to their property values are not reflected in the context. To set the context, use Set-OpenAIContext. - - - - Set-OpenAIContext - - - - - - - - - - - - - -------------------------- Example 1 -------------------------- - PS C:\> Set-OpenAIContext -ApiType 'Azure' -ApiKey 'AZURE_API_KEY' -ApiBase 'https://my-endpoint.openai.azure.com/' -PS C:\> Get-OpenAIContext - -ApiKey : System.Security.SecureString -ApiType : Azure -ApiBase : https://my-endpoint.openai.azure.com/ -ApiVersion : -AuthType : azure -Organization : -TimeoutSec : 0 -MaxRetryCount : 0 - - - - - - - - Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/Get-OpenAIContext.md - - - - - - Get-OpenAIFile - Get - OpenAIFile - - Retrieves information about files stored in OpenAI, allowing for listing and retrieving specific files. - - - - Retrieves information about files stored in OpenAI, allowing for listing and retrieving specific files. - - - - Get-OpenAIFile - - FileId + + AdditionalQuery - Specifies the ID of the file to be retrieved. + Additional query parameters to include in the request. + + IDictionary + + IDictionary + + + None + + + After + + Cursor identifying the item after which to continue a cursor-based listing. String @@ -6000,83 +5905,79 @@ MaxRetryCount : 0 None - - TimeoutSec + + AgentId - Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). + The reusable agent ID. - Int32 + String - Int32 + String - 0 + None - - MaxRetryCount + + All - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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. - + Retrieves all available cursor-based pages. - Int32 - Int32 + SwitchParameter - 0 + False - + ApiBase - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` + The base URI for the OpenAI API. - System.Uri + Uri - System.Uri + Uri - https://api.openai.com/v1 + None - + ApiKey - Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + The OpenAI API key as a secure string. - Object + SecureString - Object + SecureString None - - Organization + + ApiType - Specifies Organization ID which used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + The API provider. Agents API commands support OpenAI only. - string + + OpenAI + Azure + + OpenAIApiType - string + OpenAIApiType None - - - Get-OpenAIFile - - Purpose + + AuthType - Only return files with the given purpose. + The authentication type. Use openai for the Agents API. + + openai + azure + azure_ad + String String @@ -6084,33 +5985,34 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN None - + Limit - A limit on the number of objects to be returned. Limit can range between 1 and 10000, and the default is 10000. + The maximum number of items to return in one page. Int32 Int32 - 10000 + None - - All + + MaxRetryCount - When this switch is specified, all objects will be retrieved. + The maximum number of retries for transient API failures. + Int32 - SwitchParameter + Int32 - False + None - + Order - Sort order by the created timestamp of the objects. `asc` for ascending order and `desc` for descending order. The default is `desc` + The order in which items are returned. asc @@ -6121,56 +6023,63 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN String - desc + None - - TimeoutSec + + Organization - Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). + The OpenAI organization ID. - Int32 + String - Int32 + String - 0 + None - - MaxRetryCount + + TimeoutSec - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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. - + The request timeout in seconds. Zero uses the module default. Int32 Int32 - 0 + None - - ApiBase + + ProgressAction - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` + Controls how PowerShell responds to progress updates. - System.Uri + ActionPreference - System.Uri + ActionPreference - https://api.openai.com/v1 + None - - ApiKey + + + Get-AgentSession + + SessionId - Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + The managed agent session ID. + + String + + String + + + None + + + AdditionalBody + + Additional JSON properties to merge into the request body. Object @@ -6179,15 +6088,131 @@ If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_AP None - + + AdditionalHeaders + + Additional HTTP headers to include in the request. + + IDictionary + + IDictionary + + + None + + + AdditionalQuery + + Additional query parameters to include in the request. + + IDictionary + + IDictionary + + + None + + + ApiBase + + The base URI for the OpenAI API. + + Uri + + Uri + + + None + + + ApiKey + + The OpenAI API key as a secure string. + + SecureString + + SecureString + + + None + + + ApiType + + The API provider. Agents API commands support OpenAI only. + + + OpenAI + Azure + + OpenAIApiType + + OpenAIApiType + + + None + + + AuthType + + The authentication type. Use openai for the Agents API. + + + openai + azure + azure_ad + + String + + String + + + None + + + MaxRetryCount + + The maximum number of retries for transient API failures. + + Int32 + + Int32 + + + None + + Organization - Specifies Organization ID which used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + The OpenAI organization ID. - string + String - string + String + + + None + + + TimeoutSec + + The request timeout in seconds. Zero uses the module default. + + Int32 + + Int32 + + + None + + + ProgressAction + + Controls how PowerShell responds to progress updates. + + ActionPreference + + ActionPreference None @@ -6195,22 +6220,46 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN - - FileId + + AdditionalBody - Specifies the ID of the file to be retrieved. + Additional JSON properties to merge into the request body. - String + Object - String + Object None - - Purpose + + AdditionalHeaders - Only return files with the given purpose. + Additional HTTP headers to include in the request. + + IDictionary + + IDictionary + + + None + + + AdditionalQuery + + Additional query parameters to include in the request. + + IDictionary + + IDictionary + + + None + + + After + + Cursor identifying the item after which to continue a cursor-based listing. String @@ -6219,22 +6268,22 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN None - - Limit + + AgentId - A limit on the number of objects to be returned. Limit can range between 1 and 10000, and the default is 10000. + The reusable agent ID. - Int32 + String - Int32 + String - 10000 + None - + All - When this switch is specified, all objects will be retrieved. + Retrieves all available cursor-based pages. SwitchParameter @@ -6243,100 +6292,142 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN False - - Order + + ApiBase - Sort order by the created timestamp of the objects. `asc` for ascending order and `desc` for descending order. The default is `desc` + The base URI for the OpenAI API. + + Uri + + Uri + + + None + + + ApiKey + + The OpenAI API key as a secure string. + + SecureString + + SecureString + + + None + + + ApiType + + The API provider. Agents API commands support OpenAI only. + + OpenAIApiType + + OpenAIApiType + + + None + + + AuthType + + The authentication type. Use openai for the Agents API. String String - desc + None - - TimeoutSec + + Limit - Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). + The maximum number of items to return in one page. Int32 Int32 - 0 + None - + MaxRetryCount - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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. - + The maximum number of retries for transient API failures. Int32 Int32 - 0 + None - - ApiBase + + Order - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` + The order in which items are returned. - System.Uri + String - System.Uri + String - https://api.openai.com/v1 + None - - ApiKey + + Organization - Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + The OpenAI organization ID. - Object + String - Object + String None - - Organization + + SessionId - Specifies Organization ID which used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + The managed agent session ID. - string + String - string + String None - - - - + + TimeoutSec + + The request timeout in seconds. Zero uses the module default. + + Int32 - PSCustomObject + Int32 + + None + + + ProgressAction - + Controls how PowerShell responds to progress updates. - - - + ActionPreference + + ActionPreference + + + None + + + + + @@ -6344,54 +6435,42 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN -------------------------- Example 1 -------------------------- - PS C:\> Get-OpenAIFile -FileId "file-abc123" - - This command retrieves a file with the specified ID from OpenAI. - - - - -------------------------- Example 2 -------------------------- - PS C:\> Get-OpenAIFile -Purpose "assistants" -All + Get-AgentSession -SessionId 'session_123' - Lists all files where the purpose attribute is assistants. + Retrieves a managed agent session by ID. Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/Get-OpenAIFile.md - - - https://developers.openai.com/api/reference/resources/files/methods/list/ - https://developers.openai.com/api/reference/resources/files/methods/list/ + https://github.com/mkht/PSOpenAI/blob/v5/Docs/Get-AgentSession.md - https://developers.openai.com/api/reference/resources/files/methods/retrieve/ - https://developers.openai.com/api/reference/resources/files/methods/retrieve/ + OpenAI Agents API + https://developers.openai.com/api/reference/typescript/resources/beta/subresources/agents - Get-OpenAIFileContent + Get-AgentSessionArtifact Get - OpenAIFileContent + AgentSessionArtifact - Retrieves the contents of a file. + Retrieves or lists immutable session artifacts. - Retrieves the contents of a file. You can choose to output as a byte array or save to a file. -Note: The OpenAI API specification limits the types of files whose contents can be retrieved. + Retrieves or lists immutable session artifacts. This command uses the OpenAI Agents API public beta and sends the required `OpenAI-Beta: agents=v1` header. Nested, evolving request schemas are accepted through `-Body` where applicable. - Get-OpenAIFileContent - - FileId + Get-AgentSessionArtifact + + SessionId - The ID of the file to use for this request. + The managed agent session ID. String @@ -6400,10 +6479,46 @@ Note: The OpenAI API specification limits the types of files whose contents can None - - OutFile + + AdditionalBody - The path of the file to save. + Additional JSON properties to merge into the request body. + + Object + + Object + + + None + + + AdditionalHeaders + + Additional HTTP headers to include in the request. + + IDictionary + + IDictionary + + + None + + + AdditionalQuery + + Additional query parameters to include in the request. + + IDictionary + + IDictionary + + + None + + + After + + Cursor identifying the item after which to continue a cursor-based listing. String @@ -6412,71 +6527,170 @@ Note: The OpenAI API specification limits the types of files whose contents can None - - TimeoutSec + + All - Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). + Retrieves all available cursor-based pages. + + + SwitchParameter + + + False + + + ApiBase + + The base URI for the OpenAI API. + + Uri + + Uri + + + None + + + ApiKey + + The OpenAI API key as a secure string. + + SecureString + + SecureString + + + None + + + ApiType + + The API provider. Agents API commands support OpenAI only. + + + OpenAI + Azure + + OpenAIApiType + + OpenAIApiType + + + None + + + ArtifactId + + The session artifact ID. + + String + + String + + + None + + + AuthType + + The authentication type. Use openai for the Agents API. + + + openai + azure + azure_ad + + String + + String + + + None + + + EnvironmentId + + The live agent environment ID. + + String + + String + + + None + + + Limit + + The maximum number of items to return in one page. Int32 Int32 - 0 + None - + MaxRetryCount - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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. - + The maximum number of retries for transient API failures. Int32 Int32 - 0 + None - - ApiBase + + Order - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` + The order in which items are returned. - System.Uri + + asc + desc + + String - System.Uri + String - https://api.openai.com/v1 + None - - ApiKey + + Organization - Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + The OpenAI organization ID. - Object + String - Object + String None - - Organization + + TimeoutSec - Specifies Organization ID which used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + The request timeout in seconds. Zero uses the module default. - string + Int32 - string + Int32 + + + None + + + ProgressAction + + Controls how PowerShell responds to progress updates. + + ActionPreference + + ActionPreference None @@ -6484,111 +6698,225 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN - - FileId + + AdditionalBody - The ID of the file to use for this request. + Additional JSON properties to merge into the request body. - String + Object - String + Object None - - OutFile + + AdditionalHeaders - The path of the file to save. + Additional HTTP headers to include in the request. - String + IDictionary - String + IDictionary None - - TimeoutSec + + AdditionalQuery - Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). + Additional query parameters to include in the request. - Int32 + IDictionary - Int32 + IDictionary - 0 + None - - MaxRetryCount + + After - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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. - + Cursor identifying the item after which to continue a cursor-based listing. - Int32 + String - Int32 + String - 0 + None - - ApiBase + + All - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` + Retrieves all available cursor-based pages. - System.Uri + SwitchParameter - System.Uri + SwitchParameter - https://api.openai.com/v1 + False - - ApiKey + + ApiBase - Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + The base URI for the OpenAI API. - Object + Uri - Object + Uri None - - Organization + + ApiKey - Specifies Organization ID which used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + The OpenAI API key as a secure string. - string + SecureString - string + SecureString None - - - - + + ApiType + + The API provider. Agents API commands support OpenAI only. + + OpenAIApiType - [System.Byte[]] + OpenAIApiType + + None + + + ArtifactId - + The session artifact ID. - - + String + + String + + + None + + + AuthType + + The authentication type. Use openai for the Agents API. + + String + + String + + + None + + + EnvironmentId + + The live agent environment ID. + + String + + String + + + None + + + Limit + + The maximum number of items to return in one page. + + Int32 + + Int32 + + + None + + + MaxRetryCount + + The maximum number of retries for transient API failures. + + Int32 + + Int32 + + + None + + + Order + + The order in which items are returned. + + String + + String + + + None + + + Organization + + The OpenAI organization ID. + + String + + String + + + None + + + SessionId + + The managed agent session ID. + + String + + String + + + None + + + TimeoutSec + + The request timeout in seconds. Zero uses the module default. + + Int32 + + Int32 + + + None + + + ProgressAction + + Controls how PowerShell responds to progress updates. + + ActionPreference + + ActionPreference + + + None + + + + @@ -6597,45 +6925,42 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN -------------------------- Example 1 -------------------------- - PS C:\> Get-OpenAIFileContent -FileId 'file-abc123' -OutFile C:\file.csv + Get-AgentSessionArtifact -SessionId 'session_123' -ArtifactId 'artifact_123' - Retrieve the contents of the file whose ID is file-abc123 and save it to C:\file.csv + Retrieves artifact metadata from a managed session. Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/Get-OpenAIFileContent.md + https://github.com/mkht/PSOpenAI/blob/v5/Docs/Get-AgentSessionArtifact.md - https://developers.openai.com/api/reference/resources/files/methods/content - https://developers.openai.com/api/reference/resources/files/methods/content + OpenAI Agents API + https://developers.openai.com/api/reference/typescript/resources/beta/subresources/agents - Get-OpenAIModels + Get-AgentSessionArtifactContent Get - OpenAIModels + AgentSessionArtifactContent - Lists the currently available models. + Downloads the binary content of a session artifact. - Lists the currently available models, and provides basic information about each one such as the owner and availability. -You can refer to the Models documentation to understand what models are available and the differences between them. -https://developers.openai.com/api/reference/resources/models/methods/list/ + Downloads the binary content of a session artifact. This command uses the OpenAI Agents API public beta and sends the required `OpenAI-Beta: agents=v1` header. Nested, evolving request schemas are accepted through `-Body` where applicable. - Get-OpenAIModels - - Name + Get-AgentSessionArtifactContent + + SessionId - Specifies the model name which you wish to get. -If not specified, lists all available models. + The managed agent session ID. String @@ -6644,71 +6969,155 @@ If not specified, lists all available models. None - - TimeoutSec + + ArtifactId - Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). + The session artifact ID. - Int32 + String - Int32 + String - 0 + None - - MaxRetryCount + + AdditionalHeaders - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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. - + Additional HTTP headers to include in the request. - Int32 + IDictionary - Int32 + IDictionary - 0 + None - + + AdditionalQuery + + Additional query parameters to include in the request. + + IDictionary + + IDictionary + + + None + + ApiBase - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` + The base URI for the OpenAI API. - System.Uri + Uri - System.Uri + Uri - https://api.openai.com/v1 + None - + ApiKey - Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + The OpenAI API key as a secure string. - Object + SecureString - Object + SecureString None - + + ApiType + + The API provider. Agents API commands support OpenAI only. + + + OpenAI + Azure + + OpenAIApiType + + OpenAIApiType + + + None + + + AuthType + + The authentication type. Use openai for the Agents API. + + + openai + azure + azure_ad + + String + + String + + + None + + + MaxRetryCount + + The maximum number of retries for transient API failures. + + Int32 + + Int32 + + + None + + Organization - Specifies Organization ID which used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + The OpenAI organization ID. - string + String - string + String + + + None + + + OutFile + + The local path where downloaded artifact content is saved. + + String + + String + + + None + + + TimeoutSec + + The request timeout in seconds. Zero uses the module default. + + Int32 + + Int32 + + + None + + + ProgressAction + + Controls how PowerShell responds to progress updates. + + ActionPreference + + ActionPreference None @@ -6716,11 +7125,70 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN - - Name + + AdditionalHeaders - Specifies the model name which you wish to get. -If not specified, lists all available models. + Additional HTTP headers to include in the request. + + IDictionary + + IDictionary + + + None + + + AdditionalQuery + + Additional query parameters to include in the request. + + IDictionary + + IDictionary + + + None + + + ApiBase + + The base URI for the OpenAI API. + + Uri + + Uri + + + None + + + ApiKey + + The OpenAI API key as a secure string. + + SecureString + + SecureString + + + None + + + ApiType + + The API provider. Agents API commands support OpenAI only. + + OpenAIApiType + + OpenAIApiType + + + None + + + ArtifactId + + The session artifact ID. String @@ -6729,87 +7197,93 @@ If not specified, lists all available models. None - - TimeoutSec + + AuthType - Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). + The authentication type. Use openai for the Agents API. - Int32 + String - Int32 + String - 0 + None - + MaxRetryCount - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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. - + The maximum number of retries for transient API failures. Int32 Int32 - 0 + None - - ApiBase + + Organization - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` + The OpenAI organization ID. - System.Uri + String - System.Uri + String - https://api.openai.com/v1 + None - - ApiKey + + OutFile - Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + The local path where downloaded artifact content is saved. - Object + String - Object + String None - - Organization + + SessionId - Specifies Organization ID which used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + The managed agent session ID. - string + String - string + String None - - - - + + TimeoutSec + + The request timeout in seconds. Zero uses the module default. + + Int32 - [pscustomobject] + Int32 + + None + + + ProgressAction - + Controls how PowerShell responds to progress updates. - - + ActionPreference + + ActionPreference + + + None + + + + @@ -6817,68 +7291,43 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN - ------------ Example 1: List all available models. ------------ - PS C:\> Get-OpenAIModels | select -ExpandProperty ID - -babbage -davinci -gpt-3.5-turbo-0613 -text-davinci-003 -... - - - - - - ---------- Example 2: Get specific model information. ---------- - PS C:\> Get-OpenAIModels -Name "gpt-3.5-turbo" - -id : gpt-3.5-turbo -object : model -owned_by : openai -permission : {@{id=modelperm-QvbW9EnkbwPtWZu... -root : gpt-3.5-turbo -parent : -created : 2023/02/28 18:56:42 + -------------------------- Example 1 -------------------------- + Get-AgentSessionArtifactContent -SessionId 'session_123' -ArtifactId 'artifact_123' -OutFile './artifact.bin' - + Downloads an immutable session artifact. Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/Get-OpenAIModels.md + https://github.com/mkht/PSOpenAI/blob/v5/Docs/Get-AgentSessionArtifactContent.md - https://developers.openai.com/api/docs/models - https://developers.openai.com/api/docs/models - - - https://developers.openai.com/api/reference/resources/models/methods/list/ - https://developers.openai.com/api/reference/resources/models/methods/list/ + OpenAI Agents API + https://developers.openai.com/api/reference/typescript/resources/beta/subresources/agents - Get-Response + Get-AgentSessionEvent Get - Response + AgentSessionEvent - Retrieves a model response with the given ID. + Streams server-sent events from an agent session. - Retrieves a model response with the given ID. + Streams server-sent events from an agent session. This command uses the OpenAI Agents API public beta and sends the required `OpenAI-Beta: agents=v1` header. Nested, evolving request schemas are accepted through `-Body` where applicable. - Get-Response - - ResponseId + Get-AgentSessionEvent + + SessionId - The ID of the response to retrieve. + The managed agent session ID. String @@ -6887,321 +7336,273 @@ created : 2023/02/28 18:56:42 None - - Include + + AdditionalHeaders - Specify additional output data to include in the model response. + Additional HTTP headers to include in the request. - String[] + IDictionary - String[] + IDictionary None - - IncludeObfuscation + + AdditionalQuery - When true, stream obfuscation will be enabled. Stream obfuscation adds random characters to an obfuscation field on streaming delta events to normalize payload sizes as a mitigation to certain side-channel attacks. + Additional query parameters to include in the request. - Boolean + IDictionary - Boolean + IDictionary None - - Stream + + ApiBase - If set, the model response data will be streamed to the client. + The base URI for the OpenAI API. + Uri - SwitchParameter + Uri - False + None - - StreamOutputType + + ApiKey - Specifying the format that the function output. This parameter is only valid for the stream output. This parameter is only valid for the stream output. - `text` : Output only text deltas that the model generated. (Default) -- `object` : Output all events that the API respond. - + The OpenAI API key as a secure string. - - text - object - - String + SecureString - String + SecureString - text + None - - StartingAfter + + ApiType - The sequence number of the event after which to start streaming. This parameter is only valid for the stream output. + The API provider. Agents API commands support OpenAI only. - Int32 + + OpenAI + Azure + + OpenAIApiType - Int32 + OpenAIApiType None - - OutputRawResponse + + AuthType - If specifies this switch, an output of this function to be a raw response value from the API. (Normally JSON formatted string.) + The authentication type. Use openai for the Agents API. + + openai + azure + azure_ad + + String - SwitchParameter + String - False + None - - TimeoutSec + + MaxRetryCount - Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). + The maximum number of retries for transient API failures. Int32 Int32 - 0 + None - - MaxRetryCount + + Organization - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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. - + The OpenAI organization ID. + + String + + String + + + None + + + TimeoutSec + + The request timeout in seconds. Zero uses the module default. Int32 Int32 - 0 + None - - ApiBase + + ProgressAction - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` + Controls how PowerShell responds to progress updates. - System.Uri + ActionPreference - System.Uri + ActionPreference - https://api.openai.com/v1 - - - ApiKey - - Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` - - Object - - Object - - - None - - - Organization - - Specifies Organization ID which used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` - - string - - string - - - None + None - - ResponseId + + AdditionalHeaders - The ID of the response to retrieve. + Additional HTTP headers to include in the request. - String + IDictionary - String + IDictionary None - - Include + + AdditionalQuery - Specify additional output data to include in the model response. + Additional query parameters to include in the request. - String[] + IDictionary - String[] + IDictionary None - - IncludeObfuscation + + ApiBase - When true, stream obfuscation will be enabled. Stream obfuscation adds random characters to an obfuscation field on streaming delta events to normalize payload sizes as a mitigation to certain side-channel attacks. + The base URI for the OpenAI API. - Boolean + Uri - Boolean + Uri None - - Stream - - If set, the model response data will be streamed to the client. - - SwitchParameter - - SwitchParameter - - - False - - - StreamOutputType + + ApiKey - Specifying the format that the function output. This parameter is only valid for the stream output. This parameter is only valid for the stream output. - `text` : Output only text deltas that the model generated. (Default) -- `object` : Output all events that the API respond. - + The OpenAI API key as a secure string. - String + SecureString - String + SecureString - text + None - - StartingAfter + + ApiType - The sequence number of the event after which to start streaming. This parameter is only valid for the stream output. + The API provider. Agents API commands support OpenAI only. - Int32 + OpenAIApiType - Int32 + OpenAIApiType None - - OutputRawResponse + + AuthType - If specifies this switch, an output of this function to be a raw response value from the API. (Normally JSON formatted string.) + The authentication type. Use openai for the Agents API. - SwitchParameter + String - SwitchParameter + String - False + None - - TimeoutSec + + MaxRetryCount - Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). + The maximum number of retries for transient API failures. Int32 Int32 - 0 + None - - MaxRetryCount + + Organization - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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. - + The OpenAI organization ID. - Int32 + String - Int32 + String - 0 + None - - ApiBase + + SessionId - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` + The managed agent session ID. - System.Uri + String - System.Uri + String - https://api.openai.com/v1 + None - - ApiKey + + TimeoutSec - Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + The request timeout in seconds. Zero uses the module default. - Object + Int32 - Object + Int32 None - - Organization + + ProgressAction - Specifies Organization ID which used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + Controls how PowerShell responds to progress updates. - string + ActionPreference - string + ActionPreference None - - - - PSCustomObject - - - - - - + @@ -7210,42 +7611,42 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN -------------------------- Example 1 -------------------------- - PS C:\> Get-Response -ResponseId "resp_abcd123" + Get-AgentSessionEvent -SessionId 'session_123' - Get a response with the specified ID. + Streams server-sent events from a managed session. Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/Get-Response.md + https://github.com/mkht/PSOpenAI/blob/v5/Docs/Get-AgentSessionEvent.md - https://developers.openai.com/api/reference/resources/responses/methods/retrieve/ - https://developers.openai.com/api/reference/resources/responses/methods/retrieve/ + OpenAI Agents API + https://developers.openai.com/api/reference/typescript/resources/beta/subresources/agents - Get-ResponseInputItem + Get-AgentSessionItem Get - ResponseInputItem + AgentSessionItem - Lists or Retrieves an input items for a given response. + Lists items from a session, subagent, or subagent turn. - Lists or Retrieves a Message of the Thread. + Lists items from a session, subagent, or subagent turn. This command uses the OpenAI Agents API public beta and sends the required `OpenAI-Beta: agents=v1` header. Nested, evolving request schemas are accepted through `-Body` where applicable. - Get-ResponseInputItem - - ResponseId + Get-AgentSessionItem + + SessionId - The ID of the response to retrieve input items for. + The managed agent session ID. String @@ -7254,145 +7655,277 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN None - - Limit + + AdditionalBody - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + Additional JSON properties to merge into the request body. - Int32 + Object - Int32 + Object - 20 + None - - All + + AdditionalHeaders - When this switch is specified, all objects will be retrieved. + Additional HTTP headers to include in the request. + IDictionary - SwitchParameter + IDictionary - False + None - - Order + + AdditionalQuery - The order to return the input items in. `asc` for ascending order and `desc` for descending order. The default is `asc` + Additional query parameters to include in the request. - - asc - desc - - String + IDictionary - String + IDictionary - asc + None - - TimeoutSec + + After - Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). + Cursor identifying the item after which to continue a cursor-based listing. - Int32 + String - Int32 + String - 0 + None - - MaxRetryCount + + All - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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. - + Retrieves all available cursor-based pages. - Int32 - Int32 + SwitchParameter - 0 + False - + ApiBase - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` + The base URI for the OpenAI API. - System.Uri + Uri - System.Uri + Uri - https://api.openai.com/v1 + None - + ApiKey - Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + The OpenAI API key as a secure string. - Object + SecureString - Object + SecureString None - - Organization + + ApiType - Specifies Organization ID which used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + The API provider. Agents API commands support OpenAI only. - string + + OpenAI + Azure + + OpenAIApiType - string + OpenAIApiType None - - - - - ResponseId - - The ID of the response to retrieve input items for. - - String - - String - - - None + + AuthType + + The authentication type. Use openai for the Agents API. + + + openai + azure + azure_ad + + String + + String + + + None + + + Limit + + The maximum number of items to return in one page. + + Int32 + + Int32 + + + None + + + MaxRetryCount + + The maximum number of retries for transient API failures. + + Int32 + + Int32 + + + None + + + Order + + The order in which items are returned. + + + asc + desc + + String + + String + + + None + + + Organization + + The OpenAI organization ID. + + String + + String + + + None + + + SubagentId + + The session subagent ID. + + String + + String + + + None + + + TimeoutSec + + The request timeout in seconds. Zero uses the module default. + + Int32 + + Int32 + + + None + + + TurnId + + The agent or subagent turn ID. + + String + + String + + + None + + + ProgressAction + + Controls how PowerShell responds to progress updates. + + ActionPreference + + ActionPreference + + + None + + + + + + AdditionalBody + + Additional JSON properties to merge into the request body. + + Object + + Object + + + None - - Limit + + AdditionalHeaders - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + Additional HTTP headers to include in the request. - Int32 + IDictionary - Int32 + IDictionary - 20 + None - + + AdditionalQuery + + Additional query parameters to include in the request. + + IDictionary + + IDictionary + + + None + + + After + + Cursor identifying the item after which to continue a cursor-based listing. + + String + + String + + + None + + All - When this switch is specified, all objects will be retrieved. + Retrieves all available cursor-based pages. SwitchParameter @@ -7401,99 +7934,165 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN False - - Order + + ApiBase - The order to return the input items in. `asc` for ascending order and `desc` for descending order. The default is `asc` + The base URI for the OpenAI API. + + Uri + + Uri + + + None + + + ApiKey + + The OpenAI API key as a secure string. + + SecureString + + SecureString + + + None + + + ApiType + + The API provider. Agents API commands support OpenAI only. + + OpenAIApiType + + OpenAIApiType + + + None + + + AuthType + + The authentication type. Use openai for the Agents API. String String - asc + None - - TimeoutSec + + Limit - Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). + The maximum number of items to return in one page. Int32 Int32 - 0 + None - + MaxRetryCount - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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. - + The maximum number of retries for transient API failures. Int32 Int32 - 0 + None - - ApiBase + + Order - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` + The order in which items are returned. - System.Uri + String - System.Uri + String - https://api.openai.com/v1 + None - - ApiKey + + Organization - Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + The OpenAI organization ID. - Object + String - Object + String None - - Organization + + SessionId - Specifies Organization ID which used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + The managed agent session ID. - string + String - string + String None - - - - + + SubagentId + + The session subagent ID. + + String - PSCustomObject + String + + + None + + + TimeoutSec + + The request timeout in seconds. Zero uses the module default. + + Int32 + + Int32 + + None + + + TurnId - + The agent or subagent turn ID. - - + String + + String + + + None + + + ProgressAction + + Controls how PowerShell responds to progress updates. + + ActionPreference + + ActionPreference + + + None + + + + @@ -7502,42 +8101,42 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN -------------------------- Example 1 -------------------------- - PS C:\> Get-ResponseInputItem -ResponseId 'resp_abc123' -All + Get-AgentSessionItem -SessionId 'session_123' -All - List all input items associated with the response. + Lists every item associated with a managed session. Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/Get-ResponseInputItem.md + https://github.com/mkht/PSOpenAI/blob/v5/Docs/Get-AgentSessionItem.md - https://developers.openai.com/api/reference/resources/responses/subresources/input_items/methods/list/ - https://developers.openai.com/api/reference/resources/responses/subresources/input_items/methods/list/ + OpenAI Agents API + https://developers.openai.com/api/reference/typescript/resources/beta/subresources/agents - Get-VectorStore + Get-AgentSessionSubagent Get - VectorStore + AgentSessionSubagent - Retrieves a vector store. + Retrieves or lists subagents in a session. - Get a vector srore or List multiple vector srore + Retrieves or lists subagents in a session. This command uses the OpenAI Agents API public beta and sends the required `OpenAI-Beta: agents=v1` header. Nested, evolving request schemas are accepted through `-Body` where applicable. - Get-VectorStore - - VectorStoreId + Get-AgentSessionSubagent + + SessionId - The ID of the vector store to retrieve. + The managed agent session ID. String @@ -7546,193 +8145,150 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN None - - TimeoutSec - - Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). - - Int32 - - Int32 - - - 0 - - - MaxRetryCount - - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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. - - - Int32 - - Int32 - - - 0 - - - ApiBase + + AdditionalBody - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` + Additional JSON properties to merge into the request body. - System.Uri + Object - System.Uri + Object - https://api.openai.com/v1 + None - - ApiKey + + AdditionalHeaders - Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + Additional HTTP headers to include in the request. - Object + IDictionary - Object + IDictionary None - - Organization + + AdditionalQuery - Specifies Organization ID which used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + Additional query parameters to include in the request. - string + IDictionary - string + IDictionary None - - - Get-VectorStore - - Limit + + After - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + Cursor identifying the item after which to continue a cursor-based listing. - Int32 + String - Int32 + String - 20 + None - - Order + + All - Sort order by the created timestamp of the objects. `asc` for ascending order and `desc` for descending order. The default is `asc` + Retrieves all available cursor-based pages. - - asc - desc - - String - String + SwitchParameter - asc + False - - TimeoutSec + + ApiBase - Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). + The base URI for the OpenAI API. - Int32 + Uri - Int32 + Uri - 0 + None - - MaxRetryCount + + ApiKey - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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. - + The OpenAI API key as a secure string. - Int32 + SecureString - Int32 + SecureString - 0 + None - - ApiBase + + ApiType - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` + The API provider. Agents API commands support OpenAI only. - System.Uri + + OpenAI + Azure + + OpenAIApiType - System.Uri + OpenAIApiType - https://api.openai.com/v1 + None - - ApiKey + + AuthType - Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + The authentication type. Use openai for the Agents API. - Object + + openai + azure + azure_ad + + String - Object + String None - - Organization + + Limit - Specifies Organization ID which used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + The maximum number of items to return in one page. - string + Int32 - string + Int32 None - - - Get-VectorStore - - All + + MaxRetryCount - When this switch is specified, all vector stores will be retrieved. + The maximum number of retries for transient API failures. + Int32 - SwitchParameter + Int32 - False + None - + Order - Sort order by the created timestamp of the objects. `asc` for ascending order and `desc` for descending order. The default is `asc` + The order in which items are returned. asc @@ -7743,73 +8299,52 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN String - asc - - - TimeoutSec - - Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). - - Int32 - - Int32 - - - 0 + None - - MaxRetryCount + + Organization - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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. - + The OpenAI organization ID. - Int32 + String - Int32 + String - 0 + None - - ApiBase + + SubagentId - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` + The session subagent ID. - System.Uri + String - System.Uri + String - https://api.openai.com/v1 + None - - ApiKey + + TimeoutSec - Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + The request timeout in seconds. Zero uses the module default. - Object + Int32 - Object + Int32 None - - Organization + + ProgressAction - Specifies Organization ID which used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + Controls how PowerShell responds to progress updates. - string + ActionPreference - string + ActionPreference None @@ -7817,135 +8352,213 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN - - VectorStoreId + + AdditionalBody - The ID of the vector store to retrieve. + Additional JSON properties to merge into the request body. - String + Object - String + Object None - - Limit + + AdditionalHeaders - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + Additional HTTP headers to include in the request. - Int32 + IDictionary - Int32 + IDictionary - 20 + None - - All + + AdditionalQuery - When this switch is specified, all vector stores will be retrieved. + Additional query parameters to include in the request. - SwitchParameter + IDictionary - SwitchParameter + IDictionary - False + None - - Order + + After - Sort order by the created timestamp of the objects. `asc` for ascending order and `desc` for descending order. The default is `asc` + Cursor identifying the item after which to continue a cursor-based listing. String String - asc + None - - TimeoutSec + + All - Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). + Retrieves all available cursor-based pages. + + SwitchParameter + + SwitchParameter + + + False + + + ApiBase + + The base URI for the OpenAI API. + + Uri + + Uri + + + None + + + ApiKey + + The OpenAI API key as a secure string. + + SecureString + + SecureString + + + None + + + ApiType + + The API provider. Agents API commands support OpenAI only. + + OpenAIApiType + + OpenAIApiType + + + None + + + AuthType + + The authentication type. Use openai for the Agents API. + + String + + String + + + None + + + Limit + + The maximum number of items to return in one page. Int32 Int32 - 0 + None - + MaxRetryCount - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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. - + The maximum number of retries for transient API failures. Int32 Int32 - 0 + None - - ApiBase + + Order - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` + The order in which items are returned. - System.Uri + String - System.Uri + String - https://api.openai.com/v1 + None - - ApiKey + + Organization - Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + The OpenAI organization ID. - Object + String - Object + String None - - Organization + + SessionId - Specifies Organization ID which used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + The managed agent session ID. - string + String - string + String None - - - - + + SubagentId + + The session subagent ID. + + String - PSCustomObject + String + + None + + + TimeoutSec - + The request timeout in seconds. Zero uses the module default. - - + Int32 + + Int32 + + + None + + + ProgressAction + + Controls how PowerShell responds to progress updates. + + ActionPreference + + ActionPreference + + + None + + + + @@ -7954,60 +8567,42 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN -------------------------- Example 1 -------------------------- - PS C:\> Get-VectorStore "vs_abc123" - - Get a vector store with ID of `vs_abc123`. - - - - -------------------------- Example 2 -------------------------- - PS C:\> Get-VectorStore -Limit 5 -Order desc - - Get latest 5 vector stores. - - - - -------------------------- Example 3 -------------------------- - PS C:\> Get-VectorStore -All + Get-AgentSessionSubagent -SessionId 'session_123' -SubagentId 'subagent_123' - Get all vector stores. + Retrieves a subagent created within a managed session. Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/Get-VectorStore.md - - - https://developers.openai.com/api/reference/resources/vector_stores/methods/retrieve/ - https://developers.openai.com/api/reference/resources/vector_stores/methods/retrieve/ + https://github.com/mkht/PSOpenAI/blob/v5/Docs/Get-AgentSessionSubagent.md - https://developers.openai.com/api/reference/resources/vector_stores/methods/list/ - https://developers.openai.com/api/reference/resources/vector_stores/methods/list/ + OpenAI Agents API + https://developers.openai.com/api/reference/typescript/resources/beta/subresources/agents - Get-VectorStoreFile + Get-AgentSessionTurn Get - VectorStoreFile + AgentSessionTurn - Retrieves vector store files. + Retrieves or lists turns from a session or subagent. - Retrieves vector store files. + Retrieves or lists turns from a session or subagent. This command uses the OpenAI Agents API public beta and sends the required `OpenAI-Beta: agents=v1` header. Nested, evolving request schemas are accepted through `-Body` where applicable. - Get-VectorStoreFile - - VectorStoreId + Get-AgentSessionTurn + + SessionId - The ID of the vector store that the file belongs to. + The managed agent session ID. String @@ -8016,206 +8611,166 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN None - - FileId + + AdditionalBody - The ID of the file being retrieved. + Additional JSON properties to merge into the request body. - String + Object - String + Object None - - TimeoutSec + + AdditionalHeaders - Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). + Additional HTTP headers to include in the request. - Int32 + IDictionary - Int32 + IDictionary - 0 + None - - MaxRetryCount + + AdditionalQuery - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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. - + Additional query parameters to include in the request. - Int32 + IDictionary - Int32 + IDictionary - 0 + None - - ApiBase + + After - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` + Cursor identifying the item after which to continue a cursor-based listing. - System.Uri + String - System.Uri + String - https://api.openai.com/v1 + None - - ApiKey + + All - Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + Retrieves all available cursor-based pages. - Object - Object + SwitchParameter - None + False - - Organization + + ApiBase - Specifies Organization ID which used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + The base URI for the OpenAI API. - string + Uri - string + Uri None - - - Get-VectorStoreFile - - Filter + + ApiKey - Filter by file status. One of `in_progress`, `completed`, `failed`, `cancelled`. + The OpenAI API key as a secure string. - String + SecureString - String + SecureString None - - Limit + + ApiType - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + The API provider. Agents API commands support OpenAI only. - Int32 + + OpenAI + Azure + + OpenAIApiType - Int32 + OpenAIApiType - 20 + None - - Order + + AuthType - Sort order by the created timestamp of the objects. `asc` for ascending order and `desc` for descending order. The default is `asc` + The authentication type. Use openai for the Agents API. - asc - desc + openai + azure + azure_ad String String - asc + None - - TimeoutSec + + Limit - Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). + The maximum number of items to return in one page. Int32 Int32 - 0 + None - + MaxRetryCount - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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. - + The maximum number of retries for transient API failures. Int32 Int32 - 0 - - - ApiBase - - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` - - System.Uri - - System.Uri - - - https://api.openai.com/v1 - - - ApiKey - - Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` - - Object - - Object - - None - - Organization + + Order - Specifies Organization ID which used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + The order in which items are returned. - string + + asc + desc + + String - string + String None - - - Get-VectorStoreFile - - Filter + + Organization - Filter by file status. One of `in_progress`, `completed`, `failed`, `cancelled`. + The OpenAI organization ID. String @@ -8224,98 +8779,50 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN None - - All - - When this switch is specified, all vector stores will be retrieved. - - - SwitchParameter - - - False - - - Order + + SubagentId - Sort order by the created timestamp of the objects. `asc` for ascending order and `desc` for descending order. The default is `asc` + The session subagent ID. - - asc - desc - String String - asc + None - + TimeoutSec - Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). - - Int32 - - Int32 - - - 0 - - - MaxRetryCount - - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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. - + The request timeout in seconds. Zero uses the module default. Int32 Int32 - 0 - - - ApiBase - - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` - - System.Uri - - System.Uri - - - https://api.openai.com/v1 + None - - ApiKey + + TurnId - Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + The agent or subagent turn ID. - Object + String - Object + String None - - Organization + + ProgressAction - Specifies Organization ID which used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + Controls how PowerShell responds to progress updates. - string + ActionPreference - string + ActionPreference None @@ -8323,58 +8830,58 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN - - VectorStoreId + + AdditionalBody - The ID of the vector store that the file belongs to. + Additional JSON properties to merge into the request body. - String + Object - String + Object None - - FileId + + AdditionalHeaders - The ID of the file being retrieved. + Additional HTTP headers to include in the request. - String + IDictionary - String + IDictionary None - - Filter + + AdditionalQuery - Filter by file status. One of `in_progress`, `completed`, `failed`, `cancelled`. + Additional query parameters to include in the request. - String + IDictionary - String + IDictionary None - - Limit + + After - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + Cursor identifying the item after which to continue a cursor-based listing. - Int32 + String - Int32 + String - 20 + None - + All - When this switch is specified, all vector stores will be retrieved. + Retrieves all available cursor-based pages. SwitchParameter @@ -8383,154 +8890,245 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN False - - Order + + ApiBase - Sort order by the created timestamp of the objects. `asc` for ascending order and `desc` for descending order. The default is `asc` + The base URI for the OpenAI API. + + Uri + + Uri + + + None + + + ApiKey + + The OpenAI API key as a secure string. + + SecureString + + SecureString + + + None + + + ApiType + + The API provider. Agents API commands support OpenAI only. + + OpenAIApiType + + OpenAIApiType + + + None + + + AuthType + + The authentication type. Use openai for the Agents API. String String - asc + None - - TimeoutSec + + Limit - Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). + The maximum number of items to return in one page. Int32 Int32 - 0 + None - + MaxRetryCount - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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. - + The maximum number of retries for transient API failures. Int32 Int32 - 0 + None - - ApiBase + + Order - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` + The order in which items are returned. - System.Uri + String - System.Uri + String - https://api.openai.com/v1 + None - - ApiKey + + Organization - Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + The OpenAI organization ID. - Object + String - Object + String None - - Organization + + SessionId - Specifies Organization ID which used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + The managed agent session ID. - string + String - string + String None - - - - + + SubagentId + + The session subagent ID. + + String - PSCustomObject + String + + None + + + TimeoutSec - + The request timeout in seconds. Zero uses the module default. - - - - - - - + Int32 + + Int32 + + + None + + + TurnId + + The agent or subagent turn ID. + + String + + String + + + None + + + ProgressAction + + Controls how PowerShell responds to progress updates. + + ActionPreference + + ActionPreference + + + None + + + + + + + + + -------------------------- Example 1 -------------------------- - PS C:\> Get-VectorStoreFile -VectorStoreId 'vs_abc123' -FileId 'file-abc123' + Get-AgentSessionTurn -SessionId 'session_123' -TurnId 'turn_123' - Get a file with ID `file-abc123` in the vector store with ID of `vs_abc123`. - - - - -------------------------- Example 2 -------------------------- - PS C:\> Get-VectorStoreFile -VectorStoreId 'vs_abc123' -All - - Get all files in the vector store with ID of `vs_abc123`. + Retrieves a turn from a managed session. Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/Get-VectorStoreFile.md - - - https://developers.openai.com/api/reference/resources/vector_stores/subresources/files/methods/retrieve/ - https://developers.openai.com/api/reference/resources/vector_stores/subresources/files/methods/retrieve/ + https://github.com/mkht/PSOpenAI/blob/v5/Docs/Get-AgentSessionTurn.md - https://developers.openai.com/api/reference/resources/vector_stores/subresources/files/methods/list/ - https://developers.openai.com/api/reference/resources/vector_stores/subresources/files/methods/list/ + OpenAI Agents API + https://developers.openai.com/api/reference/typescript/resources/beta/subresources/agents - Get-VectorStoreFileBatch + Get-AgentVault Get - VectorStoreFileBatch + AgentVault - Retrieves a vector store file batch. + Retrieves or lists agent credential vaults. - Retrieves a vector store file batch. + Retrieves or lists agent credential vaults. This command uses the OpenAI Agents API public beta and sends the required `OpenAI-Beta: agents=v1` header. Nested, evolving request schemas are accepted through `-Body` where applicable. - Get-VectorStoreFileBatch - - VectorStoreId + Get-AgentVault + + AdditionalBody - The ID of the vector store that the batch belongs to. + Additional JSON properties to merge into the request body. + + Object + + Object + + + None + + + AdditionalHeaders + + Additional HTTP headers to include in the request. + + IDictionary + + IDictionary + + + None + + + AdditionalQuery + + Additional query parameters to include in the request. + + IDictionary + + IDictionary + + + None + + + After + + Cursor identifying the item after which to continue a cursor-based listing. String @@ -8539,11 +9137,67 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN None - - BatchId + + All - The ID of the file batch being retrieved. + Retrieves all available cursor-based pages. + + + SwitchParameter + + + False + + + ApiBase + + The base URI for the OpenAI API. + + Uri + + Uri + + + None + + + ApiKey + + The OpenAI API key as a secure string. + + SecureString + + SecureString + + + None + + + ApiType + + The API provider. Agents API commands support OpenAI only. + + + OpenAI + Azure + + OpenAIApiType + + OpenAIApiType + + + None + + + AuthType + + The authentication type. Use openai for the Agents API. + + openai + azure + azure_ad + String String @@ -8551,54 +9205,117 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN None - - TimeoutSec + + Limit - Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). + The maximum number of items to return in one page. Int32 Int32 - 0 + None - + MaxRetryCount - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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. - + The maximum number of retries for transient API failures. Int32 Int32 - 0 + None - - ApiBase + + Order - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` + The order in which items are returned. - System.Uri + + asc + desc + + String - System.Uri + String - https://api.openai.com/v1 + None - - ApiKey + + Organization - Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + The OpenAI organization ID. + + String + + String + + + None + + + Status + + One or more lifecycle statuses used to filter results. + + + active + archived + + String[] + + String[] + + + None + + + TimeoutSec + + The request timeout in seconds. Zero uses the module default. + + Int32 + + Int32 + + + None + + + ProgressAction + + Controls how PowerShell responds to progress updates. + + ActionPreference + + ActionPreference + + + None + + + + Get-AgentVault + + VaultId + + The agent vault ID. + + String + + String + + + None + + + AdditionalBody + + Additional JSON properties to merge into the request body. Object @@ -8607,307 +9324,131 @@ If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_AP None - - Organization + + AdditionalHeaders - Specifies Organization ID which used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + Additional HTTP headers to include in the request. - string + IDictionary - string + IDictionary None - - - - - VectorStoreId - - The ID of the vector store that the batch belongs to. - - String - - String - - - None - - - BatchId - - The ID of the file batch being retrieved. - - String - - String - - - None - - - TimeoutSec - - Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). - - Int32 - - Int32 - - - 0 - - - MaxRetryCount - - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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. - - - Int32 - - Int32 - - - 0 - - - ApiBase - - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` - - System.Uri - - System.Uri - - - https://api.openai.com/v1 - - - ApiKey - - Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` - - Object - - Object - - - None - - - Organization - - Specifies Organization ID which used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` - - string - - string - - - None - - - - - - - PSCustomObject - - - - - - - - - - - - - - -------------------------- Example 1 -------------------------- - PS C:\> Get-VectorStoreFileBatch -VectorStoreId "vs_abc123" -BatchId 'vsfb_abc123' - - Get a vector store file batch with ID `vsfb_abc123`. - - - - - - Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/Get-VectorStoreFileBatch.md - - - https://developers.openai.com/api/reference/resources/vector_stores/subresources/file_batches/methods/retrieve/ - https://developers.openai.com/api/reference/resources/vector_stores/subresources/file_batches/methods/retrieve/ - - - - - - Get-VectorStoreFileInBatch - Get - VectorStoreFileInBatch - - Returns a list of vector store files in a batch. - - - - Returns a list of vector store files in a batch. - - - - Get-VectorStoreFileInBatch - - VectorStoreId + + AdditionalQuery - The ID of the vector store that the batch belongs to. + Additional query parameters to include in the request. - String + IDictionary - String + IDictionary None - - BatchId + + ApiBase - The ID of the file batch being retrieved. + The base URI for the OpenAI API. - String + Uri - String + Uri None - - Filter + + ApiKey - Filter by file status. One of `in_progress`, `completed`, `failed`, `cancelled`. + The OpenAI API key as a secure string. - String + SecureString - String + SecureString None - - Limit - - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. - - Int32 - - Int32 - - - 20 - - - All + + ApiType - When this switch is specified, all files in a batch will be retrieved. + The API provider. Agents API commands support OpenAI only. + + OpenAI + Azure + + OpenAIApiType - SwitchParameter + OpenAIApiType - False + None - - Order + + AuthType - Sort order by the created timestamp of the objects. `asc` for ascending order and `desc` for descending order. The default is `asc` + The authentication type. Use openai for the Agents API. - asc - desc + openai + azure + azure_ad String String - asc - - - TimeoutSec - - Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). - - Int32 - - Int32 - - - 0 + None - + MaxRetryCount - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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. - + The maximum number of retries for transient API failures. Int32 Int32 - 0 + None - - ApiBase + + Organization - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` + The OpenAI organization ID. - System.Uri + String - System.Uri + String - https://api.openai.com/v1 + None - - ApiKey + + TimeoutSec - Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + The request timeout in seconds. Zero uses the module default. - Object + Int32 - Object + Int32 None - - Organization + + ProgressAction - Specifies Organization ID which used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + Controls how PowerShell responds to progress updates. - string + ActionPreference - string + ActionPreference None @@ -8915,58 +9456,58 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN - - VectorStoreId + + AdditionalBody - The ID of the vector store that the batch belongs to. + Additional JSON properties to merge into the request body. - String + Object - String + Object None - - BatchId + + AdditionalHeaders - The ID of the file batch being retrieved. + Additional HTTP headers to include in the request. - String + IDictionary - String + IDictionary None - - Filter + + AdditionalQuery - Filter by file status. One of `in_progress`, `completed`, `failed`, `cancelled`. + Additional query parameters to include in the request. - String + IDictionary - String + IDictionary None - - Limit + + After - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + Cursor identifying the item after which to continue a cursor-based listing. - Int32 + String - Int32 + String - 20 + None - + All - When this switch is specified, all files in a batch will be retrieved. + Retrieves all available cursor-based pages. SwitchParameter @@ -8975,99 +9516,153 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN False - - Order + + ApiBase - Sort order by the created timestamp of the objects. `asc` for ascending order and `desc` for descending order. The default is `asc` + The base URI for the OpenAI API. + + Uri + + Uri + + + None + + + ApiKey + + The OpenAI API key as a secure string. + + SecureString + + SecureString + + + None + + + ApiType + + The API provider. Agents API commands support OpenAI only. + + OpenAIApiType + + OpenAIApiType + + + None + + + AuthType + + The authentication type. Use openai for the Agents API. String String - asc + None - - TimeoutSec + + Limit - Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). + The maximum number of items to return in one page. Int32 Int32 - 0 + None - + MaxRetryCount - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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. - + The maximum number of retries for transient API failures. Int32 Int32 - 0 + None - - ApiBase + + Order - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` + The order in which items are returned. - System.Uri + String - System.Uri + String - https://api.openai.com/v1 + None - - ApiKey + + Organization - Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + The OpenAI organization ID. - Object + String - Object + String None - - Organization + + Status - Specifies Organization ID which used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + One or more lifecycle statuses used to filter results. - string + String[] - string + String[] None - - - - + + TimeoutSec + + The request timeout in seconds. Zero uses the module default. + + Int32 - PSCustomObject + Int32 + + None + + + VaultId - + The agent vault ID. - - + String + + String + + + None + + + ProgressAction + + Controls how PowerShell responds to progress updates. + + ActionPreference + + ActionPreference + + + None + + + + @@ -9076,42 +9671,42 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN -------------------------- Example 1 -------------------------- - PS C:\> Get-VectorStoreFileInBatch -VectorStoreId 'vs_abc123' -BatchId 'vsfb_abc123' -All + Get-AgentVault -VaultId 'vault_123' - Get all files in the vector store batch with ID of `vsfb_abc123`. + Retrieves an agent vault by ID. Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/Get-VectorStoreFileInBatch.md + https://github.com/mkht/PSOpenAI/blob/v5/Docs/Get-AgentVault.md - https://developers.openai.com/api/reference/resources/vector_stores/subresources/file_batches/methods/list_files/ - https://developers.openai.com/api/reference/resources/vector_stores/subresources/file_batches/methods/list_files/ + OpenAI Agents API + https://developers.openai.com/api/reference/typescript/resources/beta/subresources/agents - Get-Video + Get-AgentVaultCredential Get - Video + AgentVaultCredential - Retrieves one or more video generation jobs. + Retrieves or lists credentials in an agent vault. - 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. + Retrieves or lists credentials in an agent vault. This command uses the OpenAI Agents API public beta and sends the required `OpenAI-Beta: agents=v1` header. Nested, evolving request schemas are accepted through `-Body` where applicable. - Get-Video - - VideoId + Get-AgentVaultCredential + + VaultId - The identifier of the video to retrieve. + The agent vault ID. String @@ -9120,164 +9715,222 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN None - - TimeoutSec + + AdditionalBody - Specifies how long the request can be pending before it times out. The default value is `0` (infinite). + Additional JSON properties to merge into the request body. - Int32 + Object - Int32 + Object - 0 + None - - MaxRetryCount + + AdditionalHeaders - Number between `0` and `100`. Specifies the maximum number of retries if the request fails. The default value is `0` (No retry). 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. + Additional HTTP headers to include in the request. - Int32 + IDictionary - Int32 + IDictionary - 0 + None - - ApiBase + + AdditionalQuery - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` If not specified, it will use `https://api.openai.com/v1` + Additional query parameters to include in the request. - System.Uri + IDictionary - System.Uri + IDictionary - https://api.openai.com/v1 + None - - ApiKey + + After - Specifies API key for authentication. The type of data should `[string]` or `[securestring]`. If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + Cursor identifying the item after which to continue a cursor-based listing. - Object + String - Object + String None - - Organization + + All - Specifies Organization ID which used for an API request. If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + Retrieves all available cursor-based pages. - string - string + SwitchParameter + + + False + + + ApiBase + + The base URI for the OpenAI API. + + Uri + + Uri None - - - Get-Video - - Limit + + ApiKey - A number of items to retrieve. Limit can range between 1 and 100, and the default is 20. + The OpenAI API key as a secure string. - Int32 + SecureString - Int32 + SecureString - 20 + None - - Order + + ApiType - Sort order by the created timestamp of the objects. `asc` for ascending order and `desc` for descending order. The default is `asc`. + The API provider. Agents API commands support OpenAI only. - asc - desc + OpenAI + Azure + + OpenAIApiType + + OpenAIApiType + + + None + + + AuthType + + The authentication type. Use openai for the Agents API. + + + openai + azure + azure_ad String String - asc + None - - All + + CredentialId - When this switch is specified, all video jobs will be retrieved. + The vault credential ID. + String - SwitchParameter + String - False + None - - TimeoutSec + + Limit - Specifies how long the request can be pending before it times out. The default value is `0` (infinite). + The maximum number of items to return in one page. Int32 Int32 - 0 + None - + MaxRetryCount - Number between `0` and `100`. Specifies the maximum number of retries if the request fails. The default value is `0` (No retry). 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. + The maximum number of retries for transient API failures. Int32 Int32 - 0 + None - - ApiBase + + Order - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` If not specified, it will use `https://api.openai.com/v1` + The order in which items are returned. - System.Uri + + asc + desc + + String - System.Uri + String - https://api.openai.com/v1 + None - - ApiKey + + Organization - Specifies API key for authentication. The type of data should `[string]` or `[securestring]`. If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + The OpenAI organization ID. - Object + String - Object + String None - - Organization + + Status - Specifies Organization ID which used for an API request. If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + One or more lifecycle statuses used to filter results. - string + + active + archived + + String[] - string + String[] + + + None + + + TimeoutSec + + The request timeout in seconds. Zero uses the module default. + + Int32 + + Int32 + + + None + + + ProgressAction + + Controls how PowerShell responds to progress updates. + + ActionPreference + + ActionPreference None @@ -9285,46 +9938,58 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN - - VideoId + + AdditionalBody - The identifier of the video to retrieve. + Additional JSON properties to merge into the request body. - String + Object - String + Object None - - Limit + + AdditionalHeaders - A number of items to retrieve. Limit can range between 1 and 100, and the default is 20. + Additional HTTP headers to include in the request. - Int32 + IDictionary - Int32 + IDictionary - 20 + None - - Order + + AdditionalQuery - Sort order by the created timestamp of the objects. `asc` for ascending order and `desc` for descending order. The default is `asc`. + Additional query parameters to include in the request. + + IDictionary + + IDictionary + + + None + + + After + + Cursor identifying the item after which to continue a cursor-based listing. String String - asc + None - + All - When this switch is specified, all video jobs will be retrieved. + Retrieves all available cursor-based pages. SwitchParameter @@ -9333,78 +9998,165 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN False - - TimeoutSec + + ApiBase - Specifies how long the request can be pending before it times out. The default value is `0` (infinite). + The base URI for the OpenAI API. + + Uri + + Uri + + + None + + + ApiKey + + The OpenAI API key as a secure string. + + SecureString + + SecureString + + + None + + + ApiType + + The API provider. Agents API commands support OpenAI only. + + OpenAIApiType + + OpenAIApiType + + + None + + + AuthType + + The authentication type. Use openai for the Agents API. + + String + + String + + + None + + + CredentialId + + The vault credential ID. + + String + + String + + + None + + + Limit + + The maximum number of items to return in one page. Int32 Int32 - 0 + None - + MaxRetryCount - Number between `0` and `100`. Specifies the maximum number of retries if the request fails. The default value is `0` (No retry). 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. + The maximum number of retries for transient API failures. Int32 Int32 - 0 + None - - ApiBase + + Order - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` If not specified, it will use `https://api.openai.com/v1` + The order in which items are returned. - System.Uri + String - System.Uri + String - https://api.openai.com/v1 + None - - ApiKey + + Organization - Specifies API key for authentication. The type of data should `[string]` or `[securestring]`. If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + The OpenAI organization ID. - Object + String - Object + String None - - Organization + + Status - Specifies Organization ID which used for an API request. If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + One or more lifecycle statuses used to filter results. - string + String[] - string + String[] None - - - - + + TimeoutSec + + The request timeout in seconds. Zero uses the module default. + + Int32 - PSCustomObject + Int32 + + None + + + VaultId - + The agent vault ID. - - + String + + String + + + None + + + ProgressAction + + Controls how PowerShell responds to progress updates. + + ActionPreference + + ActionPreference + + + None + + + + @@ -9413,72 +10165,42 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN -------------------------- Example 1 -------------------------- - PS C:\> Get-Video -VideoId 'video_fb4e' - - Gets the job details for the specified video ID. - - - - -------------------------- Example 2 -------------------------- - PS C:\> Get-Video -Limit 5 -Order desc - - Lists the five most recent video jobs. - - - - -------------------------- Example 3 -------------------------- - PS C:\> Get-Video -All + Get-AgentVaultCredential -VaultId 'vault_123' -CredentialId 'credential_123' - Lists all available video jobs by paging through the API. + Retrieves non-secret metadata for a vault credential. Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/Get-Video.md - - - https://developers.openai.com/api/reference/resources/videos/methods/retrieve/ - https://developers.openai.com/api/reference/resources/videos/methods/retrieve/ + https://github.com/mkht/PSOpenAI/blob/v5/Docs/Get-AgentVaultCredential.md - https://developers.openai.com/api/reference/resources/videos/methods/list/ - https://developers.openai.com/api/reference/resources/videos/methods/list/ + OpenAI Agents API + https://developers.openai.com/api/reference/typescript/resources/beta/subresources/agents - Get-VideoContent + Get-Batch Get - VideoContent + Batch - Downloads generated video content. + Retrieves a batch. - 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. + Get an batch or List multiple batches - Get-VideoContent - - VideoId - - The identifier of the video whose media to download. - - String - - String - - - None - - - OutFile + Get-Batch + + BatchId - Path to the file where the content should be saved. If omitted, the cmdlet returns the byte array instead of writing to disk. + The ID of the batch to retrieve. String @@ -9487,33 +10209,11 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN None - - Variant - - Which downloadable asset to return. Supported values are `video`, `thumbnail`, and `spritesheet`. The default value is `video`. - - String - - String - - - video - - - WaitForCompletion - - When specified, waits for the job to reach a completed state before downloading the content. - - - SwitchParameter - - - False - TimeoutSec - Specifies how long the request can be pending before it times out. The default value is `0` (infinite). + Specifies how long the request can be pending before it times out. +The default value is `0` (infinite). Int32 @@ -9525,7 +10225,11 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN MaxRetryCount - Number between `0` and `100`. Specifies the maximum number of retries if the request fails. The default value is `0` (No retry). 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. + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). +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. + Int32 @@ -9537,7 +10241,8 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN ApiBase - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` If not specified, it will use `https://api.openai.com/v1` + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` System.Uri @@ -9549,7 +10254,9 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN ApiKey - Specifies API key for authentication. The type of data should `[string]` or `[securestring]`. If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + Specifies API key for authentication. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` Object @@ -9561,7 +10268,103 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN Organization - Specifies Organization ID which used for an API request. If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + Specifies Organization ID which used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + + string + + string + + + None + + + + Get-Batch + + Limit + + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + + Int32 + + Int32 + + + 20 + + + All + + When this switch is specified, all batch objects will be retrieved. + + + SwitchParameter + + + False + + + TimeoutSec + + Specifies how long the request can be pending before it times out. +The default value is `0` (infinite). + + Int32 + + Int32 + + + 0 + + + MaxRetryCount + + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). +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. + + + Int32 + + Int32 + + + 0 + + + ApiBase + + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` + + System.Uri + + System.Uri + + + https://api.openai.com/v1 + + + ApiKey + + Specifies API key for authentication. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + + Object + + Object + + + None + + + Organization + + Specifies Organization ID which used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` string @@ -9573,22 +10376,10 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN - - VideoId - - The identifier of the video whose media to download. - - String - - String - - - None - - - OutFile + + BatchId - Path to the file where the content should be saved. If omitted, the cmdlet returns the byte array instead of writing to disk. + The ID of the batch to retrieve. String @@ -9598,21 +10389,21 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN None - Variant + Limit - Which downloadable asset to return. Supported values are `video`, `thumbnail`, and `spritesheet`. The default value is `video`. + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. - String + Int32 - String + Int32 - video + 20 - WaitForCompletion + All - When specified, waits for the job to reach a completed state before downloading the content. + When this switch is specified, all batch objects will be retrieved. SwitchParameter @@ -9624,7 +10415,8 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN TimeoutSec - Specifies how long the request can be pending before it times out. The default value is `0` (infinite). + Specifies how long the request can be pending before it times out. +The default value is `0` (infinite). Int32 @@ -9636,7 +10428,11 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN MaxRetryCount - Number between `0` and `100`. Specifies the maximum number of retries if the request fails. The default value is `0` (No retry). 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. + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). +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. + Int32 @@ -9648,7 +10444,8 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN ApiBase - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` If not specified, it will use `https://api.openai.com/v1` + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` System.Uri @@ -9660,7 +10457,9 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN ApiKey - Specifies API key for authentication. The type of data should `[string]` or `[securestring]`. If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + Specifies API key for authentication. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` Object @@ -9672,7 +10471,8 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN Organization - Specifies Organization ID which used for an API request. If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + Specifies Organization ID which used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` string @@ -9686,7 +10486,7 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN - System.Byte[] + PSCustomObject @@ -9701,58 +10501,60 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN -------------------------- Example 1 -------------------------- - PS C:\> Get-VideoContent -VideoId 'video_abc123' -OutFile C:\videos\demo.mp4 + PS C:\> Get-Batch -Limit 5 - Saves the video content for the specified job to `C:\videos\demo.mp4`. + Get latest 5 batches. -------------------------- Example 2 -------------------------- - PS C:\> $Bytes = Get-VideoContent -VideoId 'video_abc123' + PS C:\> Get-Batch -All - Returns the video bytes for further processing. + Get all batches. -------------------------- Example 3 -------------------------- - PS C:\> Get-VideoContent -VideoId 'video_abc123' -Variant thumbnail -WaitForCompletion -OutFile C:\videos\demo.webp + PS C:\> Get-Batch -BatchId 'batch_abc123' - Waits for the job to finish and then downloads the thumbnail asset. + Get a batch with ID of `batch_abc123`. Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/Get-VideoContent.md + https://github.com/mkht/PSOpenAI/blob/main/Docs/Get-Batch.md - https://developers.openai.com/api/reference/resources/videos/methods/download_content/ - https://developers.openai.com/api/reference/resources/videos/methods/download_content/ + https://developers.openai.com/api/reference/resources/batches/methods/list/ + https://developers.openai.com/api/reference/resources/batches/methods/list/ + + + https://developers.openai.com/api/reference/resources/batches/methods/retrieve/ + https://developers.openai.com/api/reference/resources/batches/methods/retrieve/ - New-ChatCompletionFunction - New - ChatCompletionFunction + Get-BatchOutput + Get + BatchOutput - Generate function spcifications for ChatGPT Function calling from PowerShell commands + Retrieve batch output (result) items. - Generate function spcifications for ChatGPT Function calling from PowerShell commands -The generated function spcification is a hash table that can be converted to a JSON string following JSON Schema. -https://developers.openai.com/api/docs/guides/function-calling/ + Retrieve batch output (result) items. - New-ChatCompletionFunction - - Command + Get-BatchOutput + + BatchId - Specify the name of the PowerShell command. + Specifies a Batch ID. String @@ -9762,133 +10564,187 @@ https://developers.openai.com/api/docs/guides/function-calling/ None - Description + Wait - Specifies the descriptive text of the PowerShell command. If not specified, the command help description will be used. + When the Wait switch is used, it waits until that the Batch is completed and then returns the result. - String - String + SwitchParameter - None + False - ExcludeParameters + TimeoutSec - Names of parameters that should not be included in the function definition. + Specifies how long the request can be pending before it times out. +The default value is `0` (infinite). - String[] + Int32 - String[] + Int32 - None + 0 - IncludeParameters + MaxRetryCount - Name of the parameter to be included in the function definition. If this parameter is specified, any unspecified parameters will not be included in the function definition. + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). +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. + - String[] + Int32 - String[] + Int32 - None + 0 - ParameterSetName + ApiBase - If a PowerShell command has multiple parameter sets, the default parameter set is selected by default. -If you want to use a non-default parameter set, specify the set name in this parameter. + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` - String + System.Uri - String + System.Uri - None + https://api.openai.com/v1 - - - - - Command - - Specify the name of the PowerShell command. - - String - + + ApiKey + + Specifies API key for authentication. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + + Object + + Object + + + None + + + Organization + + Specifies Organization ID which used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + + string + + string + + + None + + + + + + BatchId + + Specifies a Batch ID. + + String + String None - Description + Wait - Specifies the descriptive text of the PowerShell command. If not specified, the command help description will be used. + When the Wait switch is used, it waits until that the Batch is completed and then returns the result. - String + SwitchParameter - String + SwitchParameter - None + False - ExcludeParameters + TimeoutSec - Names of parameters that should not be included in the function definition. + Specifies how long the request can be pending before it times out. +The default value is `0` (infinite). - String[] + Int32 - String[] + Int32 - None + 0 - IncludeParameters + MaxRetryCount - Name of the parameter to be included in the function definition. If this parameter is specified, any unspecified parameters will not be included in the function definition. + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). +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. + - String[] + Int32 - String[] + Int32 - None + 0 - ParameterSetName + ApiBase - If a PowerShell command has multiple parameter sets, the default parameter set is selected by default. -If you want to use a non-default parameter set, specify the set name in this parameter. + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` - String + System.Uri - String + System.Uri - None + https://api.openai.com/v1 - - - + + ApiKey + + Specifies API key for authentication. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + + Object - None + Object + + None + + + Organization - + Specifies Organization ID which used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` - - + string + + string + + + None + + + - System.Collections.Specialized.OrderedDictionary + PSCustomObject @@ -9897,110 +10753,48 @@ If you want to use a non-default parameter set, specify the set name in this par - + Batch output items are stored on OpenAI storage as JSONL files. This cmdlet does not delete files on the storage. -------------------------- Example 1 -------------------------- - PS C:\> New-ChatCompletionFunction -Command "New-Item" - - Generates a function definition for the `New-Item` command. - - - - -------------------------- Example 2 -------------------------- - PS C:\> New-ChatCompletionFunction -Command "Test-Connection" -IncludeParameters ('TargetName', 'Count', 'Delay') - - Generate a function spcification for the `Test-Connection` command. Only three parameters are included in the function definition: `TargetName`, `Count`, and `Delay`. - - - - -------------------------- Example 3 -------------------------- - PS C:\> New-ChatCompletionFunction -Command "Test-NetConnection" -ParameterSetName "RemotePort" -Description "This command tests TCP connectivity of the specified hosts or address and displays the results." + PS C:\> $Result = Get-BatchOutput 'batch_abc123' - Generate a function definition for the `Test-NetConnection` command. Explicitly specifies the parameter set name and command description. + Get an output data in the specified ID of batch Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/New-ChatCompletionFunction.md + https://github.com/mkht/PSOpenAI/blob/main/Docs/Get-BatchOutput.md - https://developers.openai.com/api/docs/guides/function-calling/ - https://developers.openai.com/api/docs/guides/function-calling/ + https://developers.openai.com/api/reference/resources/batches/methods/retrieve/ + https://developers.openai.com/api/reference/resources/batches/methods/retrieve/ - New-Container - New - Container + Get-ChatCompletion + Get + ChatCompletion - Create Container. + Get stored chat completions. - Create a new Container for CodeInterpreter tools. + Retrieves stored chat completions. Only chat completions that have been stored with the store parameter set to true will be returned. - New-Container - - Name - - Name of the container to create. - - String - - String - - - None - - - ExpiresAfterMinutes - - Container expiration time in minutes. - - UInt32 - - UInt32 - - - None - - - ExpiresAfterAnchor - - Time anchor for the expiration time. Currently only 'last_active_at' is supported. - - String - - String - - - last_active_at - - - FileId - - IDs of files to copy to the container. - - String[] - - String[] - - - None - - - MemoryLimit + Get-ChatCompletion + + CompletionId - Optional memory limit for the container. Defaults to `1g`. Supported values are `1g`, `4g`, `16g`, and `64g`. + The ID of the chat completion to retrieve. String @@ -10079,67 +10873,166 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN None - - - - Name - - Name of the container to create. - - String - - String - - - None - - - ExpiresAfterMinutes - - Container expiration time in minutes. - - UInt32 - - UInt32 - - - None - - - ExpiresAfterAnchor - - Time anchor for the expiration time. Currently only 'last_active_at' is supported. - - String - - String - - - last_active_at - - - FileId - - IDs of files to copy to the container. - - String[] - - String[] + + Get-ChatCompletion + + Limit + + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + + Int32 + + Int32 + + + 20 + + + All + + When this switch is specified, all objects will be retrieved. + + + SwitchParameter + + + False + + + Order + + Sort order by the created timestamp of the objects. `asc` for ascending order and `desc` for descending order. The default is `asc` + + + asc + desc + + String + + String + + + asc + + + TimeoutSec + + Specifies how long the request can be pending before it times out. +The default value is `0` (infinite). + + Int32 + + Int32 + + + 0 + + + MaxRetryCount + + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). +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. + + + Int32 + + Int32 + + + 0 + + + ApiBase + + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` + + System.Uri + + System.Uri + + + https://api.openai.com/v1 + + + ApiKey + + Specifies API key for authentication. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + + Object + + Object + + + None + + + Organization + + Specifies Organization ID which used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + + string + + string + + + None + + + + + + CompletionId + + The ID of the chat completion to retrieve. + + String + + String None - - MemoryLimit + + Limit - Optional memory limit for the container. Defaults to `1g`. Supported values are `1g`, `4g`, `16g`, and `64g`. + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + + Int32 + + Int32 + + + 20 + + + All + + When this switch is specified, all objects will be retrieved. + + SwitchParameter + + SwitchParameter + + + False + + + Order + + Sort order by the created timestamp of the objects. `asc` for ascending order and `desc` for descending order. The default is `asc` String String - None + asc TimeoutSec @@ -10230,53 +11123,57 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN -------------------------- Example 1 -------------------------- - PS C:\> New-Container -Name "My Container" + PS C:\> Get-ChatCompletion -CompletionId "chatcompl-abcd123" - Creates a new container with the name "My Container". + Get a completion with the specified ID. - ----------------------------- 例 2 ----------------------------- - PS C:\> New-Container -Name "My Container" -FileId ('file-abc123', 'file-def456') + -------------------------- Example 2 -------------------------- + PS C:\> Get-ChatCompletion -All - Creates a new container with the name "My Container" and copies two files to the container. + Lists all stored completions. Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/New-Container.md + https://github.com/mkht/PSOpenAI/blob/main/Docs/Get-ChatCompletion.md - https://developers.openai.com/api/reference/resources/containers/methods/create/ - https://developers.openai.com/api/reference/resources/containers/methods/create/ + https://developers.openai.com/api/reference/resources/chat/subresources/completions/methods/list/ + https://developers.openai.com/api/reference/resources/chat/subresources/completions/methods/list/ + + + https://developers.openai.com/api/reference/resources/chat/subresources/completions/methods/retrieve/ + https://developers.openai.com/api/reference/resources/chat/subresources/completions/methods/retrieve/ - New-Conversation - New - Conversation + Get-Container + Get + Container - Create a new conversation. + Retrieves a container. - Create a new conversation. + Get a single container or list multiple containers. - New-Conversation - - MetaData + Get-Container + + ContainerId - A dictionary of metadata to associate with the conversation. + The ID of the container to retrieve. - IDictionary + String - IDictionary + String None @@ -10299,7 +11196,8 @@ The default value is `0` (infinite). Number between `0` and `100`. Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). +The default value is `0` (No retry). +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 retried. Int32 @@ -10328,243 +11226,67 @@ If not specified, it will use `https://api.openai.com/v1`. The type of data should be `[string]` or `[securestring]`. If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY`. - SecureString + Object - SecureString + Object + + + None + + + Organization + + Specifies Organization ID used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION`. + + string + + string None - - - - MetaData - - A dictionary of metadata to associate with the conversation. - - IDictionary - - IDictionary - - - None - - - TimeoutSec - - Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). - - Int32 - - Int32 - - - 0 - - - MaxRetryCount - - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). - - Int32 - - Int32 - - - 0 - - - ApiBase - - Specifies an API endpoint URL such as: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1`. - - System.Uri - - System.Uri - - - https://api.openai.com/v1 - - - ApiKey - - Specifies API key for authentication. -The type of data should be `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY`. - - SecureString - - SecureString - - - None - - - - - - - PSCustomObject - - - - - - - - - - - - - - -------------------------- Example 1 -------------------------- - PS C:\> $Conversation = New-Conversation - - Creates a new conversation. - - - - - - Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/New-Conversation.md - - - https://developers.openai.com/api/reference/resources/conversations/methods/create/ - https://developers.openai.com/api/reference/resources/conversations/methods/create/ - - - - - - New-VectorStore - New - VectorStore - - Create a vector store. - - - - Create a vector store. - - - New-VectorStore - - Name - - The name of the vector store. - - String - - String - - - None - + Get-Container - Description - - A description for the vector store. Can be used to describe the vector store's purpose. - - String - - String - - - None - - - FileId + Limit - A list of File IDs that the vector store should use. + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. - Object[] + Int32 - Object[] + Int32 - None + 20 - ExpiresAfterDays + All - The number of days after the anchor time that the vector store will expire. + When this switch is specified, all containers will be retrieved. - UInt16 - UInt16 + SwitchParameter - None + False - ExpiresAfterAnchor - - Anchor timestamp after which the expiration policy applies. Supported anchors: `last_active_at`. - - String - - String - - - last_active_at - - - ChunkingStrategy - - The chunking strategy used to chunk the file(s). If not set, will use the "auto" strategy. Only applicable if FileId is non-empty. - - String - - String - - - None - - - MaxChunkSizeTokens - - The maximum number of tokens in each chunk. The default value is 800. The minimum value is 100 and the maximum value is 4096. -Note that the parameter only acceptable when the ChunkingStrategy is "static". - - String - - String - - - 800 - - - ChunkOverlapTokens + Order - The number of tokens that overlap between chunks. The default value is 400. The value must not exceed half of MaxChunkSizeTokens. -Note that the parameter only acceptable when the ChunkingStrategy is "static". + Sort order by the created timestamp of the objects. `asc` for ascending order and `desc` for descending order. The default is `asc`. + + asc + desc + String String - 400 - - - MetaData - - Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. - - IDictionary - - IDictionary - - - None + asc TimeoutSec @@ -10585,8 +11307,7 @@ The default value is `0` (infinite). Number between `0` and `100`. Specifies the maximum number of retries if the request fails. The default value is `0` (No retry). -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. - +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 retried. Int32 @@ -10598,8 +11319,8 @@ Note : Retries will only be performed if the request fails with a `429 (Rate lim ApiBase - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` + Specifies an API endpoint URL such as: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1`. System.Uri @@ -10612,8 +11333,8 @@ If not specified, it will use `https://api.openai.com/v1` ApiKey Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` +The type of data should be `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY`. Object @@ -10625,8 +11346,8 @@ If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_AP Organization - Specifies Organization ID which used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + Specifies Organization ID used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION`. string @@ -10638,10 +11359,10 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN - - Name + + ContainerId - The name of the vector store. + The ID of the container to retrieve. String @@ -10651,115 +11372,53 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN None - Description - - A description for the vector store. Can be used to describe the vector store's purpose. - - String - - String - - - None - - - FileId + Limit - A list of File IDs that the vector store should use. + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. - Object[] + Int32 - Object[] + Int32 - None + 20 - ExpiresAfterDays + All - The number of days after the anchor time that the vector store will expire. + When this switch is specified, all containers will be retrieved. - UInt16 + SwitchParameter - UInt16 + SwitchParameter - None + False - ExpiresAfterAnchor + Order - Anchor timestamp after which the expiration policy applies. Supported anchors: `last_active_at`. + Sort order by the created timestamp of the objects. `asc` for ascending order and `desc` for descending order. The default is `asc`. String String - last_active_at + asc - - ChunkingStrategy + + TimeoutSec - The chunking strategy used to chunk the file(s). If not set, will use the "auto" strategy. Only applicable if FileId is non-empty. + Specifies how long the request can be pending before it times out. +The default value is `0` (infinite). - String + Int32 - String + Int32 - None - - - MaxChunkSizeTokens - - The maximum number of tokens in each chunk. The default value is 800. The minimum value is 100 and the maximum value is 4096. -Note that the parameter only acceptable when the ChunkingStrategy is "static". - - String - - String - - - 800 - - - ChunkOverlapTokens - - The number of tokens that overlap between chunks. The default value is 400. The value must not exceed half of MaxChunkSizeTokens. -Note that the parameter only acceptable when the ChunkingStrategy is "static". - - String - - String - - - 400 - - - MetaData - - Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. - - IDictionary - - IDictionary - - - None - - - TimeoutSec - - Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). - - Int32 - - Int32 - - - 0 + 0 MaxRetryCount @@ -10767,8 +11426,7 @@ The default value is `0` (infinite). Number between `0` and `100`. Specifies the maximum number of retries if the request fails. The default value is `0` (No retry). -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. - +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 retried. Int32 @@ -10780,8 +11438,8 @@ Note : Retries will only be performed if the request fails with a `429 (Rate lim ApiBase - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` + Specifies an API endpoint URL such as: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1`. System.Uri @@ -10794,8 +11452,8 @@ If not specified, it will use `https://api.openai.com/v1` ApiKey Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` +The type of data should be `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY`. Object @@ -10807,8 +11465,8 @@ If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_AP Organization - Specifies Organization ID which used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + Specifies Organization ID used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION`. string @@ -10837,49 +11495,60 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN -------------------------- Example 1 -------------------------- - PS C:\> New-VectorStore -Name "Test-Store-X" + PS C:\> Get-Container "cont_abc123" - Creates a new vector store that the name has. + Get a container with the ID `cont_abc123`. - -------------------------- Example 1 -------------------------- - PS C:\> New-VectorStore -Name "Test-Store-X" -FileId ('file-abc123', 'file-def456', 'file-ghi789') + -------------------------- Example 2 -------------------------- + PS C:\> Get-Container -Limit 5 -Order desc - Creates a new vector store with attached 3 files. + Get the latest 5 containers. + + + + -------------------------- Example 3 -------------------------- + PS C:\> Get-Container -All + + Get all containers. Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/New-VectorStore.md + https://github.com/mkht/PSOpenAI/blob/main/Docs/Get-Container.md - https://developers.openai.com/api/reference/resources/vector_stores/methods/create/ - https://developers.openai.com/api/reference/resources/vector_stores/methods/create/ + https://developers.openai.com/api/reference/resources/containers/methods/retrieve/ + https://developers.openai.com/api/reference/resources/containers/methods/retrieve/ + + + https://developers.openai.com/api/reference/resources/containers/methods/list/ + https://developers.openai.com/api/reference/resources/containers/methods/list/ - New-Video - New - Video + Get-ContainerFile + Get + ContainerFile - Creates a new video generation job. + Retrieve Container File. - Creates a new asynchronous job that generates a video with the requested model, duration, and resolution. The cmdlet returns the job metadata so that you can poll its status or download the generated content when it completes. + Get a single file attached to a container, or list multiple files attached to a container. - New-Video - - Prompt + Get-ContainerFile + + ContainerId - Text prompt that describes the video to generate. + The ID of the container. String @@ -10888,10 +11557,10 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN None - - InputReference + + FileId - Path to an optional image reference that guides generation. + The ID of the file to retrieve. String @@ -10901,45 +11570,132 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN None - Model + TimeoutSec - The video generation model to use. The default value is `sora-2`. + Specifies how long the request can be pending before it times out. +The default value is `0` (infinite). - String + Int32 - String + Int32 - sora-2 + 0 - Seconds + MaxRetryCount - Length of the generated video, in seconds. Supported values are `4`, `8`, and `12`. The default value is `4`. + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). +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 retried. + + Int32 + + Int32 + + + 0 + + + ApiBase + + Specifies an API endpoint URL such as: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1`. + + System.Uri + + System.Uri + + + https://api.openai.com/v1 + + + ApiKey + + Specifies API key for authentication. +The type of data should be `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY`. + + Object + + Object + + + None + + + Organization + + Specifies Organization ID used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION`. + + string + + string + + + None + + + + Get-ContainerFile + + ContainerId + + The ID of the container. String String - 4 + None - Size + Limit - Resolution of the generated video. Supported values are `720x1280`, `1280x720`, `1024x1792`, and `1792x1024`. The default value is `720x1280`. + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + + Int32 + + Int32 + + + 20 + + + All + + When this switch is specified, all files attached to the container will be retrieved. + + + SwitchParameter + + + False + + + Order + + Sort order by the created timestamp of the objects. `asc` for ascending order and `desc` for descending order. The default is `asc`. + + asc + desc + String String - 720x1280 + asc TimeoutSec - Specifies how long the request can be pending before it times out. The default value is `0` (infinite). + Specifies how long the request can be pending before it times out. +The default value is `0` (infinite). Int32 @@ -10951,7 +11707,10 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN MaxRetryCount - Number between `0` and `100`. Specifies the maximum number of retries if the request fails. The default value is `0` (No retry). 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. + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). +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 retried. Int32 @@ -10963,7 +11722,8 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN ApiBase - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` If not specified, it will use `https://api.openai.com/v1` + Specifies an API endpoint URL such as: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1`. System.Uri @@ -10975,7 +11735,9 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN ApiKey - Specifies API key for authentication. The type of data should `[string]` or `[securestring]`. If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + Specifies API key for authentication. +The type of data should be `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY`. Object @@ -10987,7 +11749,8 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN Organization - Specifies Organization ID which used for an API request. If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + Specifies Organization ID used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION`. string @@ -10999,10 +11762,10 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN - - Prompt + + ContainerId - Text prompt that describes the video to generate. + The ID of the container. String @@ -11011,10 +11774,10 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN None - - InputReference + + FileId - Path to an optional image reference that guides generation. + The ID of the file to retrieve. String @@ -11024,45 +11787,46 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN None - Model + Limit - The video generation model to use. The default value is `sora-2`. + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. - String + Int32 - String + Int32 - sora-2 + 20 - Seconds + All - Length of the generated video, in seconds. Supported values are `4`, `8`, and `12`. The default value is `4`. + When this switch is specified, all files attached to the container will be retrieved. - String + SwitchParameter - String + SwitchParameter - 4 + False - Size + Order - Resolution of the generated video. Supported values are `720x1280`, `1280x720`, `1024x1792`, and `1792x1024`. The default value is `720x1280`. + Sort order by the created timestamp of the objects. `asc` for ascending order and `desc` for descending order. The default is `asc`. String String - 720x1280 + asc TimeoutSec - Specifies how long the request can be pending before it times out. The default value is `0` (infinite). + Specifies how long the request can be pending before it times out. +The default value is `0` (infinite). Int32 @@ -11074,7 +11838,10 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN MaxRetryCount - Number between `0` and `100`. Specifies the maximum number of retries if the request fails. The default value is `0` (No retry). 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. + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). +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 retried. Int32 @@ -11086,7 +11853,8 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN ApiBase - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` If not specified, it will use `https://api.openai.com/v1` + Specifies an API endpoint URL such as: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1`. System.Uri @@ -11098,7 +11866,9 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN ApiKey - Specifies API key for authentication. The type of data should `[string]` or `[securestring]`. If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + Specifies API key for authentication. +The type of data should be `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY`. Object @@ -11110,7 +11880,8 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN Organization - Specifies Organization ID which used for an API request. If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + Specifies Organization ID used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION`. string @@ -11139,53 +11910,62 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN -------------------------- Example 1 -------------------------- - PS C:\> New-Video -Prompt 'Dancing Doggo' + PS C:\> Get-ContainerFile -ContainerId 'cont_abc123' -FileId 'file-abc123' - Creates a new video job using the default model, duration, and resolution. + Get the file with ID `file-abc123` attached to the container with ID `cont_abc123`. -------------------------- Example 2 -------------------------- - PS C:\> New-Video -Prompt 'Dancing Donuts' -Model 'sora-2-pro' -Seconds 12 -Size 1280x720 + PS C:\> Get-ContainerFile -ContainerId 'cont_abc123' -Limit 5 -Order desc - Creates a 12-second landscape video with the `sora-2-pro` model. + Get the latest 5 files attached to the container with ID `cont_abc123`. + + + + -------------------------- Example 3 -------------------------- + PS C:\> Get-ContainerFile -ContainerId 'cont_abc123' -All + + Get all files attached to the container with ID `cont_abc123`. Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/New-Video.md + https://github.com/mkht/PSOpenAI/blob/main/Docs/Get-ContainerFile.md - https://developers.openai.com/api/docs/guides/video-generation - https://developers.openai.com/api/docs/guides/video-generation + https://developers.openai.com/api/reference/resources/containers/subresources/files/methods/retrieve/ + https://developers.openai.com/api/reference/resources/containers/subresources/files/methods/retrieve/ - https://developers.openai.com/api/reference/resources/videos/methods/create/ - https://developers.openai.com/api/reference/resources/videos/methods/create/ + https://developers.openai.com/api/reference/resources/containers/subresources/files/methods/list/ + https://developers.openai.com/api/reference/resources/containers/subresources/files/methods/list/ - New-Video - New - Video + Get-ContainerFileContent + Get + ContainerFileContent - Creates a new video remix job. + Retrieve Container File Content - Remix lets you take an existing video and make targeted adjustments without regenerating everything from scratch. You can provide a text prompt to guide the changes you want to make, and the model will generate a new version of the video that incorporates those changes while preserving the original content as much as possible. + Get the content of a file attached to a container. +You can specify the container and file by their IDs, or pass a ContainerFile object. +The content can be saved to a local file or output as a byte array. - New-Video - - Prompt + Get-ContainerFileContent + + ContainerId - Updated text prompt that directs the remix generation. + The ID of the container. String @@ -11194,10 +11974,23 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN None - - VideoId + + FileId - The identifier of the video to delete. + The ID of the file to retrieve. + + String + + String + + + None + + + OutFile + + The path to the local file to save the content. +If not specified, the content is output as a byte array. String @@ -11209,7 +12002,8 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN TimeoutSec - Specifies how long the request can be pending before it times out. The default value is `0` (infinite). + Specifies how long the request can be pending before it times out. +The default value is `0` (infinite). Int32 @@ -11221,7 +12015,10 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN MaxRetryCount - Number between `0` and `100`. Specifies the maximum number of retries if the request fails. The default value is `0` (No retry). 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. + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). +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 retried. Int32 @@ -11233,7 +12030,8 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN ApiBase - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` If not specified, it will use `https://api.openai.com/v1` + Specifies an API endpoint URL such as: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1`. System.Uri @@ -11245,7 +12043,9 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN ApiKey - Specifies API key for authentication. The type of data should `[string]` or `[securestring]`. If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + Specifies API key for authentication. +The type of data should be `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY`. Object @@ -11257,7 +12057,104 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN Organization - Specifies Organization ID which used for an API request. If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + Specifies Organization ID used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION`. + + string + + string + + + None + + + + Get-ContainerFileContent + + ContainerFile + + A ContainerFile object from Get-ContainerFile. + + PSCustomObject + + PSCustomObject + + + None + + + OutFile + + The path to the local file to save the content. +If not specified, the content is output as a byte array. + + String + + String + + + None + + + TimeoutSec + + Specifies how long the request can be pending before it times out. +The default value is `0` (infinite). + + Int32 + + Int32 + + + 0 + + + MaxRetryCount + + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). +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 retried. + + Int32 + + Int32 + + + 0 + + + ApiBase + + Specifies an API endpoint URL such as: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1`. + + System.Uri + + System.Uri + + + https://api.openai.com/v1 + + + ApiKey + + Specifies API key for authentication. +The type of data should be `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY`. + + Object + + Object + + + None + + + Organization + + Specifies Organization ID used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION`. string @@ -11269,10 +12166,10 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN - - Prompt + + ContainerId - Updated text prompt that directs the remix generation. + The ID of the container. String @@ -11281,10 +12178,10 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN None - - VideoId + + FileId - The identifier of the video to delete. + The ID of the file to retrieve. String @@ -11293,34 +12190,64 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN None - - TimeoutSec + + ContainerFile - Specifies how long the request can be pending before it times out. The default value is `0` (infinite). + A ContainerFile object from Get-ContainerFile. - Int32 + PSCustomObject - Int32 + PSCustomObject - 0 + None - MaxRetryCount + OutFile - Number between `0` and `100`. Specifies the maximum number of retries if the request fails. The default value is `0` (No retry). 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. + The path to the local file to save the content. +If not specified, the content is output as a byte array. - Int32 + String - Int32 + String - 0 + None - ApiBase + TimeoutSec - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` If not specified, it will use `https://api.openai.com/v1` + Specifies how long the request can be pending before it times out. +The default value is `0` (infinite). + + Int32 + + Int32 + + + 0 + + + MaxRetryCount + + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). +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 retried. + + Int32 + + Int32 + + + 0 + + + ApiBase + + Specifies an API endpoint URL such as: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1`. System.Uri @@ -11332,7 +12259,9 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN ApiKey - Specifies API key for authentication. The type of data should `[string]` or `[securestring]`. If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + Specifies API key for authentication. +The type of data should be `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY`. Object @@ -11344,7 +12273,8 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN Organization - Specifies Organization ID which used for an API request. If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + Specifies Organization ID used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION`. string @@ -11358,10 +12288,10 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN - PSCustomObject + Byte[] - + If `-OutFile` is not specified, outputs the file content as a byte array. @@ -11373,42 +12303,57 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN -------------------------- Example 1 -------------------------- - PS C:\> New-VideoRemix -Prompt 'Change the background to a sunny beach' -VideoId 'video_abc123' + PS C:\> Get-ContainerFileContent -ContainerId 'cont_abc123' -FileId 'file-abc123' -OutFile 'C:\data\sample.pdf' - Creates a new video remix job using the specified prompt and video ID. + Download the file content and save it to `C:\data\sample.pdf`. + + + + -------------------------- Example 2 -------------------------- + PS C:\> $ContentBytes = Get-ContainerFileContent -ContainerId 'cont_abc123' -FileId 'file-abc123' + + Download the file content and output as a byte array. + + + + -------------------------- Example 3 -------------------------- + PS C:\> $File = Get-ContainerFile -ContainerId 'cont_abc123' -FileId 'file-abc123' +PS C:\> Get-ContainerFileContent -ContainerFile $File -OutFile 'C:\data\sample.pdf' + + Download the file content using a ContainerFile object and save it to a local file. Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/New-VideoRemix.md + https://github.com/mkht/PSOpenAI/blob/main/Docs/Get-ContainerFileContent.md - https://developers.openai.com/api/reference/resources/videos/methods/remix/ - https://developers.openai.com/api/reference/resources/videos/methods/remix/ + https://developers.openai.com/api/reference/resources/containers/subresources/files/subresources/content/methods/retrieve/ + https://developers.openai.com/api/reference/resources/containers/subresources/files/subresources/content/methods/retrieve/ - Remove-ChatCompletion - Remove - ChatCompletion + Get-Conversation + Get + Conversation - Delete a stored chat completion. + Get a conversation with the given ID. - Delete a stored chat completion. Only chat completions that have been created with the store parameter set to true can be deleted. + Get a conversation with the given ID. - Remove-ChatCompletion - - CompletionId + Get-Conversation + + ConversationId - The ID of the chat completion to delete. + The unique identifier of the conversation to retrieve. String @@ -11421,19 +12366,6 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN TimeoutSec Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). - - Int32 - - Int32 - - - 0 - - - TimeoutSec - - Specifies how long the request can be pending before it times out. The default value is `0` (infinite). Int32 @@ -11449,8 +12381,7 @@ The default value is `0` (infinite). Number between `0` and `100`. Specifies the maximum number of retries if the request fails. The default value is `0` (No retry). -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. - +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 retried. Int32 @@ -11462,8 +12393,8 @@ Note : Retries will only be performed if the request fails with a `429 (Rate lim ApiBase - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` + Specifies an API endpoint URL such as: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1`. System.Uri @@ -11476,25 +12407,12 @@ If not specified, it will use `https://api.openai.com/v1` ApiKey Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` - - Object - - Object - - - None - - - Organization - - Specifies Organization ID which used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` +The type of data should be `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY`. - string + SecureString - string + SecureString None @@ -11502,10 +12420,10 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN - - CompletionId + + ConversationId - The ID of the chat completion to delete. + The unique identifier of the conversation to retrieve. String @@ -11518,19 +12436,6 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN TimeoutSec Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). - - Int32 - - Int32 - - - 0 - - - TimeoutSec - - Specifies how long the request can be pending before it times out. The default value is `0` (infinite). Int32 @@ -11546,8 +12451,7 @@ The default value is `0` (infinite). Number between `0` and `100`. Specifies the maximum number of retries if the request fails. The default value is `0` (No retry). -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. - +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 retried. Int32 @@ -11559,8 +12463,8 @@ Note : Retries will only be performed if the request fails with a `429 (Rate lim ApiBase - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` + Specifies an API endpoint URL such as: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1`. System.Uri @@ -11573,32 +12477,28 @@ If not specified, it will use `https://api.openai.com/v1` ApiKey Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` - - Object - - Object - - - None - - - Organization - - Specifies Organization ID which used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` +The type of data should be `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY`. - string + SecureString - string + SecureString None - + + + + PSCustomObject + + + + + + @@ -11607,42 +12507,43 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN -------------------------- Example 1 -------------------------- - PS C:\> Remove-ChatCompletion -CompletionId 'chatcompl-abc123' + PS C:\> $Conversation = Get-Conversation -ConversationId 'conv_abc123' - Remove a chat completion has the ID `chatcompl-abc123` + Retrieves a Conversation object with the ID `conv_abc123`. Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/Remove-ChatCompletion.md + https://github.com/mkht/PSOpenAI/blob/main/Docs/Get-Conversation.md - https://developers.openai.com/api/reference/resources/chat/subresources/completions/methods/delete/ - https://developers.openai.com/api/reference/resources/chat/subresources/completions/methods/delete/ + https://developers.openai.com/api/reference/resources/conversations/methods/retrieve/ + https://developers.openai.com/api/reference/resources/conversations/methods/retrieve/ - Remove-Container - Remove - Container + Get-ConversationItem + Get + ConversationItem - Delete Container + List items or get a specific item from a conversation. - Delete Container + Retrieves items from a conversation or a specific item by its ID. +Supports pagination, ordering, and additional query options. - Remove-Container - - ContainerId + Get-ConversationItem + + ConversationId - The ID of the container to delete. + The unique identifier of the conversation. String @@ -11651,70 +12552,124 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN None - - TimeoutSec + + ItemId - Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). + The unique identifier of the item to retrieve. - Int32 + String - Int32 + String - 0 + None - MaxRetryCount + Limit - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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 retried. + The maximum number of items to retrieve per request. +Default is `20`. Maximum is `100`. Int32 Int32 - 0 + 20 - ApiBase + All - Specifies an API endpoint URL such as: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1`. + If specified, retrieves all items by automatically handling pagination. - System.Uri - System.Uri + SwitchParameter - https://api.openai.com/v1 + False - ApiKey + After - Specifies API key for authentication. -The type of data should be `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY`. + A cursor for pagination. Retrieves items after the specified item ID. - Object + String - Object + String None - - Organization + + Order - Specifies Organization ID used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION`. + The order in which to return items. Allowed values: `asc`, `desc`. Default is `asc`. - string + String - string + String + + + asc + + + Include + + Specify additional output data to include in the model response. + + String[] + + String[] + + + None + + + TimeoutSec + + Specifies how long the request can be pending before it times out. +Default is `0` (infinite). + + Int32 + + Int32 + + + 0 + + + MaxRetryCount + + Specifies the maximum number of retries if the request fails. +Default is `0` (No retry). + + Int32 + + Int32 + + + 0 + + + ApiBase + + Specifies the API endpoint URL. + + System.Uri + + System.Uri + + + None + + + ApiKey + + Specifies the API key for authentication. + + SecureString + + SecureString None @@ -11722,10 +12677,59 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN - - ContainerId + + ConversationId - The ID of the container to delete. + The unique identifier of the conversation. + + String + + String + + + None + + + ItemId + + The unique identifier of the item to retrieve. + + String + + String + + + None + + + Limit + + The maximum number of items to retrieve per request. +Default is `20`. Maximum is `100`. + + Int32 + + Int32 + + + 20 + + + All + + If specified, retrieves all items by automatically handling pagination. + + SwitchParameter + + SwitchParameter + + + False + + + After + + A cursor for pagination. Retrieves items after the specified item ID. String @@ -11734,11 +12738,35 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN None + + Order + + The order in which to return items. Allowed values: `asc`, `desc`. Default is `asc`. + + String + + String + + + asc + + + Include + + Specify additional output data to include in the model response. + + String[] + + String[] + + + None + TimeoutSec Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). +Default is `0` (infinite). Int32 @@ -11750,10 +12778,8 @@ The default value is `0` (infinite). MaxRetryCount - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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 retried. + Specifies the maximum number of retries if the request fails. +Default is `0` (No retry). Int32 @@ -11765,46 +12791,48 @@ Note: Retries will only be performed if the request fails with a `429 (Rate limi ApiBase - Specifies an API endpoint URL such as: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1`. + Specifies the API endpoint URL. System.Uri System.Uri - https://api.openai.com/v1 + None ApiKey - Specifies API key for authentication. -The type of data should be `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY`. + Specifies the API key for authentication. - Object + SecureString - Object + SecureString None - - Organization + + + + + String + - Specifies Organization ID used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION`. + - string + + + + - string - + PSCustomObject - None - - - - + + + + + @@ -11813,55 +12841,213 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN -------------------------- Example 1 -------------------------- - PS C:\> Remove-Container 'cont_abc123' + PS C:\> Get-ConversationItem -ConversationId 'conv_abc123' -Limit 10 - Delete a container with ID `cont_abc123`. + Retrieves the list of items in the conversation with ID `conv_abc123`. Limits the result to 10 items. + + + + -------------------------- Example 2 -------------------------- + PS C:\> Get-ConversationItem -ConversationId 'conv_abc123' -ItemId 'item_xyz789' + + Retrieves a specific item with ID `item_xyz789` from the conversation `conv_abc123`. + + + + -------------------------- Example 3 -------------------------- + PS C:\> Get-ConversationItem -ConversationId 'conv_abc123' -All + + Retrieves all items from the conversation, handling pagination automatically. Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/Remove-Container.md + https://github.com/mkht/PSOpenAI/blob/main/Docs/Get-ConversationItem.md - https://developers.openai.com/api/reference/resources/containers/methods/delete/ - https://developers.openai.com/api/reference/resources/containers/methods/delete/ + https://developers.openai.com/api/reference/resources/conversations/subresources/items/methods/retrieve + https://developers.openai.com/api/reference/resources/conversations/subresources/items/methods/retrieve + + + https://developers.openai.com/api/reference/resources/conversations/subresources/items/methods/list + https://developers.openai.com/api/reference/resources/conversations/subresources/items/methods/list - Remove-ContainerFile - Remove - ContainerFile + Get-CosineSimilarity + Get + CosineSimilarity - Delete Container File + Calculate cosine similarity between two vectors. - Removes a file attached to a container. - + Calculate cosine similarity between two vectors. - Remove-ContainerFile - - ContainerId + Get-CosineSimilarity + + Vector1 - The ID of the container. + First vector - String + Double[] - String + Double[] None - - FileId - - The ID of the file to remove. + + Vector2 + + Second vector. The dimension is must same as first vector. + + Double[] + + Double[] + + + None + + + + + + Vector1 + + First vector + + Double[] + + Double[] + + + None + + + Vector2 + + Second vector. The dimension is must same as first vector. + + Double[] + + Double[] + + + None + + + + + + + System.Double + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + PS C:\> $v1 = (-0.01302161, -0.01999075, 0.007301898) +PS C:\> $v2 = (0.01506045, -0.04311577, 0.01272033) +PS C:\> Get-CosineSimilarity $v1 $v2 +0.00144161334877118 + + + + + + + + Online Version: + https://github.com/mkht/PSOpenAI/blob/main/Docs/Get-CosineSimilarity.md + + + + + + Set-OpenAIContext + Set + OpenAIContext + + Gets common parameters that are implicitly used when executing functions. + + + + Gets the common parameter context that is set by Set-OpenAIContext. Note: Objects obtained with Get-OpenAIContext are read-only, and changes to their property values are not reflected in the context. To set the context, use Set-OpenAIContext. + + + + Set-OpenAIContext + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + PS C:\> Set-OpenAIContext -ApiType 'Azure' -ApiKey 'AZURE_API_KEY' -ApiBase 'https://my-endpoint.openai.azure.com/' +PS C:\> Get-OpenAIContext + +ApiKey : System.Security.SecureString +ApiType : Azure +ApiBase : https://my-endpoint.openai.azure.com/ +ApiVersion : +AuthType : azure +Organization : +TimeoutSec : 0 +MaxRetryCount : 0 + + + + + + + + Online Version: + https://github.com/mkht/PSOpenAI/blob/main/Docs/Get-OpenAIContext.md + + + + + + Get-OpenAIFile + Get + OpenAIFile + + Retrieves information about files stored in OpenAI, allowing for listing and retrieving specific files. + + + + Retrieves information about files stored in OpenAI, allowing for listing and retrieving specific files. + + + + Get-OpenAIFile + + FileId + + Specifies the ID of the file to be retrieved. String @@ -11889,7 +13075,8 @@ The default value is `0` (infinite). Number between `0` and `100`. Specifies the maximum number of retries if the request fails. The default value is `0` (No retry). -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 retried. +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. + Int32 @@ -11901,8 +13088,8 @@ Note: Retries will only be performed if the request fails with a `429 (Rate limi ApiBase - Specifies an API endpoint URL such as: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1`. + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` System.Uri @@ -11915,8 +13102,8 @@ If not specified, it will use `https://api.openai.com/v1`. ApiKey Specifies API key for authentication. -The type of data should be `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY`. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` Object @@ -11928,8 +13115,8 @@ If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_AP Organization - Specifies Organization ID used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION`. + Specifies Organization ID which used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` string @@ -11940,19 +13127,58 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN - Remove-ContainerFile - - ContainerFile + Get-OpenAIFile + + Purpose - A ContainerFile object from Get-ContainerFile. + Only return files with the given purpose. - PSCustomObject + String - PSCustomObject + String None + + Limit + + A limit on the number of objects to be returned. Limit can range between 1 and 10000, and the default is 10000. + + Int32 + + Int32 + + + 10000 + + + All + + When this switch is specified, all objects will be retrieved. + + + SwitchParameter + + + False + + + Order + + Sort order by the created timestamp of the objects. `asc` for ascending order and `desc` for descending order. The default is `desc` + + + asc + desc + + String + + String + + + desc + TimeoutSec @@ -11972,7 +13198,8 @@ The default value is `0` (infinite). Number between `0` and `100`. Specifies the maximum number of retries if the request fails. The default value is `0` (No retry). -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 retried. +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. + Int32 @@ -11984,8 +13211,8 @@ Note: Retries will only be performed if the request fails with a `429 (Rate limi ApiBase - Specifies an API endpoint URL such as: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1`. + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` System.Uri @@ -11998,8 +13225,8 @@ If not specified, it will use `https://api.openai.com/v1`. ApiKey Specifies API key for authentication. -The type of data should be `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY`. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` Object @@ -12011,8 +13238,8 @@ If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_AP Organization - Specifies Organization ID used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION`. + Specifies Organization ID which used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` string @@ -12024,10 +13251,10 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN - - ContainerId + + FileId - The ID of the container. + Specifies the ID of the file to be retrieved. String @@ -12036,10 +13263,10 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN None - - FileId + + Purpose - The ID of the file to remove. + Only return files with the given purpose. String @@ -12048,30 +13275,54 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN None - - ContainerFile - - A ContainerFile object from Get-ContainerFile. - - PSCustomObject - - PSCustomObject - - - None - - TimeoutSec + Limit - Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). + A limit on the number of objects to be returned. Limit can range between 1 and 10000, and the default is 10000. Int32 Int32 - 0 + 10000 + + + All + + When this switch is specified, all objects will be retrieved. + + SwitchParameter + + SwitchParameter + + + False + + + Order + + Sort order by the created timestamp of the objects. `asc` for ascending order and `desc` for descending order. The default is `desc` + + String + + String + + + desc + + + TimeoutSec + + Specifies how long the request can be pending before it times out. +The default value is `0` (infinite). + + Int32 + + Int32 + + + 0 MaxRetryCount @@ -12079,7 +13330,8 @@ The default value is `0` (infinite). Number between `0` and `100`. Specifies the maximum number of retries if the request fails. The default value is `0` (No retry). -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 retried. +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. + Int32 @@ -12091,8 +13343,8 @@ Note: Retries will only be performed if the request fails with a `429 (Rate limi ApiBase - Specifies an API endpoint URL such as: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1`. + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` System.Uri @@ -12105,8 +13357,8 @@ If not specified, it will use `https://api.openai.com/v1`. ApiKey Specifies API key for authentication. -The type of data should be `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY`. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` Object @@ -12118,8 +13370,8 @@ If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_AP Organization - Specifies Organization ID used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION`. + Specifies Organization ID which used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` string @@ -12148,50 +13400,66 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN -------------------------- Example 1 -------------------------- - PS C:\> Remove-ContainerFile -ContainerId 'cont_abc123' -FileId 'file-abc123' + PS C:\> Get-OpenAIFile -FileId "file-abc123" - Remove the file with ID `file-abc123` from the container with ID `cont_abc123`. + This command retrieves a file with the specified ID from OpenAI. -------------------------- Example 2 -------------------------- - PS C:\> $File = Get-ContainerFile -ContainerId 'cont_abc123' -FileId 'file-abc123' -PS C:\> Remove-ContainerFile -ContainerFile $File + PS C:\> Get-OpenAIFile -Purpose "assistants" -All - Remove the file using a ContainerFile object. + Lists all files where the purpose attribute is assistants. Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/Remove-ContainerFile.md + https://github.com/mkht/PSOpenAI/blob/main/Docs/Get-OpenAIFile.md - https://developers.openai.com/api/reference/resources/containers/subresources/files/methods/delete/ - https://developers.openai.com/api/reference/resources/containers/subresources/files/methods/delete/ + https://developers.openai.com/api/reference/resources/files/methods/list/ + https://developers.openai.com/api/reference/resources/files/methods/list/ + + + https://developers.openai.com/api/reference/resources/files/methods/retrieve/ + https://developers.openai.com/api/reference/resources/files/methods/retrieve/ - Remove-Conversation - Remove - Conversation + Get-OpenAIFileContent + Get + OpenAIFileContent - Delete a conversation with the given ID. + Retrieves the contents of a file. - Delete a conversation with the given ID. + Retrieves the contents of a file. You can choose to output as a byte array or save to a file. +Note: The OpenAI API specification limits the types of files whose contents can be retrieved. - Remove-Conversation - - ConversationId + Get-OpenAIFileContent + + FileId - The ID of the conversation to delete. + The ID of the file to use for this request. + + String + + String + + + None + + + OutFile + + The path of the file to save. String @@ -12218,7 +13486,9 @@ The default value is `0` (infinite). Number between `0` and `100`. Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). +The default value is `0` (No retry). +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. + Int32 @@ -12230,8 +13500,8 @@ The default value is `0` (No retry). ApiBase - Specifies an API endpoint URL such as: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1`. + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` System.Uri @@ -12244,12 +13514,25 @@ If not specified, it will use `https://api.openai.com/v1`. ApiKey Specifies API key for authentication. -The type of data should be `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY`. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` - SecureString + Object - SecureString + Object + + + None + + + Organization + + Specifies Organization ID which used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + + string + + string None @@ -12257,10 +13540,22 @@ If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_AP - - ConversationId + + FileId - The ID of the conversation to delete. + The ID of the file to use for this request. + + String + + String + + + None + + + OutFile + + The path of the file to save. String @@ -12287,7 +13582,9 @@ The default value is `0` (infinite). Number between `0` and `100`. Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). +The default value is `0` (No retry). +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. + Int32 @@ -12299,8 +13596,8 @@ The default value is `0` (No retry). ApiBase - Specifies an API endpoint URL such as: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1`. + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` System.Uri @@ -12313,12 +13610,25 @@ If not specified, it will use `https://api.openai.com/v1`. ApiKey Specifies API key for authentication. -The type of data should be `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY`. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` - SecureString + Object - SecureString + Object + + + None + + + Organization + + Specifies Organization ID which used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + + string + + string None @@ -12328,7 +13638,7 @@ If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_AP - None + [System.Byte[]] @@ -12343,54 +13653,45 @@ If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_AP -------------------------- Example 1 -------------------------- - PS C:\> Remove-Conversation -ConversationId "conv_abc123" + PS C:\> Get-OpenAIFileContent -FileId 'file-abc123' -OutFile C:\file.csv - Deletes the conversation with the ID `conv_abc123`. + Retrieve the contents of the file whose ID is file-abc123 and save it to C:\file.csv Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/Remove-Conversation.md + https://github.com/mkht/PSOpenAI/blob/main/Docs/Get-OpenAIFileContent.md - https://developers.openai.com/api/reference/resources/conversations/methods/delete/ - https://developers.openai.com/api/reference/resources/conversations/methods/delete/ + https://developers.openai.com/api/reference/resources/files/methods/content + https://developers.openai.com/api/reference/resources/files/methods/content - Remove-ConversationItem - Remove - ConversationItem + Get-OpenAIModels + Get + OpenAIModels - Delete an item from a conversation with the given ID. + Lists the currently available models. - Delete an item from a conversation with the given ID. + Lists the currently available models, and provides basic information about each one such as the owner and availability. +You can refer to the Models documentation to understand what models are available and the differences between them. +https://developers.openai.com/api/reference/resources/models/methods/list/ - Remove-ConversationItem - - ItemId - - The ID of the item to delete. - - String - - String - - - None - - - ConversationId + Get-OpenAIModels + + Name - The ID of the conversation that contains the item. + Specifies the model name which you wish to get. +If not specified, lists all available models. String @@ -12417,7 +13718,9 @@ The default value is `0` (infinite). Number between `0` and `100`. Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). +The default value is `0` (No retry). +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. + Int32 @@ -12429,8 +13732,8 @@ The default value is `0` (No retry). ApiBase - Specifies an API endpoint URL such as: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1`. + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` System.Uri @@ -12443,12 +13746,25 @@ If not specified, it will use `https://api.openai.com/v1`. ApiKey Specifies API key for authentication. -The type of data should be `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY`. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` - SecureString + Object - SecureString + Object + + + None + + + Organization + + Specifies Organization ID which used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + + string + + string None @@ -12456,22 +13772,11 @@ If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_AP - - ConversationId + + Name - The ID of the conversation that contains the item. - - String - - String - - - None - - - ItemId - - The ID of the item to delete. + Specifies the model name which you wish to get. +If not specified, lists all available models. String @@ -12498,7 +13803,9 @@ The default value is `0` (infinite). Number between `0` and `100`. Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). +The default value is `0` (No retry). +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. + Int32 @@ -12510,8 +13817,8 @@ The default value is `0` (No retry). ApiBase - Specifies an API endpoint URL such as: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1`. + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` System.Uri @@ -12524,12 +13831,25 @@ If not specified, it will use `https://api.openai.com/v1`. ApiKey Specifies API key for authentication. -The type of data should be `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY`. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` - SecureString + Object - SecureString + Object + + + None + + + Organization + + Specifies Organization ID which used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + + string + + string None @@ -12539,7 +13859,7 @@ If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_AP - None + [pscustomobject] @@ -12553,43 +13873,68 @@ If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_AP - -------------------------- Example 1 -------------------------- - PS C:\> Remove-ConversationItem -ConversationId "conv_abc123" -ItemId "msg_xyz456" + ------------ Example 1: List all available models. ------------ + PS C:\> Get-OpenAIModels | select -ExpandProperty ID + +babbage +davinci +gpt-3.5-turbo-0613 +text-davinci-003 +... - Deletes the item with ID `msg_xyz456` from the conversation with ID `conv_abc123`. + + + + + ---------- Example 2: Get specific model information. ---------- + PS C:\> Get-OpenAIModels -Name "gpt-3.5-turbo" + +id : gpt-3.5-turbo +object : model +owned_by : openai +permission : {@{id=modelperm-QvbW9EnkbwPtWZu... +root : gpt-3.5-turbo +parent : +created : 2023/02/28 18:56:42 + + Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/Remove-ConversationItem.md + https://github.com/mkht/PSOpenAI/blob/main/Docs/Get-OpenAIModels.md - https://developers.openai.com/api/reference/resources/conversations/subresources/items/methods/delete/ - https://developers.openai.com/api/reference/resources/conversations/subresources/items/methods/delete/ + https://developers.openai.com/api/docs/models + https://developers.openai.com/api/docs/models + + + https://developers.openai.com/api/reference/resources/models/methods/list/ + https://developers.openai.com/api/reference/resources/models/methods/list/ - Remove-OpenAIFile - Remove - OpenAIFile + Get-Response + Get + Response - Delete a file. + Retrieves a model response with the given ID. - Delete a file. + Retrieves a model response with the given ID. - Remove-OpenAIFile - - FileId + Get-Response + + ResponseId - The ID of the file to use for this request. + The ID of the response to retrieve. String @@ -12599,17 +13944,80 @@ If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_AP None - TimeoutSec + Include - Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). + Specify additional output data to include in the model response. + + String[] + + String[] + + + None + + + IncludeObfuscation + + When true, stream obfuscation will be enabled. Stream obfuscation adds random characters to an obfuscation field on streaming delta events to normalize payload sizes as a mitigation to certain side-channel attacks. + + Boolean + + Boolean + + + None + + + Stream + + If set, the model response data will be streamed to the client. + + + SwitchParameter + + + False + + + StreamOutputType + + Specifying the format that the function output. This parameter is only valid for the stream output. This parameter is only valid for the stream output. - `text` : Output only text deltas that the model generated. (Default) +- `object` : Output all events that the API respond. + + + + text + object + + String + + String + + + text + + + StartingAfter + + The sequence number of the event after which to start streaming. This parameter is only valid for the stream output. Int32 Int32 - 0 + None + + + OutputRawResponse + + If specifies this switch, an output of this function to be a raw response value from the API. (Normally JSON formatted string.) + + + SwitchParameter + + + False TimeoutSec @@ -12683,10 +14091,10 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN - - FileId + + ResponseId - The ID of the file to use for this request. + The ID of the response to retrieve. String @@ -12696,17 +14104,78 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN None - TimeoutSec + Include - Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). + Specify additional output data to include in the model response. + + String[] + + String[] + + + None + + + IncludeObfuscation + + When true, stream obfuscation will be enabled. Stream obfuscation adds random characters to an obfuscation field on streaming delta events to normalize payload sizes as a mitigation to certain side-channel attacks. + + Boolean + + Boolean + + + None + + + Stream + + If set, the model response data will be streamed to the client. + + SwitchParameter + + SwitchParameter + + + False + + + StreamOutputType + + Specifying the format that the function output. This parameter is only valid for the stream output. This parameter is only valid for the stream output. - `text` : Output only text deltas that the model generated. (Default) +- `object` : Output all events that the API respond. + + + String + + String + + + text + + + StartingAfter + + The sequence number of the event after which to start streaming. This parameter is only valid for the stream output. Int32 Int32 - 0 + None + + + OutputRawResponse + + If specifies this switch, an output of this function to be a raw response value from the API. (Normally JSON formatted string.) + + SwitchParameter + + SwitchParameter + + + False TimeoutSec @@ -12779,101 +14248,16 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN - - - - - - - - - -------------------------- Example 1 -------------------------- - PS C:\> Remove-OpenAIFile -FileId 'file-abc123' - - Remove a file that has the ID `file-abc123` - - - - - - Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/Remove-OpenAIFile.md - - - https://developers.openai.com/api/reference/resources/files/methods/delete/ - https://developers.openai.com/api/reference/resources/files/methods/delete/ - - - - - - Remove-RealtimeSessionItem - Remove - RealtimeSessionItem - - Remove an item from the conversation history. - - - - Remove an item from the conversation history. - - - - Remove-RealtimeSessionItem - - ItemId - - The ID of the item to delete. - - String - - String - - - None - - - EventId - - Optional client-generated ID used to identify this event. - - String - - String - - - None - - - - - - ItemId - - The ID of the item to delete. - - String + + - String - + PSCustomObject - None - - - EventId - Optional client-generated ID used to identify this event. + - String - - String - - - None - - - - + + @@ -12882,42 +14266,42 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN -------------------------- Example 1 -------------------------- - PS C:\> Remove-RealtimeSessionItem -ItemId 'msg_001' + PS C:\> Get-Response -ResponseId "resp_abcd123" - + Get a response with the specified ID. Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/Remove-RealtimeSessionItem.md + https://github.com/mkht/PSOpenAI/blob/main/Docs/Get-Response.md - https://developers.openai.com/api/docs/guides/realtime-conversations/ - https://developers.openai.com/api/docs/guides/realtime-conversations/ + https://developers.openai.com/api/reference/resources/responses/methods/retrieve/ + https://developers.openai.com/api/reference/resources/responses/methods/retrieve/ - Remove-Response - Remove - Response + Get-ResponseInputItem + Get + ResponseInputItem - Deletes a model response with the given ID. + Lists or Retrieves an input items for a given response. - Deletes a model response with the given ID. + Lists or Retrieves a Message of the Thread. - Remove-Response + Get-ResponseInputItem ResponseId - The ID of the response to delete. + The ID of the response to retrieve input items for. String @@ -12927,17 +14311,43 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN None - TimeoutSec + Limit - Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. Int32 Int32 - 0 + 20 + + + All + + When this switch is specified, all objects will be retrieved. + + + SwitchParameter + + + False + + + Order + + The order to return the input items in. `asc` for ascending order and `desc` for descending order. The default is `asc` + + + asc + desc + + String + + String + + + asc TimeoutSec @@ -13014,7 +14424,7 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN ResponseId - The ID of the response to delete. + The ID of the response to retrieve input items for. String @@ -13024,17 +14434,40 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN None - TimeoutSec + Limit - Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. Int32 Int32 - 0 + 20 + + + All + + When this switch is specified, all objects will be retrieved. + + SwitchParameter + + SwitchParameter + + + False + + + Order + + The order to return the input items in. `asc` for ascending order and `desc` for descending order. The default is `asc` + + String + + String + + + asc TimeoutSec @@ -13107,7 +14540,16 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN - + + + + PSCustomObject + + + + + + @@ -13116,42 +14558,42 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN -------------------------- Example 1 -------------------------- - PS C:\> Remove-Response -ResponseId 'resp_abc123' + PS C:\> Get-ResponseInputItem -ResponseId 'resp_abc123' -All - Remove a response has the ID `resp_abc123` + List all input items associated with the response. Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/Remove-Response.md + https://github.com/mkht/PSOpenAI/blob/main/Docs/Get-ResponseInputItem.md - https://developers.openai.com/api/reference/resources/responses/methods/delete/ - https://developers.openai.com/api/reference/resources/responses/methods/delete/ + https://developers.openai.com/api/reference/resources/responses/subresources/input_items/methods/list/ + https://developers.openai.com/api/reference/resources/responses/subresources/input_items/methods/list/ - Remove-VectorStore - Remove + Get-VectorStore + Get VectorStore - Delete a vector store. + Retrieves a vector store. - Delete a vector store. + Get a vector srore or List multiple vector srore - Remove-VectorStore - + Get-VectorStore + VectorStoreId - The ID of the vector store to delete. + The ID of the vector store to retrieve. String @@ -13230,155 +14672,134 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN None - - - - VectorStoreId - - The ID of the vector store to delete. - - String - - String - - - None - - - TimeoutSec - - Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). - - Int32 - - Int32 - - - 0 - - - MaxRetryCount - - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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. - - - Int32 - - Int32 - - - 0 - - - ApiBase - - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` + + Get-VectorStore + + Limit + + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + + Int32 + + Int32 + + + 20 + + + Order + + Sort order by the created timestamp of the objects. `asc` for ascending order and `desc` for descending order. The default is `asc` + + + asc + desc + + String + + String + + + asc + + + TimeoutSec + + Specifies how long the request can be pending before it times out. +The default value is `0` (infinite). + + Int32 + + Int32 + + + 0 + + + MaxRetryCount + + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). +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. + + + Int32 + + Int32 + + + 0 + + + ApiBase + + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` If not specified, it will use `https://api.openai.com/v1` - - System.Uri - - System.Uri - - - https://api.openai.com/v1 - - - ApiKey - - Specifies API key for authentication. + + System.Uri + + System.Uri + + + https://api.openai.com/v1 + + + ApiKey + + Specifies API key for authentication. The type of data should `[string]` or `[securestring]`. If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` - - Object - - Object - - - None - - - Organization - - Specifies Organization ID which used for an API request. + + Object + + Object + + + None + + + Organization + + Specifies Organization ID which used for an API request. If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` - - string - - string - - - None - - - - - - - - - - - - -------------------------- Example 1 -------------------------- - PS C:\> Remove-VectorStore 'vs_abc123' - - Delete a vector store with ID `vs_abc123`. - - - - - - Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/Remove-VectorStore.md - - - https://developers.openai.com/api/reference/resources/vector_stores/methods/delete/ - https://developers.openai.com/api/reference/resources/vector_stores/methods/delete/ - - - - - - Remove-VectorStoreFile - Remove - VectorStoreFile - - Delete a vector store file. - - - - Delete a vector store file. This will remove the file from the vector store but the file itself will not be deleted. To delete the file, use `Remove-OpenAIFile`. - - + + string + + string + + + None + + - Remove-VectorStoreFile - - VectorStoreId + Get-VectorStore + + All - The ID of the vector store that the file belongs to. + When this switch is specified, all vector stores will be retrieved. - String - String + SwitchParameter - None + False - - FileId + + Order - The ID of the file being removed. + Sort order by the created timestamp of the objects. `asc` for ascending order and `desc` for descending order. The default is `asc` + + asc + desc + String String - None + asc TimeoutSec @@ -13452,10 +14873,10 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN - + VectorStoreId - The ID of the vector store that the file belongs to. + The ID of the vector store to retrieve. String @@ -13464,17 +14885,41 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN None - - FileId + + Limit - The ID of the file being removed. + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + + Int32 + + Int32 + + + 20 + + + All + + When this switch is specified, all vector stores will be retrieved. + + SwitchParameter + + SwitchParameter + + + False + + + Order + + Sort order by the created timestamp of the objects. `asc` for ascending order and `desc` for descending order. The default is `asc` String String - None + asc TimeoutSec @@ -13547,7 +14992,16 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN - + + + + PSCustomObject + + + + + + @@ -13556,42 +15010,72 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN -------------------------- Example 1 -------------------------- - PS C:\> Remove-VectorStoreFile -VectorStoreId 'vs_abc123' -FileId 'file-abc123' + PS C:\> Get-VectorStore "vs_abc123" - Deletes a file with ID `file-abc123` from the vector store with ID `vs_ab123` + Get a vector store with ID of `vs_abc123`. - - - - Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/Remove-VectorStoreFile.md - + + -------------------------- Example 2 -------------------------- + PS C:\> Get-VectorStore -Limit 5 -Order desc + + Get latest 5 vector stores. + + + + -------------------------- Example 3 -------------------------- + PS C:\> Get-VectorStore -All + + Get all vector stores. + + + + - https://developers.openai.com/api/reference/resources/vector_stores/subresources/files/methods/delete/ - https://developers.openai.com/api/reference/resources/vector_stores/subresources/files/methods/delete/ + Online Version: + https://github.com/mkht/PSOpenAI/blob/main/Docs/Get-VectorStore.md + + + https://developers.openai.com/api/reference/resources/vector_stores/methods/retrieve/ + https://developers.openai.com/api/reference/resources/vector_stores/methods/retrieve/ + + + https://developers.openai.com/api/reference/resources/vector_stores/methods/list/ + https://developers.openai.com/api/reference/resources/vector_stores/methods/list/ - Remove-Video - Remove - Video + Get-VectorStoreFile + Get + VectorStoreFile - Deletes a video generation job. + Retrieves vector store files. - Deletes a video job that was previously created. Use this to clean up jobs that you no longer need. + Retrieves vector store files. - Remove-Video - - VideoId + Get-VectorStoreFile + + VectorStoreId - The identifier of the video to delete. + The ID of the vector store that the file belongs to. + + String + + String + + + None + + + FileId + + The ID of the file being retrieved. String @@ -13603,7 +15087,8 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN TimeoutSec - Specifies how long the request can be pending before it times out. The default value is `0` (infinite). + Specifies how long the request can be pending before it times out. +The default value is `0` (infinite). Int32 @@ -13615,7 +15100,11 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN MaxRetryCount - Number between `0` and `100`. Specifies the maximum number of retries if the request fails. The default value is `0` (No retry). 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. + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). +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. + Int32 @@ -13627,7 +15116,8 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN ApiBase - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` If not specified, it will use `https://api.openai.com/v1` + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` System.Uri @@ -13639,7 +15129,9 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN ApiKey - Specifies API key for authentication. The type of data should `[string]` or `[securestring]`. If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + Specifies API key for authentication. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` Object @@ -13651,7 +15143,8 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN Organization - Specifies Organization ID which used for an API request. If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + Specifies Organization ID which used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` string @@ -13661,129 +15154,12 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN None - - - - VideoId - - The identifier of the video to delete. - - String - - String - - - None - - - TimeoutSec - - Specifies how long the request can be pending before it times out. The default value is `0` (infinite). - - Int32 - - Int32 - - - 0 - - - MaxRetryCount - - Number between `0` and `100`. Specifies the maximum number of retries if the request fails. The default value is `0` (No retry). 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. - - Int32 - - Int32 - - - 0 - - - ApiBase - - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` If not specified, it will use `https://api.openai.com/v1` - - System.Uri - - System.Uri - - - https://api.openai.com/v1 - - - ApiKey - - Specifies API key for authentication. The type of data should `[string]` or `[securestring]`. If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` - - Object - - Object - - - None - - - Organization - - Specifies Organization ID which used for an API request. If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` - - string - - string - - - None - - - - - - - - - - - - -------------------------- Example 1 -------------------------- - PS C:\> Remove-Video -VideoId 'video_68ea' - - Deletes the specified video job. - - - - - - Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/Remove-Video.md - - - https://developers.openai.com/api/reference/resources/videos/methods/delete/ - https://developers.openai.com/api/reference/resources/videos/methods/delete/ - - - - - - Request-AudioSpeech - Request - AudioSpeech - - Generates audio from the input text. - - - - Generates audio from the input text. -https://developers.openai.com/api/docs/guides/text-to-speech/ - - - Request-AudioSpeech - - Text + Get-VectorStoreFile + + Filter - (Required) -The text to generate audio for. The maximum length is 4096 characters. + Filter by file status. One of `in_progress`, `completed`, `failed`, `cancelled`. String @@ -13793,60 +15169,109 @@ The text to generate audio for. The maximum length is 4096 characters.None - Model + Limit - One of the available TTS models: `tts-1`, `tts-1-hd` or `gpt-4o-mini-tts`. -The default value is `tts-1`. + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. - String + Int32 - String + Int32 - tts-1 + 20 - Voice + Order - The voice to use when generating the audio. Supported voices are `alloy`, `ash`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage` and `shimmer`. -The default value is `alloy`. + Sort order by the created timestamp of the objects. `asc` for ascending order and `desc` for descending order. The default is `asc` + + asc + desc + String String - alloy + asc - - Instructions + + TimeoutSec - Control the voice of your generated audio with additional instructions. Does not work with `tts-1` or `tts-1-hd`. + Specifies how long the request can be pending before it times out. +The default value is `0` (infinite). - String + Int32 - String + Int32 - None + 0 - - ResponseFormat + + MaxRetryCount - The format of audio. Supported formats are `mp3`, `opus`, `aac`, `flac`, `wav`, and `pcm` + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). +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. + - String + Int32 - String + Int32 - None + 0 - - OutFile - - (Required) -The path of the file to save. + + ApiBase + + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` + + System.Uri + + System.Uri + + + https://api.openai.com/v1 + + + ApiKey + + Specifies API key for authentication. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + + Object + + Object + + + None + + + Organization + + Specifies Organization ID which used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + + string + + string + + + None + + + + Get-VectorStoreFile + + Filter + + Filter by file status. One of `in_progress`, `completed`, `failed`, `cancelled`. String @@ -13856,16 +15281,31 @@ The path of the file to save. None - Speed + All - The speed of the generated audio. Select a value from `0.25` to `4.0`. `1.0` is the default. + When this switch is specified, all vector stores will be retrieved. - Double - Double + SwitchParameter - 1.0 + False + + + Order + + Sort order by the created timestamp of the objects. `asc` for ascending order and `desc` for descending order. The default is `asc` + + + asc + desc + + String + + String + + + asc TimeoutSec @@ -13884,7 +15324,8 @@ The default value is `0` (infinite). MaxRetryCount Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. The default value is `0` (No retry). +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). 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. @@ -13938,11 +15379,10 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN - - Text + + VectorStoreId - (Required) -The text to generate audio for. The maximum length is 4096 characters. + The ID of the vector store that the file belongs to. String @@ -13951,36 +15391,22 @@ The text to generate audio for. The maximum length is 4096 characters. None - - Model + + FileId - One of the available TTS models: `tts-1`, `tts-1-hd` or `gpt-4o-mini-tts`. -The default value is `tts-1`. + The ID of the file being retrieved. String String - tts-1 + None - Voice - - The voice to use when generating the audio. Supported voices are `alloy`, `ash`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage` and `shimmer`. -The default value is `alloy`. - - String - - String - - - alloy - - - Instructions + Filter - Control the voice of your generated audio with additional instructions. Does not work with `tts-1` or `tts-1-hd`. + Filter by file status. One of `in_progress`, `completed`, `failed`, `cancelled`. String @@ -13989,42 +15415,41 @@ The default value is `alloy`. None - - ResponseFormat + + Limit - The format of audio. Supported formats are `mp3`, `opus`, `aac`, `flac`, `wav`, and `pcm` + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. - String + Int32 - String + Int32 - None + 20 - - OutFile + + All - (Required) -The path of the file to save. + When this switch is specified, all vector stores will be retrieved. - String + SwitchParameter - String + SwitchParameter - None + False - Speed + Order - The speed of the generated audio. Select a value from `0.25` to `4.0`. `1.0` is the default. + Sort order by the created timestamp of the objects. `asc` for ascending order and `desc` for descending order. The default is `asc` - Double + String - Double + String - 1.0 + asc TimeoutSec @@ -14043,7 +15468,8 @@ The default value is `0` (infinite). MaxRetryCount Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. The default value is `0` (No retry). +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). 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. @@ -14099,7 +15525,7 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN - [string] + PSCustomObject @@ -14113,61 +15539,54 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN - -------------- Example 1: Text-to-Speech (Basic) -------------- - Request-AudioSpeech -Text 'Hello.' -OutFile 'C:\sample\audio.mp3' + -------------------------- Example 1 -------------------------- + PS C:\> Get-VectorStoreFile -VectorStoreId 'vs_abc123' -FileId 'file-abc123' - + Get a file with ID `file-abc123` in the vector store with ID of `vs_abc123`. - ------------- Example 2: Text-to-Speech (Options) ------------- - Request-AudioSpeech ` - -Text 'The quick brown fox jumped over the lazy dog.' ` - -OutFile 'C:\sample\audio.aac' ` - -Model tts-1-hd ` - -Voice Onyx ` - -Speed 1.2 + -------------------------- Example 2 -------------------------- + PS C:\> Get-VectorStoreFile -VectorStoreId 'vs_abc123' -All - + Get all files in the vector store with ID of `vs_abc123`. Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/Request-AudioSpeech.md + https://github.com/mkht/PSOpenAI/blob/main/Docs/Get-VectorStoreFile.md - https://developers.openai.com/api/docs/guides/text-to-speech/ - https://developers.openai.com/api/docs/guides/text-to-speech/ + https://developers.openai.com/api/reference/resources/vector_stores/subresources/files/methods/retrieve/ + https://developers.openai.com/api/reference/resources/vector_stores/subresources/files/methods/retrieve/ - https://developers.openai.com/api/reference/resources/audio/subresources/speech/methods/create/ - https://developers.openai.com/api/reference/resources/audio/subresources/speech/methods/create/ + https://developers.openai.com/api/reference/resources/vector_stores/subresources/files/methods/list/ + https://developers.openai.com/api/reference/resources/vector_stores/subresources/files/methods/list/ - Request-AudioTranscription - Request - AudioTranscription + Get-VectorStoreFileBatch + Get + VectorStoreFileBatch - Transcribes audio into the input language. + Retrieves a vector store file batch. - Transcribes audio into the input language. -https://developers.openai.com/api/docs/guides/speech-to-text/ + Retrieves a vector store file batch. - Request-AudioTranscription - - File + Get-VectorStoreFileBatch + + VectorStoreId - (Required) The audio file to transcribe, in one of these formats: `flac`, `mp3`, `mp4`, `mpeg`, `mpga`, `m4a`, `ogg`, `wav`, or `webm`. - + The ID of the vector store that the batch belongs to. String @@ -14176,98 +15595,239 @@ https://developers.openai.com/api/docs/guides/speech-to-text/ None - - Model + + BatchId - The name of model to use. The default value is `whisper-1`. + The ID of the file batch being retrieved. String String - whisper-1 + None - Prompt + TimeoutSec - An optional text to guide the model's style or continue a previous audio segment. -The prompt should match the audio language. + Specifies how long the request can be pending before it times out. +The default value is `0` (infinite). - String + Int32 - String + Int32 - None + 0 - - ResponseFormat + + MaxRetryCount - The format of the transcript output, in one of these options: `json`, `text`, `srt`, `verbose_json`, `vtt` or `diarized_json`. -The default value is `text`. + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). +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. + - String + Int32 - String + Int32 - text + 0 - Temperature + ApiBase - The sampling temperature, between `0` and `1`. -Higher values like `0.8` will make the output more random, while lower values like `0.2` will make it more focused and deterministic. + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` - Double + System.Uri - Double + System.Uri - None + https://api.openai.com/v1 - Include + ApiKey - Additional information to include in the transcription response. -`logprobs` only works with `-ResponseFormat` set to `json` and only with the models `gpt-4o-transcribe` and `gpt-4o-mini-transcribe` + Specifies API key for authentication. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` - String[] + Object - String[] - - - None - - - KnownSpeakerNames - - Optional list of speaker names that correspond to the audio samples provided in `-KnownSpeakerReferences`. Each entry should be a short identifier (for example customer or agent). Up to 4 speakers are supported. - - String[] - - String[] + Object None - - KnownSpeakerReferences + + Organization - Optional list of audio samples that contain known speaker references matching `-KnownSpeakerNames`. Each sample must be between 2 and 10 seconds, and can use any of the same input audio formats supported by file. + Specifies Organization ID which used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` - String[] + string - String[] + string None - - ChunkingStrategy + + + + + VectorStoreId + + The ID of the vector store that the batch belongs to. + + String + + String + + + None + + + BatchId + + The ID of the file batch being retrieved. + + String + + String + + + None + + + TimeoutSec + + Specifies how long the request can be pending before it times out. +The default value is `0` (infinite). + + Int32 + + Int32 + + + 0 + + + MaxRetryCount + + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). +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. + + + Int32 + + Int32 + + + 0 + + + ApiBase + + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` + + System.Uri + + System.Uri + + + https://api.openai.com/v1 + + + ApiKey + + Specifies API key for authentication. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + + Object + + Object + + + None + + + Organization + + Specifies Organization ID which used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + + string + + string + + + None + + + + + + + PSCustomObject + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + PS C:\> Get-VectorStoreFileBatch -VectorStoreId "vs_abc123" -BatchId 'vsfb_abc123' + + Get a vector store file batch with ID `vsfb_abc123`. + + + + + + Online Version: + https://github.com/mkht/PSOpenAI/blob/main/Docs/Get-VectorStoreFileBatch.md + + + https://developers.openai.com/api/reference/resources/vector_stores/subresources/file_batches/methods/retrieve/ + https://developers.openai.com/api/reference/resources/vector_stores/subresources/file_batches/methods/retrieve/ + + + + + + Get-VectorStoreFileInBatch + Get + VectorStoreFileInBatch + + Returns a list of vector store files in a batch. + + + + Returns a list of vector store files in a batch. + + + + Get-VectorStoreFileInBatch + + VectorStoreId - Controls how the audio is cut into chunks. Options are: `auto`, `server_vad`. The default value is `auto`. + The ID of the vector store that the batch belongs to. String @@ -14276,71 +15836,46 @@ Higher values like `0.8` will make the output more random, while lower values li None - - ChunkingStrategyThreshold - - Sensitivity threshold (0.0 to 1.0) for voice activity detection. - - Float - - Float - - - None - - - ChunkingStrategyPrefixPadding + + BatchId - Amount of audio to include before the VAD detected speech (in milliseconds). + The ID of the file batch being retrieved. - UInt16 + String - UInt16 + String None - ChunkingStrategySilenceDuration - - Duration of silence to detect speech stop (in milliseconds). - - UInt16 - - UInt16 - - - None - - - TimestampGranularities + Filter - The timestamp granularities to populate for this transcription. Any of these options: `word`, or `segment`. The default is `segment`. + Filter by file status. One of `in_progress`, `completed`, `failed`, `cancelled`. - String[] + String - String[] + String None - Language + Limit - The language of the input audio. -Supplying the input language in `ISO-639-1` format will improve accuracy and latency. + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. - String + Int32 - String + Int32 - None + 20 - Stream + All - If set to true, the model response data will be streamed. + When this switch is specified, all files in a batch will be retrieved. SwitchParameter @@ -14349,17 +15884,20 @@ Supplying the input language in `ISO-639-1` format will improve accuracy and lat False - StreamOutputType + Order - The format of the stream output, `text` or `object`. -The default value is `text`. This parameter is only used when `-Stream` is enabled. + Sort order by the created timestamp of the objects. `asc` for ascending order and `desc` for descending order. The default is `asc` + + asc + desc + String String - text + asc TimeoutSec @@ -14433,11 +15971,10 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN - - File + + VectorStoreId - (Required) The audio file to transcribe, in one of these formats: `flac`, `mp3`, `mp4`, `mpeg`, `mpga`, `m4a`, `ogg`, `wav`, or `webm`. - + The ID of the vector store that the batch belongs to. String @@ -14446,98 +15983,22 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN None - - Model - - The name of model to use. The default value is `whisper-1`. - - String - - String - - - whisper-1 - - - Prompt - - An optional text to guide the model's style or continue a previous audio segment. -The prompt should match the audio language. - - String - - String - - - None - - - ResponseFormat + + BatchId - The format of the transcript output, in one of these options: `json`, `text`, `srt`, `verbose_json`, `vtt` or `diarized_json`. -The default value is `text`. + The ID of the file batch being retrieved. String String - text - - - Temperature - - The sampling temperature, between `0` and `1`. -Higher values like `0.8` will make the output more random, while lower values like `0.2` will make it more focused and deterministic. - - Double - - Double - - - None - - - Include - - Additional information to include in the transcription response. -`logprobs` only works with `-ResponseFormat` set to `json` and only with the models `gpt-4o-transcribe` and `gpt-4o-mini-transcribe` - - String[] - - String[] - - - None - - - KnownSpeakerNames - - Optional list of speaker names that correspond to the audio samples provided in `-KnownSpeakerReferences`. Each entry should be a short identifier (for example customer or agent). Up to 4 speakers are supported. - - String[] - - String[] - - - None - - - KnownSpeakerReferences - - Optional list of audio samples that contain known speaker references matching `-KnownSpeakerNames`. Each sample must be between 2 and 10 seconds, and can use any of the same input audio formats supported by file. - - String[] - - String[] - - None - ChunkingStrategy + Filter - Controls how the audio is cut into chunks. Options are: `auto`, `server_vad`. The default value is `auto`. + Filter by file status. One of `in_progress`, `completed`, `failed`, `cancelled`. String @@ -14547,70 +16008,21 @@ Higher values like `0.8` will make the output more random, while lower values li None - ChunkingStrategyThreshold - - Sensitivity threshold (0.0 to 1.0) for voice activity detection. - - Float - - Float - - - None - - - ChunkingStrategyPrefixPadding - - Amount of audio to include before the VAD detected speech (in milliseconds). - - UInt16 - - UInt16 - - - None - - - ChunkingStrategySilenceDuration - - Duration of silence to detect speech stop (in milliseconds). - - UInt16 - - UInt16 - - - None - - - TimestampGranularities - - The timestamp granularities to populate for this transcription. Any of these options: `word`, or `segment`. The default is `segment`. - - String[] - - String[] - - - None - - - Language + Limit - The language of the input audio. -Supplying the input language in `ISO-639-1` format will improve accuracy and latency. + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. - String + Int32 - String + Int32 - None + 20 - Stream + All - If set to true, the model response data will be streamed. + When this switch is specified, all files in a batch will be retrieved. SwitchParameter @@ -14620,17 +16032,16 @@ Supplying the input language in `ISO-639-1` format will improve accuracy and lat False - StreamOutputType + Order - The format of the stream output, `text` or `object`. -The default value is `text`. This parameter is only used when `-Stream` is enabled. + Sort order by the created timestamp of the objects. `asc` for ascending order and `desc` for descending order. The default is `asc` String String - text + asc TimeoutSec @@ -14706,7 +16117,7 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN - [string] + PSCustomObject @@ -14720,59 +16131,43 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN - ------------------- Example 1: Audio-to-Text ------------------- - PS C:\> Request-AudioTranscription -File C:\sample\audio.mp3 -ResponseFormat text - -Hello, I am david. - - - - - - ---------------- Example 2: Speaker diarization ---------------- - PS C:\> $JsonResult = Request-AudioTranscription -File C:\sample\meeting.mp3 -Model gpt-transcribe-diarize -ResponseFormat diarized_json -PS C:\> $JsonResult | ConvertFrom-Json + -------------------------- Example 1 -------------------------- + PS C:\> Get-VectorStoreFileInBatch -VectorStoreId 'vs_abc123' -BatchId 'vsfb_abc123' -All - + Get all files in the vector store batch with ID of `vsfb_abc123`. Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/Request-AudioTranscription.md - - - https://developers.openai.com/api/docs/guides/speech-to-text/ - https://developers.openai.com/api/docs/guides/speech-to-text/ + https://github.com/mkht/PSOpenAI/blob/main/Docs/Get-VectorStoreFileInBatch.md - https://developers.openai.com/api/reference/resources/audio/subresources/transcriptions/methods/create/ - https://developers.openai.com/api/reference/resources/audio/subresources/transcriptions/methods/create/ + https://developers.openai.com/api/reference/resources/vector_stores/subresources/file_batches/methods/list_files/ + https://developers.openai.com/api/reference/resources/vector_stores/subresources/file_batches/methods/list_files/ - Request-AudioTranslation - Request - AudioTranslation + Get-Video + Get + Video - Translates audio into English. + Retrieves one or more video generation jobs. - Translates audio into English. -https://developers.openai.com/api/docs/guides/speech-to-text/ + 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. - Request-AudioTranslation - - File + Get-Video + + VideoId - (Required) The audio file to translate, in one of these formats: `flac`, `mp3`, `mp4`, `mpeg`, `mpga`, `m4a`, `ogg`, `wav`, or `webm`. - + The identifier of the video to retrieve. String @@ -14782,77 +16177,123 @@ https://developers.openai.com/api/docs/guides/speech-to-text/ None - Model + TimeoutSec - The name of model to use. The default value is `whisper-1`. + Specifies how long the request can be pending before it times out. The default value is `0` (infinite). - String + Int32 - String + Int32 - whisper-1 + 0 - Prompt + MaxRetryCount - An optional text to guide the model's style or continue a previous audio segment. -The prompt should be in English. + Number between `0` and `100`. Specifies the maximum number of retries if the request fails. The default value is `0` (No retry). 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. - String + Int32 - String + Int32 - None + 0 - - ResponseFormat + + ApiBase - The format of the transcript output, in one of these options: `json`, `text`, `srt`, `verbose_json`, or `vtt`. -The default value is `text`. + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` If not specified, it will use `https://api.openai.com/v1` - String + System.Uri - String + System.Uri - text + https://api.openai.com/v1 - Temperature + ApiKey - The sampling temperature, between `0` and `1`. -Higher values like `0.8` will make the output more random, while lower values like `0.2` will make it more focused and deterministic. + Specifies API key for authentication. The type of data should `[string]` or `[securestring]`. If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` - Double + Object - Double + Object None - - TimeoutSec + + Organization - Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). + Specifies Organization ID which used for an API request. If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` - Int32 + string - Int32 + string - 0 + None + + + + Get-Video + + Limit + + A number of items to retrieve. Limit can range between 1 and 100, and the default is 20. + + Int32 + + Int32 + + + 20 + + + Order + + Sort order by the created timestamp of the objects. `asc` for ascending order and `desc` for descending order. The default is `asc`. + + + asc + desc + + String + + String + + + asc + + + All + + When this switch is specified, all video jobs will be retrieved. + + + SwitchParameter + + + False + + + TimeoutSec + + Specifies how long the request can be pending before it times out. The default value is `0` (infinite). + + Int32 + + Int32 + + + 0 MaxRetryCount - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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. - + Number between `0` and `100`. Specifies the maximum number of retries if the request fails. The default value is `0` (No retry). 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. Int32 @@ -14864,8 +16305,7 @@ Note : Retries will only be performed if the request fails with a `429 (Rate lim ApiBase - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` If not specified, it will use `https://api.openai.com/v1` System.Uri @@ -14877,9 +16317,7 @@ If not specified, it will use `https://api.openai.com/v1` ApiKey - Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + Specifies API key for authentication. The type of data should `[string]` or `[securestring]`. If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` Object @@ -14891,8 +16329,7 @@ If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_AP Organization - Specifies Organization ID which used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + Specifies Organization ID which used for an API request. If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` string @@ -14904,11 +16341,10 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN - - File + + VideoId - (Required) The audio file to translate, in one of these formats: `flac`, `mp3`, `mp4`, `mpeg`, `mpga`, `m4a`, `ogg`, `wav`, or `webm`. - + The identifier of the video to retrieve. String @@ -14918,61 +16354,45 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN None - Model + Limit - The name of model to use. The default value is `whisper-1`. + A number of items to retrieve. Limit can range between 1 and 100, and the default is 20. - String + Int32 - String + Int32 - whisper-1 + 20 - Prompt - - An optional text to guide the model's style or continue a previous audio segment. -The prompt should be in English. - - String - - String - - - None - - - ResponseFormat + Order - The format of the transcript output, in one of these options: `json`, `text`, `srt`, `verbose_json`, or `vtt`. -The default value is `text`. + Sort order by the created timestamp of the objects. `asc` for ascending order and `desc` for descending order. The default is `asc`. String String - text + asc - Temperature + All - The sampling temperature, between `0` and `1`. -Higher values like `0.8` will make the output more random, while lower values like `0.2` will make it more focused and deterministic. + When this switch is specified, all video jobs will be retrieved. - Double + SwitchParameter - Double + SwitchParameter - None + False TimeoutSec - Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). + Specifies how long the request can be pending before it times out. The default value is `0` (infinite). Int32 @@ -14984,11 +16404,7 @@ The default value is `0` (infinite). MaxRetryCount - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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. - + Number between `0` and `100`. Specifies the maximum number of retries if the request fails. The default value is `0` (No retry). 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. Int32 @@ -15000,8 +16416,7 @@ Note : Retries will only be performed if the request fails with a `429 (Rate lim ApiBase - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` If not specified, it will use `https://api.openai.com/v1` System.Uri @@ -15013,9 +16428,7 @@ If not specified, it will use `https://api.openai.com/v1` ApiKey - Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + Specifies API key for authentication. The type of data should `[string]` or `[securestring]`. If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` Object @@ -15027,8 +16440,7 @@ If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_AP Organization - Specifies Organization ID which used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + Specifies Organization ID which used for an API request. If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` string @@ -15042,7 +16454,7 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN - [string] + PSCustomObject @@ -15056,50 +16468,61 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN - --------- Example 1: Japanese speech to English text. --------- - Request-AudioTranslation -File C:\sample\japanese.mp3 -ResponseFormat text - -Hello, My name is tanaka yoshio. + -------------------------- Example 1 -------------------------- + PS C:\> Get-Video -VideoId 'video_fb4e' - + Gets the job details for the specified video ID. + + + + -------------------------- Example 2 -------------------------- + PS C:\> Get-Video -Limit 5 -Order desc + + Lists the five most recent video jobs. + + + + -------------------------- Example 3 -------------------------- + PS C:\> Get-Video -All + + Lists all available video jobs by paging through the API. Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/Request-AudioTranslation.md + https://github.com/mkht/PSOpenAI/blob/main/Docs/Get-Video.md - https://developers.openai.com/api/docs/guides/speech-to-text/ - https://developers.openai.com/api/docs/guides/speech-to-text/ + https://developers.openai.com/api/reference/resources/videos/methods/retrieve/ + https://developers.openai.com/api/reference/resources/videos/methods/retrieve/ - https://developers.openai.com/api/reference/resources/audio/subresources/transcriptions/methods/create/ - https://developers.openai.com/api/reference/resources/audio/subresources/transcriptions/methods/create/ + https://developers.openai.com/api/reference/resources/videos/methods/list/ + https://developers.openai.com/api/reference/resources/videos/methods/list/ - Request-ChatCompletion - Request - ChatCompletion + Get-VideoContent + Get + VideoContent - Creates a completion for the chat message. + Downloads generated video content. - Creates a completion for the chat message. -https://developers.openai.com/api/reference/chat-completions/overview/ + 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. - Request-ChatCompletion - - Message + Get-VideoContent + + VideoId - The messages to generate chat completions. + The identifier of the video whose media to download. String @@ -15109,10 +16532,9 @@ https://developers.openai.com/api/reference/chat-completions/overview/None - Role + OutFile - The role of the messages author. One of `user`, `system`, `developer` or `function`. -The default is `user`. + Path to the file where the content should be saved. If omitted, the cmdlet returns the byte array instead of writing to disk. String @@ -15122,211 +16544,386 @@ The default is `user`. None - Name + Variant - The name of the author of this message. -This is an optional field, and may contain a-z, A-Z, 0-9, hyphens, and underscores, with a maximum length of 64 characters. + Which downloadable asset to return. Supported values are `video`, `thumbnail`, and `spritesheet`. The default value is `video`. String String - None + video - - Model + + WaitForCompletion - The name of model to use. The default value is `gpt-3.5-turbo`. + When specified, waits for the job to reach a completed state before downloading the content. - String - String + SwitchParameter - gpt-3.5-turbo + False - - SystemMessage + + TimeoutSec - An optional text to set the behavior of the assistant. + Specifies how long the request can be pending before it times out. The default value is `0` (infinite). - String[] + Int32 - String[] + Int32 - None + 0 - DeveloperMessage + MaxRetryCount - Developer-provided instructions that the model should follow, regardless of messages sent by the user. With o1 models and newer, developer messages replace the previous system messages. + Number between `0` and `100`. Specifies the maximum number of retries if the request fails. The default value is `0` (No retry). 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. - String[] + Int32 - String[] + Int32 - None + 0 - Modalities + ApiBase - Output types that you would like the model to generate for this request. -Some models can generate both text and audio. To request that responses, you can specify: `("text", "audio")` + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` If not specified, it will use `https://api.openai.com/v1` - String[] + System.Uri - String[] + System.Uri - None + https://api.openai.com/v1 - Voice + ApiKey - The voice the model uses to respond. + Specifies API key for authentication. The type of data should `[string]` or `[securestring]`. If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` - String + Object - String + Object None - - InputAudio + + Organization - The path of the audio file to passing the model. Supported formats are `wav` and `mp3`. + Specifies Organization ID which used for an API request. If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` - String + string - String + string None - - InputAudioFormat + + + + + VideoId + + The identifier of the video whose media to download. + + String + + String + + + None + + + OutFile + + Path to the file where the content should be saved. If omitted, the cmdlet returns the byte array instead of writing to disk. + + String + + String + + + None + + + Variant + + Which downloadable asset to return. Supported values are `video`, `thumbnail`, and `spritesheet`. The default value is `video`. + + String + + String + + + video + + + WaitForCompletion + + When specified, waits for the job to reach a completed state before downloading the content. + + SwitchParameter + + SwitchParameter + + + False + + + TimeoutSec + + Specifies how long the request can be pending before it times out. The default value is `0` (infinite). + + Int32 + + Int32 + + + 0 + + + MaxRetryCount + + Number between `0` and `100`. Specifies the maximum number of retries if the request fails. The default value is `0` (No retry). 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. + + Int32 + + Int32 + + + 0 + + + ApiBase + + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` If not specified, it will use `https://api.openai.com/v1` + + System.Uri + + System.Uri + + + https://api.openai.com/v1 + + + ApiKey + + Specifies API key for authentication. The type of data should `[string]` or `[securestring]`. If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + + Object + + Object + + + None + + + Organization + + Specifies Organization ID which used for an API request. If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + + string + + string + + + None + + + + + + + System.Byte[] + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + PS C:\> Get-VideoContent -VideoId 'video_abc123' -OutFile C:\videos\demo.mp4 + + Saves the video content for the specified job to `C:\videos\demo.mp4`. + + + + -------------------------- Example 2 -------------------------- + PS C:\> $Bytes = Get-VideoContent -VideoId 'video_abc123' + + Returns the video bytes for further processing. + + + + -------------------------- Example 3 -------------------------- + PS C:\> Get-VideoContent -VideoId 'video_abc123' -Variant thumbnail -WaitForCompletion -OutFile C:\videos\demo.webp + + Waits for the job to finish and then downloads the thumbnail asset. + + + + + + Online Version: + https://github.com/mkht/PSOpenAI/blob/main/Docs/Get-VideoContent.md + + + https://developers.openai.com/api/reference/resources/videos/methods/download_content/ + https://developers.openai.com/api/reference/resources/videos/methods/download_content/ + + + + + + New-Agent + New + Agent + + Creates a reusable agent. + + + + Creates a reusable agent. This command uses the OpenAI Agents API public beta and sends the required `OpenAI-Beta: agents=v1` header. Nested, evolving request schemas are accepted through `-Body` where applicable. + + + + New-Agent + + Body - Specifies the format of the input audio file. If not specified, the format is automatically determined from the file extension. + The request body as a dictionary. Use the fields defined by the corresponding OpenAI Agents API operation. - String + IDictionary - String + IDictionary None - - AudioOutFile + + AdditionalBody - Specifies where audio response from the model will be saved. If the model does not return a audio response, nothing is saved. + Additional JSON properties to merge into the request body. - String + Object - String + Object None - - OutputAudioFormat + + AdditionalHeaders - Specifies the format of the output audio file. The default value is `mp3`. + Additional HTTP headers to include in the request. - String + IDictionary - String + IDictionary None - - Images + + AdditionalQuery - An array of images to passing the model. You can specifies local image file or remote url. - + Additional query parameters to include in the request. - String[] + IDictionary - String[] + IDictionary None - - ImageDetail + + ApiBase - Controls how the model processes the image and generates its textual understanding. You can select from `Low` or `High`. -See more details : https://developers.openai.com/api/docs/guides/images-vision/ + The base URI for the OpenAI API. - String + Uri - String + Uri - Auto + None - - Tools + + ApiKey - A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for. -https://github.com/mkht/PSOpenAI/blob/main/Guides/How_to_call_functions_with_ChatGPT.ipynb + The OpenAI API key as a secure string. - System.Collections.IDictionary[] + SecureString - System.Collections.IDictionary[] + SecureString None - - ToolChoice + + ApiType - Controls how the model responds to function calls. -- `none` means the model does not call a function, and responds to the end-user. -- `auto` means the model can pick between an end-user or calling a function. -Specifying a particular function via `@{type = "function"; function = @{name = "my_function"}}` forces the model to call that function. + The API provider. Agents API commands support OpenAI only. - Object + + OpenAI + Azure + + OpenAIApiType - Object + OpenAIApiType None - - ParallelToolCalls + + AuthType - Whether to enable parallel function calling during tool use. The default is true (enabled) + The authentication type. Use openai for the Agents API. + + openai + azure + azure_ad + + String - SwitchParameter + String - True + None - - InvokeTools + + MaxRetryCount - Selects the action to be taken when the GPT model requests a function call. -- `None`: The requested function is not executed. This is the default. -- `Auto`: Automatically executes the requested function. -- `Confirm`: Displays a confirmation to the user before executing the requested function. + The maximum number of retries for transient API failures. - String + Int32 - String + Int32 None - - WebSearchContextSize + + Organization - High level guidance for the amount of context window space to use for the web search. One of `low`, `medium`, or `high` + The OpenAI organization ID. String @@ -15335,146 +16932,341 @@ Specifying a particular function via `@{type = "function"; function = @{name = " None - - WebSearchUserLocationCity + + TimeoutSec - Approximate location parameters for the web search. + The request timeout in seconds. Zero uses the module default. - String + Int32 - String + Int32 None - - WebSearchUserLocationCountry + + ProgressAction - Approximate location parameters for the web search. + Controls how PowerShell responds to progress updates. - String + ActionPreference - String + ActionPreference None - - WebSearchUserLocationRegion + + + + + AdditionalBody + + Additional JSON properties to merge into the request body. + + Object + + Object + + + None + + + AdditionalHeaders + + Additional HTTP headers to include in the request. + + IDictionary + + IDictionary + + + None + + + AdditionalQuery + + Additional query parameters to include in the request. + + IDictionary + + IDictionary + + + None + + + ApiBase + + The base URI for the OpenAI API. + + Uri + + Uri + + + None + + + ApiKey + + The OpenAI API key as a secure string. + + SecureString + + SecureString + + + None + + + ApiType + + The API provider. Agents API commands support OpenAI only. + + OpenAIApiType + + OpenAIApiType + + + None + + + AuthType + + The authentication type. Use openai for the Agents API. + + String + + String + + + None + + + Body + + The request body as a dictionary. Use the fields defined by the corresponding OpenAI Agents API operation. + + IDictionary + + IDictionary + + + None + + + MaxRetryCount + + The maximum number of retries for transient API failures. + + Int32 + + Int32 + + + None + + + Organization + + The OpenAI organization ID. + + String + + String + + + None + + + TimeoutSec + + The request timeout in seconds. Zero uses the module default. + + Int32 + + Int32 + + + None + + + ProgressAction + + Controls how PowerShell responds to progress updates. + + ActionPreference + + ActionPreference + + + None + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + New-Agent -Body @{ model = 'gpt-5.6'; name = 'Repository assistant' } + + Creates a reusable agent configuration. + + + + + + Online Version: + https://github.com/mkht/PSOpenAI/blob/v5/Docs/New-Agent.md + + + OpenAI Agents API + https://developers.openai.com/api/reference/typescript/resources/beta/subresources/agents + + + + + + New-AgentEnvironmentTemplate + New + AgentEnvironmentTemplate + + Creates a reusable agent environment template. + + + + Creates a reusable agent environment template. This command uses the OpenAI Agents API public beta and sends the required `OpenAI-Beta: agents=v1` header. Nested, evolving request schemas are accepted through `-Body` where applicable. + + + + New-AgentEnvironmentTemplate + + Body - Approximate location parameters for the web search. + The request body as a dictionary. Use the fields defined by the corresponding OpenAI Agents API operation. - String + IDictionary - String + IDictionary None - - WebSearchUserLocationTimeZone + + AdditionalBody - Approximate location parameters for the web search. + Additional JSON properties to merge into the request body. - String + Object - String + Object None - - Prediction + + AdditionalHeaders - Static predicted output content, such as the content of a text file that is being regenerated. + Additional HTTP headers to include in the request. - String + IDictionary - String + IDictionary None - - Temperature + + AdditionalQuery - 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. + Additional query parameters to include in the request. - Double + IDictionary - Double + IDictionary None - - TopP + + ApiBase - 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. + The base URI for the OpenAI API. - Double + Uri - Double + Uri None - - NumberOfAnswers + + ApiKey - How many chat completion choices to generate for each input message. -The default value is `1`. + The OpenAI API key as a secure string. - UInt16 + SecureString - UInt16 + SecureString - 1 + None - - Stream + + ApiType - If set, partial message deltas will be sent, like in ChatGPT. + The API provider. Agents API commands support OpenAI only. + + OpenAI + Azure + + OpenAIApiType - SwitchParameter + OpenAIApiType - False + None - - Store + + AuthType - Whether or not to store the output of this chat completion request for use in model distillation or evals. + The authentication type. Use openai for the Agents API. + + openai + azure + azure_ad + + String - SwitchParameter + String - False + None - - Verbosity + + MaxRetryCount - Controls the verbosity level of the response. -Valid values are `low`, `medium`, or `high`. - + The maximum number of retries for transient API failures. - String + Int32 - String + Int32 - medium + None - - ReasoningEffort + + Organization - Constrains effort on reasoning for reasoning models. Supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. -Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. + The OpenAI organization ID. String @@ -15483,212 +17275,341 @@ Reducing reasoning effort can result in faster responses and fewer tokens used o None - - MetaData + + TimeoutSec - Developer-defined tags and values used for filtering completions in the dashboard. + The request timeout in seconds. Zero uses the module default. - IDictionary + Int32 - IDictionary + Int32 None - - StopSequence + + ProgressAction - Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence. + Controls how PowerShell responds to progress updates. - String[] + ActionPreference - String[] + ActionPreference None - - MaxTokens + + + + + AdditionalBody + + Additional JSON properties to merge into the request body. + + Object + + Object + + + None + + + AdditionalHeaders + + Additional HTTP headers to include in the request. + + IDictionary + + IDictionary + + + None + + + AdditionalQuery + + Additional query parameters to include in the request. + + IDictionary + + IDictionary + + + None + + + ApiBase + + The base URI for the OpenAI API. + + Uri + + Uri + + + None + + + ApiKey + + The OpenAI API key as a secure string. + + SecureString + + SecureString + + + None + + + ApiType + + The API provider. Agents API commands support OpenAI only. + + OpenAIApiType + + OpenAIApiType + + + None + + + AuthType + + The authentication type. Use openai for the Agents API. + + String + + String + + + None + + + Body + + The request body as a dictionary. Use the fields defined by the corresponding OpenAI Agents API operation. + + IDictionary + + IDictionary + + + None + + + MaxRetryCount + + The maximum number of retries for transient API failures. + + Int32 + + Int32 + + + None + + + Organization + + The OpenAI organization ID. + + String + + String + + + None + + + TimeoutSec + + The request timeout in seconds. Zero uses the module default. + + Int32 + + Int32 + + + None + + + ProgressAction + + Controls how PowerShell responds to progress updates. + + ActionPreference + + ActionPreference + + + None + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + New-AgentEnvironmentTemplate -Body @{ name = 'Development environment' } + + Creates a reusable hosted environment template. + + + + + + Online Version: + https://github.com/mkht/PSOpenAI/blob/v5/Docs/New-AgentEnvironmentTemplate.md + + + OpenAI Agents API + https://developers.openai.com/api/reference/typescript/resources/beta/subresources/agents + + + + + + New-AgentSession + New + AgentSession + + Creates an agent session, optionally returning streamed events. + + + + Creates an agent session, optionally returning streamed events. This command uses the OpenAI Agents API public beta and sends the required `OpenAI-Beta: agents=v1` header. Nested, evolving request schemas are accepted through `-Body` where applicable. + + + + New-AgentSession + + Body - This value is now deprecated in favor of MaxCompletionTokens. + The request body as a dictionary. Use the fields defined by the corresponding OpenAI Agents API operation. - Int32 + IDictionary - Int32 + IDictionary None - - MaxCompletionTokens + + AdditionalBody - An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. + Additional JSON properties to merge into the request body. - Int32 + Object - Int32 + Object None - - PresencePenalty + + AdditionalHeaders - Number between `-2.0` and `2.0`. -Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics. + Additional HTTP headers to include in the request. - Double + IDictionary - Double + IDictionary None - - FrequencyPenalty + + AdditionalQuery - Number between `-2.0` and `2.0`. -Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. + Additional query parameters to include in the request. - Double + IDictionary - Double + IDictionary None - - LogitBias + + ApiBase - Modify the likelihood of specified tokens appearing in the completion. -Accepts a maps of tokens to an associated bias value from `-100` to `100`. You can use `ConvertTo-Token` to convert text to token IDs. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between `-1` and `1` should decrease or increase likelihood of selection; values like `-100` or `100` should result in a ban or exclusive selection of the relevant token. -As an example, you can pass like so: `@{23182 = 20; 88847 = -100}` -ID 23182 maps to "apple" and ID 88847 maps to "banana". Thus, this example increases the likelihood of the word "apple" being included in the response from the AI and greatly reduces the likelihood of the word "banana" being included. + The base URI for the OpenAI API. - IDictionary + Uri - IDictionary + Uri None - - LogProbs + + ApiKey - Whether to return log probabilities of the output tokens or not. If true, returns the log probabilities of each output token returned in the `content` of `message`. + The OpenAI API key as a secure string. - Boolean + SecureString - Boolean + SecureString None - - TopLogProbs + + ApiType - An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. `logprobs` must be set to `true` if this parameter is used. + The API provider. Agents API commands support OpenAI only. - UInt16 + + OpenAI + Azure + + OpenAIApiType - UInt16 + OpenAIApiType None - - ResponseFormat + + AuthType - Specifies the format that the model must output. -- `text` is default. -- `json_object` enables JSON mode, which ensures the message the model generates is valid JSON. -- `json_schema` enables Structured Outputs which ensures the model will match your supplied JSON schema. - - `raw_response` returns raw response content from API. + The authentication type. Use openai for the Agents API. - Object + + openai + azure + azure_ad + + String - Object + String None - - JsonSchema + + MaxRetryCount - Specifies an object or data structure to represent the JSON Schema that the model should be constrained to follow. -Required if `json_schema` is specified for `-ResponseFormat`. Otherwise, it is ignored. + The maximum number of retries for transient API failures. - String + Int32 - String + Int32 None - - Seed - - If specified, the system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. - - Int64 - - Int64 - - - None - - - ServiceTier - - Specifies the latency tier to use for processing the request. This parameter is relevant for customers subscribed to the scale tier service. - - String - - String - - - None - - - PromptCacheKey - - Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. - - String - - String - - - None - - - PromptCacheRetention - - The retention policy for the prompt cache. Set to `24h` to enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. - - String - - String - - - None - - - SafetyIdentifier - - A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. The IDs should be a string that uniquely identifies each user. - - String - - String - - - None - - - User + + Organization - (deprecated) This field is being replaced by `SafetyIdentifier` and `PromptCacheKey`. + The OpenAI organization ID. String @@ -15697,11 +17618,10 @@ Required if `json_schema` is specified for `-ResponseFormat`. Otherwise, it is i None - - AsBatch + + Stream - If this is specified, this cmdlet returns an object for Batch input -It does not perform an API request to OpenAI. It is useful with `Start-Batch` cmdlet. + Streams agent session events using server-sent events. For session creation, this also sends stream=true in the request body. SwitchParameter @@ -15709,96 +17629,26 @@ It does not perform an API request to OpenAI. It is useful with `Start-Batch` cm False - - CustomBatchId - - A unique id that will be used to match outputs to inputs of batch. Must be unique for each request in a batch. -This parameter is valid only when the `-AsBatch` swicth is used. Otherwise, it is simply ignored. - - String - - String - - - None - - + TimeoutSec - Specifies the timeout in seconds for each HTTP attempt, including reading the response body or stream. Retry delays are excluded. -The default value is `0` (infinite). - - Int32 - - Int32 - - - 0 - - - MaxRetryCount - - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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. - + The request timeout in seconds. Zero uses the module default. Int32 Int32 - 0 - - - ApiBase - - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` - - System.Uri - - System.Uri - - - https://api.openai.com/v1 - - - ApiKey - - Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` - - Object - - Object - - None - - Organization - - Specifies Organization ID which used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` - - string - - string - - - None - - - History + + ProgressAction - An object for keeping the conversation history. + Controls how PowerShell responds to progress updates. - Object[] + ActionPreference - Object[] + ActionPreference None @@ -15806,97 +17656,82 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN - - Message + + AdditionalBody - The messages to generate chat completions. + Additional JSON properties to merge into the request body. - String + Object - String + Object None - - Role + + AdditionalHeaders - The role of the messages author. One of `user`, `system`, `developer` or `function`. -The default is `user`. + Additional HTTP headers to include in the request. - String + IDictionary - String + IDictionary None - - Name + + AdditionalQuery - The name of the author of this message. -This is an optional field, and may contain a-z, A-Z, 0-9, hyphens, and underscores, with a maximum length of 64 characters. + Additional query parameters to include in the request. - String + IDictionary - String + IDictionary None - - Model - - The name of model to use. The default value is `gpt-3.5-turbo`. - - String - - String - - - gpt-3.5-turbo - - - SystemMessage + + ApiBase - An optional text to set the behavior of the assistant. + The base URI for the OpenAI API. - String[] + Uri - String[] + Uri None - - DeveloperMessage + + ApiKey - Developer-provided instructions that the model should follow, regardless of messages sent by the user. With o1 models and newer, developer messages replace the previous system messages. + The OpenAI API key as a secure string. - String[] + SecureString - String[] + SecureString None - - Modalities + + ApiType - Output types that you would like the model to generate for this request. -Some models can generate both text and audio. To request that responses, you can specify: `("text", "audio")` + The API provider. Agents API commands support OpenAI only. - String[] + OpenAIApiType - String[] + OpenAIApiType None - - Voice + + AuthType - The voice the model uses to respond. + The authentication type. Use openai for the Agents API. String @@ -15905,34 +17740,34 @@ Some models can generate both text and audio. To request that responses, you can None - - InputAudio + + Body - The path of the audio file to passing the model. Supported formats are `wav` and `mp3`. + The request body as a dictionary. Use the fields defined by the corresponding OpenAI Agents API operation. - String + IDictionary - String + IDictionary None - - InputAudioFormat + + MaxRetryCount - Specifies the format of the input audio file. If not specified, the format is automatically determined from the file extension. + The maximum number of retries for transient API failures. - String + Int32 - String + Int32 None - - AudioOutFile + + Organization - Specifies where audio response from the model will be saved. If the model does not return a audio response, nothing is saved. + The OpenAI organization ID. String @@ -15941,127 +17776,317 @@ Some models can generate both text and audio. To request that responses, you can None - - OutputAudioFormat + + Stream - Specifies the format of the output audio file. The default value is `mp3`. + Streams agent session events using server-sent events. For session creation, this also sends stream=true in the request body. - String + SwitchParameter - String + SwitchParameter - None + False - - Images + + TimeoutSec - An array of images to passing the model. You can specifies local image file or remote url. - + The request timeout in seconds. Zero uses the module default. - String[] + Int32 - String[] + Int32 None - - ImageDetail + + ProgressAction - Controls how the model processes the image and generates its textual understanding. You can select from `Low` or `High`. -See more details : https://developers.openai.com/api/docs/guides/images-vision/ + Controls how PowerShell responds to progress updates. - String + ActionPreference - String + ActionPreference - Auto + None - - Tools + + + + + + + + + + + -------------------------- Example 1 -------------------------- + New-AgentSession -Body @{ agent_id = 'agent_123'; environment = @{ type = 'none' }; input = 'Inspect this repository.' } + + Creates a managed session and submits its initial user input. + + + + + + Online Version: + https://github.com/mkht/PSOpenAI/blob/v5/Docs/New-AgentSession.md + + + OpenAI Agents API + https://developers.openai.com/api/reference/typescript/resources/beta/subresources/agents + + + + + + New-AgentVault + New + AgentVault + + Creates an agent credential vault. + + + + Creates an agent credential vault. This command uses the OpenAI Agents API public beta and sends the required `OpenAI-Beta: agents=v1` header. Nested, evolving request schemas are accepted through `-Body` where applicable. + + + + New-AgentVault + + Body + + The request body as a dictionary. Use the fields defined by the corresponding OpenAI Agents API operation. + + IDictionary + + IDictionary + + + None + + + AdditionalBody + + Additional JSON properties to merge into the request body. + + Object + + Object + + + None + + + AdditionalHeaders + + Additional HTTP headers to include in the request. + + IDictionary + + IDictionary + + + None + + + AdditionalQuery + + Additional query parameters to include in the request. + + IDictionary + + IDictionary + + + None + + + ApiBase + + The base URI for the OpenAI API. + + Uri + + Uri + + + None + + + ApiKey + + The OpenAI API key as a secure string. + + SecureString + + SecureString + + + None + + + ApiType + + The API provider. Agents API commands support OpenAI only. + + + OpenAI + Azure + + OpenAIApiType + + OpenAIApiType + + + None + + + AuthType + + The authentication type. Use openai for the Agents API. + + + openai + azure + azure_ad + + String + + String + + + None + + + MaxRetryCount + + The maximum number of retries for transient API failures. + + Int32 + + Int32 + + + None + + + Organization + + The OpenAI organization ID. + + String + + String + + + None + + + TimeoutSec + + The request timeout in seconds. Zero uses the module default. + + Int32 + + Int32 + + + None + + + ProgressAction + + Controls how PowerShell responds to progress updates. + + ActionPreference + + ActionPreference + + + None + + + + + + AdditionalBody - A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for. -https://github.com/mkht/PSOpenAI/blob/main/Guides/How_to_call_functions_with_ChatGPT.ipynb + Additional JSON properties to merge into the request body. - System.Collections.IDictionary[] + Object - System.Collections.IDictionary[] + Object None - - ToolChoice + + AdditionalHeaders - Controls how the model responds to function calls. -- `none` means the model does not call a function, and responds to the end-user. -- `auto` means the model can pick between an end-user or calling a function. -Specifying a particular function via `@{type = "function"; function = @{name = "my_function"}}` forces the model to call that function. + Additional HTTP headers to include in the request. - Object + IDictionary - Object + IDictionary None - - ParallelToolCalls + + AdditionalQuery - Whether to enable parallel function calling during tool use. The default is true (enabled) + Additional query parameters to include in the request. - SwitchParameter + IDictionary - SwitchParameter + IDictionary - True + None - - InvokeTools + + ApiBase - Selects the action to be taken when the GPT model requests a function call. -- `None`: The requested function is not executed. This is the default. -- `Auto`: Automatically executes the requested function. -- `Confirm`: Displays a confirmation to the user before executing the requested function. + The base URI for the OpenAI API. - String + Uri - String + Uri None - - WebSearchContextSize + + ApiKey - High level guidance for the amount of context window space to use for the web search. One of `low`, `medium`, or `high` + The OpenAI API key as a secure string. - String + SecureString - String + SecureString None - - WebSearchUserLocationCity + + ApiType - Approximate location parameters for the web search. + The API provider. Agents API commands support OpenAI only. - String + OpenAIApiType - String + OpenAIApiType None - - WebSearchUserLocationCountry + + AuthType - Approximate location parameters for the web search. + The authentication type. Use openai for the Agents API. String @@ -16070,34 +18095,34 @@ Specifying a particular function via `@{type = "function"; function = @{name = " None - - WebSearchUserLocationRegion + + Body - Approximate location parameters for the web search. + The request body as a dictionary. Use the fields defined by the corresponding OpenAI Agents API operation. - String + IDictionary - String + IDictionary None - - WebSearchUserLocationTimeZone + + MaxRetryCount - Approximate location parameters for the web search. + The maximum number of retries for transient API failures. - String + Int32 - String + Int32 None - - Prediction + + Organization - Static predicted output content, such as the content of a text file that is being regenerated. + The OpenAI organization ID. String @@ -16106,136 +18131,341 @@ Specifying a particular function via `@{type = "function"; function = @{name = " None - - Temperature + + TimeoutSec - 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. + The request timeout in seconds. Zero uses the module default. - Double + Int32 - Double + Int32 None - - TopP + + ProgressAction - 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. + Controls how PowerShell responds to progress updates. - Double + ActionPreference - Double + ActionPreference None - - NumberOfAnswers - - How many chat completion choices to generate for each input message. -The default value is `1`. - - UInt16 - - UInt16 - - - 1 + + + + + + + + + + + -------------------------- Example 1 -------------------------- + New-AgentVault -Body @{ name = 'Agent credentials' } + + Creates a vault for agent credentials. + + + + + + Online Version: + https://github.com/mkht/PSOpenAI/blob/v5/Docs/New-AgentVault.md + + + OpenAI Agents API + https://developers.openai.com/api/reference/typescript/resources/beta/subresources/agents + + + + + + New-AgentVaultCredential + New + AgentVaultCredential + + Creates a credential in an agent vault. + + + + Creates a credential in an agent vault. This command uses the OpenAI Agents API public beta and sends the required `OpenAI-Beta: agents=v1` header. Nested, evolving request schemas are accepted through `-Body` where applicable. + + + + New-AgentVaultCredential + + VaultId + + The agent vault ID. + + String + + String + + + None + + + Body + + The request body as a dictionary. Use the fields defined by the corresponding OpenAI Agents API operation. + + IDictionary + + IDictionary + + + None + + + AdditionalBody + + Additional JSON properties to merge into the request body. + + Object + + Object + + + None + + + AdditionalHeaders + + Additional HTTP headers to include in the request. + + IDictionary + + IDictionary + + + None + + + AdditionalQuery + + Additional query parameters to include in the request. + + IDictionary + + IDictionary + + + None + + + ApiBase + + The base URI for the OpenAI API. + + Uri + + Uri + + + None + + + ApiKey + + The OpenAI API key as a secure string. + + SecureString + + SecureString + + + None + + + ApiType + + The API provider. Agents API commands support OpenAI only. + + + OpenAI + Azure + + OpenAIApiType + + OpenAIApiType + + + None + + + AuthType + + The authentication type. Use openai for the Agents API. + + + openai + azure + azure_ad + + String + + String + + + None + + + MaxRetryCount + + The maximum number of retries for transient API failures. + + Int32 + + Int32 + + + None + + + Organization + + The OpenAI organization ID. + + String + + String + + + None + + + TimeoutSec + + The request timeout in seconds. Zero uses the module default. + + Int32 + + Int32 + + + None + + + ProgressAction + + Controls how PowerShell responds to progress updates. + + ActionPreference + + ActionPreference + + + None + + + + + + AdditionalBody + + Additional JSON properties to merge into the request body. + + Object + + Object + + + None - - Stream + + AdditionalHeaders - If set, partial message deltas will be sent, like in ChatGPT. + Additional HTTP headers to include in the request. - SwitchParameter + IDictionary - SwitchParameter + IDictionary - False + None - - Store + + AdditionalQuery - Whether or not to store the output of this chat completion request for use in model distillation or evals. + Additional query parameters to include in the request. - SwitchParameter + IDictionary - SwitchParameter + IDictionary - False + None - - Verbosity + + ApiBase - Controls the verbosity level of the response. -Valid values are `low`, `medium`, or `high`. - + The base URI for the OpenAI API. - String + Uri - String + Uri - medium + None - - ReasoningEffort + + ApiKey - Constrains effort on reasoning for reasoning models. Supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. -Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. + The OpenAI API key as a secure string. - String + SecureString - String + SecureString None - - MetaData + + ApiType - Developer-defined tags and values used for filtering completions in the dashboard. + The API provider. Agents API commands support OpenAI only. - IDictionary + OpenAIApiType - IDictionary + OpenAIApiType None - - StopSequence + + AuthType - Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence. + The authentication type. Use openai for the Agents API. - String[] + String - String[] + String None - - MaxTokens + + Body - This value is now deprecated in favor of MaxCompletionTokens. + The request body as a dictionary. Use the fields defined by the corresponding OpenAI Agents API operation. - Int32 + IDictionary - Int32 + IDictionary None - - MaxCompletionTokens + + MaxRetryCount - An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. + The maximum number of retries for transient API failures. Int32 @@ -16244,92 +18474,34 @@ Reducing reasoning effort can result in faster responses and fewer tokens used o None - - PresencePenalty + + Organization - Number between `-2.0` and `2.0`. -Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics. + The OpenAI organization ID. - Double + String - Double + String None - - FrequencyPenalty + + TimeoutSec - Number between `-2.0` and `2.0`. -Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. + The request timeout in seconds. Zero uses the module default. - Double + Int32 - Double + Int32 None - - LogitBias - - Modify the likelihood of specified tokens appearing in the completion. -Accepts a maps of tokens to an associated bias value from `-100` to `100`. You can use `ConvertTo-Token` to convert text to token IDs. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between `-1` and `1` should decrease or increase likelihood of selection; values like `-100` or `100` should result in a ban or exclusive selection of the relevant token. -As an example, you can pass like so: `@{23182 = 20; 88847 = -100}` -ID 23182 maps to "apple" and ID 88847 maps to "banana". Thus, this example increases the likelihood of the word "apple" being included in the response from the AI and greatly reduces the likelihood of the word "banana" being included. - - IDictionary - - IDictionary - - - None - - - LogProbs - - Whether to return log probabilities of the output tokens or not. If true, returns the log probabilities of each output token returned in the `content` of `message`. - - Boolean - - Boolean - - - None - - - TopLogProbs - - An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. `logprobs` must be set to `true` if this parameter is used. - - UInt16 - - UInt16 - - - None - - - ResponseFormat - - Specifies the format that the model must output. -- `text` is default. -- `json_object` enables JSON mode, which ensures the message the model generates is valid JSON. -- `json_schema` enables Structured Outputs which ensures the model will match your supplied JSON schema. - - `raw_response` returns raw response content from API. - - Object - - Object - - - None - - - JsonSchema + + VaultId - Specifies an object or data structure to represent the JSON Schema that the model should be constrained to follow. -Required if `json_schema` is specified for `-ResponseFormat`. Otherwise, it is ignored. + The agent vault ID. String @@ -16338,22 +18510,131 @@ Required if `json_schema` is specified for `-ResponseFormat`. Otherwise, it is i None - - Seed + + ProgressAction - If specified, the system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. + Controls how PowerShell responds to progress updates. - Int64 + ActionPreference - Int64 + ActionPreference None - - ServiceTier + + + + + + + + + + + -------------------------- Example 1 -------------------------- + New-AgentVaultCredential -VaultId 'vault_123' -Body @{ name = 'MCP token'; auth = @{ type = 'static_bearer'; token = '<token>'; mcp_server_url = 'https://mcp.example.com' } } + + Stores a write-only MCP bearer credential in a vault. + + + + + + Online Version: + https://github.com/mkht/PSOpenAI/blob/v5/Docs/New-AgentVaultCredential.md + + + OpenAI Agents API + https://developers.openai.com/api/reference/typescript/resources/beta/subresources/agents + + + + + + New-ChatCompletionFunction + New + ChatCompletionFunction + + Generate function spcifications for ChatGPT Function calling from PowerShell commands + + + + Generate function spcifications for ChatGPT Function calling from PowerShell commands +The generated function spcification is a hash table that can be converted to a JSON string following JSON Schema. +https://developers.openai.com/api/docs/guides/function-calling/ + + + + New-ChatCompletionFunction + + Command + + Specify the name of the PowerShell command. + + String + + String + + + None + + + Description + + Specifies the descriptive text of the PowerShell command. If not specified, the command help description will be used. + + String + + String + + + None + + + ExcludeParameters + + Names of parameters that should not be included in the function definition. + + String[] + + String[] + + + None + + + IncludeParameters + + Name of the parameter to be included in the function definition. If this parameter is specified, any unspecified parameters will not be included in the function definition. + + String[] + + String[] + + + None + + + ParameterSetName + + If a PowerShell command has multiple parameter sets, the default parameter set is selected by default. +If you want to use a non-default parameter set, specify the set name in this parameter. + + String + + String + + + None + + + + + + Command - Specifies the latency tier to use for processing the request. This parameter is relevant for customers subscribed to the scale tier service. + Specify the name of the PowerShell command. String @@ -16362,10 +18643,10 @@ Required if `json_schema` is specified for `-ResponseFormat`. Otherwise, it is i None - - PromptCacheKey + + Description - Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. + Specifies the descriptive text of the PowerShell command. If not specified, the command help description will be used. String @@ -16374,34 +18655,35 @@ Required if `json_schema` is specified for `-ResponseFormat`. Otherwise, it is i None - - PromptCacheRetention + + ExcludeParameters - The retention policy for the prompt cache. Set to `24h` to enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. + Names of parameters that should not be included in the function definition. - String + String[] - String + String[] None - - SafetyIdentifier + + IncludeParameters - A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. The IDs should be a string that uniquely identifies each user. + Name of the parameter to be included in the function definition. If this parameter is specified, any unspecified parameters will not be included in the function definition. - String + String[] - String + String[] None - User + ParameterSetName - (deprecated) This field is being replaced by `SafetyIdentifier` and `PromptCacheKey`. + If a PowerShell command has multiple parameter sets, the default parameter set is selected by default. +If you want to use a non-default parameter set, specify the set name in this parameter. String @@ -16410,122 +18692,24 @@ Required if `json_schema` is specified for `-ResponseFormat`. Otherwise, it is i None - - AsBatch - - If this is specified, this cmdlet returns an object for Batch input -It does not perform an API request to OpenAI. It is useful with `Start-Batch` cmdlet. - - SwitchParameter - - SwitchParameter - - - False - - - CustomBatchId - - A unique id that will be used to match outputs to inputs of batch. Must be unique for each request in a batch. -This parameter is valid only when the `-AsBatch` swicth is used. Otherwise, it is simply ignored. - - String + + + - String - + None - None - - - TimeoutSec - Specifies the timeout in seconds for each HTTP attempt, including reading the response body or stream. Retry delays are excluded. -The default value is `0` (infinite). + - Int32 + + + + - Int32 - + System.Collections.Specialized.OrderedDictionary - 0 - - - MaxRetryCount - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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. - - - Int32 - - Int32 - - - 0 - - - ApiBase - - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` - - System.Uri - - System.Uri - - - https://api.openai.com/v1 - - - ApiKey - - Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` - - Object - - Object - - - None - - - Organization - - Specifies Organization ID which used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` - - string - - string - - - None - - - History - - An object for keeping the conversation history. - - Object[] - - Object[] - - - None - - - - - - - [pscustomobject] - - - + @@ -16536,95 +18720,105 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN - --- Example 1: Ask one question to ChatGPT, and get answer. --- - PS C:\> Request-ChatCompletion -Message "Who are you?" | select Answer - -I am an AI language model created by OpenAI, designed to assist with ... - - - - - - Example 2: Multiple questions with context preserved. (chats) - PS> $FirstQA = Request-ChatCompletion -Message "What is the population of the United States?" -PS> $FirstQA.Answer - -As of September 2021, the estimated population of the United States is around 331.4 million people. - -PS\> $SecondQA = $FirstQA | Request-ChatCompletion -Message "Translate the previous answer into French." -PS\> $SecondQA.Answer - -En septembre 2021, la population estimée des États-Unis est d'environ 331,4 millions de personnes. - - - - - - ---------------- Example 3: Stream completions. ---------------- - PS C:\> Request-ChatCompletion 'Please describe ChatGPT in 100 charactors.' -Stream | Write-Host -NoNewline - - ! stream (/Docs/images/StreamOutput.gif) - - - - ----------------- Example 4: Function calling ----------------- - PS C:\> $PingFunction = New-ChatCompletionFunction -Command 'Test-Connection' -IncludeParameters ('TargetName','Count') -PS C:\> $Message = 'Ping the Google Public DNS address three times and briefly report the results.' -PS C:\> $GPTPingAnswer = Request-ChatCompletion -Message $Message -Model gpt-4o -Tools $PingFunction -InvokeTools Auto -PS C:\> $GPTPingAnswer | select Answer + -------------------------- Example 1 -------------------------- + PS C:\> New-ChatCompletionFunction -Command "New-Item" - + Generates a function definition for the `New-Item` command. - --------------- Example 5: Image input (Vision) --------------- - PS C:\> Request-ChatCompletion -Message $Message -Model gpt-4o -Images "C:\image.png" + -------------------------- Example 2 -------------------------- + PS C:\> New-ChatCompletionFunction -Command "Test-Connection" -IncludeParameters ('TargetName', 'Count', 'Delay') - + Generate a function spcification for the `Test-Connection` command. Only three parameters are included in the function definition: `TargetName`, `Count`, and `Delay`. - --------------- Example 6: Audio input / output --------------- - PS C:\> Request-ChatCompletion -Modalities text, audio -InputAudio 'C:\hello.mp3' -AudioOutFile 'C:\response.mp3' -Model gpt-audio-1.5 + -------------------------- Example 3 -------------------------- + PS C:\> New-ChatCompletionFunction -Command "Test-NetConnection" -ParameterSetName "RemotePort" -Description "This command tests TCP connectivity of the specified hosts or address and displays the results." - + Generate a function definition for the `Test-NetConnection` command. Explicitly specifies the parameter set name and command description. Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/Request-ChatCompletion.md - - - https://developers.openai.com/api/reference/chat-completions/overview/ - https://developers.openai.com/api/reference/chat-completions/overview/ + https://github.com/mkht/PSOpenAI/blob/main/Docs/New-ChatCompletionFunction.md - https://developers.openai.com/api/reference/resources/chat/subresources/completions/methods/create/ - https://developers.openai.com/api/reference/resources/chat/subresources/completions/methods/create/ + https://developers.openai.com/api/docs/guides/function-calling/ + https://developers.openai.com/api/docs/guides/function-calling/ - Request-ContentProvenanceCheck - Request - ContentProvenanceCheck + New-Container + New + Container - Check an image or audio file for supported OpenAI provenance signals. + Create Container. - Check an image or audio file for supported OpenAI provenance signals. + Create a new Container for CodeInterpreter tools. - Request-ContentProvenanceCheck - - File + New-Container + + Name - Path to the image or audio file to check. Relative paths and pipeline input are supported. + Name of the container to create. + + String + + String + + + None + + + ExpiresAfterMinutes + + Container expiration time in minutes. + + UInt32 + + UInt32 + + + None + + + ExpiresAfterAnchor + + Time anchor for the expiration time. Currently only 'last_active_at' is supported. + + String + + String + + + last_active_at + + + FileId + + IDs of files to copy to the container. + + String[] + + String[] + + + None + + + MemoryLimit + + Optional memory limit for the container. Defaults to `1g`. Supported values are `1g`, `4g`, `16g`, and `64g`. String @@ -16651,7 +18845,9 @@ The default value is `0` (infinite). Number between `0` and `100`. Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). +The default value is `0` (No retry). +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. + Int32 @@ -16663,8 +18859,8 @@ The default value is `0` (No retry). ApiBase - Specifies an API endpoint URL such as: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1`. + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` System.Uri @@ -16677,12 +18873,25 @@ If not specified, it will use `https://api.openai.com/v1`. ApiKey Specifies API key for authentication. -The type of data should be `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY`. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` - SecureString + Object - SecureString + Object + + + None + + + Organization + + Specifies Organization ID which used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + + string + + string None @@ -16690,10 +18899,10 @@ If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_AP - - File + + Name - Path to the image or audio file to check. Relative paths and pipeline input are supported. + Name of the container to create. String @@ -16703,37 +18912,87 @@ If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_AP None - TimeoutSec + ExpiresAfterMinutes - Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). + Container expiration time in minutes. - Int32 + UInt32 - Int32 + UInt32 - 0 + None - MaxRetryCount + ExpiresAfterAnchor - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). + Time anchor for the expiration time. Currently only 'last_active_at' is supported. - Int32 + String - Int32 + String - 0 + last_active_at - - ApiBase + + FileId - Specifies an API endpoint URL such as: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1`. + IDs of files to copy to the container. + + String[] + + String[] + + + None + + + MemoryLimit + + Optional memory limit for the container. Defaults to `1g`. Supported values are `1g`, `4g`, `16g`, and `64g`. + + String + + String + + + None + + + TimeoutSec + + Specifies how long the request can be pending before it times out. +The default value is `0` (infinite). + + Int32 + + Int32 + + + 0 + + + MaxRetryCount + + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). +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. + + + Int32 + + Int32 + + + 0 + + + ApiBase + + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` System.Uri @@ -16746,161 +19005,96 @@ If not specified, it will use `https://api.openai.com/v1`. ApiKey Specifies API key for authentication. -The type of data should be `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY`. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` - SecureString + Object - SecureString + Object None - - - - - System.String - + + Organization - + Specifies Organization ID which used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` - - + string + + string + + + None + + + PSCustomObject - A PSOpenAI.ContentProvenanceCheck object containing created_at (local DateTime), object, and results. Nested result fields are preserved from the API. + - Uploads the file as multipart/form-data to POST /v1/content_provenance_checks. Image results include C2PA and SynthID; audio results include SynthID. - A not_detected outcome does not establish that the content is human-created. Signals may be missing or degraded, and other companies' models are not detected. - This endpoint is provided by OpenAI; Azure OpenAI is not supported. + -------------------------- Example 1 -------------------------- - PS C:\> Request-ContentProvenanceCheck -File 'C:\Images\sample.png' + PS C:\> New-Container -Name "My Container" - Returns the provenance check and its results. + Creates a new container with the name "My Container". + + + + ----------------------------- 例 2 ----------------------------- + PS C:\> New-Container -Name "My Container" -FileId ('file-abc123', 'file-def456') + + Creates a new container with the name "My Container" and copies two files to the container. Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/Request-ContentProvenanceCheck.md + https://github.com/mkht/PSOpenAI/blob/main/Docs/New-Container.md - https://developers.openai.com/api/reference/resources/content_provenance_checks/methods/create/ - https://developers.openai.com/api/reference/resources/content_provenance_checks/methods/create/ + https://developers.openai.com/api/reference/resources/containers/methods/create/ + https://developers.openai.com/api/reference/resources/containers/methods/create/ - Request-Embeddings - Request - Embeddings + New-Conversation + New + Conversation - Creates an embedding vector representing the input text. + Create a new conversation. - Creates an embedding vector representing the input text. -https://developers.openai.com/api/docs/guides/embeddings/ + Create a new conversation. - Request-Embeddings - - Text - - (Required) Input text to get embeddings for - - String[] - - String[] - - - None - - - Model - - The name of model to use. The default value is `text-embedding-ada-002`. - - String - - String - - - text-embedding-ada-002 - - - EncodingFormat - - The format to return the embeddings in. Can be either `float` or `base64` The default value is `float`. - - String - - String - - - float - - - Dimensions - - The number of dimensions the resulting output embeddings should have. Only supported in `text-embedding-3` and later models. - - Int32 - - Int32 - - - None - - - User - - A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. - - String - - String - - - None - - - AsBatch - - If this is specified, this cmdlet returns an object for Batch input -It does not perform an API request to OpenAI. It is useful with `Start-Batch` cmdlet. - - - SwitchParameter - - - False - + New-Conversation - CustomBatchId + MetaData - A unique id that will be used to match outputs to inputs of batch. Must be unique for each request in a batch. -This parameter is valid only when the `-AsBatch` swicth is used. Otherwise, it is simply ignored. + A dictionary of metadata to associate with the conversation. - String + IDictionary - String + IDictionary None @@ -16908,7 +19102,8 @@ This parameter is valid only when the `-AsBatch` swicth is used. Otherwise, it i TimeoutSec - Specifies how long the request can be pending before it times out. The default value is `0` (infinite). + Specifies how long the request can be pending before it times out. +The default value is `0` (infinite). Int32 @@ -16922,9 +19117,7 @@ This parameter is valid only when the `-AsBatch` swicth is used. Otherwise, it i Number between `0` and `100`. Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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. - +The default value is `0` (No retry). Int32 @@ -16936,8 +19129,8 @@ Note : Retries will only be performed if the request fails with a `429 (Rate lim ApiBase - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` + Specifies an API endpoint URL such as: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1`. System.Uri @@ -16950,25 +19143,12 @@ If not specified, it will use `https://api.openai.com/v1` ApiKey Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` - - Object - - Object - - - None - - - Organization - - Specifies Organization ID which used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` +The type of data should be `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY`. - string + SecureString - string + SecureString None @@ -16976,98 +19156,25 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN - - Text + + MetaData - (Required) Input text to get embeddings for + A dictionary of metadata to associate with the conversation. - String[] + IDictionary - String[] + IDictionary None - Model + TimeoutSec - The name of model to use. The default value is `text-embedding-ada-002`. + Specifies how long the request can be pending before it times out. +The default value is `0` (infinite). - String - - String - - - text-embedding-ada-002 - - - EncodingFormat - - The format to return the embeddings in. Can be either `float` or `base64` The default value is `float`. - - String - - String - - - float - - - Dimensions - - The number of dimensions the resulting output embeddings should have. Only supported in `text-embedding-3` and later models. - - Int32 - - Int32 - - - None - - - User - - A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. - - String - - String - - - None - - - AsBatch - - If this is specified, this cmdlet returns an object for Batch input -It does not perform an API request to OpenAI. It is useful with `Start-Batch` cmdlet. - - SwitchParameter - - SwitchParameter - - - False - - - CustomBatchId - - A unique id that will be used to match outputs to inputs of batch. Must be unique for each request in a batch. -This parameter is valid only when the `-AsBatch` swicth is used. Otherwise, it is simply ignored. - - String - - String - - - None - - - TimeoutSec - - Specifies how long the request can be pending before it times out. The default value is `0` (infinite). - - Int32 + Int32 Int32 @@ -17079,9 +19186,7 @@ This parameter is valid only when the `-AsBatch` swicth is used. Otherwise, it i Number between `0` and `100`. Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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. - +The default value is `0` (No retry). Int32 @@ -17093,8 +19198,8 @@ Note : Retries will only be performed if the request fails with a `429 (Rate lim ApiBase - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` + Specifies an API endpoint URL such as: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1`. System.Uri @@ -17107,25 +19212,12 @@ If not specified, it will use `https://api.openai.com/v1` ApiKey Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` - - Object - - Object - - - None - - - Organization - - Specifies Organization ID which used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` +The type of data should be `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY`. - string + SecureString - string + SecureString None @@ -17135,7 +19227,7 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN - [pscustomobject] + PSCustomObject @@ -17149,71 +19241,43 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN - --- Example 1: Get a vector representation of a given input. --- - Request-Embeddings -Text 'Waiter, the food was delicious...' | select -ExpandProperty data - -object : embedding -index : 0 -embedding : {0.01004226, -0.01884855, 0.01824344, -0.01565562…} -Text : Waiter, the food was delicious... + -------------------------- Example 1 -------------------------- + PS C:\> $Conversation = New-Conversation - + Creates a new conversation. Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/Request-Embeddings.md - - - https://developers.openai.com/api/docs/guides/embeddings/ - https://developers.openai.com/api/docs/guides/embeddings/ + https://github.com/mkht/PSOpenAI/blob/main/Docs/New-Conversation.md - https://developers.openai.com/api/reference/resources/embeddings/ - https://developers.openai.com/api/reference/resources/embeddings/ + https://developers.openai.com/api/reference/resources/conversations/methods/create/ + https://developers.openai.com/api/reference/resources/conversations/methods/create/ - Request-ImageEdit - Request - ImageEdit + New-VectorStore + New + VectorStore - Creates an edited or extended image given an original image and a prompt. + Create a vector store. - Creates an edited or extended image given an original image and a prompt. -https://developers.openai.com/api/reference/resources/images/methods/edit + Create a vector store. - Request-ImageEdit - - - Request-ImageEdit - - - Request-ImageEdit - - Image - - (Required) The image(s) to edit. Must be a supported image file or an array of images. For the GPT image models, each image should be a `png`, `webp`, or `jpg` file less than 50MB. You can provide up to 16 images. - - String[] - - String[] - - - None - - - Prompt + New-VectorStore + + Name - (Required) A text description of the desired image(s). The maximum length is 32000 characters for the GPT image models. + The name of the vector store. String @@ -17223,9 +19287,9 @@ https://developers.openai.com/api/reference/resources/images/methods/editNone - Mask + Description - An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where image should be edited. If there are multiple images provided, the mask will be applied on the first image. Must be a valid PNG file, less than 4MB, and have the same dimensions as image. + A description for the vector store. Can be used to describe the vector store's purpose. String @@ -17234,440 +19298,117 @@ https://developers.openai.com/api/reference/resources/images/methods/edit None - - Model + + FileId - The model to use for image generation. Defaults to `gpt-image-2`. + A list of File IDs that the vector store should use. - String + Object[] - String + Object[] None - - NumberOfImages + + ExpiresAfterDays - The number of images to generate. Must be between 1 and 10. + The number of days after the anchor time that the vector store will expire. UInt16 UInt16 - 1 + None - Quality + ExpiresAfterAnchor - The quality of the image that will be generated. -- `auto` (default value) will automatically select the best quality for the given model. - - `high`, `medium` and `low` are supported for the GPT image models. + Anchor timestamp after which the expiration policy applies. Supported anchors: `last_active_at`. String String - auto + last_active_at - - Size + + ChunkingStrategy - The size of the generated images. Must be one of `1024x1024`, `1536x1024` (landscape), `1024x1536` (portrait), or `auto` (default value) for the GPT image models, and one of `256x256`, `512x512`, or `1024x1024` for dall-e-2, and one of `1024x1024`, `1792x1024`, or `1024x1792` for `dall-e-3`. + The chunking strategy used to chunk the file(s). If not set, will use the "auto" strategy. Only applicable if FileId is non-empty. String String - auto + None - - Background + + MaxChunkSizeTokens - Background behavior for generated image output. -Accepts one of the following: `transparent`, `opaque`, and `auto` (default). + The maximum number of tokens in each chunk. The default value is 800. The minimum value is 100 and the maximum value is 4096. +Note that the parameter only acceptable when the ChunkingStrategy is "static". String String - auto + 800 - - InputFidelity + + ChunkOverlapTokens - Controls fidelity to the original input image(s). This parameter is only supported for `gpt-image-1` and `gpt-image-2` and later models, unsupported for `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`. + The number of tokens that overlap between chunks. The default value is 400. The value must not exceed half of MaxChunkSizeTokens. +Note that the parameter only acceptable when the ChunkingStrategy is "static". String String - low + 400 - - OutputCompression + + MetaData - The compression level (0-100%) for the generated images. This parameter is only supported for the GPT image models with the `webp` or `jpeg` output formats, and defaults to 100. + Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. - UInt16 + IDictionary - UInt16 + IDictionary - 100 + None - - OutputFormat + + TimeoutSec - The format in which the generated images are returned. This parameter is only supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`. The default value is `png`. + Specifies how long the request can be pending before it times out. +The default value is `0` (infinite). - String + Int32 - String + Int32 - png + 0 - - ResponseFormat + + MaxRetryCount - The format in which the generated images are returned. Must be one of `url`, `base64` or `byte`. This parameter is only supported for `dall-e-2`, as the GPT image models always return images in `base64` format. + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). +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. + - String + Int32 - String - - - base64 - - - OutputRawResponse - - If specifies this switch, an output of this function to be a raw response value from the API. (Normally JSON formatted string.) - - - SwitchParameter - - - False - - - Stream - - Edit the image in streaming mode. Defaults to `false`. - - - SwitchParameter - - - False - - - PartialImages - - The number of partial images to generate. This parameter is used for streaming responses that return partial images. Value must be between 0 and 3. When set to 0, the response will be a single image sent in one streaming event. - - UInt16 - - UInt16 - - - 0 - - - User - - A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. - - String - - String - - - None - - - TimeoutSec - - Specifies how long the request can be pending before it times out. The default value is `0` (infinite). - - Int32 - - Int32 - - - 0 - - - MaxRetryCount - - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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. - - - Int32 - - Int32 - - - 0 - - - ApiBase - - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` - - System.Uri - - System.Uri - - - https://api.openai.com/v1 - - - ApiKey - - Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` - - Object - - Object - - - None - - - Organization - - Specifies Organization ID which used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` - - string - - string - - - None - - - - Request-ImageEdit - - Image - - (Required) The image(s) to edit. Must be a supported image file or an array of images. For the GPT image models, each image should be a `png`, `webp`, or `jpg` file less than 50MB. You can provide up to 16 images. - - String[] - - String[] - - - None - - - Prompt - - (Required) A text description of the desired image(s). The maximum length is 32000 characters for the GPT image models. - - String - - String - - - None - - - Mask - - An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where image should be edited. If there are multiple images provided, the mask will be applied on the first image. Must be a valid PNG file, less than 4MB, and have the same dimensions as image. - - String - - String - - - None - - - Model - - The model to use for image generation. Defaults to `gpt-image-2`. - - String - - String - - - None - - - NumberOfImages - - The number of images to generate. Must be between 1 and 10. - - UInt16 - - UInt16 - - - 1 - - - Quality - - The quality of the image that will be generated. -- `auto` (default value) will automatically select the best quality for the given model. - - `high`, `medium` and `low` are supported for the GPT image models. - - String - - String - - - auto - - - Size - - The size of the generated images. Must be one of `1024x1024`, `1536x1024` (landscape), `1024x1536` (portrait), or `auto` (default value) for the GPT image models, and one of `256x256`, `512x512`, or `1024x1024` for dall-e-2, and one of `1024x1024`, `1792x1024`, or `1024x1792` for `dall-e-3`. - - String - - String - - - auto - - - Background - - Background behavior for generated image output. -Accepts one of the following: `transparent`, `opaque`, and `auto` (default). - - String - - String - - - auto - - - InputFidelity - - Controls fidelity to the original input image(s). This parameter is only supported for `gpt-image-1` and `gpt-image-2` and later models, unsupported for `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`. - - String - - String - - - low - - - OutputCompression - - The compression level (0-100%) for the generated images. This parameter is only supported for the GPT image models with the `webp` or `jpeg` output formats, and defaults to 100. - - UInt16 - - UInt16 - - - 100 - - - OutputFormat - - The format in which the generated images are returned. This parameter is only supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`. The default value is `png`. - - String - - String - - - png - - - OutFile - - Specify the file path where the generated images will be saved. This cannot be specified with the `ResponseFormat` parameter. - - String - - String - - - None - - - Stream - - Edit the image in streaming mode. Defaults to `false`. - - - SwitchParameter - - - False - - - PartialImages - - The number of partial images to generate. This parameter is used for streaming responses that return partial images. Value must be between 0 and 3. When set to 0, the response will be a single image sent in one streaming event. - - UInt16 - - UInt16 - - - 0 - - - User - - A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. - - String - - String - - - None - - - TimeoutSec - - Specifies how long the request can be pending before it times out. The default value is `0` (infinite). - - Int32 - - Int32 - - - 0 - - - MaxRetryCount - - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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. - - - Int32 - - Int32 + Int32 0 @@ -17715,22 +19456,10 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN - - Image - - (Required) The image(s) to edit. Must be a supported image file or an array of images. For the GPT image models, each image should be a `png`, `webp`, or `jpg` file less than 50MB. You can provide up to 16 images. - - String[] - - String[] - - - None - - - Prompt + + Name - (Required) A text description of the desired image(s). The maximum length is 32000 characters for the GPT image models. + The name of the vector store. String @@ -17740,9 +19469,9 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN None - Mask + Description - An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where image should be edited. If there are multiple images provided, the mask will be applied on the first image. Must be a valid PNG file, less than 4MB, and have the same dimensions as image. + A description for the vector store. Can be used to describe the vector store's purpose. String @@ -17751,173 +19480,88 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN None - - Model + + FileId - The model to use for image generation. Defaults to `gpt-image-2`. + A list of File IDs that the vector store should use. - String + Object[] - String + Object[] None - - NumberOfImages + + ExpiresAfterDays - The number of images to generate. Must be between 1 and 10. + The number of days after the anchor time that the vector store will expire. UInt16 UInt16 - 1 - - - Quality - - The quality of the image that will be generated. -- `auto` (default value) will automatically select the best quality for the given model. - - `high`, `medium` and `low` are supported for the GPT image models. - - String - - String - - - auto - - - Size - - The size of the generated images. Must be one of `1024x1024`, `1536x1024` (landscape), `1024x1536` (portrait), or `auto` (default value) for the GPT image models, and one of `256x256`, `512x512`, or `1024x1024` for dall-e-2, and one of `1024x1024`, `1792x1024`, or `1024x1792` for `dall-e-3`. - - String - - String - - - auto + None - Background - - Background behavior for generated image output. -Accepts one of the following: `transparent`, `opaque`, and `auto` (default). - - String - - String - - - auto - - - InputFidelity + ExpiresAfterAnchor - Controls fidelity to the original input image(s). This parameter is only supported for `gpt-image-1` and `gpt-image-2` and later models, unsupported for `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`. + Anchor timestamp after which the expiration policy applies. Supported anchors: `last_active_at`. String String - low - - - OutputCompression - - The compression level (0-100%) for the generated images. This parameter is only supported for the GPT image models with the `webp` or `jpeg` output formats, and defaults to 100. - - UInt16 - - UInt16 - - - 100 + last_active_at - - OutputFormat + + ChunkingStrategy - The format in which the generated images are returned. This parameter is only supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`. The default value is `png`. + The chunking strategy used to chunk the file(s). If not set, will use the "auto" strategy. Only applicable if FileId is non-empty. String String - png + None - - ResponseFormat + + MaxChunkSizeTokens - The format in which the generated images are returned. Must be one of `url`, `base64` or `byte`. This parameter is only supported for `dall-e-2`, as the GPT image models always return images in `base64` format. + The maximum number of tokens in each chunk. The default value is 800. The minimum value is 100 and the maximum value is 4096. +Note that the parameter only acceptable when the ChunkingStrategy is "static". String String - base64 - - - OutputRawResponse - - If specifies this switch, an output of this function to be a raw response value from the API. (Normally JSON formatted string.) - - SwitchParameter - - SwitchParameter - - - False + 800 - - OutFile + + ChunkOverlapTokens - Specify the file path where the generated images will be saved. This cannot be specified with the `ResponseFormat` parameter. + The number of tokens that overlap between chunks. The default value is 400. The value must not exceed half of MaxChunkSizeTokens. +Note that the parameter only acceptable when the ChunkingStrategy is "static". String String - None - - - Stream - - Edit the image in streaming mode. Defaults to `false`. - - SwitchParameter - - SwitchParameter - - - False - - - PartialImages - - The number of partial images to generate. This parameter is used for streaming responses that return partial images. Value must be between 0 and 3. When set to 0, the response will be a single image sent in one streaming event. - - UInt16 - - UInt16 - - - 0 + 400 - User + MetaData - A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. + Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. - String + IDictionary - String + IDictionary None @@ -17925,7 +19569,8 @@ Accepts one of the following: `transparent`, `opaque`, and `auto` (default). TimeoutSec - Specifies how long the request can be pending before it times out. The default value is `0` (infinite). + Specifies how long the request can be pending before it times out. +The default value is `0` (infinite). Int32 @@ -17992,7 +19637,16 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN - + + + + PSCustomObject + + + + + + @@ -18000,61 +19654,50 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN - ----------- Example 1: Edit an image with a prompt. ----------- - Request-ImageEdit -Model 'gpt-image-2' -Prompt 'A bird on the desert' -Image 'C:\sand_with_fether.png' -OutFile 'C:\bird_on_desert.png' -Size 1024x1024 + -------------------------- Example 1 -------------------------- + PS C:\> New-VectorStore -Name "Test-Store-X" - | Original | Generated | | ----------------------------------------------- | ------------------------------------------ | | ! original (/Docs/images/sand_with_feather.png) | ![edited](/Docs/images/bird_on_desert.png)| + Creates a new vector store that the name has. - --- Example 2: Create variation image from source and mask. --- - Request-ImageEdit -Model 'gpt-image-2' -Image C:\sand_with_feather.png -Mask C:\fether_mask.png -Prompt "A bird on the desert" -OutFile C:\edit2.png + -------------------------- Example 1 -------------------------- + PS C:\> New-VectorStore -Name "Test-Store-X" -FileId ('file-abc123', 'file-def456', 'file-ghi789') - | Source (sand_with_feather.png) | Mask (fether_mask.png) | Generated (edit2.png) | | --------------------------------------------- | ------------------------------------- | ----------------------------------- | | ! masked (/Docs/images/sand_with_feather.png) | ![mask](/Docs/images/fether_mask.png) | ![restored](/Docs/images/edit2.png)| + Creates a new vector store with attached 3 files. Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/Request-ImageEdit.md - - - https://developers.openai.com/api/docs/guides/image-generation/ - https://developers.openai.com/api/docs/guides/image-generation/ + https://github.com/mkht/PSOpenAI/blob/main/Docs/New-VectorStore.md - https://developers.openai.com/api/reference/resources/images/methods/edit - https://developers.openai.com/api/reference/resources/images/methods/edit + https://developers.openai.com/api/reference/resources/vector_stores/methods/create/ + https://developers.openai.com/api/reference/resources/vector_stores/methods/create/ - Request-ImageGeneration - Request - ImageGeneration + New-Video + New + Video - Creates an image given a prompt. + Creates a new video generation job. - Creates an image given a prompt. -https://developers.openai.com/api/reference/resources/images/methods/generate + Creates a new asynchronous job that generates a video with the requested model, duration, and resolution. The cmdlet returns the job metadata so that you can poll its status or download the generated content when it completes. - Request-ImageGeneration - - - Request-ImageGeneration - - - Request-ImageGeneration - + New-Video + Prompt - (Required) A text description of the desired image(s). The maximum length is 32000 characters for the GPT image models, 1000 characters for `dall-e-2` and 4000 characters for `dall-e-3`. + Text prompt that describes the video to generate. String @@ -18063,72 +19706,10 @@ https://developers.openai.com/api/reference/resources/images/methods/generate None - - Model - - The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or a GPT image model. Defaults to `dall-e-2` unless a parameter specific to the GPT image models is used. - - String - - String - - - dall-e-2 - - - NumberOfImages - - The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only `1` is supported. - - UInt16 - - UInt16 - - - 1 - - - Size - - The size of the generated images. Must be one of `1024x1024`, `1536x1024` (landscape), `1024x1536` (portrait), or `auto` (default value) for the GPT image models, one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`, and one of `1024x1024`, `1792x1024`, or `1024x1792` for `dall-e-3`. - - String - - String - - - auto - - - Quality - - The quality of the image that will be generated. -- `auto` (default value) will automatically select the best quality for the given model. - - `high`, `medium` and `low` are supported for the GPT image models. - - String - - String - - - auto - - - Style - - The style of the generated images. Must be one of `vivid` or `natural`. Vivid causes the model to lean towards generating hyper-real and dramatic images. Natural causes the model to produce more natural, less hyper-real looking images. This param is only supported for `dall-e-3`. - - String - - String - - - vivid - - - Background + + InputReference - Allows to set transparency for the background of the generated image(s). This parameter is only supported for the GPT image models. Must be one of `transparent`, `opaque` or `auto` (default value). When `auto` is used, the model will automatically determine the best background for the image. + Path to an optional image reference that guides generation. String @@ -18138,75 +19719,40 @@ https://developers.openai.com/api/reference/resources/images/methods/generateNone - Moderation - - Control the content-moderation level for images generated by the GPT image models. Must be either `low` for less restrictive filtering or `auto` (default value). - - String - - String - - - None - - - OutputCompression - - The compression level (0-100%) for the generated images. This parameter is only supported for the GPT image models with the `webp` or `jpeg` output formats, and defaults to 100. - - UInt16 - - UInt16 - - - None - - - OutputFormat + Model - The format in which the generated images are returned. This parameter is only supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`. + The video generation model to use. The default value is `sora-2`. String String - None + sora-2 - - ResponseFormat + + Seconds - The format in which the generated images are returned. Must be one of `url`, `base64` or `byte`. This parameter is only supported for `dall-e-2`, as the GPT image models always return images in `base64` format. + Length of the generated video, in seconds. Supported values are `4`, `8`, and `12`. The default value is `4`. String String - url - - - OutputRawResponse - - If specifies this switch, an output of this function to be a raw response value from the API. (Normally JSON formatted string.) - - - SwitchParameter - - - False + 4 - User + Size - A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. + Resolution of the generated video. Supported values are `720x1280`, `1280x720`, `1024x1792`, and `1792x1024`. The default value is `720x1280`. String String - None + 720x1280 TimeoutSec @@ -18223,11 +19769,7 @@ https://developers.openai.com/api/reference/resources/images/methods/generate MaxRetryCount - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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. - + Number between `0` and `100`. Specifies the maximum number of retries if the request fails. The default value is `0` (No retry). 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. Int32 @@ -18239,8 +19781,7 @@ Note : Retries will only be performed if the request fails with a `429 (Rate lim ApiBase - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` If not specified, it will use `https://api.openai.com/v1` System.Uri @@ -18252,9 +19793,7 @@ If not specified, it will use `https://api.openai.com/v1` ApiKey - Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + Specifies API key for authentication. The type of data should `[string]` or `[securestring]`. If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` Object @@ -18266,8 +19805,7 @@ If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_AP Organization - Specifies Organization ID which used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + Specifies Organization ID which used for an API request. If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` string @@ -18277,134 +19815,195 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN None - - Request-ImageGeneration - - Prompt - - (Required) A text description of the desired image(s). The maximum length is 32000 characters for the GPT image models, 1000 characters for `dall-e-2` and 4000 characters for `dall-e-3`. - - String - - String - - - None - - - Model - - The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or a GPT image model. Defaults to `dall-e-2` unless a parameter specific to the GPT image models is used. - - String - - String - - - dall-e-2 - - - NumberOfImages - - The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only `1` is supported. - - UInt16 - - UInt16 - - - 1 - - - Size - - The size of the generated images. Must be one of `1024x1024`, `1536x1024` (landscape), `1024x1536` (portrait), or `auto` (default value) for the GPT image models, one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`, and one of `1024x1024`, `1792x1024`, or `1024x1792` for `dall-e-3`. - - String - - String - - - auto - - - Quality - - The quality of the image that will be generated. -- `auto` (default value) will automatically select the best quality for the given model. - - `high`, `medium` and `low` are supported for the GPT image models. - - String - - String - - - auto - - - Style - - The style of the generated images. Must be one of `vivid` or `natural`. Vivid causes the model to lean towards generating hyper-real and dramatic images. Natural causes the model to produce more natural, less hyper-real looking images. This param is only supported for `dall-e-3`. - - String - - String - - - vivid - - - Background - - Allows to set transparency for the background of the generated image(s). This parameter is only supported for the GPT image models. Must be one of `transparent`, `opaque` or `auto` (default value). When `auto` is used, the model will automatically determine the best background for the image. - - String - - String - - - None - - - Moderation - - Control the content-moderation level for images generated by the GPT image models. Must be either `low` for less restrictive filtering or `auto` (default value). - - String - - String - - - None - - - OutputCompression - - The compression level (0-100%) for the generated images. This parameter is only supported for the GPT image models with the `webp` or `jpeg` output formats, and defaults to 100. - - UInt16 - - UInt16 - - - None - - - OutputFormat - - The format in which the generated images are returned. This parameter is only supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`. - - String - - String - - - None - - - OutFile + + + + Prompt + + Text prompt that describes the video to generate. + + String + + String + + + None + + + InputReference + + Path to an optional image reference that guides generation. + + String + + String + + + None + + + Model + + The video generation model to use. The default value is `sora-2`. + + String + + String + + + sora-2 + + + Seconds + + Length of the generated video, in seconds. Supported values are `4`, `8`, and `12`. The default value is `4`. + + String + + String + + + 4 + + + Size + + Resolution of the generated video. Supported values are `720x1280`, `1280x720`, `1024x1792`, and `1792x1024`. The default value is `720x1280`. + + String + + String + + + 720x1280 + + + TimeoutSec + + Specifies how long the request can be pending before it times out. The default value is `0` (infinite). + + Int32 + + Int32 + + + 0 + + + MaxRetryCount + + Number between `0` and `100`. Specifies the maximum number of retries if the request fails. The default value is `0` (No retry). 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. + + Int32 + + Int32 + + + 0 + + + ApiBase + + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` If not specified, it will use `https://api.openai.com/v1` + + System.Uri + + System.Uri + + + https://api.openai.com/v1 + + + ApiKey + + Specifies API key for authentication. The type of data should `[string]` or `[securestring]`. If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + + Object + + Object + + + None + + + Organization + + Specifies Organization ID which used for an API request. If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + + string + + string + + + None + + + + + + + PSCustomObject + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + PS C:\> New-Video -Prompt 'Dancing Doggo' + + Creates a new video job using the default model, duration, and resolution. + + + + -------------------------- Example 2 -------------------------- + PS C:\> New-Video -Prompt 'Dancing Donuts' -Model 'sora-2-pro' -Seconds 12 -Size 1280x720 + + Creates a 12-second landscape video with the `sora-2-pro` model. + + + + + + Online Version: + https://github.com/mkht/PSOpenAI/blob/main/Docs/New-Video.md + + + https://developers.openai.com/api/docs/guides/video-generation + https://developers.openai.com/api/docs/guides/video-generation + + + https://developers.openai.com/api/reference/resources/videos/methods/create/ + https://developers.openai.com/api/reference/resources/videos/methods/create/ + + + + + + New-Video + New + Video + + Creates a new video remix job. + + + + Remix lets you take an existing video and make targeted adjustments without regenerating everything from scratch. You can provide a text prompt to guide the changes you want to make, and the model will generate a new version of the video that incorporates those changes while preserving the original content as much as possible. + + + + New-Video + + Prompt - Specify the file path where the generated images will be saved. This cannot be specified with the `ResponseFormat` parameter. + Updated text prompt that directs the remix generation. String @@ -18413,10 +20012,10 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN None - - User + + VideoId - A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. + The identifier of the video to delete. String @@ -18440,11 +20039,7 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN MaxRetryCount - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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. - + Number between `0` and `100`. Specifies the maximum number of retries if the request fails. The default value is `0` (No retry). 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. Int32 @@ -18456,8 +20051,7 @@ Note : Retries will only be performed if the request fails with a `429 (Rate lim ApiBase - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` If not specified, it will use `https://api.openai.com/v1` System.Uri @@ -18469,9 +20063,7 @@ If not specified, it will use `https://api.openai.com/v1` ApiKey - Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + Specifies API key for authentication. The type of data should `[string]` or `[securestring]`. If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` Object @@ -18483,8 +20075,7 @@ If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_AP Organization - Specifies Organization ID which used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + Specifies Organization ID which used for an API request. If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` string @@ -18496,10 +20087,10 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN - + Prompt - (Required) A text description of the desired image(s). The maximum length is 32000 characters for the GPT image models, 1000 characters for `dall-e-2` and 4000 characters for `dall-e-3`. + Updated text prompt that directs the remix generation. String @@ -18508,156 +20099,10 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN None - - Model + + VideoId - The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or a GPT image model. Defaults to `dall-e-2` unless a parameter specific to the GPT image models is used. - - String - - String - - - dall-e-2 - - - NumberOfImages - - The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only `1` is supported. - - UInt16 - - UInt16 - - - 1 - - - Size - - The size of the generated images. Must be one of `1024x1024`, `1536x1024` (landscape), `1024x1536` (portrait), or `auto` (default value) for the GPT image models, one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`, and one of `1024x1024`, `1792x1024`, or `1024x1792` for `dall-e-3`. - - String - - String - - - auto - - - Quality - - The quality of the image that will be generated. -- `auto` (default value) will automatically select the best quality for the given model. - - `high`, `medium` and `low` are supported for the GPT image models. - - String - - String - - - auto - - - Style - - The style of the generated images. Must be one of `vivid` or `natural`. Vivid causes the model to lean towards generating hyper-real and dramatic images. Natural causes the model to produce more natural, less hyper-real looking images. This param is only supported for `dall-e-3`. - - String - - String - - - vivid - - - Background - - Allows to set transparency for the background of the generated image(s). This parameter is only supported for the GPT image models. Must be one of `transparent`, `opaque` or `auto` (default value). When `auto` is used, the model will automatically determine the best background for the image. - - String - - String - - - None - - - Moderation - - Control the content-moderation level for images generated by the GPT image models. Must be either `low` for less restrictive filtering or `auto` (default value). - - String - - String - - - None - - - OutputCompression - - The compression level (0-100%) for the generated images. This parameter is only supported for the GPT image models with the `webp` or `jpeg` output formats, and defaults to 100. - - UInt16 - - UInt16 - - - None - - - OutputFormat - - The format in which the generated images are returned. This parameter is only supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`. - - String - - String - - - None - - - ResponseFormat - - The format in which the generated images are returned. Must be one of `url`, `base64` or `byte`. This parameter is only supported for `dall-e-2`, as the GPT image models always return images in `base64` format. - - String - - String - - - url - - - OutputRawResponse - - If specifies this switch, an output of this function to be a raw response value from the API. (Normally JSON formatted string.) - - SwitchParameter - - SwitchParameter - - - False - - - OutFile - - Specify the file path where the generated images will be saved. This cannot be specified with the `ResponseFormat` parameter. - - String - - String - - - None - - - User - - A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. + The identifier of the video to delete. String @@ -18681,11 +20126,7 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN MaxRetryCount - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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. - + Number between `0` and `100`. Specifies the maximum number of retries if the request fails. The default value is `0` (No retry). 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. Int32 @@ -18697,8 +20138,7 @@ Note : Retries will only be performed if the request fails with a `429 (Rate lim ApiBase - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` If not specified, it will use `https://api.openai.com/v1` System.Uri @@ -18710,9 +20150,7 @@ If not specified, it will use `https://api.openai.com/v1` ApiKey - Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + Specifies API key for authentication. The type of data should `[string]` or `[securestring]`. If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` Object @@ -18724,8 +20162,7 @@ If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_AP Organization - Specifies Organization ID which used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + Specifies Organization ID which used for an API request. If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` string @@ -18736,7 +20173,16 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN - + + + + PSCustomObject + + + + + + @@ -18744,66 +20190,43 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN - ------ Example 1: Creates and save an image from prompt. ------ - Request-ImageGeneration -Model 'gpt-image-2' -Prompt 'A cute baby lion' -OutFile C:\babylion.png - - ! lion (/Docs/images/babylion.png) - - - - Example 2: Creates multiple images at once, and retrieve results by URL. - Request-ImageGeneration -Model 'dall-e-3' -Prompt 'Delicious ramen with gyoza' -Model -ResponseFormat 'url' -NumberOfImages 3 - -https://oaidalleapiprodscus.blob.core.windows.net/private/org-BXLtGIt0xglP9if8FVhkD... -https://oaidalleapiprodscus.blob.core.windows.net/private/org-BXLtGIt0xglP9if8FVhkD... -https://oaidalleapiprodscus.blob.core.windows.net/private/org-BXLtGIt0xglP9if8FVhkD... + -------------------------- Example 1 -------------------------- + PS C:\> New-VideoRemix -Prompt 'Change the background to a sunny beach' -VideoId 'video_abc123' - + Creates a new video remix job using the specified prompt and video ID. Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/Request-ImageGeneration.md - - - https://developers.openai.com/api/docs/guides/image-generation/ - https://developers.openai.com/api/docs/guides/image-generation/ + https://github.com/mkht/PSOpenAI/blob/main/Docs/New-VideoRemix.md - https://developers.openai.com/api/reference/resources/images/methods/generate - https://developers.openai.com/api/reference/resources/images/methods/generate + https://developers.openai.com/api/reference/resources/videos/methods/remix/ + https://developers.openai.com/api/reference/resources/videos/methods/remix/ - Request-ImageVariation - Request - ImageVariation + Remove-Agent + Remove + Agent - Creates a variation of a given image. + Deletes a reusable agent. - Creates a variation of a given image. -https://developers.openai.com/api/docs/guides/image-generation/ + Deletes a reusable agent. This command uses the OpenAI Agents API public beta and sends the required `OpenAI-Beta: agents=v1` header. Nested, evolving request schemas are accepted through `-Body` where applicable. - Request-ImageVariation - - - Request-ImageVariation - - - Request-ImageVariation - - Image + Remove-Agent + + AgentId - (Required) The image to use as the basis for the variation(s). -Must be a valid PNG file, less than 4MB, and square. + The reusable agent ID. String @@ -18812,134 +20235,92 @@ Must be a valid PNG file, less than 4MB, and square. None - - NumberOfImages + + AdditionalBody - The number of images to generate. -Must be between `1` and `10`. The default value is `1`. + Additional JSON properties to merge into the request body. - UInt16 + Object - UInt16 + Object - 1 + None - - Size + + AdditionalHeaders - The size of the generated images. -Must be one of `256x256`, `512x512`, or `1024x1024`. The default value is `1024x1024`. + Additional HTTP headers to include in the request. - String + IDictionary - String + IDictionary - 1024x1024 + None - - ResponseFormat + + AdditionalQuery - The format in which the generated images are returned. -Must be one of `url`, `base64` or `byte`. + Additional query parameters to include in the request. - String + IDictionary - String + IDictionary - url + None - - User + + ApiBase - A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. + The base URI for the OpenAI API. - String + Uri - String + Uri None - - TimeoutSec + + ApiKey - Specifies how long the request can be pending before it times out. The default value is `0` (infinite). - - Int32 - - Int32 - - - 0 - - - MaxRetryCount - - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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. - - - Int32 - - Int32 - - - 0 - - - ApiBase - - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` - - System.Uri - - System.Uri - - - https://api.openai.com/v1 - - - ApiKey - - Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + The OpenAI API key as a secure string. - Object + SecureString - Object + SecureString None - - Organization + + ApiType - Specifies Organization ID which used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + The API provider. Agents API commands support OpenAI only. - string + + OpenAI + Azure + + OpenAIApiType - string + OpenAIApiType None - - - Request-ImageVariation - - Image + + AuthType - (Required) The image to use as the basis for the variation(s). -Must be a valid PNG file, less than 4MB, and square. + The authentication type. Use openai for the Agents API. + + openai + azure + azure_ad + String String @@ -18947,49 +20328,33 @@ Must be a valid PNG file, less than 4MB, and square. None - - NumberOfImages - - The number of images to generate. -Must be between `1` and `10`. The default value is `1`. - - UInt16 - - UInt16 - - - 1 - - - Size + + Confirm - The size of the generated images. -Must be one of `256x256`, `512x512`, or `1024x1024`. The default value is `1024x1024`. + Prompts you for confirmation before running the cmdlet. - String - String + SwitchParameter - 1024x1024 + False - - OutFile + + MaxRetryCount - Specify the file path where the generated images will be saved. -This cannot be specified with the `Format` parameter. Also, `NumberOfImages` must be `1`. + The maximum number of retries for transient API failures. - String + Int32 - String + Int32 None - - User + + Organization - A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. + The OpenAI organization ID. String @@ -18998,70 +20363,37 @@ This cannot be specified with the `Format` parameter. Also, `NumberOfImages` mus None - + TimeoutSec - Specifies how long the request can be pending before it times out. The default value is `0` (infinite). - - Int32 - - Int32 - - - 0 - - - MaxRetryCount - - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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. - + The request timeout in seconds. Zero uses the module default. Int32 Int32 - 0 - - - ApiBase - - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` - - System.Uri - - System.Uri - - - https://api.openai.com/v1 + None - - ApiKey + + WhatIf - Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + Shows what would happen if the cmdlet runs. The cmdlet is not run. - Object - Object + SwitchParameter - None + False - - Organization + + ProgressAction - Specifies Organization ID which used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + Controls how PowerShell responds to progress updates. - string + ActionPreference - string + ActionPreference None @@ -19069,187 +20401,177 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN - - Image + + AdditionalBody - (Required) The image to use as the basis for the variation(s). -Must be a valid PNG file, less than 4MB, and square. + Additional JSON properties to merge into the request body. - String + Object - String + Object None - - NumberOfImages + + AdditionalHeaders - The number of images to generate. -Must be between `1` and `10`. The default value is `1`. + Additional HTTP headers to include in the request. - UInt16 + IDictionary - UInt16 + IDictionary - 1 + None - - Size + + AdditionalQuery - The size of the generated images. -Must be one of `256x256`, `512x512`, or `1024x1024`. The default value is `1024x1024`. + Additional query parameters to include in the request. - String + IDictionary - String + IDictionary - 1024x1024 + None - - ResponseFormat + + AgentId - The format in which the generated images are returned. -Must be one of `url`, `base64` or `byte`. + The reusable agent ID. String String - url + None - - OutFile + + ApiBase - Specify the file path where the generated images will be saved. -This cannot be specified with the `Format` parameter. Also, `NumberOfImages` must be `1`. + The base URI for the OpenAI API. - String + Uri - String + Uri None - - User + + ApiKey - A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. + The OpenAI API key as a secure string. - String + SecureString - String + SecureString None - - TimeoutSec + + ApiType - Specifies how long the request can be pending before it times out. The default value is `0` (infinite). + The API provider. Agents API commands support OpenAI only. - Int32 + OpenAIApiType - Int32 + OpenAIApiType - 0 + None - - MaxRetryCount + + AuthType - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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. - + The authentication type. Use openai for the Agents API. - Int32 + String - Int32 + String - 0 + None - - ApiBase + + Confirm - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` + Prompts you for confirmation before running the cmdlet. - System.Uri + SwitchParameter - System.Uri + SwitchParameter - https://api.openai.com/v1 + False - - ApiKey + + MaxRetryCount - Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + The maximum number of retries for transient API failures. - Object + Int32 - Object + Int32 None - + Organization - Specifies Organization ID which used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + The OpenAI organization ID. - string + String - string + String None - - - - - - ResponseFormat = url : string or array of string - + + TimeoutSec - + The request timeout in seconds. Zero uses the module default. - - + Int32 - ResponseFormat = base64 : Generated image data represented in base64 string. + Int32 + + None + + + WhatIf - + Shows what would happen if the cmdlet runs. The cmdlet is not run. - - + SwitchParameter - ResponseFormat = byte : Byte array of generated image. + SwitchParameter + + False + + + ProgressAction - + Controls how PowerShell responds to progress updates. - - + ActionPreference - OutFile : Nothing. + ActionPreference + - - - - - + None + + + + @@ -19257,84 +20579,137 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN - Example 1: Creates a variation of a given image, then save to file. - Request-ImageVariation -Image C:\cupcake.png -OutFile C:\cupcake2.png -Size 256x256 - - | Source (cupcake.png) | Generated (cupcake2.png) | | ----------------------------------- | ------------------------------------ | | ! source (/Docs/images/cupcake.png) | ![output](/Docs/images/cupcake2.png)| - - - - Example 2: Creates a variation of a given image, then output as base64 string. - Request-ImageVariation -Image C:\cupcake.png -ResponseFormat "base64" - -iVBORw0KGgoAAAANSUhEUgAABAAAAAQACAIAAADwf7zUAAAAaGV...... + -------------------------- Example 1 -------------------------- + Remove-Agent -AgentId 'agent_123' -WhatIf - + Shows what would happen when deleting the reusable agent. Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/Request-ImageVariation.md - - - https://developers.openai.com/api/docs/guides/image-generation/ - https://developers.openai.com/api/docs/guides/image-generation/ + https://github.com/mkht/PSOpenAI/blob/v5/Docs/Remove-Agent.md - https://developers.openai.com/api/reference/resources/images/methods/create_variation/ - https://developers.openai.com/api/reference/resources/images/methods/create_variation/ + OpenAI Agents API + https://developers.openai.com/api/reference/typescript/resources/beta/subresources/agents - Request-Moderation - Request - Moderation + Remove-AgentEnvironmentTemplate + Remove + AgentEnvironmentTemplate - Given a input text, outputs if the model classifies it as violating OpenAI's content policy. + Deletes an agent environment template. - Given a input text, outputs if the model classifies it as violating OpenAI's content policy. -The moderation endpoint is free to use when monitoring the inputs and outputs of OpenAI APIs. -https://developers.openai.com/api/docs/guides/moderation/ + Deletes an agent environment template. This command uses the OpenAI Agents API public beta and sends the required `OpenAI-Beta: agents=v1` header. Nested, evolving request schemas are accepted through `-Body` where applicable. - Request-Moderation - - Text + Remove-AgentEnvironmentTemplate + + EnvironmentTemplateId - A string of text to classify for moderation. + The reusable agent environment template ID. - String[] + String - String[] + String None - - Images + + AdditionalBody - An array of images to passing the model. You can specifies local image file or remote url. - + Additional JSON properties to merge into the request body. - String[] + Object - String[] + Object None - - Model + + AdditionalHeaders - The content moderation model you would like to use. + Additional HTTP headers to include in the request. + + IDictionary + + IDictionary + + + None + + + AdditionalQuery + + Additional query parameters to include in the request. + + IDictionary + + IDictionary + + + None + + + ApiBase + + The base URI for the OpenAI API. + + Uri + + Uri + + + None + + + ApiKey + + The OpenAI API key as a secure string. + + SecureString + + SecureString + + + None + + + ApiType + + The API provider. Agents API commands support OpenAI only. + + + OpenAI + Azure + + OpenAIApiType + + OpenAIApiType + + + None + + + AuthType + + The authentication type. Use openai for the Agents API. + + openai + azure + azure_ad + String String @@ -19342,70 +20717,72 @@ https://developers.openai.com/api/docs/guides/moderation/ None - - TimeoutSec + + Confirm - Specifies how long the request can be pending before it times out. The default value is `0` (infinite). + Prompts you for confirmation before running the cmdlet. - Int32 - Int32 + SwitchParameter - 0 + False - + MaxRetryCount - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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. - + The maximum number of retries for transient API failures. Int32 Int32 - 0 + None - - ApiBase + + Organization - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` + The OpenAI organization ID. - System.Uri + String - System.Uri + String - https://api.openai.com/v1 + None - - ApiKey + + TimeoutSec - Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + The request timeout in seconds. Zero uses the module default. - Object + Int32 - Object + Int32 None - - Organization + + WhatIf - Specifies Organization ID which used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + Shows what would happen if the cmdlet runs. The cmdlet is not run. - string - string + SwitchParameter + + + False + + + ProgressAction + + Controls how PowerShell responds to progress updates. + + ActionPreference + + ActionPreference None @@ -19413,123 +20790,177 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN - - Text + + AdditionalBody - A string of text to classify for moderation. + Additional JSON properties to merge into the request body. - String[] + Object - String[] + Object None - - Images + + AdditionalHeaders - An array of images to passing the model. You can specifies local image file or remote url. - + Additional HTTP headers to include in the request. - String[] + IDictionary - String[] + IDictionary None - - Model + + AdditionalQuery - The content moderation model you would like to use. + Additional query parameters to include in the request. - String + IDictionary - String + IDictionary None - - TimeoutSec + + ApiBase - Specifies how long the request can be pending before it times out. The default value is `0` (infinite). + The base URI for the OpenAI API. - Int32 + Uri - Int32 + Uri - 0 + None - - MaxRetryCount + + ApiKey - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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. - + The OpenAI API key as a secure string. - Int32 + SecureString - Int32 + SecureString - 0 + None - - ApiBase + + ApiType - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` + The API provider. Agents API commands support OpenAI only. - System.Uri + OpenAIApiType - System.Uri + OpenAIApiType - https://api.openai.com/v1 + None - - ApiKey + + AuthType - Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + The authentication type. Use openai for the Agents API. - Object + String - Object + String None - + + Confirm + + Prompts you for confirmation before running the cmdlet. + + SwitchParameter + + SwitchParameter + + + False + + + EnvironmentTemplateId + + The reusable agent environment template ID. + + String + + String + + + None + + + MaxRetryCount + + The maximum number of retries for transient API failures. + + Int32 + + Int32 + + + None + + Organization - Specifies Organization ID which used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + The OpenAI organization ID. - string + String - string + String None - - - - + + TimeoutSec + + The request timeout in seconds. Zero uses the module default. + + Int32 - [pscustomobject] + Int32 + + None + + + WhatIf - + Shows what would happen if the cmdlet runs. The cmdlet is not run. - - + SwitchParameter + + SwitchParameter + + + False + + + ProgressAction + + Controls how PowerShell responds to progress updates. + + ActionPreference + + ActionPreference + + + None + + + + @@ -19538,55 +20969,42 @@ If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPEN -------------------------- Example 1 -------------------------- - PS C:\> $Result = Request-Moderation -Text "I want to kill them." -PS C:\> $Result.results[0].categories - -sexual : False -hate : False -violence : True -self-harm : False -sexual/minors : False -hate/threatening : False -violence/graphic : False + Remove-AgentEnvironmentTemplate -EnvironmentTemplateId 'envtpl_123' -WhatIf - + Shows what would happen when deleting the environment template. Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/Request-Moderation.md - - - https://developers.openai.com/api/docs/guides/moderation/ - https://developers.openai.com/api/docs/guides/moderation/ + https://github.com/mkht/PSOpenAI/blob/v5/Docs/Remove-AgentEnvironmentTemplate.md - https://developers.openai.com/api/reference/resources/moderations/ - https://developers.openai.com/api/reference/resources/moderations/ + OpenAI Agents API + https://developers.openai.com/api/reference/typescript/resources/beta/subresources/agents - Request-RealtimeSessionResponse - Request - RealtimeSessionResponse + Remove-AgentSession + Remove + AgentSession - Instruct the server to generate a response. + Deletes an agent session. - Instruct the server to generate a response. When automatic turn detection by the server is enabled, this is usually not necessary. If turn detection is disabled, use this command to request a response from the server. + Deletes an agent session. This command uses the OpenAI Agents API public beta and sends the required `OpenAI-Beta: agents=v1` header. Nested, evolving request schemas are accepted through `-Body` where applicable. - Request-RealtimeSessionResponse - - EventId + Remove-AgentSession + + SessionId - Optional client-generated ID used to identify this event. + The managed agent session ID. String @@ -19595,51 +21013,92 @@ violence/graphic : False None - - Instructions + + AdditionalBody - Instructions for the model. + Additional JSON properties to merge into the request body. - String + Object - String + Object None - - MaxOutputTokens + + AdditionalHeaders - Maximum number of output tokens for a single assistant response. Provide an integer between 1 and 4096 to limit output tokens, or -1 for no limitations. + Additional HTTP headers to include in the request. - Int32 + IDictionary - Int32 + IDictionary - -1 + None - - OutputModalities + + AdditionalQuery - The set of modalities the model can respond with. + Additional query parameters to include in the request. + + IDictionary + + IDictionary + + + None + + + ApiBase + + The base URI for the OpenAI API. + + Uri + + Uri + + + None + + + ApiKey + + The OpenAI API key as a secure string. + + SecureString + + SecureString + + + None + + + ApiType + + The API provider. Agents API commands support OpenAI only. - text - audio + OpenAI + Azure - String[] + OpenAIApiType - String[] + OpenAIApiType None - - OutputAudioFormat + + AuthType - The format of output audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. + The authentication type. Use openai for the Agents API. + + openai + azure + azure_ad + String String @@ -19647,22 +21106,33 @@ violence/graphic : False None - - Temperature + + Confirm - Sampling temperature for the model, limited to [0.6, 1.2]. + Prompts you for confirmation before running the cmdlet. - Single - Single + SwitchParameter + + + False + + + MaxRetryCount + + The maximum number of retries for transient API failures. + + Int32 + + Int32 None - - Voice + + Organization - The voice the model uses to respond. + The OpenAI organization ID. String @@ -19671,85 +21141,168 @@ violence/graphic : False None + + TimeoutSec + + The request timeout in seconds. Zero uses the module default. + + Int32 + + Int32 + + + None + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + SwitchParameter + + + False + + + ProgressAction + + Controls how PowerShell responds to progress updates. + + ActionPreference + + ActionPreference + + + None + - - EventId + + AdditionalBody - Optional client-generated ID used to identify this event. + Additional JSON properties to merge into the request body. - String + Object - String + Object None - - Instructions + + AdditionalHeaders - Instructions for the model. + Additional HTTP headers to include in the request. - String + IDictionary - String + IDictionary None - - MaxOutputTokens + + AdditionalQuery - Maximum number of output tokens for a single assistant response. Provide an integer between 1 and 4096 to limit output tokens, or -1 for no limitations. + Additional query parameters to include in the request. - Int32 + IDictionary - Int32 + IDictionary - -1 + None - - OutputModalities + + ApiBase - The set of modalities the model can respond with. + The base URI for the OpenAI API. - String[] + Uri - String[] + Uri None - - OutputAudioFormat + + ApiKey - The format of output audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. + The OpenAI API key as a secure string. - String + SecureString - String + SecureString None - - Temperature + + ApiType - Sampling temperature for the model, limited to [0.6, 1.2]. + The API provider. Agents API commands support OpenAI only. - Single + OpenAIApiType - Single + OpenAIApiType None - - Voice + + AuthType - The voice the model uses to respond. + The authentication type. Use openai for the Agents API. + + String + + String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + SwitchParameter + + SwitchParameter + + + False + + + MaxRetryCount + + The maximum number of retries for transient API failures. + + Int32 + + Int32 + + + None + + + Organization + + The OpenAI organization ID. + + String + + String + + + None + + + SessionId + + The managed agent session ID. String @@ -19758,6 +21311,42 @@ violence/graphic : False None + + TimeoutSec + + The request timeout in seconds. Zero uses the module default. + + Int32 + + Int32 + + + None + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + SwitchParameter + + SwitchParameter + + + False + + + ProgressAction + + Controls how PowerShell responds to progress updates. + + ActionPreference + + ActionPreference + + + None + @@ -19769,54 +21358,42 @@ violence/graphic : False -------------------------- Example 1 -------------------------- - PS C:\> Request-RealtimeSessionResponse + Remove-AgentSession -SessionId 'session_123' -WhatIf - + Shows what would happen when deleting the managed session. Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/Request-RealtimeSessionResponse.md + https://github.com/mkht/PSOpenAI/blob/v5/Docs/Remove-AgentSession.md - https://developers.openai.com/api/docs/guides/realtime-conversations/ - https://developers.openai.com/api/docs/guides/realtime-conversations/ + OpenAI Agents API + https://developers.openai.com/api/reference/typescript/resources/beta/subresources/agents - Request-Response - Request - Response + Remove-AgentSessionArtifact + Remove + AgentSessionArtifact - Creates a model response. + Deletes an immutable session artifact. - Creates a model response. Provide text or image inputs to generate text or JSON outputs. + Deletes an immutable session artifact. This command uses the OpenAI Agents API public beta and sends the required `OpenAI-Beta: agents=v1` header. Nested, evolving request schemas are accepted through `-Body` where applicable. - Request-Response - - Message - - A text input to the model. - - String - - String - - - None - - - Role + Remove-AgentSessionArtifact + + SessionId - The role of the message input. One of `user`, `system`, or `developer`. The default is `user`. + The managed agent session ID. String @@ -19825,110 +21402,104 @@ violence/graphic : False None - - Model + + ArtifactId - The name of model to use. -The default value is `gpt-4o-mini`. + The session artifact ID. String String - gpt-4o-mini - - - SystemMessage - - (Instead of this parameter, the use of the `-Instructions` parameter is recommended.) -Instructions that the model should follow. - - String[] - - String[] - - None - - DeveloperMessage + + AdditionalBody - (Instead of this parameter, the use of the `-Instructions` parameter is recommended.) -Instructions that the model should follow. + Additional JSON properties to merge into the request body. - String[] + Object - String[] + Object None - - Instructions + + AdditionalHeaders - A system (or developer) message inserted into the model's context. + Additional HTTP headers to include in the request. - String + IDictionary - String + IDictionary None - - Conversation + + AdditionalQuery - The conversation that this response belongs to. Input items and output items from this response are automatically added to this conversation after this response completes. + Additional query parameters to include in the request. - String + IDictionary - String + IDictionary None - - PreviousResponseId + + ApiBase - The unique ID of the previous response to the model. Use this to create multi-turn conversations. + The base URI for the OpenAI API. - String + Uri - String + Uri None - - PromptId + + ApiKey - The unique identifier of the prompt template to use. + The OpenAI API key as a secure string. - String + SecureString - String + SecureString None - - PromptVariables + + ApiType - Optional map of values to substitute in for variables in your prompt. + The API provider. Agents API commands support OpenAI only. - IDictionary + + OpenAI + Azure + + OpenAIApiType - IDictionary + OpenAIApiType None - - PromptVersion + + AuthType - Optional version of the prompt template. + The authentication type. Use openai for the Agents API. + + openai + azure + azure_ad + String String @@ -19936,54 +21507,33 @@ Instructions that the model should follow. None - - Images - - A list of images to passing the model. You can specify local image file or remote url. - - - String[] - - String[] - - - None - - - ImageDetail + + Confirm - Controls how the model processes the image and generates its textual understanding. You can select from `Low` or `High`. - + Prompts you for confirmation before running the cmdlet. - - auto - low - high - - String - String + SwitchParameter - auto + False - - Files + + MaxRetryCount - A file input to the model. -You can speciy a list of the local file path, the URL of the file or the ID of the file to be uploaded. + The maximum number of retries for transient API failures. - String[] + Int32 - String[] + Int32 None - - ToolChoice + + Organization - How the model should select which tool (or tools) to use when generating a response. + The OpenAI organization ID. String @@ -19992,10 +21542,10 @@ You can speciy a list of the local file path, the URL of the file or the ID of t None - - MaxToolCalls + + TimeoutSec - The maximum number of total calls to built-in tools that can be processed in a response. + The request timeout in seconds. Zero uses the module default. Int32 @@ -20004,193 +21554,387 @@ You can speciy a list of the local file path, the URL of the file or the ID of t None - - ParallelToolCalls - - Whether to allow the model to run tool calls in parallel. - - Boolean - - Boolean - - - None - - - Functions + + WhatIf - A list of functions the model may call. + Shows what would happen if the cmdlet runs. The cmdlet is not run. - IDictionary[] - IDictionary[] + SwitchParameter - None + False - - CustomTools + + ProgressAction - A list of custom tools the model may call. + Controls how PowerShell responds to progress updates. - IDictionary[] + ActionPreference - IDictionary[] + ActionPreference None - - UseFileSearchTool - - If you want to use the File search built-in tool, Should specify this switch as enabled. - - - SwitchParameter - - - False - - - FileSearchVectorStoreIds - - The IDs of the vector stores to search. - - String[] - - String[] - - - None - - - FileSearchMaxNumberOfResults + + + + + AdditionalBody + + Additional JSON properties to merge into the request body. + + Object + + Object + + + None + + + AdditionalHeaders + + Additional HTTP headers to include in the request. + + IDictionary + + IDictionary + + + None + + + AdditionalQuery + + Additional query parameters to include in the request. + + IDictionary + + IDictionary + + + None + + + ApiBase + + The base URI for the OpenAI API. + + Uri + + Uri + + + None + + + ApiKey + + The OpenAI API key as a secure string. + + SecureString + + SecureString + + + None + + + ApiType + + The API provider. Agents API commands support OpenAI only. + + OpenAIApiType + + OpenAIApiType + + + None + + + ArtifactId + + The session artifact ID. + + String + + String + + + None + + + AuthType + + The authentication type. Use openai for the Agents API. + + String + + String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + SwitchParameter + + SwitchParameter + + + False + + + MaxRetryCount + + The maximum number of retries for transient API failures. + + Int32 + + Int32 + + + None + + + Organization + + The OpenAI organization ID. + + String + + String + + + None + + + SessionId + + The managed agent session ID. + + String + + String + + + None + + + TimeoutSec + + The request timeout in seconds. Zero uses the module default. + + Int32 + + Int32 + + + None + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + SwitchParameter + + SwitchParameter + + + False + + + ProgressAction + + Controls how PowerShell responds to progress updates. + + ActionPreference + + ActionPreference + + + None + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Remove-AgentSessionArtifact -SessionId 'session_123' -ArtifactId 'artifact_123' -WhatIf + + Shows what would happen when deleting the session artifact. + + + + + + Online Version: + https://github.com/mkht/PSOpenAI/blob/v5/Docs/Remove-AgentSessionArtifact.md + + + OpenAI Agents API + https://developers.openai.com/api/reference/typescript/resources/beta/subresources/agents + + + + + + Remove-AgentVault + Remove + AgentVault + + Deletes an agent credential vault. + + + + Deletes an agent credential vault. This command uses the OpenAI Agents API public beta and sends the required `OpenAI-Beta: agents=v1` header. Nested, evolving request schemas are accepted through `-Body` where applicable. + + + + Remove-AgentVault + + VaultId - The maximum number of results to return. + The agent vault ID. - Int32 + String - Int32 + String None - - FileSearchRanker + + AdditionalBody - The ranker to use for the file search. + Additional JSON properties to merge into the request body. - String + Object - String + Object None - - FileSearchScoreThreshold + + AdditionalHeaders - 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. + Additional HTTP headers to include in the request. - Float + IDictionary - Float + IDictionary None - - FileSearchHybridSearchEmbeddingWeight + + AdditionalQuery - The weight of the embedding in the reciprocal ranking fusion. + Additional query parameters to include in the request. - Float + IDictionary - Float + IDictionary None - - FileSearchHybridSearchTextWeight + + ApiBase - The weight of the text in the reciprocal ranking fusion. + The base URI for the OpenAI API. - Float + Uri - Float + Uri None - - UseWebSearchTool + + ApiKey - If you want to use the Web search built-in tool, Should specify this switch as enabled. + The OpenAI API key as a secure string. + SecureString - SwitchParameter + SecureString - False + None - - WebSearchType + + ApiType - The type of the web search tool. + The API provider. Agents API commands support OpenAI only. - String + + OpenAI + Azure + + OpenAIApiType - String + OpenAIApiType None - - WebSearchContextSize + + AuthType - High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default. + The authentication type. Use openai for the Agents API. - low - medium - high + openai + azure + azure_ad String String - medium + None - - WebSearchAllowedDomains + + Confirm - Allowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well. + Prompts you for confirmation before running the cmdlet. - String[] - String[] + SwitchParameter - None + False - - WebSearchUserLocationCity + + MaxRetryCount - Free text input for the city of the user, e.g. `San Francisco`. + The maximum number of retries for transient API failures. - String + Int32 - String + Int32 None - - WebSearchUserLocationCountry + + Organization - The two-letter ISO country code of the user, e.g. `US`. + The OpenAI organization ID. String @@ -20199,46 +21943,259 @@ You can speciy a list of the local file path, the URL of the file or the ID of t None - - WebSearchUserLocationRegion + + TimeoutSec - Free text input for the region of the user, e.g. `California`. + The request timeout in seconds. Zero uses the module default. - String + Int32 - String + Int32 None - - WebSearchUserLocationTimeZone + + WhatIf - The IANA timezone of the user, e.g. `America/Los_Angeles`. + Shows what would happen if the cmdlet runs. The cmdlet is not run. - String - String + SwitchParameter - None + False - - UseComputerUseTool + + ProgressAction - If you want to use the Computer-use built-in tool, Should specify this switch as enabled. + Controls how PowerShell responds to progress updates. + ActionPreference - SwitchParameter + ActionPreference - False + None - - ComputerUseEnvironment + + + + + AdditionalBody + + Additional JSON properties to merge into the request body. + + Object + + Object + + + None + + + AdditionalHeaders + + Additional HTTP headers to include in the request. + + IDictionary + + IDictionary + + + None + + + AdditionalQuery + + Additional query parameters to include in the request. + + IDictionary + + IDictionary + + + None + + + ApiBase + + The base URI for the OpenAI API. + + Uri + + Uri + + + None + + + ApiKey + + The OpenAI API key as a secure string. + + SecureString + + SecureString + + + None + + + ApiType + + The API provider. Agents API commands support OpenAI only. + + OpenAIApiType + + OpenAIApiType + + + None + + + AuthType + + The authentication type. Use openai for the Agents API. + + String + + String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + SwitchParameter + + SwitchParameter + + + False + + + MaxRetryCount + + The maximum number of retries for transient API failures. + + Int32 + + Int32 + + + None + + + Organization + + The OpenAI organization ID. + + String + + String + + + None + + + TimeoutSec + + The request timeout in seconds. Zero uses the module default. + + Int32 + + Int32 + + + None + + + VaultId + + The agent vault ID. + + String + + String + + + None + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + SwitchParameter + + SwitchParameter + + + False + + + ProgressAction + + Controls how PowerShell responds to progress updates. + + ActionPreference + + ActionPreference + + + None + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Remove-AgentVault -VaultId 'vault_123' -WhatIf + + Shows what would happen when deleting the vault. + + + + + + Online Version: + https://github.com/mkht/PSOpenAI/blob/v5/Docs/Remove-AgentVault.md + + + OpenAI Agents API + https://developers.openai.com/api/reference/typescript/resources/beta/subresources/agents + + + + + + Remove-AgentVaultCredential + Remove + AgentVaultCredential + + Deletes a credential from an agent vault. + + + + Deletes a credential from an agent vault. This command uses the OpenAI Agents API public beta and sends the required `OpenAI-Beta: agents=v1` header. Nested, evolving request schemas are accepted through `-Body` where applicable. + + + + Remove-AgentVaultCredential + + VaultId - The type of computer environment to control. -Possible values: `browser`, `mac`, `windows`, `ubuntu`. + The agent vault ID. String @@ -20247,184 +22204,411 @@ Possible values: `browser`, `mac`, `windows`, `ubuntu`. None - - ComputerUseDisplayHeight + + CredentialId - The height of the computer display. + The vault credential ID. - Int32 + String - Int32 + String None - - ComputerUseDisplayWidth + + AdditionalBody - The width of the computer display. + Additional JSON properties to merge into the request body. - Int32 + Object - Int32 + Object None - - UseRemoteMCPTool + + AdditionalHeaders - If you want to use the Remote MCP built-in tool, Should specify this switch as enabled. + Additional HTTP headers to include in the request. + IDictionary - SwitchParameter + IDictionary - False + None - - RemoteMCPServerLabel + + AdditionalQuery - A label for this MCP server, used to identify it in tool calls. + Additional query parameters to include in the request. - String + IDictionary - String + IDictionary None - - RemoteMCPServerUrl + + ApiBase - The URL for the MCP server. + The base URI for the OpenAI API. - String + Uri - String + Uri None - - RemoteMCPServerDescription + + ApiKey - Optional description of the MCP server, used to provide more context. + The OpenAI API key as a secure string. - String + SecureString - String + SecureString None - - RemoteMCPAllowedTools + + ApiType - List of allowed tool names or a filter object. + The API provider. Agents API commands support OpenAI only. - Object + + OpenAI + Azure + + OpenAIApiType - Object + OpenAIApiType None - - RemoteMCPRequireApproval + + AuthType - Specify which of the MCP server's tools require approval. When you want to specify a single approval policy for all tools. One of `always` or `never`. + The authentication type. Use openai for the Agents API. - Object + + openai + azure + azure_ad + + String - Object + String None - - RemoteMCPHeaders + + Confirm - Optional HTTP headers to send to the MCP server. Use for authentication or other purposes. + Prompts you for confirmation before running the cmdlet. - IDictionary - IDictionary + SwitchParameter - None + False - - RemoteMCPAuthorization + + MaxRetryCount - An OAuth access token that can be used with a remote MCP server. + The maximum number of retries for transient API failures. - String + Int32 - String + Int32 None - - UseConnectorTool + + Organization - If you want to use the service connector, Should specify this switch as enabled. + The OpenAI organization ID. + String - SwitchParameter + String - False + None - - ConnectorLabel + + TimeoutSec - A label for this connector, used to identify it in tool calls. + The request timeout in seconds. Zero uses the module default. - String + Int32 - String + Int32 None - - ConnectorId + + WhatIf - The ID of the connector. Supported connector id values are: -- Dropbox: `connector_dropbox` - - Gmail: `connector_gmail` - - Google Calendar: `connector_googlecalendar` - - Google Drive: `connector_googledrive` - - Microsoft Teams: `connector_microsoftteams` - - Outlook Calendar: `connector_outlookcalendar` - - Outlook Email: `connector_outlookemail` - - SharePoint: `connector_sharepoint` + Shows what would happen if the cmdlet runs. The cmdlet is not run. - String - String + SwitchParameter - None + False - - ConnectorRequireApproval + + ProgressAction - Specify whether the connector requires approval. One of `always` or `never`. + Controls how PowerShell responds to progress updates. - String + ActionPreference - String + ActionPreference None - - ConnectorAuthorization + + + + + AdditionalBody + + Additional JSON properties to merge into the request body. + + Object + + Object + + + None + + + AdditionalHeaders + + Additional HTTP headers to include in the request. + + IDictionary + + IDictionary + + + None + + + AdditionalQuery + + Additional query parameters to include in the request. + + IDictionary + + IDictionary + + + None + + + ApiBase + + The base URI for the OpenAI API. + + Uri + + Uri + + + None + + + ApiKey + + The OpenAI API key as a secure string. + + SecureString + + SecureString + + + None + + + ApiType + + The API provider. Agents API commands support OpenAI only. + + OpenAIApiType + + OpenAIApiType + + + None + + + AuthType + + The authentication type. Use openai for the Agents API. + + String + + String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + SwitchParameter + + SwitchParameter + + + False + + + CredentialId + + The vault credential ID. + + String + + String + + + None + + + MaxRetryCount + + The maximum number of retries for transient API failures. + + Int32 + + Int32 + + + None + + + Organization + + The OpenAI organization ID. + + String + + String + + + None + + + TimeoutSec + + The request timeout in seconds. Zero uses the module default. + + Int32 + + Int32 + + + None + + + VaultId + + The agent vault ID. + + String + + String + + + None + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + SwitchParameter + + SwitchParameter + + + False + + + ProgressAction + + Controls how PowerShell responds to progress updates. + + ActionPreference + + ActionPreference + + + None + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Remove-AgentVaultCredential -VaultId 'vault_123' -CredentialId 'credential_123' -WhatIf + + Shows what would happen when deleting the vault credential. + + + + + + Online Version: + https://github.com/mkht/PSOpenAI/blob/v5/Docs/Remove-AgentVaultCredential.md + + + OpenAI Agents API + https://developers.openai.com/api/reference/typescript/resources/beta/subresources/agents + + + + + + Remove-ChatCompletion + Remove + ChatCompletion + + Delete a stored chat completion. + + + + Delete a stored chat completion. Only chat completions that have been created with the store parameter set to true can be deleted. + + + + Remove-ChatCompletion + + CompletionId - An OAuth access token that can be used with a service connector. + The ID of the chat completion to delete. String @@ -20434,422 +22618,967 @@ Possible values: `browser`, `mac`, `windows`, `ubuntu`. None - UseCodeInterpreterTool + TimeoutSec - If you want to use the Code Interpreter built-in tool, Should specify this switch as enabled. + Specifies how long the request can be pending before it times out. +The default value is `0` (infinite). + Int32 - SwitchParameter + Int32 - False + 0 - CodeInterpreterMemoryLimit + TimeoutSec - {{No description provided}} + Specifies how long the request can be pending before it times out. +The default value is `0` (infinite). - String + Int32 - String + Int32 - None + 0 - ContainerId + MaxRetryCount - The code interpreter container. Can be a container ID or `auto` to use the default container. + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). +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. + - String + Int32 - String + Int32 - auto + 0 - ContainerFileIds + ApiBase - An optional list of uploaded files to make available to your code. + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` - String[] + System.Uri - String[] + System.Uri - None + https://api.openai.com/v1 - UseImageGenerationTool + ApiKey - If you want to use the Imagae Generation built-in tool, Should specify this switch as enabled. + Specifies API key for authentication. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + Object - SwitchParameter + Object - False + None - - ImageGenerationModel + + Organization - The image generation model to use. Default: `gpt-image-1`. + Specifies Organization ID which used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` - String + string - String + string None - - ImageGenerationAction + + + + + CompletionId + + The ID of the chat completion to delete. + + String + + String + + + None + + + TimeoutSec + + Specifies how long the request can be pending before it times out. +The default value is `0` (infinite). + + Int32 + + Int32 + + + 0 + + + TimeoutSec + + Specifies how long the request can be pending before it times out. +The default value is `0` (infinite). + + Int32 + + Int32 + + + 0 + + + MaxRetryCount + + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). +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. + + + Int32 + + Int32 + + + 0 + + + ApiBase + + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` + + System.Uri + + System.Uri + + + https://api.openai.com/v1 + + + ApiKey + + Specifies API key for authentication. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + + Object + + Object + + + None + + + Organization + + Specifies Organization ID which used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + + string + + string + + + None + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + PS C:\> Remove-ChatCompletion -CompletionId 'chatcompl-abc123' + + Remove a chat completion has the ID `chatcompl-abc123` + + + + + + Online Version: + https://github.com/mkht/PSOpenAI/blob/main/Docs/Remove-ChatCompletion.md + + + https://developers.openai.com/api/reference/resources/chat/subresources/completions/methods/delete/ + https://developers.openai.com/api/reference/resources/chat/subresources/completions/methods/delete/ + + + + + + Remove-Container + Remove + Container + + Delete Container + + + + Delete Container + + + + Remove-Container + + ContainerId - Whether to generate a new image or edit an existing image. Default: `auto`. + The ID of the container to delete. String String - auto + None - ImageGenerationBackGround + TimeoutSec - Background type for the generated image. One of `transparent`, `opaque`, or `auto` + Specifies how long the request can be pending before it times out. +The default value is `0` (infinite). - String + Int32 - String + Int32 - auto + 0 - ImageGenerationInputImageMask + MaxRetryCount - Optional mask for inpainting. Contains image_url (string, optional) and file_id (string, optional). + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). +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 retried. - String + Int32 - String + Int32 - None + 0 - ImageGenerationModeration + ApiBase - Moderation level for the generated image. Default: auto + Specifies an API endpoint URL such as: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1`. - String + System.Uri - String + System.Uri - auto + https://api.openai.com/v1 - ImageGenerationOutputCompression + ApiKey - Compression level for the output image. Default: 100. + Specifies API key for authentication. +The type of data should be `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY`. - Int32 + Object - Int32 + Object None - - ImageGenerationOutputFormat - - The output format of the generated image. One of `png`, `webp`, or `jpeg`. - - String - - String - - - png - - - ImageGenerationPartialImages + + Organization - Number of partial images to generate in streaming mode, from 0 (default value) to 3. + Specifies Organization ID used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION`. - Int32 + string - Int32 + string None - - ImageGenerationQuality + + + + + ContainerId + + The ID of the container to delete. + + String + + String + + + None + + + TimeoutSec + + Specifies how long the request can be pending before it times out. +The default value is `0` (infinite). + + Int32 + + Int32 + + + 0 + + + MaxRetryCount + + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). +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 retried. + + Int32 + + Int32 + + + 0 + + + ApiBase + + Specifies an API endpoint URL such as: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1`. + + System.Uri + + System.Uri + + + https://api.openai.com/v1 + + + ApiKey + + Specifies API key for authentication. +The type of data should be `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY`. + + Object + + Object + + + None + + + Organization + + Specifies Organization ID used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION`. + + string + + string + + + None + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + PS C:\> Remove-Container 'cont_abc123' + + Delete a container with ID `cont_abc123`. + + + + + + Online Version: + https://github.com/mkht/PSOpenAI/blob/main/Docs/Remove-Container.md + + + https://developers.openai.com/api/reference/resources/containers/methods/delete/ + https://developers.openai.com/api/reference/resources/containers/methods/delete/ + + + + + + Remove-ContainerFile + Remove + ContainerFile + + Delete Container File + + + + Removes a file attached to a container. + + + + + Remove-ContainerFile + + ContainerId - The quality of the generated image. One of `low`, `medium`, `high`, or `auto`. + The ID of the container. String String - auto + None - - ImageGenerationSize + + FileId - The size of the generated image. One of `1024x1024`, `1024x1536`, `1536x1024`, or `auto`. Default: `auto`. + The ID of the file to remove. String String - auto + None - UseLocalShellTool + TimeoutSec - If you want to use the Local Shell built-in tool, Should specify this switch as enabled. + Specifies how long the request can be pending before it times out. +The default value is `0` (infinite). + Int32 - SwitchParameter + Int32 - False + 0 - UseShellTool + MaxRetryCount - If you want to use the Shell built-in tool, Should specify this switch as enabled. + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). +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 retried. + Int32 - SwitchParameter + Int32 - False + 0 - UseApplyPatchTool + ApiBase - If you want to use the Apply Patch built-in tool, Should specify this switch as enabled. + Specifies an API endpoint URL such as: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1`. + System.Uri - SwitchParameter + System.Uri - False + https://api.openai.com/v1 - Include + ApiKey - Specify additional output data to include in the model response. + Specifies API key for authentication. +The type of data should be `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY`. - String[] + Object - String[] + Object None - - Truncation + + Organization - The truncation strategy to use for the model response. `disabled` (default) or `auto`. + Specifies Organization ID used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION`. - String + string - String + string - disabled + None - - Temperature + + + Remove-ContainerFile + + ContainerFile - What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random. + A ContainerFile object from Get-ContainerFile. - Float + PSCustomObject - Float + PSCustomObject None - - TopLogprobs + + TimeoutSec - An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. + Specifies how long the request can be pending before it times out. +The default value is `0` (infinite). Int32 Int32 - None + 0 - - TopP + + MaxRetryCount - 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. + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). +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 retried. - Float + Int32 - Float + Int32 - None + 0 - Store + ApiBase - Whether to store the generated model response for later retrieval via API. The default is `$true`. + Specifies an API endpoint URL such as: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1`. - Boolean + System.Uri - Boolean + System.Uri - True + https://api.openai.com/v1 - Background + ApiKey - Whether to run the model response in the background. The default is `$false`. + Specifies API key for authentication. +The type of data should be `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY`. + Object - SwitchParameter + Object - False + None - - Stream + + Organization - If set, the model response data will be streamed to the client. + Specifies Organization ID used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION`. + string - SwitchParameter + string - False + None - - StreamOutputType + + + + + ContainerId + + The ID of the container. + + String + + String + + + None + + + FileId + + The ID of the file to remove. + + String + + String + + + None + + + ContainerFile + + A ContainerFile object from Get-ContainerFile. + + PSCustomObject + + PSCustomObject + + + None + + + TimeoutSec + + Specifies how long the request can be pending before it times out. +The default value is `0` (infinite). + + Int32 + + Int32 + + + 0 + + + MaxRetryCount + + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). +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 retried. + + Int32 + + Int32 + + + 0 + + + ApiBase + + Specifies an API endpoint URL such as: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1`. + + System.Uri + + System.Uri + + + https://api.openai.com/v1 + + + ApiKey + + Specifies API key for authentication. +The type of data should be `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY`. + + Object + + Object + + + None + + + Organization + + Specifies Organization ID used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION`. + + string + + string + + + None + + + + + + + PSCustomObject + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + PS C:\> Remove-ContainerFile -ContainerId 'cont_abc123' -FileId 'file-abc123' + + Remove the file with ID `file-abc123` from the container with ID `cont_abc123`. + + + + -------------------------- Example 2 -------------------------- + PS C:\> $File = Get-ContainerFile -ContainerId 'cont_abc123' -FileId 'file-abc123' +PS C:\> Remove-ContainerFile -ContainerFile $File + + Remove the file using a ContainerFile object. + + + + + + Online Version: + https://github.com/mkht/PSOpenAI/blob/main/Docs/Remove-ContainerFile.md + + + https://developers.openai.com/api/reference/resources/containers/subresources/files/methods/delete/ + https://developers.openai.com/api/reference/resources/containers/subresources/files/methods/delete/ + + + + + + Remove-Conversation + Remove + Conversation + + Delete a conversation with the given ID. + + + + Delete a conversation with the given ID. + + + + Remove-Conversation + + ConversationId - Specifying the format that the function output. This parameter is only valid for the stream output. -- `text` : Output only text deltas that the model generated. (Default) -- `object` : Output all events that the API respond. - + The ID of the conversation to delete. - - text - object - String String - text + None - Verbosity + TimeoutSec - Controls the verbosity level of the response. -Valid values are `low`, `medium`, or `high`. - + Specifies how long the request can be pending before it times out. +The default value is `0` (infinite). - String + Int32 - String + Int32 - medium + 0 - ReasoningEffort + MaxRetryCount - Constrains effort on reasoning for reasoning models. Supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). - String + Int32 - String + Int32 - None + 0 - ReasoningSummary + ApiBase - A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of `auto`, `concise` or `detailed`. + Specifies an API endpoint URL such as: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1`. - String + System.Uri - String + System.Uri - None + https://api.openai.com/v1 - MetaData + ApiKey - Developer-defined tags and values used for filtering completions in the dashboard. + Specifies API key for authentication. +The type of data should be `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY`. - IDictionary - - IDictionary - - - None - - - MaxOutputTokens - - An upper bound for the number of tokens that can be generated for a response. - - Int32 - - Int32 - - - None - - - OutputType - - An object specifying the format that the model must output. -- `text` : Default response format. Used to generate text responses. -- `json_schema` : Enables Structured Outputs -- `json_object` : Enables the older JSON mode (Not recommended) - - - Object + SecureString - Object + SecureString None - - OutputRawResponse - - If specifies this switch, an output of this function to be a raw response value from the API. (Normally JSON formatted string.) - - - SwitchParameter - - - False - - - JsonSchema + + + + + ConversationId + + The ID of the conversation to delete. + + String + + String + + + None + + + TimeoutSec + + Specifies how long the request can be pending before it times out. +The default value is `0` (infinite). + + Int32 + + Int32 + + + 0 + + + MaxRetryCount + + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). + + Int32 + + Int32 + + + 0 + + + ApiBase + + Specifies an API endpoint URL such as: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1`. + + System.Uri + + System.Uri + + + https://api.openai.com/v1 + + + ApiKey + + Specifies API key for authentication. +The type of data should be `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY`. + + SecureString + + SecureString + + + None + + + + + + + None + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + PS C:\> Remove-Conversation -ConversationId "conv_abc123" + + Deletes the conversation with the ID `conv_abc123`. + + + + + + Online Version: + https://github.com/mkht/PSOpenAI/blob/main/Docs/Remove-Conversation.md + + + https://developers.openai.com/api/reference/resources/conversations/methods/delete/ + https://developers.openai.com/api/reference/resources/conversations/methods/delete/ + + + + + + Remove-ConversationItem + Remove + ConversationItem + + Delete an item from a conversation with the given ID. + + + + Delete an item from a conversation with the given ID. + + + + Remove-ConversationItem + + ItemId - The schema for the response format, described as a JSON Schema object. + The ID of the item to delete. String @@ -20858,10 +23587,10 @@ Valid values are `low`, `medium`, or `high`. None - - JsonSchemaName + + ConversationId - The name of the response format. + The ID of the conversation that contains the item. String @@ -20871,105 +23600,196 @@ Valid values are `low`, `medium`, or `high`. None - JsonSchemaDescription + TimeoutSec - A description of what the response format is for, used by the model to determine how to respond in the format. + Specifies how long the request can be pending before it times out. +The default value is `0` (infinite). - String + Int32 - String + Int32 - None + 0 - JsonSchemaStrict - - Whether to enable strict schema adherence when generating the output. - - Boolean - - Boolean - - - None - - - ServiceTier - - Specifies the processing type used for serving the request. - - String - - String - - - None - - - PromptCacheKey + MaxRetryCount - Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). - String + Int32 - String + Int32 - None + 0 - - PromptCacheMode + + ApiBase - Controls whether OpenAI automatically creates an implicit cache breakpoint. Defaults to implicit. With implicit. + Specifies an API endpoint URL such as: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1`. - String + System.Uri - String + System.Uri - None + https://api.openai.com/v1 - - PromptCacheTtl + + ApiKey - The minimum lifetime applied to every implicit and explicit cache breakpoint written by the request. Defaults to 30m, which is currently the only supported value. The backend may retain cache entries for longer. + Specifies API key for authentication. +The type of data should be `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY`. - String + SecureString - String + SecureString None - - PromptCacheRetention - - Deprecated. Use `-PromptCacheTtl` instead. - - String - - String - - - None - - - SafetyIdentifier - - A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. The IDs should be a string that uniquely identifies each user. - - String - - String - - - None - - - User + + + + + ConversationId + + The ID of the conversation that contains the item. + + String + + String + + + None + + + ItemId + + The ID of the item to delete. + + String + + String + + + None + + + TimeoutSec + + Specifies how long the request can be pending before it times out. +The default value is `0` (infinite). + + Int32 + + Int32 + + + 0 + + + MaxRetryCount + + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). + + Int32 + + Int32 + + + 0 + + + ApiBase + + Specifies an API endpoint URL such as: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1`. + + System.Uri + + System.Uri + + + https://api.openai.com/v1 + + + ApiKey + + Specifies API key for authentication. +The type of data should be `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY`. + + SecureString + + SecureString + + + None + + + + + + + None + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + PS C:\> Remove-ConversationItem -ConversationId "conv_abc123" -ItemId "msg_xyz456" + + Deletes the item with ID `msg_xyz456` from the conversation with ID `conv_abc123`. + + + + + + Online Version: + https://github.com/mkht/PSOpenAI/blob/main/Docs/Remove-ConversationItem.md + + + https://developers.openai.com/api/reference/resources/conversations/subresources/items/methods/delete/ + https://developers.openai.com/api/reference/resources/conversations/subresources/items/methods/delete/ + + + + + + Remove-OpenAIFile + Remove + OpenAIFile + + Delete a file. + + + + Delete a file. + + + + Remove-OpenAIFile + + FileId - (deprecated) This field is being replaced by `SafetyIdentifier` and `PromptCacheKey`. + The ID of the file to use for this request. String @@ -20978,48 +23798,23 @@ Valid values are `low`, `medium`, or `high`. None - - Organization - - Specifies Organization ID which used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` - - string - - string - - - None - - - AsBatch - - If this is specified, this cmdlet returns an object for Batch input -It does not perform an API request to OpenAI. It is useful with `Start-Batch` cmdlet. - - - SwitchParameter - - - False - - CustomBatchId + TimeoutSec - A unique id that will be used to match outputs to inputs of batch. Must be unique for each request in a batch. -This parameter is valid only when the `-AsBatch` swicth is used. + Specifies how long the request can be pending before it times out. +The default value is `0` (infinite). - String + Int32 - String + Int32 - None + 0 TimeoutSec - Specifies the timeout in seconds for each HTTP attempt, including reading the response body or stream. Retry delays are excluded. + Specifies how long the request can be pending before it times out. The default value is `0` (infinite). Int32 @@ -21072,14 +23867,15 @@ If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_AP None - - History + + Organization - An object for keeping the conversation history. + Specifies Organization ID which used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` - Object[] + string - Object[] + string None @@ -21087,10 +23883,10 @@ If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_AP - - Message + + FileId - A text input to the model. + The ID of the file to use for this request. String @@ -21100,84 +23896,161 @@ If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_AP None - Role + TimeoutSec - The role of the message input. One of `user`, `system`, or `developer`. The default is `user`. + Specifies how long the request can be pending before it times out. +The default value is `0` (infinite). - String + Int32 - String + Int32 - None + 0 - - Model + + TimeoutSec - The name of model to use. -The default value is `gpt-4o-mini`. + Specifies how long the request can be pending before it times out. +The default value is `0` (infinite). - String + Int32 - String + Int32 - gpt-4o-mini + 0 - SystemMessage + MaxRetryCount - (Instead of this parameter, the use of the `-Instructions` parameter is recommended.) -Instructions that the model should follow. + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). +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. + - String[] + Int32 - String[] + Int32 - None + 0 - DeveloperMessage + ApiBase - (Instead of this parameter, the use of the `-Instructions` parameter is recommended.) -Instructions that the model should follow. + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` - String[] + System.Uri - String[] + System.Uri - None + https://api.openai.com/v1 - Instructions + ApiKey - A system (or developer) message inserted into the model's context. + Specifies API key for authentication. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` - String + Object - String + Object None - - Conversation + + Organization - The conversation that this response belongs to. Input items and output items from this response are automatically added to this conversation after this response completes. + Specifies Organization ID which used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` - String + string - String + string None - - PreviousResponseId + + + + + + + + + + + -------------------------- Example 1 -------------------------- + PS C:\> Remove-OpenAIFile -FileId 'file-abc123' + + Remove a file that has the ID `file-abc123` + + + + + + Online Version: + https://github.com/mkht/PSOpenAI/blob/main/Docs/Remove-OpenAIFile.md + + + https://developers.openai.com/api/reference/resources/files/methods/delete/ + https://developers.openai.com/api/reference/resources/files/methods/delete/ + + + + + + Remove-RealtimeSessionItem + Remove + RealtimeSessionItem + + Remove an item from the conversation history. + + + + Remove an item from the conversation history. + + + + Remove-RealtimeSessionItem + + ItemId + + The ID of the item to delete. + + String + + String + + + None + + + EventId + + Optional client-generated ID used to identify this event. + + String + + String + + + None + + + + + + ItemId - The unique ID of the previous response to the model. Use this to create multi-turn conversations. + The ID of the item to delete. String @@ -21187,9 +24060,9 @@ Instructions that the model should follow. None - PromptId + EventId - The unique identifier of the prompt template to use. + Optional client-generated ID used to identify this event. String @@ -21198,169 +24071,591 @@ Instructions that the model should follow. None - - PromptVariables + + + + + + + + + + + -------------------------- Example 1 -------------------------- + PS C:\> Remove-RealtimeSessionItem -ItemId 'msg_001' + + + + + + + + Online Version: + https://github.com/mkht/PSOpenAI/blob/main/Docs/Remove-RealtimeSessionItem.md + + + https://developers.openai.com/api/docs/guides/realtime-conversations/ + https://developers.openai.com/api/docs/guides/realtime-conversations/ + + + + + + Remove-Response + Remove + Response + + Deletes a model response with the given ID. + + + + Deletes a model response with the given ID. + + + + Remove-Response + + ResponseId + + The ID of the response to delete. + + String + + String + + + None + + + TimeoutSec + + Specifies how long the request can be pending before it times out. +The default value is `0` (infinite). + + Int32 + + Int32 + + + 0 + + + TimeoutSec + + Specifies how long the request can be pending before it times out. +The default value is `0` (infinite). + + Int32 + + Int32 + + + 0 + + + MaxRetryCount + + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). +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. + + + Int32 + + Int32 + + + 0 + + + ApiBase + + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` + + System.Uri + + System.Uri + + + https://api.openai.com/v1 + + + ApiKey + + Specifies API key for authentication. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + + Object + + Object + + + None + + + Organization + + Specifies Organization ID which used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + + string + + string + + + None + + + + + + ResponseId - Optional map of values to substitute in for variables in your prompt. + The ID of the response to delete. - IDictionary + String - IDictionary + String None - PromptVersion + TimeoutSec - Optional version of the prompt template. + Specifies how long the request can be pending before it times out. +The default value is `0` (infinite). - String + Int32 - String + Int32 - None + 0 - Images + TimeoutSec - A list of images to passing the model. You can specify local image file or remote url. - + Specifies how long the request can be pending before it times out. +The default value is `0` (infinite). - String[] + Int32 - String[] + Int32 - None + 0 - ImageDetail + MaxRetryCount - Controls how the model processes the image and generates its textual understanding. You can select from `Low` or `High`. + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). +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. - String + Int32 - String + Int32 - auto + 0 - Files + ApiBase - A file input to the model. -You can speciy a list of the local file path, the URL of the file or the ID of the file to be uploaded. + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` - String[] + System.Uri - String[] + System.Uri - None + https://api.openai.com/v1 - - ToolChoice + + ApiKey - How the model should select which tool (or tools) to use when generating a response. + Specifies API key for authentication. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` - String + Object - String + Object None - - MaxToolCalls + + Organization - The maximum number of total calls to built-in tools that can be processed in a response. + Specifies Organization ID which used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` - Int32 + string - Int32 + string None - - ParallelToolCalls + + + + + + + + + + + -------------------------- Example 1 -------------------------- + PS C:\> Remove-Response -ResponseId 'resp_abc123' + + Remove a response has the ID `resp_abc123` + + + + + + Online Version: + https://github.com/mkht/PSOpenAI/blob/main/Docs/Remove-Response.md + + + https://developers.openai.com/api/reference/resources/responses/methods/delete/ + https://developers.openai.com/api/reference/resources/responses/methods/delete/ + + + + + + Remove-VectorStore + Remove + VectorStore + + Delete a vector store. + + + + Delete a vector store. + + + + Remove-VectorStore + + VectorStoreId + + The ID of the vector store to delete. + + String + + String + + + None + + + TimeoutSec + + Specifies how long the request can be pending before it times out. +The default value is `0` (infinite). + + Int32 + + Int32 + + + 0 + + + MaxRetryCount + + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). +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. + + + Int32 + + Int32 + + + 0 + + + ApiBase + + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` + + System.Uri + + System.Uri + + + https://api.openai.com/v1 + + + ApiKey + + Specifies API key for authentication. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + + Object + + Object + + + None + + + Organization + + Specifies Organization ID which used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + + string + + string + + + None + + + + + + VectorStoreId - Whether to allow the model to run tool calls in parallel. + The ID of the vector store to delete. - Boolean + String - Boolean + String None - Functions + TimeoutSec - A list of functions the model may call. + Specifies how long the request can be pending before it times out. +The default value is `0` (infinite). - IDictionary[] + Int32 - IDictionary[] + Int32 - None + 0 - CustomTools + MaxRetryCount - A list of custom tools the model may call. + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). +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. + - IDictionary[] + Int32 - IDictionary[] + Int32 - None + 0 - UseFileSearchTool + ApiBase - If you want to use the File search built-in tool, Should specify this switch as enabled. + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` - SwitchParameter + System.Uri - SwitchParameter + System.Uri - False + https://api.openai.com/v1 - FileSearchVectorStoreIds + ApiKey - The IDs of the vector stores to search. + Specifies API key for authentication. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` - String[] + Object - String[] + Object None - - FileSearchMaxNumberOfResults + + Organization - The maximum number of results to return. + Specifies Organization ID which used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` - Int32 + string - Int32 + string None - - FileSearchRanker + + + + + + + + + + + -------------------------- Example 1 -------------------------- + PS C:\> Remove-VectorStore 'vs_abc123' + + Delete a vector store with ID `vs_abc123`. + + + + + + Online Version: + https://github.com/mkht/PSOpenAI/blob/main/Docs/Remove-VectorStore.md + + + https://developers.openai.com/api/reference/resources/vector_stores/methods/delete/ + https://developers.openai.com/api/reference/resources/vector_stores/methods/delete/ + + + + + + Remove-VectorStoreFile + Remove + VectorStoreFile + + Delete a vector store file. + + + + Delete a vector store file. This will remove the file from the vector store but the file itself will not be deleted. To delete the file, use `Remove-OpenAIFile`. + + + + Remove-VectorStoreFile + + VectorStoreId + + The ID of the vector store that the file belongs to. + + String + + String + + + None + + + FileId + + The ID of the file being removed. + + String + + String + + + None + + + TimeoutSec + + Specifies how long the request can be pending before it times out. +The default value is `0` (infinite). + + Int32 + + Int32 + + + 0 + + + MaxRetryCount + + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). +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. + + + Int32 + + Int32 + + + 0 + + + ApiBase + + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` + + System.Uri + + System.Uri + + + https://api.openai.com/v1 + + + ApiKey + + Specifies API key for authentication. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + + Object + + Object + + + None + + + Organization + + Specifies Organization ID which used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + + string + + string + + + None + + + + + + VectorStoreId - The ranker to use for the file search. + The ID of the vector store that the file belongs to. String @@ -21369,155 +24664,209 @@ You can speciy a list of the local file path, the URL of the file or the ID of t None - - FileSearchScoreThreshold - - 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. - - Float - - Float - - - None - - - FileSearchHybridSearchEmbeddingWeight - - The weight of the embedding in the reciprocal ranking fusion. - - Float - - Float - - - None - - - FileSearchHybridSearchTextWeight + + FileId - The weight of the text in the reciprocal ranking fusion. + The ID of the file being removed. - Float + String - Float + String None - UseWebSearchTool + TimeoutSec - If you want to use the Web search built-in tool, Should specify this switch as enabled. + Specifies how long the request can be pending before it times out. +The default value is `0` (infinite). - SwitchParameter + Int32 - SwitchParameter + Int32 - False + 0 - WebSearchType + MaxRetryCount - The type of the web search tool. + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). +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. + - String + Int32 - String + Int32 - None + 0 - WebSearchContextSize + ApiBase - High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default. + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` - String + System.Uri - String + System.Uri - medium + https://api.openai.com/v1 - WebSearchAllowedDomains + ApiKey - Allowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well. + Specifies API key for authentication. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` - String[] + Object - String[] + Object None - - WebSearchUserLocationCity + + Organization - Free text input for the city of the user, e.g. `San Francisco`. + Specifies Organization ID which used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` - String + string - String + string None - - WebSearchUserLocationCountry - - The two-letter ISO country code of the user, e.g. `US`. - - String - - String - - - None - - - WebSearchUserLocationRegion - - Free text input for the region of the user, e.g. `California`. - - String - - String - - - None - - - WebSearchUserLocationTimeZone - - The IANA timezone of the user, e.g. `America/Los_Angeles`. - - String - - String - - - None - - - UseComputerUseTool - - If you want to use the Computer-use built-in tool, Should specify this switch as enabled. - - SwitchParameter - - SwitchParameter - - - False - - - ComputerUseEnvironment + + + + + + + + + + + -------------------------- Example 1 -------------------------- + PS C:\> Remove-VectorStoreFile -VectorStoreId 'vs_abc123' -FileId 'file-abc123' + + Deletes a file with ID `file-abc123` from the vector store with ID `vs_ab123` + + + + + + Online Version: + https://github.com/mkht/PSOpenAI/blob/main/Docs/Remove-VectorStoreFile.md + + + https://developers.openai.com/api/reference/resources/vector_stores/subresources/files/methods/delete/ + https://developers.openai.com/api/reference/resources/vector_stores/subresources/files/methods/delete/ + + + + + + Remove-Video + Remove + Video + + Deletes a video generation job. + + + + Deletes a video job that was previously created. Use this to clean up jobs that you no longer need. + + + + Remove-Video + + VideoId + + The identifier of the video to delete. + + String + + String + + + None + + + TimeoutSec + + Specifies how long the request can be pending before it times out. The default value is `0` (infinite). + + Int32 + + Int32 + + + 0 + + + MaxRetryCount + + Number between `0` and `100`. Specifies the maximum number of retries if the request fails. The default value is `0` (No retry). 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. + + Int32 + + Int32 + + + 0 + + + ApiBase + + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` If not specified, it will use `https://api.openai.com/v1` + + System.Uri + + System.Uri + + + https://api.openai.com/v1 + + + ApiKey + + Specifies API key for authentication. The type of data should `[string]` or `[securestring]`. If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + + Object + + Object + + + None + + + Organization + + Specifies Organization ID which used for an API request. If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + + string + + string + + + None + + + + + + VideoId - The type of computer environment to control. -Possible values: `browser`, `mac`, `windows`, `ubuntu`. + The identifier of the video to delete. String @@ -21527,93 +24876,45 @@ Possible values: `browser`, `mac`, `windows`, `ubuntu`. None - ComputerUseDisplayHeight + TimeoutSec - The height of the computer display. + Specifies how long the request can be pending before it times out. The default value is `0` (infinite). Int32 Int32 - None + 0 - ComputerUseDisplayWidth + MaxRetryCount - The width of the computer display. + Number between `0` and `100`. Specifies the maximum number of retries if the request fails. The default value is `0` (No retry). 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. Int32 Int32 - None - - - UseRemoteMCPTool - - If you want to use the Remote MCP built-in tool, Should specify this switch as enabled. - - SwitchParameter - - SwitchParameter - - - False - - - RemoteMCPServerLabel - - A label for this MCP server, used to identify it in tool calls. - - String - - String - - - None - - - RemoteMCPServerUrl - - The URL for the MCP server. - - String - - String - - - None - - - RemoteMCPServerDescription - - Optional description of the MCP server, used to provide more context. - - String - - String - - - None + 0 - RemoteMCPAllowedTools + ApiBase - List of allowed tool names or a filter object. + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` If not specified, it will use `https://api.openai.com/v1` - Object + System.Uri - Object + System.Uri - None + https://api.openai.com/v1 - RemoteMCPRequireApproval + ApiKey - Specify which of the MCP server's tools require approval. When you want to specify a single approval policy for all tools. One of `always` or `never`. + Specifies API key for authentication. The type of data should `[string]` or `[securestring]`. If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` Object @@ -21622,78 +24923,264 @@ Possible values: `browser`, `mac`, `windows`, `ubuntu`. None - - RemoteMCPHeaders + + Organization - Optional HTTP headers to send to the MCP server. Use for authentication or other purposes. + Specifies Organization ID which used for an API request. If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` - IDictionary + string - IDictionary + string None - - RemoteMCPAuthorization - - An OAuth access token that can be used with a remote MCP server. - - String - - String - - - None - - - UseConnectorTool + + + + + + + + + + + -------------------------- Example 1 -------------------------- + PS C:\> Remove-Video -VideoId 'video_68ea' + + Deletes the specified video job. + + + + + + Online Version: + https://github.com/mkht/PSOpenAI/blob/main/Docs/Remove-Video.md + + + https://developers.openai.com/api/reference/resources/videos/methods/delete/ + https://developers.openai.com/api/reference/resources/videos/methods/delete/ + + + + + + Request-AudioSpeech + Request + AudioSpeech + + Generates audio from the input text. + + + + Generates audio from the input text. +https://developers.openai.com/api/docs/guides/text-to-speech/ + + + + Request-AudioSpeech + + Text + + (Required) +The text to generate audio for. The maximum length is 4096 characters. + + String + + String + + + None + + + Model + + One of the available TTS models: `tts-1`, `tts-1-hd` or `gpt-4o-mini-tts`. +The default value is `tts-1`. + + String + + String + + + tts-1 + + + Voice + + The voice to use when generating the audio. Supported voices are `alloy`, `ash`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage` and `shimmer`. +The default value is `alloy`. + + String + + String + + + alloy + + + Instructions + + Control the voice of your generated audio with additional instructions. Does not work with `tts-1` or `tts-1-hd`. + + String + + String + + + None + + + ResponseFormat + + The format of audio. Supported formats are `mp3`, `opus`, `aac`, `flac`, `wav`, and `pcm` + + String + + String + + + None + + + OutFile + + (Required) +The path of the file to save. + + String + + String + + + None + + + Speed + + The speed of the generated audio. Select a value from `0.25` to `4.0`. `1.0` is the default. + + Double + + Double + + + 1.0 + + + TimeoutSec + + Specifies how long the request can be pending before it times out. +The default value is `0` (infinite). + + Int32 + + Int32 + + + 0 + + + MaxRetryCount + + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. The default value is `0` (No retry). +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. + + + Int32 + + Int32 + + + 0 + + + ApiBase + + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` + + System.Uri + + System.Uri + + + https://api.openai.com/v1 + + + ApiKey + + Specifies API key for authentication. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + + Object + + Object + + + None + + + Organization + + Specifies Organization ID which used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + + string + + string + + + None + + + + + + Text - If you want to use the service connector, Should specify this switch as enabled. + (Required) +The text to generate audio for. The maximum length is 4096 characters. - SwitchParameter + String - SwitchParameter + String - False + None - ConnectorLabel + Model - A label for this connector, used to identify it in tool calls. + One of the available TTS models: `tts-1`, `tts-1-hd` or `gpt-4o-mini-tts`. +The default value is `tts-1`. String String - None + tts-1 - ConnectorId + Voice - The ID of the connector. Supported connector id values are: -- Dropbox: `connector_dropbox` - - Gmail: `connector_gmail` - - Google Calendar: `connector_googlecalendar` - - Google Drive: `connector_googledrive` - - Microsoft Teams: `connector_microsoftteams` - - Outlook Calendar: `connector_outlookcalendar` - - Outlook Email: `connector_outlookemail` - - SharePoint: `connector_sharepoint` + The voice to use when generating the audio. Supported voices are `alloy`, `ash`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage` and `shimmer`. +The default value is `alloy`. String String - None + alloy - - ConnectorRequireApproval + + Instructions - Specify whether the connector requires approval. One of `always` or `never`. + Control the voice of your generated audio with additional instructions. Does not work with `tts-1` or `tts-1-hd`. String @@ -21702,10 +25189,10 @@ Possible values: `browser`, `mac`, `windows`, `ubuntu`. None - - ConnectorAuthorization + + ResponseFormat - An OAuth access token that can be used with a service connector. + The format of audio. Supported formats are `mp3`, `opus`, `aac`, `flac`, `wav`, and `pcm` String @@ -21714,106 +25201,11 @@ Possible values: `browser`, `mac`, `windows`, `ubuntu`. None - - UseCodeInterpreterTool + + OutFile - If you want to use the Code Interpreter built-in tool, Should specify this switch as enabled. - - SwitchParameter - - SwitchParameter - - - False - - - CodeInterpreterMemoryLimit - - {{No description provided}} - - String - - String - - - None - - - ContainerId - - The code interpreter container. Can be a container ID or `auto` to use the default container. - - String - - String - - - auto - - - ContainerFileIds - - An optional list of uploaded files to make available to your code. - - String[] - - String[] - - - None - - - UseImageGenerationTool - - If you want to use the Imagae Generation built-in tool, Should specify this switch as enabled. - - SwitchParameter - - SwitchParameter - - - False - - - ImageGenerationModel - - The image generation model to use. Default: `gpt-image-1`. - - String - - String - - - None - - - ImageGenerationAction - - Whether to generate a new image or edit an existing image. Default: `auto`. - - String - - String - - - auto - - - ImageGenerationBackGround - - Background type for the generated image. One of `transparent`, `opaque`, or `auto` - - String - - String - - - auto - - - ImageGenerationInputImageMask - - Optional mask for inpainting. Contains image_url (string, optional) and file_id (string, optional). + (Required) +The path of the file to save. String @@ -21823,306 +25215,10083 @@ Possible values: `browser`, `mac`, `windows`, `ubuntu`. None - ImageGenerationModeration + Speed - Moderation level for the generated image. Default: auto + The speed of the generated audio. Select a value from `0.25` to `4.0`. `1.0` is the default. - String + Double - String + Double - auto + 1.0 - ImageGenerationOutputCompression + TimeoutSec - Compression level for the output image. Default: 100. + Specifies how long the request can be pending before it times out. +The default value is `0` (infinite). Int32 Int32 - None - - - ImageGenerationOutputFormat - - The output format of the generated image. One of `png`, `webp`, or `jpeg`. - - String - - String - - - png + 0 - ImageGenerationPartialImages + MaxRetryCount - Number of partial images to generate in streaming mode, from 0 (default value) to 3. + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. The default value is `0` (No retry). +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. + Int32 Int32 - None - - - ImageGenerationQuality - - The quality of the generated image. One of `low`, `medium`, `high`, or `auto`. - - String - - String - - - auto - - - ImageGenerationSize - - The size of the generated image. One of `1024x1024`, `1024x1536`, `1536x1024`, or `auto`. Default: `auto`. - - String - - String - - - auto - - - UseLocalShellTool - - If you want to use the Local Shell built-in tool, Should specify this switch as enabled. - - SwitchParameter - - SwitchParameter - - - False - - - UseShellTool - - If you want to use the Shell built-in tool, Should specify this switch as enabled. - - SwitchParameter - - SwitchParameter - - - False - - - UseApplyPatchTool - - If you want to use the Apply Patch built-in tool, Should specify this switch as enabled. - - SwitchParameter - - SwitchParameter - - - False - - - Include - - Specify additional output data to include in the model response. - - String[] - - String[] - - - None + 0 - Truncation + ApiBase - The truncation strategy to use for the model response. `disabled` (default) or `auto`. + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` - String + System.Uri - String + System.Uri - disabled + https://api.openai.com/v1 - Temperature + ApiKey - What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random. + Specifies API key for authentication. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` - Float + Object - Float + Object None - - TopLogprobs + + Organization - An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. + Specifies Organization ID which used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` - Int32 + string - Int32 + string None - - TopP - - 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. - - Float + + + + - Float - + [string] - None - - - Store - Whether to store the generated model response for later retrieval via API. The default is `$true`. + - Boolean + + + + + + + + + + -------------- Example 1: Text-to-Speech (Basic) -------------- + Request-AudioSpeech -Text 'Hello.' -OutFile 'C:\sample\audio.mp3' + + + + + + ------------- Example 2: Text-to-Speech (Options) ------------- + Request-AudioSpeech ` + -Text 'The quick brown fox jumped over the lazy dog.' ` + -OutFile 'C:\sample\audio.aac' ` + -Model tts-1-hd ` + -Voice Onyx ` + -Speed 1.2 + + + + + + + + Online Version: + https://github.com/mkht/PSOpenAI/blob/main/Docs/Request-AudioSpeech.md + + + https://developers.openai.com/api/docs/guides/text-to-speech/ + https://developers.openai.com/api/docs/guides/text-to-speech/ + + + https://developers.openai.com/api/reference/resources/audio/subresources/speech/methods/create/ + https://developers.openai.com/api/reference/resources/audio/subresources/speech/methods/create/ + + + + + + Request-AudioTranscription + Request + AudioTranscription + + Transcribes audio into the input language. + + + + Transcribes audio into the input language. +https://developers.openai.com/api/docs/guides/speech-to-text/ + + + + Request-AudioTranscription + + File + + (Required) The audio file to transcribe, in one of these formats: `flac`, `mp3`, `mp4`, `mpeg`, `mpga`, `m4a`, `ogg`, `wav`, or `webm`. + + + String + + String + + + None + + + Model + + The name of model to use. The default value is `whisper-1`. + + String + + String + + + whisper-1 + + + Prompt + + An optional text to guide the model's style or continue a previous audio segment. +The prompt should match the audio language. + + String + + String + + + None + + + ResponseFormat + + The format of the transcript output, in one of these options: `json`, `text`, `srt`, `verbose_json`, `vtt` or `diarized_json`. +The default value is `text`. + + String + + String + + + text + + + Temperature + + The sampling temperature, between `0` and `1`. +Higher values like `0.8` will make the output more random, while lower values like `0.2` will make it more focused and deterministic. + + Double + + Double + + + None + + + Include + + Additional information to include in the transcription response. +`logprobs` only works with `-ResponseFormat` set to `json` and only with the models `gpt-4o-transcribe` and `gpt-4o-mini-transcribe` + + String[] + + String[] + + + None + + + KnownSpeakerNames + + Optional list of speaker names that correspond to the audio samples provided in `-KnownSpeakerReferences`. Each entry should be a short identifier (for example customer or agent). Up to 4 speakers are supported. + + String[] + + String[] + + + None + + + KnownSpeakerReferences + + Optional list of audio samples that contain known speaker references matching `-KnownSpeakerNames`. Each sample must be between 2 and 10 seconds, and can use any of the same input audio formats supported by file. + + String[] + + String[] + + + None + + + ChunkingStrategy + + Controls how the audio is cut into chunks. Options are: `auto`, `server_vad`. The default value is `auto`. + + String + + String + + + None + + + ChunkingStrategyThreshold + + Sensitivity threshold (0.0 to 1.0) for voice activity detection. + + Float + + Float + + + None + + + ChunkingStrategyPrefixPadding + + Amount of audio to include before the VAD detected speech (in milliseconds). + + UInt16 + + UInt16 + + + None + + + ChunkingStrategySilenceDuration + + Duration of silence to detect speech stop (in milliseconds). + + UInt16 + + UInt16 + + + None + + + TimestampGranularities + + The timestamp granularities to populate for this transcription. Any of these options: `word`, or `segment`. The default is `segment`. + + String[] + + String[] + + + None + + + Language + + The language of the input audio. +Supplying the input language in `ISO-639-1` format will improve accuracy and latency. + + String + + String + + + None + + + Stream + + If set to true, the model response data will be streamed. + + + SwitchParameter + + + False + + + StreamOutputType + + The format of the stream output, `text` or `object`. +The default value is `text`. This parameter is only used when `-Stream` is enabled. + + String + + String + + + text + + + TimeoutSec + + Specifies how long the request can be pending before it times out. +The default value is `0` (infinite). + + Int32 + + Int32 + + + 0 + + + MaxRetryCount + + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). +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. + + + Int32 + + Int32 + + + 0 + + + ApiBase + + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` + + System.Uri + + System.Uri + + + https://api.openai.com/v1 + + + ApiKey + + Specifies API key for authentication. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + + Object + + Object + + + None + + + Organization + + Specifies Organization ID which used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + + string + + string + + + None + + + + + + File + + (Required) The audio file to transcribe, in one of these formats: `flac`, `mp3`, `mp4`, `mpeg`, `mpga`, `m4a`, `ogg`, `wav`, or `webm`. + + + String + + String + + + None + + + Model + + The name of model to use. The default value is `whisper-1`. + + String + + String + + + whisper-1 + + + Prompt + + An optional text to guide the model's style or continue a previous audio segment. +The prompt should match the audio language. + + String + + String + + + None + + + ResponseFormat + + The format of the transcript output, in one of these options: `json`, `text`, `srt`, `verbose_json`, `vtt` or `diarized_json`. +The default value is `text`. + + String + + String + + + text + + + Temperature + + The sampling temperature, between `0` and `1`. +Higher values like `0.8` will make the output more random, while lower values like `0.2` will make it more focused and deterministic. + + Double + + Double + + + None + + + Include + + Additional information to include in the transcription response. +`logprobs` only works with `-ResponseFormat` set to `json` and only with the models `gpt-4o-transcribe` and `gpt-4o-mini-transcribe` + + String[] + + String[] + + + None + + + KnownSpeakerNames + + Optional list of speaker names that correspond to the audio samples provided in `-KnownSpeakerReferences`. Each entry should be a short identifier (for example customer or agent). Up to 4 speakers are supported. + + String[] + + String[] + + + None + + + KnownSpeakerReferences + + Optional list of audio samples that contain known speaker references matching `-KnownSpeakerNames`. Each sample must be between 2 and 10 seconds, and can use any of the same input audio formats supported by file. + + String[] + + String[] + + + None + + + ChunkingStrategy + + Controls how the audio is cut into chunks. Options are: `auto`, `server_vad`. The default value is `auto`. + + String + + String + + + None + + + ChunkingStrategyThreshold + + Sensitivity threshold (0.0 to 1.0) for voice activity detection. + + Float + + Float + + + None + + + ChunkingStrategyPrefixPadding + + Amount of audio to include before the VAD detected speech (in milliseconds). + + UInt16 + + UInt16 + + + None + + + ChunkingStrategySilenceDuration + + Duration of silence to detect speech stop (in milliseconds). + + UInt16 + + UInt16 + + + None + + + TimestampGranularities + + The timestamp granularities to populate for this transcription. Any of these options: `word`, or `segment`. The default is `segment`. + + String[] + + String[] + + + None + + + Language + + The language of the input audio. +Supplying the input language in `ISO-639-1` format will improve accuracy and latency. + + String + + String + + + None + + + Stream + + If set to true, the model response data will be streamed. + + SwitchParameter + + SwitchParameter + + + False + + + StreamOutputType + + The format of the stream output, `text` or `object`. +The default value is `text`. This parameter is only used when `-Stream` is enabled. + + String + + String + + + text + + + TimeoutSec + + Specifies how long the request can be pending before it times out. +The default value is `0` (infinite). + + Int32 + + Int32 + + + 0 + + + MaxRetryCount + + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). +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. + + + Int32 + + Int32 + + + 0 + + + ApiBase + + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` + + System.Uri + + System.Uri + + + https://api.openai.com/v1 + + + ApiKey + + Specifies API key for authentication. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + + Object + + Object + + + None + + + Organization + + Specifies Organization ID which used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + + string + + string + + + None + + + + + + + [string] + + + + + + + + + + + + + + ------------------- Example 1: Audio-to-Text ------------------- + PS C:\> Request-AudioTranscription -File C:\sample\audio.mp3 -ResponseFormat text + +Hello, I am david. + + + + + + ---------------- Example 2: Speaker diarization ---------------- + PS C:\> $JsonResult = Request-AudioTranscription -File C:\sample\meeting.mp3 -Model gpt-transcribe-diarize -ResponseFormat diarized_json +PS C:\> $JsonResult | ConvertFrom-Json + + + + + + + + Online Version: + https://github.com/mkht/PSOpenAI/blob/main/Docs/Request-AudioTranscription.md + + + https://developers.openai.com/api/docs/guides/speech-to-text/ + https://developers.openai.com/api/docs/guides/speech-to-text/ + + + https://developers.openai.com/api/reference/resources/audio/subresources/transcriptions/methods/create/ + https://developers.openai.com/api/reference/resources/audio/subresources/transcriptions/methods/create/ + + + + + + Request-AudioTranslation + Request + AudioTranslation + + Translates audio into English. + + + + Translates audio into English. +https://developers.openai.com/api/docs/guides/speech-to-text/ + + + + Request-AudioTranslation + + File + + (Required) The audio file to translate, in one of these formats: `flac`, `mp3`, `mp4`, `mpeg`, `mpga`, `m4a`, `ogg`, `wav`, or `webm`. + + + String + + String + + + None + + + Model + + The name of model to use. The default value is `whisper-1`. + + String + + String + + + whisper-1 + + + Prompt + + An optional text to guide the model's style or continue a previous audio segment. +The prompt should be in English. + + String + + String + + + None + + + ResponseFormat + + The format of the transcript output, in one of these options: `json`, `text`, `srt`, `verbose_json`, or `vtt`. +The default value is `text`. + + String + + String + + + text + + + Temperature + + The sampling temperature, between `0` and `1`. +Higher values like `0.8` will make the output more random, while lower values like `0.2` will make it more focused and deterministic. + + Double + + Double + + + None + + + TimeoutSec + + Specifies how long the request can be pending before it times out. +The default value is `0` (infinite). + + Int32 + + Int32 + + + 0 + + + MaxRetryCount + + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). +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. + + + Int32 + + Int32 + + + 0 + + + ApiBase + + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` + + System.Uri + + System.Uri + + + https://api.openai.com/v1 + + + ApiKey + + Specifies API key for authentication. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + + Object + + Object + + + None + + + Organization + + Specifies Organization ID which used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + + string + + string + + + None + + + + + + File + + (Required) The audio file to translate, in one of these formats: `flac`, `mp3`, `mp4`, `mpeg`, `mpga`, `m4a`, `ogg`, `wav`, or `webm`. + + + String + + String + + + None + + + Model + + The name of model to use. The default value is `whisper-1`. + + String + + String + + + whisper-1 + + + Prompt + + An optional text to guide the model's style or continue a previous audio segment. +The prompt should be in English. + + String + + String + + + None + + + ResponseFormat + + The format of the transcript output, in one of these options: `json`, `text`, `srt`, `verbose_json`, or `vtt`. +The default value is `text`. + + String + + String + + + text + + + Temperature + + The sampling temperature, between `0` and `1`. +Higher values like `0.8` will make the output more random, while lower values like `0.2` will make it more focused and deterministic. + + Double + + Double + + + None + + + TimeoutSec + + Specifies how long the request can be pending before it times out. +The default value is `0` (infinite). + + Int32 + + Int32 + + + 0 + + + MaxRetryCount + + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). +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. + + + Int32 + + Int32 + + + 0 + + + ApiBase + + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` + + System.Uri + + System.Uri + + + https://api.openai.com/v1 + + + ApiKey + + Specifies API key for authentication. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + + Object + + Object + + + None + + + Organization + + Specifies Organization ID which used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + + string + + string + + + None + + + + + + + [string] + + + + + + + + + + + + + + --------- Example 1: Japanese speech to English text. --------- + Request-AudioTranslation -File C:\sample\japanese.mp3 -ResponseFormat text + +Hello, My name is tanaka yoshio. + + + + + + + + Online Version: + https://github.com/mkht/PSOpenAI/blob/main/Docs/Request-AudioTranslation.md + + + https://developers.openai.com/api/docs/guides/speech-to-text/ + https://developers.openai.com/api/docs/guides/speech-to-text/ + + + https://developers.openai.com/api/reference/resources/audio/subresources/transcriptions/methods/create/ + https://developers.openai.com/api/reference/resources/audio/subresources/transcriptions/methods/create/ + + + + + + Request-ChatCompletion + Request + ChatCompletion + + Creates a completion for the chat message. + + + + Creates a completion for the chat message. +https://developers.openai.com/api/reference/chat-completions/overview/ + + + + Request-ChatCompletion + + Message + + The messages to generate chat completions. + + String + + String + + + None + + + Role + + The role of the messages author. One of `user`, `system`, `developer` or `function`. +The default is `user`. + + String + + String + + + None + + + Name + + The name of the author of this message. +This is an optional field, and may contain a-z, A-Z, 0-9, hyphens, and underscores, with a maximum length of 64 characters. + + String + + String + + + None + + + Model + + The name of model to use. The default value is `gpt-3.5-turbo`. + + String + + String + + + gpt-3.5-turbo + + + SystemMessage + + An optional text to set the behavior of the assistant. + + String[] + + String[] + + + None + + + DeveloperMessage + + Developer-provided instructions that the model should follow, regardless of messages sent by the user. With o1 models and newer, developer messages replace the previous system messages. + + String[] + + String[] + + + None + + + Modalities + + Output types that you would like the model to generate for this request. +Some models can generate both text and audio. To request that responses, you can specify: `("text", "audio")` + + String[] + + String[] + + + None + + + Voice + + The voice the model uses to respond. + + String + + String + + + None + + + InputAudio + + The path of the audio file to passing the model. Supported formats are `wav` and `mp3`. + + String + + String + + + None + + + InputAudioFormat + + Specifies the format of the input audio file. If not specified, the format is automatically determined from the file extension. + + String + + String + + + None + + + AudioOutFile + + Specifies where audio response from the model will be saved. If the model does not return a audio response, nothing is saved. + + String + + String + + + None + + + OutputAudioFormat + + Specifies the format of the output audio file. The default value is `mp3`. + + String + + String + + + None + + + Images + + An array of images to passing the model. You can specifies local image file or remote url. + + + String[] + + String[] + + + None + + + ImageDetail + + Controls how the model processes the image and generates its textual understanding. You can select from `Low` or `High`. +See more details : https://developers.openai.com/api/docs/guides/images-vision/ + + String + + String + + + Auto + + + Tools + + A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for. +https://github.com/mkht/PSOpenAI/blob/main/Guides/How_to_call_functions_with_ChatGPT.ipynb + + System.Collections.IDictionary[] + + System.Collections.IDictionary[] + + + None + + + ToolChoice + + Controls how the model responds to function calls. +- `none` means the model does not call a function, and responds to the end-user. +- `auto` means the model can pick between an end-user or calling a function. +Specifying a particular function via `@{type = "function"; function = @{name = "my_function"}}` forces the model to call that function. + + Object + + Object + + + None + + + ParallelToolCalls + + Whether to enable parallel function calling during tool use. The default is true (enabled) + + + SwitchParameter + + + True + + + InvokeTools + + Selects the action to be taken when the GPT model requests a function call. +- `None`: The requested function is not executed. This is the default. +- `Auto`: Automatically executes the requested function. +- `Confirm`: Displays a confirmation to the user before executing the requested function. + + String + + String + + + None + + + WebSearchContextSize + + High level guidance for the amount of context window space to use for the web search. One of `low`, `medium`, or `high` + + String + + String + + + None + + + WebSearchUserLocationCity + + Approximate location parameters for the web search. + + String + + String + + + None + + + WebSearchUserLocationCountry + + Approximate location parameters for the web search. + + String + + String + + + None + + + WebSearchUserLocationRegion + + Approximate location parameters for the web search. + + String + + String + + + None + + + WebSearchUserLocationTimeZone + + Approximate location parameters for the web search. + + String + + String + + + None + + + Prediction + + Static predicted output content, such as the content of a text file that is being regenerated. + + String + + String + + + None + + + 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. + + Double + + Double + + + None + + + TopP + + 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. + + Double + + Double + + + None + + + NumberOfAnswers + + How many chat completion choices to generate for each input message. +The default value is `1`. + + UInt16 + + UInt16 + + + 1 + + + Stream + + If set, partial message deltas will be sent, like in ChatGPT. + + + SwitchParameter + + + False + + + Store + + Whether or not to store the output of this chat completion request for use in model distillation or evals. + + + SwitchParameter + + + False + + + Verbosity + + Controls the verbosity level of the response. +Valid values are `low`, `medium`, or `high`. + + + String + + String + + + medium + + + ReasoningEffort + + Constrains effort on reasoning for reasoning models. Supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. +Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. + + String + + String + + + None + + + MetaData + + Developer-defined tags and values used for filtering completions in the dashboard. + + IDictionary + + IDictionary + + + None + + + StopSequence + + Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence. + + String[] + + String[] + + + None + + + MaxTokens + + This value is now deprecated in favor of MaxCompletionTokens. + + Int32 + + Int32 + + + None + + + MaxCompletionTokens + + An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. + + Int32 + + Int32 + + + None + + + PresencePenalty + + Number between `-2.0` and `2.0`. +Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics. + + Double + + Double + + + None + + + FrequencyPenalty + + Number between `-2.0` and `2.0`. +Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. + + Double + + Double + + + None + + + LogitBias + + Modify the likelihood of specified tokens appearing in the completion. +Accepts a maps of tokens to an associated bias value from `-100` to `100`. You can use `ConvertTo-Token` to convert text to token IDs. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between `-1` and `1` should decrease or increase likelihood of selection; values like `-100` or `100` should result in a ban or exclusive selection of the relevant token. +As an example, you can pass like so: `@{23182 = 20; 88847 = -100}` +ID 23182 maps to "apple" and ID 88847 maps to "banana". Thus, this example increases the likelihood of the word "apple" being included in the response from the AI and greatly reduces the likelihood of the word "banana" being included. + + IDictionary + + IDictionary + + + None + + + LogProbs + + Whether to return log probabilities of the output tokens or not. If true, returns the log probabilities of each output token returned in the `content` of `message`. + + Boolean + + Boolean + + + None + + + TopLogProbs + + An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. `logprobs` must be set to `true` if this parameter is used. + + UInt16 + + UInt16 + + + None + + + ResponseFormat + + Specifies the format that the model must output. +- `text` is default. +- `json_object` enables JSON mode, which ensures the message the model generates is valid JSON. +- `json_schema` enables Structured Outputs which ensures the model will match your supplied JSON schema. + - `raw_response` returns raw response content from API. + + Object + + Object + + + None + + + JsonSchema + + Specifies an object or data structure to represent the JSON Schema that the model should be constrained to follow. +Required if `json_schema` is specified for `-ResponseFormat`. Otherwise, it is ignored. + + String + + String + + + None + + + Seed + + If specified, the system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. + + Int64 + + Int64 + + + None + + + ServiceTier + + Specifies the latency tier to use for processing the request. This parameter is relevant for customers subscribed to the scale tier service. + + String + + String + + + None + + + PromptCacheKey + + Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. + + String + + String + + + None + + + PromptCacheRetention + + The retention policy for the prompt cache. Set to `24h` to enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. + + String + + String + + + None + + + SafetyIdentifier + + A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. The IDs should be a string that uniquely identifies each user. + + String + + String + + + None + + + User + + (deprecated) This field is being replaced by `SafetyIdentifier` and `PromptCacheKey`. + + String + + String + + + None + + + AsBatch + + If this is specified, this cmdlet returns an object for Batch input +It does not perform an API request to OpenAI. It is useful with `Start-Batch` cmdlet. + + + SwitchParameter + + + False + + + CustomBatchId + + A unique id that will be used to match outputs to inputs of batch. Must be unique for each request in a batch. +This parameter is valid only when the `-AsBatch` swicth is used. Otherwise, it is simply ignored. + + String + + String + + + None + + + TimeoutSec + + Specifies the timeout in seconds for each HTTP attempt, including reading the response body or stream. Retry delays are excluded. +The default value is `0` (infinite). + + Int32 + + Int32 + + + 0 + + + MaxRetryCount + + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). +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. + + + Int32 + + Int32 + + + 0 + + + ApiBase + + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` + + System.Uri + + System.Uri + + + https://api.openai.com/v1 + + + ApiKey + + Specifies API key for authentication. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + + Object + + Object + + + None + + + Organization + + Specifies Organization ID which used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + + string + + string + + + None + + + History + + An object for keeping the conversation history. + + Object[] + + Object[] + + + None + + + + + + Message + + The messages to generate chat completions. + + String + + String + + + None + + + Role + + The role of the messages author. One of `user`, `system`, `developer` or `function`. +The default is `user`. + + String + + String + + + None + + + Name + + The name of the author of this message. +This is an optional field, and may contain a-z, A-Z, 0-9, hyphens, and underscores, with a maximum length of 64 characters. + + String + + String + + + None + + + Model + + The name of model to use. The default value is `gpt-3.5-turbo`. + + String + + String + + + gpt-3.5-turbo + + + SystemMessage + + An optional text to set the behavior of the assistant. + + String[] + + String[] + + + None + + + DeveloperMessage + + Developer-provided instructions that the model should follow, regardless of messages sent by the user. With o1 models and newer, developer messages replace the previous system messages. + + String[] + + String[] + + + None + + + Modalities + + Output types that you would like the model to generate for this request. +Some models can generate both text and audio. To request that responses, you can specify: `("text", "audio")` + + String[] + + String[] + + + None + + + Voice + + The voice the model uses to respond. + + String + + String + + + None + + + InputAudio + + The path of the audio file to passing the model. Supported formats are `wav` and `mp3`. + + String + + String + + + None + + + InputAudioFormat + + Specifies the format of the input audio file. If not specified, the format is automatically determined from the file extension. + + String + + String + + + None + + + AudioOutFile + + Specifies where audio response from the model will be saved. If the model does not return a audio response, nothing is saved. + + String + + String + + + None + + + OutputAudioFormat + + Specifies the format of the output audio file. The default value is `mp3`. + + String + + String + + + None + + + Images + + An array of images to passing the model. You can specifies local image file or remote url. + + + String[] + + String[] + + + None + + + ImageDetail + + Controls how the model processes the image and generates its textual understanding. You can select from `Low` or `High`. +See more details : https://developers.openai.com/api/docs/guides/images-vision/ + + String + + String + + + Auto + + + Tools + + A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for. +https://github.com/mkht/PSOpenAI/blob/main/Guides/How_to_call_functions_with_ChatGPT.ipynb + + System.Collections.IDictionary[] + + System.Collections.IDictionary[] + + + None + + + ToolChoice + + Controls how the model responds to function calls. +- `none` means the model does not call a function, and responds to the end-user. +- `auto` means the model can pick between an end-user or calling a function. +Specifying a particular function via `@{type = "function"; function = @{name = "my_function"}}` forces the model to call that function. + + Object + + Object + + + None + + + ParallelToolCalls + + Whether to enable parallel function calling during tool use. The default is true (enabled) + + SwitchParameter + + SwitchParameter + + + True + + + InvokeTools + + Selects the action to be taken when the GPT model requests a function call. +- `None`: The requested function is not executed. This is the default. +- `Auto`: Automatically executes the requested function. +- `Confirm`: Displays a confirmation to the user before executing the requested function. + + String + + String + + + None + + + WebSearchContextSize + + High level guidance for the amount of context window space to use for the web search. One of `low`, `medium`, or `high` + + String + + String + + + None + + + WebSearchUserLocationCity + + Approximate location parameters for the web search. + + String + + String + + + None + + + WebSearchUserLocationCountry + + Approximate location parameters for the web search. + + String + + String + + + None + + + WebSearchUserLocationRegion + + Approximate location parameters for the web search. + + String + + String + + + None + + + WebSearchUserLocationTimeZone + + Approximate location parameters for the web search. + + String + + String + + + None + + + Prediction + + Static predicted output content, such as the content of a text file that is being regenerated. + + String + + String + + + None + + + 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. + + Double + + Double + + + None + + + TopP + + 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. + + Double + + Double + + + None + + + NumberOfAnswers + + How many chat completion choices to generate for each input message. +The default value is `1`. + + UInt16 + + UInt16 + + + 1 + + + Stream + + If set, partial message deltas will be sent, like in ChatGPT. + + SwitchParameter + + SwitchParameter + + + False + + + Store + + Whether or not to store the output of this chat completion request for use in model distillation or evals. + + SwitchParameter + + SwitchParameter + + + False + + + Verbosity + + Controls the verbosity level of the response. +Valid values are `low`, `medium`, or `high`. + + + String + + String + + + medium + + + ReasoningEffort + + Constrains effort on reasoning for reasoning models. Supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. +Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. + + String + + String + + + None + + + MetaData + + Developer-defined tags and values used for filtering completions in the dashboard. + + IDictionary + + IDictionary + + + None + + + StopSequence + + Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence. + + String[] + + String[] + + + None + + + MaxTokens + + This value is now deprecated in favor of MaxCompletionTokens. + + Int32 + + Int32 + + + None + + + MaxCompletionTokens + + An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. + + Int32 + + Int32 + + + None + + + PresencePenalty + + Number between `-2.0` and `2.0`. +Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics. + + Double + + Double + + + None + + + FrequencyPenalty + + Number between `-2.0` and `2.0`. +Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. + + Double + + Double + + + None + + + LogitBias + + Modify the likelihood of specified tokens appearing in the completion. +Accepts a maps of tokens to an associated bias value from `-100` to `100`. You can use `ConvertTo-Token` to convert text to token IDs. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between `-1` and `1` should decrease or increase likelihood of selection; values like `-100` or `100` should result in a ban or exclusive selection of the relevant token. +As an example, you can pass like so: `@{23182 = 20; 88847 = -100}` +ID 23182 maps to "apple" and ID 88847 maps to "banana". Thus, this example increases the likelihood of the word "apple" being included in the response from the AI and greatly reduces the likelihood of the word "banana" being included. + + IDictionary + + IDictionary + + + None + + + LogProbs + + Whether to return log probabilities of the output tokens or not. If true, returns the log probabilities of each output token returned in the `content` of `message`. + + Boolean + + Boolean + + + None + + + TopLogProbs + + An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. `logprobs` must be set to `true` if this parameter is used. + + UInt16 + + UInt16 + + + None + + + ResponseFormat + + Specifies the format that the model must output. +- `text` is default. +- `json_object` enables JSON mode, which ensures the message the model generates is valid JSON. +- `json_schema` enables Structured Outputs which ensures the model will match your supplied JSON schema. + - `raw_response` returns raw response content from API. + + Object + + Object + + + None + + + JsonSchema + + Specifies an object or data structure to represent the JSON Schema that the model should be constrained to follow. +Required if `json_schema` is specified for `-ResponseFormat`. Otherwise, it is ignored. + + String + + String + + + None + + + Seed + + If specified, the system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. + + Int64 + + Int64 + + + None + + + ServiceTier + + Specifies the latency tier to use for processing the request. This parameter is relevant for customers subscribed to the scale tier service. + + String + + String + + + None + + + PromptCacheKey + + Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. + + String + + String + + + None + + + PromptCacheRetention + + The retention policy for the prompt cache. Set to `24h` to enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. + + String + + String + + + None + + + SafetyIdentifier + + A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. The IDs should be a string that uniquely identifies each user. + + String + + String + + + None + + + User + + (deprecated) This field is being replaced by `SafetyIdentifier` and `PromptCacheKey`. + + String + + String + + + None + + + AsBatch + + If this is specified, this cmdlet returns an object for Batch input +It does not perform an API request to OpenAI. It is useful with `Start-Batch` cmdlet. + + SwitchParameter + + SwitchParameter + + + False + + + CustomBatchId + + A unique id that will be used to match outputs to inputs of batch. Must be unique for each request in a batch. +This parameter is valid only when the `-AsBatch` swicth is used. Otherwise, it is simply ignored. + + String + + String + + + None + + + TimeoutSec + + Specifies the timeout in seconds for each HTTP attempt, including reading the response body or stream. Retry delays are excluded. +The default value is `0` (infinite). + + Int32 + + Int32 + + + 0 + + + MaxRetryCount + + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). +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. + + + Int32 + + Int32 + + + 0 + + + ApiBase + + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` + + System.Uri + + System.Uri + + + https://api.openai.com/v1 + + + ApiKey + + Specifies API key for authentication. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + + Object + + Object + + + None + + + Organization + + Specifies Organization ID which used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + + string + + string + + + None + + + History + + An object for keeping the conversation history. + + Object[] + + Object[] + + + None + + + + + + + [pscustomobject] + + + + + + + + + + + + + + --- Example 1: Ask one question to ChatGPT, and get answer. --- + PS C:\> Request-ChatCompletion -Message "Who are you?" | select Answer + +I am an AI language model created by OpenAI, designed to assist with ... + + + + + + Example 2: Multiple questions with context preserved. (chats) + PS> $FirstQA = Request-ChatCompletion -Message "What is the population of the United States?" +PS> $FirstQA.Answer + +As of September 2021, the estimated population of the United States is around 331.4 million people. + +PS\> $SecondQA = $FirstQA | Request-ChatCompletion -Message "Translate the previous answer into French." +PS\> $SecondQA.Answer + +En septembre 2021, la population estimée des États-Unis est d'environ 331,4 millions de personnes. + + + + + + ---------------- Example 3: Stream completions. ---------------- + PS C:\> Request-ChatCompletion 'Please describe ChatGPT in 100 charactors.' -Stream | Write-Host -NoNewline + + ! stream (/Docs/images/StreamOutput.gif) + + + + ----------------- Example 4: Function calling ----------------- + PS C:\> $PingFunction = New-ChatCompletionFunction -Command 'Test-Connection' -IncludeParameters ('TargetName','Count') +PS C:\> $Message = 'Ping the Google Public DNS address three times and briefly report the results.' +PS C:\> $GPTPingAnswer = Request-ChatCompletion -Message $Message -Model gpt-4o -Tools $PingFunction -InvokeTools Auto +PS C:\> $GPTPingAnswer | select Answer + + + + + + --------------- Example 5: Image input (Vision) --------------- + PS C:\> Request-ChatCompletion -Message $Message -Model gpt-4o -Images "C:\image.png" + + + + + + --------------- Example 6: Audio input / output --------------- + PS C:\> Request-ChatCompletion -Modalities text, audio -InputAudio 'C:\hello.mp3' -AudioOutFile 'C:\response.mp3' -Model gpt-audio-1.5 + + + + + + + + Online Version: + https://github.com/mkht/PSOpenAI/blob/main/Docs/Request-ChatCompletion.md + + + https://developers.openai.com/api/reference/chat-completions/overview/ + https://developers.openai.com/api/reference/chat-completions/overview/ + + + https://developers.openai.com/api/reference/resources/chat/subresources/completions/methods/create/ + https://developers.openai.com/api/reference/resources/chat/subresources/completions/methods/create/ + + + + + + Request-ContentProvenanceCheck + Request + ContentProvenanceCheck + + Check an image or audio file for supported OpenAI provenance signals. + + + + Check an image or audio file for supported OpenAI provenance signals. + + + + Request-ContentProvenanceCheck + + File + + Path to the image or audio file to check. Relative paths and pipeline input are supported. + + String + + String + + + None + + + TimeoutSec + + Specifies how long the request can be pending before it times out. +The default value is `0` (infinite). + + Int32 + + Int32 + + + 0 + + + MaxRetryCount + + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). + + Int32 + + Int32 + + + 0 + + + ApiBase + + Specifies an API endpoint URL such as: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1`. + + System.Uri + + System.Uri + + + https://api.openai.com/v1 + + + ApiKey + + Specifies API key for authentication. +The type of data should be `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY`. + + SecureString + + SecureString + + + None + + + + + + File + + Path to the image or audio file to check. Relative paths and pipeline input are supported. + + String + + String + + + None + + + TimeoutSec + + Specifies how long the request can be pending before it times out. +The default value is `0` (infinite). + + Int32 + + Int32 + + + 0 + + + MaxRetryCount + + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). + + Int32 + + Int32 + + + 0 + + + ApiBase + + Specifies an API endpoint URL such as: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1`. + + System.Uri + + System.Uri + + + https://api.openai.com/v1 + + + ApiKey + + Specifies API key for authentication. +The type of data should be `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY`. + + SecureString + + SecureString + + + None + + + + + + System.String + + + + + + + + + + PSCustomObject + + + A PSOpenAI.ContentProvenanceCheck object containing created_at (local DateTime), object, and results. Nested result fields are preserved from the API. + + + + + + Uploads the file as multipart/form-data to POST /v1/content_provenance_checks. Image results include C2PA and SynthID; audio results include SynthID. + A not_detected outcome does not establish that the content is human-created. Signals may be missing or degraded, and other companies' models are not detected. + This endpoint is provided by OpenAI; Azure OpenAI is not supported. + + + + + -------------------------- Example 1 -------------------------- + PS C:\> Request-ContentProvenanceCheck -File 'C:\Images\sample.png' + + Returns the provenance check and its results. + + + + + + Online Version: + https://github.com/mkht/PSOpenAI/blob/main/Docs/Request-ContentProvenanceCheck.md + + + https://developers.openai.com/api/reference/resources/content_provenance_checks/methods/create/ + https://developers.openai.com/api/reference/resources/content_provenance_checks/methods/create/ + + + + + + Request-Embeddings + Request + Embeddings + + Creates an embedding vector representing the input text. + + + + Creates an embedding vector representing the input text. +https://developers.openai.com/api/docs/guides/embeddings/ + + + + Request-Embeddings + + Text + + (Required) Input text to get embeddings for + + String[] + + String[] + + + None + + + Model + + The name of model to use. The default value is `text-embedding-ada-002`. + + String + + String + + + text-embedding-ada-002 + + + EncodingFormat + + The format to return the embeddings in. Can be either `float` or `base64` The default value is `float`. + + String + + String + + + float + + + Dimensions + + The number of dimensions the resulting output embeddings should have. Only supported in `text-embedding-3` and later models. + + Int32 + + Int32 + + + None + + + User + + A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. + + String + + String + + + None + + + AsBatch + + If this is specified, this cmdlet returns an object for Batch input +It does not perform an API request to OpenAI. It is useful with `Start-Batch` cmdlet. + + + SwitchParameter + + + False + + + CustomBatchId + + A unique id that will be used to match outputs to inputs of batch. Must be unique for each request in a batch. +This parameter is valid only when the `-AsBatch` swicth is used. Otherwise, it is simply ignored. + + String + + String + + + None + + + TimeoutSec + + Specifies how long the request can be pending before it times out. The default value is `0` (infinite). + + Int32 + + Int32 + + + 0 + + + MaxRetryCount + + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). +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. + + + Int32 + + Int32 + + + 0 + + + ApiBase + + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` + + System.Uri + + System.Uri + + + https://api.openai.com/v1 + + + ApiKey + + Specifies API key for authentication. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + + Object + + Object + + + None + + + Organization + + Specifies Organization ID which used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + + string + + string + + + None + + + + + + Text + + (Required) Input text to get embeddings for + + String[] + + String[] + + + None + + + Model + + The name of model to use. The default value is `text-embedding-ada-002`. + + String + + String + + + text-embedding-ada-002 + + + EncodingFormat + + The format to return the embeddings in. Can be either `float` or `base64` The default value is `float`. + + String + + String + + + float + + + Dimensions + + The number of dimensions the resulting output embeddings should have. Only supported in `text-embedding-3` and later models. + + Int32 + + Int32 + + + None + + + User + + A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. + + String + + String + + + None + + + AsBatch + + If this is specified, this cmdlet returns an object for Batch input +It does not perform an API request to OpenAI. It is useful with `Start-Batch` cmdlet. + + SwitchParameter + + SwitchParameter + + + False + + + CustomBatchId + + A unique id that will be used to match outputs to inputs of batch. Must be unique for each request in a batch. +This parameter is valid only when the `-AsBatch` swicth is used. Otherwise, it is simply ignored. + + String + + String + + + None + + + TimeoutSec + + Specifies how long the request can be pending before it times out. The default value is `0` (infinite). + + Int32 + + Int32 + + + 0 + + + MaxRetryCount + + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). +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. + + + Int32 + + Int32 + + + 0 + + + ApiBase + + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` + + System.Uri + + System.Uri + + + https://api.openai.com/v1 + + + ApiKey + + Specifies API key for authentication. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + + Object + + Object + + + None + + + Organization + + Specifies Organization ID which used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + + string + + string + + + None + + + + + + + [pscustomobject] + + + + + + + + + + + + + + --- Example 1: Get a vector representation of a given input. --- + Request-Embeddings -Text 'Waiter, the food was delicious...' | select -ExpandProperty data + +object : embedding +index : 0 +embedding : {0.01004226, -0.01884855, 0.01824344, -0.01565562…} +Text : Waiter, the food was delicious... + + + + + + + + Online Version: + https://github.com/mkht/PSOpenAI/blob/main/Docs/Request-Embeddings.md + + + https://developers.openai.com/api/docs/guides/embeddings/ + https://developers.openai.com/api/docs/guides/embeddings/ + + + https://developers.openai.com/api/reference/resources/embeddings/ + https://developers.openai.com/api/reference/resources/embeddings/ + + + + + + Request-ImageEdit + Request + ImageEdit + + Creates an edited or extended image given an original image and a prompt. + + + + Creates an edited or extended image given an original image and a prompt. +https://developers.openai.com/api/reference/resources/images/methods/edit + + + + Request-ImageEdit + + + Request-ImageEdit + + + Request-ImageEdit + + Image + + (Required) The image(s) to edit. Must be a supported image file or an array of images. For the GPT image models, each image should be a `png`, `webp`, or `jpg` file less than 50MB. You can provide up to 16 images. + + String[] + + String[] + + + None + + + Prompt + + (Required) A text description of the desired image(s). The maximum length is 32000 characters for the GPT image models. + + String + + String + + + None + + + Mask + + An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where image should be edited. If there are multiple images provided, the mask will be applied on the first image. Must be a valid PNG file, less than 4MB, and have the same dimensions as image. + + String + + String + + + None + + + Model + + The model to use for image generation. Defaults to `gpt-image-2`. GPT Image 2.5 models include `gpt-image-2.5-sunburst`, `gpt-image-2.5-flare`, and their `2026-09-08` snapshots. + + String + + String + + + None + + + NumberOfImages + + The number of images to generate. Must be between 1 and 10. + + UInt16 + + UInt16 + + + 1 + + + Quality + + The quality of the image that will be generated. +- `auto` (default value) will automatically select the best quality for the given model. + - `max`, `xhigh`, `high`, `medium`, and `low` are accepted subject to model support. + + String + + String + + + auto + + + Size + + The size of the generated images. GPT Image 2 and GPT Image 2.5 accept arbitrary supported `WIDTHxHEIGHT` resolutions or `auto`. Older image models support their documented fixed sizes. + + String + + String + + + auto + + + Background + + Background behavior for generated image output. +Accepts one of the following: `transparent`, `opaque`, and `auto` (default). + + String + + String + + + auto + + + InputFidelity + + Controls fidelity to the original input image(s). This parameter is only supported for `gpt-image-1` and `gpt-image-2` and later models, unsupported for `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`. + + String + + String + + + low + + + OutputCompression + + The compression level (0-100%) for the generated images. This parameter is only supported for the GPT image models with the `webp` or `jpeg` output formats, and defaults to 100. + + UInt16 + + UInt16 + + + 100 + + + OutputFormat + + The format in which the generated images are returned. This parameter is only supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`. The default value is `png`. + + String + + String + + + png + + + ResponseFormat + + The format in which the generated images are returned. Must be one of `url`, `base64` or `byte`. This parameter is only supported for `dall-e-2`, as the GPT image models always return images in `base64` format. + + String + + String + + + base64 + + + OutputRawResponse + + If specifies this switch, an output of this function to be a raw response value from the API. (Normally JSON formatted string.) + + + SwitchParameter + + + False + + + Stream + + Edit the image in streaming mode. Defaults to `false`. + + + SwitchParameter + + + False + + + PartialImages + + The number of partial images to generate. This parameter is used for streaming responses that return partial images. Value must be between 0 and 3. When set to 0, the response will be a single image sent in one streaming event. + + UInt16 + + UInt16 + + + 0 + + + User + + A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. + + String + + String + + + None + + + TimeoutSec + + Specifies how long the request can be pending before it times out. The default value is `0` (infinite). + + Int32 + + Int32 + + + 0 + + + MaxRetryCount + + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). +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. + + + Int32 + + Int32 + + + 0 + + + ApiBase + + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` + + System.Uri + + System.Uri + + + https://api.openai.com/v1 + + + ApiKey + + Specifies API key for authentication. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + + Object + + Object + + + None + + + Organization + + Specifies Organization ID which used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + + string + + string + + + None + + + + Request-ImageEdit + + Image + + (Required) The image(s) to edit. Must be a supported image file or an array of images. For the GPT image models, each image should be a `png`, `webp`, or `jpg` file less than 50MB. You can provide up to 16 images. + + String[] + + String[] + + + None + + + Prompt + + (Required) A text description of the desired image(s). The maximum length is 32000 characters for the GPT image models. + + String + + String + + + None + + + Mask + + An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where image should be edited. If there are multiple images provided, the mask will be applied on the first image. Must be a valid PNG file, less than 4MB, and have the same dimensions as image. + + String + + String + + + None + + + Model + + The model to use for image generation. Defaults to `gpt-image-2`. GPT Image 2.5 models include `gpt-image-2.5-sunburst`, `gpt-image-2.5-flare`, and their `2026-09-08` snapshots. + + String + + String + + + None + + + NumberOfImages + + The number of images to generate. Must be between 1 and 10. + + UInt16 + + UInt16 + + + 1 + + + Quality + + The quality of the image that will be generated. +- `auto` (default value) will automatically select the best quality for the given model. + - `max`, `xhigh`, `high`, `medium`, and `low` are accepted subject to model support. + + String + + String + + + auto + + + Size + + The size of the generated images. GPT Image 2 and GPT Image 2.5 accept arbitrary supported `WIDTHxHEIGHT` resolutions or `auto`. Older image models support their documented fixed sizes. + + String + + String + + + auto + + + Background + + Background behavior for generated image output. +Accepts one of the following: `transparent`, `opaque`, and `auto` (default). + + String + + String + + + auto + + + InputFidelity + + Controls fidelity to the original input image(s). This parameter is only supported for `gpt-image-1` and `gpt-image-2` and later models, unsupported for `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`. + + String + + String + + + low + + + OutputCompression + + The compression level (0-100%) for the generated images. This parameter is only supported for the GPT image models with the `webp` or `jpeg` output formats, and defaults to 100. + + UInt16 + + UInt16 + + + 100 + + + OutputFormat + + The format in which the generated images are returned. This parameter is only supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`. The default value is `png`. + + String + + String + + + png + + + OutFile + + Specify the file path where the generated images will be saved. This cannot be specified with the `ResponseFormat` parameter. + + String + + String + + + None + + + Stream + + Edit the image in streaming mode. Defaults to `false`. + + + SwitchParameter + + + False + + + PartialImages + + The number of partial images to generate. This parameter is used for streaming responses that return partial images. Value must be between 0 and 3. When set to 0, the response will be a single image sent in one streaming event. + + UInt16 + + UInt16 + + + 0 + + + User + + A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. + + String + + String + + + None + + + TimeoutSec + + Specifies how long the request can be pending before it times out. The default value is `0` (infinite). + + Int32 + + Int32 + + + 0 + + + MaxRetryCount + + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). +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. + + + Int32 + + Int32 + + + 0 + + + ApiBase + + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` + + System.Uri + + System.Uri + + + https://api.openai.com/v1 + + + ApiKey + + Specifies API key for authentication. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + + Object + + Object + + + None + + + Organization + + Specifies Organization ID which used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + + string + + string + + + None + + + + + + Image + + (Required) The image(s) to edit. Must be a supported image file or an array of images. For the GPT image models, each image should be a `png`, `webp`, or `jpg` file less than 50MB. You can provide up to 16 images. + + String[] + + String[] + + + None + + + Prompt + + (Required) A text description of the desired image(s). The maximum length is 32000 characters for the GPT image models. + + String + + String + + + None + + + Mask + + An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where image should be edited. If there are multiple images provided, the mask will be applied on the first image. Must be a valid PNG file, less than 4MB, and have the same dimensions as image. + + String + + String + + + None + + + Model + + The model to use for image generation. Defaults to `gpt-image-2`. GPT Image 2.5 models include `gpt-image-2.5-sunburst`, `gpt-image-2.5-flare`, and their `2026-09-08` snapshots. + + String + + String + + + None + + + NumberOfImages + + The number of images to generate. Must be between 1 and 10. + + UInt16 + + UInt16 + + + 1 + + + Quality + + The quality of the image that will be generated. +- `auto` (default value) will automatically select the best quality for the given model. + - `max`, `xhigh`, `high`, `medium`, and `low` are accepted subject to model support. + + String + + String + + + auto + + + Size + + The size of the generated images. GPT Image 2 and GPT Image 2.5 accept arbitrary supported `WIDTHxHEIGHT` resolutions or `auto`. Older image models support their documented fixed sizes. + + String + + String + + + auto + + + Background + + Background behavior for generated image output. +Accepts one of the following: `transparent`, `opaque`, and `auto` (default). + + String + + String + + + auto + + + InputFidelity + + Controls fidelity to the original input image(s). This parameter is only supported for `gpt-image-1` and `gpt-image-2` and later models, unsupported for `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`. + + String + + String + + + low + + + OutputCompression + + The compression level (0-100%) for the generated images. This parameter is only supported for the GPT image models with the `webp` or `jpeg` output formats, and defaults to 100. + + UInt16 + + UInt16 + + + 100 + + + OutputFormat + + The format in which the generated images are returned. This parameter is only supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`. The default value is `png`. + + String + + String + + + png + + + ResponseFormat + + The format in which the generated images are returned. Must be one of `url`, `base64` or `byte`. This parameter is only supported for `dall-e-2`, as the GPT image models always return images in `base64` format. + + String + + String + + + base64 + + + OutputRawResponse + + If specifies this switch, an output of this function to be a raw response value from the API. (Normally JSON formatted string.) + + SwitchParameter + + SwitchParameter + + + False + + + OutFile + + Specify the file path where the generated images will be saved. This cannot be specified with the `ResponseFormat` parameter. + + String + + String + + + None + + + Stream + + Edit the image in streaming mode. Defaults to `false`. + + SwitchParameter + + SwitchParameter + + + False + + + PartialImages + + The number of partial images to generate. This parameter is used for streaming responses that return partial images. Value must be between 0 and 3. When set to 0, the response will be a single image sent in one streaming event. + + UInt16 + + UInt16 + + + 0 + + + User + + A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. + + String + + String + + + None + + + TimeoutSec + + Specifies how long the request can be pending before it times out. The default value is `0` (infinite). + + Int32 + + Int32 + + + 0 + + + MaxRetryCount + + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). +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. + + + Int32 + + Int32 + + + 0 + + + ApiBase + + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` + + System.Uri + + System.Uri + + + https://api.openai.com/v1 + + + ApiKey + + Specifies API key for authentication. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + + Object + + Object + + + None + + + Organization + + Specifies Organization ID which used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + + string + + string + + + None + + + + + + + + + + + + ----------- Example 1: Edit an image with a prompt. ----------- + Request-ImageEdit -Model 'gpt-image-2' -Prompt 'A bird on the desert' -Image 'C:\sand_with_fether.png' -OutFile 'C:\bird_on_desert.png' -Size 1024x1024 + + | Original | Generated | | ----------------------------------------------- | ------------------------------------------ | | ! original (/Docs/images/sand_with_feather.png) | ![edited](/Docs/images/bird_on_desert.png)| + + + + --- Example 2: Create variation image from source and mask. --- + Request-ImageEdit -Model 'gpt-image-2' -Image C:\sand_with_feather.png -Mask C:\fether_mask.png -Prompt "A bird on the desert" -OutFile C:\edit2.png + + | Source (sand_with_feather.png) | Mask (fether_mask.png) | Generated (edit2.png) | | --------------------------------------------- | ------------------------------------- | ----------------------------------- | | ! masked (/Docs/images/sand_with_feather.png) | ![mask](/Docs/images/fether_mask.png) | ![restored](/Docs/images/edit2.png)| + + + + + + Online Version: + https://github.com/mkht/PSOpenAI/blob/main/Docs/Request-ImageEdit.md + + + https://developers.openai.com/api/docs/guides/image-generation/ + https://developers.openai.com/api/docs/guides/image-generation/ + + + https://developers.openai.com/api/reference/resources/images/methods/edit + https://developers.openai.com/api/reference/resources/images/methods/edit + + + + + + Request-ImageGeneration + Request + ImageGeneration + + Creates an image given a prompt. + + + + Creates an image given a prompt. +https://developers.openai.com/api/reference/resources/images/methods/generate + + + + Request-ImageGeneration + + + Request-ImageGeneration + + + Request-ImageGeneration + + Prompt + + (Required) A text description of the desired image(s). The maximum length is 32000 characters for the GPT image models, 1000 characters for `dall-e-2` and 4000 characters for `dall-e-3`. + + String + + String + + + None + + + Model + + The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or a GPT image model. GPT Image 2.5 models include `gpt-image-2.5-sunburst`, `gpt-image-2.5-flare`, and their `2026-09-08` snapshots. Defaults to `dall-e-2` unless a parameter specific to the GPT image models is used. + + String + + String + + + dall-e-2 + + + NumberOfImages + + The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only `1` is supported. + + UInt16 + + UInt16 + + + 1 + + + Size + + The size of the generated images. GPT Image 2 and GPT Image 2.5 accept arbitrary supported `WIDTHxHEIGHT` resolutions or `auto`. Older image models support their documented fixed sizes. + + String + + String + + + auto + + + Quality + + The quality of the image that will be generated. +- `auto` (default value) will automatically select the best quality for the given model. + - `max`, `xhigh`, `high`, `medium`, and `low` are accepted subject to model support. + + String + + String + + + auto + + + Style + + The style of the generated images. Must be one of `vivid` or `natural`. Vivid causes the model to lean towards generating hyper-real and dramatic images. Natural causes the model to produce more natural, less hyper-real looking images. This param is only supported for `dall-e-3`. + + String + + String + + + vivid + + + Background + + Allows to set transparency for the background of the generated image(s). This parameter is only supported for the GPT image models. Must be one of `transparent`, `opaque` or `auto` (default value). When `auto` is used, the model will automatically determine the best background for the image. + + String + + String + + + None + + + Moderation + + Control the content-moderation level for images generated by the GPT image models. Must be either `low` for less restrictive filtering or `auto` (default value). + + String + + String + + + None + + + OutputCompression + + The compression level (0-100%) for the generated images. This parameter is only supported for the GPT image models with the `webp` or `jpeg` output formats, and defaults to 100. + + UInt16 + + UInt16 + + + None + + + OutputFormat + + The format in which the generated images are returned. This parameter is only supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`. + + String + + String + + + None + + + ResponseFormat + + The format in which the generated images are returned. Must be one of `url`, `base64` or `byte`. This parameter is only supported for `dall-e-2`, as the GPT image models always return images in `base64` format. + + String + + String + + + url + + + OutputRawResponse + + If specifies this switch, an output of this function to be a raw response value from the API. (Normally JSON formatted string.) + + + SwitchParameter + + + False + + + User + + A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. + + String + + String + + + None + + + TimeoutSec + + Specifies how long the request can be pending before it times out. The default value is `0` (infinite). + + Int32 + + Int32 + + + 0 + + + MaxRetryCount + + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). +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. + + + Int32 + + Int32 + + + 0 + + + ApiBase + + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` + + System.Uri + + System.Uri + + + https://api.openai.com/v1 + + + ApiKey + + Specifies API key for authentication. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + + Object + + Object + + + None + + + Organization + + Specifies Organization ID which used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + + string + + string + + + None + + + + Request-ImageGeneration + + Prompt + + (Required) A text description of the desired image(s). The maximum length is 32000 characters for the GPT image models, 1000 characters for `dall-e-2` and 4000 characters for `dall-e-3`. + + String + + String + + + None + + + Model + + The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or a GPT image model. GPT Image 2.5 models include `gpt-image-2.5-sunburst`, `gpt-image-2.5-flare`, and their `2026-09-08` snapshots. Defaults to `dall-e-2` unless a parameter specific to the GPT image models is used. + + String + + String + + + dall-e-2 + + + NumberOfImages + + The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only `1` is supported. + + UInt16 + + UInt16 + + + 1 + + + Size + + The size of the generated images. GPT Image 2 and GPT Image 2.5 accept arbitrary supported `WIDTHxHEIGHT` resolutions or `auto`. Older image models support their documented fixed sizes. + + String + + String + + + auto + + + Quality + + The quality of the image that will be generated. +- `auto` (default value) will automatically select the best quality for the given model. + - `max`, `xhigh`, `high`, `medium`, and `low` are accepted subject to model support. + + String + + String + + + auto + + + Style + + The style of the generated images. Must be one of `vivid` or `natural`. Vivid causes the model to lean towards generating hyper-real and dramatic images. Natural causes the model to produce more natural, less hyper-real looking images. This param is only supported for `dall-e-3`. + + String + + String + + + vivid + + + Background + + Allows to set transparency for the background of the generated image(s). This parameter is only supported for the GPT image models. Must be one of `transparent`, `opaque` or `auto` (default value). When `auto` is used, the model will automatically determine the best background for the image. + + String + + String + + + None + + + Moderation + + Control the content-moderation level for images generated by the GPT image models. Must be either `low` for less restrictive filtering or `auto` (default value). + + String + + String + + + None + + + OutputCompression + + The compression level (0-100%) for the generated images. This parameter is only supported for the GPT image models with the `webp` or `jpeg` output formats, and defaults to 100. + + UInt16 + + UInt16 + + + None + + + OutputFormat + + The format in which the generated images are returned. This parameter is only supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`. + + String + + String + + + None + + + OutFile + + Specify the file path where the generated images will be saved. This cannot be specified with the `ResponseFormat` parameter. + + String + + String + + + None + + + User + + A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. + + String + + String + + + None + + + TimeoutSec + + Specifies how long the request can be pending before it times out. The default value is `0` (infinite). + + Int32 + + Int32 + + + 0 + + + MaxRetryCount + + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). +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. + + + Int32 + + Int32 + + + 0 + + + ApiBase + + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` + + System.Uri + + System.Uri + + + https://api.openai.com/v1 + + + ApiKey + + Specifies API key for authentication. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + + Object + + Object + + + None + + + Organization + + Specifies Organization ID which used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + + string + + string + + + None + + + + + + Prompt + + (Required) A text description of the desired image(s). The maximum length is 32000 characters for the GPT image models, 1000 characters for `dall-e-2` and 4000 characters for `dall-e-3`. + + String + + String + + + None + + + Model + + The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or a GPT image model. GPT Image 2.5 models include `gpt-image-2.5-sunburst`, `gpt-image-2.5-flare`, and their `2026-09-08` snapshots. Defaults to `dall-e-2` unless a parameter specific to the GPT image models is used. + + String + + String + + + dall-e-2 + + + NumberOfImages + + The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only `1` is supported. + + UInt16 + + UInt16 + + + 1 + + + Size + + The size of the generated images. GPT Image 2 and GPT Image 2.5 accept arbitrary supported `WIDTHxHEIGHT` resolutions or `auto`. Older image models support their documented fixed sizes. + + String + + String + + + auto + + + Quality + + The quality of the image that will be generated. +- `auto` (default value) will automatically select the best quality for the given model. + - `max`, `xhigh`, `high`, `medium`, and `low` are accepted subject to model support. + + String + + String + + + auto + + + Style + + The style of the generated images. Must be one of `vivid` or `natural`. Vivid causes the model to lean towards generating hyper-real and dramatic images. Natural causes the model to produce more natural, less hyper-real looking images. This param is only supported for `dall-e-3`. + + String + + String + + + vivid + + + Background + + Allows to set transparency for the background of the generated image(s). This parameter is only supported for the GPT image models. Must be one of `transparent`, `opaque` or `auto` (default value). When `auto` is used, the model will automatically determine the best background for the image. + + String + + String + + + None + + + Moderation + + Control the content-moderation level for images generated by the GPT image models. Must be either `low` for less restrictive filtering or `auto` (default value). + + String + + String + + + None + + + OutputCompression + + The compression level (0-100%) for the generated images. This parameter is only supported for the GPT image models with the `webp` or `jpeg` output formats, and defaults to 100. + + UInt16 + + UInt16 + + + None + + + OutputFormat + + The format in which the generated images are returned. This parameter is only supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`. + + String + + String + + + None + + + ResponseFormat + + The format in which the generated images are returned. Must be one of `url`, `base64` or `byte`. This parameter is only supported for `dall-e-2`, as the GPT image models always return images in `base64` format. + + String + + String + + + url + + + OutputRawResponse + + If specifies this switch, an output of this function to be a raw response value from the API. (Normally JSON formatted string.) + + SwitchParameter + + SwitchParameter + + + False + + + OutFile + + Specify the file path where the generated images will be saved. This cannot be specified with the `ResponseFormat` parameter. + + String + + String + + + None + + + User + + A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. + + String + + String + + + None + + + TimeoutSec + + Specifies how long the request can be pending before it times out. The default value is `0` (infinite). + + Int32 + + Int32 + + + 0 + + + MaxRetryCount + + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). +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. + + + Int32 + + Int32 + + + 0 + + + ApiBase + + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` + + System.Uri + + System.Uri + + + https://api.openai.com/v1 + + + ApiKey + + Specifies API key for authentication. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + + Object + + Object + + + None + + + Organization + + Specifies Organization ID which used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + + string + + string + + + None + + + + + + + + + + + + ------ Example 1: Creates and save an image from prompt. ------ + Request-ImageGeneration -Model 'gpt-image-2' -Prompt 'A cute baby lion' -OutFile C:\babylion.png + + ! lion (/Docs/images/babylion.png) + + + + Example 2: Creates multiple images at once, and retrieve results by URL. + Request-ImageGeneration -Model 'dall-e-3' -Prompt 'Delicious ramen with gyoza' -Model -ResponseFormat 'url' -NumberOfImages 3 + +https://oaidalleapiprodscus.blob.core.windows.net/private/org-BXLtGIt0xglP9if8FVhkD... +https://oaidalleapiprodscus.blob.core.windows.net/private/org-BXLtGIt0xglP9if8FVhkD... +https://oaidalleapiprodscus.blob.core.windows.net/private/org-BXLtGIt0xglP9if8FVhkD... + + + + + + + + Online Version: + https://github.com/mkht/PSOpenAI/blob/main/Docs/Request-ImageGeneration.md + + + https://developers.openai.com/api/docs/guides/image-generation/ + https://developers.openai.com/api/docs/guides/image-generation/ + + + https://developers.openai.com/api/reference/resources/images/methods/generate + https://developers.openai.com/api/reference/resources/images/methods/generate + + + + + + Request-ImageVariation + Request + ImageVariation + + Creates a variation of a given image. + + + + Creates a variation of a given image. +https://developers.openai.com/api/docs/guides/image-generation/ + + + + Request-ImageVariation + + + Request-ImageVariation + + + Request-ImageVariation + + Image + + (Required) The image to use as the basis for the variation(s). +Must be a valid PNG file, less than 4MB, and square. + + String + + String + + + None + + + NumberOfImages + + The number of images to generate. +Must be between `1` and `10`. The default value is `1`. + + UInt16 + + UInt16 + + + 1 + + + Size + + The size of the generated images. +Must be one of `256x256`, `512x512`, or `1024x1024`. The default value is `1024x1024`. + + String + + String + + + 1024x1024 + + + ResponseFormat + + The format in which the generated images are returned. +Must be one of `url`, `base64` or `byte`. + + String + + String + + + url + + + User + + A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. + + String + + String + + + None + + + TimeoutSec + + Specifies how long the request can be pending before it times out. The default value is `0` (infinite). + + Int32 + + Int32 + + + 0 + + + MaxRetryCount + + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). +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. + + + Int32 + + Int32 + + + 0 + + + ApiBase + + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` + + System.Uri + + System.Uri + + + https://api.openai.com/v1 + + + ApiKey + + Specifies API key for authentication. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + + Object + + Object + + + None + + + Organization + + Specifies Organization ID which used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + + string + + string + + + None + + + + Request-ImageVariation + + Image + + (Required) The image to use as the basis for the variation(s). +Must be a valid PNG file, less than 4MB, and square. + + String + + String + + + None + + + NumberOfImages + + The number of images to generate. +Must be between `1` and `10`. The default value is `1`. + + UInt16 + + UInt16 + + + 1 + + + Size + + The size of the generated images. +Must be one of `256x256`, `512x512`, or `1024x1024`. The default value is `1024x1024`. + + String + + String + + + 1024x1024 + + + OutFile + + Specify the file path where the generated images will be saved. +This cannot be specified with the `Format` parameter. Also, `NumberOfImages` must be `1`. + + String + + String + + + None + + + User + + A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. + + String + + String + + + None + + + TimeoutSec + + Specifies how long the request can be pending before it times out. The default value is `0` (infinite). + + Int32 + + Int32 + + + 0 + + + MaxRetryCount + + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). +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. + + + Int32 + + Int32 + + + 0 + + + ApiBase + + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` + + System.Uri + + System.Uri + + + https://api.openai.com/v1 + + + ApiKey + + Specifies API key for authentication. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + + Object + + Object + + + None + + + Organization + + Specifies Organization ID which used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + + string + + string + + + None + + + + + + Image + + (Required) The image to use as the basis for the variation(s). +Must be a valid PNG file, less than 4MB, and square. + + String + + String + + + None + + + NumberOfImages + + The number of images to generate. +Must be between `1` and `10`. The default value is `1`. + + UInt16 + + UInt16 + + + 1 + + + Size + + The size of the generated images. +Must be one of `256x256`, `512x512`, or `1024x1024`. The default value is `1024x1024`. + + String + + String + + + 1024x1024 + + + ResponseFormat + + The format in which the generated images are returned. +Must be one of `url`, `base64` or `byte`. + + String + + String + + + url + + + OutFile + + Specify the file path where the generated images will be saved. +This cannot be specified with the `Format` parameter. Also, `NumberOfImages` must be `1`. + + String + + String + + + None + + + User + + A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. + + String + + String + + + None + + + TimeoutSec + + Specifies how long the request can be pending before it times out. The default value is `0` (infinite). + + Int32 + + Int32 + + + 0 + + + MaxRetryCount + + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). +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. + + + Int32 + + Int32 + + + 0 + + + ApiBase + + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` + + System.Uri + + System.Uri + + + https://api.openai.com/v1 + + + ApiKey + + Specifies API key for authentication. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + + Object + + Object + + + None + + + Organization + + Specifies Organization ID which used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + + string + + string + + + None + + + + + + + ResponseFormat = url : string or array of string + + + + + + + + ResponseFormat = base64 : Generated image data represented in base64 string. + + + + + + + + ResponseFormat = byte : Byte array of generated image. + + + + + + + + OutFile : Nothing. + + + + + + + + + + + + + + Example 1: Creates a variation of a given image, then save to file. + Request-ImageVariation -Image C:\cupcake.png -OutFile C:\cupcake2.png -Size 256x256 + + | Source (cupcake.png) | Generated (cupcake2.png) | | ----------------------------------- | ------------------------------------ | | ! source (/Docs/images/cupcake.png) | ![output](/Docs/images/cupcake2.png)| + + + + Example 2: Creates a variation of a given image, then output as base64 string. + Request-ImageVariation -Image C:\cupcake.png -ResponseFormat "base64" + +iVBORw0KGgoAAAANSUhEUgAABAAAAAQACAIAAADwf7zUAAAAaGV...... + + + + + + + + Online Version: + https://github.com/mkht/PSOpenAI/blob/main/Docs/Request-ImageVariation.md + + + https://developers.openai.com/api/docs/guides/image-generation/ + https://developers.openai.com/api/docs/guides/image-generation/ + + + https://developers.openai.com/api/reference/resources/images/methods/create_variation/ + https://developers.openai.com/api/reference/resources/images/methods/create_variation/ + + + + + + Request-Moderation + Request + Moderation + + Given a input text, outputs if the model classifies it as violating OpenAI's content policy. + + + + Given a input text, outputs if the model classifies it as violating OpenAI's content policy. +The moderation endpoint is free to use when monitoring the inputs and outputs of OpenAI APIs. +https://developers.openai.com/api/docs/guides/moderation/ + + + + Request-Moderation + + Text + + A string of text to classify for moderation. + + String[] + + String[] + + + None + + + Images + + An array of images to passing the model. You can specifies local image file or remote url. + + + String[] + + String[] + + + None + + + Model + + The content moderation model you would like to use. + + String + + String + + + None + + + TimeoutSec + + Specifies how long the request can be pending before it times out. The default value is `0` (infinite). + + Int32 + + Int32 + + + 0 + + + MaxRetryCount + + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). +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. + + + Int32 + + Int32 + + + 0 + + + ApiBase + + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` + + System.Uri + + System.Uri + + + https://api.openai.com/v1 + + + ApiKey + + Specifies API key for authentication. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + + Object + + Object + + + None + + + Organization + + Specifies Organization ID which used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + + string + + string + + + None + + + + + + Text + + A string of text to classify for moderation. + + String[] + + String[] + + + None + + + Images + + An array of images to passing the model. You can specifies local image file or remote url. + + + String[] + + String[] + + + None + + + Model + + The content moderation model you would like to use. + + String + + String + + + None + + + TimeoutSec + + Specifies how long the request can be pending before it times out. The default value is `0` (infinite). + + Int32 + + Int32 + + + 0 + + + MaxRetryCount + + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). +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. + + + Int32 + + Int32 + + + 0 + + + ApiBase + + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` + + System.Uri + + System.Uri + + + https://api.openai.com/v1 + + + ApiKey + + Specifies API key for authentication. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + + Object + + Object + + + None + + + Organization + + Specifies Organization ID which used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + + string + + string + + + None + + + + + + + [pscustomobject] + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + PS C:\> $Result = Request-Moderation -Text "I want to kill them." +PS C:\> $Result.results[0].categories + +sexual : False +hate : False +violence : True +self-harm : False +sexual/minors : False +hate/threatening : False +violence/graphic : False + + + + + + + + Online Version: + https://github.com/mkht/PSOpenAI/blob/main/Docs/Request-Moderation.md + + + https://developers.openai.com/api/docs/guides/moderation/ + https://developers.openai.com/api/docs/guides/moderation/ + + + https://developers.openai.com/api/reference/resources/moderations/ + https://developers.openai.com/api/reference/resources/moderations/ + + + + + + Request-RealtimeSessionResponse + Request + RealtimeSessionResponse + + Instruct the server to generate a response. + + + + Instruct the server to generate a response. When automatic turn detection by the server is enabled, this is usually not necessary. If turn detection is disabled, use this command to request a response from the server. + + + + Request-RealtimeSessionResponse + + EventId + + Optional client-generated ID used to identify this event. + + String + + String + + + None + + + Instructions + + Instructions for the model. + + String + + String + + + None + + + MaxOutputTokens + + Maximum number of output tokens for a single assistant response. Provide an integer between 1 and 4096 to limit output tokens, or -1 for no limitations. + + Int32 + + Int32 + + + -1 + + + OutputModalities + + The set of modalities the model can respond with. + + + text + audio + + String[] + + String[] + + + None + + + OutputAudioFormat + + The format of output audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. + + String + + String + + + None + + + Temperature + + Sampling temperature for the model, limited to [0.6, 1.2]. + + Single + + Single + + + None + + + Voice + + The voice the model uses to respond. + + String + + String + + + None + + + + + + EventId + + Optional client-generated ID used to identify this event. + + String + + String + + + None + + + Instructions + + Instructions for the model. + + String + + String + + + None + + + MaxOutputTokens + + Maximum number of output tokens for a single assistant response. Provide an integer between 1 and 4096 to limit output tokens, or -1 for no limitations. + + Int32 + + Int32 + + + -1 + + + OutputModalities + + The set of modalities the model can respond with. + + String[] + + String[] + + + None + + + OutputAudioFormat + + The format of output audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. + + String + + String + + + None + + + Temperature + + Sampling temperature for the model, limited to [0.6, 1.2]. + + Single + + Single + + + None + + + Voice + + The voice the model uses to respond. + + String + + String + + + None + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + PS C:\> Request-RealtimeSessionResponse + + + + + + + + Online Version: + https://github.com/mkht/PSOpenAI/blob/main/Docs/Request-RealtimeSessionResponse.md + + + https://developers.openai.com/api/docs/guides/realtime-conversations/ + https://developers.openai.com/api/docs/guides/realtime-conversations/ + + + + + + Request-Response + Request + Response + + Creates a model response. + + + + Creates a model response. Provide text or image inputs to generate text or JSON outputs. + + + + Request-Response + + Message + + A text input to the model. + + String + + String + + + None + + + Role + + The role of the message input. One of `user`, `system`, or `developer`. The default is `user`. + + String + + String + + + None + + + Model + + The name of model to use. +The default value is `gpt-4o-mini`. + + String + + String + + + gpt-4o-mini + + + SystemMessage + + (Instead of this parameter, the use of the `-Instructions` parameter is recommended.) +Instructions that the model should follow. + + String[] + + String[] + + + None + + + DeveloperMessage + + (Instead of this parameter, the use of the `-Instructions` parameter is recommended.) +Instructions that the model should follow. + + String[] + + String[] + + + None + + + Instructions + + A system (or developer) message inserted into the model's context. + + String + + String + + + None + + + Conversation + + The conversation that this response belongs to. Input items and output items from this response are automatically added to this conversation after this response completes. + + String + + String + + + None + + + PreviousResponseId + + The unique ID of the previous response to the model. Use this to create multi-turn conversations. + + String + + String + + + None + + + PromptId + + The unique identifier of the prompt template to use. + + String + + String + + + None + + + PromptVariables + + Optional map of values to substitute in for variables in your prompt. + + IDictionary + + IDictionary + + + None + + + PromptVersion + + Optional version of the prompt template. + + String + + String + + + None + + + Images + + A list of images to passing the model. You can specify local image file or remote url. + + + String[] + + String[] + + + None + + + ImageDetail + + Controls how the model processes the image and generates its textual understanding. You can select from `Low` or `High`. + + + + auto + low + high + + String + + String + + + auto + + + Files + + A file input to the model. +You can speciy a list of the local file path, the URL of the file or the ID of the file to be uploaded. + + String[] + + String[] + + + None + + + ToolChoice + + How the model should select which tool (or tools) to use when generating a response. + + String + + String + + + None + + + MaxToolCalls + + The maximum number of total calls to built-in tools that can be processed in a response. + + Int32 + + Int32 + + + None + + + ParallelToolCalls + + Whether to allow the model to run tool calls in parallel. + + Boolean + + Boolean + + + None + + + Functions + + A list of functions the model may call. + + IDictionary[] + + IDictionary[] + + + None + + + CustomTools + + A list of custom tools the model may call. + + IDictionary[] + + IDictionary[] + + + None + + + UseFileSearchTool + + If you want to use the File search built-in tool, Should specify this switch as enabled. + + + SwitchParameter + + + False + + + FileSearchVectorStoreIds + + The IDs of the vector stores to search. + + String[] + + String[] + + + None + + + FileSearchMaxNumberOfResults + + The maximum number of results to return. + + Int32 + + Int32 + + + None + + + FileSearchRanker + + The ranker to use for the file search. + + String + + String + + + None + + + FileSearchScoreThreshold + + 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. + + Float + + Float + + + None + + + FileSearchHybridSearchEmbeddingWeight + + The weight of the embedding in the reciprocal ranking fusion. + + Float + + Float + + + None + + + FileSearchHybridSearchTextWeight + + The weight of the text in the reciprocal ranking fusion. + + Float + + Float + + + None + + + UseWebSearchTool + + If you want to use the Web search built-in tool, Should specify this switch as enabled. + + + SwitchParameter + + + False + + + WebSearchType + + The type of the web search tool. + + String + + String + + + None + + + WebSearchContextSize + + High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default. + + + low + medium + high + + String + + String + + + medium + + + WebSearchAllowedDomains + + Allowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well. + + String[] + + String[] + + + None + + + WebSearchUserLocationCity + + Free text input for the city of the user, e.g. `San Francisco`. + + String + + String + + + None + + + WebSearchUserLocationCountry + + The two-letter ISO country code of the user, e.g. `US`. + + String + + String + + + None + + + WebSearchUserLocationRegion + + Free text input for the region of the user, e.g. `California`. + + String + + String + + + None + + + WebSearchUserLocationTimeZone + + The IANA timezone of the user, e.g. `America/Los_Angeles`. + + String + + String + + + None + + + UseComputerUseTool + + If you want to use the Computer-use built-in tool, Should specify this switch as enabled. + + + SwitchParameter + + + False + + + ComputerUseEnvironment + + The type of computer environment to control. +Possible values: `browser`, `mac`, `windows`, `ubuntu`. + + String + + String + + + None + + + ComputerUseDisplayHeight + + The height of the computer display. + + Int32 + + Int32 + + + None + + + ComputerUseDisplayWidth + + The width of the computer display. + + Int32 + + Int32 + + + None + + + UseRemoteMCPTool + + If you want to use the Remote MCP built-in tool, Should specify this switch as enabled. + + + SwitchParameter + + + False + + + RemoteMCPServerLabel + + A label for this MCP server, used to identify it in tool calls. + + String + + String + + + None + + + RemoteMCPServerUrl + + The URL for the MCP server. Specify either this parameter or `-RemoteMCPTunnelId`. + + String + + String + + + None + + + RemoteMCPTunnelId + + The ID of a secure MCP tunnel. Specify either this parameter or `-RemoteMCPServerUrl`. + + String + + String + + + None + + + RemoteMCPServerDescription + + Optional description of the MCP server, used to provide more context. + + String + + String + + + None + + + RemoteMCPAllowedTools + + List of allowed tool names or a filter object. + + Object + + Object + + + None + + + RemoteMCPRequireApproval + + Specify which of the MCP server's tools require approval. When you want to specify a single approval policy for all tools. One of `always` or `never`. + + Object + + Object + + + None + + + RemoteMCPHeaders + + Optional HTTP headers to send to the MCP server. Use for authentication or other purposes. + + IDictionary + + IDictionary + + + None + + + RemoteMCPAuthorization + + An OAuth access token that can be used with a remote MCP server. + + String + + String + + + None + + + UseConnectorTool + + If you want to use the service connector, Should specify this switch as enabled. + + + SwitchParameter + + + False + + + ConnectorLabel + + A label for this connector, used to identify it in tool calls. + + String + + String + + + None + + + ConnectorId + + Deprecated for models released after September 1, 2026. Use a remote MCP server URL or secure tunnel instead. The parameter remains available for compatibility with earlier models. + The supported connector ID values are: - Dropbox: `connector_dropbox` + - Gmail: `connector_gmail` + - Google Calendar: `connector_googlecalendar` + - Google Drive: `connector_googledrive` + - Microsoft Teams: `connector_microsoftteams` + - Outlook Calendar: `connector_outlookcalendar` + - Outlook Email: `connector_outlookemail` + - SharePoint: `connector_sharepoint` + + String + + String + + + None + + + ConnectorRequireApproval + + Specify whether the connector requires approval. One of `always` or `never`. + + String + + String + + + None + + + ConnectorAuthorization + + An OAuth access token that can be used with a service connector. + + String + + String + + + None + + + UseCodeInterpreterTool + + If you want to use the Code Interpreter built-in tool, Should specify this switch as enabled. + + + SwitchParameter + + + False + + + CodeInterpreterMemoryLimit + + {{No description provided}} + + String + + String + + + None + + + ContainerId + + The code interpreter container. Can be a container ID or `auto` to use the default container. + + String + + String + + + auto + + + ContainerFileIds + + An optional list of uploaded files to make available to your code. + + String[] + + String[] + + + None + + + UseImageGenerationTool + + If you want to use the Imagae Generation built-in tool, Should specify this switch as enabled. + + + SwitchParameter + + + False + + + ImageGenerationModel + + The image generation model to use. GPT Image 2.5 models include `gpt-image-2.5-sunburst`, `gpt-image-2.5-flare`, and their `2026-09-08` snapshots. + + String + + String + + + None + + + ImageGenerationAction + + Whether to generate a new image or edit an existing image. Default: `auto`. + + String + + String + + + auto + + + ImageGenerationBackGround + + Background type for the generated image. One of `transparent`, `opaque`, or `auto` + + String + + String + + + auto + + + ImageGenerationInputImageMask + + Optional mask for inpainting. Contains image_url (string, optional) and file_id (string, optional). + + String + + String + + + None + + + ImageGenerationModeration + + Moderation level for the generated image. Default: auto + + String + + String + + + auto + + + ImageGenerationOutputCompression + + Compression level for the output image. Default: 100. + + Int32 + + Int32 + + + None + + + ImageGenerationOutputFormat + + The output format of the generated image. One of `png`, `webp`, or `jpeg`. + + String + + String + + + png + + + ImageGenerationPartialImages + + Number of partial images to generate in streaming mode, from 0 (default value) to 3. + + Int32 + + Int32 + + + None + + + ImageGenerationQuality + + The quality of the generated image. One of `low`, `medium`, `high`, `xhigh`, `max`, or `auto`, subject to model support. + + String + + String + + + auto + + + ImageGenerationSize + + The size of the generated image. Use `auto` or a `WIDTHxHEIGHT` value supported by the selected image model. GPT Image 2 and GPT Image 2.5 accept arbitrary supported resolutions. + + String + + String + + + auto + + + UseLocalShellTool + + If you want to use the Local Shell built-in tool, Should specify this switch as enabled. + + + SwitchParameter + + + False + + + UseShellTool + + If you want to use the Shell built-in tool, Should specify this switch as enabled. + + + SwitchParameter + + + False + + + UseApplyPatchTool + + If you want to use the Apply Patch built-in tool, Should specify this switch as enabled. + + + SwitchParameter + + + False + + + Include + + Specify additional output data to include in the model response. + + String[] + + String[] + + + None + + + Truncation + + The truncation strategy to use for the model response. `disabled` (default) or `auto`. + + String + + String + + + disabled + + + Temperature + + What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random. + + Float + + Float + + + None + + + TopLogprobs + + An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. + + Int32 + + Int32 + + + None + + + TopP + + 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. + + Float + + Float + + + None + + + Store + + Whether to store the generated model response for later retrieval via API. The default is `$true`. + + Boolean + + Boolean + + + True + + + Background + + Whether to run the model response in the background. The default is `$false`. + + + SwitchParameter + + + False + + + Stream + + If set, the model response data will be streamed to the client. + + + SwitchParameter + + + False + + + StreamOutputType + + Specifying the format that the function output. This parameter is only valid for the stream output. +- `text` : Output only text deltas that the model generated. (Default) +- `object` : Output all events that the API respond. + + + + text + object + + String + + String + + + text + + + Verbosity + + Controls the verbosity level of the response. +Valid values are `low`, `medium`, or `high`. + + + String + + String + + + medium + + + ReasoningEffort + + Constrains effort on reasoning for reasoning models. Supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. + + String + + String + + + None + + + ReasoningSummary + + A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of `auto`, `concise` or `detailed`. + + String + + String + + + None + + + MetaData + + Developer-defined tags and values used for filtering completions in the dashboard. + + IDictionary + + IDictionary + + + None + + + MaxOutputTokens + + An upper bound for the number of tokens that can be generated for a response. + + Int32 + + Int32 + + + None + + + OutputType + + An object specifying the format that the model must output. +- `text` : Default response format. Used to generate text responses. +- `json_schema` : Enables Structured Outputs +- `json_object` : Enables the older JSON mode (Not recommended) + + + Object + + Object + + + None + + + OutputRawResponse + + If specifies this switch, an output of this function to be a raw response value from the API. (Normally JSON formatted string.) + + + SwitchParameter + + + False + + + JsonSchema + + The schema for the response format, described as a JSON Schema object. + + String + + String + + + None + + + JsonSchemaName + + The name of the response format. + + String + + String + + + None + + + JsonSchemaDescription + + A description of what the response format is for, used by the model to determine how to respond in the format. + + String + + String + + + None + + + JsonSchemaStrict + + Whether to enable strict schema adherence when generating the output. + + Boolean + + Boolean + + + None + + + ServiceTier + + Specifies the processing type used for serving the request. + + String + + String + + + None + + + PromptCacheKey + + Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. + + String + + String + + + None + + + PromptCacheMode + + Controls whether OpenAI automatically creates an implicit cache breakpoint. Defaults to implicit. With implicit. + + String + + String + + + None + + + PromptCacheTtl + + The minimum lifetime applied to every implicit and explicit cache breakpoint written by the request. Defaults to 30m, which is currently the only supported value. The backend may retain cache entries for longer. + + String + + String + + + None + + + PromptCacheComparisonResponseId + + The response ID to compare against when producing prompt cache diagnostics. + + String + + String + + + None + + + PromptCachePrewarm + + Prepares the prompt cache without generating output. The option is sent to the server as `prompt_cache_options.prewarm`. + + + SwitchParameter + + + False + + + PromptCacheRetention + + Deprecated. Use `-PromptCacheTtl` instead. + + String + + String + + + None + + + SafetyIdentifier + + A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. The IDs should be a string that uniquely identifies each user. + + String + + String + + + None + + + User + + (deprecated) This field is being replaced by `SafetyIdentifier` and `PromptCacheKey`. + + String + + String + + + None + + + Organization + + Specifies Organization ID which used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + + string + + string + + + None + + + AsBatch + + If this is specified, this cmdlet returns an object for Batch input +It does not perform an API request to OpenAI. It is useful with `Start-Batch` cmdlet. + + + SwitchParameter + + + False + + + CustomBatchId + + A unique id that will be used to match outputs to inputs of batch. Must be unique for each request in a batch. +This parameter is valid only when the `-AsBatch` swicth is used. + + String + + String + + + None + + + TimeoutSec + + Specifies the timeout in seconds for each HTTP attempt, including reading the response body or stream. Retry delays are excluded. +The default value is `0` (infinite). + + Int32 + + Int32 + + + 0 + + + MaxRetryCount + + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). +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. + + + Int32 + + Int32 + + + 0 + + + ApiBase + + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` + + System.Uri + + System.Uri + + + https://api.openai.com/v1 + + + ApiKey + + Specifies API key for authentication. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + + Object + + Object + + + None + + + History + + An object for keeping the conversation history. + + Object[] + + Object[] + + + None + + + + + + Message + + A text input to the model. + + String + + String + + + None + + + Role + + The role of the message input. One of `user`, `system`, or `developer`. The default is `user`. + + String + + String + + + None + + + Model + + The name of model to use. +The default value is `gpt-4o-mini`. + + String + + String + + + gpt-4o-mini + + + SystemMessage + + (Instead of this parameter, the use of the `-Instructions` parameter is recommended.) +Instructions that the model should follow. + + String[] + + String[] + + + None + + + DeveloperMessage + + (Instead of this parameter, the use of the `-Instructions` parameter is recommended.) +Instructions that the model should follow. + + String[] + + String[] + + + None + + + Instructions + + A system (or developer) message inserted into the model's context. + + String + + String + + + None + + + Conversation + + The conversation that this response belongs to. Input items and output items from this response are automatically added to this conversation after this response completes. + + String + + String + + + None + + + PreviousResponseId + + The unique ID of the previous response to the model. Use this to create multi-turn conversations. + + String + + String + + + None + + + PromptId + + The unique identifier of the prompt template to use. + + String + + String + + + None + + + PromptVariables + + Optional map of values to substitute in for variables in your prompt. + + IDictionary + + IDictionary + + + None + + + PromptVersion + + Optional version of the prompt template. + + String + + String + + + None + + + Images + + A list of images to passing the model. You can specify local image file or remote url. + + + String[] + + String[] + + + None + + + ImageDetail + + Controls how the model processes the image and generates its textual understanding. You can select from `Low` or `High`. + + + String + + String + + + auto + + + Files + + A file input to the model. +You can speciy a list of the local file path, the URL of the file or the ID of the file to be uploaded. + + String[] + + String[] + + + None + + + ToolChoice + + How the model should select which tool (or tools) to use when generating a response. + + String + + String + + + None + + + MaxToolCalls + + The maximum number of total calls to built-in tools that can be processed in a response. + + Int32 + + Int32 + + + None + + + ParallelToolCalls + + Whether to allow the model to run tool calls in parallel. + + Boolean + + Boolean + + + None + + + Functions + + A list of functions the model may call. + + IDictionary[] + + IDictionary[] + + + None + + + CustomTools + + A list of custom tools the model may call. + + IDictionary[] + + IDictionary[] + + + None + + + UseFileSearchTool + + If you want to use the File search built-in tool, Should specify this switch as enabled. + + SwitchParameter + + SwitchParameter + + + False + + + FileSearchVectorStoreIds + + The IDs of the vector stores to search. + + String[] + + String[] + + + None + + + FileSearchMaxNumberOfResults + + The maximum number of results to return. + + Int32 + + Int32 + + + None + + + FileSearchRanker + + The ranker to use for the file search. + + String + + String + + + None + + + FileSearchScoreThreshold + + 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. + + Float + + Float + + + None + + + FileSearchHybridSearchEmbeddingWeight + + The weight of the embedding in the reciprocal ranking fusion. + + Float + + Float + + + None + + + FileSearchHybridSearchTextWeight + + The weight of the text in the reciprocal ranking fusion. + + Float + + Float + + + None + + + UseWebSearchTool + + If you want to use the Web search built-in tool, Should specify this switch as enabled. + + SwitchParameter + + SwitchParameter + + + False + + + WebSearchType + + The type of the web search tool. + + String + + String + + + None + + + WebSearchContextSize + + High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default. + + String + + String + + + medium + + + WebSearchAllowedDomains + + Allowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well. + + String[] + + String[] + + + None + + + WebSearchUserLocationCity + + Free text input for the city of the user, e.g. `San Francisco`. + + String + + String + + + None + + + WebSearchUserLocationCountry + + The two-letter ISO country code of the user, e.g. `US`. + + String + + String + + + None + + + WebSearchUserLocationRegion + + Free text input for the region of the user, e.g. `California`. + + String + + String + + + None + + + WebSearchUserLocationTimeZone + + The IANA timezone of the user, e.g. `America/Los_Angeles`. + + String + + String + + + None + + + UseComputerUseTool + + If you want to use the Computer-use built-in tool, Should specify this switch as enabled. + + SwitchParameter + + SwitchParameter + + + False + + + ComputerUseEnvironment + + The type of computer environment to control. +Possible values: `browser`, `mac`, `windows`, `ubuntu`. + + String + + String + + + None + + + ComputerUseDisplayHeight + + The height of the computer display. + + Int32 + + Int32 + + + None + + + ComputerUseDisplayWidth + + The width of the computer display. + + Int32 + + Int32 + + + None + + + UseRemoteMCPTool + + If you want to use the Remote MCP built-in tool, Should specify this switch as enabled. + + SwitchParameter + + SwitchParameter + + + False + + + RemoteMCPServerLabel + + A label for this MCP server, used to identify it in tool calls. + + String + + String + + + None + + + RemoteMCPServerUrl + + The URL for the MCP server. Specify either this parameter or `-RemoteMCPTunnelId`. + + String + + String + + + None + + + RemoteMCPTunnelId + + The ID of a secure MCP tunnel. Specify either this parameter or `-RemoteMCPServerUrl`. + + String + + String + + + None + + + RemoteMCPServerDescription + + Optional description of the MCP server, used to provide more context. + + String + + String + + + None + + + RemoteMCPAllowedTools + + List of allowed tool names or a filter object. + + Object + + Object + + + None + + + RemoteMCPRequireApproval + + Specify which of the MCP server's tools require approval. When you want to specify a single approval policy for all tools. One of `always` or `never`. + + Object + + Object + + + None + + + RemoteMCPHeaders + + Optional HTTP headers to send to the MCP server. Use for authentication or other purposes. + + IDictionary + + IDictionary + + + None + + + RemoteMCPAuthorization + + An OAuth access token that can be used with a remote MCP server. + + String + + String + + + None + + + UseConnectorTool + + If you want to use the service connector, Should specify this switch as enabled. + + SwitchParameter + + SwitchParameter + + + False + + + ConnectorLabel + + A label for this connector, used to identify it in tool calls. + + String + + String + + + None + + + ConnectorId + + Deprecated for models released after September 1, 2026. Use a remote MCP server URL or secure tunnel instead. The parameter remains available for compatibility with earlier models. + The supported connector ID values are: - Dropbox: `connector_dropbox` + - Gmail: `connector_gmail` + - Google Calendar: `connector_googlecalendar` + - Google Drive: `connector_googledrive` + - Microsoft Teams: `connector_microsoftteams` + - Outlook Calendar: `connector_outlookcalendar` + - Outlook Email: `connector_outlookemail` + - SharePoint: `connector_sharepoint` + + String + + String + + + None + + + ConnectorRequireApproval + + Specify whether the connector requires approval. One of `always` or `never`. + + String + + String + + + None + + + ConnectorAuthorization + + An OAuth access token that can be used with a service connector. + + String + + String + + + None + + + UseCodeInterpreterTool + + If you want to use the Code Interpreter built-in tool, Should specify this switch as enabled. + + SwitchParameter + + SwitchParameter + + + False + + + CodeInterpreterMemoryLimit + + {{No description provided}} + + String + + String + + + None + + + ContainerId + + The code interpreter container. Can be a container ID or `auto` to use the default container. + + String + + String + + + auto + + + ContainerFileIds + + An optional list of uploaded files to make available to your code. + + String[] + + String[] + + + None + + + UseImageGenerationTool + + If you want to use the Imagae Generation built-in tool, Should specify this switch as enabled. + + SwitchParameter + + SwitchParameter + + + False + + + ImageGenerationModel + + The image generation model to use. GPT Image 2.5 models include `gpt-image-2.5-sunburst`, `gpt-image-2.5-flare`, and their `2026-09-08` snapshots. + + String + + String + + + None + + + ImageGenerationAction + + Whether to generate a new image or edit an existing image. Default: `auto`. + + String + + String + + + auto + + + ImageGenerationBackGround + + Background type for the generated image. One of `transparent`, `opaque`, or `auto` + + String + + String + + + auto + + + ImageGenerationInputImageMask + + Optional mask for inpainting. Contains image_url (string, optional) and file_id (string, optional). + + String + + String + + + None + + + ImageGenerationModeration + + Moderation level for the generated image. Default: auto + + String + + String + + + auto + + + ImageGenerationOutputCompression + + Compression level for the output image. Default: 100. + + Int32 + + Int32 + + + None + + + ImageGenerationOutputFormat + + The output format of the generated image. One of `png`, `webp`, or `jpeg`. + + String + + String + + + png + + + ImageGenerationPartialImages + + Number of partial images to generate in streaming mode, from 0 (default value) to 3. + + Int32 + + Int32 + + + None + + + ImageGenerationQuality + + The quality of the generated image. One of `low`, `medium`, `high`, `xhigh`, `max`, or `auto`, subject to model support. + + String + + String + + + auto + + + ImageGenerationSize + + The size of the generated image. Use `auto` or a `WIDTHxHEIGHT` value supported by the selected image model. GPT Image 2 and GPT Image 2.5 accept arbitrary supported resolutions. + + String + + String + + + auto + + + UseLocalShellTool + + If you want to use the Local Shell built-in tool, Should specify this switch as enabled. + + SwitchParameter + + SwitchParameter + + + False + + + UseShellTool + + If you want to use the Shell built-in tool, Should specify this switch as enabled. + + SwitchParameter + + SwitchParameter + + + False + + + UseApplyPatchTool + + If you want to use the Apply Patch built-in tool, Should specify this switch as enabled. + + SwitchParameter + + SwitchParameter + + + False + + + Include + + Specify additional output data to include in the model response. + + String[] + + String[] + + + None + + + Truncation + + The truncation strategy to use for the model response. `disabled` (default) or `auto`. + + String + + String + + + disabled + + + Temperature + + What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random. + + Float + + Float + + + None + + + TopLogprobs + + An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. + + Int32 + + Int32 + + + None + + + TopP + + 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. + + Float + + Float + + + None + + + Store + + Whether to store the generated model response for later retrieval via API. The default is `$true`. + + Boolean + + Boolean + + + True + + + Background + + Whether to run the model response in the background. The default is `$false`. + + SwitchParameter + + SwitchParameter + + + False + + + Stream + + If set, the model response data will be streamed to the client. + + SwitchParameter + + SwitchParameter + + + False + + + StreamOutputType + + Specifying the format that the function output. This parameter is only valid for the stream output. +- `text` : Output only text deltas that the model generated. (Default) +- `object` : Output all events that the API respond. + + + String + + String + + + text + + + Verbosity + + Controls the verbosity level of the response. +Valid values are `low`, `medium`, or `high`. + + + String + + String + + + medium + + + ReasoningEffort + + Constrains effort on reasoning for reasoning models. Supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. + + String + + String + + + None + + + ReasoningSummary + + A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of `auto`, `concise` or `detailed`. + + String + + String + + + None + + + MetaData + + Developer-defined tags and values used for filtering completions in the dashboard. + + IDictionary + + IDictionary + + + None + + + MaxOutputTokens + + An upper bound for the number of tokens that can be generated for a response. + + Int32 + + Int32 + + + None + + + OutputType + + An object specifying the format that the model must output. +- `text` : Default response format. Used to generate text responses. +- `json_schema` : Enables Structured Outputs +- `json_object` : Enables the older JSON mode (Not recommended) + + + Object + + Object + + + None + + + OutputRawResponse + + If specifies this switch, an output of this function to be a raw response value from the API. (Normally JSON formatted string.) + + SwitchParameter + + SwitchParameter + + + False + + + JsonSchema + + The schema for the response format, described as a JSON Schema object. + + String + + String + + + None + + + JsonSchemaName + + The name of the response format. + + String + + String + + + None + + + JsonSchemaDescription + + A description of what the response format is for, used by the model to determine how to respond in the format. + + String + + String + + + None + + + JsonSchemaStrict + + Whether to enable strict schema adherence when generating the output. + + Boolean + + Boolean + + + None + + + ServiceTier + + Specifies the processing type used for serving the request. + + String + + String + + + None + + + PromptCacheKey + + Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. + + String + + String + + + None + + + PromptCacheMode + + Controls whether OpenAI automatically creates an implicit cache breakpoint. Defaults to implicit. With implicit. + + String + + String + + + None + + + PromptCacheTtl + + The minimum lifetime applied to every implicit and explicit cache breakpoint written by the request. Defaults to 30m, which is currently the only supported value. The backend may retain cache entries for longer. + + String + + String + + + None + + + PromptCacheComparisonResponseId + + The response ID to compare against when producing prompt cache diagnostics. + + String + + String + + + None + + + PromptCachePrewarm + + Prepares the prompt cache without generating output. The option is sent to the server as `prompt_cache_options.prewarm`. + + SwitchParameter + + SwitchParameter + + + False + + + PromptCacheRetention + + Deprecated. Use `-PromptCacheTtl` instead. + + String + + String + + + None + + + SafetyIdentifier + + A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. The IDs should be a string that uniquely identifies each user. + + String + + String + + + None + + + User + + (deprecated) This field is being replaced by `SafetyIdentifier` and `PromptCacheKey`. + + String + + String + + + None + + + Organization + + Specifies Organization ID which used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + + string + + string + + + None + + + AsBatch + + If this is specified, this cmdlet returns an object for Batch input +It does not perform an API request to OpenAI. It is useful with `Start-Batch` cmdlet. + + SwitchParameter + + SwitchParameter + + + False + + + CustomBatchId + + A unique id that will be used to match outputs to inputs of batch. Must be unique for each request in a batch. +This parameter is valid only when the `-AsBatch` swicth is used. + + String + + String + + + None + + + TimeoutSec + + Specifies the timeout in seconds for each HTTP attempt, including reading the response body or stream. Retry delays are excluded. +The default value is `0` (infinite). + + Int32 + + Int32 + + + 0 + + + MaxRetryCount + + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). +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. + + + Int32 + + Int32 + + + 0 + + + ApiBase + + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` + + System.Uri + + System.Uri + + + https://api.openai.com/v1 + + + ApiKey + + Specifies API key for authentication. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + + Object + + Object + + + None + + + History + + An object for keeping the conversation history. + + Object[] + + Object[] + + + None + + + + + + + + + + + + -------------------- Example 1: Text input -------------------- + PS C:\> Request-Response "How do I make sauerkraut?" -Model 'gpt-4o' | select output_text + +Making sauerkraut is a simple process that involves fermenting cabbage. ... + + + + + + -------------------- Example 2: Image input -------------------- + PS C:\> Request-Response "What is this?" -Images 'C:\donut.png' -Model 'gpt-4o' + + + + + + -------------------- Example 3: File input -------------------- + PS C:\> Request-Response "Summarize this document" -Files 'C:\recipient.pdf' -Model 'gpt-4.1' + + + + + + -------------------- Example 4: Web search -------------------- + PS C:\> Request-Response "Tell me a recent top 3 tech news." -UseWebSearchTool -Model 'gpt-4o' + + + + + + ----------------- Example 5: Streaming output ----------------- + PS C:\> Request-Response "Implement Zeller's congruence in PowerShell." -Stream | Write-Host -NoNewline + + + + + + + + Online Version: + https://github.com/mkht/PSOpenAI/blob/main/Docs/Request-Response.md + + + https://developers.openai.com/api/reference/resources/responses/ + https://developers.openai.com/api/reference/resources/responses/ + + + + + + Request-ResponseCompaction + Request + ResponseCompaction + + Runs a compaction pass over a conversation. Compaction returns encrypted, opaque items and the underlying logic may evolve over time. + + + + Runs a compaction pass over a conversation. Compaction returns encrypted, opaque items and the underlying logic may evolve over time. + + + + Request-ResponseCompaction + + Message + + A text input to the model. + + String + + String + + + None + + + Role + + The role of the message input. One of `user`, `system`, or `developer`. The default is `user`. + + String + + String + + + None + + + Model + + The name of model to use. The default value is `gpt-4o-mini`. + + String + + String + + + gpt-4o-mini + + + SystemMessage + + (Instead of this parameter, the use of the `-Instructions` parameter is recommended.) +Instructions that the model should follow. + + String[] + + String[] + + + None + + + DeveloperMessage + + (Instead of this parameter, the use of the `-Instructions` parameter is recommended.) +Instructions that the model should follow. + + String[] + + String[] + + + None + + + Instructions + + A system (or developer) message inserted into the model's context. + + String + + String + + + None + + + PreviousResponseId + + The unique ID of the previous response to the model. Use this to create multi-turn conversations. + + String + + String + + + None + + + Images + + A list of images to passing the model. You can specify local image file or remote url. + + + String[] + + String[] + + + None + + + ImageDetail + + Controls how the model processes the image and generates its textual understanding. You can select from `Low` or `High`. + + + + auto + low + high + + String + + String + + + auto + + + Files + + A file input to the model. +You can speciy a list of the local file path, the URL of the file or the ID of the file to be uploaded. + + String[] + + String[] + + + None + + + ServiceTier + + Specifies the processing type used for serving the request. + + String + + String + + + None + + + PromptCacheMode + + Controls whether OpenAI automatically creates an implicit cache breakpoint. Defaults to implicit. With implicit. + + String + + String + + + None + + + PromptCacheTtl + + The minimum lifetime applied to every implicit and explicit cache breakpoint written by the request. Defaults to 30m, which is currently the only supported value. The backend may retain cache entries for longer. + + String + + String + + + None + + + PromptCacheComparisonResponseId + + The response ID to compare against when producing prompt cache diagnostics. + + String + + String + + + None + + + PromptCachePrewarm + + Prepares the prompt cache without generating output. The option is sent to the server as `prompt_cache_options.prewarm`. + + + SwitchParameter + + + False + + + OutputRawResponse + + If specifies this switch, an output of this function to be a raw response value from the API. (Normally JSON formatted string.) + + + SwitchParameter + + + False + + + TimeoutSec + + Specifies how long the request can be pending before it times out. +The default value is `0` (infinite). + + Int32 + + Int32 + + + 0 + + + MaxRetryCount + + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). +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. + + + Int32 + + Int32 + + + 0 + + + ApiBase + + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` + + System.Uri + + System.Uri + + + https://api.openai.com/v1 + + + ApiKey + + Specifies API key for authentication. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + + Object + + Object + + + None + + + History + + An object for keeping the conversation history. + + Object[] + + Object[] + + + None + + + + + + Message + + A text input to the model. + + String + + String + + + None + + + Role + + The role of the message input. One of `user`, `system`, or `developer`. The default is `user`. + + String + + String + + + None + + + Model + + The name of model to use. The default value is `gpt-4o-mini`. + + String + + String + + + gpt-4o-mini + + + SystemMessage + + (Instead of this parameter, the use of the `-Instructions` parameter is recommended.) +Instructions that the model should follow. + + String[] + + String[] + + + None + + + DeveloperMessage + + (Instead of this parameter, the use of the `-Instructions` parameter is recommended.) +Instructions that the model should follow. + + String[] + + String[] + + + None + + + Instructions + + A system (or developer) message inserted into the model's context. + + String + + String + + + None + + + PreviousResponseId + + The unique ID of the previous response to the model. Use this to create multi-turn conversations. + + String + + String + + + None + + + Images + + A list of images to passing the model. You can specify local image file or remote url. + + + String[] + + String[] + + + None + + + ImageDetail + + Controls how the model processes the image and generates its textual understanding. You can select from `Low` or `High`. + + + String + + String + + + auto + + + Files + + A file input to the model. +You can speciy a list of the local file path, the URL of the file or the ID of the file to be uploaded. + + String[] + + String[] + + + None + + + ServiceTier + + Specifies the processing type used for serving the request. + + String + + String + + + None + + + PromptCacheMode + + Controls whether OpenAI automatically creates an implicit cache breakpoint. Defaults to implicit. With implicit. + + String + + String + + + None + + + PromptCacheTtl + + The minimum lifetime applied to every implicit and explicit cache breakpoint written by the request. Defaults to 30m, which is currently the only supported value. The backend may retain cache entries for longer. + + String + + String + + + None + + + PromptCacheComparisonResponseId + + The response ID to compare against when producing prompt cache diagnostics. + + String + + String + + + None + + + PromptCachePrewarm + + Prepares the prompt cache without generating output. The option is sent to the server as `prompt_cache_options.prewarm`. + + SwitchParameter + + SwitchParameter + + + False + + + OutputRawResponse + + If specifies this switch, an output of this function to be a raw response value from the API. (Normally JSON formatted string.) + + SwitchParameter + + SwitchParameter + + + False + + + TimeoutSec + + Specifies how long the request can be pending before it times out. +The default value is `0` (infinite). + + Int32 + + Int32 + + + 0 + + + MaxRetryCount + + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). +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. + + + Int32 + + Int32 + + + 0 + + + ApiBase + + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` + + System.Uri + + System.Uri + + + https://api.openai.com/v1 + + + ApiKey + + Specifies API key for authentication. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + + Object + + Object + + + None + + + History + + An object for keeping the conversation history. + + Object[] + + Object[] + + + None + + + + + + + + + + + + --------------------------- Example --------------------------- + PS C:\> $Response = Request-Response 'Tell me about traditional Japanese cuisine.' -Model 'gpt-5.2' +PS C:\> $CompactedRespomse = $Response | Request-ResponseCompaction -Model 'gpt-5.2' + + + + + + + + Online Version: + https://github.com/mkht/PSOpenAI/blob/main/Docs/Request-ResponseCompaction.md + + + https://developers.openai.com/api/reference/resources/responses/methods/compact/ + https://developers.openai.com/api/reference/resources/responses/methods/compact/ + + + + + + Request-TextCompletion + Request + TextCompletion + + Creates a completion for the provided prompt and parameters. + + + + Given a prompt, the AI model will return one or more predicted completions. +https://developers.openai.com/api/docs/guides/completions/ + + + + Request-TextCompletion + + Prompt + + (Required) The prompt(s) to generate completions for + + String[] + + String[] + + + None + + + Suffix + + The suffix that comes after a completion of inserted text. + + String + + String + + + None + + + Model + + The name of model to use. The default value is `gpt-3.5-turbo-instruct`. + + String + + String + + + gpt-3.5-turbo-instruct + + + 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. + + Double + + Double + + + None + + + TopP + + 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. + + Double + + Double + + + None + + + NumberOfAnswers + + How many texts to generate for each prompt. The default value is `1`. + + UInt16 + + UInt16 + + + 1 + + + Stream + + Whether to stream back partial progress. + + + System.Management.Automation.SwitchParameter + + + False + + + StopSequence + + Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence. + + String[] + + String[] + + + None + + + MaxTokens + + The maximum number of tokens allowed for the generated answer. +The max value depends on models. + + Int32 + + Int32 + + + 2048 + + + PresencePenalty + + Number between `-2.0` and `2.0`. +Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics. + + Double + + Double + + + None + + + FrequencyPenalty + + Number between `-2.0` and `2.0`. +Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. + + Double + + Double + + + None + + + LogitBias + + Modify the likelihood of specified tokens appearing in the completion. +Accepts a maps of tokens to an associated bias value from `-100` to `100`. You can use `ConvertTo-Token` to convert text to token IDs. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between `-1` and `1` should decrease or increase likelihood of selection; values like `-100` or `100` should result in a ban or exclusive selection of the relevant token. +As an example, you can pass like so: `@{23182 = 20; 88847 = -100}` +ID 23182 maps to "apple" and ID 88847 maps to "banana". Thus, this example increases the likelihood of the word "apple" being included in the response from the AI and greatly reduces the likelihood of the word "banana" being included. + + IDictionary + + IDictionary + + + None + + + User + + A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. + + String + + String + + + None + + + Echo + + Echo back the prompt in addition to the completion. The default value is `$false`. + + Boolean + + Boolean + + + $false + + + BestOf + + Generates best_of completions server-side and returns the "best" (the one with the highest log probability per token). + + UInt16 + + UInt16 + + + None + + + AsBatch + + If this is specified, this cmdlet returns an object for Batch input +It does not perform an API request to OpenAI. It is useful with `Start-Batch` cmdlet. + + + SwitchParameter + + + False + + + CustomBatchId + + A unique id that will be used to match outputs to inputs of batch. Must be unique for each request in a batch. +This parameter is valid only when the `-AsBatch` swicth is used. Otherwise, it is simply ignored. + + String + + String + + + None + + + TimeoutSec + + Specifies how long the request can be pending before it times out. The default value is `0` (infinite). + + Int32 + + Int32 + + + 0 + + + MaxRetryCount + + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). +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. + + + Int32 + + Int32 + + + 0 + + + ApiBase + + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` + + System.Uri + + System.Uri + + + https://api.openai.com/v1 + + + ApiKey + + Specifies API key for authentication. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + + Object + + Object + + + None + + + Organization + + Specifies Organization ID which used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + + string + + string + + + None + + + + + + Prompt + + (Required) The prompt(s) to generate completions for + + String[] + + String[] + + + None + + + Suffix + + The suffix that comes after a completion of inserted text. + + String + + String + + + None + + + Model + + The name of model to use. The default value is `gpt-3.5-turbo-instruct`. + + String + + String + + + gpt-3.5-turbo-instruct + + + 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. + + Double + + Double + + + None + + + TopP + + 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. + + Double + + Double + + + None + + + NumberOfAnswers + + How many texts to generate for each prompt. The default value is `1`. + + UInt16 + + UInt16 + + + 1 + + + Stream + + Whether to stream back partial progress. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + StopSequence + + Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence. + + String[] + + String[] + + + None + + + MaxTokens + + The maximum number of tokens allowed for the generated answer. +The max value depends on models. + + Int32 + + Int32 + + + 2048 + + + PresencePenalty + + Number between `-2.0` and `2.0`. +Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics. + + Double + + Double + + + None + + + FrequencyPenalty + + Number between `-2.0` and `2.0`. +Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. + + Double + + Double + + + None + + + LogitBias + + Modify the likelihood of specified tokens appearing in the completion. +Accepts a maps of tokens to an associated bias value from `-100` to `100`. You can use `ConvertTo-Token` to convert text to token IDs. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between `-1` and `1` should decrease or increase likelihood of selection; values like `-100` or `100` should result in a ban or exclusive selection of the relevant token. +As an example, you can pass like so: `@{23182 = 20; 88847 = -100}` +ID 23182 maps to "apple" and ID 88847 maps to "banana". Thus, this example increases the likelihood of the word "apple" being included in the response from the AI and greatly reduces the likelihood of the word "banana" being included. + + IDictionary + + IDictionary + + + None + + + User + + A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. + + String + + String + + + None + + + Echo + + Echo back the prompt in addition to the completion. The default value is `$false`. + + Boolean + + Boolean + + + $false + + + BestOf + + Generates best_of completions server-side and returns the "best" (the one with the highest log probability per token). + + UInt16 + + UInt16 + + + None + + + AsBatch + + If this is specified, this cmdlet returns an object for Batch input +It does not perform an API request to OpenAI. It is useful with `Start-Batch` cmdlet. + + SwitchParameter + + SwitchParameter + + + False + + + CustomBatchId + + A unique id that will be used to match outputs to inputs of batch. Must be unique for each request in a batch. +This parameter is valid only when the `-AsBatch` swicth is used. Otherwise, it is simply ignored. + + String + + String + + + None + + + TimeoutSec + + Specifies how long the request can be pending before it times out. The default value is `0` (infinite). + + Int32 + + Int32 + + + 0 + + + MaxRetryCount + + Number between `0` and `100`. +Specifies the maximum number of retries if the request fails. +The default value is `0` (No retry). +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. + + + Int32 + + Int32 + + + 0 + + + ApiBase + + Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` +If not specified, it will use `https://api.openai.com/v1` + + System.Uri + + System.Uri + + + https://api.openai.com/v1 + + + ApiKey + + Specifies API key for authentication. +The type of data should `[string]` or `[securestring]`. +If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + + Object + + Object + + + None + + + Organization + + Specifies Organization ID which used for an API request. +If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + + string + + string + + + None + + + + + + + [pscustomobject] + + + + + + + + + + + + + + -------- Example 1: Estimate the sentences that follow. -------- + Request-TextCompletion -Prompt 'This is a hamburger store.' | select Answer + +We serves +-classic hamburgers +-tofu burgers + + + + + + + + Online Version: + https://github.com/mkht/PSOpenAI/blob/main/Docs/Request-TextCompletion.md + + + https://developers.openai.com/api/docs/guides/completions/ + https://developers.openai.com/api/docs/guides/completions/ + + + https://developers.openai.com/api/reference/resources/completions/methods/create/ + https://developers.openai.com/api/reference/resources/completions/methods/create/ + + + + + + Send-RealtimeSessionEvent + Send + RealtimeSessionEvent + + Send any client event to the server. + + + + Sends an arbitrary message expressed as a JSON string to the session. This is useful for sending custom events that PSOpenAI does not support in its functions. + + + + Send-RealtimeSessionEvent + + Message + + JSON-formatted message. + + String + + String + + + None + + + + + + Message + + JSON-formatted message. + + String - Boolean + String - True + None - - Background + + + + + + + + + + + -------------------------- Example 1 -------------------------- + PS C:\> Send-RealtimeSessionEvent -Message '{"event_id": "event_567", "type": "response.cancel"}' + + + + + + + + Online Version: + https://github.com/mkht/PSOpenAI/blob/main/Docs/Send-RealtimeSessionEvent.md + + + https://developers.openai.com/api/reference/resources/realtime/ + https://developers.openai.com/api/reference/resources/realtime/ + + + + + + Set-Agent + Set + Agent + + Updates a reusable agent. + + + + Updates a reusable agent. This command uses the OpenAI Agents API public beta and sends the required `OpenAI-Beta: agents=v1` header. Nested, evolving request schemas are accepted through `-Body` where applicable. + + + + Set-Agent + + AgentId + + The reusable agent ID. + + String + + String + + + None + + + Body + + The request body as a dictionary. Use the fields defined by the corresponding OpenAI Agents API operation. + + IDictionary + + IDictionary + + + None + + + AdditionalBody + + Additional JSON properties to merge into the request body. + + Object + + Object + + + None + + + AdditionalHeaders + + Additional HTTP headers to include in the request. + + IDictionary + + IDictionary + + + None + + + AdditionalQuery + + Additional query parameters to include in the request. + + IDictionary + + IDictionary + + + None + + + ApiBase + + The base URI for the OpenAI API. + + Uri + + Uri + + + None + + + ApiKey + + The OpenAI API key as a secure string. + + SecureString + + SecureString + + + None + + + ApiType + + The API provider. Agents API commands support OpenAI only. + + + OpenAI + Azure + + OpenAIApiType + + OpenAIApiType + + + None + + + AuthType + + The authentication type. Use openai for the Agents API. + + + openai + azure + azure_ad + + String + + String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + SwitchParameter + + + False + + + MaxRetryCount + + The maximum number of retries for transient API failures. + + Int32 + + Int32 + + + None + + + Organization + + The OpenAI organization ID. + + String + + String + + + None + + + TimeoutSec + + The request timeout in seconds. Zero uses the module default. + + Int32 + + Int32 + + + None + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + SwitchParameter + + + False + + + ProgressAction + + Controls how PowerShell responds to progress updates. + + ActionPreference + + ActionPreference + + + None + + + + + + AdditionalBody - Whether to run the model response in the background. The default is `$false`. + Additional JSON properties to merge into the request body. - SwitchParameter + Object - SwitchParameter + Object - False + None - - Stream + + AdditionalHeaders - If set, the model response data will be streamed to the client. + Additional HTTP headers to include in the request. - SwitchParameter + IDictionary - SwitchParameter + IDictionary - False + None - - StreamOutputType + + AdditionalQuery - Specifying the format that the function output. This parameter is only valid for the stream output. -- `text` : Output only text deltas that the model generated. (Default) -- `object` : Output all events that the API respond. - + Additional query parameters to include in the request. - String + IDictionary - String + IDictionary - text + None - - Verbosity + + AgentId - Controls the verbosity level of the response. -Valid values are `low`, `medium`, or `high`. - + The reusable agent ID. String String - medium + None - - ReasoningEffort + + ApiBase - Constrains effort on reasoning for reasoning models. Supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. + The base URI for the OpenAI API. - String + Uri - String + Uri None - - ReasoningSummary + + ApiKey - A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of `auto`, `concise` or `detailed`. + The OpenAI API key as a secure string. - String + SecureString - String + SecureString None - - MetaData + + ApiType - Developer-defined tags and values used for filtering completions in the dashboard. + The API provider. Agents API commands support OpenAI only. - IDictionary + OpenAIApiType - IDictionary + OpenAIApiType None - - MaxOutputTokens + + AuthType - An upper bound for the number of tokens that can be generated for a response. + The authentication type. Use openai for the Agents API. - Int32 + String - Int32 + String None - - OutputType + + Body - An object specifying the format that the model must output. -- `text` : Default response format. Used to generate text responses. -- `json_schema` : Enables Structured Outputs -- `json_object` : Enables the older JSON mode (Not recommended) - + The request body as a dictionary. Use the fields defined by the corresponding OpenAI Agents API operation. - Object + IDictionary - Object + IDictionary None - - OutputRawResponse + + Confirm - If specifies this switch, an output of this function to be a raw response value from the API. (Normally JSON formatted string.) + Prompts you for confirmation before running the cmdlet. SwitchParameter @@ -22131,22 +35300,22 @@ Valid values are `low`, `medium`, or `high`. False - - JsonSchema + + MaxRetryCount - The schema for the response format, described as a JSON Schema object. + The maximum number of retries for transient API failures. - String + Int32 - String + Int32 None - - JsonSchemaName + + Organization - The name of the response format. + The OpenAI organization ID. String @@ -22155,106 +35324,351 @@ Valid values are `low`, `medium`, or `high`. None - - JsonSchemaDescription + + TimeoutSec - A description of what the response format is for, used by the model to determine how to respond in the format. + The request timeout in seconds. Zero uses the module default. - String + Int32 - String + Int32 None - - JsonSchemaStrict + + WhatIf - Whether to enable strict schema adherence when generating the output. + Shows what would happen if the cmdlet runs. The cmdlet is not run. - Boolean + SwitchParameter - Boolean + SwitchParameter + + + False + + + ProgressAction + + Controls how PowerShell responds to progress updates. + + ActionPreference + + ActionPreference None - - ServiceTier + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Set-Agent -AgentId 'agent_123' -Body @{ instructions = 'Review PowerShell code.' } + + Updates a reusable agent configuration. + + + + + + Online Version: + https://github.com/mkht/PSOpenAI/blob/v5/Docs/Set-Agent.md + + + OpenAI Agents API + https://developers.openai.com/api/reference/typescript/resources/beta/subresources/agents + + + + + + Set-AgentEnvironmentTemplate + Set + AgentEnvironmentTemplate + + Updates an agent environment template. + + + + Updates an agent environment template. This command uses the OpenAI Agents API public beta and sends the required `OpenAI-Beta: agents=v1` header. Nested, evolving request schemas are accepted through `-Body` where applicable. + + + + Set-AgentEnvironmentTemplate + + EnvironmentTemplateId + + The reusable agent environment template ID. + + String + + String + + + None + + + Body + + The request body as a dictionary. Use the fields defined by the corresponding OpenAI Agents API operation. + + IDictionary + + IDictionary + + + None + + + AdditionalBody + + Additional JSON properties to merge into the request body. + + Object + + Object + + + None + + + AdditionalHeaders + + Additional HTTP headers to include in the request. + + IDictionary + + IDictionary + + + None + + + AdditionalQuery + + Additional query parameters to include in the request. + + IDictionary + + IDictionary + + + None + + + ApiBase + + The base URI for the OpenAI API. + + Uri + + Uri + + + None + + + ApiKey + + The OpenAI API key as a secure string. + + SecureString + + SecureString + + + None + + + ApiType + + The API provider. Agents API commands support OpenAI only. + + + OpenAI + Azure + + OpenAIApiType + + OpenAIApiType + + + None + + + AuthType + + The authentication type. Use openai for the Agents API. + + + openai + azure + azure_ad + + String + + String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + SwitchParameter + + + False + + + MaxRetryCount + + The maximum number of retries for transient API failures. + + Int32 + + Int32 + + + None + + + Organization + + The OpenAI organization ID. + + String + + String + + + None + + + TimeoutSec + + The request timeout in seconds. Zero uses the module default. + + Int32 + + Int32 + + + None + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + SwitchParameter + + + False + + + ProgressAction + + Controls how PowerShell responds to progress updates. + + ActionPreference + + ActionPreference + + + None + + + + + + AdditionalBody - Specifies the processing type used for serving the request. + Additional JSON properties to merge into the request body. - String + Object - String + Object None - - PromptCacheKey + + AdditionalHeaders - Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. + Additional HTTP headers to include in the request. - String + IDictionary - String + IDictionary None - - PromptCacheMode + + AdditionalQuery - Controls whether OpenAI automatically creates an implicit cache breakpoint. Defaults to implicit. With implicit. + Additional query parameters to include in the request. - String + IDictionary - String + IDictionary None - - PromptCacheTtl + + ApiBase - The minimum lifetime applied to every implicit and explicit cache breakpoint written by the request. Defaults to 30m, which is currently the only supported value. The backend may retain cache entries for longer. + The base URI for the OpenAI API. - String + Uri - String + Uri None - - PromptCacheRetention + + ApiKey - Deprecated. Use `-PromptCacheTtl` instead. + The OpenAI API key as a secure string. - String + SecureString - String + SecureString None - - SafetyIdentifier + + ApiType - A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. The IDs should be a string that uniquely identifies each user. + The API provider. Agents API commands support OpenAI only. - String + OpenAIApiType - String + OpenAIApiType None - - User + + AuthType - (deprecated) This field is being replaced by `SafetyIdentifier` and `PromptCacheKey`. + The authentication type. Use openai for the Agents API. String @@ -22263,24 +35677,22 @@ Valid values are `low`, `medium`, or `high`. None - - Organization + + Body - Specifies Organization ID which used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + The request body as a dictionary. Use the fields defined by the corresponding OpenAI Agents API operation. - string + IDictionary - string + IDictionary None - - AsBatch + + Confirm - If this is specified, this cmdlet returns an object for Batch input -It does not perform an API request to OpenAI. It is useful with `Start-Batch` cmdlet. + Prompts you for confirmation before running the cmdlet. SwitchParameter @@ -22289,11 +35701,10 @@ It does not perform an API request to OpenAI. It is useful with `Start-Batch` cm False - - CustomBatchId + + EnvironmentTemplateId - A unique id that will be used to match outputs to inputs of batch. Must be unique for each request in a batch. -This parameter is valid only when the `-AsBatch` swicth is used. + The reusable agent environment template ID. String @@ -22302,70 +35713,62 @@ This parameter is valid only when the `-AsBatch` swicth is used. None - - TimeoutSec + + MaxRetryCount - Specifies the timeout in seconds for each HTTP attempt, including reading the response body or stream. Retry delays are excluded. -The default value is `0` (infinite). + The maximum number of retries for transient API failures. Int32 Int32 - 0 + None - - MaxRetryCount + + Organization - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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. - + The OpenAI organization ID. - Int32 + String - Int32 + String - 0 + None - - ApiBase + + TimeoutSec - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` + The request timeout in seconds. Zero uses the module default. - System.Uri + Int32 - System.Uri + Int32 - https://api.openai.com/v1 + None - - ApiKey + + WhatIf - Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + Shows what would happen if the cmdlet runs. The cmdlet is not run. - Object + SwitchParameter - Object + SwitchParameter - None + False - - History + + ProgressAction - An object for keeping the conversation history. + Controls how PowerShell responds to progress updates. - Object[] + ActionPreference - Object[] + ActionPreference None @@ -22380,228 +35783,149 @@ If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_AP - -------------------- Example 1: Text input -------------------- - PS C:\> Request-Response "How do I make sauerkraut?" -Model 'gpt-4o' | select output_text - -Making sauerkraut is a simple process that involves fermenting cabbage. ... - - - - - - -------------------- Example 2: Image input -------------------- - PS C:\> Request-Response "What is this?" -Images 'C:\donut.png' -Model 'gpt-4o' - - - - - - -------------------- Example 3: File input -------------------- - PS C:\> Request-Response "Summarize this document" -Files 'C:\recipient.pdf' -Model 'gpt-4.1' - - - - - - -------------------- Example 4: Web search -------------------- - PS C:\> Request-Response "Tell me a recent top 3 tech news." -UseWebSearchTool -Model 'gpt-4o' - - - - - - ----------------- Example 5: Streaming output ----------------- - PS C:\> Request-Response "Implement Zeller's congruence in PowerShell." -Stream | Write-Host -NoNewline + -------------------------- Example 1 -------------------------- + Set-AgentEnvironmentTemplate -EnvironmentTemplateId 'envtpl_123' -Body @{ name = 'Updated environment' } - + Updates a reusable environment template. Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/Request-Response.md + https://github.com/mkht/PSOpenAI/blob/v5/Docs/Set-AgentEnvironmentTemplate.md - https://developers.openai.com/api/reference/resources/responses/ - https://developers.openai.com/api/reference/resources/responses/ + OpenAI Agents API + https://developers.openai.com/api/reference/typescript/resources/beta/subresources/agents - Request-ResponseCompaction - Request - ResponseCompaction + Set-AgentSession + Set + AgentSession - Runs a compaction pass over a conversation. Compaction returns encrypted, opaque items and the underlying logic may evolve over time. + Updates an agent session. - Runs a compaction pass over a conversation. Compaction returns encrypted, opaque items and the underlying logic may evolve over time. + Updates an agent session. This command uses the OpenAI Agents API public beta and sends the required `OpenAI-Beta: agents=v1` header. Nested, evolving request schemas are accepted through `-Body` where applicable. - Request-ResponseCompaction - - Message - - A text input to the model. - - String - - String - - - None - - - Role - - The role of the message input. One of `user`, `system`, or `developer`. The default is `user`. - - String - - String - - - None - - - Model + Set-AgentSession + + SessionId - The name of model to use. The default value is `gpt-4o-mini`. + The managed agent session ID. String String - gpt-4o-mini - - - SystemMessage - - (Instead of this parameter, the use of the `-Instructions` parameter is recommended.) -Instructions that the model should follow. - - String[] - - String[] - - None - - DeveloperMessage - - (Instead of this parameter, the use of the `-Instructions` parameter is recommended.) -Instructions that the model should follow. - - String[] - - String[] - - - None - - - Instructions + + Body - A system (or developer) message inserted into the model's context. + The request body as a dictionary. Use the fields defined by the corresponding OpenAI Agents API operation. - String + IDictionary - String + IDictionary None - - PreviousResponseId + + AdditionalBody - The unique ID of the previous response to the model. Use this to create multi-turn conversations. + Additional JSON properties to merge into the request body. - String + Object - String + Object None - - Images + + AdditionalHeaders - A list of images to passing the model. You can specify local image file or remote url. - + Additional HTTP headers to include in the request. - String[] + IDictionary - String[] + IDictionary None - - - ImageDetail - - Controls how the model processes the image and generates its textual understanding. You can select from `Low` or `High`. - - - - auto - low - high - - String + + + AdditionalQuery + + Additional query parameters to include in the request. + + IDictionary - String + IDictionary - auto + None - - Files + + ApiBase - A file input to the model. -You can speciy a list of the local file path, the URL of the file or the ID of the file to be uploaded. + The base URI for the OpenAI API. - String[] + Uri - String[] + Uri None - - ServiceTier + + ApiKey - Specifies the processing type used for serving the request. + The OpenAI API key as a secure string. - String + SecureString - String + SecureString None - - PromptCacheMode + + ApiType - Controls whether OpenAI automatically creates an implicit cache breakpoint. Defaults to implicit. With implicit. + The API provider. Agents API commands support OpenAI only. - String + + OpenAI + Azure + + OpenAIApiType - String + OpenAIApiType None - - PromptCacheTtl + + AuthType - The minimum lifetime applied to every implicit and explicit cache breakpoint written by the request. Defaults to 30m, which is currently the only supported value. The backend may retain cache entries for longer. + The authentication type. Use openai for the Agents API. + + openai + azure + azure_ad + String String @@ -22609,10 +35933,10 @@ You can speciy a list of the local file path, the URL of the file or the ID of t None - - OutputRawResponse + + Confirm - If specifies this switch, an output of this function to be a raw response value from the API. (Normally JSON formatted string.) + Prompts you for confirmation before running the cmdlet. SwitchParameter @@ -22620,70 +35944,61 @@ You can speciy a list of the local file path, the URL of the file or the ID of t False - - TimeoutSec + + MaxRetryCount - Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). + The maximum number of retries for transient API failures. Int32 Int32 - 0 + None - - MaxRetryCount + + Organization - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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. - + The OpenAI organization ID. - Int32 + String - Int32 + String - 0 + None - - ApiBase + + TimeoutSec - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` + The request timeout in seconds. Zero uses the module default. - System.Uri + Int32 - System.Uri + Int32 - https://api.openai.com/v1 + None - - ApiKey + + WhatIf - Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + Shows what would happen if the cmdlet runs. The cmdlet is not run. - Object - Object + SwitchParameter - None + False - - History + + ProgressAction - An object for keeping the conversation history. + Controls how PowerShell responds to progress updates. - Object[] + ActionPreference - Object[] + ActionPreference None @@ -22691,84 +36006,82 @@ If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_AP - - Message + + AdditionalBody - A text input to the model. + Additional JSON properties to merge into the request body. - String + Object - String + Object None - - Role + + AdditionalHeaders - The role of the message input. One of `user`, `system`, or `developer`. The default is `user`. + Additional HTTP headers to include in the request. - String + IDictionary - String + IDictionary None - - Model + + AdditionalQuery - The name of model to use. The default value is `gpt-4o-mini`. + Additional query parameters to include in the request. - String + IDictionary - String + IDictionary - gpt-4o-mini + None - - SystemMessage + + ApiBase - (Instead of this parameter, the use of the `-Instructions` parameter is recommended.) -Instructions that the model should follow. + The base URI for the OpenAI API. - String[] + Uri - String[] + Uri None - - DeveloperMessage + + ApiKey - (Instead of this parameter, the use of the `-Instructions` parameter is recommended.) -Instructions that the model should follow. + The OpenAI API key as a secure string. - String[] + SecureString - String[] + SecureString None - - Instructions + + ApiType - A system (or developer) message inserted into the model's context. + The API provider. Agents API commands support OpenAI only. - String + OpenAIApiType - String + OpenAIApiType None - - PreviousResponseId + + AuthType - The unique ID of the previous response to the model. Use this to create multi-turn conversations. + The authentication type. Use openai for the Agents API. String @@ -22777,49 +36090,46 @@ Instructions that the model should follow. None - - Images + + Body - A list of images to passing the model. You can specify local image file or remote url. - + The request body as a dictionary. Use the fields defined by the corresponding OpenAI Agents API operation. - String[] + IDictionary - String[] + IDictionary None - - ImageDetail + + Confirm - Controls how the model processes the image and generates its textual understanding. You can select from `Low` or `High`. - + Prompts you for confirmation before running the cmdlet. - String + SwitchParameter - String + SwitchParameter - auto + False - - Files + + MaxRetryCount - A file input to the model. -You can speciy a list of the local file path, the URL of the file or the ID of the file to be uploaded. + The maximum number of retries for transient API failures. - String[] + Int32 - String[] + Int32 None - - ServiceTier + + Organization - Specifies the processing type used for serving the request. + The OpenAI organization ID. String @@ -22828,10 +36138,10 @@ You can speciy a list of the local file path, the URL of the file or the ID of t None - - PromptCacheMode + + SessionId - Controls whether OpenAI automatically creates an implicit cache breakpoint. Defaults to implicit. With implicit. + The managed agent session ID. String @@ -22840,22 +36150,22 @@ You can speciy a list of the local file path, the URL of the file or the ID of t None - - PromptCacheTtl + + TimeoutSec - The minimum lifetime applied to every implicit and explicit cache breakpoint written by the request. Defaults to 30m, which is currently the only supported value. The backend may retain cache entries for longer. + The request timeout in seconds. Zero uses the module default. - String + Int32 - String + Int32 None - - OutputRawResponse + + WhatIf - If specifies this switch, an output of this function to be a raw response value from the API. (Normally JSON formatted string.) + Shows what would happen if the cmdlet runs. The cmdlet is not run. SwitchParameter @@ -22864,70 +36174,14 @@ You can speciy a list of the local file path, the URL of the file or the ID of t False - - TimeoutSec - - Specifies how long the request can be pending before it times out. -The default value is `0` (infinite). - - Int32 - - Int32 - - - 0 - - - MaxRetryCount - - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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. - - - Int32 - - Int32 - - - 0 - - - ApiBase - - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` - - System.Uri - - System.Uri - - - https://api.openai.com/v1 - - - ApiKey - - Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` - - Object - - Object - - - None - - - History + + ProgressAction - An object for keeping the conversation history. + Controls how PowerShell responds to progress updates. - Object[] + ActionPreference - Object[] + ActionPreference None @@ -22940,59 +36194,45 @@ If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_AP - - - --------------------------- Example --------------------------- - PS C:\> $Response = Request-Response 'Tell me about traditional Japanese cuisine.' -Model 'gpt-5.2' -PS C:\> $CompactedRespomse = $Response | Request-ResponseCompaction -Model 'gpt-5.2' + + + -------------------------- Example 1 -------------------------- + Set-AgentSession -SessionId 'session_123' -Body @{ metadata = @{ project = 'PSOpenAI' } } - + Updates mutable settings on a managed session. Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/Request-ResponseCompaction.md + https://github.com/mkht/PSOpenAI/blob/v5/Docs/Set-AgentSession.md - https://developers.openai.com/api/reference/resources/responses/methods/compact/ - https://developers.openai.com/api/reference/resources/responses/methods/compact/ + OpenAI Agents API + https://developers.openai.com/api/reference/typescript/resources/beta/subresources/agents - Request-TextCompletion - Request - TextCompletion + Set-AgentVaultCredential + Set + AgentVaultCredential - Creates a completion for the provided prompt and parameters. + Rotates the secret material for an agent vault credential. - Given a prompt, the AI model will return one or more predicted completions. -https://developers.openai.com/api/docs/guides/completions/ + Rotates the secret material for an agent vault credential. This command uses the OpenAI Agents API public beta and sends the required `OpenAI-Beta: agents=v1` header. Nested, evolving request schemas are accepted through `-Body` where applicable. - Request-TextCompletion - - Prompt - - (Required) The prompt(s) to generate completions for - - String[] - - String[] - - - None - - - Suffix + Set-AgentVaultCredential + + VaultId - The suffix that comes after a completion of inserted text. + The agent vault ID. String @@ -23001,138 +36241,116 @@ https://developers.openai.com/api/docs/guides/completions/ None - - Model + + CredentialId - The name of model to use. The default value is `gpt-3.5-turbo-instruct`. + The vault credential ID. String String - gpt-3.5-turbo-instruct - - - 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. - - Double - - Double - - None - - TopP + + Body - 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. + The request body as a dictionary. Use the fields defined by the corresponding OpenAI Agents API operation. - Double + IDictionary - Double + IDictionary None - - NumberOfAnswers - - How many texts to generate for each prompt. The default value is `1`. - - UInt16 - - UInt16 - - - 1 - - - Stream + + AdditionalBody - Whether to stream back partial progress. + Additional JSON properties to merge into the request body. + Object - System.Management.Automation.SwitchParameter + Object - False + None - - StopSequence + + AdditionalHeaders - Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence. + Additional HTTP headers to include in the request. - String[] + IDictionary - String[] + IDictionary None - - MaxTokens + + AdditionalQuery - The maximum number of tokens allowed for the generated answer. -The max value depends on models. + Additional query parameters to include in the request. - Int32 + IDictionary - Int32 + IDictionary - 2048 + None - - PresencePenalty + + ApiBase - Number between `-2.0` and `2.0`. -Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics. + The base URI for the OpenAI API. - Double + Uri - Double + Uri None - - FrequencyPenalty + + ApiKey - Number between `-2.0` and `2.0`. -Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. + The OpenAI API key as a secure string. - Double + SecureString - Double + SecureString None - - LogitBias + + ApiType - Modify the likelihood of specified tokens appearing in the completion. -Accepts a maps of tokens to an associated bias value from `-100` to `100`. You can use `ConvertTo-Token` to convert text to token IDs. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between `-1` and `1` should decrease or increase likelihood of selection; values like `-100` or `100` should result in a ban or exclusive selection of the relevant token. -As an example, you can pass like so: `@{23182 = 20; 88847 = -100}` -ID 23182 maps to "apple" and ID 88847 maps to "banana". Thus, this example increases the likelihood of the word "apple" being included in the response from the AI and greatly reduces the likelihood of the word "banana" being included. + The API provider. Agents API commands support OpenAI only. - IDictionary + + OpenAI + Azure + + OpenAIApiType - IDictionary + OpenAIApiType None - - User + + AuthType - A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. + The authentication type. Use openai for the Agents API. + + openai + azure + azure_ad + String String @@ -23140,47 +36358,33 @@ ID 23182 maps to "apple" and ID 88847 maps to "banana". Thus, this example incre None - - Echo + + Confirm - Echo back the prompt in addition to the completion. The default value is `$false`. + Prompts you for confirmation before running the cmdlet. - Boolean - Boolean + SwitchParameter - $false + False - - BestOf + + MaxRetryCount - Generates best_of completions server-side and returns the "best" (the one with the highest log probability per token). + The maximum number of retries for transient API failures. - UInt16 + Int32 - UInt16 + Int32 None - - AsBatch - - If this is specified, this cmdlet returns an object for Batch input -It does not perform an API request to OpenAI. It is useful with `Start-Batch` cmdlet. - - - SwitchParameter - - - False - - - CustomBatchId + + Organization - A unique id that will be used to match outputs to inputs of batch. Must be unique for each request in a batch. -This parameter is valid only when the `-AsBatch` swicth is used. Otherwise, it is simply ignored. + The OpenAI organization ID. String @@ -23189,233 +36393,120 @@ This parameter is valid only when the `-AsBatch` swicth is used. Otherwise, it i None - + TimeoutSec - Specifies how long the request can be pending before it times out. The default value is `0` (infinite). - - Int32 - - Int32 - - - 0 - - - MaxRetryCount - - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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. - + The request timeout in seconds. Zero uses the module default. Int32 Int32 - 0 - - - ApiBase - - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` - - System.Uri - - System.Uri - - - https://api.openai.com/v1 + None - - ApiKey + + WhatIf - Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + Shows what would happen if the cmdlet runs. The cmdlet is not run. - Object - Object + SwitchParameter - None + False - - Organization + + ProgressAction - Specifies Organization ID which used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + Controls how PowerShell responds to progress updates. - string + ActionPreference - string + ActionPreference - None - - - - - - Prompt - - (Required) The prompt(s) to generate completions for - - String[] - - String[] - - - None - - - Suffix - - The suffix that comes after a completion of inserted text. - - String - - String - - - None - - - Model - - The name of model to use. The default value is `gpt-3.5-turbo-instruct`. - - String - - String - - - gpt-3.5-turbo-instruct - - - Temperature + None + + + + + + AdditionalBody - 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. + Additional JSON properties to merge into the request body. - Double + Object - Double + Object None - - TopP + + AdditionalHeaders - 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. + Additional HTTP headers to include in the request. - Double + IDictionary - Double + IDictionary None - - NumberOfAnswers - - How many texts to generate for each prompt. The default value is `1`. - - UInt16 - - UInt16 - - - 1 - - - Stream - - Whether to stream back partial progress. - - System.Management.Automation.SwitchParameter - - System.Management.Automation.SwitchParameter - - - False - - - StopSequence + + AdditionalQuery - Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence. + Additional query parameters to include in the request. - String[] + IDictionary - String[] + IDictionary None - - MaxTokens - - The maximum number of tokens allowed for the generated answer. -The max value depends on models. - - Int32 - - Int32 - - - 2048 - - - PresencePenalty + + ApiBase - Number between `-2.0` and `2.0`. -Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics. + The base URI for the OpenAI API. - Double + Uri - Double + Uri None - - FrequencyPenalty + + ApiKey - Number between `-2.0` and `2.0`. -Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. + The OpenAI API key as a secure string. - Double + SecureString - Double + SecureString None - - LogitBias + + ApiType - Modify the likelihood of specified tokens appearing in the completion. -Accepts a maps of tokens to an associated bias value from `-100` to `100`. You can use `ConvertTo-Token` to convert text to token IDs. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between `-1` and `1` should decrease or increase likelihood of selection; values like `-100` or `100` should result in a ban or exclusive selection of the relevant token. -As an example, you can pass like so: `@{23182 = 20; 88847 = -100}` -ID 23182 maps to "apple" and ID 88847 maps to "banana". Thus, this example increases the likelihood of the word "apple" being included in the response from the AI and greatly reduces the likelihood of the word "banana" being included. + The API provider. Agents API commands support OpenAI only. - IDictionary + OpenAIApiType - IDictionary + OpenAIApiType None - - User + + AuthType - A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. + The authentication type. Use openai for the Agents API. String @@ -23424,35 +36515,22 @@ ID 23182 maps to "apple" and ID 88847 maps to "banana". Thus, this example incre None - - Echo - - Echo back the prompt in addition to the completion. The default value is `$false`. - - Boolean - - Boolean - - - $false - - - BestOf + + Body - Generates best_of completions server-side and returns the "best" (the one with the highest log probability per token). + The request body as a dictionary. Use the fields defined by the corresponding OpenAI Agents API operation. - UInt16 + IDictionary - UInt16 + IDictionary None - - AsBatch + + Confirm - If this is specified, this cmdlet returns an object for Batch input -It does not perform an API request to OpenAI. It is useful with `Start-Batch` cmdlet. + Prompts you for confirmation before running the cmdlet. SwitchParameter @@ -23461,11 +36539,10 @@ It does not perform an API request to OpenAI. It is useful with `Start-Batch` cm False - - CustomBatchId + + CredentialId - A unique id that will be used to match outputs to inputs of batch. Must be unique for each request in a batch. -This parameter is valid only when the `-AsBatch` swicth is used. Otherwise, it is simply ignored. + The vault credential ID. String @@ -23474,157 +36551,74 @@ This parameter is valid only when the `-AsBatch` swicth is used. Otherwise, it i None - - TimeoutSec + + MaxRetryCount - Specifies how long the request can be pending before it times out. The default value is `0` (infinite). + The maximum number of retries for transient API failures. Int32 Int32 - 0 + None - - MaxRetryCount + + Organization - Number between `0` and `100`. -Specifies the maximum number of retries if the request fails. -The default value is `0` (No retry). -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. - + The OpenAI organization ID. - Int32 + String - Int32 + String - 0 + None - - ApiBase + + TimeoutSec - Specifies an API endpoint URL such like: `https://your-api-endpoint.test/v1` -If not specified, it will use `https://api.openai.com/v1` + The request timeout in seconds. Zero uses the module default. - System.Uri + Int32 - System.Uri + Int32 - https://api.openai.com/v1 + None - - ApiKey + + VaultId - Specifies API key for authentication. -The type of data should `[string]` or `[securestring]`. -If not specified, it will try to use `$global:OPENAI_API_KEY` or `$env:OPENAI_API_KEY` + The agent vault ID. - Object + String - Object + String None - - Organization + + WhatIf - Specifies Organization ID which used for an API request. -If not specified, it will try to use `$global:OPENAI_ORGANIZATION` or `$env:OPENAI_ORGANIZATION` + Shows what would happen if the cmdlet runs. The cmdlet is not run. - string + SwitchParameter - string + SwitchParameter - None + False - - - - - - [pscustomobject] - - - - - - - - - - - - - - -------- Example 1: Estimate the sentences that follow. -------- - Request-TextCompletion -Prompt 'This is a hamburger store.' | select Answer - -We serves --classic hamburgers --tofu burgers - - - - - - - - Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/Request-TextCompletion.md - - - https://developers.openai.com/api/docs/guides/completions/ - https://developers.openai.com/api/docs/guides/completions/ - - - https://developers.openai.com/api/reference/resources/completions/methods/create/ - https://developers.openai.com/api/reference/resources/completions/methods/create/ - - - - - - Send-RealtimeSessionEvent - Send - RealtimeSessionEvent - - Send any client event to the server. - - - - Sends an arbitrary message expressed as a JSON string to the session. This is useful for sending custom events that PSOpenAI does not support in its functions. - - - - Send-RealtimeSessionEvent - - Message - - JSON-formatted message. - - String - - String - - - None - - - - - - Message + + ProgressAction - JSON-formatted message. + Controls how PowerShell responds to progress updates. - String + ActionPreference - String + ActionPreference None @@ -23640,20 +36634,20 @@ We serves -------------------------- Example 1 -------------------------- - PS C:\> Send-RealtimeSessionEvent -Message '{"event_id": "event_567", "type": "response.cancel"}' + Set-AgentVaultCredential -VaultId 'vault_123' -CredentialId 'credential_123' -Body @{ auth = @{ token = '<new-token>' } } - + Rotates the write-only secret for a vault credential. Online Version: - https://github.com/mkht/PSOpenAI/blob/main/Docs/Send-RealtimeSessionEvent.md + https://github.com/mkht/PSOpenAI/blob/v5/Docs/Set-AgentVaultCredential.md - https://developers.openai.com/api/reference/resources/realtime/ - https://developers.openai.com/api/reference/resources/realtime/ + OpenAI Agents API + https://developers.openai.com/api/reference/typescript/resources/beta/subresources/agents diff --git a/PSOpenAI.psd1 b/PSOpenAI.psd1 index 71ed97d..4403967 100644 --- a/PSOpenAI.psd1 +++ b/PSOpenAI.psd1 @@ -84,6 +84,37 @@ 'Get-ResponseInputItem', 'Remove-Response', 'Request-ResponseCompaction', + #### Agents (Beta) #### + 'New-Agent', + 'Get-Agent', + 'Set-Agent', + 'Remove-Agent', + 'New-AgentEnvironmentTemplate', + 'Get-AgentEnvironmentTemplate', + 'Set-AgentEnvironmentTemplate', + 'Remove-AgentEnvironmentTemplate', + 'Get-AgentEnvironment', + 'Add-AgentEnvironmentFile', + 'Get-AgentEnvironmentFile', + 'New-AgentSession', + 'Get-AgentSession', + 'Set-AgentSession', + 'Remove-AgentSession', + 'Add-AgentSessionEvent', + 'Get-AgentSessionEvent', + 'Get-AgentSessionItem', + 'Get-AgentSessionTurn', + 'Get-AgentSessionSubagent', + 'Get-AgentSessionArtifact', + 'Get-AgentSessionArtifactContent', + 'Remove-AgentSessionArtifact', + 'New-AgentVault', + 'Get-AgentVault', + 'Remove-AgentVault', + 'New-AgentVaultCredential', + 'Get-AgentVaultCredential', + 'Set-AgentVaultCredential', + 'Remove-AgentVaultCredential', #### Conversations #### 'New-Conversation', 'Set-Conversation', diff --git a/Private/Get-OpenAIAPIEndpoint.ps1 b/Private/Get-OpenAIAPIEndpoint.ps1 index 3f66aeb..81d578d 100644 --- a/Private/Get-OpenAIAPIEndpoint.ps1 +++ b/Private/Get-OpenAIAPIEndpoint.ps1 @@ -270,6 +270,46 @@ function Get-OpenAIAPIEndpoint { } continue } + 'Agents' { + $UriBuilder.Path += 'agents' + @{ + Name = 'agents' + Method = 'Post' + Uri = $UriBuilder.Uri + ContentType = 'application/json' + } + continue + } + 'Agent.Environments' { + $UriBuilder.Path += 'agents/environments' + @{ + Name = 'agent_environments' + Method = 'Get' + Uri = $UriBuilder.Uri + ContentType = 'application/json' + } + continue + } + 'Agent.Sessions' { + $UriBuilder.Path += 'agents/sessions' + @{ + Name = 'agent_sessions' + Method = 'Post' + Uri = $UriBuilder.Uri + ContentType = 'application/json' + } + continue + } + 'Agent.Vaults' { + $UriBuilder.Path += 'vaults' + @{ + Name = 'agent_vaults' + Method = 'Post' + Uri = $UriBuilder.Uri + ContentType = 'application/json' + } + continue + } 'Videos' { $UriBuilder.Path += 'videos' @{ diff --git a/Private/ObjectParser.ps1 b/Private/ObjectParser.ps1 index a1ded9a..9937134 100644 --- a/Private/ObjectParser.ps1 +++ b/Private/ObjectParser.ps1 @@ -214,17 +214,21 @@ function ParseResponseObject { $StructuredOutputs = @() if ($OutputType -is [type]) { foreach ($output in $InputObject.output) { - if ($output.content.type -eq 'output_text') { - ## Deserialize JSON output to .NET object - try { - $DeserializedObject = [Newtonsoft.Json.JsonConvert]::DeserializeObject($output.content.text, $OutputType) - if ($null -ne $DeserializedObject) { - $output.content | Add-Member -MemberType NoteProperty -Name 'parsed' -Value $DeserializedObject -Force - $StructuredOutputs += $DeserializedObject + foreach ($content in $output.content) { + # Only final answer text contains the structured response. Older API + # responses do not include phase, so preserve their parsing behavior. + if ($content.type -eq 'output_text' -and ($null -eq $content.phase -or $content.phase -eq 'final_answer')) { + ## Deserialize JSON output to .NET object + try { + $DeserializedObject = [Newtonsoft.Json.JsonConvert]::DeserializeObject($content.text, $OutputType) + if ($null -ne $DeserializedObject) { + $content | Add-Member -MemberType NoteProperty -Name 'parsed' -Value $DeserializedObject -Force + $StructuredOutputs += $DeserializedObject + } + } + catch { + Write-Error -Exception $_.Exception } - } - catch { - Write-Error -Exception $_.Exception } } } @@ -450,4 +454,4 @@ function ParseVideoJobObject { } Write-Warning -Message $WarnMessage } -} \ No newline at end of file +} diff --git a/Public/Agents/Add-AgentEnvironmentFile.ps1 b/Public/Agents/Add-AgentEnvironmentFile.ps1 new file mode 100644 index 0000000..30a7529 --- /dev/null +++ b/Public/Agents/Add-AgentEnvironmentFile.ps1 @@ -0,0 +1,12 @@ +function Add-AgentEnvironmentFile { + [CmdletBinding()] [OutputType([pscustomobject])] + param( + [Parameter(Mandatory,Position=0,ValueFromPipelineByPropertyName)] [Alias('environment_id')] [string][UrlEncodeTransformation()]$EnvironmentId, + [Parameter(Mandatory,Position=1)] [System.Collections.IDictionary]$Body, + [int]$TimeoutSec=0,[ValidateRange(0,100)][int]$MaxRetryCount=0,[OpenAIApiType]$ApiType=[OpenAIApiType]::OpenAI, + [System.Uri]$ApiBase,[Parameter(DontShow)][string]$ApiVersion,[ValidateSet('openai','azure','azure_ad')][string]$AuthType='openai', + [securestring][SecureStringTransformation()]$ApiKey,[Alias('OrgId')][string]$Organization, + [System.Collections.IDictionary]$AdditionalQuery,[System.Collections.IDictionary]$AdditionalHeaders,[object]$AdditionalBody + ) + process { Invoke-AgentApiRequest -EndpointName Agent.Environments -Path "$EnvironmentId/files" -Method Post -Parameters $PSBoundParameters -Body $Body -TypeName PSOpenAI.Agent.EnvironmentFile } +} diff --git a/Public/Agents/Add-AgentSessionEvent.ps1 b/Public/Agents/Add-AgentSessionEvent.ps1 new file mode 100644 index 0000000..563b646 --- /dev/null +++ b/Public/Agents/Add-AgentSessionEvent.ps1 @@ -0,0 +1,22 @@ +function Add-AgentSessionEvent { + [CmdletBinding()] + param( + [Parameter(Mandatory,Position=0)] [Alias('session_id')] [string][UrlEncodeTransformation()]$SessionId, + [Parameter(Mandatory,Position=1)] [ValidateNotNullOrEmpty()] [object[]]$Event, + [string]$IdempotencyKey, + [int]$TimeoutSec=0,[ValidateRange(0,100)][int]$MaxRetryCount=0,[OpenAIApiType]$ApiType=[OpenAIApiType]::OpenAI, + [System.Uri]$ApiBase,[Parameter(DontShow)][string]$ApiVersion,[ValidateSet('openai','azure','azure_ad')][string]$AuthType='openai', + [securestring][SecureStringTransformation()]$ApiKey,[Alias('OrgId')][string]$Organization, + [System.Collections.IDictionary]$AdditionalQuery,[System.Collections.IDictionary]$AdditionalHeaders,[object]$AdditionalBody + ) + process { + $Body=[ordered]@{events=@($Event)} + $RequestParameters = @{} + $PSBoundParameters + if($PSBoundParameters.ContainsKey('IdempotencyKey')){ + $Headers = @{'Idempotency-Key' = $IdempotencyKey} + if($null -ne $AdditionalHeaders){ $Headers = Merge-Dictionary $Headers $AdditionalHeaders } + $RequestParameters.AdditionalHeaders = $Headers + } + Invoke-AgentApiRequest -EndpointName Agent.Sessions -Path "$SessionId/events" -Method Post -Parameters $RequestParameters -Body $Body + } +} diff --git a/Public/Agents/Get-Agent.ps1 b/Public/Agents/Get-Agent.ps1 new file mode 100644 index 0000000..3dff1f7 --- /dev/null +++ b/Public/Agents/Get-Agent.ps1 @@ -0,0 +1,19 @@ +function Get-Agent { + [CmdletBinding(DefaultParameterSetName = 'List')] [OutputType([pscustomobject])] + param( + [Parameter(ParameterSetName = 'Get', Mandatory, Position = 0, ValueFromPipeline, ValueFromPipelineByPropertyName)] [Alias('agent_id')] [string][UrlEncodeTransformation()]$AgentId, + [Parameter(ParameterSetName = 'List')] [ValidateRange(1, 100)] [int]$Limit = 20, + [Parameter(ParameterSetName = 'List')] [switch]$All, + [Parameter(ParameterSetName = 'List')] [string]$After, + [Parameter(ParameterSetName = 'List')] [ValidateSet('asc', 'desc')] [string]$Order = 'desc', + [int]$TimeoutSec = 0, [ValidateRange(0, 100)] [int]$MaxRetryCount = 0, + [OpenAIApiType]$ApiType = [OpenAIApiType]::OpenAI, [System.Uri]$ApiBase, [Parameter(DontShow)] [string]$ApiVersion, + [ValidateSet('openai', 'azure', 'azure_ad')] [string]$AuthType = 'openai', [securestring][SecureStringTransformation()]$ApiKey, + [Alias('OrgId')] [string]$Organization, [System.Collections.IDictionary]$AdditionalQuery, + [System.Collections.IDictionary]$AdditionalHeaders, [object]$AdditionalBody + ) + process { + if ($PSCmdlet.ParameterSetName -eq 'Get') { Invoke-AgentApiRequest -EndpointName Agents -Path $AgentId -Method Get -Parameters $PSBoundParameters -TypeName PSOpenAI.Agent } + else { Invoke-AgentApiRequest -EndpointName Agents -Method Get -Parameters $PSBoundParameters -Query ([ordered]@{ limit = $Limit; after = $After; order = $Order }) -All:$All -TypeName PSOpenAI.Agent } + } +} diff --git a/Public/Agents/Get-AgentEnvironment.ps1 b/Public/Agents/Get-AgentEnvironment.ps1 new file mode 100644 index 0000000..2a00ef5 --- /dev/null +++ b/Public/Agents/Get-AgentEnvironment.ps1 @@ -0,0 +1,11 @@ +function Get-AgentEnvironment { + [CmdletBinding()] [OutputType([pscustomobject])] + param( + [Parameter(Mandatory,Position=0,ValueFromPipelineByPropertyName)] [Alias('environment_id')] [string][UrlEncodeTransformation()]$EnvironmentId, + [int]$TimeoutSec=0,[ValidateRange(0,100)][int]$MaxRetryCount=0,[OpenAIApiType]$ApiType=[OpenAIApiType]::OpenAI, + [System.Uri]$ApiBase,[Parameter(DontShow)][string]$ApiVersion,[ValidateSet('openai','azure','azure_ad')][string]$AuthType='openai', + [securestring][SecureStringTransformation()]$ApiKey,[Alias('OrgId')][string]$Organization, + [System.Collections.IDictionary]$AdditionalQuery,[System.Collections.IDictionary]$AdditionalHeaders,[object]$AdditionalBody + ) + process { Invoke-AgentApiRequest -EndpointName Agent.Environments -Path $EnvironmentId -Method Get -Parameters $PSBoundParameters -TypeName PSOpenAI.Agent.Environment } +} diff --git a/Public/Agents/Get-AgentEnvironmentFile.ps1 b/Public/Agents/Get-AgentEnvironmentFile.ps1 new file mode 100644 index 0000000..7dd8843 --- /dev/null +++ b/Public/Agents/Get-AgentEnvironmentFile.ps1 @@ -0,0 +1,12 @@ +function Get-AgentEnvironmentFile { + [CmdletBinding()] [OutputType([pscustomobject])] + param( + [Parameter(Mandatory,Position=0,ValueFromPipelineByPropertyName)] [Alias('environment_id')] [string][UrlEncodeTransformation()]$EnvironmentId, + [ValidateRange(1,100)] [int]$Limit=20, [ValidateSet('asc','desc')] [string]$Order='asc', [string]$Page, [string]$Path, + [int]$TimeoutSec=0,[ValidateRange(0,100)][int]$MaxRetryCount=0,[OpenAIApiType]$ApiType=[OpenAIApiType]::OpenAI, + [System.Uri]$ApiBase,[Parameter(DontShow)][string]$ApiVersion,[ValidateSet('openai','azure','azure_ad')][string]$AuthType='openai', + [securestring][SecureStringTransformation()]$ApiKey,[Alias('OrgId')][string]$Organization, + [System.Collections.IDictionary]$AdditionalQuery,[System.Collections.IDictionary]$AdditionalHeaders,[object]$AdditionalBody + ) + process { Invoke-AgentApiRequest -EndpointName Agent.Environments -Path "$EnvironmentId/files" -Method Get -Parameters $PSBoundParameters -Query ([ordered]@{limit=$Limit;order=$Order;page=$Page;path=$Path}) -TypeName PSOpenAI.Agent.EnvironmentFile } +} diff --git a/Public/Agents/Get-AgentEnvironmentTemplate.ps1 b/Public/Agents/Get-AgentEnvironmentTemplate.ps1 new file mode 100644 index 0000000..fa7afd3 --- /dev/null +++ b/Public/Agents/Get-AgentEnvironmentTemplate.ps1 @@ -0,0 +1,16 @@ +function Get-AgentEnvironmentTemplate { + [CmdletBinding(DefaultParameterSetName='List')] [OutputType([pscustomobject])] + param( + [Parameter(ParameterSetName='Get', Mandatory, Position=0, ValueFromPipelineByPropertyName)] [Alias('environment_template_id')] [string][UrlEncodeTransformation()]$EnvironmentTemplateId, + [Parameter(ParameterSetName='List')] [ValidateRange(1,100)] [int]$Limit = 20, [Parameter(ParameterSetName='List')] [switch]$All, + [Parameter(ParameterSetName='List')] [string]$After, [Parameter(ParameterSetName='List')] [ValidateSet('asc','desc')] [string]$Order = 'desc', + [int]$TimeoutSec = 0, [ValidateRange(0,100)] [int]$MaxRetryCount = 0, [OpenAIApiType]$ApiType = [OpenAIApiType]::OpenAI, + [System.Uri]$ApiBase, [Parameter(DontShow)] [string]$ApiVersion, [ValidateSet('openai','azure','azure_ad')] [string]$AuthType = 'openai', + [securestring][SecureStringTransformation()]$ApiKey, [Alias('OrgId')] [string]$Organization, + [System.Collections.IDictionary]$AdditionalQuery, [System.Collections.IDictionary]$AdditionalHeaders, [object]$AdditionalBody + ) + process { + if ($PSCmdlet.ParameterSetName -eq 'Get') { Invoke-AgentApiRequest -EndpointName Agent.Environments -Path "templates/$EnvironmentTemplateId" -Method Get -Parameters $PSBoundParameters -TypeName PSOpenAI.Agent.EnvironmentTemplate } + else { Invoke-AgentApiRequest -EndpointName Agent.Environments -Path templates -Method Get -Parameters $PSBoundParameters -Query ([ordered]@{limit=$Limit;after=$After;order=$Order}) -All:$All -TypeName PSOpenAI.Agent.EnvironmentTemplate } + } +} diff --git a/Public/Agents/Get-AgentSession.ps1 b/Public/Agents/Get-AgentSession.ps1 new file mode 100644 index 0000000..c26d5c6 --- /dev/null +++ b/Public/Agents/Get-AgentSession.ps1 @@ -0,0 +1,17 @@ +function Get-AgentSession { + [CmdletBinding(DefaultParameterSetName='List')] [OutputType([pscustomobject])] + param( + [Parameter(ParameterSetName='Get',Mandatory,Position=0,ValueFromPipelineByPropertyName)] [Alias('session_id')] [string][UrlEncodeTransformation()]$SessionId, + [Parameter(ParameterSetName='List')] [string]$AgentId, [Parameter(ParameterSetName='List')] [ValidateRange(1,100)] [int]$Limit=20, + [Parameter(ParameterSetName='List')] [switch]$All, [Parameter(ParameterSetName='List')] [string]$After, + [Parameter(ParameterSetName='List')] [ValidateSet('asc','desc')] [string]$Order='desc', + [int]$TimeoutSec=0,[ValidateRange(0,100)][int]$MaxRetryCount=0,[OpenAIApiType]$ApiType=[OpenAIApiType]::OpenAI, + [System.Uri]$ApiBase,[Parameter(DontShow)][string]$ApiVersion,[ValidateSet('openai','azure','azure_ad')][string]$AuthType='openai', + [securestring][SecureStringTransformation()]$ApiKey,[Alias('OrgId')][string]$Organization, + [System.Collections.IDictionary]$AdditionalQuery,[System.Collections.IDictionary]$AdditionalHeaders,[object]$AdditionalBody + ) + process { + if($PSCmdlet.ParameterSetName -eq 'Get'){ Invoke-AgentApiRequest -EndpointName Agent.Sessions -Path $SessionId -Method Get -Parameters $PSBoundParameters -TypeName PSOpenAI.Agent.Session } + else { Invoke-AgentApiRequest -EndpointName Agent.Sessions -Method Get -Parameters $PSBoundParameters -Query ([ordered]@{agent_id=$AgentId;limit=$Limit;after=$After;order=$Order}) -All:$All -TypeName PSOpenAI.Agent.Session } + } +} diff --git a/Public/Agents/Get-AgentSessionArtifact.ps1 b/Public/Agents/Get-AgentSessionArtifact.ps1 new file mode 100644 index 0000000..69a050f --- /dev/null +++ b/Public/Agents/Get-AgentSessionArtifact.ps1 @@ -0,0 +1,16 @@ +function Get-AgentSessionArtifact { + [CmdletBinding()] [OutputType([pscustomobject])] + param( + [Parameter(Mandatory,Position=0)] [Alias('session_id')] [string][UrlEncodeTransformation()]$SessionId, + [string][UrlEncodeTransformation()]$ArtifactId, [string]$EnvironmentId, + [ValidateRange(1,100)] [int]$Limit=20, [switch]$All, [string]$After, [ValidateSet('asc','desc')] [string]$Order='desc', + [int]$TimeoutSec=0,[ValidateRange(0,100)][int]$MaxRetryCount=0,[OpenAIApiType]$ApiType=[OpenAIApiType]::OpenAI, + [System.Uri]$ApiBase,[Parameter(DontShow)][string]$ApiVersion,[ValidateSet('openai','azure','azure_ad')][string]$AuthType='openai', + [securestring][SecureStringTransformation()]$ApiKey,[Alias('OrgId')][string]$Organization, + [System.Collections.IDictionary]$AdditionalQuery,[System.Collections.IDictionary]$AdditionalHeaders,[object]$AdditionalBody + ) + process { + $Path=if($ArtifactId){"$SessionId/artifacts/$ArtifactId"}else{"$SessionId/artifacts"}; $Query=if($ArtifactId){$null}else{[ordered]@{environment_id=$EnvironmentId;limit=$Limit;after=$After;order=$Order}} + Invoke-AgentApiRequest -EndpointName Agent.Sessions -Path $Path -Method Get -Parameters $PSBoundParameters -Query $Query -All:($All -and -not $ArtifactId) -TypeName PSOpenAI.Agent.Session.Artifact + } +} diff --git a/Public/Agents/Get-AgentSessionArtifactContent.ps1 b/Public/Agents/Get-AgentSessionArtifactContent.ps1 new file mode 100644 index 0000000..629ca25 --- /dev/null +++ b/Public/Agents/Get-AgentSessionArtifactContent.ps1 @@ -0,0 +1,13 @@ +function Get-AgentSessionArtifactContent { + [CmdletBinding()] [OutputType([byte[]])] + param( + [Parameter(Mandatory,Position=0)] [Alias('session_id')] [string][UrlEncodeTransformation()]$SessionId, + [Parameter(Mandatory,Position=1,ValueFromPipelineByPropertyName)] [Alias('artifact_id')] [string][UrlEncodeTransformation()]$ArtifactId, + [string]$OutFile, + [int]$TimeoutSec=0,[ValidateRange(0,100)][int]$MaxRetryCount=0,[OpenAIApiType]$ApiType=[OpenAIApiType]::OpenAI, + [System.Uri]$ApiBase,[Parameter(DontShow)][string]$ApiVersion,[ValidateSet('openai','azure','azure_ad')][string]$AuthType='openai', + [securestring][SecureStringTransformation()]$ApiKey,[Alias('OrgId')][string]$Organization, + [System.Collections.IDictionary]$AdditionalQuery,[System.Collections.IDictionary]$AdditionalHeaders + ) + process { Invoke-AgentApiRequest -EndpointName Agent.Sessions -Path "$SessionId/artifacts/$ArtifactId/content" -Method Get -Parameters $PSBoundParameters -Binary -OutFile $OutFile } +} diff --git a/Public/Agents/Get-AgentSessionEvent.ps1 b/Public/Agents/Get-AgentSessionEvent.ps1 new file mode 100644 index 0000000..c55ccef --- /dev/null +++ b/Public/Agents/Get-AgentSessionEvent.ps1 @@ -0,0 +1,11 @@ +function Get-AgentSessionEvent { + [CmdletBinding()] [OutputType([pscustomobject])] + param( + [Parameter(Mandatory,Position=0,ValueFromPipelineByPropertyName)] [Alias('session_id')] [string][UrlEncodeTransformation()]$SessionId, + [int]$TimeoutSec=0,[ValidateRange(0,100)][int]$MaxRetryCount=0,[OpenAIApiType]$ApiType=[OpenAIApiType]::OpenAI, + [System.Uri]$ApiBase,[Parameter(DontShow)][string]$ApiVersion,[ValidateSet('openai','azure','azure_ad')][string]$AuthType='openai', + [securestring][SecureStringTransformation()]$ApiKey,[Alias('OrgId')][string]$Organization, + [System.Collections.IDictionary]$AdditionalQuery,[System.Collections.IDictionary]$AdditionalHeaders + ) + process { Invoke-AgentApiRequest -EndpointName Agent.Sessions -Path "$SessionId/events" -Method Get -Parameters $PSBoundParameters -Stream } +} diff --git a/Public/Agents/Get-AgentSessionItem.ps1 b/Public/Agents/Get-AgentSessionItem.ps1 new file mode 100644 index 0000000..2e3d5e4 --- /dev/null +++ b/Public/Agents/Get-AgentSessionItem.ps1 @@ -0,0 +1,17 @@ +function Get-AgentSessionItem { + [CmdletBinding()] [OutputType([pscustomobject])] + param( + [Parameter(Mandatory,Position=0)] [Alias('session_id')] [string][UrlEncodeTransformation()]$SessionId, + [string][UrlEncodeTransformation()]$SubagentId, [string][UrlEncodeTransformation()]$TurnId, + [ValidateRange(1,100)] [int]$Limit=20, [switch]$All, [string]$After, [ValidateSet('asc','desc')] [string]$Order='asc', + [int]$TimeoutSec=0,[ValidateRange(0,100)][int]$MaxRetryCount=0,[OpenAIApiType]$ApiType=[OpenAIApiType]::OpenAI, + [System.Uri]$ApiBase,[Parameter(DontShow)][string]$ApiVersion,[ValidateSet('openai','azure','azure_ad')][string]$AuthType='openai', + [securestring][SecureStringTransformation()]$ApiKey,[Alias('OrgId')][string]$Organization, + [System.Collections.IDictionary]$AdditionalQuery,[System.Collections.IDictionary]$AdditionalHeaders,[object]$AdditionalBody + ) + process { + if($TurnId -and -not $SubagentId){ throw [System.ArgumentException]::new('TurnId requires SubagentId.') } + $Path=if($TurnId){"$SessionId/subagents/$SubagentId/turns/$TurnId/items"}elseif($SubagentId){"$SessionId/subagents/$SubagentId/items"}else{"$SessionId/items"} + Invoke-AgentApiRequest -EndpointName Agent.Sessions -Path $Path -Method Get -Parameters $PSBoundParameters -Query ([ordered]@{limit=$Limit;after=$After;order=$Order}) -All:$All -TypeName PSOpenAI.Agent.Session.Item + } +} diff --git a/Public/Agents/Get-AgentSessionSubagent.ps1 b/Public/Agents/Get-AgentSessionSubagent.ps1 new file mode 100644 index 0000000..0e21043 --- /dev/null +++ b/Public/Agents/Get-AgentSessionSubagent.ps1 @@ -0,0 +1,16 @@ +function Get-AgentSessionSubagent { + [CmdletBinding()] [OutputType([pscustomobject])] + param( + [Parameter(Mandatory,Position=0)] [Alias('session_id')] [string][UrlEncodeTransformation()]$SessionId, + [string][UrlEncodeTransformation()]$SubagentId, + [ValidateRange(1,100)] [int]$Limit=20, [switch]$All, [string]$After, [ValidateSet('asc','desc')] [string]$Order='asc', + [int]$TimeoutSec=0,[ValidateRange(0,100)][int]$MaxRetryCount=0,[OpenAIApiType]$ApiType=[OpenAIApiType]::OpenAI, + [System.Uri]$ApiBase,[Parameter(DontShow)][string]$ApiVersion,[ValidateSet('openai','azure','azure_ad')][string]$AuthType='openai', + [securestring][SecureStringTransformation()]$ApiKey,[Alias('OrgId')][string]$Organization, + [System.Collections.IDictionary]$AdditionalQuery,[System.Collections.IDictionary]$AdditionalHeaders,[object]$AdditionalBody + ) + process { + $Path=if($SubagentId){"$SessionId/subagents/$SubagentId"}else{"$SessionId/subagents"}; $Query=if($SubagentId){$null}else{[ordered]@{limit=$Limit;after=$After;order=$Order}} + Invoke-AgentApiRequest -EndpointName Agent.Sessions -Path $Path -Method Get -Parameters $PSBoundParameters -Query $Query -All:($All -and -not $SubagentId) -TypeName PSOpenAI.Agent.Session.Subagent + } +} diff --git a/Public/Agents/Get-AgentSessionTurn.ps1 b/Public/Agents/Get-AgentSessionTurn.ps1 new file mode 100644 index 0000000..7dbc345 --- /dev/null +++ b/Public/Agents/Get-AgentSessionTurn.ps1 @@ -0,0 +1,17 @@ +function Get-AgentSessionTurn { + [CmdletBinding()] [OutputType([pscustomobject])] + param( + [Parameter(Mandatory,Position=0)] [Alias('session_id')] [string][UrlEncodeTransformation()]$SessionId, + [string][UrlEncodeTransformation()]$SubagentId, [string][UrlEncodeTransformation()]$TurnId, + [ValidateRange(1,100)] [int]$Limit=20, [switch]$All, [string]$After, [ValidateSet('asc','desc')] [string]$Order='asc', + [int]$TimeoutSec=0,[ValidateRange(0,100)][int]$MaxRetryCount=0,[OpenAIApiType]$ApiType=[OpenAIApiType]::OpenAI, + [System.Uri]$ApiBase,[Parameter(DontShow)][string]$ApiVersion,[ValidateSet('openai','azure','azure_ad')][string]$AuthType='openai', + [securestring][SecureStringTransformation()]$ApiKey,[Alias('OrgId')][string]$Organization, + [System.Collections.IDictionary]$AdditionalQuery,[System.Collections.IDictionary]$AdditionalHeaders,[object]$AdditionalBody + ) + process { + $Base=if($SubagentId){"$SessionId/subagents/$SubagentId/turns"}else{"$SessionId/turns"}; $Path=if($TurnId){"$Base/$TurnId"}else{$Base} + $Query=if($TurnId){$null}else{[ordered]@{limit=$Limit;after=$After;order=$Order}} + Invoke-AgentApiRequest -EndpointName Agent.Sessions -Path $Path -Method Get -Parameters $PSBoundParameters -Query $Query -All:($All -and -not $TurnId) -TypeName PSOpenAI.Agent.Session.Turn + } +} diff --git a/Public/Agents/Get-AgentVault.ps1 b/Public/Agents/Get-AgentVault.ps1 new file mode 100644 index 0000000..dbd0016 --- /dev/null +++ b/Public/Agents/Get-AgentVault.ps1 @@ -0,0 +1,17 @@ +function Get-AgentVault { + [CmdletBinding(DefaultParameterSetName='List')] [OutputType([pscustomobject])] + param( + [Parameter(ParameterSetName='Get',Mandatory,Position=0,ValueFromPipelineByPropertyName)] [Alias('vault_id')] [string][UrlEncodeTransformation()]$VaultId, + [Parameter(ParameterSetName='List')] [ValidateSet('active','archived')] [string[]]$Status, + [Parameter(ParameterSetName='List')] [ValidateRange(1,100)] [int]$Limit=20,[Parameter(ParameterSetName='List')] [switch]$All, + [Parameter(ParameterSetName='List')] [string]$After,[Parameter(ParameterSetName='List')] [ValidateSet('asc','desc')] [string]$Order='desc', + [int]$TimeoutSec=0,[ValidateRange(0,100)][int]$MaxRetryCount=0,[OpenAIApiType]$ApiType=[OpenAIApiType]::OpenAI, + [System.Uri]$ApiBase,[Parameter(DontShow)][string]$ApiVersion,[ValidateSet('openai','azure','azure_ad')][string]$AuthType='openai', + [securestring][SecureStringTransformation()]$ApiKey,[Alias('OrgId')][string]$Organization, + [System.Collections.IDictionary]$AdditionalQuery,[System.Collections.IDictionary]$AdditionalHeaders,[object]$AdditionalBody + ) + process { + if($PSCmdlet.ParameterSetName -eq 'Get'){Invoke-AgentApiRequest -EndpointName Agent.Vaults -Path $VaultId -Method Get -Parameters $PSBoundParameters -TypeName PSOpenAI.Agent.Vault} + else{Invoke-AgentApiRequest -EndpointName Agent.Vaults -Method Get -Parameters $PSBoundParameters -Query ([ordered]@{status=$Status;limit=$Limit;after=$After;order=$Order}) -All:$All -TypeName PSOpenAI.Agent.Vault} + } +} diff --git a/Public/Agents/Get-AgentVaultCredential.ps1 b/Public/Agents/Get-AgentVaultCredential.ps1 new file mode 100644 index 0000000..382a616 --- /dev/null +++ b/Public/Agents/Get-AgentVaultCredential.ps1 @@ -0,0 +1,16 @@ +function Get-AgentVaultCredential { + [CmdletBinding()] [OutputType([pscustomobject])] + param( + [Parameter(Mandatory,Position=0)] [Alias('vault_id')] [string][UrlEncodeTransformation()]$VaultId, + [string][UrlEncodeTransformation()]$CredentialId,[ValidateSet('active','archived')][string[]]$Status, + [ValidateRange(1,100)][int]$Limit=20,[switch]$All,[string]$After,[ValidateSet('asc','desc')][string]$Order='desc', + [int]$TimeoutSec=0,[ValidateRange(0,100)][int]$MaxRetryCount=0,[OpenAIApiType]$ApiType=[OpenAIApiType]::OpenAI, + [System.Uri]$ApiBase,[Parameter(DontShow)][string]$ApiVersion,[ValidateSet('openai','azure','azure_ad')][string]$AuthType='openai', + [securestring][SecureStringTransformation()]$ApiKey,[Alias('OrgId')][string]$Organization, + [System.Collections.IDictionary]$AdditionalQuery,[System.Collections.IDictionary]$AdditionalHeaders,[object]$AdditionalBody + ) + process{ + $Path=if($CredentialId){"$VaultId/credentials/$CredentialId"}else{"$VaultId/credentials"};$Query=if($CredentialId){$null}else{[ordered]@{status=$Status;limit=$Limit;after=$After;order=$Order}} + Invoke-AgentApiRequest -EndpointName Agent.Vaults -Path $Path -Method Get -Parameters $PSBoundParameters -Query $Query -All:($All -and -not $CredentialId) -TypeName PSOpenAI.Agent.Vault.Credential + } +} diff --git a/Public/Agents/New-Agent.ps1 b/Public/Agents/New-Agent.ps1 new file mode 100644 index 0000000..a1c8999 --- /dev/null +++ b/Public/Agents/New-Agent.ps1 @@ -0,0 +1,14 @@ +function New-Agent { + [CmdletBinding()] [OutputType([pscustomobject])] + param( + [Parameter(Mandatory, Position = 0)] [System.Collections.IDictionary]$Body, + [int]$TimeoutSec = 0, [ValidateRange(0, 100)] [int]$MaxRetryCount = 0, + [OpenAIApiType]$ApiType = [OpenAIApiType]::OpenAI, [System.Uri]$ApiBase, + [Parameter(DontShow)] [string]$ApiVersion, + [ValidateSet('openai', 'azure', 'azure_ad')] [string]$AuthType = 'openai', + [securestring][SecureStringTransformation()]$ApiKey, [Alias('OrgId')] [string]$Organization, + [System.Collections.IDictionary]$AdditionalQuery, [System.Collections.IDictionary]$AdditionalHeaders, + [object]$AdditionalBody + ) + process { Invoke-AgentApiRequest -EndpointName Agents -Method Post -Parameters $PSBoundParameters -Body $Body -TypeName PSOpenAI.Agent } +} diff --git a/Public/Agents/New-AgentEnvironmentTemplate.ps1 b/Public/Agents/New-AgentEnvironmentTemplate.ps1 new file mode 100644 index 0000000..e18500d --- /dev/null +++ b/Public/Agents/New-AgentEnvironmentTemplate.ps1 @@ -0,0 +1,11 @@ +function New-AgentEnvironmentTemplate { + [CmdletBinding()] [OutputType([pscustomobject])] + param( + [Parameter(Position = 0)] [System.Collections.IDictionary]$Body = @{}, + [int]$TimeoutSec = 0, [ValidateRange(0,100)] [int]$MaxRetryCount = 0, [OpenAIApiType]$ApiType = [OpenAIApiType]::OpenAI, + [System.Uri]$ApiBase, [Parameter(DontShow)] [string]$ApiVersion, [ValidateSet('openai','azure','azure_ad')] [string]$AuthType = 'openai', + [securestring][SecureStringTransformation()]$ApiKey, [Alias('OrgId')] [string]$Organization, + [System.Collections.IDictionary]$AdditionalQuery, [System.Collections.IDictionary]$AdditionalHeaders, [object]$AdditionalBody + ) + process { Invoke-AgentApiRequest -EndpointName Agent.Environments -Path templates -Method Post -Parameters $PSBoundParameters -Body $Body -TypeName PSOpenAI.Agent.EnvironmentTemplate } +} diff --git a/Public/Agents/New-AgentSession.ps1 b/Public/Agents/New-AgentSession.ps1 new file mode 100644 index 0000000..747cdc0 --- /dev/null +++ b/Public/Agents/New-AgentSession.ps1 @@ -0,0 +1,16 @@ +function New-AgentSession { + [CmdletBinding()] [OutputType([pscustomobject])] + param( + [Parameter(Mandatory,Position=0)] [System.Collections.IDictionary]$Body, [switch]$Stream, + [int]$TimeoutSec=0,[ValidateRange(0,100)][int]$MaxRetryCount=0,[OpenAIApiType]$ApiType=[OpenAIApiType]::OpenAI, + [System.Uri]$ApiBase,[Parameter(DontShow)][string]$ApiVersion,[ValidateSet('openai','azure','azure_ad')][string]$AuthType='openai', + [securestring][SecureStringTransformation()]$ApiKey,[Alias('OrgId')][string]$Organization, + [System.Collections.IDictionary]$AdditionalQuery,[System.Collections.IDictionary]$AdditionalHeaders,[object]$AdditionalBody + ) + process { + $RequestBody = [ordered]@{} + foreach($Entry in $Body.GetEnumerator()){ $RequestBody[$Entry.Key] = $Entry.Value } + if($Stream){ $RequestBody.stream = $true } + Invoke-AgentApiRequest -EndpointName Agent.Sessions -Method Post -Parameters $PSBoundParameters -Body $RequestBody -Stream:$Stream -TypeName PSOpenAI.Agent.Session + } +} diff --git a/Public/Agents/New-AgentVault.ps1 b/Public/Agents/New-AgentVault.ps1 new file mode 100644 index 0000000..3ad7167 --- /dev/null +++ b/Public/Agents/New-AgentVault.ps1 @@ -0,0 +1,11 @@ +function New-AgentVault { + [CmdletBinding()] [OutputType([pscustomobject])] + param( + [Parameter(Position=0)] [System.Collections.IDictionary]$Body=@{}, + [int]$TimeoutSec=0,[ValidateRange(0,100)][int]$MaxRetryCount=0,[OpenAIApiType]$ApiType=[OpenAIApiType]::OpenAI, + [System.Uri]$ApiBase,[Parameter(DontShow)][string]$ApiVersion,[ValidateSet('openai','azure','azure_ad')][string]$AuthType='openai', + [securestring][SecureStringTransformation()]$ApiKey,[Alias('OrgId')][string]$Organization, + [System.Collections.IDictionary]$AdditionalQuery,[System.Collections.IDictionary]$AdditionalHeaders,[object]$AdditionalBody + ) + process { Invoke-AgentApiRequest -EndpointName Agent.Vaults -Method Post -Parameters $PSBoundParameters -Body $Body -TypeName PSOpenAI.Agent.Vault } +} diff --git a/Public/Agents/New-AgentVaultCredential.ps1 b/Public/Agents/New-AgentVaultCredential.ps1 new file mode 100644 index 0000000..3a8260d --- /dev/null +++ b/Public/Agents/New-AgentVaultCredential.ps1 @@ -0,0 +1,12 @@ +function New-AgentVaultCredential { + [CmdletBinding()] [OutputType([pscustomobject])] + param( + [Parameter(Mandatory,Position=0)] [Alias('vault_id')] [string][UrlEncodeTransformation()]$VaultId, + [Parameter(Mandatory,Position=1)] [System.Collections.IDictionary]$Body, + [int]$TimeoutSec=0,[ValidateRange(0,100)][int]$MaxRetryCount=0,[OpenAIApiType]$ApiType=[OpenAIApiType]::OpenAI, + [System.Uri]$ApiBase,[Parameter(DontShow)][string]$ApiVersion,[ValidateSet('openai','azure','azure_ad')][string]$AuthType='openai', + [securestring][SecureStringTransformation()]$ApiKey,[Alias('OrgId')][string]$Organization, + [System.Collections.IDictionary]$AdditionalQuery,[System.Collections.IDictionary]$AdditionalHeaders,[object]$AdditionalBody + ) + process{Invoke-AgentApiRequest -EndpointName Agent.Vaults -Path "$VaultId/credentials" -Method Post -Parameters $PSBoundParameters -Body $Body -TypeName PSOpenAI.Agent.Vault.Credential} +} diff --git a/Public/Agents/Remove-Agent.ps1 b/Public/Agents/Remove-Agent.ps1 new file mode 100644 index 0000000..6b4d03c --- /dev/null +++ b/Public/Agents/Remove-Agent.ps1 @@ -0,0 +1,11 @@ +function Remove-Agent { + [CmdletBinding(SupportsShouldProcess, ConfirmImpact = 'High')] [OutputType([pscustomobject])] + param( + [Parameter(Mandatory, Position = 0, ValueFromPipelineByPropertyName)] [Alias('agent_id')] [string][UrlEncodeTransformation()]$AgentId, + [int]$TimeoutSec = 0, [ValidateRange(0, 100)] [int]$MaxRetryCount = 0, [OpenAIApiType]$ApiType = [OpenAIApiType]::OpenAI, + [System.Uri]$ApiBase, [Parameter(DontShow)] [string]$ApiVersion, [ValidateSet('openai', 'azure', 'azure_ad')] [string]$AuthType = 'openai', + [securestring][SecureStringTransformation()]$ApiKey, [Alias('OrgId')] [string]$Organization, + [System.Collections.IDictionary]$AdditionalQuery, [System.Collections.IDictionary]$AdditionalHeaders, [object]$AdditionalBody + ) + process { if ($PSCmdlet.ShouldProcess($AgentId, 'Delete agent')) { Invoke-AgentApiRequest -EndpointName Agents -Path $AgentId -Method Delete -Parameters $PSBoundParameters -TypeName PSOpenAI.Agent.Deleted } } +} diff --git a/Public/Agents/Remove-AgentEnvironmentTemplate.ps1 b/Public/Agents/Remove-AgentEnvironmentTemplate.ps1 new file mode 100644 index 0000000..a972d25 --- /dev/null +++ b/Public/Agents/Remove-AgentEnvironmentTemplate.ps1 @@ -0,0 +1,11 @@ +function Remove-AgentEnvironmentTemplate { + [CmdletBinding(SupportsShouldProcess,ConfirmImpact='High')] [OutputType([pscustomobject])] + param( + [Parameter(Mandatory,Position=0,ValueFromPipelineByPropertyName)] [Alias('environment_template_id')] [string][UrlEncodeTransformation()]$EnvironmentTemplateId, + [int]$TimeoutSec=0,[ValidateRange(0,100)][int]$MaxRetryCount=0,[OpenAIApiType]$ApiType=[OpenAIApiType]::OpenAI, + [System.Uri]$ApiBase,[Parameter(DontShow)][string]$ApiVersion,[ValidateSet('openai','azure','azure_ad')][string]$AuthType='openai', + [securestring][SecureStringTransformation()]$ApiKey,[Alias('OrgId')][string]$Organization, + [System.Collections.IDictionary]$AdditionalQuery,[System.Collections.IDictionary]$AdditionalHeaders,[object]$AdditionalBody + ) + process { if ($PSCmdlet.ShouldProcess($EnvironmentTemplateId,'Delete agent environment template')) { Invoke-AgentApiRequest -EndpointName Agent.Environments -Path "templates/$EnvironmentTemplateId" -Method Delete -Parameters $PSBoundParameters -TypeName PSOpenAI.Agent.EnvironmentTemplate.Deleted } } +} diff --git a/Public/Agents/Remove-AgentSession.ps1 b/Public/Agents/Remove-AgentSession.ps1 new file mode 100644 index 0000000..c798c27 --- /dev/null +++ b/Public/Agents/Remove-AgentSession.ps1 @@ -0,0 +1,11 @@ +function Remove-AgentSession { + [CmdletBinding(SupportsShouldProcess,ConfirmImpact='High')] [OutputType([pscustomobject])] + param( + [Parameter(Mandatory,Position=0,ValueFromPipelineByPropertyName)] [Alias('session_id')] [string][UrlEncodeTransformation()]$SessionId, + [int]$TimeoutSec=0,[ValidateRange(0,100)][int]$MaxRetryCount=0,[OpenAIApiType]$ApiType=[OpenAIApiType]::OpenAI, + [System.Uri]$ApiBase,[Parameter(DontShow)][string]$ApiVersion,[ValidateSet('openai','azure','azure_ad')][string]$AuthType='openai', + [securestring][SecureStringTransformation()]$ApiKey,[Alias('OrgId')][string]$Organization, + [System.Collections.IDictionary]$AdditionalQuery,[System.Collections.IDictionary]$AdditionalHeaders,[object]$AdditionalBody + ) + process { if($PSCmdlet.ShouldProcess($SessionId,'Delete agent session')){ Invoke-AgentApiRequest -EndpointName Agent.Sessions -Path $SessionId -Method Delete -Parameters $PSBoundParameters -TypeName PSOpenAI.Agent.Session.Deleted } } +} diff --git a/Public/Agents/Remove-AgentSessionArtifact.ps1 b/Public/Agents/Remove-AgentSessionArtifact.ps1 new file mode 100644 index 0000000..d66d792 --- /dev/null +++ b/Public/Agents/Remove-AgentSessionArtifact.ps1 @@ -0,0 +1,12 @@ +function Remove-AgentSessionArtifact { + [CmdletBinding(SupportsShouldProcess,ConfirmImpact='High')] [OutputType([pscustomobject])] + param( + [Parameter(Mandatory,Position=0)] [Alias('session_id')] [string][UrlEncodeTransformation()]$SessionId, + [Parameter(Mandatory,Position=1,ValueFromPipelineByPropertyName)] [Alias('artifact_id')] [string][UrlEncodeTransformation()]$ArtifactId, + [int]$TimeoutSec=0,[ValidateRange(0,100)][int]$MaxRetryCount=0,[OpenAIApiType]$ApiType=[OpenAIApiType]::OpenAI, + [System.Uri]$ApiBase,[Parameter(DontShow)][string]$ApiVersion,[ValidateSet('openai','azure','azure_ad')][string]$AuthType='openai', + [securestring][SecureStringTransformation()]$ApiKey,[Alias('OrgId')][string]$Organization, + [System.Collections.IDictionary]$AdditionalQuery,[System.Collections.IDictionary]$AdditionalHeaders,[object]$AdditionalBody + ) + process { if($PSCmdlet.ShouldProcess($ArtifactId,'Delete agent session artifact')){ Invoke-AgentApiRequest -EndpointName Agent.Sessions -Path "$SessionId/artifacts/$ArtifactId" -Method Delete -Parameters $PSBoundParameters -TypeName PSOpenAI.Agent.Session.Artifact.Deleted } } +} diff --git a/Public/Agents/Remove-AgentVault.ps1 b/Public/Agents/Remove-AgentVault.ps1 new file mode 100644 index 0000000..d1feec3 --- /dev/null +++ b/Public/Agents/Remove-AgentVault.ps1 @@ -0,0 +1,11 @@ +function Remove-AgentVault { + [CmdletBinding(SupportsShouldProcess,ConfirmImpact='High')] [OutputType([pscustomobject])] + param( + [Parameter(Mandatory,Position=0,ValueFromPipelineByPropertyName)] [Alias('vault_id')] [string][UrlEncodeTransformation()]$VaultId, + [int]$TimeoutSec=0,[ValidateRange(0,100)][int]$MaxRetryCount=0,[OpenAIApiType]$ApiType=[OpenAIApiType]::OpenAI, + [System.Uri]$ApiBase,[Parameter(DontShow)][string]$ApiVersion,[ValidateSet('openai','azure','azure_ad')][string]$AuthType='openai', + [securestring][SecureStringTransformation()]$ApiKey,[Alias('OrgId')][string]$Organization, + [System.Collections.IDictionary]$AdditionalQuery,[System.Collections.IDictionary]$AdditionalHeaders,[object]$AdditionalBody + ) + process {if($PSCmdlet.ShouldProcess($VaultId,'Delete agent vault')){Invoke-AgentApiRequest -EndpointName Agent.Vaults -Path $VaultId -Method Delete -Parameters $PSBoundParameters -TypeName PSOpenAI.Agent.Vault.Deleted}} +} diff --git a/Public/Agents/Remove-AgentVaultCredential.ps1 b/Public/Agents/Remove-AgentVaultCredential.ps1 new file mode 100644 index 0000000..abc6c4d --- /dev/null +++ b/Public/Agents/Remove-AgentVaultCredential.ps1 @@ -0,0 +1,12 @@ +function Remove-AgentVaultCredential { + [CmdletBinding(SupportsShouldProcess,ConfirmImpact='High')] [OutputType([pscustomobject])] + param( + [Parameter(Mandatory,Position=0)] [Alias('vault_id')] [string][UrlEncodeTransformation()]$VaultId, + [Parameter(Mandatory,Position=1,ValueFromPipelineByPropertyName)] [Alias('credential_id')] [string][UrlEncodeTransformation()]$CredentialId, + [int]$TimeoutSec=0,[ValidateRange(0,100)][int]$MaxRetryCount=0,[OpenAIApiType]$ApiType=[OpenAIApiType]::OpenAI, + [System.Uri]$ApiBase,[Parameter(DontShow)][string]$ApiVersion,[ValidateSet('openai','azure','azure_ad')][string]$AuthType='openai', + [securestring][SecureStringTransformation()]$ApiKey,[Alias('OrgId')][string]$Organization, + [System.Collections.IDictionary]$AdditionalQuery,[System.Collections.IDictionary]$AdditionalHeaders,[object]$AdditionalBody + ) + process{if($PSCmdlet.ShouldProcess($CredentialId,'Delete agent vault credential')){Invoke-AgentApiRequest -EndpointName Agent.Vaults -Path "$VaultId/credentials/$CredentialId" -Method Delete -Parameters $PSBoundParameters -TypeName PSOpenAI.Agent.Vault.Credential.Deleted}} +} diff --git a/Public/Agents/Set-Agent.ps1 b/Public/Agents/Set-Agent.ps1 new file mode 100644 index 0000000..894206b --- /dev/null +++ b/Public/Agents/Set-Agent.ps1 @@ -0,0 +1,12 @@ +function Set-Agent { + [CmdletBinding(SupportsShouldProcess)] [OutputType([pscustomobject])] + param( + [Parameter(Mandatory, Position = 0, ValueFromPipelineByPropertyName)] [Alias('agent_id')] [string][UrlEncodeTransformation()]$AgentId, + [Parameter(Mandatory, Position = 1)] [System.Collections.IDictionary]$Body, + [int]$TimeoutSec = 0, [ValidateRange(0, 100)] [int]$MaxRetryCount = 0, [OpenAIApiType]$ApiType = [OpenAIApiType]::OpenAI, + [System.Uri]$ApiBase, [Parameter(DontShow)] [string]$ApiVersion, [ValidateSet('openai', 'azure', 'azure_ad')] [string]$AuthType = 'openai', + [securestring][SecureStringTransformation()]$ApiKey, [Alias('OrgId')] [string]$Organization, + [System.Collections.IDictionary]$AdditionalQuery, [System.Collections.IDictionary]$AdditionalHeaders, [object]$AdditionalBody + ) + process { if ($PSCmdlet.ShouldProcess($AgentId, 'Update agent')) { Invoke-AgentApiRequest -EndpointName Agents -Path $AgentId -Method Post -Parameters $PSBoundParameters -Body $Body -TypeName PSOpenAI.Agent } } +} diff --git a/Public/Agents/Set-AgentEnvironmentTemplate.ps1 b/Public/Agents/Set-AgentEnvironmentTemplate.ps1 new file mode 100644 index 0000000..01b43c1 --- /dev/null +++ b/Public/Agents/Set-AgentEnvironmentTemplate.ps1 @@ -0,0 +1,12 @@ +function Set-AgentEnvironmentTemplate { + [CmdletBinding(SupportsShouldProcess)] [OutputType([pscustomobject])] + param( + [Parameter(Mandatory, Position=0, ValueFromPipelineByPropertyName)] [Alias('environment_template_id')] [string][UrlEncodeTransformation()]$EnvironmentTemplateId, + [Parameter(Mandatory, Position=1)] [System.Collections.IDictionary]$Body, + [int]$TimeoutSec=0, [ValidateRange(0,100)] [int]$MaxRetryCount=0, [OpenAIApiType]$ApiType=[OpenAIApiType]::OpenAI, + [System.Uri]$ApiBase, [Parameter(DontShow)] [string]$ApiVersion, [ValidateSet('openai','azure','azure_ad')] [string]$AuthType='openai', + [securestring][SecureStringTransformation()]$ApiKey, [Alias('OrgId')] [string]$Organization, + [System.Collections.IDictionary]$AdditionalQuery, [System.Collections.IDictionary]$AdditionalHeaders, [object]$AdditionalBody + ) + process { if ($PSCmdlet.ShouldProcess($EnvironmentTemplateId,'Update agent environment template')) { Invoke-AgentApiRequest -EndpointName Agent.Environments -Path "templates/$EnvironmentTemplateId" -Method Post -Parameters $PSBoundParameters -Body $Body -TypeName PSOpenAI.Agent.EnvironmentTemplate } } +} diff --git a/Public/Agents/Set-AgentSession.ps1 b/Public/Agents/Set-AgentSession.ps1 new file mode 100644 index 0000000..c487975 --- /dev/null +++ b/Public/Agents/Set-AgentSession.ps1 @@ -0,0 +1,12 @@ +function Set-AgentSession { + [CmdletBinding(SupportsShouldProcess)] [OutputType([pscustomobject])] + param( + [Parameter(Mandatory,Position=0,ValueFromPipelineByPropertyName)] [Alias('session_id')] [string][UrlEncodeTransformation()]$SessionId, + [Parameter(Mandatory,Position=1)] [System.Collections.IDictionary]$Body, + [int]$TimeoutSec=0,[ValidateRange(0,100)][int]$MaxRetryCount=0,[OpenAIApiType]$ApiType=[OpenAIApiType]::OpenAI, + [System.Uri]$ApiBase,[Parameter(DontShow)][string]$ApiVersion,[ValidateSet('openai','azure','azure_ad')][string]$AuthType='openai', + [securestring][SecureStringTransformation()]$ApiKey,[Alias('OrgId')][string]$Organization, + [System.Collections.IDictionary]$AdditionalQuery,[System.Collections.IDictionary]$AdditionalHeaders,[object]$AdditionalBody + ) + process { if($PSCmdlet.ShouldProcess($SessionId,'Update agent session')){ Invoke-AgentApiRequest -EndpointName Agent.Sessions -Path $SessionId -Method Post -Parameters $PSBoundParameters -Body $Body -TypeName PSOpenAI.Agent.Session } } +} diff --git a/Public/Agents/Set-AgentVaultCredential.ps1 b/Public/Agents/Set-AgentVaultCredential.ps1 new file mode 100644 index 0000000..873c380 --- /dev/null +++ b/Public/Agents/Set-AgentVaultCredential.ps1 @@ -0,0 +1,13 @@ +function Set-AgentVaultCredential { + [CmdletBinding(SupportsShouldProcess)] [OutputType([pscustomobject])] + param( + [Parameter(Mandatory,Position=0)] [Alias('vault_id')] [string][UrlEncodeTransformation()]$VaultId, + [Parameter(Mandatory,Position=1,ValueFromPipelineByPropertyName)] [Alias('credential_id')] [string][UrlEncodeTransformation()]$CredentialId, + [Parameter(Mandatory,Position=2)] [System.Collections.IDictionary]$Body, + [int]$TimeoutSec=0,[ValidateRange(0,100)][int]$MaxRetryCount=0,[OpenAIApiType]$ApiType=[OpenAIApiType]::OpenAI, + [System.Uri]$ApiBase,[Parameter(DontShow)][string]$ApiVersion,[ValidateSet('openai','azure','azure_ad')][string]$AuthType='openai', + [securestring][SecureStringTransformation()]$ApiKey,[Alias('OrgId')][string]$Organization, + [System.Collections.IDictionary]$AdditionalQuery,[System.Collections.IDictionary]$AdditionalHeaders,[object]$AdditionalBody + ) + process{if($PSCmdlet.ShouldProcess($CredentialId,'Rotate agent vault credential')){Invoke-AgentApiRequest -EndpointName Agent.Vaults -Path "$VaultId/credentials/$CredentialId" -Method Post -Parameters $PSBoundParameters -Body $Body -TypeName PSOpenAI.Agent.Vault.Credential}} +} diff --git a/Public/Agents/_AgentCommon.ps1 b/Public/Agents/_AgentCommon.ps1 new file mode 100644 index 0000000..d8c6863 --- /dev/null +++ b/Public/Agents/_AgentCommon.ps1 @@ -0,0 +1,83 @@ +function Invoke-AgentApiRequest { + [CmdletBinding()] + param ( + [Parameter(Mandatory)] [string]$EndpointName, + [Parameter()] [string]$Path, + [Parameter(Mandatory)] [ValidateSet('Get', 'Post', 'Delete')] [string]$Method, + [Parameter(Mandatory)] [hashtable]$Parameters, + [Parameter()] [object]$Body, + [Parameter()] [System.Collections.IDictionary]$Query, + [Parameter()] [switch]$All, + [Parameter()] [switch]$Stream, + [Parameter()] [switch]$Binary, + [Parameter()] [string]$OutFile, + [Parameter()] [string]$TypeName + ) + + if ($Parameters.ContainsKey('ApiType') -and $Parameters.ApiType -eq [OpenAIApiType]::Azure) { + throw [System.NotSupportedException]::new('The Agents API is currently available only from OpenAI.') + } + + $OpenAIParameter = Get-OpenAIAPIParameter -EndpointName $EndpointName -Parameters $Parameters -ErrorAction Stop + $After = if ($null -ne $Query) { $Query.after } else { $null } + + do { + $UriBuilder = [System.UriBuilder]::new($OpenAIParameter.Uri) + if (-not [string]::IsNullOrWhiteSpace($Path)) { + $UriBuilder.Path += '/' + $Path.TrimStart('/') + } + $QueryParams = [System.Web.HttpUtility]::ParseQueryString($UriBuilder.Query) + if ($null -ne $Query) { + foreach ($Entry in $Query.GetEnumerator()) { + $Value = if ($Entry.Key -eq 'after') { $After } else { $Entry.Value } + if ($null -eq $Value -or [string]::IsNullOrWhiteSpace([string]$Value)) { continue } + foreach ($Item in @($Value)) { + $QueryParams.Add([string]$Entry.Key, [string]$Item) + } + } + } + $UriBuilder.Query = $QueryParams.ToString() + + $Request = @{ + Method = $Method + Uri = $UriBuilder.Uri + ContentType = $OpenAIParameter.ContentType + TimeoutSec = $OpenAIParameter.TimeoutSec + MaxRetryCount = $OpenAIParameter.MaxRetryCount + ApiKey = $OpenAIParameter.ApiKey + AuthType = $OpenAIParameter.AuthType + Organization = $OpenAIParameter.Organization + Headers = @{'OpenAI-Beta' = 'agents=v1' } + AdditionalQuery = $Parameters.AdditionalQuery + AdditionalHeaders = $Parameters.AdditionalHeaders + AdditionalBody = $Parameters.AdditionalBody + } + if ($PSBoundParameters.ContainsKey('Body')) { $Request.Body = $Body } + if ($OutFile) { $Request.OutFile = $OutFile } + + if ($Stream) { + Invoke-OpenAIHttpRequest -Stream @Request | Where-Object { -not [string]::IsNullOrWhiteSpace($_) } | ForEach-Object { + try { $_ | ConvertFrom-Json -ErrorAction Stop } catch { Write-Error -Exception $_.Exception } + } + return + } + + $Response = Invoke-OpenAIHttpRequest @Request + if ($null -eq $Response -or $OutFile) { return } + if ($Binary) { + Write-Output -NoEnumerate ([byte[]]$Response) + return + } + if ([string]::IsNullOrWhiteSpace([string]$Response)) { return } + try { $ResponseObject = $Response | ConvertFrom-Json -ErrorAction Stop } catch { Write-Error -Exception $_.Exception; return } + + $Objects = if ($ResponseObject.object -eq 'list' -and $null -ne $ResponseObject.data) { @($ResponseObject.data) } else { @($ResponseObject) } + foreach ($Object in $Objects) { + if ($TypeName) { $Object.psobject.TypeNames.Insert(0, $TypeName) } + Write-Output $Object + } + + $HasMore = $All -and [bool]$ResponseObject.has_more -and -not [string]::IsNullOrWhiteSpace([string]$ResponseObject.last_id) + if ($HasMore) { $After = $ResponseObject.last_id } + } while ($HasMore) +} diff --git a/Public/Images/Request-ImageEdit.ps1 b/Public/Images/Request-ImageEdit.ps1 index e35a48b..bde0173 100644 --- a/Public/Images/Request-ImageEdit.ps1 +++ b/Public/Images/Request-ImageEdit.ps1 @@ -16,6 +16,10 @@ function Request-ImageEdit { [Parameter()] [Completions( + 'gpt-image-2.5-sunburst', + 'gpt-image-2.5-sunburst-2026-09-08', + 'gpt-image-2.5-flare', + 'gpt-image-2.5-flare-2026-09-08', 'gpt-image-2', 'gpt-image-1.5', 'gpt-image-1', @@ -34,7 +38,7 @@ function Request-ImageEdit { [string]$Size = 'auto', [Parameter()] - [ValidateSet('low', 'medium', 'high', 'auto')] + [ValidateSet('low', 'medium', 'high', 'xhigh', 'max', 'auto')] [string][LowerCaseTransformation()]$Quality = 'auto', [Parameter()] diff --git a/Public/Images/Request-ImageGeneration.ps1 b/Public/Images/Request-ImageGeneration.ps1 index d891258..6da5e8b 100644 --- a/Public/Images/Request-ImageGeneration.ps1 +++ b/Public/Images/Request-ImageGeneration.ps1 @@ -7,6 +7,10 @@ function Request-ImageGeneration { [Parameter()] [Completions( + 'gpt-image-2.5-sunburst', + 'gpt-image-2.5-sunburst-2026-09-08', + 'gpt-image-2.5-flare', + 'gpt-image-2.5-flare-2026-09-08', 'gpt-image-2', 'gpt-image-1.5', 'gpt-image-1', @@ -25,7 +29,7 @@ function Request-ImageGeneration { [string]$Size = 'auto', [Parameter()] - [ValidateSet('low', 'medium', 'high', 'auto')] + [ValidateSet('low', 'medium', 'high', 'xhigh', 'max', 'auto')] [string][LowerCaseTransformation()]$Quality = 'auto', [Parameter()] diff --git a/Public/Responses/Request-Response.ps1 b/Public/Responses/Request-Response.ps1 index a26fb8a..af7033b 100644 --- a/Public/Responses/Request-Response.ps1 +++ b/Public/Responses/Request-Response.ps1 @@ -213,6 +213,10 @@ function Request-Response { [ValidateNotNullOrEmpty()] [string]$RemoteMCPServerUrl, + [Parameter()] + [ValidateNotNullOrEmpty()] + [string]$RemoteMCPTunnelId, + [Parameter()] [string]$RemoteMCPServerDescription, @@ -249,6 +253,7 @@ function Request-Response { 'connector_outlookemail', 'connector_sharepoint' )] + [System.Obsolete('ConnectorId is deprecated for models released after 2026-09-01. Use a remote MCP server URL or tunnel ID instead.')] [ValidateNotNullOrEmpty()] [string]$ConnectorId, @@ -286,7 +291,17 @@ function Request-Response { [string]$ImageGenerationType = 'image_generation', # Always 'image_generation' [Parameter()] - [Completions('gpt-image-1', 'gpt-image-1-mini', 'gpt-image-1.5', 'gpt-image-2', 'chatgpt-image-latest')] + [Completions( + 'gpt-image-2.5-sunburst', + 'gpt-image-2.5-sunburst-2026-09-08', + 'gpt-image-2.5-flare', + 'gpt-image-2.5-flare-2026-09-08', + 'gpt-image-2', + 'gpt-image-1.5', + 'gpt-image-1', + 'gpt-image-1-mini', + 'chatgpt-image-latest' + )] [string]$ImageGenerationModel, [Parameter()] @@ -316,11 +331,11 @@ function Request-Response { [int]$ImageGenerationPartialImages, [Parameter()] - [ValidateSet('low', 'medium', 'high', 'auto')] + [ValidateSet('low', 'medium', 'high', 'xhigh', 'max', 'auto')] [string][LowerCaseTransformation()]$ImageGenerationQuality = 'auto', [Parameter()] - [ValidateSet('auto', '1024x1024', '1536x1024', '1024x1536')] + [ValidatePattern('^(auto|[1-9][0-9]*x[1-9][0-9]*)$')] [string]$ImageGenerationSize = 'auto', #endregion Image Generation @@ -473,6 +488,14 @@ function Request-Response { [Alias('prompt_cache_options.ttl')] [string]$PromptCacheTtl, + [Parameter()] + [Alias('prompt_cache_options.comparison_response_id')] + [string]$PromptCacheComparisonResponseId, + + [Parameter()] + [Alias('prompt_cache_options.prewarm')] + [switch]$PromptCachePrewarm, + [Parameter()] [Alias('safety_identifier')] [string]$SafetyIdentifier, @@ -646,6 +669,12 @@ function Request-Response { if ($PSBoundParameters.ContainsKey('PromptCacheTtl')) { $PromptCacheOptions.ttl = $PromptCacheTtl } + if ($PSBoundParameters.ContainsKey('PromptCacheComparisonResponseId')) { + $PromptCacheOptions.comparison_response_id = $PromptCacheComparisonResponseId + } + if ($PSBoundParameters.ContainsKey('PromptCachePrewarm')) { + $PromptCacheOptions.prewarm = $PromptCachePrewarm.IsPresent + } if ($PromptCacheOptions.Keys.Count -gt 0) { $PostBody.prompt_cache_options = $PromptCacheOptions } @@ -838,18 +867,26 @@ function Request-Response { #region Remote MCP if ($UseRemoteMCPTool) { - # Server label and URL are required. + # Server label and one connection target are required. if ([string]::IsNullOrWhiteSpace($RemoteMCPServerLabel)) { Write-Error 'RemoteMCPServerLabel must be specified.' } - if ([string]::IsNullOrWhiteSpace($RemoteMCPServerUrl)) { - Write-Error 'RemoteMCPServerUrl must be specified.' + if ([string]::IsNullOrWhiteSpace($RemoteMCPServerUrl) -and [string]::IsNullOrWhiteSpace($RemoteMCPTunnelId)) { + Write-Error 'RemoteMCPServerUrl or RemoteMCPTunnelId must be specified.' + } + if (-not [string]::IsNullOrWhiteSpace($RemoteMCPServerUrl) -and -not [string]::IsNullOrWhiteSpace($RemoteMCPTunnelId)) { + Write-Error 'RemoteMCPServerUrl and RemoteMCPTunnelId cannot be specified together.' } $MCPTool = @{ type = $RemoteMCPType server_label = $RemoteMCPServerLabel - server_url = $RemoteMCPServerUrl + } + if ($PSBoundParameters.ContainsKey('RemoteMCPServerUrl')) { + $MCPTool.server_url = $RemoteMCPServerUrl + } + if ($PSBoundParameters.ContainsKey('RemoteMCPTunnelId')) { + $MCPTool.tunnel_id = $RemoteMCPTunnelId } if ($PSBoundParameters.ContainsKey('RemoteMCPServerDescription')) { @@ -1255,4 +1292,4 @@ function Request-Response { end { } -} \ No newline at end of file +} diff --git a/Public/Responses/Request-ResponseCompaction.ps1 b/Public/Responses/Request-ResponseCompaction.ps1 index 9fcfe70..6b32447 100644 --- a/Public/Responses/Request-ResponseCompaction.ps1 +++ b/Public/Responses/Request-ResponseCompaction.ps1 @@ -101,6 +101,14 @@ function Request-ResponseCompaction { [Alias('prompt_cache_options.ttl')] [string]$PromptCacheTtl, + [Parameter()] + [Alias('prompt_cache_options.comparison_response_id')] + [string]$PromptCacheComparisonResponseId, + + [Parameter()] + [Alias('prompt_cache_options.prewarm')] + [switch]$PromptCachePrewarm, + [Parameter()] [switch]$OutputRawResponse, @@ -181,6 +189,12 @@ function Request-ResponseCompaction { if ($PSBoundParameters.ContainsKey('PromptCacheTtl')) { $PromptCacheOptions.ttl = $PromptCacheTtl } + if ($PSBoundParameters.ContainsKey('PromptCacheComparisonResponseId')) { + $PromptCacheOptions.comparison_response_id = $PromptCacheComparisonResponseId + } + if ($PSBoundParameters.ContainsKey('PromptCachePrewarm')) { + $PromptCacheOptions.prewarm = $PromptCachePrewarm.IsPresent + } if ($PromptCacheOptions.Keys.Count -gt 0) { $PostBody.prompt_cache_options = $PromptCacheOptions } @@ -372,4 +386,4 @@ function Request-ResponseCompaction { end { } -} \ No newline at end of file +} diff --git a/README.md b/README.md index 2aac2de..480c824 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,38 @@ Guide: [Migrate ChatCompletion to Response](/Guides/Migrate_ChatCompletion_to_Re + [Get-ResponseInputItem](/Docs/Get-ResponseInputItem.md) + [Request-ResponseCompaction](/Docs/Request-ResponseCompaction.md) +#### Agents API (Beta) ++ [New-Agent](/Docs/New-Agent.md) ++ [Get-Agent](/Docs/Get-Agent.md) ++ [Set-Agent](/Docs/Set-Agent.md) ++ [Remove-Agent](/Docs/Remove-Agent.md) ++ [New-AgentEnvironmentTemplate](/Docs/New-AgentEnvironmentTemplate.md) ++ [Get-AgentEnvironmentTemplate](/Docs/Get-AgentEnvironmentTemplate.md) ++ [Set-AgentEnvironmentTemplate](/Docs/Set-AgentEnvironmentTemplate.md) ++ [Remove-AgentEnvironmentTemplate](/Docs/Remove-AgentEnvironmentTemplate.md) ++ [Get-AgentEnvironment](/Docs/Get-AgentEnvironment.md) ++ [Add-AgentEnvironmentFile](/Docs/Add-AgentEnvironmentFile.md) ++ [Get-AgentEnvironmentFile](/Docs/Get-AgentEnvironmentFile.md) ++ [New-AgentSession](/Docs/New-AgentSession.md) ++ [Get-AgentSession](/Docs/Get-AgentSession.md) ++ [Set-AgentSession](/Docs/Set-AgentSession.md) ++ [Remove-AgentSession](/Docs/Remove-AgentSession.md) ++ [Add-AgentSessionEvent](/Docs/Add-AgentSessionEvent.md) ++ [Get-AgentSessionEvent](/Docs/Get-AgentSessionEvent.md) ++ [Get-AgentSessionItem](/Docs/Get-AgentSessionItem.md) ++ [Get-AgentSessionTurn](/Docs/Get-AgentSessionTurn.md) ++ [Get-AgentSessionSubagent](/Docs/Get-AgentSessionSubagent.md) ++ [Get-AgentSessionArtifact](/Docs/Get-AgentSessionArtifact.md) ++ [Get-AgentSessionArtifactContent](/Docs/Get-AgentSessionArtifactContent.md) ++ [Remove-AgentSessionArtifact](/Docs/Remove-AgentSessionArtifact.md) ++ [New-AgentVault](/Docs/New-AgentVault.md) ++ [Get-AgentVault](/Docs/Get-AgentVault.md) ++ [Remove-AgentVault](/Docs/Remove-AgentVault.md) ++ [New-AgentVaultCredential](/Docs/New-AgentVaultCredential.md) ++ [Get-AgentVaultCredential](/Docs/Get-AgentVaultCredential.md) ++ [Set-AgentVaultCredential](/Docs/Set-AgentVaultCredential.md) ++ [Remove-AgentVaultCredential](/Docs/Remove-AgentVaultCredential.md) + #### Conversations + [New-Conversation](/Docs/New-Conversation.md) + [Get-Conversation](/Docs/Get-Conversation.md) @@ -168,6 +200,26 @@ Guide: [How to use Batch](/Guides/How_to_use_Batch.md) See [Docs](/Docs) and [Guides](/Guides) for more detailed and complex scenario descriptions. +### Agents API (Beta) + +Agents API commands accept evolving nested API schemas through `-Body`. The following creates a reusable agent and starts a managed session without a hosted execution environment. + +```PowerShell +$Agent = New-Agent -Body @{ + model = 'gpt-5.6' + name = 'Repository assistant' + instructions = 'Review PowerShell code and report actionable findings.' +} + +$Session = New-AgentSession -Body @{ + agent_id = $Agent.id + environment = @{ type = 'none' } + input = 'Inspect this repository.' +} +``` + +The Agents API is a public beta and is currently supported only with the OpenAI API, not Azure OpenAI. + ### Responses The primary method for interacting with OpenAI models. You can generate text from the model with the code below. diff --git a/Tests/Agents/Agents.tests.ps1 b/Tests/Agents/Agents.tests.ps1 new file mode 100644 index 0000000..5fa7c04 --- /dev/null +++ b/Tests/Agents/Agents.tests.ps1 @@ -0,0 +1,118 @@ +#Requires -Modules @{ ModuleName="Pester"; ModuleVersion="5.3.0" } + +BeforeAll { + $script:ModuleRoot = Split-Path (Split-Path $PSScriptRoot -Parent) -Parent + $script:ModuleName = 'PSOpenAI' + Import-Module (Join-Path $script:ModuleRoot 'PSOpenAI.psd1') -Force +} + +Describe 'Agents API commands' -Tag 'Offline' { + BeforeAll { + Mock -ModuleName $script:ModuleName Initialize-APIKey { [securestring]::new() } + } + + BeforeEach { + Mock -ModuleName $script:ModuleName Invoke-OpenAIHttpRequest { + '{"id":"agent_123","object":"agent","model":"gpt-5.6"}' + } + } + + It 'creates a reusable agent with the beta header and raw body' { + $Result = New-Agent -Body @{ model = 'gpt-5.6'; tools = @(@{ type = 'function'; name = 'lookup' }) } + $Result.id | Should -BeExactly 'agent_123' + $Result.psobject.TypeNames | Should -Contain 'PSOpenAI.Agent' + Should -Invoke Invoke-OpenAIHttpRequest -ModuleName $script:ModuleName -Times 1 -Exactly -ParameterFilter { + $Method -eq 'Post' -and $Uri.AbsolutePath -eq '/v1/agents' -and + $Headers.'OpenAI-Beta' -eq 'agents=v1' -and $Body.model -eq 'gpt-5.6' + } + } + + It 'updates and deletes a reusable agent using the documented routes' { + $null = Set-Agent agent_123 -Body @{ name = 'updated' } -Confirm:$false + $null = Remove-Agent agent_123 -Confirm:$false + Should -Invoke Invoke-OpenAIHttpRequest -ModuleName $script:ModuleName -ParameterFilter { $Method -eq 'Post' -and $Uri.AbsolutePath -eq '/v1/agents/agent_123' -and $Body.name -eq 'updated' } + Should -Invoke Invoke-OpenAIHttpRequest -ModuleName $script:ModuleName -ParameterFilter { $Method -eq 'Delete' -and $Uri.AbsolutePath -eq '/v1/agents/agent_123' } + } + + It 'follows cursor pagination when listing all agents' { + $script:Page = 0 + Mock -ModuleName $script:ModuleName Invoke-OpenAIHttpRequest { + $script:Page++ + if ($script:Page -eq 1) { '{"object":"list","data":[{"id":"agent_1"}],"has_more":true,"last_id":"agent_1"}' } + else { '{"object":"list","data":[{"id":"agent_2"}],"has_more":false}' } + } + @(Get-Agent -All).id | Should -Be @('agent_1','agent_2') + Should -Invoke Invoke-OpenAIHttpRequest -ModuleName $script:ModuleName -Times 2 -Exactly + Should -Invoke Invoke-OpenAIHttpRequest -ModuleName $script:ModuleName -ParameterFilter { $Uri.Query -match 'after=agent_1' } + } + + It 'creates a session and posts input events' { + Mock -ModuleName $script:ModuleName Invoke-OpenAIHttpRequest { '{"id":"session_123","object":"agent.session"}' } + $Session = New-AgentSession -Body @{ agent_id = 'agent_123'; environment = @{ type = 'none' } } + $null = Add-AgentSessionEvent session_123 -Event @{ type = 'message'; role = 'user'; content = @(@{type='input_text';text='hello'}) } -IdempotencyKey key_123 + $Session.id | Should -BeExactly 'session_123' + Should -Invoke Invoke-OpenAIHttpRequest -ModuleName $script:ModuleName -ParameterFilter { $Method -eq 'Post' -and $Uri.AbsolutePath -eq '/v1/agents/sessions' -and $Body.agent_id -eq 'agent_123' -and $Body.environment.type -eq 'none' } + Should -Invoke Invoke-OpenAIHttpRequest -ModuleName $script:ModuleName -ParameterFilter { $Method -eq 'Post' -and $Uri.AbsolutePath -eq '/v1/agents/sessions/session_123/events' -and $Body.events.Count -eq 1 -and $AdditionalHeaders.'Idempotency-Key' -eq 'key_123' } + } + + It 'parses the session event SSE data stream' { + Mock -ModuleName $script:ModuleName Invoke-OpenAIHttpRequest -ParameterFilter { $Stream } { + '{"type":"session.created","session":{"id":"session_123"}}' + '{"type":"session.completed","session":{"id":"session_123"}}' + } + $Events = @(Get-AgentSessionEvent session_123) + $Events.type | Should -Be @('session.created','session.completed') + Should -Invoke Invoke-OpenAIHttpRequest -ModuleName $script:ModuleName -ParameterFilter { $Stream -and $Method -eq 'Get' -and $Uri.AbsolutePath -eq '/v1/agents/sessions/session_123/events' } + } + + It 'requests a streamed session in both the JSON body and HTTP transport' { + Mock -ModuleName $script:ModuleName Invoke-OpenAIHttpRequest -ParameterFilter { $Stream } { '{"type":"agent.session.created"}' } + $Body = @{ agent_id = 'agent_123'; environment = @{ type = 'none' } } + $null = New-AgentSession -Body $Body -Stream + $Body.ContainsKey('stream') | Should -BeFalse + Should -Invoke Invoke-OpenAIHttpRequest -ModuleName $script:ModuleName -ParameterFilter { $Stream -and $Body.stream -eq $true -and $Uri.AbsolutePath -eq '/v1/agents/sessions' } + } + + It 'addresses root and subagent inspection routes' { + $null = Get-AgentSessionItem session_123 -SubagentId sub_123 -TurnId turn_123 + $null = Get-AgentSessionTurn session_123 -SubagentId sub_123 -TurnId turn_123 + $null = Get-AgentSessionSubagent session_123 -SubagentId sub_123 + Should -Invoke Invoke-OpenAIHttpRequest -ModuleName $script:ModuleName -ParameterFilter { $Uri.AbsolutePath -eq '/v1/agents/sessions/session_123/subagents/sub_123/turns/turn_123/items' } + Should -Invoke Invoke-OpenAIHttpRequest -ModuleName $script:ModuleName -ParameterFilter { $Uri.AbsolutePath -eq '/v1/agents/sessions/session_123/subagents/sub_123/turns/turn_123' } + Should -Invoke Invoke-OpenAIHttpRequest -ModuleName $script:ModuleName -ParameterFilter { $Uri.AbsolutePath -eq '/v1/agents/sessions/session_123/subagents/sub_123' } + } + + It 'uses artifact metadata, content, and deletion routes' { + $null = Get-AgentSessionArtifact session_123 -ArtifactId artifact_123 + $null = Get-AgentSessionArtifactContent session_123 artifact_123 -OutFile (Join-Path $TestDrive artifact.bin) + $null = Remove-AgentSessionArtifact session_123 artifact_123 -Confirm:$false + Should -Invoke Invoke-OpenAIHttpRequest -ModuleName $script:ModuleName -ParameterFilter { $Method -eq 'Get' -and $Uri.AbsolutePath -eq '/v1/agents/sessions/session_123/artifacts/artifact_123' } + Should -Invoke Invoke-OpenAIHttpRequest -ModuleName $script:ModuleName -ParameterFilter { $Method -eq 'Get' -and $Uri.AbsolutePath -eq '/v1/agents/sessions/session_123/artifacts/artifact_123/content' -and $OutFile } + Should -Invoke Invoke-OpenAIHttpRequest -ModuleName $script:ModuleName -ParameterFilter { $Method -eq 'Delete' -and $Uri.AbsolutePath -eq '/v1/agents/sessions/session_123/artifacts/artifact_123' } + } + + It 'returns artifact content as one byte array when OutFile is omitted' { + Mock -ModuleName $script:ModuleName Invoke-OpenAIHttpRequest { [byte[]](1, 2, 3) } + + $Content = Get-AgentSessionArtifactContent session_123 artifact_123 + + $Content.GetType() | Should -Be ([byte[]]) + $Content | Should -HaveCount 3 + $Content[0] | Should -Be 1 + } + + It 'supports environment templates, environment files, vaults, and credentials' { + $null = New-AgentEnvironmentTemplate -Body @{ name = 'dev' } + $null = Add-AgentEnvironmentFile env_123 -Body @{ path = 'README.md'; content = 'hello' } + $null = New-AgentVault -Body @{ name = 'secrets' } + $null = New-AgentVaultCredential vault_123 -Body @{ name='token'; auth=@{type='static_bearer';token='secret';mcp_server_url='https://mcp.example'} } + Should -Invoke Invoke-OpenAIHttpRequest -ModuleName $script:ModuleName -ParameterFilter { $Uri.AbsolutePath -eq '/v1/agents/environments/templates' -and $Method -eq 'Post' } + Should -Invoke Invoke-OpenAIHttpRequest -ModuleName $script:ModuleName -ParameterFilter { $Uri.AbsolutePath -eq '/v1/agents/environments/env_123/files' -and $Method -eq 'Post' } + Should -Invoke Invoke-OpenAIHttpRequest -ModuleName $script:ModuleName -ParameterFilter { $Uri.AbsolutePath -eq '/v1/vaults' -and $Method -eq 'Post' } + Should -Invoke Invoke-OpenAIHttpRequest -ModuleName $script:ModuleName -ParameterFilter { $Uri.AbsolutePath -eq '/v1/vaults/vault_123/credentials' -and $Body.auth.token -eq 'secret' } + } + + It 'rejects Azure because the Agents API is OpenAI-only' { + { Get-Agent -ApiType Azure -ApiKey ([securestring]::new()) -ErrorAction Stop } | Should -Throw -ExceptionType ([System.NotSupportedException]) + } +} diff --git a/Tests/Images/Request-ImageEdit.tests.ps1 b/Tests/Images/Request-ImageEdit.tests.ps1 index c201035..5fc550b 100644 --- a/Tests/Images/Request-ImageEdit.tests.ps1 +++ b/Tests/Images/Request-ImageEdit.tests.ps1 @@ -21,6 +21,23 @@ Describe 'Request-ImageEdit' { $script:Result = '' } + It 'Serializes GPT Image 2.5 model, arbitrary size, and xhigh quality' { + { + $script:Result = Request-ImageEdit ` + -Image ($script:TestImageData + '/fether_mask.png') ` + -Prompt 'Add a sunrise' ` + -Model 'gpt-image-2.5-sunburst' ` + -Size '2048x1024' ` + -Quality 'xhigh' ` + -OutputRawResponse ` + -ea Stop + } | Should -Not -Throw + + $Result.Body.model | Should -BeExactly 'gpt-image-2.5-sunburst' + $Result.Body.size | Should -BeExactly '2048x1024' + $Result.Body.quality | Should -BeExactly 'xhigh' + } + It 'Image edit. one input, one output, save to file' { $TestResponse = @' { diff --git a/Tests/Images/Request-ImageGeneration.tests.ps1 b/Tests/Images/Request-ImageGeneration.tests.ps1 index c6c2f16..0e728b2 100644 --- a/Tests/Images/Request-ImageGeneration.tests.ps1 +++ b/Tests/Images/Request-ImageGeneration.tests.ps1 @@ -21,6 +21,22 @@ Describe 'Request-ImageGeneration' { $script:Result = '' } + It 'Serializes GPT Image 2.5 model and maximum quality options' { + { + $script:Result = Request-ImageGeneration ` + -Prompt 'A sunrise' ` + -Model 'gpt-image-2.5-flare-2026-09-08' ` + -Size '2048x1024' ` + -Quality 'max' ` + -OutputRawResponse ` + -ea Stop + } | Should -Not -Throw + + $Result.Body.model | Should -BeExactly 'gpt-image-2.5-flare-2026-09-08' + $Result.Body.size | Should -BeExactly '2048x1024' + $Result.Body.quality | Should -BeExactly 'max' + } + It 'Generate image. No options.' { $TestResponse = @' { diff --git a/Tests/Responses/ObjectParser.tests.ps1 b/Tests/Responses/ObjectParser.tests.ps1 new file mode 100644 index 0000000..213932f --- /dev/null +++ b/Tests/Responses/ObjectParser.tests.ps1 @@ -0,0 +1,85 @@ +#Requires -Modules @{ ModuleName="Pester"; ModuleVersion="5.3.0" } + +BeforeAll { + $script:ModuleRoot = Split-Path (Split-Path $PSScriptRoot -Parent) -Parent + $script:ModuleName = 'PSOpenAI' + Import-Module (Join-Path $script:ModuleRoot "$script:ModuleName.psd1") -Force +} + +Describe 'ParseResponseObject' { + Context 'Structured Outputs (offline)' -Tag 'Offline' { + It 'parses only the final answer when commentary is also present' { + InModuleScope $script:ModuleName { + $Response = @' +{ + "id": "resp_structured_output", + "object": "response", + "status": "completed", + "output": [ + { + "type": "message", + "role": "assistant", + "content": [ + { + "type": "output_text", + "phase": "commentary", + "text": "Preparing the structured answer.", + "annotations": [] + }, + { + "type": "output_text", + "phase": "final_answer", + "text": "{\"answer\":\"42\"}", + "annotations": [] + } + ] + } + ] +} +'@ | ConvertFrom-Json + $Messages = [System.Collections.Generic.List[object]]::new() + + { $script:Result = ParseResponseObject -InputObject $Response -Messages $Messages -OutputType ([hashtable]) -ErrorAction Stop } | + Should -Not -Throw + + $Result.output[0].content[0].text | Should -BeExactly 'Preparing the structured answer.' + $Result.output[0].content[0].PSObject.Properties.Name | Should -Not -Contain 'parsed' + $Result.output[0].content[1].parsed.answer | Should -BeExactly '42' + $Result.StructuredOutputs | Should -HaveCount 1 + $Result.StructuredOutputs[0].answer | Should -BeExactly '42' + } + } + + It 'continues to parse legacy output text without phase' { + InModuleScope $script:ModuleName { + $Response = @' +{ + "id": "resp_legacy_structured_output", + "object": "response", + "status": "completed", + "output": [ + { + "type": "message", + "role": "assistant", + "content": [ + { + "type": "output_text", + "text": "{\"answer\":\"legacy\"}", + "annotations": [] + } + ] + } + ] +} +'@ | ConvertFrom-Json + $Messages = [System.Collections.Generic.List[object]]::new() + + $Result = ParseResponseObject -InputObject $Response -Messages $Messages -OutputType ([hashtable]) -ErrorAction Stop + + $Result.output[0].content[0].parsed.answer | Should -BeExactly 'legacy' + $Result.StructuredOutputs | Should -HaveCount 1 + $Result.StructuredOutputs[0].answer | Should -BeExactly 'legacy' + } + } + } +} diff --git a/Tests/Responses/Request-Response.tests.ps1 b/Tests/Responses/Request-Response.tests.ps1 index 22fbf30..5d7a334 100644 --- a/Tests/Responses/Request-Response.tests.ps1 +++ b/Tests/Responses/Request-Response.tests.ps1 @@ -693,6 +693,47 @@ Describe 'Request-Response' { { Request-Response -PromptId 'pmpt_123' -PromptVersion 4 -PromptVariables @{'city' = 'Tokyo' } -ea Stop } | Should -Not -Throw Should -InvokeVerifiable } + + It 'Serializes prompt cache diagnostics, prewarming, MCP tunnels, and GPT Image 2.5 options' { + { + $script:Result = Request-Response ` + -Message 'Hello' ` + -PromptCacheComparisonResponseId 'resp_compare123' ` + -PromptCachePrewarm ` + -UseRemoteMCPTool ` + -RemoteMCPServerLabel 'secure-server' ` + -RemoteMCPTunnelId 'tnl_123' ` + -UseImageGenerationTool ` + -ImageGenerationModel 'gpt-image-2.5-sunburst-2026-09-08' ` + -ImageGenerationQuality 'xhigh' ` + -ImageGenerationSize '2048x1024' ` + -OutputRawResponse ` + -ea Stop + } | Should -Not -Throw + + $RequestBody = $Result.Body + $RequestBody.prompt_cache_options.comparison_response_id | Should -BeExactly 'resp_compare123' + $RequestBody.prompt_cache_options.prewarm | Should -BeTrue + $MCPTool = $RequestBody.tools | Where-Object type -EQ 'mcp' + $MCPTool.tunnel_id | Should -BeExactly 'tnl_123' + $MCPTool.ContainsKey('server_url') | Should -BeFalse + $ImageTool = $RequestBody.tools | Where-Object type -EQ 'image_generation' + $ImageTool.model | Should -BeExactly 'gpt-image-2.5-sunburst-2026-09-08' + $ImageTool.quality | Should -BeExactly 'xhigh' + $ImageTool.size | Should -BeExactly '2048x1024' + } + + It 'Rejects specifying both an MCP server URL and tunnel ID' { + { + Request-Response ` + -Message 'Hello' ` + -UseRemoteMCPTool ` + -RemoteMCPServerLabel 'server' ` + -RemoteMCPServerUrl 'https://example.com/mcp' ` + -RemoteMCPTunnelId 'tnl_123' ` + -ea Stop + } | Should -Throw 'RemoteMCPServerUrl and RemoteMCPTunnelId cannot be specified together.' + } } It 'When specifying conversation id, input message is not required' { @@ -1182,4 +1223,4 @@ STEP2. Use the timestamp tool to save the resulting timestamp in date and time, $Result | Should -HaveCount 10 } } -} \ No newline at end of file +} diff --git a/Tests/Responses/Request-ResponseCompaction.tests.ps1 b/Tests/Responses/Request-ResponseCompaction.tests.ps1 index 171cf49..90145a9 100644 --- a/Tests/Responses/Request-ResponseCompaction.tests.ps1 +++ b/Tests/Responses/Request-ResponseCompaction.tests.ps1 @@ -238,6 +238,8 @@ Describe 'Request-ResponseCompaction' { PromptCacheKey = 'prompt_cache_key_1234' PromptCacheMode = 'explicit' PromptCacheTtl = '30m' + PromptCacheComparisonResponseId = 'resp_compare123' + PromptCachePrewarm = $true TimeoutSec = 30 MaxRetryCount = 3 } @@ -245,6 +247,20 @@ Describe 'Request-ResponseCompaction' { } | Should -Not -Throw Should -InvokeVerifiable } + + It 'Serializes prompt cache diagnostics and prewarming options' { + { + $script:Result = Request-ResponseCompaction ` + -Message 'Hello.' ` + -PromptCacheComparisonResponseId 'resp_compare123' ` + -PromptCachePrewarm ` + -OutputRawResponse ` + -ea Stop + } | Should -Not -Throw + + $Result.Body.prompt_cache_options.comparison_response_id | Should -BeExactly 'resp_compare123' + $Result.Body.prompt_cache_options.prewarm | Should -BeTrue + } } Context 'Integration tests (online)' -Tag 'Online' { @@ -308,4 +324,4 @@ Describe 'Request-ResponseCompaction' { $Result.History[1].Type | Should -Be 'compaction' } } -} \ No newline at end of file +}