ai_workflows / workflows /utils /feedback.py
theRealNG's picture
workflows(course_learn): Return run_id
0413dd6
raw
history blame
504 Bytes
from pydantic import BaseModel, UUID4
from typing import List, Optional
from langsmith import Client
class Feedback(BaseModel):
metric_type: Optional[str]
metric_score: Optional[float]
feedback_on: Optional[str]
def post_feedback(run_id: UUID4, feedback: Feedback):
client = Client()
client.create_feedback(
str(run_id),
key=feedback.metric_type,
score=feedback.metric_score,
source_info={"content": feedback.feedback_on},
type="api",
)