-
Notifications
You must be signed in to change notification settings - Fork 380
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
passing in relevant_chunks as a message's context #575
Comments
Hi @johnyoonh! I'm not sure I understand the issue. If you run the generation only with a message that contains the context updates (as in the first snippet you shared), then nothing happens because there's no user message to act on. In the RAG example notebook that you pointed to, the generation call includes both the context (with the relevant chunks) and the user query. Can you provide an example to reproduce the issue? |
Apologize for the delayed response. I only included context for the brevity of an example, but the behavior is the same even when I include messages with roles: user and assitant to get the proper RAG action. response = rails.generate(messages=[, |
In the Rag example, passing in the relevant_chunks as a message is possible
But when trying this as a JSON input, the
relevant_chunks
will trigger ContextUpdate and make the state update to stop, ending the event chain to be incomplete and input request failing silently with empty response.Here is my current workaround, where I try to treat context update for
relevant_chunks
as other types of event, so thatnew_state
is created and event chain is continued:nemoguardrails/colang/v1_0/runtime/flows.py
My proposed solution is to allow for custom role and update the context with consistent name pattern: "user_message", "context_message", "assistant_message", "custom_message", etc
This would allow me to pass in context specific message like this:
In an action, I would be able to retrieve them like this:
context_message = context.get("context_message")
The text was updated successfully, but these errors were encountered: