Add CompletionRequest.StreamOptions (#959)
The legacy completion API supports a `stream_options` object when `stream` is set to true [0]. This adds a StreamOptions property to the CompletionRequest struct to support this setting. [0] https://platform.openai.com/docs/api-reference/completions/create#completions-create-stream_options Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
This commit is contained in:
@@ -215,6 +215,8 @@ type CompletionRequest struct {
|
|||||||
Temperature float32 `json:"temperature,omitempty"`
|
Temperature float32 `json:"temperature,omitempty"`
|
||||||
TopP float32 `json:"top_p,omitempty"`
|
TopP float32 `json:"top_p,omitempty"`
|
||||||
User string `json:"user,omitempty"`
|
User string `json:"user,omitempty"`
|
||||||
|
// Options for streaming response. Only set this when you set stream: true.
|
||||||
|
StreamOptions *StreamOptions `json:"stream_options,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CompletionChoice represents one of possible completions.
|
// CompletionChoice represents one of possible completions.
|
||||||
|
|||||||
Reference in New Issue
Block a user