Skip to main content
Freeplay lets you log customer feedback, client events, and any other customer experience-related metadata associated with any LLM completion. This can be useful to tie feedback from your application back to Freeplay creating a feedback loop, whether for explicit signals like a feedback score, or implicit signals like a request to regenerate a completion or edits to a draft. Customer Feedback supports arbitrary key-value pairs and accepts any string, boolean, integer or float. There is one special key-value pair to consider: The key freeplay_feedback is a special case to capture your primary positive/negative user feedback signals from customers. It accepts only the following string values:
  • positive will render a 👍 in the UI
  • negative will render as a 👎 in the UI

Methods Overview

Method NameParametersDescription
updatecompletion_id: string feedback: dictLog feedback associated with a specified completion

Log Customer Feedback

# create a session which will create a UID
session = fpClient.sessions.create()

# record the results
payload = RecordPayload(
    project_id=project_id,
    all_messages=all_messages,
    inputs=prompt_vars,
    session_info=session,
    prompt_version_info=prompt_info,
    call_info=CallInfo.from_prompt_info(prompt_info, start_time=s, end_time=e),
    response_info=ResponseInfo(
        is_complete=chat_response.choices[0].finish_reason == 'stop'
    )
)
# this will create the completion id needed for the logging of customer feedback
completion_info = fpClient.recordings.create(payload)

# add some customer feedback
fpClient.customer_feedback.update(
    completion_id=completion_info.completion_id,
    feedback={'freeplay_feedback': 'positive',
              'link_clicked': True}
)