Test request builder + streams (#242)
* test request builder + streams * provide prompt to test
This commit is contained in:
@@ -9,7 +9,7 @@ import (
|
|||||||
var (
|
var (
|
||||||
ErrCompletionUnsupportedModel = errors.New("this model is not supported with this method, please use CreateChatCompletion client method instead") //nolint:lll
|
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
|
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
|
// GPT3 Defines the models provided by OpenAI to use when generating
|
||||||
|
|||||||
@@ -145,6 +145,11 @@ func TestClientReturnsRequestBuilderErrors(t *testing.T) {
|
|||||||
if !errors.Is(err, errTestRequestBuilderFailed) {
|
if !errors.Is(err, errTestRequestBuilderFailed) {
|
||||||
t.Fatalf("Did not return error when request builder failed: %v", err)
|
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) {
|
func TestReturnsRequestBuilderErrorsAddtion(t *testing.T) {
|
||||||
|
|||||||
Reference in New Issue
Block a user