Augment
This module contains functionality related to the the augment script.
Augment
This script is used to handle chat interactions using the ChainLit library and a chat engine. Actions are observed by Langfuse. To make it work vector storage should be filled with the embeddings of the documents. To run the script execute the following command from the root directory of the project:
python src/chat.py
app_shutdown()
async
Clean up resources on application shutdown. Stops the scheduler if it is running.
Source code in src/augment.py
105 106 107 108 109 110 111 112 113 114 115 | |
app_startup()
async
Initialize the application on startup. Sets up the augmentation initializer and configuration, and starts the scheduler.
Source code in src/augment.py
29 30 31 32 33 34 35 36 37 38 | |
get_data_layer()
Initialize Chainlit's data layer with the custom service.
Note: This function may be called before app_startup(), so we need to initialize configuration lazily if it's not already set.
| Returns: |
|
|---|
Source code in src/augment.py
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | |
main(user_message)
async
Process user messages and generate responses.
| Parameters: |
|
|---|
Source code in src/augment.py
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 | |
start()
async
Initialize chat session with chat engine. Sets up session-specific chat engine and displays welcome message.
Source code in src/augment.py
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | |