Describe the bug
When running a search in memory and limiting the results to certain number, I have noticed that this limit is not taken into account.
For instance, if I set a limit of 4 results, I am getting result entries above that number.
To Reproduce
-
Create a Kernel with Memory (AzureCognitiveSearchMemory in this case)
String modelId="gpt-35-turbo";
String acsEndpoint="yourAcsEndpoint";
String acsApiKey="yourAcsApiKey";
Kernel kernel = SKBuilders.kernel()
.withDefaultAIService(SKBuilders.chatCompletion()
.setModelId(modelId)
.withOpenAIClient(client)
.build())
.withMemory(new AzureCognitiveSearchMemory(acsEndpoint, acsApiKey))
.build();
-
Perform a search using this kernel:
String collection = "yourcollection";
String query = "yourquery";
int limit= 10;
System.out.println("Limit is " + limit);
List<MemoryQueryResult> result = kernel.
.getMemory()
.searchAsync(collection,
query, limit, 0.7, false)
.block();
System.out.println("Returning " + result.size() + " results");
Expected behavior
The search should return an amount of result entries below or equals than the limit set.
Screenshots

Platform
- OS: Linux
- IDE: VS Code
- Language: Java
- Source: 0.2.8-alpha
Describe the bug
When running a search in memory and limiting the results to certain number, I have noticed that this limit is not taken into account.
For instance, if I set a limit of 4 results, I am getting result entries above that number.
To Reproduce
Create a Kernel with Memory (AzureCognitiveSearchMemory in this case)
Perform a search using this kernel:
Expected behavior
The search should return an amount of result entries below or equals than the limit set.
Screenshots

Platform