-
Notifications
You must be signed in to change notification settings - Fork 65
[llm unify 5/n] llm_filter #1154
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
Conversation
Signed-off-by: Henry Lindeman <hmlindeman@yahoo.com>
…e use entity Signed-off-by: Henry Lindeman <hmlindeman@yahoo.com>
Signed-off-by: Henry Lindeman <hmlindeman@yahoo.com>
Signed-off-by: Henry Lindeman <hmlindeman@yahoo.com>
Signed-off-by: Henry Lindeman <hmlindeman@yahoo.com>
Signed-off-by: Henry Lindeman <hmlindeman@yahoo.com>
Signed-off-by: Henry Lindeman <hmlindeman@yahoo.com>
Signed-off-by: Henry Lindeman <hmlindeman@yahoo.com>
Signed-off-by: Henry Lindeman <hmlindeman@yahoo.com>
Signed-off-by: Henry Lindeman <hmlindeman@yahoo.com>
Signed-off-by: Henry Lindeman <hmlindeman@yahoo.com>
Signed-off-by: Henry Lindeman <hmlindeman@yahoo.com>
Signed-off-by: Henry Lindeman <hmlindeman@yahoo.com>
…plan as map Signed-off-by: Henry Lindeman <hmlindeman@yahoo.com>
Signed-off-by: Henry Lindeman <hmlindeman@yahoo.com>
|
||
|
||
class LlmFilterMessagesPrompt(SimplePrompt): | ||
class _LlmFilterMessagesPrompt(SimplePrompt): |
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.
delete?
LlmFilterDocValuePrompt = FieldValuePrompt( | ||
system="You are a helpful classifier that generously filters database entries based on questions.", | ||
user=( | ||
"Given a field value and a question, you will answer the question relating " |
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.
We can probably combine these? It's okay to rewrite this prompt to something better too since we're editing. I can help test
super().__init__() | ||
|
||
|
||
class JinjaDie(Exception): |
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.
Maybe name this differently :D
assert (taken[0].elements[1]["properties"]["_element_index"]) == 2 | ||
|
||
# Element order should be changed in the prompt | ||
print(taken[1]) |
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.
remove
) | ||
comptransform = entity_extractor.as_llm_map(child) | ||
assert isinstance(comptransform, CompositeTransform) | ||
llm_map = comptransform.nodes[-2] |
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.
mind adding a couple comments to clarify what the expectation here is/why
Signed-off-by: Henry Lindeman <hmlindeman@yahoo.com>
* convert extract_properties to use LLMMap Signed-off-by: Henry Lindeman <hmlindeman@yahoo.com> * use _schema_name or _schema_class as output field if present otherwise use entity Signed-off-by: Henry Lindeman <hmlindeman@yahoo.com> * drop _prompts Signed-off-by: Henry Lindeman <hmlindeman@yahoo.com> * address pr comments Signed-off-by: Henry Lindeman <hmlindeman@yahoo.com> * make mypy happy Signed-off-by: Henry Lindeman <hmlindeman@yahoo.com> * put back original exception whoops Signed-off-by: Henry Lindeman <hmlindeman@yahoo.com> * initial llm filter translate Signed-off-by: Henry Lindeman <hmlindeman@yahoo.com> * ..source_element_index -> ..source_element_indices Signed-off-by: Henry Lindeman <hmlindeman@yahoo.com> * oh yeah this was supposed to get deleted Signed-off-by: Henry Lindeman <hmlindeman@yahoo.com> * deprecate docset.llm_filter Signed-off-by: Henry Lindeman <hmlindeman@yahoo.com> * add source indices for single batch element batcher Signed-off-by: Henry Lindeman <hmlindeman@yahoo.com> * get llm_filter uts working while using EntityExtractor.as_llm_map to plan as map Signed-off-by: Henry Lindeman <hmlindeman@yahoo.com> * fix uts that broke Signed-off-by: Henry Lindeman <hmlindeman@yahoo.com> * ruff Signed-off-by: Henry Lindeman <hmlindeman@yahoo.com> * mypy Signed-off-by: Henry Lindeman <hmlindeman@yahoo.com> * pr comments Signed-off-by: Henry Lindeman <hmlindeman@yahoo.com> --------- Signed-off-by: Henry Lindeman <hmlindeman@yahoo.com>
No description provided.