Skip to content

OpenAI.Request.Set

Andrew Lambert edited this page Dec 20, 2023 · 5 revisions

Method signature

 Sub Set(KeyName As String, KeyValue As Variant)

Parameters

Name Type Comment
KeyName String The name of the JSON key to add to the request.
KeyValue Variant The value of the JSON key to add to the request.

Remarks

Sets the specified request parameter. The KeyName must exactly match the parameter name used by the API, which might not match the name of property exposed by this class. For example, the NumberOfResults property corresponds to the "n" API parameter.

The KeyValue must be the correct type and format for the parameter.

This method allows you to set a request parameter or parameter value that cannot be set through one of this class's properties. For example, some endpoints accept either a single string value or an array of string values for the input parameter, but the Input class property doesn't accept string arrays. To set an array value for a request parameter, we have to use this method.

See also

Clone this wiki locally