useFeedback
useFeedback(options: UseFeedbackOptions): UseFeedbackResult
The useFeedback()
hook makes it easy to attach feedback to a message.
Basic example
Hook API
UseFeedbackOptions
Prop | Type | Description |
---|---|---|
feedbackOptions | Omit<SubmitFeedbackOptions, 'signal'> | Enable and configure feedback functionality |
projectKey | string | Markprompt project key |
apiUrl | string | The base API URL |
UseFeedbackResult
Prop | Type | Description |
---|---|---|
abort | () => void | Abort any pending feedback submission |
submitFeedback | (feedback: PromptFeedback, messageId?: string) => void | Submit feedback for the current message |
submitThreadCSAT | (threadId: string, csat: CSAT) => void | Submit CSAT for a thread |
submitThreadCSATReason | (threadId: string, reason: string) => void | Submit CSAT reason for a thread |