File tree Expand file tree Collapse file tree 3 files changed +7
-303
lines changed Expand file tree Collapse file tree 3 files changed +7
-303
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -6,8 +6,10 @@ The OpenAI Go library provides convenient access to the [OpenAI REST API](https:
6
6
from applications written in Go.
7
7
8
8
> [ !WARNING]
9
- > The latest version of this package uses a new design with significant breaking changes.
10
- > Please refer to the [ migration guide] ( ./MIGRATION.md ) for more information on how to update your code.
9
+ > The latest version of this package has small and limited breaking changes.
10
+ > With the launch of ` custom ` tools in Chat Completions, ` function ` tools have been renamed to be clarify the difference between the two
11
+ > The type ` ChatCompletionMessageToolCall ` has become ` ChatCompletionMessageToolCallUnion `
12
+ and ` ChatCompletionMessageToolCallParam ` has become ` ChatCompletionMessageToolCallParamUnion ` .
11
13
12
14
## Installation
13
15
@@ -663,7 +665,7 @@ func main() {
663
665
)
664
666
665
667
r := gin.Default ()
666
-
668
+
667
669
r.POST (" /webhook" , func (c *gin.Context ) {
668
670
body , err := io.ReadAll (c.Request .Body )
669
671
if err != nil {
@@ -722,7 +724,7 @@ func main() {
722
724
)
723
725
724
726
r := gin.Default ()
725
-
727
+
726
728
r.POST (" /webhook" , func (c *gin.Context ) {
727
729
body , err := io.ReadAll (c.Request .Body )
728
730
if err != nil {
@@ -737,7 +739,7 @@ func main() {
737
739
c.JSON (http.StatusBadRequest , gin.H {" error" : " invalid signature" })
738
740
return
739
741
}
740
-
742
+
741
743
c.JSON (http.StatusOK , gin.H {" message" : " ok" })
742
744
})
743
745
Original file line number Diff line number Diff line change @@ -2193,20 +2193,6 @@ func (r ChatCompletionMessageToolCallUnion) ToParam() ChatCompletionMessageToolC
2193
2193
return param.Override [ChatCompletionMessageToolCallUnionParam ](json .RawMessage (r .RawJSON ()))
2194
2194
}
2195
2195
2196
- func ChatCompletionMessageToolCallParamOfFunction (function ChatCompletionMessageFunctionToolCallFunctionParam , id string ) ChatCompletionMessageToolCallUnionParam {
2197
- var variant ChatCompletionMessageFunctionToolCallParam
2198
- variant .Function = function
2199
- variant .ID = id
2200
- return ChatCompletionMessageToolCallUnionParam {OfFunction : & variant }
2201
- }
2202
-
2203
- func ChatCompletionMessageToolCallParamOfCustom (custom ChatCompletionMessageCustomToolCallCustomParam , id string ) ChatCompletionMessageToolCallUnionParam {
2204
- var variant ChatCompletionMessageCustomToolCallParam
2205
- variant .Custom = custom
2206
- variant .ID = id
2207
- return ChatCompletionMessageToolCallUnionParam {OfCustom : & variant }
2208
- }
2209
-
2210
2196
// Only one field can be non-zero.
2211
2197
//
2212
2198
// Use [param.IsOmitted] to confirm if a field is set.
You can’t perform that action at this time.
0 commit comments