refactor: Refactor endpoint and model compatibility check (#180)

* Add model check for chat stream

* Sync model checks

* Fix typo

* Fix functino

* refactor: Refactor endpoint and model compatibility check

* apply review suggestions

* minor fix

* invert return boolean flag

* fix test
This commit is contained in:
Jo
2023-03-22 21:46:08 +08:00
committed by GitHub
parent 428839400a
commit 2ebb265e71
8 changed files with 94 additions and 13 deletions

View File

@@ -61,7 +61,7 @@ func TestClientReturnsRequestBuilderErrors(t *testing.T) {
t.Fatalf("Did not return error when request builder failed: %v", err)
}
_, err = client.CreateChatCompletionStream(ctx, ChatCompletionRequest{})
_, err = client.CreateChatCompletionStream(ctx, ChatCompletionRequest{Model: GPT3Dot5Turbo})
if !errors.Is(err, errTestRequestBuilderFailed) {
t.Fatalf("Did not return error when request builder failed: %v", err)
}