API Reference - Text Chat#
src
#
intentional_text_chat
#
Init file for intentional_text_chat
.
__about__
#
Package descriptors for intentional-text-chat.
bot_structure
#
Bot structure to support text chat for Intentional.
TextChatBotStructure
#
Bases: TurnBasedBotStructure
Bot structure implementation for text chat.
Source code in plugins/intentional-text-chat/src/intentional_text_chat/bot_structure.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
|
__init__(config, intent_router)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config
|
Dict[str, Any]
|
The configuration dictionary for the bot structure. |
required |
Source code in plugins/intentional-text-chat/src/intentional_text_chat/bot_structure.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
|
handle_interruption(lenght_to_interruption)
async
#
Handle an interruption in the streaming.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
lenght_to_interruption
|
int
|
The length of the data that was produced to the user before the interruption. This value could be number of characters, number of words, milliseconds, number of audio frames, etc. depending on the bot structure that implements it. |
required |
Source code in plugins/intentional-text-chat/src/intentional_text_chat/bot_structure.py
60 61 62 63 64 65 66 67 68 69 |
|
run()
async
#
Main loop for the bot.
Source code in plugins/intentional-text-chat/src/intentional_text_chat/bot_structure.py
45 46 47 48 49 |
|
send(data)
async
#
Sends a message to the model and forward the response.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data
|
Dict[str, Any]
|
The message to send to the model in OpenAI format, like {"role": "user", "content": "Hello!"} |
required |
Source code in plugins/intentional-text-chat/src/intentional_text_chat/bot_structure.py
51 52 53 54 55 56 57 58 |
|