Skip to content

Latest commit

 

History

History
194 lines (152 loc) · 4.31 KB

Add-RealtimeSessionItem.md

File metadata and controls

194 lines (152 loc) · 4.31 KB
external help file Module Name online version schema
PSOpenAI-help.xml
PSOpenAI
2.0.0

Add-RealtimeSessionItem

SYNOPSIS

Add a new Item to the Conversation's context, including messages, function calls, and function call responses.

SYNTAX

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]

DESCRIPTION

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

EXAMPLES

Example 1

PS C:\> Add-RealtimeSessionItem 'Hello. Why is the sun so bright?'

Example 2

PS C:\> Add-RealtimeSessionItem 'This is a great question!' -Role assistant

PARAMETERS

-Content

The content of the message.

Type: String
Aliases: Message, Text
Required: True
Position: 0

-ContentTranscript

The transcript of the audio, used for input_audio content type.

Type: String
Required: False
Position: Named

-ContentType

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

-EventId

Optional client-generated ID used to identify this event.

Type: String
Required: False
Position: Named

-FunctionCallArguments

The arguments of the function call (for function_call items).

Type: String
Required: False
Position: Named

-FunctionCallId

The ID of the function call (for function_call and function_call_output items).

Type: String
Required: False
Position: Named

-FunctionCallName

The name of the function being called (for function_call items).

Type: String
Required: False
Position: Named

-FunctionCallOutput

The output of the function call (for function_call_output items).

Type: String
Required: False
Position: Named

-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.

Type: String
Required: False
Position: Named

-ItemType

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

-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, 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

-Role

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

-Status

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

-TriggerResponse

If specified, instructs the server to create a response after adding this item.

Type: SwitchParameter
Required: False
Position: Named

INPUTS

OUTPUTS

NOTES

RELATED LINKS

https://platform.openai.com/docs/api-reference/realtime-client-events/conversation/item/create