Skip to content

Commit

Permalink
'score_threshold' removed from db action (#1355)
Browse files Browse the repository at this point in the history
* db action model and db objects changes

* data processor test cases fixed

* services test cases fixed

* db action model and db objects changes

* data processor test cases fixed

* services test cases fixed

* test cases fixed

* Codacy code suggestion fixed

* added validation for empty payload for db action

* added payload search handling for non str data

* circuit breaker logic improved

* fixed training validator

* unused import removed

* removed score threshold from db action
  • Loading branch information
sfahad1414 authored Jul 18, 2024
1 parent 757eea3 commit f3cbc9a
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 6 deletions.
1 change: 0 additions & 1 deletion kairon/shared/vector_embeddings/db/qdrant.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ async def perform_operation(self, data: Dict, user: str, **kwargs):
if user_msg and isinstance(user_msg, str):
vector = await self.__get_embedding(user_msg, user, **kwargs)
request['query'] = vector
request['score_threshold'] = 0.70

if DbActionOperationType.payload_search in data:
payload = data.get(DbActionOperationType.payload_search)
Expand Down
4 changes: 0 additions & 4 deletions tests/integration_test/action_service_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3915,7 +3915,6 @@ def test_vectordb_action_execution_embedding_search_from_value(mock_embedding):
body=resp_msg,
status=200,
match=[responses.matchers.json_params_matcher({'query': embedding,
'score_threshold': 0.7,
'with_payload': True, 'limit': 10})],
)

Expand Down Expand Up @@ -4154,7 +4153,6 @@ def test_vectordb_action_execution_embedding_search_from_slot(mock_embedding):
body=resp_msg,
status=200,
match=[responses.matchers.json_params_matcher({'query': embedding,
'score_threshold': 0.7,
'with_payload': True, 'limit': 10})],
)

Expand Down Expand Up @@ -4253,7 +4251,6 @@ def test_vectordb_action_execution_embedding_search_no_response_dispatch(mock_em
body=resp_msg,
status=200,
match=[responses.matchers.json_params_matcher({'query': embedding,
'score_threshold': 0.7,
'with_payload': True, 'limit': 10})],
)

Expand Down Expand Up @@ -12868,7 +12865,6 @@ def test_vectordb_action_execution_embedding_payload_search(mock_embedding):
match=[responses.matchers.json_params_matcher({'with_payload': True,
'limit': 10,
'query': embedding,
'score_threshold': 0.7,
**payload}, strict_match=False)],
)

Expand Down
1 change: 0 additions & 1 deletion tests/unit_test/vector_embeddings/qdrant_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ async def test_embedding_search_valid_request_body_payload(self, mock_http_reque
called_args = mock_http_request.call_args
called_payload = called_args.kwargs['request_body']
assert called_payload == {'query': embedding,
'score_threshold': 0.7,
'with_payload': True,
'limit': 10}
assert called_args.kwargs['http_url'] == 'http://localhost:6333/collections/5f50fd0a56v098ca10d75d2g/points/query'
Expand Down

0 comments on commit f3cbc9a

Please sign in to comment.