Skip to content

Streaming with the per_req_config_modifier #665

Answered by rarchitgupta
rarchitgupta asked this question in Q&A
Discussion options

You must be logged in to vote

@ltbd78 Thank you so much, yes I dug deeper into what you mentioned earlier and after tinkering around for quite a bit, I got something that works for me

Modified the class to look like this:

class PerUserQuery(RunnableSerializable):
    """
    A custom runnable that returns a list of documents for the given user.

    The runnable is configurable by the user, and the search results are
    filtered by the user ID.
    """

    user_id: Optional[str]
    vectorstore: VectorStore

    class Config:
        # Allow arbitrary types since VectorStore is an abstract interface
        # and not a pydantic model
        arbitrary_types_allowed = True

    def get_rag_chain(self, query):

        

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@ltbd78
Comment options

@rarchitgupta
Comment options

@ltbd78
Comment options

@rarchitgupta
Comment options

Answer selected by rarchitgupta
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants