-
Notifications
You must be signed in to change notification settings - Fork 4
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: request contextualisation - core functionality #65
base: main
Are you sure you want to change the base?
Conversation
…turn List[MethodParamWithTyping] required to construct ExposedFunction dataclass
Code Coverage Summary
Diff against main
Results for commit: f8bf64e Minimum allowed coverage is ♻️ This comment has been updated with latest results |
…bugfix; fixed linting issues
…aseCallerContext subclasses from the Union[] args; linting fix
…ss + type hint improvements: fixes, new generics and aliases
…nt when it detectes the additional context is required
…jc/issue-54-request-context
0ded684
to
9ba89e5
Compare
…pylint; run pre-commit auto refactor
Trivy scanning results. |
7a49b4d
to
3c87020
Compare
…ity and properly handle types: Union[Type1, Type2, ...], __main__.SomeCustomClass
f78c101
to
3423033
Compare
src/dbally/context/_utils.py
Outdated
filter_method_: type_ext.Callable, hidden_args: Sequence[str] | ||
) -> Tuple[Sequence[MethodParamWithTyping], ContextClass]: | ||
""" | ||
Processes the MethodsBaseView filter method signauture to extract the args and type hints in the desired format. |
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.
Typos: "signauture", "claases", "are getting excluded the returned"
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.
Thanks.
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.
Please update the docs on how contexts are defined and how they work.
) | ||
except IQLError as exc: | ||
# TODO handle the possibility of variable `response` being not initialized |
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.
How can it be not initialized at this point?
|
||
Returns: | ||
Generated IQL query. | ||
""" | ||
prompt_format = IQLGenerationPromptFormat( | ||
question=question, | ||
filters=filters, | ||
examples=examples, | ||
examples=examples or [], |
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.
This is handled in the PromptFormat
initializator.
src/dbally/context/exceptions.py
Outdated
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.
All dbally exceptions should inherit from dbally.exceptions.DbAllyError
. To be consistent with the rest of the code base:
BaseContextException
should inherit fromDbAllyError
- rename
BaseContextException
->ContextError
- use inheritance for
ContextNotAvailableError
andContextualisationNotAllowed
…mples to the prompt
…, b] -> a | b; removed typing & typing_extensions module name prefixes
b5827c9
to
1294a9c
Compare
…context" -> "metadata" (to ommit confusing naming overlap with newly added contextualisation functionality); views.exposed_functions pylint warnings resolved
… list[int]) in Python 3.9+
7f8b5f4
to
5398636
Compare
…xecutionResult]."context" -> "metadata"
…as other IQL errors, inherting from IQLError, thus enabled its handling by self-reflection mechanism
…ly in 'structured_view.ask()' and than stored in 'ExposedFunction' instances
5398636
to
623effd
Compare
…and putting filter args in quotation marks
c5d7b65
to
e7e8826
Compare
…uest-context; type hint fixes, missing docstrings, additional refactor
Closes #54