Utils
config_loader
llama_utils.utils.config_loader
A class or function to load configuration.
ConfigLoader
A class or function to load configuration.
Source code in src/llama_utils/utils/config_loader.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 |
|
embedding
property
writable
Get the embedding model.
llm
property
writable
Get the llm model.
settings
property
Get the settings.
__init__(llm: Any = None, embedding: Any = None)
Initialize the ConfigLoader class.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
llm
|
Any
|
llm model to use. |
None
|
embedding
|
Any
|
Embedding model to use. |
None
|
Source code in src/llama_utils/utils/config_loader.py
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 |
|
helper_functions
llama_utils.utils.helper_functions
A collection of helper functions used across different modules (e.g., text preprocessing, validation).
HelperFunctions
A collection of helper functions used across different modules (e.g., text preprocessing, validation).
Source code in src/llama_utils/utils/helper_functions.py
10 11 12 13 14 15 |
|
__init__()
Initialize the helper functions.
Source code in src/llama_utils/utils/helper_functions.py
13 14 15 |
|
generate_content_hash(content: str)
Generate a hash for the document content using SHA-256.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
content
|
str
|
The content of the document. |
required |
Returns:
Type | Description |
---|---|
str
|
The SHA-256 hash of the content. |
Source code in src/llama_utils/utils/helper_functions.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
|
is_sha256(string: str) -> bool
Check if a string is a valid SHA-256 hash.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
string
|
str
|
The string to check. |
required |
Returns:
Type | Description |
---|---|
bool
|
True if the string is a valid SHA-256 hash, False otherwise. |
Source code in src/llama_utils/utils/helper_functions.py
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
|