chore: ruff ruff
This commit is contained in:
parent
4a5d5f70d0
commit
f5d8fc6e81
4 changed files with 13 additions and 15 deletions
|
|
@ -73,14 +73,11 @@ class UserQAFeedback(BaseFeedback):
|
||||||
)
|
)
|
||||||
to_node_ids.append(str(target_id_2))
|
to_node_ids.append(str(target_id_2))
|
||||||
|
|
||||||
|
|
||||||
if len(relationships) > 0:
|
if len(relationships) > 0:
|
||||||
graph_engine = await get_graph_engine()
|
graph_engine = await get_graph_engine()
|
||||||
await graph_engine.add_edges(relationships)
|
await graph_engine.add_edges(relationships)
|
||||||
await graph_engine.apply_feedback_weight(
|
await graph_engine.apply_feedback_weight(
|
||||||
node_ids=to_node_ids,
|
node_ids=to_node_ids, weight=feedback_sentiment.score
|
||||||
weight=feedback_sentiment.score
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
return [feedback_text]
|
return [feedback_text]
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ from cognee.modules.engine.models.node_set import NodeSet
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
from pydantic import BaseModel, Field, confloat
|
from pydantic import BaseModel, Field, confloat
|
||||||
|
|
||||||
|
|
||||||
class CogneeUserInteraction(DataPoint):
|
class CogneeUserInteraction(DataPoint):
|
||||||
"""User - Cognee interaction"""
|
"""User - Cognee interaction"""
|
||||||
|
|
||||||
|
|
@ -32,8 +33,8 @@ class UserFeedbackSentiment(str, Enum):
|
||||||
|
|
||||||
class UserFeedbackEvaluation(BaseModel):
|
class UserFeedbackEvaluation(BaseModel):
|
||||||
"""User - User feedback evaluation"""
|
"""User - User feedback evaluation"""
|
||||||
|
|
||||||
score: confloat(ge=-5, le=5) = Field(
|
score: confloat(ge=-5, le=5) = Field(
|
||||||
...,
|
..., description="Sentiment score from -5 (negative) to +5 (positive)"
|
||||||
description="Sentiment score from -5 (negative) to +5 (positive)"
|
|
||||||
)
|
)
|
||||||
evaluation: UserFeedbackSentiment
|
evaluation: UserFeedbackSentiment
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue