Support retrieve_online_documents with embedding function
We can pass an optional embedding function to retrieve_online_documents to embed data first then retrieve top k documents.
E.g,
def retrieve_online_documents(
self,
feature: str,
embedding: func,
query: Union[str, List[float]],
top_k: int,
distance_metric: Optional[str] = None,
) -> OnlineResponse:
if query is string and embedding:
embedded_query = embedding(query)
return retrieve_online_documents(..., embedded_quer)
@franciscojavierarceo @tokoko let me what you think
Yeah I like this idea! We could just come up with an opinionated way to do this with HuggingFace as an extra? We could call it feast[genai] or something that reduces friction for getting setup even further?
One concern from me is... in a client-server execution (using feature server), would this function be applied on the client-side or the server-side? If it's server-side, passing an arbitrary function to this method is a problem. We usually store these kinds of user-provided functions in the registry, don't we? This seems like a bit of a deviation in that sense, or maybe I don't understand what the function does exactly.
I imagine it would look like the demo and it would happen server side. Maybe instead of an arbitrary function we could just have things configurable and make it correspond to a transformer or an OpenAi call.
We can discuss today at community call!
One concern from me is... in a client-server execution (using feature server), would this function be applied on the client-side or the server-side? If it's server-side, passing an arbitrary function to this method is a problem. We usually store these kinds of user-provided functions in the registry, don't we? This seems like a bit of a deviation in that sense, or maybe I don't understand what the function does exactly.
maybe we can do just the client side. not sure how the server works in feast, but my use case is just apply embedding before the vector be used.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.