external help file | Module Name | online version | schema |
---|---|---|---|
PSOpenAI-help.xml |
PSOpenAI |
2.0.0 |
Add a new Item to the Conversation's context, including messages, function calls, and function call responses.
Add-RealtimeSessionItem
[-Content] <String>
[-EventId <String>]
[-PreviousItemId <String>]
[-ItemId <String>]
[-ItemType <String>]
[-Status <String>]
[-Role <String>]
[-ContentType <String>]
[-ContentTranscript <String>]
[-FunctionCallId <String>]
[-FunctionCallName <String>]
[-FunctionCallArguments <String>]
[-FunctionCallOutput <String>]
[-TriggerResponse]
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
PS C:\> Add-RealtimeSessionItem 'Hello. Why is the sun so bright?'
PS C:\> Add-RealtimeSessionItem 'This is a great question!' -Role assistant
The content of the message.
Type: String
Aliases: Message, Text
Required: True
Position: 0
The transcript of the audio, used for input_audio
content type.
Type: String
Required: False
Position: Named
The content type (input_text
, input_audio
, text
).
The default value is input_text
.
Type: String
Accepted values: input_text, input_audio, text, audio
Required: False
Position: Named
Default value: input_text
Optional client-generated ID used to identify this event.
Type: String
Required: False
Position: Named
The arguments of the function call (for function_call
items).
Type: String
Required: False
Position: Named
The ID of the function call (for function_call
and function_call_output
items).
Type: String
Required: False
Position: Named
The name of the function being called (for function_call
items).
Type: String
Required: False
Position: Named
The output of the function call (for function_call_output
items).
Type: String
Required: False
Position: Named
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.
Type: String
Required: False
Position: Named
The type of the item (message
, function_call
, function_call_output
).
The default is message
.
Type: String
Accepted values: message, function_call, function_call_output
Required: False
Position: Named
Default value: message
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, 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.
Type: String
Required: False
Position: Named
The role of the message sender (user
, assistant
, system
), only applicable for message items.
Type: String
Accepted values: user, assistant, system
Required: False
Position: Named
Default value: user
The status of the item (completed
, incomplete
). These have no effect on the conversation.
Type: String
Accepted values: completed, in_progress, incomplete
Required: False
Position: Named
If specified, instructs the server to create a response after adding this item.
Type: SwitchParameter
Required: False
Position: Named
https://platform.openai.com/docs/api-reference/realtime-client-events/conversation/item/create