Skip to content

Commit c407f90

Browse files
committed
Fix and re-enable retrieval tests
1 parent fdb3352 commit c407f90

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Tests/RetrievalTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace Devlooped.Extensions.AI;
66

77
public class RetrievalTests(ITestOutputHelper output)
88
{
9-
[SecretsTheory("OPENAI_API_KEY", Skip = "Vector processing not completing")]
9+
[SecretsTheory("OPENAI_API_KEY")]
1010
[InlineData("gpt-4.1-nano", "Qué es la rebeldía en el Código Procesal Civil y Comercial Nacional?")]
1111
[InlineData("gpt-4.1-nano", "What's the battery life in an iPhone 15?", true)]
1212
public async Task CanRetrieveContent(string model, string question, bool empty = false)
@@ -19,10 +19,10 @@ public async Task CanRetrieveContent(string model, string question, bool empty =
1919
try
2020
{
2121
var result = client.GetVectorStoreClient().AddFileToVectorStore(store.Value.Id, file.Value.Id);
22-
while (result.Value.Status != global::OpenAI.VectorStores.VectorStoreFileStatus.Cancelled)
22+
while (result.Value.Status != global::OpenAI.VectorStores.VectorStoreFileStatus.Completed)
2323
{
24-
await Task.Delay(100);
25-
result = client.GetVectorStoreClient().GetVectorStoreFile(store.Value.Id, file.Value.Id);
24+
await Task.Delay(250);
25+
result = client.GetVectorStoreClient().GetVectorStoreFile(result.Value.VectorStoreId, result.Value.FileId);
2626
}
2727

2828
var responses = new OpenAIResponseClient(model, Configuration["OPENAI_API_KEY"]);

0 commit comments

Comments
 (0)