Multiple messages
Intelli chatbot understands the conversation flow from the history messages you pass. ChatModelInput lets you add a sequence of messages from both the user and the assistant. Use the messages to provide the conversation context, or to tune the model to respond in a specific way with few shot examples.
Example
from intelli.model.input.chatbot_input import ChatModelInput
from intelli.function.chatbot import Chatbot, ChatProvider
chat_input = ChatModelInput(system="You are a helpful assistant.", model="mistral-large-latest")
# add the messages history
chat_input.add_user_message("What's the scientific name for a tomato?")
chat_input.add_assistant_message("The scientific name for a tomato is Solanum lycopersicum.")
chat_input.add_user_message("Is it a fruit or a vegetable?")
chat_input.add_assistant_message("Botanically, a tomato is considered a fruit.")
chat_input.add_user_message("What are its nutritional benefits?")
# call the chatbot with the full history
chatbot = Chatbot(YOUR_MISTRAL_API_KEY, ChatProvider.MISTRAL)
response = chatbot.chat(chat_input)
Get the next agent guide in your inbox.
Be the first to read new guides on AI agents, RAG and MCP apps.