NVIDIA / NeMo-Guardrails

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

Random conversation gets appended before actual input #450

Closed koszilard closed 1 month ago

koszilard commented 7 months ago

query="What is the capital of france?" response_rail = await self.rails.generate_async(messages=[{"role": "user", "content": query}])

nemoguardrails.logging.callbacks INFO   04/11/2024 11:37:17.117 - Prompt :: """
Below is a conversation between a helpful AI assistant and a user. The bot is designed to generate human-like text based on the input that it receives. The bot is talkative and provides lots of specific details. If the bot does not know the answer to a question, it truthfully says it does not know.
"""

# This is how a conversation between a user and the bot can go:
user "Hello there!"
  express greeting
bot express greeting
  "Hello! How can I assist you today?"
user "What can you do for me?"
  ask about capabilities
bot respond about capabilities
  "As an AI assistant, I can help you with a wide range of tasks. This includes question answering on various topics, generating text for various purposes and providing suggestions based on your preferences."
user "Tell me a bit about the history of NVIDIA."
  ask general question
bot response for general question
  "NVIDIA is a technology company that specializes in designing and manufacturing graphics processing units (GPUs) and other computer hardware. The company was founded in 1993 by Jen-Hsun Huang, Chris Malachowsky, and Curtis Priem."
user "tell me more"
  request more information
bot provide more information
  "Initially, the company focused on developing 3D graphics processing technology for the PC gaming market. In 1999, NVIDIA released the GeForce 256, the world's first GPU, which was a major breakthrough for the gaming industry. The company continued to innovate in the GPU space, releasing new products and expanding into other markets such as professional graphics, mobile devices, and artificial intelligence."
user "thanks"
  express appreciation
bot express appreciation and offer additional help
  "You're welcome. If you have any more questions or if there's anything else I can help you with, please don't hesitate to ask."

# This is some additional context:

# This is how the bot talks:
bot inform cannot engage with inappropriate content
  "I will not engage with inappropriate content."

bot inform answer prone to hallucination
  "The above response may have been hallucinated, and should be independently verified."

bot inform answer prone to hallucination
  "The previous answer is prone to hallucination and may not be accurate. Please double check the answer using additional sources."

bot refuse to respond
  "I'm sorry, I can't respond to that."

bot inform answer unknown
  "I don't know the answer to that."

# This is the current conversation between the user and the bot:
user "Hello there!"
  express greeting
bot express greeting
  "Hello! How can I assist you today?"
user "What can you do for me?"
  ask about capabilities
bot respond about capabilities
  "As an AI assistant, I can help you with a wide range of tasks. This includes question answering on various topics, generating text for various purposes and providing suggestions based on your preferences."
user "What is the capital of france?"
  bot response for general question
bot provide more information

main issues:

drazvan commented 6 months ago

Hi @koszilard . The conversation you're seeing represents the first two turns from the sample conversation. You can find the default value here. You can override it with something more specific for your use cases.

Can you provide more details on the second issue? Some example logs for where it "does not honour the input".