Skip to content

Commit f1fdd73

Browse files
committed
Add missed recordings
1 parent 1deb7ab commit f1fdd73

File tree

3 files changed

+201
-1
lines changed

3 files changed

+201
-1
lines changed

tests/Responses/ResponsesTests.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ public async Task ImageGenToolStreaming()
294294
int inProgressCount = 0;
295295
int generateCount = 0;
296296
bool gotCompletedImageGenItem = false;
297+
bool gotCompletedResponseItem = false;
297298

298299
await foreach (StreamingResponseUpdate update
299300
in client.CreateResponseStreamingAsync(message, responseOptions))
@@ -330,9 +331,20 @@ in client.CreateResponseStreamingAsync(message, responseOptions))
330331
Assert.That(outputItemCompleteUpdate.OutputIndex, Is.EqualTo(0));
331332
gotCompletedImageGenItem = true;
332333
}
334+
else if (update is StreamingResponseOutputItemDoneUpdate outputItemDoneUpdate)
335+
{
336+
if (outputItemDoneUpdate.Item is ImageGenerationCallResponseItem imageGenCallItem)
337+
{
338+
Assert.That(imageGenCallItem.Id, Is.Not.Null.And.Not.Empty);
339+
imageGenItemId ??= imageGenCallItem.Id;
340+
Assert.That(imageGenItemId, Is.EqualTo(outputItemDoneUpdate.Item.Id));
341+
Assert.That(outputItemDoneUpdate.OutputIndex, Is.EqualTo(0));
342+
gotCompletedResponseItem = true;
343+
}
344+
}
333345
}
334346

335-
Assert.That(gotCompletedImageGenItem, Is.True);
347+
Assert.That(gotCompletedResponseItem || gotCompletedImageGenItem, Is.True);
336348
Assert.That(partialCount, Is.EqualTo(1));
337349
Assert.That(inProgressCount, Is.EqualTo(1));
338350
Assert.That(generateCount, Is.EqualTo(1));

tests/SessionRecords/ResponsesTests/ImageGenToolStreaming.json

Lines changed: 96 additions & 0 deletions
Large diffs are not rendered by default.

tests/SessionRecords/ResponsesTests/ImageGenToolStreamingAsync.json

Lines changed: 92 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)