Spaces:
Runtime error
Runtime error
| 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", | |
| ) | |