| external help file | PSOpenAI-help.xml |
|---|---|
| Module Name | PSOpenAI |
| online version | https://github.com/mkht/PSOpenAI/blob/main/Docs/Add-RealtimeSessionItem.md |
| schema | 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?'This example adds a text message as an input to the conversation.
PS C:\> Add-RealtimeSessionItem -ContentType 'input_image' -Content 'C:\path\to\image.png'This example adds an image as an input to the conversation.
PS C:\> Add-RealtimeSessionItem 'This is a great question!' -Role assistantThe 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.
Type: String
Aliases: Message, Text
Required: True
Position: 0The transcript of the audio, used for input_audio content type.
Type: String
Required: False
Position: NamedThe content type (input_text, input_image, input_audio, item_reference, text).
The default value is input_text.
Type: String
Accepted values: input_text, input_image, input_audio, item_reference
Required: False
Position: Named
Default value: input_textOptional client-generated ID used to identify this event.
Type: String
Required: False
Position: NamedThe arguments of the function call (for function_call items).
Type: String
Required: False
Position: NamedThe ID of the function call (for function_call and function_call_output items).
Type: String
Required: False
Position: NamedThe name of the function being called (for function_call items).
Type: String
Required: False
Position: NamedThe output of the function call (for function_call_output items).
Type: String
Required: False
Position: NamedThe 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: NamedThe 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: messageThe 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.
Type: String
Required: False
Position: NamedThe 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: userThe status of the item (completed, incomplete). These have no effect on the conversation.
Type: String
Accepted values: completed, in_progress, incomplete
Required: False
Position: NamedIf specified, instructs the server to create a response after adding this item.
Type: SwitchParameter
Required: False
Position: Namedhttps://developers.openai.com/api/docs/guides/realtime-conversations/