-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
44 lines (36 loc) · 1.02 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package main
import (
"context"
"fmt"
otiai10 "github.com/otiai10/openaigo"
sashabaranov "github.com/sashabaranov/go-openai"
"github.com/emikhalev/chatgpt-golang-examples/utils"
)
func main() {
ctx := context.Background()
apiKey := utils.APIKey()
fineTuneID := ""
{
client := otiai10.NewClient(apiKey)
fineTuneID = firstFineTuneID(ctx, client)
}
{ // otiai10
client := otiai10.NewClient(apiKey)
deleteFineTune, err := client.DeleteFineTuneModel(ctx, fineTuneID)
fmt.Printf("otiai10 DeleteFineTuneModel: %v \n (err: %+v)\n\n",
utils.SPrintStruct(deleteFineTune), err)
}
{ // sashabaranov
client := sashabaranov.NewClient(apiKey)
deleteFineTune, err := client.DeleteFineTune(ctx, fineTuneID)
fmt.Printf("sashabaranov DeleteFineTuneModel: %v \n (err: %+v)\n\n",
utils.SPrintStruct(deleteFineTune), err)
}
}
func firstFineTuneID(ctx context.Context, client *otiai10.Client) string {
list, err := client.ListFineTunes(ctx)
if err != nil || len(list.Data) == 0 {
return ""
}
return list.Data[0].ID
}