export type SuggestionFeedbackRequestDto = {rating?: (string | null) | undefined}; export type CreateApiV1ChatRoomsRoomIdSuggestionsSuggestionIdFeedbackArgs = {roomId: number, suggestionId: number, body: SuggestionFeedbackRequestDto}; export type CreateApiV1ChatRoomsRoomIdSuggestionsSuggestionIdFeedbackOptions = {baseUrl: string, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Queue the current agent's approval (👍) or disapproval (👎) of one AI suggestion. * `rating` is `up` | `down` | `none` (none withdraws). One vote per * agent per suggestion — re-voting overwrites. Returns the raw object, NOT wrapped in * `ApiResponse`, mirroring the sibling suggestion endpoints. * * POST /v1/chat/rooms/{roomId}/suggestions/{suggestionId}/feedback * * Also accepts auth: API Key */ export const createApiV1ChatRoomsRoomIdSuggestionsSuggestionIdFeedback = async (args: CreateApiV1ChatRoomsRoomIdSuggestionsSuggestionIdFeedbackArgs, options: CreateApiV1ChatRoomsRoomIdSuggestionsSuggestionIdFeedbackOptions) => { const {baseUrl, fetch: fetchFn = fetch, Bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (Bearer !== undefined) headers.set('authorization', `Bearer ${Bearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/chat/rooms/${encodeURIComponent(String(args.roomId))}/suggestions/${encodeURIComponent(String(args.suggestionId))}/feedback${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };