o1 model support stream (#904)

This commit is contained in:
LinYushen
2024-11-21 04:26:10 +08:00
committed by GitHub
parent b3ece4d32e
commit 1687616165
2 changed files with 0 additions and 28 deletions

View File

@@ -36,27 +36,6 @@ func TestChatCompletionsStreamWrongModel(t *testing.T) {
}
}
func TestChatCompletionsStreamWithO1BetaLimitations(t *testing.T) {
config := openai.DefaultConfig("whatever")
config.BaseURL = "http://localhost/v1/chat/completions"
client := openai.NewClientWithConfig(config)
ctx := context.Background()
req := openai.ChatCompletionRequest{
Model: openai.O1Preview,
Messages: []openai.ChatCompletionMessage{
{
Role: openai.ChatMessageRoleUser,
Content: "Hello!",
},
},
}
_, err := client.CreateChatCompletionStream(ctx, req)
if !errors.Is(err, openai.ErrO1BetaLimitationsStreaming) {
t.Fatalf("CreateChatCompletion should return ErrO1BetaLimitationsStreaming, but returned: %v", err)
}
}
func TestCreateChatCompletionStream(t *testing.T) {
client, server, teardown := setupOpenAITestServer()
defer teardown()