Skip to content

Commit afaa2b8

Browse files
committed
chore: document breaking changes
1 parent 3a777fc commit afaa2b8

File tree

3 files changed

+7
-303
lines changed

3 files changed

+7
-303
lines changed

MIGRATION.md

Lines changed: 0 additions & 284 deletions
This file was deleted.

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ The OpenAI Go library provides convenient access to the [OpenAI REST API](https:
66
from applications written in Go.
77

88
> [!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`.
1113

1214
## Installation
1315

@@ -663,7 +665,7 @@ func main() {
663665
)
664666

665667
r := gin.Default()
666-
668+
667669
r.POST("/webhook", func(c *gin.Context) {
668670
body, err := io.ReadAll(c.Request.Body)
669671
if err != nil {
@@ -722,7 +724,7 @@ func main() {
722724
)
723725

724726
r := gin.Default()
725-
727+
726728
r.POST("/webhook", func(c *gin.Context) {
727729
body, err := io.ReadAll(c.Request.Body)
728730
if err != nil {
@@ -737,7 +739,7 @@ func main() {
737739
c.JSON(http.StatusBadRequest, gin.H{"error": "invalid signature"})
738740
return
739741
}
740-
742+
741743
c.JSON(http.StatusOK, gin.H{"message": "ok"})
742744
})
743745

chatcompletion.go

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2193,20 +2193,6 @@ func (r ChatCompletionMessageToolCallUnion) ToParam() ChatCompletionMessageToolC
21932193
return param.Override[ChatCompletionMessageToolCallUnionParam](json.RawMessage(r.RawJSON()))
21942194
}
21952195

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-
22102196
// Only one field can be non-zero.
22112197
//
22122198
// Use [param.IsOmitted] to confirm if a field is set.

0 commit comments

Comments
 (0)