Create and manage a multi-turn conversation with an LLM.
Usage
hf_conversation(system = NULL, model = "HuggingFaceTB/SmolLM3-3B")
Arguments
- system
Character string or NULL. System prompt for the conversation.
- model
Character string. Model ID from Hugging Face Hub.
Default: "HuggingFaceTB/SmolLM3-3B".
Value
A conversation object (list) that can be extended with chat().
Examples
if (FALSE) { # \dontrun{
# Create conversation
convo <- hf_conversation(system = "You are a helpful R tutor.")
# Add messages (see chat() method)
convo <- chat(convo, "How do I read a CSV?")
convo <- chat(convo, "What about Excel files?")
# View history
convo$history
} # }