| external help file | PSOpenAI-help.xml |
|---|---|
| Module Name | PSOpenAI |
| online version | https://github.com/mkht/PSOpenAI/blob/main/Docs/Request-ResponseCompaction.md |
| schema | 2.0.0 |
Runs a compaction pass over a conversation. Compaction returns encrypted, opaque items and the underlying logic may evolve over time.
Request-ResponseCompaction
[[-Message] <String>]
[-Role <String>]
[-Model <String>]
[-SystemMessage <String[]>]
[-DeveloperMessage <String[]>]
[-Instructions <String>]
[-Images <String[]>]
[-ImageDetail <String>]
[-Files <String[]>]
[-PreviousResponseId <String>]
[-OutputRawResponse]
[-Organization <String>]
[-TimeoutSec <Int32>]
[-MaxRetryCount <Int32>]
[-ApiBase <Uri>]
[-ApiKey <SecureString>]
[-History <Object[]>]
[<CommonParameters>]
Runs a compaction pass over a conversation. Compaction returns encrypted, opaque items and the underlying logic may evolve over time.
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'A text input to the model.
Type: String
Aliases: UserMessage, input
Required: False
Position: 0The role of the message input. One of user, system, or developer. The default is user.
Type: String
Required: False
Position: NamedThe name of model to use. The default value is gpt-4o-mini.
Type: String
Required: False
Position: Named
Accept pipeline input: True (ByPropertyName)
Default value: gpt-4o-mini(Instead of this parameter, the use of the -Instructions parameter is recommended.)
Instructions that the model should follow.
Type: String[]
Required: False
Position: Named(Instead of this parameter, the use of the -Instructions parameter is recommended.)
Instructions that the model should follow.
Type: String[]
Required: False
Position: NamedA system (or developer) message inserted into the model's context.
Type: String
Required: False
Position: NamedThe unique ID of the previous response to the model. Use this to create multi-turn conversations.
Type: String
Aliases: previous_response_id
Required: False
Position: Named
Accept pipeline input: True (ByPropertyName)A list of images to passing the model. You can specify local image file or remote url.
Type: String[]
Required: False
Position: NamedControls how the model processes the image and generates its textual understanding. You can select from Low or High.
Type: String
Accepted values: auto, low, high
Required: False
Position: Named
Default value: autoA 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.
Type: String[]
Required: False
Position: NamedIf specifies this switch, an output of this function to be a raw response value from the API. (Normally JSON formatted string.)
Type: SwitchParameter
Required: False
Position: NamedSpecifies how long the request can be pending before it times out.
The default value is 0 (infinite).
Type: Int32
Required: False
Position: Named
Default value: 0Number 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.
Type: Int32
Required: False
Position: Named
Default value: 0Specifies an API endpoint URL such like: https://your-api-endpoint.test/v1
If not specified, it will use https://api.openai.com/v1
Type: System.Uri
Required: False
Position: Named
Default value: https://api.openai.com/v1Specifies 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
Type: Object
Required: False
Position: NamedAn object for keeping the conversation history.
Type: Object[]
Required: False
Position: Named
Accept pipeline input: True (ByPropertyName)https://developers.openai.com/api/reference/resources/responses/methods/compact/