-
Notifications
You must be signed in to change notification settings - Fork 482
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
Feature/additional parameters options predict #1546
Feature/additional parameters options predict #1546
Conversation
618f980
to
9e6293f
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1546 +/- ##
==========================================
- Coverage 80.33% 80.30% -0.04%
==========================================
Files 95 110 +15
Lines 6602 7691 +1089
==========================================
+ Hits 5304 6176 +872
- Misses 1298 1515 +217 ☔ View full report in Codecov by Sentry. |
9e6293f
to
d241c25
Compare
@@ -722,6 +722,19 @@ def _delete(self, *args, **kwargs): | |||
def execute(self, db): | |||
return db.databackend.conn.table(self.identifier).execute() | |||
|
|||
def model_update( |
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.
Haven't implemented this for SQL yet.
:param vector_index: The vector index to use | ||
:param n: The number of results to return | ||
""" | ||
|
||
r: Document | ||
r: t.Union[t.Dict, Document] |
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 makes it easier to pass data to vector-search.
'type_id': item.type_id, | ||
'identifier': item.identifier, | ||
'version': getattr(item, 'version', None), | ||
def _serialize(item: t.Any, serialize_variables: bool = True): |
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 function was not flexible enough and was overly complicated for what it did.
This should make it easier to understand.
return self.deserialize(r) # rebuild new class instance | ||
|
||
def dict(self) -> t.Dict[str, t.Any]: | ||
return asdict(self) | ||
|
||
|
||
class Variable: |
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 class allows queries to be included in a model,
and "crystallized" at runtime.
d241c25
to
3ca2402
Compare
Merging so that we can push ahead with this one. If comments/ feedback are relevant we can fix after the fact. |
Description
This PR adds additional parameters to
.predict
to allow single outputs to be saved back into the database.In addition, this adds a few new
_Predictor
descendants which allow users to implement search and easier model chaining.Related Issues
Checklist
make test
successfully?Additional Notes or Comments