/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 340b625c04fe */ import * as z from "zod/v3"; import { ClosedEnum } from "../../types/enums.js"; import { FeedbackChatExchange, FeedbackChatExchange$Outbound, FeedbackChatExchange$outboundSchema, } from "./feedbackchatexchange.js"; /** * The source associated with the Feedback.event.MANUAL_FEEDBACK event. */ export const ManualFeedbackInfoSource = { Autocomplete: "AUTOCOMPLETE", Calendar: "CALENDAR", Chat: "CHAT", ChatGeneral: "CHAT_GENERAL", ConceptCard: "CONCEPT_CARD", DesktopApp: "DESKTOP_APP", DisambiguationCard: "DISAMBIGUATION_CARD", ExpertDetection: "EXPERT_DETECTION", Feed: "FEED", GeneratedQAndA: "GENERATED_Q_AND_A", InlineMenu: "INLINE_MENU", NativeResult: "NATIVE_RESULT", Prism: "PRISM", QAndA: "Q_AND_A", RelatedQuestions: "RELATED_QUESTIONS", ReportIssue: "REPORT_ISSUE", Sciobot: "SCIOBOT", Search: "SEARCH", Sidebar: "SIDEBAR", Summary: "SUMMARY", Tasks: "TASKS", TaskExecution: "TASK_EXECUTION", } as const; /** * The source associated with the Feedback.event.MANUAL_FEEDBACK event. */ export type ManualFeedbackInfoSource = ClosedEnum< typeof ManualFeedbackInfoSource >; export const Issue = { AgentCanvasFailed: "AGENT_CANVAS_FAILED", AgentClarifyingQuestions: "AGENT_CLARIFYING_QUESTIONS", AgentIntermediateStepsFailed: "AGENT_INTERMEDIATE_STEPS_FAILED", AgentToolCallFailed: "AGENT_TOOL_CALL_FAILED", InaccurateResponse: "INACCURATE_RESPONSE", IncompleteOrNoAnswer: "INCOMPLETE_OR_NO_ANSWER", IncorrectCitation: "INCORRECT_CITATION", MissingCitation: "MISSING_CITATION", Other: "OTHER", OutdatedResponse: "OUTDATED_RESPONSE", ResultMissing: "RESULT_MISSING", ResultShouldNotAppear: "RESULT_SHOULD_NOT_APPEAR", ResultsHelpful: "RESULTS_HELPFUL", ResultsPoorOrder: "RESULTS_POOR_ORDER", TooMuchOneKind: "TOO_MUCH_ONE_KIND", } as const; export type Issue = ClosedEnum; /** * The vote associated with the Feedback.event.MANUAL_FEEDBACK event. */ export const ManualFeedbackInfoVote = { Upvote: "UPVOTE", Downvote: "DOWNVOTE", } as const; /** * The vote associated with the Feedback.event.MANUAL_FEEDBACK event. */ export type ManualFeedbackInfoVote = ClosedEnum; export type ManualFeedbackInfo = { /** * The email address of the user who submitted the Feedback.event.MANUAL_FEEDBACK event. * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ email?: string | undefined; /** * The source associated with the Feedback.event.MANUAL_FEEDBACK event. */ source?: ManualFeedbackInfoSource | undefined; /** * The issue the user indicated in the feedback. * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ issue?: string | undefined; /** * The issue(s) the user indicated in the feedback. */ issues?: Array | undefined; /** * URLs of images uploaded by user when providing feedback */ imageUrls?: Array | undefined; /** * The query associated with the Feedback.event.MANUAL_FEEDBACK event. */ query?: string | undefined; /** * The query associated with the Feedback.event.MANUAL_FEEDBACK event, but obscured such that the vowels are replaced with special characters. For search feedback events only. */ obscuredQuery?: string | undefined; /** * Which tabs the user had chosen at the time of the Feedback.event.MANUAL_FEEDBACK event. For search feedback events only. */ activeTab?: string | undefined; /** * The comments users can optionally add to the Feedback.event.MANUAL_FEEDBACK events. */ comments?: string | undefined; /** * The array of search result Glean Document IDs, ordered by top to bottom result. */ searchResults?: Array | undefined; /** * The array of previous messages in a chat session, ordered by oldest to newest. */ previousMessages?: Array | undefined; /** * Array of previous request/response exchanges, ordered by oldest to newest. */ chatTranscript?: Array | undefined; /** * How many times this query has been run in the past. */ numQueriesFromFirstRun?: number | undefined; /** * The vote associated with the Feedback.event.MANUAL_FEEDBACK event. */ vote?: ManualFeedbackInfoVote | undefined; /** * A rating associated with the user feedback. The value will be between one and the maximum given by ratingScale, inclusive. */ rating?: number | undefined; /** * A description of the rating that contextualizes how it appeared to the user, e.g. "satisfied". */ ratingKey?: string | undefined; /** * The scale of comparison for a rating associated with the feedback. Rating values start from one and go up to the maximum specified by ratingScale. For example, a five-option satisfaction rating will have a ratingScale of 5 and a thumbs-up/thumbs-down rating will have a ratingScale of 2. */ ratingScale?: number | undefined; }; /** @internal */ export const ManualFeedbackInfoSource$outboundSchema: z.ZodNativeEnum< typeof ManualFeedbackInfoSource > = z.nativeEnum(ManualFeedbackInfoSource); /** @internal */ export const Issue$outboundSchema: z.ZodNativeEnum = z.nativeEnum( Issue, ); /** @internal */ export const ManualFeedbackInfoVote$outboundSchema: z.ZodNativeEnum< typeof ManualFeedbackInfoVote > = z.nativeEnum(ManualFeedbackInfoVote); /** @internal */ export type ManualFeedbackInfo$Outbound = { email?: string | undefined; source?: string | undefined; issue?: string | undefined; issues?: Array | undefined; imageUrls?: Array | undefined; query?: string | undefined; obscuredQuery?: string | undefined; activeTab?: string | undefined; comments?: string | undefined; searchResults?: Array | undefined; previousMessages?: Array | undefined; chatTranscript?: Array | undefined; numQueriesFromFirstRun?: number | undefined; vote?: string | undefined; rating?: number | undefined; ratingKey?: string | undefined; ratingScale?: number | undefined; }; /** @internal */ export const ManualFeedbackInfo$outboundSchema: z.ZodType< ManualFeedbackInfo$Outbound, z.ZodTypeDef, ManualFeedbackInfo > = z.object({ email: z.string().optional(), source: ManualFeedbackInfoSource$outboundSchema.optional(), issue: z.string().optional(), issues: z.array(Issue$outboundSchema).optional(), imageUrls: z.array(z.string()).optional(), query: z.string().optional(), obscuredQuery: z.string().optional(), activeTab: z.string().optional(), comments: z.string().optional(), searchResults: z.array(z.string()).optional(), previousMessages: z.array(z.string()).optional(), chatTranscript: z.array(FeedbackChatExchange$outboundSchema).optional(), numQueriesFromFirstRun: z.number().int().optional(), vote: ManualFeedbackInfoVote$outboundSchema.optional(), rating: z.number().int().optional(), ratingKey: z.string().optional(), ratingScale: z.number().int().optional(), }); export function manualFeedbackInfoToJSON( manualFeedbackInfo: ManualFeedbackInfo, ): string { return JSON.stringify( ManualFeedbackInfo$outboundSchema.parse(manualFeedbackInfo), ); }