-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support tencent vector db #3568
Conversation
api/tests/unit_tests/core/rag/datasource/vdb/tencent/test_tencent.py
Outdated
Show resolved
Hide resolved
-1 for supporting tencent vdb
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rest looks good to me.
how is it going? |
wait review ~ |
|
done~ |
ok, thx. |
limit=kwargs.get('top_k', 4), | ||
timeout=self._client_config.timeout, | ||
) | ||
return self._get_search_res(res) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the socre is not returned and we have the score thresold check.
pls refer to below code:
for doc, score in docs_and_scores:
score_threshold = kwargs.get("score_threshold", .0) if kwargs.get('score_threshold', .0) else 0.0
# check score threshold
if score > score_threshold:
doc.metadata['score'] = score
docs.append(doc)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@quicksandznzn In the method |
the sdk is fine , it has returned the score |
|
thanks , optimized |
with redis_client.lock(lock_name, timeout=20): | ||
collection_exist_cache_key = 'vector_indexing_{}'.format(self._collection_name) | ||
if redis_client.get(collection_exist_cache_key): | ||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the self.collection
not initialized @quicksandznzn
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix
@quicksandznzn I found some problems: dify/api/core/rag/datasource/vdb/tencent/tencent_vector.py Lines 158 to 161 in a591366
The self.collection won't be initialized in multithread because of redis lock (For example, create a dataset), why not use |
it takes so long~~ 😭 |
* commit '12c815c597b121357151c798aae6580304416937': (97 commits) fix: ExtractSetting optional value missing None as default val (langgenius#5238) version to 0.6.11 (langgenius#5224) Feat/firecrawl data source (langgenius#5232) update tooltip (langgenius#5235) fix: note editor italic (langgenius#5230) fix: z-index (langgenius#5229) Update README.md (langgenius#5228) fix: allow the name and icon of the web app to be set independently of that of the bot itself (langgenius#5225) fix: initialize site with customized icon and icon_background (langgenius#5227) feat: support firecrawl frontend code (langgenius#5226) feat(Tools): Add Feishu multi-dimensional table operation function (langgenius#5213) chore: development script for syncing Poetry lockfile (langgenius#5170) fix: workspace member's last_active should be last_active_time, but not last_login_time (langgenius#4906) fix: number variable cause type error in openai moderation (langgenius#5222) feat: new editor user permission profile (langgenius#4435) Fix: http_request delete method not working (langgenius#4975) Update README, deploy dify with YAML file on Kubernetes (langgenius#5131) feat: support tencent vector db (langgenius#3568) fix: add repo check for build-push.yml (langgenius#5141) feat: Add Optional API Key, Proxy Server, and Bypass Cache Parameters to Jina Tools (langgenius#5197) ... # Conflicts: # api/core/helper/code_executor/code_executor.py # api/requirements.txt
Description
Support Tencent Vector DB
dependencies
tcvectordb==1.3.2
Type of Change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Suggested Checklist:
dev/reformat
(backend) andcd web && npx lint-staged
(frontend) to appease the lint godsoptional
I have made corresponding changes to the documentationoptional
I have added tests that prove my fix is effective or that my feature worksoptional
New and existing unit tests pass locally with my changes