tryAGI / LangChain

C# implementation of LangChain. We try to be as close to the original as possible in terms of abstractions, but are open to new entities.
https://tryagi.gitbook.io/langchain/
MIT License
466 stars 71 forks source link

Search right after adding doesn't return the added items. Fix this later, it's j... #268

Closed github-actions[bot] closed 2 months ago

github-actions[bot] commented 2 months ago

https://github.com/tryAGI/LangChain/blob/03110ccdfc74d2a4bdace3575a52b97c15d6f595/src/Databases/OpenSearch/src/OpenSearchVectorCollection.cs#L52


            throw new InvalidOperationException($"Failed to add items to collection '{Name}'. DebugInformation: {response.DebugInformation}");
        }

        // TODO: Search right after adding doesn't return the added items. Fix this later, it's just a temporary solution. 
        await Task.Delay(TimeSpan.FromMilliseconds(1000), cancellationToken).ConfigureAwait(false);

        return response.Items
            .Select(i => i.Id)
            .ToArray();