Extend SearchResult and MemoryResult objects #879
marcominerva
started this conversation in
2. Feature requests
Replies: 1 comment 3 replies
-
How about extending the classes? public class MySearchResult : SearchResult
{
public Dictionary<string, object?>? Metadata { get; set; }
} public class MySearchClient : ISearchClient
{
public async Task<SearchResult> SearchAsync(...)
{
var result = new MySearchResult();
// ....
return result
}
} |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We can easily provide a custom implementation of
ISearchClient
if we want to define our custom search logic. However, we are tied to useSearchResult
andMemoryAnswer
return type, so we cannot add custom information.My suggestion is to add a property like "Metadata" to both
SearchResult
andMemoryAnswer
:In this way, new implementations of
SearchClient
can use this property to customize the response.Beta Was this translation helpful? Give feedback.
All reactions