Check for Stream parameter usage (#174)
* check for stream:true usage * lint
This commit is contained in:
15
chat_test.go
15
chat_test.go
@@ -38,6 +38,21 @@ func TestChatCompletionsWrongModel(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestChatCompletionsWithStream(t *testing.T) {
|
||||
config := DefaultConfig("whatever")
|
||||
config.BaseURL = "http://localhost/v1"
|
||||
client := NewClientWithConfig(config)
|
||||
ctx := context.Background()
|
||||
|
||||
req := ChatCompletionRequest{
|
||||
Stream: true,
|
||||
}
|
||||
_, err := client.CreateChatCompletion(ctx, req)
|
||||
if !errors.Is(err, ErrChatCompletionStreamNotSupported) {
|
||||
t.Fatalf("CreateChatCompletion didn't return ErrChatCompletionStreamNotSupported error")
|
||||
}
|
||||
}
|
||||
|
||||
// TestCompletions Tests the completions endpoint of the API using the mocked server.
|
||||
func TestChatCompletions(t *testing.T) {
|
||||
server := test.NewTestServer()
|
||||
|
||||
Reference in New Issue
Block a user