Get Vector Store
Create or retrieve a Vectorstore instance for PDF RAG.
get_vectorstore(embedding_model, config, force_new=False)
Factory function to get or create a Vectorstore instance. Ensures the same instance is reused across the application.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
embedding_model
|
Embeddings
|
The embedding model to use |
required |
config
|
Any
|
Configuration object |
required |
force_new
|
bool
|
Force creation of a new instance |
False
|
Returns:
Type | Description |
---|---|
Vectorstore
|
Vectorstore instance |
Source code in aiagents4pharma/talk2scholars/tools/pdf/utils/get_vectorstore.py
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 |
|