from parea.schemas import FeedbackRequest
from parea import Parea, get_current_trace_id, trace
p = Parea(api_key="PAREA_API_KEY")
@trace
def argument_chain(messages: list[dict]) -> tuple[str, str]:
# get_current_trace_id will return the trace_id of the most recent trace
trace_id = get_current_trace_id()
return call_llm(messages), trace_id
result, trace_id = argument_chain([{"role": "user", "content": "Hello"}])
p.record_feedback(
FeedbackRequest(
trace_id=trace_id,
# insert your user score here, score must be float
score=USER_SCORE,
# Optionally, you can also provide a ground truth or
# target answer. This could also be from your user.
target="ground_truth",
)
)