crowd.dev
crowd.dev copied to clipboard
New sentiment
Changes proposed ✍️
What
🤖 Generated by Copilot at a1f7fb9
This pull request introduces HuggingFace as a new sentiment analysis provider for the crowd.dev platform. It adds a feature flag NEW_SENTIMENT
to toggle between the old and new providers. It also adds the axios
library as a dependency for the sentiment
module, which uses it to make requests to the HuggingFace service. It updates the configuration files, environment variables, and types to include the HuggingFace API key. It also modifies the tooltip component in the frontend to display the sentiment label instead of the score.
🤖 Generated by Copilot at a1f7fb9
Oh we're the crew of the data sink And we work with sentiment We've got a new provider to try It's called
HuggingFace
we bet
Why
How
🤖 Generated by Copilot at a1f7fb9
- Add
CROWD_HUGGINGFACE_API_KEY
environment variable to configure the API key for the HuggingFace service, a new external provider for sentiment analysis (link, link, link) - Add
axios
dependency to the sentiment library to make HTTP requests to the HuggingFace service (link, link, link, link, link, link, link, link, link, link, link, link, link, link, link) - Add
isNewSentimentEnabled
parameter to thegetSentiment
function in the sentiment module and the data sink worker service to implement a feature flag mechanism that allows switching between the old and the new sentiment analysis providers (link, link, link, link) - Add
NEW_SENTIMENT
enum value to theFeatureFlag
enum to represent the feature flag for the new sentiment analysis provider (link) - Add
huggingfaceApiKey
property to theISentimentClientConfig
interface to store the API key for the HuggingFace service in the configuration object for the sentiment module (link) - Modify the
content
attribute of the tooltip component in thefrontend/src/modules/activity/components/activity-sentiment.vue
file to display the sentiment label instead of the score (link) - Add
tenantId
parameter to themergeActivityData
function in the data sink worker service to pass the tenant identifier, which will be used to check the feature flag for the new sentiment analysis provider (link, link)
Checklist ✅
- [ ] Label appropriately with
Feature
,Improvement
, orBug
. - [ ] Add screenshots to the PR description for relevant FE changes
- [ ] New backend functionality has been unit-tested.
- [ ] API documentation has been updated (if necessary) (see docs on API documentation).
- [ ] Quality standards are met.