Skip to content

Commit

Permalink
upgreade sdk version
Browse files Browse the repository at this point in the history
  • Loading branch information
skyscrapr committed Jun 25, 2023
1 parent 23c844c commit fdff9ce
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ require (

require (
github.com/hashicorp/terraform-plugin-log v0.9.0
github.com/skyscrapr/openai-sdk-go v0.0.0-20230622090806-5d31a7778304
github.com/skyscrapr/openai-sdk-go v0.0.0-20230625053051-c9e7443692f7
)

require (
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ github.com/skyscrapr/openai-sdk-go v0.0.0-20230621101012-bd23337cec2b h1:zIfOISt
github.com/skyscrapr/openai-sdk-go v0.0.0-20230621101012-bd23337cec2b/go.mod h1:FsqF4u4OHs6BFjFuQavyHuqI8eWDt68fdLvfP/gXns8=
github.com/skyscrapr/openai-sdk-go v0.0.0-20230622090806-5d31a7778304 h1:4JkYGSOo2GAnj1WgnUe6+iF52xffbqpm3BfgRmGnoAI=
github.com/skyscrapr/openai-sdk-go v0.0.0-20230622090806-5d31a7778304/go.mod h1:FsqF4u4OHs6BFjFuQavyHuqI8eWDt68fdLvfP/gXns8=
github.com/skyscrapr/openai-sdk-go v0.0.0-20230625053051-c9e7443692f7 h1:ArMa2jUopYM0AO+bDjuaPsYT3L9IoI+KXTFDFdtlhoM=
github.com/skyscrapr/openai-sdk-go v0.0.0-20230625053051-c9e7443692f7/go.mod h1:FsqF4u4OHs6BFjFuQavyHuqI8eWDt68fdLvfP/gXns8=
github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w=
github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU=
Expand Down
13 changes: 3 additions & 10 deletions openai/finetune_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package openai

import (
"context"
"encoding/json"
"fmt"

"github.com/hashicorp/terraform-plugin-framework/path"
Expand Down Expand Up @@ -238,15 +237,9 @@ func (r *FineTuneResource) Create(ctx context.Context, req resource.CreateReques
tflog.Info(ctx, "Begin Streaming")
err = r.client.FineTunes().SubscribeFineTuneEvents(
fineTune.Id,
func(event *openai.SSEEvent) error {
var fineTuneEvent openai.FineTuneEvent
err := json.Unmarshal([]byte(event.Data), &fineTuneEvent)
tflog.Info(ctx, fmt.Sprintf("Fine -Tune Event: %s", fineTuneEvent.Message))
return err
},
func(err error) error {
tflog.Error(ctx, fmt.Sprintf("Fine-Tune Event Error: %s", err))
return err
func(event *openai.FineTuneEvent) error {
tflog.Info(ctx, fmt.Sprintf("Fine -Tune Event: %s", event.Message))
return nil
},
)
if err != nil {
Expand Down

0 comments on commit fdff9ce

Please sign in to comment.