Skip to content

New OAIMessage

dfinke edited this page Apr 20, 2024 · 2 revisions

New-OAIMessage

SYNOPSIS

Creates a new message in a specified thread.

SYNTAX

New-OAIMessage [[-ThreadId] <Object>] [-Role] <Object> [-Content] <Object> [[-FileIds] <Object>]
 [[-Metadata] <Object>] [-ProgressAction <ActionPreference>] [<CommonParameters>]

DESCRIPTION

The New-OAIMessage function is used to create a new message in a specified thread. It requires the thread ID, role, content, and optional file IDs as parameters.

EXAMPLES

EXAMPLE 1

New-OAIMessage -ThreadId 12345 -Role 'user' -Content 'Hello, world!' -FileIds 'file1', 'file2'

This example creates a new message in the thread with ID 12345, sent by a user with the content "Hello, world!" and attaches two files with IDs 'file1' and 'file2'.

PARAMETERS

-ThreadId

The ID of the thread where the message will be created.

Type: Object
Parameter Sets: (All)
Aliases: Id

Required: False
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-Role

The role of the message sender. Only 'user' is currently supported.

Type: Object
Parameter Sets: (All)
Aliases:

Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Content

The content of the message.

Type: Object
Parameter Sets: (All)
Aliases:

Required: True
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-FileIds

An optional array of file IDs to attach to the message.

Type: Object
Parameter Sets: (All)
Aliases:

Required: False
Position: 4
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Metadata

Optional metadata to include with the message.

Type: Object
Parameter Sets: (All)
Aliases:

Required: False
Position: 5
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ProgressAction

{{ Fill ProgressAction Description }}

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.

INPUTS

OUTPUTS

NOTES

RELATED LINKS

https://platform.openai.com/docs/api-reference/messages/createMessage

Clone this wiki locally