quivr/backend/modules/analytics
Stan Girard 3400b8633f
feat(analytics): rely on sql rather that python loop for brains (#2437)
This pull request refactors the get_brains_usages method in the
Analytics class. The changes include improving code readability,
optimizing database queries, and fixing potential bugs.

<!--
ELLIPSIS_HIDDEN
-->


----

| <a href="https://ellipsis.dev" target="_blank"><img
src="https://avatars.githubusercontent.com/u/80834858?s=400&u=31e596315b0d8f7465b3ee670f25cea677299c96&v=4"
alt="Ellipsis" width="30px" height="30px"/></a> | 🚀 This PR
description was created by [Ellipsis](https://www.ellipsis.dev) for
commit f0ad664673. |
|--------|--------|

### Summary:
This PR optimizes the `get_brains_usages` method in the `Analytics`
class by reducing database calls and improving code readability.

**Key points**:
- Refactored `get_brains_usages` method in `Analytics` class.
- Optimized database query to fetch chat history in one go.
- Improved code readability and formatting.


----
Generated with ❤️ by [ellipsis.dev](https://www.ellipsis.dev)



<!--
ELLIPSIS_HIDDEN
-->
2024-04-17 07:24:03 -07:00
..
controller feat(analytics): added analytics page (#2416) 2024-04-10 02:20:21 -07:00
entity feat(analytics): added analytics page (#2416) 2024-04-10 02:20:21 -07:00
repository feat(analytics): rely on sql rather that python loop for brains (#2437) 2024-04-17 07:24:03 -07:00
service feat(analytics): added analytics page (#2416) 2024-04-10 02:20:21 -07:00
__init__.py feat(analytics): added analytics page (#2416) 2024-04-10 02:20:21 -07:00