Version: Latest

Chitchat and Small Talk

This guide shows you how you can have your assistant handle chitchat / smalltalk.

Enabling Free-form chitchat

The easiest way to enable chitchat is to allow free-form generated responses from an LLM. To do this, add a flow with the name pattern_chitchat to override the default chitchat pattern. Use the utter_free_chitchat_response action:

flows.yml
flows:
pattern_chitchat:
description: handle interactions with the user that are not task-oriented
name: pattern chitchat
steps:
- action: utter_free_chitchat_response

And a custom prompt as part of the utter_free_chitchat_response in your domain:

domain.yml
utter_free_chitchat_response:
- text: ""
metadata:
rephrase: True
rephrase_prompt: |
The following is a conversation with
an AI assistant. The assistant is helpful, creative, clever, and very friendly.
The user is making small talk, and the assistant should respond, keeping things light.
Context / previous conversation with the user:
{{history}}
{{current_input}}
Suggested AI Response:

Make sure you have the response rephraser set up with an appropriate LLM in your endpoints file. For example:

endpoints.yml
nlg:
type: rephrase
llm:
model: gpt-4o

And ensure that you have set an API key via an environment variable. For example, if you're using an OpenAI model,

export OPENAI_API_KEY="your-openai-api-key"