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

export type ClientOptions = {
  baseUrl: `${string}://${string}/console/api` | (string & {})
}

export type InstalledAppListResponse = {
  installed_apps: Array<InstalledAppResponse>
}

export type ChatMessagePayload = {
  conversation_id?: string | null
  files?: Array<unknown> | null
  inputs: {
    [key: string]: unknown
  }
  model_config: {
    [key: string]: unknown
  }
  parent_message_id?: string | null
  query: string
  response_mode?: 'blocking' | 'streaming'
  retriever_from?: string
}

export type CompletionMessageExplorePayload = {
  files?: Array<{
    [key: string]: unknown
  }> | null
  inputs: {
    [key: string]: unknown
  }
  query?: string
  response_mode?: 'blocking' | 'streaming' | null
  retriever_from?: string
}

export type ConversationRenamePayload = {
  auto_generate?: boolean
  name?: string | null
}

export type MessageFeedbackPayload = {
  content?: string | null
  message_id: string
  rating?: 'like' | 'dislike' | null
}

export type SavedMessageCreatePayload = {
  message_id: string
}

export type TextToAudioPayload = {
  message_id?: string | null
  streaming?: boolean | null
  text?: string | null
  voice?: string | null
}

export type WorkflowRunPayload = {
  files?: Array<{
    [key: string]: unknown
  }> | null
  inputs: {
    [key: string]: unknown
  }
}

export type InstalledAppResponse = {
  app: InstalledAppInfoResponse
  app_owner_tenant_id: string
  editable: boolean
  id: string
  is_pinned: boolean
  last_used_at?: number | null
  uninstallable: boolean
}

export type InstalledAppInfoResponse = {
  icon?: string | null
  icon_background?: string | null
  icon_type?: string | null
  id: string
  mode?: string | null
  name?: string | null
  use_icon_as_answer_icon?: boolean | null
}

export type GetInstalledAppsData = {
  body?: never
  path?: never
  query?: never
  url: '/installed-apps'
}

export type GetInstalledAppsResponses = {
  200: InstalledAppListResponse
}

export type GetInstalledAppsResponse = GetInstalledAppsResponses[keyof GetInstalledAppsResponses]

export type PostInstalledAppsData = {
  body?: never
  path?: never
  query?: never
  url: '/installed-apps'
}

export type PostInstalledAppsResponses = {
  200: {
    [key: string]: unknown
  }
}

export type PostInstalledAppsResponse = PostInstalledAppsResponses[keyof PostInstalledAppsResponses]

export type DeleteInstalledAppsByInstalledAppIdData = {
  body?: never
  path: {
    installed_app_id: string
  }
  query?: never
  url: '/installed-apps/{installed_app_id}'
}

export type DeleteInstalledAppsByInstalledAppIdResponses = {
  200: {
    [key: string]: unknown
  }
}

export type DeleteInstalledAppsByInstalledAppIdResponse
  = DeleteInstalledAppsByInstalledAppIdResponses[keyof DeleteInstalledAppsByInstalledAppIdResponses]

export type PatchInstalledAppsByInstalledAppIdData = {
  body?: never
  path: {
    installed_app_id: string
  }
  query?: never
  url: '/installed-apps/{installed_app_id}'
}

export type PatchInstalledAppsByInstalledAppIdResponses = {
  200: {
    [key: string]: unknown
  }
}

export type PatchInstalledAppsByInstalledAppIdResponse
  = PatchInstalledAppsByInstalledAppIdResponses[keyof PatchInstalledAppsByInstalledAppIdResponses]

export type PostInstalledAppsByInstalledAppIdAudioToTextData = {
  body?: never
  path: {
    installed_app_id: string
  }
  query?: never
  url: '/installed-apps/{installed_app_id}/audio-to-text'
}

export type PostInstalledAppsByInstalledAppIdAudioToTextResponses = {
  200: {
    [key: string]: unknown
  }
}

export type PostInstalledAppsByInstalledAppIdAudioToTextResponse
  = PostInstalledAppsByInstalledAppIdAudioToTextResponses[keyof PostInstalledAppsByInstalledAppIdAudioToTextResponses]

export type PostInstalledAppsByInstalledAppIdChatMessagesData = {
  body: ChatMessagePayload
  path: {
    installed_app_id: string
  }
  query?: never
  url: '/installed-apps/{installed_app_id}/chat-messages'
}

export type PostInstalledAppsByInstalledAppIdChatMessagesResponses = {
  200: {
    [key: string]: unknown
  }
}

export type PostInstalledAppsByInstalledAppIdChatMessagesResponse
  = PostInstalledAppsByInstalledAppIdChatMessagesResponses[keyof PostInstalledAppsByInstalledAppIdChatMessagesResponses]

export type PostInstalledAppsByInstalledAppIdChatMessagesByTaskIdStopData = {
  body?: never
  path: {
    installed_app_id: string
    task_id: string
  }
  query?: never
  url: '/installed-apps/{installed_app_id}/chat-messages/{task_id}/stop'
}

export type PostInstalledAppsByInstalledAppIdChatMessagesByTaskIdStopResponses = {
  200: {
    [key: string]: unknown
  }
}

export type PostInstalledAppsByInstalledAppIdChatMessagesByTaskIdStopResponse
  = PostInstalledAppsByInstalledAppIdChatMessagesByTaskIdStopResponses[keyof PostInstalledAppsByInstalledAppIdChatMessagesByTaskIdStopResponses]

export type PostInstalledAppsByInstalledAppIdCompletionMessagesData = {
  body: CompletionMessageExplorePayload
  path: {
    installed_app_id: string
  }
  query?: never
  url: '/installed-apps/{installed_app_id}/completion-messages'
}

export type PostInstalledAppsByInstalledAppIdCompletionMessagesResponses = {
  200: {
    [key: string]: unknown
  }
}

export type PostInstalledAppsByInstalledAppIdCompletionMessagesResponse
  = PostInstalledAppsByInstalledAppIdCompletionMessagesResponses[keyof PostInstalledAppsByInstalledAppIdCompletionMessagesResponses]

export type PostInstalledAppsByInstalledAppIdCompletionMessagesByTaskIdStopData = {
  body?: never
  path: {
    installed_app_id: string
    task_id: string
  }
  query?: never
  url: '/installed-apps/{installed_app_id}/completion-messages/{task_id}/stop'
}

export type PostInstalledAppsByInstalledAppIdCompletionMessagesByTaskIdStopResponses = {
  200: {
    [key: string]: unknown
  }
}

export type PostInstalledAppsByInstalledAppIdCompletionMessagesByTaskIdStopResponse
  = PostInstalledAppsByInstalledAppIdCompletionMessagesByTaskIdStopResponses[keyof PostInstalledAppsByInstalledAppIdCompletionMessagesByTaskIdStopResponses]

export type GetInstalledAppsByInstalledAppIdConversationsData = {
  body?: never
  path: {
    installed_app_id: string
  }
  query?: {
    last_id?: string | null
    limit?: number
    pinned?: boolean | null
  }
  url: '/installed-apps/{installed_app_id}/conversations'
}

export type GetInstalledAppsByInstalledAppIdConversationsResponses = {
  200: {
    [key: string]: unknown
  }
}

export type GetInstalledAppsByInstalledAppIdConversationsResponse
  = GetInstalledAppsByInstalledAppIdConversationsResponses[keyof GetInstalledAppsByInstalledAppIdConversationsResponses]

export type DeleteInstalledAppsByInstalledAppIdConversationsByCIdData = {
  body?: never
  path: {
    installed_app_id: string
    c_id: string
  }
  query?: never
  url: '/installed-apps/{installed_app_id}/conversations/{c_id}'
}

export type DeleteInstalledAppsByInstalledAppIdConversationsByCIdResponses = {
  200: {
    [key: string]: unknown
  }
}

export type DeleteInstalledAppsByInstalledAppIdConversationsByCIdResponse
  = DeleteInstalledAppsByInstalledAppIdConversationsByCIdResponses[keyof DeleteInstalledAppsByInstalledAppIdConversationsByCIdResponses]

export type PostInstalledAppsByInstalledAppIdConversationsByCIdNameData = {
  body: ConversationRenamePayload
  path: {
    installed_app_id: string
    c_id: string
  }
  query?: never
  url: '/installed-apps/{installed_app_id}/conversations/{c_id}/name'
}

export type PostInstalledAppsByInstalledAppIdConversationsByCIdNameResponses = {
  200: {
    [key: string]: unknown
  }
}

export type PostInstalledAppsByInstalledAppIdConversationsByCIdNameResponse
  = PostInstalledAppsByInstalledAppIdConversationsByCIdNameResponses[keyof PostInstalledAppsByInstalledAppIdConversationsByCIdNameResponses]

export type PatchInstalledAppsByInstalledAppIdConversationsByCIdPinData = {
  body?: never
  path: {
    installed_app_id: string
    c_id: string
  }
  query?: never
  url: '/installed-apps/{installed_app_id}/conversations/{c_id}/pin'
}

export type PatchInstalledAppsByInstalledAppIdConversationsByCIdPinResponses = {
  200: {
    [key: string]: unknown
  }
}

export type PatchInstalledAppsByInstalledAppIdConversationsByCIdPinResponse
  = PatchInstalledAppsByInstalledAppIdConversationsByCIdPinResponses[keyof PatchInstalledAppsByInstalledAppIdConversationsByCIdPinResponses]

export type PatchInstalledAppsByInstalledAppIdConversationsByCIdUnpinData = {
  body?: never
  path: {
    installed_app_id: string
    c_id: string
  }
  query?: never
  url: '/installed-apps/{installed_app_id}/conversations/{c_id}/unpin'
}

export type PatchInstalledAppsByInstalledAppIdConversationsByCIdUnpinResponses = {
  200: {
    [key: string]: unknown
  }
}

export type PatchInstalledAppsByInstalledAppIdConversationsByCIdUnpinResponse
  = PatchInstalledAppsByInstalledAppIdConversationsByCIdUnpinResponses[keyof PatchInstalledAppsByInstalledAppIdConversationsByCIdUnpinResponses]

export type GetInstalledAppsByInstalledAppIdMessagesData = {
  body?: never
  path: {
    installed_app_id: string
  }
  query: {
    conversation_id: string
    first_id?: string | null
    limit?: number
  }
  url: '/installed-apps/{installed_app_id}/messages'
}

export type GetInstalledAppsByInstalledAppIdMessagesResponses = {
  200: {
    [key: string]: unknown
  }
}

export type GetInstalledAppsByInstalledAppIdMessagesResponse
  = GetInstalledAppsByInstalledAppIdMessagesResponses[keyof GetInstalledAppsByInstalledAppIdMessagesResponses]

export type PostInstalledAppsByInstalledAppIdMessagesByMessageIdFeedbacksData = {
  body: MessageFeedbackPayload
  path: {
    installed_app_id: string
    message_id: string
  }
  query?: never
  url: '/installed-apps/{installed_app_id}/messages/{message_id}/feedbacks'
}

export type PostInstalledAppsByInstalledAppIdMessagesByMessageIdFeedbacksResponses = {
  200: {
    [key: string]: unknown
  }
}

export type PostInstalledAppsByInstalledAppIdMessagesByMessageIdFeedbacksResponse
  = PostInstalledAppsByInstalledAppIdMessagesByMessageIdFeedbacksResponses[keyof PostInstalledAppsByInstalledAppIdMessagesByMessageIdFeedbacksResponses]

export type GetInstalledAppsByInstalledAppIdMessagesByMessageIdMoreLikeThisData = {
  body?: never
  path: {
    installed_app_id: string
    message_id: string
  }
  query: {
    response_mode: 'blocking' | 'streaming'
  }
  url: '/installed-apps/{installed_app_id}/messages/{message_id}/more-like-this'
}

export type GetInstalledAppsByInstalledAppIdMessagesByMessageIdMoreLikeThisResponses = {
  200: {
    [key: string]: unknown
  }
}

export type GetInstalledAppsByInstalledAppIdMessagesByMessageIdMoreLikeThisResponse
  = GetInstalledAppsByInstalledAppIdMessagesByMessageIdMoreLikeThisResponses[keyof GetInstalledAppsByInstalledAppIdMessagesByMessageIdMoreLikeThisResponses]

export type GetInstalledAppsByInstalledAppIdMessagesByMessageIdSuggestedQuestionsData = {
  body?: never
  path: {
    installed_app_id: string
    message_id: string
  }
  query?: never
  url: '/installed-apps/{installed_app_id}/messages/{message_id}/suggested-questions'
}

export type GetInstalledAppsByInstalledAppIdMessagesByMessageIdSuggestedQuestionsResponses = {
  200: {
    [key: string]: unknown
  }
}

export type GetInstalledAppsByInstalledAppIdMessagesByMessageIdSuggestedQuestionsResponse
  = GetInstalledAppsByInstalledAppIdMessagesByMessageIdSuggestedQuestionsResponses[keyof GetInstalledAppsByInstalledAppIdMessagesByMessageIdSuggestedQuestionsResponses]

export type GetInstalledAppsByInstalledAppIdMetaData = {
  body?: never
  path: {
    installed_app_id: string
  }
  query?: never
  url: '/installed-apps/{installed_app_id}/meta'
}

export type GetInstalledAppsByInstalledAppIdMetaResponses = {
  200: {
    [key: string]: unknown
  }
}

export type GetInstalledAppsByInstalledAppIdMetaResponse
  = GetInstalledAppsByInstalledAppIdMetaResponses[keyof GetInstalledAppsByInstalledAppIdMetaResponses]

export type GetInstalledAppsByInstalledAppIdParametersData = {
  body?: never
  path: {
    installed_app_id: string
  }
  query?: never
  url: '/installed-apps/{installed_app_id}/parameters'
}

export type GetInstalledAppsByInstalledAppIdParametersResponses = {
  200: {
    [key: string]: unknown
  }
}

export type GetInstalledAppsByInstalledAppIdParametersResponse
  = GetInstalledAppsByInstalledAppIdParametersResponses[keyof GetInstalledAppsByInstalledAppIdParametersResponses]

export type GetInstalledAppsByInstalledAppIdSavedMessagesData = {
  body?: never
  path: {
    installed_app_id: string
  }
  query?: {
    last_id?: string | null
    limit?: number
  }
  url: '/installed-apps/{installed_app_id}/saved-messages'
}

export type GetInstalledAppsByInstalledAppIdSavedMessagesResponses = {
  200: {
    [key: string]: unknown
  }
}

export type GetInstalledAppsByInstalledAppIdSavedMessagesResponse
  = GetInstalledAppsByInstalledAppIdSavedMessagesResponses[keyof GetInstalledAppsByInstalledAppIdSavedMessagesResponses]

export type PostInstalledAppsByInstalledAppIdSavedMessagesData = {
  body: SavedMessageCreatePayload
  path: {
    installed_app_id: string
  }
  query?: never
  url: '/installed-apps/{installed_app_id}/saved-messages'
}

export type PostInstalledAppsByInstalledAppIdSavedMessagesResponses = {
  200: {
    [key: string]: unknown
  }
}

export type PostInstalledAppsByInstalledAppIdSavedMessagesResponse
  = PostInstalledAppsByInstalledAppIdSavedMessagesResponses[keyof PostInstalledAppsByInstalledAppIdSavedMessagesResponses]

export type DeleteInstalledAppsByInstalledAppIdSavedMessagesByMessageIdData = {
  body?: never
  path: {
    installed_app_id: string
    message_id: string
  }
  query?: never
  url: '/installed-apps/{installed_app_id}/saved-messages/{message_id}'
}

export type DeleteInstalledAppsByInstalledAppIdSavedMessagesByMessageIdResponses = {
  200: {
    [key: string]: unknown
  }
}

export type DeleteInstalledAppsByInstalledAppIdSavedMessagesByMessageIdResponse
  = DeleteInstalledAppsByInstalledAppIdSavedMessagesByMessageIdResponses[keyof DeleteInstalledAppsByInstalledAppIdSavedMessagesByMessageIdResponses]

export type PostInstalledAppsByInstalledAppIdTextToAudioData = {
  body: TextToAudioPayload
  path: {
    installed_app_id: string
  }
  query?: never
  url: '/installed-apps/{installed_app_id}/text-to-audio'
}

export type PostInstalledAppsByInstalledAppIdTextToAudioResponses = {
  200: {
    [key: string]: unknown
  }
}

export type PostInstalledAppsByInstalledAppIdTextToAudioResponse
  = PostInstalledAppsByInstalledAppIdTextToAudioResponses[keyof PostInstalledAppsByInstalledAppIdTextToAudioResponses]

export type PostInstalledAppsByInstalledAppIdWorkflowsRunData = {
  body: WorkflowRunPayload
  path: {
    installed_app_id: string
  }
  query?: never
  url: '/installed-apps/{installed_app_id}/workflows/run'
}

export type PostInstalledAppsByInstalledAppIdWorkflowsRunResponses = {
  200: {
    [key: string]: unknown
  }
}

export type PostInstalledAppsByInstalledAppIdWorkflowsRunResponse
  = PostInstalledAppsByInstalledAppIdWorkflowsRunResponses[keyof PostInstalledAppsByInstalledAppIdWorkflowsRunResponses]

export type PostInstalledAppsByInstalledAppIdWorkflowsTasksByTaskIdStopData = {
  body?: never
  path: {
    installed_app_id: string
    task_id: string
  }
  query?: never
  url: '/installed-apps/{installed_app_id}/workflows/tasks/{task_id}/stop'
}

export type PostInstalledAppsByInstalledAppIdWorkflowsTasksByTaskIdStopResponses = {
  200: {
    [key: string]: unknown
  }
}

export type PostInstalledAppsByInstalledAppIdWorkflowsTasksByTaskIdStopResponse
  = PostInstalledAppsByInstalledAppIdWorkflowsTasksByTaskIdStopResponses[keyof PostInstalledAppsByInstalledAppIdWorkflowsTasksByTaskIdStopResponses]
