// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../core/resource'; import { APIPromise } from '../../core/api-promise'; import { buildHeaders } from '../../internal/headers'; import { RequestOptions } from '../../internal/request-options'; export class Feedback extends APIResource { /** * Add user feedback to a specific message for quality tracking and improvement. */ save(params: FeedbackSaveParams, options?: RequestOptions): APIPromise { const { 'Accept-Language': acceptLanguage, 'X-Error-Format': xErrorFormat, ...body } = params; return this._client.post('/message/feedback', { body, ...options, headers: buildHeaders([ { 'Content-Type': 'application/x-www-form-urlencoded', ...(acceptLanguage != null ? { 'Accept-Language': acceptLanguage } : undefined), ...(xErrorFormat != null ? { 'X-Error-Format': xErrorFormat } : undefined), }, options?.headers, ]), }); } } export type FeedbackSaveResponse = unknown; export interface FeedbackSaveParams { /** * Body param */ conversation_id: string; /** * Body param */ message_id: string; /** * Body param */ feedback?: string | null; /** * Body param */ is_send_conversation?: boolean; /** * Body param */ user_id?: string | null; /** * Header param */ 'Accept-Language'?: string; /** * Header param: Set to `structured` to receive errors in the structured envelope. * Omit it to keep the legacy error body. */ 'X-Error-Format'?: string; } export declare namespace Feedback { export { type FeedbackSaveResponse as FeedbackSaveResponse, type FeedbackSaveParams as FeedbackSaveParams }; }