-
Notifications
You must be signed in to change notification settings - Fork 904
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
refactor(agents-api): Add decorator to wrap cozo queries inside and execute #273
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…xecute Signed-off-by: Diwank Singh Tomer <[email protected]>
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.
👍 Looks good to me!
- Reviewed the entire pull request up to 86414f9
- Looked at
1729
lines of code in39
files - Took 4 minutes and 59 seconds to review
More info
- Skipped
0
files when reviewing. - Skipped posting
17
additional comments because they didn't meet confidence threshold of50%
.
1. agents-api/agents_api/models/utils.py:9
:
- Assessed confidence :
0%
- Comment:
Good use of a decorator to handle query execution and reduce code duplication. - Reasoning:
The decoratorcozo_query
is used to wrap functions that return a tuple of a query string and a dictionary of variables. The decorator executes the query using thecozo_client
and returns a DataFrame. This is a good practice as it reduces code duplication and makes the code cleaner.
2. agents-api/agents_api/models/agent/create_agent.py:8
:
- Assessed confidence :
0%
- Comment:
The function now returns a tuple of a query string and a dictionary of variables, which is consistent with the use of thecozo_query
decorator for query execution. - Reasoning:
The functioncreate_agent_query
increate_agent.py
has been refactored to return a tuple of a query string and a dictionary of variables instead of executing the query and returning a DataFrame. This is consistent with the changes made throughout the codebase to use thecozo_query
decorator for query execution.
3. agents-api/agents_api/models/agent/delete_agent.py:8
:
- Assessed confidence :
0%
- Comment:
The function now returns a tuple of a query string and a dictionary of variables, which is consistent with the use of thecozo_query
decorator for query execution. - Reasoning:
The functiondelete_agent_query
indelete_agent.py
has been refactored to return a tuple of a query string and a dictionary of variables instead of executing the query and returning a DataFrame. This is consistent with the changes made throughout the codebase to use thecozo_query
decorator for query execution.
4. agents-api/agents_api/models/agent/get_agent.py:8
:
- Assessed confidence :
0%
- Comment:
The function now returns a tuple of a query string and a dictionary of variables, which is consistent with the use of thecozo_query
decorator for query execution. - Reasoning:
The functionget_agent_query
inget_agent.py
has been refactored to return a tuple of a query string and a dictionary of variables instead of executing the query and returning a DataFrame. This is consistent with the changes made throughout the codebase to use thecozo_query
decorator for query execution.
5. agents-api/agents_api/models/agent/list_agents.py:6
:
- Assessed confidence :
0%
- Comment:
The function now returns a tuple of a query string and a dictionary of variables, which is consistent with the use of thecozo_query
decorator for query execution. - Reasoning:
The functionlist_agents_query
inlist_agents.py
has been refactored to return a tuple of a query string and a dictionary of variables instead of executing the query and returning a DataFrame. This is consistent with the changes made throughout the codebase to use thecozo_query
decorator for query execution.
6. agents-api/agents_api/models/agent/patch_agent.py:7
:
- Assessed confidence :
0%
- Comment:
The function now returns a tuple of a query string and a dictionary of variables, which is consistent with the use of thecozo_query
decorator for query execution. - Reasoning:
The functionpatch_agent_query
inpatch_agent.py
has been refactored to return a tuple of a query string and a dictionary of variables instead of executing the query and returning a DataFrame. This is consistent with the changes made throughout the codebase to use thecozo_query
decorator for query execution.
7. agents-api/agents_api/models/agent/update_tool.py:4
:
- Assessed confidence :
0%
- Comment:
The function now returns a tuple of a query string and a dictionary of variables, which is consistent with the use of thecozo_query
decorator for query execution. - Reasoning:
The functionupdate_tool_by_id_query
inupdate_tool.py
has been refactored to return a tuple of a query string and a dictionary of variables instead of executing the query and returning a DataFrame. This is consistent with the changes made throughout the codebase to use thecozo_query
decorator for query execution.
8. agents-api/agents_api/models/docs/create_docs.py:8
:
- Assessed confidence :
0%
- Comment:
The function now returns a tuple of a query string and a dictionary of variables, which is consistent with the use of thecozo_query
decorator for query execution. - Reasoning:
The functioncreate_docs_query
increate_docs.py
has been refactored to return a tuple of a query string and a dictionary of variables instead of executing the query and returning a DataFrame. This is consistent with the changes made throughout the codebase to use thecozo_query
decorator for query execution.
9. agents-api/agents_api/models/docs/delete_docs.py:5
:
- Assessed confidence :
0%
- Comment:
The function now returns a tuple of a query string and a dictionary of variables, which is consistent with the use of thecozo_query
decorator for query execution. - Reasoning:
The functiondelete_docs_by_id_query
indelete_docs.py
has been refactored to return a tuple of a query string and a dictionary of variables instead of executing the query and returning a DataFrame. This is consistent with the changes made throughout the codebase to use thecozo_query
decorator for query execution.
10. agents-api/agents_api/models/docs/embed_docs.py:8
:
- Assessed confidence :
0%
- Comment:
The function now returns a tuple of a query string and a dictionary of variables, which is consistent with the use of thecozo_query
decorator for query execution. - Reasoning:
The functionembed_docs_snippets_query
inembed_docs.py
has been refactored to return a tuple of a query string and a dictionary of variables instead of executing the query and returning a DataFrame. This is consistent with the changes made throughout the codebase to use thecozo_query
decorator for query execution.
11. agents-api/agents_api/models/docs/get_docs.py:8
:
- Assessed confidence :
0%
- Comment:
The function now returns a tuple of a query string and a dictionary of variables, which is consistent with the use of thecozo_query
decorator for query execution. - Reasoning:
The functionget_docs_snippets_by_id_query
inget_docs.py
has been refactored to return a tuple of a query string and a dictionary of variables instead of executing the query and returning a DataFrame. This is consistent with the changes made throughout the codebase to use thecozo_query
decorator for query execution.
12. agents-api/agents_api/models/docs/list_docs.py:5
:
- Assessed confidence :
0%
- Comment:
The function now returns a tuple of a query string and a dictionary of variables, which is consistent with the use of thecozo_query
decorator for query execution. - Reasoning:
The functionensure_owner_exists_query
inlist_docs.py
has been refactored to return a tuple of a query string and a dictionary of variables instead of executing the query and returning a DataFrame. This is consistent with the changes made throughout the codebase to use thecozo_query
decorator for query execution.
13. agents-api/agents_api/models/docs/search_docs.py:8
:
- Assessed confidence :
0%
- Comment:
The function now returns a tuple of a query string and a dictionary of variables, which is consistent with the use of thecozo_query
decorator for query execution. - Reasoning:
The functionsearch_docs_snippets_by_embedding_query
insearch_docs.py
has been refactored to return a tuple of a query string and a dictionary of variables instead of executing the query and returning a DataFrame. This is consistent with the changes made throughout the codebase to use thecozo_query
decorator for query execution.
14. agents-api/agents_api/models/entry/delete_entries.py:5
:
- Assessed confidence :
0%
- Comment:
The function now returns a tuple of a query string and a dictionary of variables, which is consistent with the use of thecozo_query
decorator for query execution. - Reasoning:
The functiondelete_entries_query
indelete_entries.py
has been refactored to return a tuple of a query string and a dictionary of variables instead of executing the query and returning a DataFrame. This is consistent with the changes made throughout the codebase to use thecozo_query
decorator for query execution.
15. agents-api/agents_api/models/entry/entries_summarization.py:8
:
- Assessed confidence :
0%
- Comment:
The function now returns a tuple of a query string and a dictionary of variables, which is consistent with the use of thecozo_query
decorator for query execution. - Reasoning:
The functionentries_summarization_query
inentries_summarization.py
has been refactored to return a tuple of a query string and a dictionary of variables instead of executing the query and returning a DataFrame. This is consistent with the changes made throughout the codebase to use thecozo_query
decorator for query execution.
16. agents-api/agents_api/models/entry/proc_mem_context.py:8
:
- Assessed confidence :
0%
- Comment:
The function now returns a tuple of a query string and a dictionary of variables, which is consistent with the use of thecozo_query
decorator for query execution. - Reasoning:
The functionproc_mem_context_query
inproc_mem_context.py
has been refactored to return a tuple of a query string and a dictionary of variables instead of executing the query and returning a DataFrame. This is consistent with the changes made throughout the codebase to use thecozo_query
decorator for query execution.
17. agents-api/agents_api/models/session/create_session.py:12
:
- Assessed confidence :
0%
- Comment:
The function now returns a tuple of a query string and a dictionary of variables, which is consistent with the use of thecozo_query
decorator for query execution. - Reasoning:
The functioncreate_session_query
increate_session.py
has been refactored to return a tuple of a query string and a dictionary of variables instead of executing the query and returning a DataFrame. This is consistent with the changes made throughout the codebase to use thecozo_query
decorator for query execution.
Workflow ID: wflow_CvXjbS9LaqzIzeEK
Not what you expected? You can customize the content of the reviews using rules. Learn more here.
This was referenced Apr 26, 2024
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary:
This PR introduces a decorator to simplify database query execution in the
agents_api/models
directory, and includes various updates to the TypeScript and Python SDKs, fixes, and documentation improvements.Key points:
cozo_query
decorator inagents_api/models/utils.py
to wrap functions returning a query and variables, executing the query and returning a DataFrame.cozo_query
decorator to various functions acrossagents_api/models
, simplifying code by removing repeated query execution logic.Generated with ❤️ by ellipsis.dev