Skip to content

Commit

Permalink
Merge pull request #74 from OZ-Coding-School/feature/init-project
Browse files Browse the repository at this point in the history
Fix: adjust indifference weight
  • Loading branch information
Scanf-s authored Aug 1, 2024
2 parents fd4e092 + aabf00e commit 5883ab6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion api/ett_backend/dialog/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ class AIMessageView(ListCreateAPIView):
serializer_class = AIMessageSerializer
permission_classes = [IsAuthenticated]

INDIFFERENCE_WEIGHT = 0.6

def create(self, request, *args, **kwargs):
logger.info("POST /api/message/ai/<uuid:chat_room_uuid>")
chat_room_uuid = kwargs.get("chat_room_uuid")
Expand Down Expand Up @@ -105,7 +107,8 @@ def create(self, request, *args, **kwargs):
"anger": structured_response["sentiments"].get("anger", 0.0),
"sadness": structured_response["sentiments"].get("sadness", 0.0),
"worry": structured_response["sentiments"].get("worry", 0.0),
"indifference": structured_response["sentiments"].get("indifference", 0.0),
"indifference":
round(structured_response["sentiments"].get("indifference", 0.0) * self.INDIFFERENCE_WEIGHT, 1),
},
)

Expand Down

0 comments on commit 5883ab6

Please sign in to comment.