Utils
utils
Functions:
Name | Description |
---|---|
run_chat |
Runs a chat session between a user and a bot. |
run_chat
Runs a chat session between a user and a bot. The function works by continuously listening to the user's input and generating the bot's responses in separate threads. If the user interrupts the bot's speech, the remaining part of the bot's response is saved and prepended to the user's next input. The chat stops when the stopping_criteria function returns True for a bot's response.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mouth
|
A mouth object. |
required | |
ear
|
An ear object. |
required | |
chatbot
|
A chatbot object. |
required | |
stopping_criteria
|
A function that determines when the chat should stop. It takes the bot's response as input and returns a boolean. Defaults to a function that always returns False. |
lambda x: False
|