From c7b595a6bced7a6e0a15e8cdbdb64eb3c136076c Mon Sep 17 00:00:00 2001 From: Rubicon Lee Date: Thu, 3 Oct 2024 17:41:01 -0500 Subject: [PATCH] fix: updated sdk to 0.6.0 Signed-off-by: Rubicon Lee --- internal/connectors/openai/lib.go | 2 +- internal/connectors/openai/operation_prompt_chatgpt.go | 4 ---- internal/connectors/openai/shared.go | 3 --- 3 files changed, 1 insertion(+), 8 deletions(-) diff --git a/internal/connectors/openai/lib.go b/internal/connectors/openai/lib.go index 63a2d70..8d6e3ab 100644 --- a/internal/connectors/openai/lib.go +++ b/internal/connectors/openai/lib.go @@ -29,7 +29,7 @@ func NewConnector() (*sdk.ConnectorPlugin, error) { Triggers: []sdk.ITrigger{}, Operations: []sdk.IOperation{ NewPromptChatGPT(), - //NewPromptDallE(), + // NewPromptDallE(), }, }) } diff --git a/internal/connectors/openai/operation_prompt_chatgpt.go b/internal/connectors/openai/operation_prompt_chatgpt.go index c1af94c..74e4da1 100644 --- a/internal/connectors/openai/operation_prompt_chatgpt.go +++ b/internal/connectors/openai/operation_prompt_chatgpt.go @@ -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 } @@ -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 } @@ -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 } @@ -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 } diff --git a/internal/connectors/openai/shared.go b/internal/connectors/openai/shared.go index 26c6ed1..712250e 100644 --- a/internal/connectors/openai/shared.go +++ b/internal/connectors/openai/shared.go @@ -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 } @@ -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 }