diff --git a/completion.go b/completion.go index 44057616f..5eec88c29 100644 --- a/completion.go +++ b/completion.go @@ -9,7 +9,7 @@ import ( var ( ErrCompletionUnsupportedModel = errors.New("this model is not supported with this method, please use CreateChatCompletion client method instead") //nolint:lll ErrCompletionStreamNotSupported = errors.New("streaming is not supported with this method, please use CreateCompletionStream") //nolint:lll - ErrCompletionRequestPromptTypeNotSupported = errors.New("the type of CompletionRequest.Promp only supports string and []string") //nolint:lll + ErrCompletionRequestPromptTypeNotSupported = errors.New("the type of CompletionRequest.Prompt only supports string and []string") //nolint:lll ) // GPT3 Defines the models provided by OpenAI to use when generating diff --git a/request_builder_test.go b/request_builder_test.go index e5b65df0c..b1adbf1c6 100644 --- a/request_builder_test.go +++ b/request_builder_test.go @@ -145,6 +145,11 @@ func TestClientReturnsRequestBuilderErrors(t *testing.T) { if !errors.Is(err, errTestRequestBuilderFailed) { t.Fatalf("Did not return error when request builder failed: %v", err) } + + _, err = client.CreateCompletionStream(ctx, CompletionRequest{Prompt: ""}) + if !errors.Is(err, errTestRequestBuilderFailed) { + t.Fatalf("Did not return error when request builder failed: %v", err) + } } func TestReturnsRequestBuilderErrorsAddtion(t *testing.T) {