Utils
This module contains functionality related to the the utils
module for augmentation.chainlit
.
Utils
ChainlitUtils
Utility class for handling conversation messages.
Provides methods for managing welcome messages and reference handling in conversations.
Attributes: |
|
---|
Source code in src/augmentation/chainlit/utils.py
13 14 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 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
|
__init__(configuration)
Initialize ChainlitUtils with configuration.
Parameters: |
|
---|
Source code in src/augmentation/chainlit/utils.py
24 25 26 27 28 29 30 31 |
|
add_references(message, response)
Append source references to a message from a streaming response.
Takes a message object and a streaming response containing source nodes, then appends formatted references to the message content.
Parameters: |
|
---|
Source code in src/augmentation/chainlit/utils.py
47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
|
get_welcome_message()
Create and return a welcome message for the chat interface.
Creates a Message object with content from the configuration's welcome_message to greet users when they start a conversation.
Returns: |
|
---|
Source code in src/augmentation/chainlit/utils.py
33 34 35 36 37 38 39 40 41 42 43 44 45 |
|
ChainlitUtilsFactory
Bases: SingletonFactory
Factory class for creating ChainlitUtils instances.
This class extends the Factory pattern to create instances of ChainlitUtils based on a given ChainlitConfiguration. It ensures that the configuration provided is of the correct type and handles the creation of new instances.
Attributes: |
|
---|
Source code in src/augmentation/chainlit/utils.py
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 |
|