Skip to content

OpenAI.ChatCompletion.GetResultRole

Andrew Lambert edited this page Mar 6, 2023 · 1 revision

OpenAI.ChatCompletion.GetResultRole

Method signature

Function GetResultRole(Index As Integer = 0) As String

Parameters

Name Type Comment
Index Integer Optional. The index of the result to retrieve if there are more than one. If the index is invalid then an OutOfBoundsException will be raised.

Return value

The "role" part of the chat result at Index.

Remarks

The "role" is one of "user", "assistant", or "system", and indicates the speaker of the message. Use ChatCompletion.GetResult() to retrieve the message.

Clone this wiki locally