You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Added support for Moderations API
* gofmt moderation.go
* support for edits endpoint & other improvements
* fix: Choice redeclared in this block
* Added more parameters for the Search endpoint. (#3)
Copy file name to clipboardExpand all lines: completion.go
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -27,8 +27,8 @@ type CompletionRequest struct {
27
27
Userstring`json:"user,omitempty"`
28
28
}
29
29
30
-
// Choice represents one of possible completions
31
-
typeChoicestruct {
30
+
// CompletionChoice represents one of possible completions
31
+
typeCompletionChoicestruct {
32
32
Textstring`json:"text"`
33
33
Indexint`json:"index"`
34
34
FinishReasonstring`json:"finish_reason"`
@@ -52,12 +52,12 @@ type CompletionUsage struct {
52
52
53
53
// CompletionResponse represents a response structure for completion API
54
54
typeCompletionResponsestruct {
55
-
IDstring`json:"id"`
56
-
Objectstring`json:"object"`
57
-
Createduint64`json:"created"`
58
-
Modelstring`json:"model"`
59
-
Choices []Choice`json:"choices"`
60
-
UsageCompletionUsage`json:"usage"`
55
+
IDstring`json:"id"`
56
+
Objectstring`json:"object"`
57
+
Createduint64`json:"created"`
58
+
Modelstring`json:"model"`
59
+
Choices []CompletionChoice`json:"choices"`
60
+
UsageCompletionUsage`json:"usage"`
61
61
}
62
62
63
63
// CreateCompletion — API call to create a completion. This is the main endpoint of the API. Returns new text as well as, if requested, the probabilities over each alternative token at each position.
0 commit comments