NVIDIA / NeMo-Guardrails

NeMo Guardrails is an open-source toolkit for easily adding programmable guardrails to LLM-based conversational systems.
Other
4.08k stars 380 forks source link

Is there a way to access chat history? #231

Open Abubakarjutt opened 10 months ago

Abubakarjutt commented 10 months ago

I am using the following command to interact with the chat application.

messages = [{"role": "user", "content": "hello"}]
res = await rails.generate_async(messages=messages)
print(res)

Is there a way to get chat history so I can extract user info from the chat history to varify users? Also can this be done through a single colang file? Can the same colang file contains the chat flows and also the instructions to extract certain information from the user inputs?

drazvan commented 10 months ago

Hi @Abubakarjutt ! The chat history is the set of initial messages that you are passing to the generate method plus the additional one that is returned.

Related to your second question, do you mean something along these lines: https://github.com/NVIDIA/NeMo-Guardrails/blob/develop/docs/user_guides/advanced/extract-user-provided-values.md ?