Update retrieve_utils.py added lancedb as vectordb#25
Conversation
|
Thank you @akashAD98 for the PR. I suggest we keep the current APIs and adding a parameter def create_vector_db_from_dir(
dir_path: str,
max_tokens: int = 4000,
client: API = None,
db_path: str = "/tmp/chromadb.db",
collection_name: str = "all-my-documents",
get_or_create: bool = False,
chunk_mode: str = "multi_lines",
must_break_at_empty_line: bool = True,
embedding_model: str = "all-MiniLM-L6-v2",
vector_database: str = "chromadb",
):
def query_vector_db(
query_texts: List[str],
n_results: int = 10,
client: API = None,
db_path: str = "/tmp/chromadb.db",
collection_name: str = "all-my-documents",
search_string: str = "",
embedding_model: str = "all-MiniLM-L6-v2",
vector_database: str = "chromadb",
) -> Dict[str, List[str]]:We can define different functions to use different vector databases and call them in the current APIs. def create_chromadb_from_dir():
def query_chromadb():
def create_lancedb_from_dir():
def query_lancedb():Could you please also update the tests for the new util functions? Thank you very much again for your contribution. |
thinkall
left a comment
There was a problem hiding this comment.
Comments left in the last reply.
Codecov Report
@@ Coverage Diff @@
## main #25 +/- ##
==========================================
- Coverage 39.98% 36.49% -3.49%
==========================================
Files 17 16 -1
Lines 2036 2066 +30
Branches 453 458 +5
==========================================
- Hits 814 754 -60
- Misses 1149 1242 +93
+ Partials 73 70 -3
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
@thinkall yes, thanks for the reply.yes ill add this sure |
|
@thinkall as per your suggetion i did changes,can you please review it? let me know if anything i need to do or modify.thanks |
thinkall
left a comment
There was a problem hiding this comment.
Thank you so much, @akashAD98 , nice job! I've left some comments, could you please address them?
Could you also add some tests in autogen/test/test_retrieve_utils.py to cover the new functions?
Thank you again for your contribution! Let me know if you need any help.
|
The code format checking is failed, could you please run |
removed duplicate code & using same embedding function instead of hugging face
yes im working on it. thank you so much for your guidance |
added vector_database parameter
sorry i missed your msg.yes i m doining |
Hi @akashAD98 , I'm thinking about a more general way of supporting different vector dbs in this PR #161 . Could you check if this works for your use case? Thank you very much! |
|
I see your reply in #161. Let me try adding your case as a test in my PR. |
Hi @akashAD98 , check the example here: autogen/test/test_retrieve_utils.py Line 103 in fa6e2a5 |
|
@thinkall I'm running the code in collab, i have defind the class LancedbRetrieveUserProxyAgent & im gettiing bewlow error,so whts wrong here? |
|
@akashAD98 , could you try update |
|
@thinkall yes its works but its always gives same output also im not user , adding 'client:'--' it is taking lancedb i tried this way but working table = db.open_table("my_table", mode="overwrite") |
* make ghClient fetch synchronous * refactor memory, extract knowledge adding to AiAgent
…responses (#25) * rename broadcast to publish * remove require response, remove responses from publishing
- Add tabindex='0' to make button focusable - Add aria-label for screen readers - Add keydown handler for Enter/Space activation - Announce scroll action via live region Fixes issue microsoft#25 in microsoft#6090

Why are these changes needed?
I want to use the lancdb as vectordb ,so i have added code, i know we can make it better like passing arguments or more user friendly. so looking for some suggestions how can we add diff vectorestore.thanks
Related issue number
Checks