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

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

export type AccessModeResponse = {
  accessMode: string
}

export type AccessTokenData = {
  access_token: string
}

export type AccessTokenResultResponse = {
  data: AccessTokenData
  result: string
}

export type AgentThought = {
  answer?: string | null
  chain_id?: string | null
  created_at?: number | null
  files: Array<string>
  id: string
  message_id: string
  observation?: string | null
  position: number
  thought?: string | null
  tool?: string | null
  tool_input?: string | null
  tool_labels: JsonValue
}

export type AppAccessModeQuery = {
  appCode?: string | null
  appId?: string | null
}

export type AppMetaResponse = {
  tool_icons?: {
    [key: string]: unknown
  }
}

export type AppMode =
  | 'advanced-chat'
  | 'agent'
  | 'agent-chat'
  | 'channel'
  | 'chat'
  | 'completion'
  | 'rag-pipeline'
  | 'workflow'

export type AppPermissionQuery = {
  appId: string
}

export type AudioToTextResponse = {
  text: string
}

export type BooleanResultResponse = {
  result: boolean
}

export type BrandingModel = {
  application_title: string
  enabled: boolean
  favicon: string
  login_page_logo: string
  workspace_logo: string
}

export type ButtonStyle = 'accent' | 'default' | 'ghost' | 'primary'

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

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

export type ConversationInfiniteScrollPagination = {
  data: Array<SimpleConversation>
  has_more: boolean
  limit: number
}

export type ConversationListQuery = {
  last_id?: string | null
  limit?: number
  pinned?: boolean | null
  sort_by?: '-created_at' | '-updated_at' | 'created_at' | 'updated_at'
}

export type ConversationRenamePayload = (
  | {
      auto_generate: true
      name?: string | null
    }
  | {
      auto_generate?: false
      name: string
    }
) & {
  auto_generate?: boolean
  name?: string | null
}

export type DeploymentEdition = 'CLOUD' | 'COMMUNITY' | 'ENTERPRISE'

export type EmailCodeLoginSendPayload = {
  email: string
  language?: string | null
}

export type EmailCodeLoginVerifyPayload = {
  code: string
  email: string
  token: string
}

export type EventStreamResponse = string

export type ExecutionContentType = 'human_input'

export type FileInputConfig = {
  allowed_file_extensions?: Array<string>
  allowed_file_types?: Array<FileType>
  allowed_file_upload_methods?: Array<FileTransferMethod>
  output_variable_name: string
  type?: 'file'
}

export type FileListInputConfig = {
  allowed_file_extensions?: Array<string>
  allowed_file_types?: Array<FileType>
  allowed_file_upload_methods?: Array<FileTransferMethod>
  number_limits?: number
  output_variable_name: string
  type?: 'file-list'
}

export type FileResponse = {
  conversation_id?: string | null
  created_at?: number | null
  created_by?: string | null
  extension?: string | null
  file_key?: string | null
  id: string
  mime_type?: string | null
  name: string
  original_url?: string | null
  preview_url?: string | null
  reference?: string | null
  size: number
  source_url?: string | null
  tenant_id?: string | null
  user_id?: string | null
}

export type FileTransferMethod = 'datasource_file' | 'local_file' | 'remote_url' | 'tool_file'

export type FileType = 'audio' | 'custom' | 'document' | 'image' | 'video'

export type FileWithSignedUrl = {
  created_at: number | null
  created_by: string | null
  extension: string | null
  id: string
  mime_type: string | null
  name: string
  size: number
  url: string | null
}

export type ForgotPasswordCheckPayload = {
  code: string
  email: string
  token: string
}

export type ForgotPasswordResetPayload = {
  new_password: string
  password_confirm: string
  token: string
}

export type ForgotPasswordSendPayload = {
  email: string
  language?: string | null
}

export type FormInputConfig =
  | ({
      type: 'paragraph'
    } & ParagraphInputConfig)
  | ({
      type: 'select'
    } & SelectInputConfig)
  | ({
      type: 'file'
    } & FileInputConfig)
  | ({
      type: 'file-list'
    } & FileListInputConfig)

export type GeneratedAppResponse = JsonValue

export type HumanInputContent = {
  form_definition?: HumanInputFormDefinition | null
  form_submission_data?: HumanInputFormSubmissionData | null
  submitted: boolean
  type?: ExecutionContentType
  workflow_run_id: string
}

export type HumanInputFileUploadFormPayload = {
  url?: string | null
}

export type HumanInputFormDefinition = {
  actions?: Array<UserActionConfig>
  display_in_ui?: boolean
  expiration_time: number
  form_content: string
  form_id: string
  form_token?: string | null
  inputs?: Array<FormInputConfig>
  node_id: string
  node_title: string
  resolved_default_values?: {
    [key: string]: unknown
  }
}

export type HumanInputFormDefinitionResponse = {
  expiration_time: number
  form_content: string
  inputs: Array<FormInputConfig>
  resolved_default_values: {
    [key: string]: string
  }
  site?: WebAppSiteResponse | null
  user_actions: Array<UserActionConfig>
}

export type HumanInputFormSubmissionData = {
  action_id: string
  action_text: string
  node_id: string
  node_title: string
  rendered_content: string
  submitted_data?: {
    [key: string]: JsonValue2
  } | null
}

export type HumanInputFormSubmitPayload = {
  action: string
  inputs: {
    [key: string]: JsonValue2
  }
}

export type HumanInputFormSubmitResponse = {
  [key: string]: unknown
}

export type HumanInputUploadTokenResponse = {
  expires_at: number
  upload_token: string
}

export type JsonObject = {
  [key: string]: unknown
}

export type JsonValue =
  | string
  | number
  | number
  | boolean
  | {
      [key: string]: unknown
    }
  | Array<unknown>
  | null

export type JsonValueType = unknown

export type JsonValue2 = unknown

export type LicenseStatus = 'active' | 'expired' | 'expiring' | 'inactive' | 'lost' | 'none'

export type LicenseStatusModel = {
  status: LicenseStatus
}

export type LoginPayload = {
  email: string
  password: string
}

export type LoginStatusQuery = {
  app_code?: string | null
  user_id?: string | null
}

export type LoginStatusResponse = {
  app_logged_in: boolean
  logged_in: boolean
}

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

export type MessageFile = {
  belongs_to?: string | null
  filename: string
  id: string
  mime_type?: string | null
  size?: number | null
  transfer_method: string
  type: string
  upload_file_id?: string | null
  url?: string | null
}

export type MessageListQuery = {
  conversation_id: string
  first_id?: string | null
  limit?: number
}

export type MessageMoreLikeThisQuery = {
  response_mode: 'blocking' | 'streaming'
}

export type ParagraphInputConfig = {
  default?: StringSource | null
  output_variable_name: string
  type?: 'paragraph'
}

export type Parameters = {
  annotation_reply: JsonObject
  file_upload: JsonObject
  more_like_this: JsonObject
  opening_statement?: string | null
  retriever_resource: JsonObject
  sensitive_word_avoidance: JsonObject
  speech_to_text: JsonObject
  suggested_questions: Array<string>
  suggested_questions_after_answer: JsonObject
  system_parameters: SystemParameters
  text_to_speech: JsonObject
  user_input_form: Array<JsonObject>
}

export type PassportAccessTokenResponse = {
  access_token: string
}

export type PassportQuery = {
  user_id?: string | null
}

export type PluginInstallationPermissionModel = {
  plugin_installation_scope: PluginInstallationScope
  restrict_to_marketplace_only: boolean
}

export type PluginInstallationScope =
  | 'all'
  | 'none'
  | 'official_and_specific_partners'
  | 'official_only'

export type RemoteFileInfo = {
  file_length: number
  file_type: string
}

export type RemoteFileUploadPayload = {
  url: string
}

export type ResultResponse = {
  result: string
}

export type RetrieverResource = {
  content?: string | null
  created_at?: number | null
  data_source_type?: string | null
  dataset_id?: string | null
  dataset_name?: string | null
  document_id?: string | null
  document_name?: string | null
  hit_count?: number | null
  id?: string
  index_node_hash?: string | null
  message_id?: string
  position: number
  score?: number | null
  segment_id?: string | null
  segment_position?: number | null
  summary?: string | null
  word_count?: number | null
}

export type SavedMessageCreatePayload = {
  message_id: string
}

export type SavedMessageInfiniteScrollPagination = {
  data: Array<SavedMessageItem>
  has_more: boolean
  limit: number
}

export type SavedMessageItem = {
  answer: string
  created_at?: number | null
  feedback?: SimpleFeedback | null
  id: string
  inputs: {
    [key: string]: JsonValueType
  }
  message_files: Array<MessageFile>
  query: string
}

export type SavedMessageListQuery = {
  last_id?: string | null
  limit?: number
}

export type SelectInputConfig = {
  option_source: StringListSource
  output_variable_name: string
  type?: 'select'
}

export type SimpleConversation = {
  created_at?: number | null
  id: string
  inputs: {
    [key: string]: JsonValue
  }
  introduction?: string | null
  name: string
  status: string
  updated_at?: number | null
}

export type SimpleFeedback = {
  rating?: string | null
}

export type SimpleResultDataResponse = {
  data: string
  result: string
}

export type SimpleResultResponse = {
  result: string
}

export type StringListSource = {
  selector?: Array<string>
  type: ValueSourceType
  value?: Array<string>
}

export type StringSource = {
  selector?: Array<string>
  type: ValueSourceType
  value?: string
}

export type SuggestedQuestionsResponse = {
  data: Array<string>
}

export type SystemFeatureModel = {
  branding: BrandingModel
  deployment_edition: DeploymentEdition
  enable_app_deploy: boolean
  enable_change_email: boolean
  enable_collaboration_mode: boolean
  enable_creators_platform: boolean
  enable_email_code_login: boolean
  enable_email_password_login: boolean
  enable_explore_banner: boolean
  enable_learn_app: boolean
  enable_marketplace: boolean
  enable_social_oauth_login: boolean
  enable_step_by_step_tour: boolean
  is_allow_register: boolean
  is_email_setup: boolean
  knowledge_fs_enabled: boolean
  license: LicenseStatusModel
  plugin_installation_permission: PluginInstallationPermissionModel
  rbac_enabled: boolean
  sso_enforced_for_signin: boolean
  sso_enforced_for_signin_protocol: string
  webapp_auth: WebAppAuthModel
}

export type SystemParameters = {
  audio_file_size_limit: number
  file_size_limit: number
  image_file_size_limit: number
  video_file_size_limit: number
  workflow_file_upload_limit: number
}

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

export type UserActionConfig = {
  button_style?: ButtonStyle
  id: string
  title: string
}

export type ValueSourceType = 'constant' | 'variable'

export type VerificationTokenResponse = {
  email: string
  is_valid: boolean
  token: string
}

export type WebAppAuthModel = {
  allow_email_code_login: boolean
  allow_email_password_login: boolean
  allow_public_access: boolean
  allow_sso: boolean
  enabled: boolean
  sso_config: WebAppAuthSsoModel
}

export type WebAppAuthSsoModel = {
  protocol: string
}

export type WebAppCustomConfigResponse = {
  remove_webapp_brand: boolean
  replace_webapp_logo?: string | null
}

export type WebAppSiteResponse = {
  app_id: string
  can_replace_logo: boolean
  custom_config?: WebAppCustomConfigResponse | null
  enable_site: boolean
  end_user_id?: string | null
  mode: AppMode
  model_config?: WebModelConfigResponse | null
  plan: string
  site: WebSiteResponse
}

export type WebMessageInfiniteScrollPagination = {
  data: Array<WebMessageListItem>
  has_more: boolean
  limit: number
}

export type WebMessageListItem = {
  agent_thoughts: Array<AgentThought>
  answer: string
  answer_tokens?: number
  conversation_id: string
  created_at?: number | null
  currency?: string | null
  error?: string | null
  extra_contents: Array<HumanInputContent>
  feedback?: SimpleFeedback | null
  id: string
  inputs: {
    [key: string]: JsonValueType
  }
  message_files: Array<MessageFile>
  message_tokens?: number
  metadata?: JsonValueType | null
  parent_message_id?: string | null
  provider_response_latency?: number
  query: string
  retriever_resources: Array<RetrieverResource>
  status: string
  total_price?: string | null
  readonly total_tokens: number
}

export type WebModelConfigResponse = {
  model?: unknown
  more_like_this?: unknown
  opening_statement?: string | null
  pre_prompt?: string | null
  suggested_questions?: unknown
  suggested_questions_after_answer?: unknown
  user_input_form?: unknown
}

export type WebSiteResponse = {
  chat_color_theme?: string | null
  chat_color_theme_inverted: boolean
  copyright?: string | null
  custom_disclaimer?: string | null
  default_language?: string | null
  description?: string | null
  icon?: string | null
  icon_background?: string | null
  icon_type?: string | null
  icon_url?: string | null
  input_placeholder?: string | null
  privacy_policy?: string | null
  prompt_public?: boolean | null
  show_workflow_steps?: boolean | null
  title: string
  use_icon_as_answer_icon?: boolean | null
}

export type WorkflowRunPayload = {
  files?: Array<{
    transfer_method: 'local_file' | 'remote_url'
    type: 'audio' | 'custom' | 'document' | 'image' | 'video'
    upload_file_id?: string
    url?: string
  }> | null
  inputs: {
    [key: string]: unknown
  }
}

export type GeneratedAppResponseWritable = JsonValue

export type HumanInputFormSubmitResponseWritable = {
  [key: string]: unknown
}

export type WebMessageInfiniteScrollPaginationWritable = {
  data: Array<WebMessageListItemWritable>
  has_more: boolean
  limit: number
}

export type WebMessageListItemWritable = {
  agent_thoughts: Array<AgentThought>
  answer: string
  answer_tokens?: number
  conversation_id: string
  created_at?: number | null
  currency?: string | null
  error?: string | null
  extra_contents: Array<HumanInputContent>
  feedback?: SimpleFeedback | null
  id: string
  inputs: {
    [key: string]: JsonValueType
  }
  message_files: Array<MessageFile>
  message_tokens?: number
  metadata?: JsonValueType | null
  parent_message_id?: string | null
  provider_response_latency?: number
  query: string
  retriever_resources: Array<RetrieverResource>
  status: string
  total_price?: string | null
}

export type PostAudioToTextData = {
  body?: never
  path?: never
  query?: never
  url: '/audio-to-text'
}

export type PostAudioToTextErrors = {
  400: unknown
  401: unknown
  403: unknown
  413: unknown
  415: unknown
  500: unknown
}

export type PostAudioToTextResponses = {
  200: AudioToTextResponse
}

export type PostAudioToTextResponse = PostAudioToTextResponses[keyof PostAudioToTextResponses]

export type PostChatMessagesData = {
  body: ChatMessagePayload
  path?: never
  query?: never
  url: '/chat-messages'
}

export type PostChatMessagesErrors = {
  400: unknown
  401: unknown
  403: unknown
  404: unknown
  500: unknown
}

export type PostChatMessagesResponses = {
  200: GeneratedAppResponse
}

export type PostChatMessagesResponse = PostChatMessagesResponses[keyof PostChatMessagesResponses]

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

export type PostChatMessagesByTaskIdStopErrors = {
  400: unknown
  401: unknown
  403: unknown
  404: unknown
  500: unknown
}

export type PostChatMessagesByTaskIdStopResponses = {
  200: SimpleResultResponse
}

export type PostChatMessagesByTaskIdStopResponse =
  PostChatMessagesByTaskIdStopResponses[keyof PostChatMessagesByTaskIdStopResponses]

export type PostCompletionMessagesData = {
  body: CompletionMessagePayload
  path?: never
  query?: never
  url: '/completion-messages'
}

export type PostCompletionMessagesErrors = {
  400: unknown
  401: unknown
  403: unknown
  404: unknown
  500: unknown
}

export type PostCompletionMessagesResponses = {
  200: GeneratedAppResponse
}

export type PostCompletionMessagesResponse =
  PostCompletionMessagesResponses[keyof PostCompletionMessagesResponses]

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

export type PostCompletionMessagesByTaskIdStopErrors = {
  400: unknown
  401: unknown
  403: unknown
  404: unknown
  500: unknown
}

export type PostCompletionMessagesByTaskIdStopResponses = {
  200: SimpleResultResponse
}

export type PostCompletionMessagesByTaskIdStopResponse =
  PostCompletionMessagesByTaskIdStopResponses[keyof PostCompletionMessagesByTaskIdStopResponses]

export type GetConversationsData = {
  body?: never
  path?: never
  query?: {
    last_id?: string
    limit?: number
    pinned?: boolean
    sort_by?: '-created_at' | '-updated_at' | 'created_at' | 'updated_at'
  }
  url: '/conversations'
}

export type GetConversationsErrors = {
  400: unknown
  401: unknown
  403: unknown
  404: unknown
  500: unknown
}

export type GetConversationsResponses = {
  200: ConversationInfiniteScrollPagination
}

export type GetConversationsResponse = GetConversationsResponses[keyof GetConversationsResponses]

export type DeleteConversationsByCIdData = {
  body?: never
  path: {
    c_id: string
  }
  query?: never
  url: '/conversations/{c_id}'
}

export type DeleteConversationsByCIdErrors = {
  400: unknown
  401: unknown
  403: unknown
  404: unknown
  500: unknown
}

export type DeleteConversationsByCIdResponses = {
  204: void
}

export type DeleteConversationsByCIdResponse =
  DeleteConversationsByCIdResponses[keyof DeleteConversationsByCIdResponses]

export type PostConversationsByCIdNameData = {
  body: ConversationRenamePayload
  path: {
    c_id: string
  }
  query?: {
    auto_generate?: boolean
    name?: string
  }
  url: '/conversations/{c_id}/name'
}

export type PostConversationsByCIdNameErrors = {
  400: unknown
  401: unknown
  403: unknown
  404: unknown
  500: unknown
}

export type PostConversationsByCIdNameResponses = {
  200: SimpleConversation
}

export type PostConversationsByCIdNameResponse =
  PostConversationsByCIdNameResponses[keyof PostConversationsByCIdNameResponses]

export type PatchConversationsByCIdPinData = {
  body?: never
  path: {
    c_id: string
  }
  query?: never
  url: '/conversations/{c_id}/pin'
}

export type PatchConversationsByCIdPinErrors = {
  400: unknown
  401: unknown
  403: unknown
  404: unknown
  500: unknown
}

export type PatchConversationsByCIdPinResponses = {
  200: ResultResponse
}

export type PatchConversationsByCIdPinResponse =
  PatchConversationsByCIdPinResponses[keyof PatchConversationsByCIdPinResponses]

export type PatchConversationsByCIdUnpinData = {
  body?: never
  path: {
    c_id: string
  }
  query?: never
  url: '/conversations/{c_id}/unpin'
}

export type PatchConversationsByCIdUnpinErrors = {
  400: unknown
  401: unknown
  403: unknown
  404: unknown
  500: unknown
}

export type PatchConversationsByCIdUnpinResponses = {
  200: ResultResponse
}

export type PatchConversationsByCIdUnpinResponse =
  PatchConversationsByCIdUnpinResponses[keyof PatchConversationsByCIdUnpinResponses]

export type PostEmailCodeLoginData = {
  body: EmailCodeLoginSendPayload
  path?: never
  query?: never
  url: '/email-code-login'
}

export type PostEmailCodeLoginErrors = {
  400: unknown
  404: unknown
}

export type PostEmailCodeLoginResponses = {
  200: SimpleResultDataResponse
}

export type PostEmailCodeLoginResponse =
  PostEmailCodeLoginResponses[keyof PostEmailCodeLoginResponses]

export type PostEmailCodeLoginValidityData = {
  body: EmailCodeLoginVerifyPayload
  path?: never
  query?: never
  url: '/email-code-login/validity'
}

export type PostEmailCodeLoginValidityErrors = {
  400: unknown
  401: unknown
  404: unknown
}

export type PostEmailCodeLoginValidityResponses = {
  200: AccessTokenResultResponse
}

export type PostEmailCodeLoginValidityResponse =
  PostEmailCodeLoginValidityResponses[keyof PostEmailCodeLoginValidityResponses]

export type PostFilesUploadData = {
  body?: never
  path?: never
  query?: never
  url: '/files/upload'
}

export type PostFilesUploadErrors = {
  400: unknown
  413: unknown
  415: unknown
}

export type PostFilesUploadResponses = {
  201: FileResponse
}

export type PostFilesUploadResponse = PostFilesUploadResponses[keyof PostFilesUploadResponses]

export type PostForgotPasswordData = {
  body: ForgotPasswordSendPayload
  path?: never
  query?: never
  url: '/forgot-password'
}

export type PostForgotPasswordErrors = {
  400: unknown
  404: unknown
  429: unknown
}

export type PostForgotPasswordResponses = {
  200: SimpleResultDataResponse
}

export type PostForgotPasswordResponse =
  PostForgotPasswordResponses[keyof PostForgotPasswordResponses]

export type PostForgotPasswordResetsData = {
  body: ForgotPasswordResetPayload
  path?: never
  query?: never
  url: '/forgot-password/resets'
}

export type PostForgotPasswordResetsErrors = {
  400: unknown
  401: unknown
  404: unknown
}

export type PostForgotPasswordResetsResponses = {
  200: SimpleResultResponse
}

export type PostForgotPasswordResetsResponse =
  PostForgotPasswordResetsResponses[keyof PostForgotPasswordResetsResponses]

export type PostForgotPasswordValidityData = {
  body: ForgotPasswordCheckPayload
  path?: never
  query?: never
  url: '/forgot-password/validity'
}

export type PostForgotPasswordValidityErrors = {
  400: unknown
  401: unknown
}

export type PostForgotPasswordValidityResponses = {
  200: VerificationTokenResponse
}

export type PostForgotPasswordValidityResponse =
  PostForgotPasswordValidityResponses[keyof PostForgotPasswordValidityResponses]

export type GetFormHumanInputByFormTokenData = {
  body?: never
  path: {
    form_token: string
  }
  query?: never
  url: '/form/human_input/{form_token}'
}

export type GetFormHumanInputByFormTokenErrors = {
  403: unknown
  404: unknown
  412: unknown
  429: unknown
}

export type GetFormHumanInputByFormTokenResponses = {
  200: HumanInputFormDefinitionResponse
}

export type GetFormHumanInputByFormTokenResponse =
  GetFormHumanInputByFormTokenResponses[keyof GetFormHumanInputByFormTokenResponses]

export type PostFormHumanInputByFormTokenData = {
  body: HumanInputFormSubmitPayload
  path: {
    form_token: string
  }
  query?: never
  url: '/form/human_input/{form_token}'
}

export type PostFormHumanInputByFormTokenErrors = {
  400: unknown
  404: unknown
  412: unknown
  429: unknown
}

export type PostFormHumanInputByFormTokenResponses = {
  200: HumanInputFormSubmitResponse
}

export type PostFormHumanInputByFormTokenResponse =
  PostFormHumanInputByFormTokenResponses[keyof PostFormHumanInputByFormTokenResponses]

export type PostFormHumanInputByFormTokenUploadTokenData = {
  body?: never
  path: {
    form_token: string
  }
  query?: never
  url: '/form/human_input/{form_token}/upload-token'
}

export type PostFormHumanInputByFormTokenUploadTokenErrors = {
  404: unknown
  412: unknown
  429: unknown
}

export type PostFormHumanInputByFormTokenUploadTokenResponses = {
  200: HumanInputUploadTokenResponse
}

export type PostFormHumanInputByFormTokenUploadTokenResponse =
  PostFormHumanInputByFormTokenUploadTokenResponses[keyof PostFormHumanInputByFormTokenUploadTokenResponses]

export type PostHumanInputFormsFilesData = {
  body?: never
  path?: never
  query?: never
  url: '/human-input-forms/files'
}

export type PostHumanInputFormsFilesResponses = {
  201: FileResponse
}

export type PostHumanInputFormsFilesResponse =
  PostHumanInputFormsFilesResponses[keyof PostHumanInputFormsFilesResponses]

export type PostLoginData = {
  body: LoginPayload
  path?: never
  query?: never
  url: '/login'
}

export type PostLoginErrors = {
  400: unknown
  401: unknown
  403: unknown
  404: unknown
}

export type PostLoginResponses = {
  200: AccessTokenResultResponse
}

export type PostLoginResponse = PostLoginResponses[keyof PostLoginResponses]

export type GetLoginStatusData = {
  body?: never
  path?: never
  query?: {
    app_code?: string
    user_id?: string
  }
  url: '/login/status'
}

export type GetLoginStatusErrors = {
  401: unknown
}

export type GetLoginStatusResponses = {
  200: LoginStatusResponse
}

export type GetLoginStatusResponse = GetLoginStatusResponses[keyof GetLoginStatusResponses]

export type PostLogoutData = {
  body?: never
  path?: never
  query?: never
  url: '/logout'
}

export type PostLogoutResponses = {
  200: SimpleResultResponse
}

export type PostLogoutResponse = PostLogoutResponses[keyof PostLogoutResponses]

export type GetMessagesData = {
  body?: never
  path?: never
  query: {
    conversation_id: string
    first_id?: string
    limit?: number
  }
  url: '/messages'
}

export type GetMessagesErrors = {
  400: unknown
  401: unknown
  403: unknown
  404: unknown
  500: unknown
}

export type GetMessagesResponses = {
  200: WebMessageInfiniteScrollPagination
}

export type GetMessagesResponse = GetMessagesResponses[keyof GetMessagesResponses]

export type PostMessagesByMessageIdFeedbacksData = {
  body: MessageFeedbackPayload
  path: {
    message_id: string
  }
  query?: {
    content?: string
    rating?: 'dislike' | 'like'
  }
  url: '/messages/{message_id}/feedbacks'
}

export type PostMessagesByMessageIdFeedbacksErrors = {
  400: unknown
  401: unknown
  403: unknown
  404: unknown
  500: unknown
}

export type PostMessagesByMessageIdFeedbacksResponses = {
  200: ResultResponse
}

export type PostMessagesByMessageIdFeedbacksResponse =
  PostMessagesByMessageIdFeedbacksResponses[keyof PostMessagesByMessageIdFeedbacksResponses]

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

export type GetMessagesByMessageIdMoreLikeThisErrors = {
  400: unknown
  401: unknown
  403: unknown
  404: unknown
  500: unknown
}

export type GetMessagesByMessageIdMoreLikeThisResponses = {
  200: GeneratedAppResponse
}

export type GetMessagesByMessageIdMoreLikeThisResponse =
  GetMessagesByMessageIdMoreLikeThisResponses[keyof GetMessagesByMessageIdMoreLikeThisResponses]

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

export type GetMessagesByMessageIdSuggestedQuestionsErrors = {
  400: unknown
  401: unknown
  403: unknown
  404: unknown
  500: unknown
}

export type GetMessagesByMessageIdSuggestedQuestionsResponses = {
  200: SuggestedQuestionsResponse
}

export type GetMessagesByMessageIdSuggestedQuestionsResponse =
  GetMessagesByMessageIdSuggestedQuestionsResponses[keyof GetMessagesByMessageIdSuggestedQuestionsResponses]

export type GetMetaData = {
  body?: never
  path?: never
  query?: never
  url: '/meta'
}

export type GetMetaErrors = {
  400: unknown
  401: unknown
  403: unknown
  404: unknown
  500: unknown
}

export type GetMetaResponses = {
  200: AppMetaResponse
}

export type GetMetaResponse = GetMetaResponses[keyof GetMetaResponses]

export type GetParametersData = {
  body?: never
  path?: never
  query?: never
  url: '/parameters'
}

export type GetParametersErrors = {
  400: unknown
  401: unknown
  403: unknown
  404: unknown
  500: unknown
}

export type GetParametersResponses = {
  200: Parameters
}

export type GetParametersResponse = GetParametersResponses[keyof GetParametersResponses]

export type GetPassportData = {
  body?: never
  path?: never
  query?: {
    user_id?: string
  }
  url: '/passport'
}

export type GetPassportErrors = {
  401: unknown
  404: unknown
}

export type GetPassportResponses = {
  200: PassportAccessTokenResponse
}

export type GetPassportResponse = GetPassportResponses[keyof GetPassportResponses]

export type PostRemoteFilesUploadData = {
  body: RemoteFileUploadPayload
  path?: never
  query?: never
  url: '/remote-files/upload'
}

export type PostRemoteFilesUploadErrors = {
  400: unknown
  413: unknown
  415: unknown
  500: unknown
}

export type PostRemoteFilesUploadResponses = {
  201: FileWithSignedUrl
}

export type PostRemoteFilesUploadResponse =
  PostRemoteFilesUploadResponses[keyof PostRemoteFilesUploadResponses]

export type GetRemoteFilesByUrlData = {
  body?: never
  path: {
    url: string
  }
  query?: never
  url: '/remote-files/{url}'
}

export type GetRemoteFilesByUrlErrors = {
  400: unknown
  404: unknown
  500: unknown
}

export type GetRemoteFilesByUrlResponses = {
  200: RemoteFileInfo
}

export type GetRemoteFilesByUrlResponse =
  GetRemoteFilesByUrlResponses[keyof GetRemoteFilesByUrlResponses]

export type GetSavedMessagesData = {
  body?: never
  path?: never
  query?: {
    last_id?: string
    limit?: number
  }
  url: '/saved-messages'
}

export type GetSavedMessagesErrors = {
  400: unknown
  401: unknown
  403: unknown
  404: unknown
  500: unknown
}

export type GetSavedMessagesResponses = {
  200: SavedMessageInfiniteScrollPagination
}

export type GetSavedMessagesResponse = GetSavedMessagesResponses[keyof GetSavedMessagesResponses]

export type PostSavedMessagesData = {
  body: SavedMessageCreatePayload
  path?: never
  query: {
    message_id: string
  }
  url: '/saved-messages'
}

export type PostSavedMessagesErrors = {
  400: unknown
  401: unknown
  403: unknown
  404: unknown
  500: unknown
}

export type PostSavedMessagesResponses = {
  200: ResultResponse
}

export type PostSavedMessagesResponse = PostSavedMessagesResponses[keyof PostSavedMessagesResponses]

export type DeleteSavedMessagesByMessageIdData = {
  body?: never
  path: {
    message_id: string
  }
  query?: never
  url: '/saved-messages/{message_id}'
}

export type DeleteSavedMessagesByMessageIdErrors = {
  400: unknown
  401: unknown
  403: unknown
  404: unknown
  500: unknown
}

export type DeleteSavedMessagesByMessageIdResponses = {
  204: void
}

export type DeleteSavedMessagesByMessageIdResponse =
  DeleteSavedMessagesByMessageIdResponses[keyof DeleteSavedMessagesByMessageIdResponses]

export type GetSiteData = {
  body?: never
  path?: never
  query?: never
  url: '/site'
}

export type GetSiteErrors = {
  400: unknown
  401: unknown
  403: unknown
  404: unknown
  500: unknown
}

export type GetSiteResponses = {
  200: WebAppSiteResponse
}

export type GetSiteResponse = GetSiteResponses[keyof GetSiteResponses]

export type GetSystemFeaturesData = {
  body?: never
  path?: never
  query?: never
  url: '/system-features'
}

export type GetSystemFeaturesErrors = {
  500: unknown
}

export type GetSystemFeaturesResponses = {
  200: SystemFeatureModel
}

export type GetSystemFeaturesResponse = GetSystemFeaturesResponses[keyof GetSystemFeaturesResponses]

export type PostTextToAudioData = {
  body: TextToAudioPayload
  path?: never
  query?: never
  url: '/text-to-audio'
}

export type PostTextToAudioErrors = {
  400: unknown
  401: unknown
  403: unknown
  500: unknown
}

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

export type PostTextToAudioResponse = PostTextToAudioResponses[keyof PostTextToAudioResponses]

export type GetWebappAccessModeData = {
  body?: never
  path?: never
  query?: {
    appCode?: string
    appId?: string
  }
  url: '/webapp/access-mode'
}

export type GetWebappAccessModeErrors = {
  400: unknown
  500: unknown
}

export type GetWebappAccessModeResponses = {
  200: AccessModeResponse
}

export type GetWebappAccessModeResponse =
  GetWebappAccessModeResponses[keyof GetWebappAccessModeResponses]

export type GetWebappPermissionData = {
  body?: never
  path?: never
  query: {
    appId: string
  }
  url: '/webapp/permission'
}

export type GetWebappPermissionErrors = {
  400: unknown
  401: unknown
  500: unknown
}

export type GetWebappPermissionResponses = {
  200: BooleanResultResponse
}

export type GetWebappPermissionResponse =
  GetWebappPermissionResponses[keyof GetWebappPermissionResponses]

export type GetWorkflowByTaskIdEventsData = {
  body?: never
  path: {
    task_id: string
  }
  query?: never
  url: '/workflow/{task_id}/events'
}

export type GetWorkflowByTaskIdEventsResponses = {
  200: EventStreamResponse
}

export type GetWorkflowByTaskIdEventsResponse =
  GetWorkflowByTaskIdEventsResponses[keyof GetWorkflowByTaskIdEventsResponses]

export type PostWorkflowsRunData = {
  body: WorkflowRunPayload
  path?: never
  query?: never
  url: '/workflows/run'
}

export type PostWorkflowsRunErrors = {
  400: unknown
  401: unknown
  403: unknown
  404: unknown
  500: unknown
}

export type PostWorkflowsRunResponses = {
  200: GeneratedAppResponse
}

export type PostWorkflowsRunResponse = PostWorkflowsRunResponses[keyof PostWorkflowsRunResponses]

export type PostWorkflowsTasksByTaskIdStopData = {
  body?: never
  path: {
    task_id: string
  }
  query?: never
  url: '/workflows/tasks/{task_id}/stop'
}

export type PostWorkflowsTasksByTaskIdStopErrors = {
  400: unknown
  401: unknown
  403: unknown
  404: unknown
  500: unknown
}

export type PostWorkflowsTasksByTaskIdStopResponses = {
  200: SimpleResultResponse
}

export type PostWorkflowsTasksByTaskIdStopResponse =
  PostWorkflowsTasksByTaskIdStopResponses[keyof PostWorkflowsTasksByTaskIdStopResponses]
