LanguageModelFeedback
Feedback appropriate for logging or attaching to Feedback Assistant.
Declaration
struct LanguageModelFeedbackMentioned in
Overview
LanguageModelFeedback is a namespace with structures for describing feedback in a consistent way. LanguageModelFeedback.Sentiment describes the sentiment of the feedback, while LanguageModelFeedback.Issue offers a standard template for issues.
Given a model session, use logFeedbackAttachment(sentiment:issues:desiredOutput:) to produce structured feedback.
let session = LanguageModelSession()
let response = try await session.respond(to: "What is the capital of France?")
// Create feedback for a problematic response.
let feedbackData = session.logFeedbackAttachment(
sentiment: LanguageModelFeedback.Sentiment.negative,
issues: [
LanguageModelFeedback.Issue(
category: .incorrect,
explanation: "The model provided outdated information"
)
],
desiredOutput: Transcript.Entry.response(...)
)