-
-
Notifications
You must be signed in to change notification settings - Fork 6
OpenAI.Response
Andrew Lambert edited this page Jan 23, 2024
·
15 revisions
OpenAI.Response
Protected Class Response
This class represents a generic API response. It is the common ancestor to all other response classes, but can be used directly for "raw" access to the OpenAI API.
This example sends a request to the /v1/completions
endpoint, and collects the raw JSON output.
Dim request As New OpenAI.Request
request.Prompt = "What is the airspeed velocity of an unladen European swallow?"
request.Model = "text-davinci-003"
request.NumberOfResults = 5
request.BestOf = 10
Dim result As OpenAI.Response = OpenAI.Response.Create("/v1/completions", request)
Dim choices() As JSONItem
For i As Integer = 0 To result.ResultCount - 1
choices.Append(result.GetResult(i))
Next
Wiki home | Project page | Bugs | Become a sponsor
Text and code examples are Copyright ©2023-24 Andrew Lambert, offered under the CC BY-SA 3.0 License.