Tool Helper
Helper class for question and answer tool in PDF processing.
QAToolHelper
Encapsulates helper routines for the PDF Question & Answer tool. Enhanced with automatic GPU/CPU detection and optimization.
Source code in aiagents4pharma/talk2scholars/tools/pdf/utils/tool_helper.py
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 |
|
get_hardware_stats()
Get current hardware configuration stats for monitoring.
Source code in aiagents4pharma/talk2scholars/tools/pdf/utils/tool_helper.py
81 82 83 84 85 86 87 |
|
get_state_models_and_data(state)
Retrieve embedding model, LLM, and article data from agent state.
Source code in aiagents4pharma/talk2scholars/tools/pdf/utils/tool_helper.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
|
init_vector_store(emb_model)
Get the singleton Milvus vector store instance with GPU/CPU optimization.
Source code in aiagents4pharma/talk2scholars/tools/pdf/utils/tool_helper.py
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 |
|