Skip to content

OpenAI.Response

Andrew Lambert edited this page Jan 23, 2024 · 15 revisions

OpenAI.Response

Class Declaration

 Protected Class Response

Remarks

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.

Example

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

Methods

Properties

Shared methods

Shared properties

Clone this wiki locally