Project - Building a RAG Chatbot from Your Website Data using OpenAI and Langchain

17 / 26

Step 5: Defining LLM Prompt - Prompt Roles

In chat models, a "role" refers to the specific function or identity assigned to a participant in a conversation. Each role helps determine the behavior and responsibilities of that participant within the chat interaction. Roles commonly used in chat models include "system," "user/human," and "assistant," which dictate the purpose and perspective of messages exchanged during the conversation.

System Message:

  • A system message is like a special instruction or setup for the chat model (the assistant). It's not written by a person but by the system using the chat model.
  • The system message tells the chat model how it should behave or what its role is in the conversation.
  • It might specify the assistant's personality or provide specific instructions for how it should interact.
  • An example of a system message could be: "You are a friendly assistant here to help."

User/Human Message:

  • A human message is what a person (user) types or says in the chat. It's a question, comment, or statement that the person wants the chat model (assistant) to respond to.
  • Human messages are part of the conversation and contain the actual content that drives the chat forward.
  • They can be questions like "Who won the World Series in 2020?" or follow-up queries such as "Where was it played?"
  • The assistant uses these human messages to understand what information or assistance is needed and then generates a response based on them.

Assistant Message:

  • An assistant message is a response generated by the chat model (assistant) based on the input it receives from the user messages.
  • This message represents the output of the chat model and is what the user sees as the assistant's reply in the conversation.
  • The assistant message can include answers, explanations, suggestions, or any other form of response that the chat model is capable of generating.
  • In a chat interaction, the assistant message continues the flow of conversation by providing information or addressing the user's queries.
  • Assistant messages can also be used strategically by the person using the chat model to guide or train the assistant to behave in a desired manner.

No hints are availble for this assesment

Answer is not availble for this assesment

Loading comments...