Skip to content

Commit

Permalink
fix: updated sdk to 0.6.0
Browse files Browse the repository at this point in the history
Signed-off-by: Rubicon Lee <rex@wakflo.com>
  • Loading branch information
raff-wakflo committed Oct 3, 2024
1 parent 7678ba9 commit c7b595a
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 8 deletions.
2 changes: 1 addition & 1 deletion internal/connectors/openai/lib.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func NewConnector() (*sdk.ConnectorPlugin, error) {
Triggers: []sdk.ITrigger{},
Operations: []sdk.IOperation{
NewPromptChatGPT(),
//NewPromptDallE(),
// NewPromptDallE(),
},
})
}
4 changes: 0 additions & 4 deletions internal/connectors/openai/operation_prompt_chatgpt.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ type PromptChatGPTOperationInput struct {
func NewPromptChatGPT() *PromptChatGPTOperation {
getGPTModels := func(ctx *sdkcore.DynamicFieldContext) (interface{}, error) {
models, err := getModels(ctx.Auth.Secret, "gpt")

if err != nil {
return nil, err
}
Expand Down Expand Up @@ -166,7 +165,6 @@ func (c *PromptChatGPTOperation) Run(ctx *sdk.RunContext) (sdk.JSON, error) {
}

client, err := getOpenAiClient(ctx.Auth.Secret)

if err != nil {
return nil, err
}
Expand All @@ -175,7 +173,6 @@ func (c *PromptChatGPTOperation) Run(ctx *sdk.RunContext) (sdk.JSON, error) {
Header().AddContentType("application/json").
Body().AsJSON(requestBody).
Send()

if err != nil {
return nil, err
}
Expand All @@ -185,7 +182,6 @@ func (c *PromptChatGPTOperation) Run(ctx *sdk.RunContext) (sdk.JSON, error) {
}

bodyBytes, err := io.ReadAll(res.Body().Raw())

if err != nil {
return nil, err
}
Expand Down
3 changes: 0 additions & 3 deletions internal/connectors/openai/shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,11 @@ func getOpenAiClient(token string) (fastshot.ClientHttpMethods, error) {

func getModels(token string, modelPrefix string) (interface{}, error) {
client, err := getOpenAiClient(token)

if err != nil {
return nil, err
}

res, err := client.GET("/models").Send()

if err != nil {
return nil, err
}
Expand All @@ -34,7 +32,6 @@ func getModels(token string, modelPrefix string) (interface{}, error) {
}

bodyBytes, err := io.ReadAll(res.Body().Raw())

if err != nil {
return nil, err
}
Expand Down

0 comments on commit c7b595a

Please sign in to comment.