Replies: 1 comment
-
I have the same problem here, I defined a list of allowed comparators but the get_query_constructor_prompt does not seem to follow those rules |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Checked other resources
Commit to Help
Example Code
Description
I am trying to update the allowed_comparators to include "Like" by doing the following:
allowed_comparators = [
"$eq", # Equal to (number, string, boolean)
"$ne", # Not equal to (number, string, boolean)
"$gt", # Greater than (number)
"$gte", # Greater than or equal to (number)
"$lt", # Less than (number)
"$lte", # Less than or equal to (number)
"$like", # Like (string)
]
constructor_prompt = get_query_constructor_prompt(
document_contents=document_content_description,
attribute_info= metadata_field_info,
allowed_comparators=allowed_comparators,
)
output_parser = StructuredQueryOutputParser.from_components()
query_constructor = constructor_prompt | query_model | output_parser
However I am still getting the following error: ValueError: Received disallowed comparator Comparator.LIKE. Allowed comparators are [<Comparator.EQ: 'eq'>, <Comparator.NE: 'ne'>, <Comparator.GT: 'gt'>, <Comparator.GTE: 'gte'>, <Comparator.LT: 'lt'>, <Comparator.LTE: 'lte'>]
System Info
mac os, python 3.12
Beta Was this translation helpful? Give feedback.
All reactions