cohere-toolkit
cohere-toolkit copied to clipboard
agents: track indexing tasks
This PR introduces a new feature for agent task management and makes changes to the backend and frontend of the application.
Summary of Changes
- Backend:
- Added a new table,
agent_tasks, to store agent tasks. - Introduced new functions,
create_agent_taskandget_agent_tasks_by_agent_id, for creating and retrieving agent tasks. - Modified the
handle_google_drive_syncfunction to include an additionalagent_idparameter. - Updated the functions
create,delete,edit,move,rename,restore, andpermission_changeto include anagent_idparameter and added error handling. - Added a new
MinimalBaseclass to thesrc/backend/database_models/base.pymodule. - Created a new
AgentTaskResponsemodel to represent agent task responses. - Modified the
Agentmodel to include a newagent_tasksattribute.
- Added a new table,
- Frontend:
- Added new components and hooks for displaying agent tasks, including a new page,
src/interfaces/assistants_web/src/app/tasks/[agentId]/page.tsx, for viewing tasks and a right-panel link,src/interfaces/assistants_web/src/components/Agents/RightPanel.tsx, for accessing task dashboards. - Updated the
AgentTaskResponsemodel to include additional properties. - Introduced a new
useAgentTaskshook for fetching agent tasks.
- Added new components and hooks for displaying agent tasks, including a new page,
Codecov Report
Attention: Patch coverage is 50.70423% with 105 lines in your changes missing coverage. Please review.
Project coverage is 75.23%. Comparing base (
95d5639) to head (a8cfea6).
Additional details and impacted files
@@ Coverage Diff @@
## main #676 +/- ##
==========================================
- Coverage 75.50% 75.23% -0.28%
==========================================
Files 263 265 +2
Lines 11728 11862 +134
==========================================
+ Hits 8855 8924 +69
- Misses 2873 2938 +65
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Do we have a video of the UI changes and how they look? Just curious.
Also this current db design around AgentTask basically provides us with the lowest sync unit for an agent which is its file syncs. Have thoughts about how we should track general "agent syncs"? It would probably be a grouping of AgentTasks in a time period that we surface right? In that case how do we answer the question of "when was the agents last synced". Maybe that is not a question we care about answering and we care more about the files directly. Just thinking
@giannis2two demo here https://cohereai.slack.com/archives/C075ZG5MX7Y/p1723842119080759
good points, i want to merge this PR first as it is just a foundational first draft. not actually a user feature quite yet. we can revisit the details of pagination and grouping of tasks after.