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
Add Support for Querying Agents via SQL #8856
Conversation
@@ -63,6 +67,52 @@ def predict(self, model_name: str, data, version=None, params=None): | |||
ml_handler = self.integration_controller.get_ml_handler(model_metadata['engine_name']) | |||
return ml_handler.predict(model_name, data, project_name=self.project.name, version=version, params=params) | |||
|
|||
def _query_agent(self, query: ast.ASTNode, existing_agent: db.Agents, session): |
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 move this function to agent controller? it is about how agent works
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.
I would prefer to keep it here since there are a good amount of SQL operations. IMO would be best to keep filtering SQL targets, filtering conditions, etc out of agents_controller
. Open to more discussion if you feel strongly though
Also I think for better design this function (or the whole class) should be moved to agent controller:
|
100% agree that we should have a more central location for agent completions such as |
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.
Nice work 🚀, LGTM
* agent behaves as model * flake8 * don't add one more line to response
Description
Related to #8821
This PR adds support for querying agents using MindsDB SQL. Example:
Type of change
Verification Process
To ensure the changes are working as expected:
./tests/interfaces/agents/test_agents_controller.py
Additional Media:
Checklist: