// This file is auto-generated by @hey-api/openapi-ts

import * as z from 'zod'

/**
 * ChatMessagePayload
 */
export const zChatMessagePayload = z.object({
  conversation_id: z.string().nullish(),
  files: z.array(z.unknown()).nullish(),
  inputs: z.record(z.string(), z.unknown()),
  model_config: z.record(z.string(), z.unknown()),
  parent_message_id: z.string().nullish(),
  query: z.string(),
  response_mode: z.enum(['blocking', 'streaming']).optional().default('blocking'),
  retriever_from: z.string().optional().default('dev'),
})

/**
 * CompletionMessageExplorePayload
 */
export const zCompletionMessageExplorePayload = z.object({
  files: z.array(z.record(z.string(), z.unknown())).nullish(),
  inputs: z.record(z.string(), z.unknown()),
  query: z.string().optional().default(''),
  response_mode: z.enum(['blocking', 'streaming']).nullish(),
  retriever_from: z.string().optional().default('explore_app'),
})

/**
 * ConversationRenamePayload
 */
export const zConversationRenamePayload = z.object({
  auto_generate: z.boolean().optional().default(false),
  name: z.string().nullish(),
})

/**
 * MessageFeedbackPayload
 */
export const zMessageFeedbackPayload = z.object({
  content: z.string().nullish(),
  message_id: z.string(),
  rating: z.enum(['like', 'dislike']).nullish(),
})

/**
 * SavedMessageCreatePayload
 */
export const zSavedMessageCreatePayload = z.object({
  message_id: z.string(),
})

/**
 * TextToAudioPayload
 */
export const zTextToAudioPayload = z.object({
  message_id: z.string().nullish(),
  streaming: z.boolean().nullish(),
  text: z.string().nullish(),
  voice: z.string().nullish(),
})

/**
 * WorkflowRunPayload
 */
export const zWorkflowRunPayload = z.object({
  files: z.array(z.record(z.string(), z.unknown())).nullish(),
  inputs: z.record(z.string(), z.unknown()),
})

/**
 * InstalledAppInfoResponse
 */
export const zInstalledAppInfoResponse = z.object({
  icon: z.string().nullish(),
  icon_background: z.string().nullish(),
  icon_type: z.string().nullish(),
  id: z.string(),
  mode: z.string().nullish(),
  name: z.string().nullish(),
  use_icon_as_answer_icon: z.boolean().nullish(),
})

/**
 * InstalledAppResponse
 */
export const zInstalledAppResponse = z.object({
  app: zInstalledAppInfoResponse,
  app_owner_tenant_id: z.string(),
  editable: z.boolean(),
  id: z.string(),
  is_pinned: z.boolean(),
  last_used_at: z.int().nullish(),
  uninstallable: z.boolean(),
})

/**
 * InstalledAppListResponse
 */
export const zInstalledAppListResponse = z.object({
  installed_apps: z.array(zInstalledAppResponse),
})

/**
 * Success
 */
export const zGetInstalledAppsResponse = zInstalledAppListResponse

/**
 * Success
 */
export const zPostInstalledAppsResponse = z.record(z.string(), z.unknown())

export const zDeleteInstalledAppsByInstalledAppIdPath = z.object({
  installed_app_id: z.string(),
})

/**
 * Success
 */
export const zDeleteInstalledAppsByInstalledAppIdResponse = z.record(z.string(), z.unknown())

export const zPatchInstalledAppsByInstalledAppIdPath = z.object({
  installed_app_id: z.string(),
})

/**
 * Success
 */
export const zPatchInstalledAppsByInstalledAppIdResponse = z.record(z.string(), z.unknown())

export const zPostInstalledAppsByInstalledAppIdAudioToTextPath = z.object({
  installed_app_id: z.string(),
})

/**
 * Success
 */
export const zPostInstalledAppsByInstalledAppIdAudioToTextResponse = z.record(
  z.string(),
  z.unknown(),
)

export const zPostInstalledAppsByInstalledAppIdChatMessagesBody = zChatMessagePayload

export const zPostInstalledAppsByInstalledAppIdChatMessagesPath = z.object({
  installed_app_id: z.string(),
})

/**
 * Success
 */
export const zPostInstalledAppsByInstalledAppIdChatMessagesResponse = z.record(
  z.string(),
  z.unknown(),
)

export const zPostInstalledAppsByInstalledAppIdChatMessagesByTaskIdStopPath = z.object({
  installed_app_id: z.string(),
  task_id: z.string(),
})

/**
 * Success
 */
export const zPostInstalledAppsByInstalledAppIdChatMessagesByTaskIdStopResponse = z.record(
  z.string(),
  z.unknown(),
)

export const zPostInstalledAppsByInstalledAppIdCompletionMessagesBody
  = zCompletionMessageExplorePayload

export const zPostInstalledAppsByInstalledAppIdCompletionMessagesPath = z.object({
  installed_app_id: z.string(),
})

/**
 * Success
 */
export const zPostInstalledAppsByInstalledAppIdCompletionMessagesResponse = z.record(
  z.string(),
  z.unknown(),
)

export const zPostInstalledAppsByInstalledAppIdCompletionMessagesByTaskIdStopPath = z.object({
  installed_app_id: z.string(),
  task_id: z.string(),
})

/**
 * Success
 */
export const zPostInstalledAppsByInstalledAppIdCompletionMessagesByTaskIdStopResponse = z.record(
  z.string(),
  z.unknown(),
)

export const zGetInstalledAppsByInstalledAppIdConversationsPath = z.object({
  installed_app_id: z.string(),
})

export const zGetInstalledAppsByInstalledAppIdConversationsQuery = z.object({
  last_id: z.string().nullish(),
  limit: z.int().gte(1).lte(100).optional().default(20),
  pinned: z.boolean().nullish(),
})

/**
 * Success
 */
export const zGetInstalledAppsByInstalledAppIdConversationsResponse = z.record(
  z.string(),
  z.unknown(),
)

export const zDeleteInstalledAppsByInstalledAppIdConversationsByCIdPath = z.object({
  installed_app_id: z.string(),
  c_id: z.string(),
})

/**
 * Success
 */
export const zDeleteInstalledAppsByInstalledAppIdConversationsByCIdResponse = z.record(
  z.string(),
  z.unknown(),
)

export const zPostInstalledAppsByInstalledAppIdConversationsByCIdNameBody
  = zConversationRenamePayload

export const zPostInstalledAppsByInstalledAppIdConversationsByCIdNamePath = z.object({
  installed_app_id: z.string(),
  c_id: z.string(),
})

/**
 * Success
 */
export const zPostInstalledAppsByInstalledAppIdConversationsByCIdNameResponse = z.record(
  z.string(),
  z.unknown(),
)

export const zPatchInstalledAppsByInstalledAppIdConversationsByCIdPinPath = z.object({
  installed_app_id: z.string(),
  c_id: z.string(),
})

/**
 * Success
 */
export const zPatchInstalledAppsByInstalledAppIdConversationsByCIdPinResponse = z.record(
  z.string(),
  z.unknown(),
)

export const zPatchInstalledAppsByInstalledAppIdConversationsByCIdUnpinPath = z.object({
  installed_app_id: z.string(),
  c_id: z.string(),
})

/**
 * Success
 */
export const zPatchInstalledAppsByInstalledAppIdConversationsByCIdUnpinResponse = z.record(
  z.string(),
  z.unknown(),
)

export const zGetInstalledAppsByInstalledAppIdMessagesPath = z.object({
  installed_app_id: z.string(),
})

export const zGetInstalledAppsByInstalledAppIdMessagesQuery = z.object({
  conversation_id: z.string(),
  first_id: z.string().nullish(),
  limit: z.int().gte(1).lte(100).optional().default(20),
})

/**
 * Success
 */
export const zGetInstalledAppsByInstalledAppIdMessagesResponse = z.record(z.string(), z.unknown())

export const zPostInstalledAppsByInstalledAppIdMessagesByMessageIdFeedbacksBody
  = zMessageFeedbackPayload

export const zPostInstalledAppsByInstalledAppIdMessagesByMessageIdFeedbacksPath = z.object({
  installed_app_id: z.string(),
  message_id: z.string(),
})

/**
 * Success
 */
export const zPostInstalledAppsByInstalledAppIdMessagesByMessageIdFeedbacksResponse = z.record(
  z.string(),
  z.unknown(),
)

export const zGetInstalledAppsByInstalledAppIdMessagesByMessageIdMoreLikeThisPath = z.object({
  installed_app_id: z.string(),
  message_id: z.string(),
})

export const zGetInstalledAppsByInstalledAppIdMessagesByMessageIdMoreLikeThisQuery = z.object({
  response_mode: z.enum(['blocking', 'streaming']),
})

/**
 * Success
 */
export const zGetInstalledAppsByInstalledAppIdMessagesByMessageIdMoreLikeThisResponse = z.record(
  z.string(),
  z.unknown(),
)

export const zGetInstalledAppsByInstalledAppIdMessagesByMessageIdSuggestedQuestionsPath = z.object({
  installed_app_id: z.string(),
  message_id: z.string(),
})

/**
 * Success
 */
export const zGetInstalledAppsByInstalledAppIdMessagesByMessageIdSuggestedQuestionsResponse
  = z.record(z.string(), z.unknown())

export const zGetInstalledAppsByInstalledAppIdMetaPath = z.object({
  installed_app_id: z.string(),
})

/**
 * Success
 */
export const zGetInstalledAppsByInstalledAppIdMetaResponse = z.record(z.string(), z.unknown())

export const zGetInstalledAppsByInstalledAppIdParametersPath = z.object({
  installed_app_id: z.string(),
})

/**
 * Success
 */
export const zGetInstalledAppsByInstalledAppIdParametersResponse = z.record(z.string(), z.unknown())

export const zGetInstalledAppsByInstalledAppIdSavedMessagesPath = z.object({
  installed_app_id: z.string(),
})

export const zGetInstalledAppsByInstalledAppIdSavedMessagesQuery = z.object({
  last_id: z.string().nullish(),
  limit: z.int().gte(1).lte(100).optional().default(20),
})

/**
 * Success
 */
export const zGetInstalledAppsByInstalledAppIdSavedMessagesResponse = z.record(
  z.string(),
  z.unknown(),
)

export const zPostInstalledAppsByInstalledAppIdSavedMessagesBody = zSavedMessageCreatePayload

export const zPostInstalledAppsByInstalledAppIdSavedMessagesPath = z.object({
  installed_app_id: z.string(),
})

/**
 * Success
 */
export const zPostInstalledAppsByInstalledAppIdSavedMessagesResponse = z.record(
  z.string(),
  z.unknown(),
)

export const zDeleteInstalledAppsByInstalledAppIdSavedMessagesByMessageIdPath = z.object({
  installed_app_id: z.string(),
  message_id: z.string(),
})

/**
 * Success
 */
export const zDeleteInstalledAppsByInstalledAppIdSavedMessagesByMessageIdResponse = z.record(
  z.string(),
  z.unknown(),
)

export const zPostInstalledAppsByInstalledAppIdTextToAudioBody = zTextToAudioPayload

export const zPostInstalledAppsByInstalledAppIdTextToAudioPath = z.object({
  installed_app_id: z.string(),
})

/**
 * Success
 */
export const zPostInstalledAppsByInstalledAppIdTextToAudioResponse = z.record(
  z.string(),
  z.unknown(),
)

export const zPostInstalledAppsByInstalledAppIdWorkflowsRunBody = zWorkflowRunPayload

export const zPostInstalledAppsByInstalledAppIdWorkflowsRunPath = z.object({
  installed_app_id: z.string(),
})

/**
 * Success
 */
export const zPostInstalledAppsByInstalledAppIdWorkflowsRunResponse = z.record(
  z.string(),
  z.unknown(),
)

export const zPostInstalledAppsByInstalledAppIdWorkflowsTasksByTaskIdStopPath = z.object({
  installed_app_id: z.string(),
  task_id: z.string(),
})

/**
 * Success
 */
export const zPostInstalledAppsByInstalledAppIdWorkflowsTasksByTaskIdStopResponse = z.record(
  z.string(),
  z.unknown(),
)
