Skip to content

Commit

Permalink
fix: exception when retrieval query does not mention filter value
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjoyo committed Oct 10, 2023
1 parent 0eb6f21 commit e5f156e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion python/src/gpt/agents/retrieval_agent/retrieval_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def create_retrieval_qa(
verbose=True
)
else:
if isinstance(vector_store, AzureSearch):
if filter and isinstance(vector_store, AzureSearch):
filter_dict = {'filters': f"{list(filter.keys())[0]} eq '{list(filter.values())[0]}'"}
else:
filter_dict = {'filter': filter}
Expand Down
3 changes: 1 addition & 2 deletions python/tests/manual_integration/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,7 @@ def test_retrieve():
)
print(qa(
inputs={
"input": "I can't decide between the Electra Townie Go! and the Sun Bicycles Electrolite. Could you tell me how they compare in terms of their weight?",
#"input": "What is the weight limit of the Electra Townie Go?",
"input": "What is the weight limit of the Electra Townie Go?",
"context": ""
})["output"]["answer"])

Expand Down

0 comments on commit e5f156e

Please sign in to comment.