Spaces:
Runtime error
Runtime error
workflows(feedback): modified the data type for original_content & modified_content
Browse files
app/lib/supabase_client.py
CHANGED
|
@@ -11,13 +11,16 @@ class SupabaseClient:
|
|
| 11 |
key = os.environ.get("SUPABASE_KEY")
|
| 12 |
self.client = create_client(url, key)
|
| 13 |
|
| 14 |
-
def post_feedback(self, run_id: UUID4, metric_type: str, metric_score: float,
|
|
|
|
| 15 |
try:
|
| 16 |
response = self.client.table(FEEDBACK_TABLE_NAME).insert({
|
| 17 |
"run_id": str(run_id),
|
| 18 |
"sub_workflow": sub_workflow,
|
| 19 |
"metric_type": metric_type,
|
| 20 |
"metric_score": metric_score,
|
|
|
|
|
|
|
| 21 |
}).execute()
|
| 22 |
print("Response: ", response)
|
| 23 |
return response
|
|
|
|
| 11 |
key = os.environ.get("SUPABASE_KEY")
|
| 12 |
self.client = create_client(url, key)
|
| 13 |
|
| 14 |
+
def post_feedback(self, run_id: UUID4, metric_type: str, metric_score: float,
|
| 15 |
+
sub_workflow: str, original_content: dict, modified_content: dict):
|
| 16 |
try:
|
| 17 |
response = self.client.table(FEEDBACK_TABLE_NAME).insert({
|
| 18 |
"run_id": str(run_id),
|
| 19 |
"sub_workflow": sub_workflow,
|
| 20 |
"metric_type": metric_type,
|
| 21 |
"metric_score": metric_score,
|
| 22 |
+
"original_content": original_content,
|
| 23 |
+
"modified_content": modified_content
|
| 24 |
}).execute()
|
| 25 |
print("Response: ", response)
|
| 26 |
return response
|
app/workflows/utils/feedback.py
CHANGED
|
@@ -26,8 +26,8 @@ def post_feedback(run_id: UUID4, feedback: Feedback):
|
|
| 26 |
class NewFeedback(BaseModel):
|
| 27 |
metric_type: str
|
| 28 |
metric_score: float
|
| 29 |
-
original_content: Optional[
|
| 30 |
-
modified_content: Optional[
|
| 31 |
|
| 32 |
def post(self, inputs={}):
|
| 33 |
run_id = inputs["run_id"]
|
|
@@ -42,7 +42,9 @@ class NewFeedback(BaseModel):
|
|
| 42 |
run_id= run_id,
|
| 43 |
sub_workflow= sub_worfklow,
|
| 44 |
metric_score=self.metric_score,
|
| 45 |
-
metric_type=self.metric_type
|
|
|
|
|
|
|
| 46 |
)
|
| 47 |
return
|
| 48 |
|
|
|
|
| 26 |
class NewFeedback(BaseModel):
|
| 27 |
metric_type: str
|
| 28 |
metric_score: float
|
| 29 |
+
original_content: Optional[dict]
|
| 30 |
+
modified_content: Optional[dict]
|
| 31 |
|
| 32 |
def post(self, inputs={}):
|
| 33 |
run_id = inputs["run_id"]
|
|
|
|
| 42 |
run_id= run_id,
|
| 43 |
sub_workflow= sub_worfklow,
|
| 44 |
metric_score=self.metric_score,
|
| 45 |
+
metric_type=self.metric_type,
|
| 46 |
+
original_content=self.original_content,
|
| 47 |
+
modified_content=self.modified_content
|
| 48 |
)
|
| 49 |
return
|
| 50 |
|