Skip to content

OpenAI.Response.GetResultAttribute

Andrew Lambert edited this page Mar 3, 2024 · 2 revisions

OpenAI.Response.GetResultAttribute

Method signature

 Function GetResultAttribute(Index As Integer, AttributeName As String, DefaultValue As Variant = Nil) As Variant

Parameters

Name Type Comment
Index Integer The index of the result to retrieve if there are more than one. If the index is invalid then an OutOfBoundsException will be raised.
AttributeName String The key into the reply's raw JSON to retrieve.
DefaultValue Variant Optional. The value to return if the AttributeName was not found.

Return value

A Variant containing the attribute. This may be a String, a Picture, a JSONItem, or another kind of data depending on the attribute. If the AttributeName does not exist then the DefaultValue is returned; the default value of DefaultValue is Nil.

Remarks

Use this method to retrieve parts of the JSON reply that are not exposed through the wrapper.

Clone this wiki locally