From 109f5f85bf9e7424953b90f48ae0ee01569518fe Mon Sep 17 00:00:00 2001 From: Richard Park <51494936+richardpark-msft@users.noreply.github.com> Date: Fri, 4 Oct 2024 15:16:20 -0700 Subject: [PATCH] [azopenaiextensions] Of course, the streaming version can throttle as well. (#23544) * Of course, the streaming version can throttle as well. * The listing API depends on the "after this assistant" ID existing. I was just paging over the list of assistants randomly, and that is hazardous - now I always start with a known assistant ID (my own). --- sdk/ai/azopenaiextensions/client_assistants_test.go | 1 + .../client_chat_completions_extensions_test.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/sdk/ai/azopenaiextensions/client_assistants_test.go b/sdk/ai/azopenaiextensions/client_assistants_test.go index e4181b1db4..842e25cc59 100644 --- a/sdk/ai/azopenaiextensions/client_assistants_test.go +++ b/sdk/ai/azopenaiextensions/client_assistants_test.go @@ -61,6 +61,7 @@ func TestAssistants(t *testing.T) { // listing assistants { pager, err := assistantClient.List(context.Background(), openai.BetaAssistantListParams{ + After: openai.F(assistant.ID), Limit: openai.Int(1), }) require.NoError(t, err) diff --git a/sdk/ai/azopenaiextensions/client_chat_completions_extensions_test.go b/sdk/ai/azopenaiextensions/client_chat_completions_extensions_test.go index c197f01fb0..1b5de9fd52 100644 --- a/sdk/ai/azopenaiextensions/client_chat_completions_extensions_test.go +++ b/sdk/ai/azopenaiextensions/client_chat_completions_extensions_test.go @@ -89,7 +89,7 @@ func TestChatExtensionsStreaming_extensions_bringYourOwnData(t *testing.T) { } } - require.NoError(t, streamer.Err()) + customRequireNoError(t, streamer.Err()) require.NotEmpty(t, text) t.Logf("Streaming content = %s", text)