
/* !!! This is code generated by Prisma. Do not edit directly. !!! */
/* eslint-disable */
// biome-ignore-all lint: generated file
// @ts-nocheck 
/*
 * This file exports the `KnowledgeSource` model and its related types.
 *
 * 🟢 You can import this file directly.
 */
import type * as runtime from "@prisma/client/runtime/client"
import type * as $Enums from "../enums.js"
import type * as Prisma from "../internal/prismaNamespace.js"

/**
 * Model KnowledgeSource
 * 
 */
export type KnowledgeSourceModel = runtime.Types.Result.DefaultSelection<Prisma.$KnowledgeSourcePayload>

export type AggregateKnowledgeSource = {
  _count: KnowledgeSourceCountAggregateOutputType | null
  _min: KnowledgeSourceMinAggregateOutputType | null
  _max: KnowledgeSourceMaxAggregateOutputType | null
}

export type KnowledgeSourceMinAggregateOutputType = {
  kbId: string | null
  organizationId: string | null
  agentId: string | null
  userId: string | null
  name: string | null
  originalFileName: string | null
  storagePath: string | null
  sourceType: $Enums.sourceType | null
  status: $Enums.kbStatus | null
  lastIndexedAt: Date | null
  uploadedAt: Date | null
}

export type KnowledgeSourceMaxAggregateOutputType = {
  kbId: string | null
  organizationId: string | null
  agentId: string | null
  userId: string | null
  name: string | null
  originalFileName: string | null
  storagePath: string | null
  sourceType: $Enums.sourceType | null
  status: $Enums.kbStatus | null
  lastIndexedAt: Date | null
  uploadedAt: Date | null
}

export type KnowledgeSourceCountAggregateOutputType = {
  kbId: number
  organizationId: number
  agentId: number
  userId: number
  name: number
  originalFileName: number
  storagePath: number
  sourceType: number
  status: number
  metadata: number
  lastIndexedAt: number
  uploadedAt: number
  _all: number
}


export type KnowledgeSourceMinAggregateInputType = {
  kbId?: true
  organizationId?: true
  agentId?: true
  userId?: true
  name?: true
  originalFileName?: true
  storagePath?: true
  sourceType?: true
  status?: true
  lastIndexedAt?: true
  uploadedAt?: true
}

export type KnowledgeSourceMaxAggregateInputType = {
  kbId?: true
  organizationId?: true
  agentId?: true
  userId?: true
  name?: true
  originalFileName?: true
  storagePath?: true
  sourceType?: true
  status?: true
  lastIndexedAt?: true
  uploadedAt?: true
}

export type KnowledgeSourceCountAggregateInputType = {
  kbId?: true
  organizationId?: true
  agentId?: true
  userId?: true
  name?: true
  originalFileName?: true
  storagePath?: true
  sourceType?: true
  status?: true
  metadata?: true
  lastIndexedAt?: true
  uploadedAt?: true
  _all?: true
}

export type KnowledgeSourceAggregateArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Filter which KnowledgeSource to aggregate.
   */
  where?: Prisma.KnowledgeSourceWhereInput
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
   * 
   * Determine the order of KnowledgeSources to fetch.
   */
  orderBy?: Prisma.KnowledgeSourceOrderByWithRelationInput | Prisma.KnowledgeSourceOrderByWithRelationInput[]
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
   * 
   * Sets the start position
   */
  cursor?: Prisma.KnowledgeSourceWhereUniqueInput
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
   * 
   * Take `±n` KnowledgeSources from the position of the cursor.
   */
  take?: number
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
   * 
   * Skip the first `n` KnowledgeSources.
   */
  skip?: number
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
   * 
   * Count returned KnowledgeSources
  **/
  _count?: true | KnowledgeSourceCountAggregateInputType
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
   * 
   * Select which fields to find the minimum value
  **/
  _min?: KnowledgeSourceMinAggregateInputType
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
   * 
   * Select which fields to find the maximum value
  **/
  _max?: KnowledgeSourceMaxAggregateInputType
}

export type GetKnowledgeSourceAggregateType<T extends KnowledgeSourceAggregateArgs> = {
      [P in keyof T & keyof AggregateKnowledgeSource]: P extends '_count' | 'count'
    ? T[P] extends true
      ? number
      : Prisma.GetScalarType<T[P], AggregateKnowledgeSource[P]>
    : Prisma.GetScalarType<T[P], AggregateKnowledgeSource[P]>
}




export type KnowledgeSourceGroupByArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  where?: Prisma.KnowledgeSourceWhereInput
  orderBy?: Prisma.KnowledgeSourceOrderByWithAggregationInput | Prisma.KnowledgeSourceOrderByWithAggregationInput[]
  by: Prisma.KnowledgeSourceScalarFieldEnum[] | Prisma.KnowledgeSourceScalarFieldEnum
  having?: Prisma.KnowledgeSourceScalarWhereWithAggregatesInput
  take?: number
  skip?: number
  _count?: KnowledgeSourceCountAggregateInputType | true
  _min?: KnowledgeSourceMinAggregateInputType
  _max?: KnowledgeSourceMaxAggregateInputType
}

export type KnowledgeSourceGroupByOutputType = {
  kbId: string
  organizationId: string
  agentId: string | null
  userId: string | null
  name: string
  originalFileName: string | null
  storagePath: string
  sourceType: $Enums.sourceType
  status: $Enums.kbStatus
  metadata: runtime.JsonValue | null
  lastIndexedAt: Date | null
  uploadedAt: Date
  _count: KnowledgeSourceCountAggregateOutputType | null
  _min: KnowledgeSourceMinAggregateOutputType | null
  _max: KnowledgeSourceMaxAggregateOutputType | null
}

export type GetKnowledgeSourceGroupByPayload<T extends KnowledgeSourceGroupByArgs> = Prisma.PrismaPromise<
  Array<
    Prisma.PickEnumerable<KnowledgeSourceGroupByOutputType, T['by']> &
      {
        [P in ((keyof T) & (keyof KnowledgeSourceGroupByOutputType))]: P extends '_count'
          ? T[P] extends boolean
            ? number
            : Prisma.GetScalarType<T[P], KnowledgeSourceGroupByOutputType[P]>
          : Prisma.GetScalarType<T[P], KnowledgeSourceGroupByOutputType[P]>
      }
    >
  >



export type KnowledgeSourceWhereInput = {
  AND?: Prisma.KnowledgeSourceWhereInput | Prisma.KnowledgeSourceWhereInput[]
  OR?: Prisma.KnowledgeSourceWhereInput[]
  NOT?: Prisma.KnowledgeSourceWhereInput | Prisma.KnowledgeSourceWhereInput[]
  kbId?: Prisma.StringFilter<"KnowledgeSource"> | string
  organizationId?: Prisma.StringFilter<"KnowledgeSource"> | string
  agentId?: Prisma.StringNullableFilter<"KnowledgeSource"> | string | null
  userId?: Prisma.StringNullableFilter<"KnowledgeSource"> | string | null
  name?: Prisma.StringFilter<"KnowledgeSource"> | string
  originalFileName?: Prisma.StringNullableFilter<"KnowledgeSource"> | string | null
  storagePath?: Prisma.StringFilter<"KnowledgeSource"> | string
  sourceType?: Prisma.EnumsourceTypeFilter<"KnowledgeSource"> | $Enums.sourceType
  status?: Prisma.EnumkbStatusFilter<"KnowledgeSource"> | $Enums.kbStatus
  metadata?: Prisma.JsonNullableFilter<"KnowledgeSource">
  lastIndexedAt?: Prisma.DateTimeNullableFilter<"KnowledgeSource"> | Date | string | null
  uploadedAt?: Prisma.DateTimeFilter<"KnowledgeSource"> | Date | string
  organization?: Prisma.XOR<Prisma.OrganizationScalarRelationFilter, Prisma.OrganizationWhereInput>
  agent?: Prisma.XOR<Prisma.AgentNullableScalarRelationFilter, Prisma.AgentWhereInput> | null
  user?: Prisma.XOR<Prisma.UserNullableScalarRelationFilter, Prisma.UserWhereInput> | null
}

export type KnowledgeSourceOrderByWithRelationInput = {
  kbId?: Prisma.SortOrder
  organizationId?: Prisma.SortOrder
  agentId?: Prisma.SortOrderInput | Prisma.SortOrder
  userId?: Prisma.SortOrderInput | Prisma.SortOrder
  name?: Prisma.SortOrder
  originalFileName?: Prisma.SortOrderInput | Prisma.SortOrder
  storagePath?: Prisma.SortOrder
  sourceType?: Prisma.SortOrder
  status?: Prisma.SortOrder
  metadata?: Prisma.SortOrderInput | Prisma.SortOrder
  lastIndexedAt?: Prisma.SortOrderInput | Prisma.SortOrder
  uploadedAt?: Prisma.SortOrder
  organization?: Prisma.OrganizationOrderByWithRelationInput
  agent?: Prisma.AgentOrderByWithRelationInput
  user?: Prisma.UserOrderByWithRelationInput
}

export type KnowledgeSourceWhereUniqueInput = Prisma.AtLeast<{
  kbId?: string
  AND?: Prisma.KnowledgeSourceWhereInput | Prisma.KnowledgeSourceWhereInput[]
  OR?: Prisma.KnowledgeSourceWhereInput[]
  NOT?: Prisma.KnowledgeSourceWhereInput | Prisma.KnowledgeSourceWhereInput[]
  organizationId?: Prisma.StringFilter<"KnowledgeSource"> | string
  agentId?: Prisma.StringNullableFilter<"KnowledgeSource"> | string | null
  userId?: Prisma.StringNullableFilter<"KnowledgeSource"> | string | null
  name?: Prisma.StringFilter<"KnowledgeSource"> | string
  originalFileName?: Prisma.StringNullableFilter<"KnowledgeSource"> | string | null
  storagePath?: Prisma.StringFilter<"KnowledgeSource"> | string
  sourceType?: Prisma.EnumsourceTypeFilter<"KnowledgeSource"> | $Enums.sourceType
  status?: Prisma.EnumkbStatusFilter<"KnowledgeSource"> | $Enums.kbStatus
  metadata?: Prisma.JsonNullableFilter<"KnowledgeSource">
  lastIndexedAt?: Prisma.DateTimeNullableFilter<"KnowledgeSource"> | Date | string | null
  uploadedAt?: Prisma.DateTimeFilter<"KnowledgeSource"> | Date | string
  organization?: Prisma.XOR<Prisma.OrganizationScalarRelationFilter, Prisma.OrganizationWhereInput>
  agent?: Prisma.XOR<Prisma.AgentNullableScalarRelationFilter, Prisma.AgentWhereInput> | null
  user?: Prisma.XOR<Prisma.UserNullableScalarRelationFilter, Prisma.UserWhereInput> | null
}, "kbId">

export type KnowledgeSourceOrderByWithAggregationInput = {
  kbId?: Prisma.SortOrder
  organizationId?: Prisma.SortOrder
  agentId?: Prisma.SortOrderInput | Prisma.SortOrder
  userId?: Prisma.SortOrderInput | Prisma.SortOrder
  name?: Prisma.SortOrder
  originalFileName?: Prisma.SortOrderInput | Prisma.SortOrder
  storagePath?: Prisma.SortOrder
  sourceType?: Prisma.SortOrder
  status?: Prisma.SortOrder
  metadata?: Prisma.SortOrderInput | Prisma.SortOrder
  lastIndexedAt?: Prisma.SortOrderInput | Prisma.SortOrder
  uploadedAt?: Prisma.SortOrder
  _count?: Prisma.KnowledgeSourceCountOrderByAggregateInput
  _max?: Prisma.KnowledgeSourceMaxOrderByAggregateInput
  _min?: Prisma.KnowledgeSourceMinOrderByAggregateInput
}

export type KnowledgeSourceScalarWhereWithAggregatesInput = {
  AND?: Prisma.KnowledgeSourceScalarWhereWithAggregatesInput | Prisma.KnowledgeSourceScalarWhereWithAggregatesInput[]
  OR?: Prisma.KnowledgeSourceScalarWhereWithAggregatesInput[]
  NOT?: Prisma.KnowledgeSourceScalarWhereWithAggregatesInput | Prisma.KnowledgeSourceScalarWhereWithAggregatesInput[]
  kbId?: Prisma.StringWithAggregatesFilter<"KnowledgeSource"> | string
  organizationId?: Prisma.StringWithAggregatesFilter<"KnowledgeSource"> | string
  agentId?: Prisma.StringNullableWithAggregatesFilter<"KnowledgeSource"> | string | null
  userId?: Prisma.StringNullableWithAggregatesFilter<"KnowledgeSource"> | string | null
  name?: Prisma.StringWithAggregatesFilter<"KnowledgeSource"> | string
  originalFileName?: Prisma.StringNullableWithAggregatesFilter<"KnowledgeSource"> | string | null
  storagePath?: Prisma.StringWithAggregatesFilter<"KnowledgeSource"> | string
  sourceType?: Prisma.EnumsourceTypeWithAggregatesFilter<"KnowledgeSource"> | $Enums.sourceType
  status?: Prisma.EnumkbStatusWithAggregatesFilter<"KnowledgeSource"> | $Enums.kbStatus
  metadata?: Prisma.JsonNullableWithAggregatesFilter<"KnowledgeSource">
  lastIndexedAt?: Prisma.DateTimeNullableWithAggregatesFilter<"KnowledgeSource"> | Date | string | null
  uploadedAt?: Prisma.DateTimeWithAggregatesFilter<"KnowledgeSource"> | Date | string
}

export type KnowledgeSourceCreateInput = {
  kbId?: string
  name: string
  originalFileName?: string | null
  storagePath: string
  sourceType: $Enums.sourceType
  status: $Enums.kbStatus
  metadata?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
  lastIndexedAt?: Date | string | null
  uploadedAt?: Date | string
  organization: Prisma.OrganizationCreateNestedOneWithoutKnowledgeSourcesInput
  agent?: Prisma.AgentCreateNestedOneWithoutKnowledgeSourcesInput
  user?: Prisma.UserCreateNestedOneWithoutKnowledgeSourcesInput
}

export type KnowledgeSourceUncheckedCreateInput = {
  kbId?: string
  organizationId: string
  agentId?: string | null
  userId?: string | null
  name: string
  originalFileName?: string | null
  storagePath: string
  sourceType: $Enums.sourceType
  status: $Enums.kbStatus
  metadata?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
  lastIndexedAt?: Date | string | null
  uploadedAt?: Date | string
}

export type KnowledgeSourceUpdateInput = {
  kbId?: Prisma.StringFieldUpdateOperationsInput | string
  name?: Prisma.StringFieldUpdateOperationsInput | string
  originalFileName?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  storagePath?: Prisma.StringFieldUpdateOperationsInput | string
  sourceType?: Prisma.EnumsourceTypeFieldUpdateOperationsInput | $Enums.sourceType
  status?: Prisma.EnumkbStatusFieldUpdateOperationsInput | $Enums.kbStatus
  metadata?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
  lastIndexedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
  uploadedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  organization?: Prisma.OrganizationUpdateOneRequiredWithoutKnowledgeSourcesNestedInput
  agent?: Prisma.AgentUpdateOneWithoutKnowledgeSourcesNestedInput
  user?: Prisma.UserUpdateOneWithoutKnowledgeSourcesNestedInput
}

export type KnowledgeSourceUncheckedUpdateInput = {
  kbId?: Prisma.StringFieldUpdateOperationsInput | string
  organizationId?: Prisma.StringFieldUpdateOperationsInput | string
  agentId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  userId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  name?: Prisma.StringFieldUpdateOperationsInput | string
  originalFileName?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  storagePath?: Prisma.StringFieldUpdateOperationsInput | string
  sourceType?: Prisma.EnumsourceTypeFieldUpdateOperationsInput | $Enums.sourceType
  status?: Prisma.EnumkbStatusFieldUpdateOperationsInput | $Enums.kbStatus
  metadata?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
  lastIndexedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
  uploadedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
}

export type KnowledgeSourceCreateManyInput = {
  kbId?: string
  organizationId: string
  agentId?: string | null
  userId?: string | null
  name: string
  originalFileName?: string | null
  storagePath: string
  sourceType: $Enums.sourceType
  status: $Enums.kbStatus
  metadata?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
  lastIndexedAt?: Date | string | null
  uploadedAt?: Date | string
}

export type KnowledgeSourceUpdateManyMutationInput = {
  kbId?: Prisma.StringFieldUpdateOperationsInput | string
  name?: Prisma.StringFieldUpdateOperationsInput | string
  originalFileName?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  storagePath?: Prisma.StringFieldUpdateOperationsInput | string
  sourceType?: Prisma.EnumsourceTypeFieldUpdateOperationsInput | $Enums.sourceType
  status?: Prisma.EnumkbStatusFieldUpdateOperationsInput | $Enums.kbStatus
  metadata?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
  lastIndexedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
  uploadedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
}

export type KnowledgeSourceUncheckedUpdateManyInput = {
  kbId?: Prisma.StringFieldUpdateOperationsInput | string
  organizationId?: Prisma.StringFieldUpdateOperationsInput | string
  agentId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  userId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  name?: Prisma.StringFieldUpdateOperationsInput | string
  originalFileName?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  storagePath?: Prisma.StringFieldUpdateOperationsInput | string
  sourceType?: Prisma.EnumsourceTypeFieldUpdateOperationsInput | $Enums.sourceType
  status?: Prisma.EnumkbStatusFieldUpdateOperationsInput | $Enums.kbStatus
  metadata?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
  lastIndexedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
  uploadedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
}

export type KnowledgeSourceListRelationFilter = {
  every?: Prisma.KnowledgeSourceWhereInput
  some?: Prisma.KnowledgeSourceWhereInput
  none?: Prisma.KnowledgeSourceWhereInput
}

export type KnowledgeSourceOrderByRelationAggregateInput = {
  _count?: Prisma.SortOrder
}

export type KnowledgeSourceCountOrderByAggregateInput = {
  kbId?: Prisma.SortOrder
  organizationId?: Prisma.SortOrder
  agentId?: Prisma.SortOrder
  userId?: Prisma.SortOrder
  name?: Prisma.SortOrder
  originalFileName?: Prisma.SortOrder
  storagePath?: Prisma.SortOrder
  sourceType?: Prisma.SortOrder
  status?: Prisma.SortOrder
  metadata?: Prisma.SortOrder
  lastIndexedAt?: Prisma.SortOrder
  uploadedAt?: Prisma.SortOrder
}

export type KnowledgeSourceMaxOrderByAggregateInput = {
  kbId?: Prisma.SortOrder
  organizationId?: Prisma.SortOrder
  agentId?: Prisma.SortOrder
  userId?: Prisma.SortOrder
  name?: Prisma.SortOrder
  originalFileName?: Prisma.SortOrder
  storagePath?: Prisma.SortOrder
  sourceType?: Prisma.SortOrder
  status?: Prisma.SortOrder
  lastIndexedAt?: Prisma.SortOrder
  uploadedAt?: Prisma.SortOrder
}

export type KnowledgeSourceMinOrderByAggregateInput = {
  kbId?: Prisma.SortOrder
  organizationId?: Prisma.SortOrder
  agentId?: Prisma.SortOrder
  userId?: Prisma.SortOrder
  name?: Prisma.SortOrder
  originalFileName?: Prisma.SortOrder
  storagePath?: Prisma.SortOrder
  sourceType?: Prisma.SortOrder
  status?: Prisma.SortOrder
  lastIndexedAt?: Prisma.SortOrder
  uploadedAt?: Prisma.SortOrder
}

export type KnowledgeSourceCreateNestedManyWithoutUserInput = {
  create?: Prisma.XOR<Prisma.KnowledgeSourceCreateWithoutUserInput, Prisma.KnowledgeSourceUncheckedCreateWithoutUserInput> | Prisma.KnowledgeSourceCreateWithoutUserInput[] | Prisma.KnowledgeSourceUncheckedCreateWithoutUserInput[]
  connectOrCreate?: Prisma.KnowledgeSourceCreateOrConnectWithoutUserInput | Prisma.KnowledgeSourceCreateOrConnectWithoutUserInput[]
  createMany?: Prisma.KnowledgeSourceCreateManyUserInputEnvelope
  connect?: Prisma.KnowledgeSourceWhereUniqueInput | Prisma.KnowledgeSourceWhereUniqueInput[]
}

export type KnowledgeSourceUncheckedCreateNestedManyWithoutUserInput = {
  create?: Prisma.XOR<Prisma.KnowledgeSourceCreateWithoutUserInput, Prisma.KnowledgeSourceUncheckedCreateWithoutUserInput> | Prisma.KnowledgeSourceCreateWithoutUserInput[] | Prisma.KnowledgeSourceUncheckedCreateWithoutUserInput[]
  connectOrCreate?: Prisma.KnowledgeSourceCreateOrConnectWithoutUserInput | Prisma.KnowledgeSourceCreateOrConnectWithoutUserInput[]
  createMany?: Prisma.KnowledgeSourceCreateManyUserInputEnvelope
  connect?: Prisma.KnowledgeSourceWhereUniqueInput | Prisma.KnowledgeSourceWhereUniqueInput[]
}

export type KnowledgeSourceUpdateManyWithoutUserNestedInput = {
  create?: Prisma.XOR<Prisma.KnowledgeSourceCreateWithoutUserInput, Prisma.KnowledgeSourceUncheckedCreateWithoutUserInput> | Prisma.KnowledgeSourceCreateWithoutUserInput[] | Prisma.KnowledgeSourceUncheckedCreateWithoutUserInput[]
  connectOrCreate?: Prisma.KnowledgeSourceCreateOrConnectWithoutUserInput | Prisma.KnowledgeSourceCreateOrConnectWithoutUserInput[]
  upsert?: Prisma.KnowledgeSourceUpsertWithWhereUniqueWithoutUserInput | Prisma.KnowledgeSourceUpsertWithWhereUniqueWithoutUserInput[]
  createMany?: Prisma.KnowledgeSourceCreateManyUserInputEnvelope
  set?: Prisma.KnowledgeSourceWhereUniqueInput | Prisma.KnowledgeSourceWhereUniqueInput[]
  disconnect?: Prisma.KnowledgeSourceWhereUniqueInput | Prisma.KnowledgeSourceWhereUniqueInput[]
  delete?: Prisma.KnowledgeSourceWhereUniqueInput | Prisma.KnowledgeSourceWhereUniqueInput[]
  connect?: Prisma.KnowledgeSourceWhereUniqueInput | Prisma.KnowledgeSourceWhereUniqueInput[]
  update?: Prisma.KnowledgeSourceUpdateWithWhereUniqueWithoutUserInput | Prisma.KnowledgeSourceUpdateWithWhereUniqueWithoutUserInput[]
  updateMany?: Prisma.KnowledgeSourceUpdateManyWithWhereWithoutUserInput | Prisma.KnowledgeSourceUpdateManyWithWhereWithoutUserInput[]
  deleteMany?: Prisma.KnowledgeSourceScalarWhereInput | Prisma.KnowledgeSourceScalarWhereInput[]
}

export type KnowledgeSourceUncheckedUpdateManyWithoutUserNestedInput = {
  create?: Prisma.XOR<Prisma.KnowledgeSourceCreateWithoutUserInput, Prisma.KnowledgeSourceUncheckedCreateWithoutUserInput> | Prisma.KnowledgeSourceCreateWithoutUserInput[] | Prisma.KnowledgeSourceUncheckedCreateWithoutUserInput[]
  connectOrCreate?: Prisma.KnowledgeSourceCreateOrConnectWithoutUserInput | Prisma.KnowledgeSourceCreateOrConnectWithoutUserInput[]
  upsert?: Prisma.KnowledgeSourceUpsertWithWhereUniqueWithoutUserInput | Prisma.KnowledgeSourceUpsertWithWhereUniqueWithoutUserInput[]
  createMany?: Prisma.KnowledgeSourceCreateManyUserInputEnvelope
  set?: Prisma.KnowledgeSourceWhereUniqueInput | Prisma.KnowledgeSourceWhereUniqueInput[]
  disconnect?: Prisma.KnowledgeSourceWhereUniqueInput | Prisma.KnowledgeSourceWhereUniqueInput[]
  delete?: Prisma.KnowledgeSourceWhereUniqueInput | Prisma.KnowledgeSourceWhereUniqueInput[]
  connect?: Prisma.KnowledgeSourceWhereUniqueInput | Prisma.KnowledgeSourceWhereUniqueInput[]
  update?: Prisma.KnowledgeSourceUpdateWithWhereUniqueWithoutUserInput | Prisma.KnowledgeSourceUpdateWithWhereUniqueWithoutUserInput[]
  updateMany?: Prisma.KnowledgeSourceUpdateManyWithWhereWithoutUserInput | Prisma.KnowledgeSourceUpdateManyWithWhereWithoutUserInput[]
  deleteMany?: Prisma.KnowledgeSourceScalarWhereInput | Prisma.KnowledgeSourceScalarWhereInput[]
}

export type KnowledgeSourceCreateNestedManyWithoutOrganizationInput = {
  create?: Prisma.XOR<Prisma.KnowledgeSourceCreateWithoutOrganizationInput, Prisma.KnowledgeSourceUncheckedCreateWithoutOrganizationInput> | Prisma.KnowledgeSourceCreateWithoutOrganizationInput[] | Prisma.KnowledgeSourceUncheckedCreateWithoutOrganizationInput[]
  connectOrCreate?: Prisma.KnowledgeSourceCreateOrConnectWithoutOrganizationInput | Prisma.KnowledgeSourceCreateOrConnectWithoutOrganizationInput[]
  createMany?: Prisma.KnowledgeSourceCreateManyOrganizationInputEnvelope
  connect?: Prisma.KnowledgeSourceWhereUniqueInput | Prisma.KnowledgeSourceWhereUniqueInput[]
}

export type KnowledgeSourceUncheckedCreateNestedManyWithoutOrganizationInput = {
  create?: Prisma.XOR<Prisma.KnowledgeSourceCreateWithoutOrganizationInput, Prisma.KnowledgeSourceUncheckedCreateWithoutOrganizationInput> | Prisma.KnowledgeSourceCreateWithoutOrganizationInput[] | Prisma.KnowledgeSourceUncheckedCreateWithoutOrganizationInput[]
  connectOrCreate?: Prisma.KnowledgeSourceCreateOrConnectWithoutOrganizationInput | Prisma.KnowledgeSourceCreateOrConnectWithoutOrganizationInput[]
  createMany?: Prisma.KnowledgeSourceCreateManyOrganizationInputEnvelope
  connect?: Prisma.KnowledgeSourceWhereUniqueInput | Prisma.KnowledgeSourceWhereUniqueInput[]
}

export type KnowledgeSourceUpdateManyWithoutOrganizationNestedInput = {
  create?: Prisma.XOR<Prisma.KnowledgeSourceCreateWithoutOrganizationInput, Prisma.KnowledgeSourceUncheckedCreateWithoutOrganizationInput> | Prisma.KnowledgeSourceCreateWithoutOrganizationInput[] | Prisma.KnowledgeSourceUncheckedCreateWithoutOrganizationInput[]
  connectOrCreate?: Prisma.KnowledgeSourceCreateOrConnectWithoutOrganizationInput | Prisma.KnowledgeSourceCreateOrConnectWithoutOrganizationInput[]
  upsert?: Prisma.KnowledgeSourceUpsertWithWhereUniqueWithoutOrganizationInput | Prisma.KnowledgeSourceUpsertWithWhereUniqueWithoutOrganizationInput[]
  createMany?: Prisma.KnowledgeSourceCreateManyOrganizationInputEnvelope
  set?: Prisma.KnowledgeSourceWhereUniqueInput | Prisma.KnowledgeSourceWhereUniqueInput[]
  disconnect?: Prisma.KnowledgeSourceWhereUniqueInput | Prisma.KnowledgeSourceWhereUniqueInput[]
  delete?: Prisma.KnowledgeSourceWhereUniqueInput | Prisma.KnowledgeSourceWhereUniqueInput[]
  connect?: Prisma.KnowledgeSourceWhereUniqueInput | Prisma.KnowledgeSourceWhereUniqueInput[]
  update?: Prisma.KnowledgeSourceUpdateWithWhereUniqueWithoutOrganizationInput | Prisma.KnowledgeSourceUpdateWithWhereUniqueWithoutOrganizationInput[]
  updateMany?: Prisma.KnowledgeSourceUpdateManyWithWhereWithoutOrganizationInput | Prisma.KnowledgeSourceUpdateManyWithWhereWithoutOrganizationInput[]
  deleteMany?: Prisma.KnowledgeSourceScalarWhereInput | Prisma.KnowledgeSourceScalarWhereInput[]
}

export type KnowledgeSourceUncheckedUpdateManyWithoutOrganizationNestedInput = {
  create?: Prisma.XOR<Prisma.KnowledgeSourceCreateWithoutOrganizationInput, Prisma.KnowledgeSourceUncheckedCreateWithoutOrganizationInput> | Prisma.KnowledgeSourceCreateWithoutOrganizationInput[] | Prisma.KnowledgeSourceUncheckedCreateWithoutOrganizationInput[]
  connectOrCreate?: Prisma.KnowledgeSourceCreateOrConnectWithoutOrganizationInput | Prisma.KnowledgeSourceCreateOrConnectWithoutOrganizationInput[]
  upsert?: Prisma.KnowledgeSourceUpsertWithWhereUniqueWithoutOrganizationInput | Prisma.KnowledgeSourceUpsertWithWhereUniqueWithoutOrganizationInput[]
  createMany?: Prisma.KnowledgeSourceCreateManyOrganizationInputEnvelope
  set?: Prisma.KnowledgeSourceWhereUniqueInput | Prisma.KnowledgeSourceWhereUniqueInput[]
  disconnect?: Prisma.KnowledgeSourceWhereUniqueInput | Prisma.KnowledgeSourceWhereUniqueInput[]
  delete?: Prisma.KnowledgeSourceWhereUniqueInput | Prisma.KnowledgeSourceWhereUniqueInput[]
  connect?: Prisma.KnowledgeSourceWhereUniqueInput | Prisma.KnowledgeSourceWhereUniqueInput[]
  update?: Prisma.KnowledgeSourceUpdateWithWhereUniqueWithoutOrganizationInput | Prisma.KnowledgeSourceUpdateWithWhereUniqueWithoutOrganizationInput[]
  updateMany?: Prisma.KnowledgeSourceUpdateManyWithWhereWithoutOrganizationInput | Prisma.KnowledgeSourceUpdateManyWithWhereWithoutOrganizationInput[]
  deleteMany?: Prisma.KnowledgeSourceScalarWhereInput | Prisma.KnowledgeSourceScalarWhereInput[]
}

export type KnowledgeSourceCreateNestedManyWithoutAgentInput = {
  create?: Prisma.XOR<Prisma.KnowledgeSourceCreateWithoutAgentInput, Prisma.KnowledgeSourceUncheckedCreateWithoutAgentInput> | Prisma.KnowledgeSourceCreateWithoutAgentInput[] | Prisma.KnowledgeSourceUncheckedCreateWithoutAgentInput[]
  connectOrCreate?: Prisma.KnowledgeSourceCreateOrConnectWithoutAgentInput | Prisma.KnowledgeSourceCreateOrConnectWithoutAgentInput[]
  createMany?: Prisma.KnowledgeSourceCreateManyAgentInputEnvelope
  connect?: Prisma.KnowledgeSourceWhereUniqueInput | Prisma.KnowledgeSourceWhereUniqueInput[]
}

export type KnowledgeSourceUncheckedCreateNestedManyWithoutAgentInput = {
  create?: Prisma.XOR<Prisma.KnowledgeSourceCreateWithoutAgentInput, Prisma.KnowledgeSourceUncheckedCreateWithoutAgentInput> | Prisma.KnowledgeSourceCreateWithoutAgentInput[] | Prisma.KnowledgeSourceUncheckedCreateWithoutAgentInput[]
  connectOrCreate?: Prisma.KnowledgeSourceCreateOrConnectWithoutAgentInput | Prisma.KnowledgeSourceCreateOrConnectWithoutAgentInput[]
  createMany?: Prisma.KnowledgeSourceCreateManyAgentInputEnvelope
  connect?: Prisma.KnowledgeSourceWhereUniqueInput | Prisma.KnowledgeSourceWhereUniqueInput[]
}

export type KnowledgeSourceUpdateManyWithoutAgentNestedInput = {
  create?: Prisma.XOR<Prisma.KnowledgeSourceCreateWithoutAgentInput, Prisma.KnowledgeSourceUncheckedCreateWithoutAgentInput> | Prisma.KnowledgeSourceCreateWithoutAgentInput[] | Prisma.KnowledgeSourceUncheckedCreateWithoutAgentInput[]
  connectOrCreate?: Prisma.KnowledgeSourceCreateOrConnectWithoutAgentInput | Prisma.KnowledgeSourceCreateOrConnectWithoutAgentInput[]
  upsert?: Prisma.KnowledgeSourceUpsertWithWhereUniqueWithoutAgentInput | Prisma.KnowledgeSourceUpsertWithWhereUniqueWithoutAgentInput[]
  createMany?: Prisma.KnowledgeSourceCreateManyAgentInputEnvelope
  set?: Prisma.KnowledgeSourceWhereUniqueInput | Prisma.KnowledgeSourceWhereUniqueInput[]
  disconnect?: Prisma.KnowledgeSourceWhereUniqueInput | Prisma.KnowledgeSourceWhereUniqueInput[]
  delete?: Prisma.KnowledgeSourceWhereUniqueInput | Prisma.KnowledgeSourceWhereUniqueInput[]
  connect?: Prisma.KnowledgeSourceWhereUniqueInput | Prisma.KnowledgeSourceWhereUniqueInput[]
  update?: Prisma.KnowledgeSourceUpdateWithWhereUniqueWithoutAgentInput | Prisma.KnowledgeSourceUpdateWithWhereUniqueWithoutAgentInput[]
  updateMany?: Prisma.KnowledgeSourceUpdateManyWithWhereWithoutAgentInput | Prisma.KnowledgeSourceUpdateManyWithWhereWithoutAgentInput[]
  deleteMany?: Prisma.KnowledgeSourceScalarWhereInput | Prisma.KnowledgeSourceScalarWhereInput[]
}

export type KnowledgeSourceUncheckedUpdateManyWithoutAgentNestedInput = {
  create?: Prisma.XOR<Prisma.KnowledgeSourceCreateWithoutAgentInput, Prisma.KnowledgeSourceUncheckedCreateWithoutAgentInput> | Prisma.KnowledgeSourceCreateWithoutAgentInput[] | Prisma.KnowledgeSourceUncheckedCreateWithoutAgentInput[]
  connectOrCreate?: Prisma.KnowledgeSourceCreateOrConnectWithoutAgentInput | Prisma.KnowledgeSourceCreateOrConnectWithoutAgentInput[]
  upsert?: Prisma.KnowledgeSourceUpsertWithWhereUniqueWithoutAgentInput | Prisma.KnowledgeSourceUpsertWithWhereUniqueWithoutAgentInput[]
  createMany?: Prisma.KnowledgeSourceCreateManyAgentInputEnvelope
  set?: Prisma.KnowledgeSourceWhereUniqueInput | Prisma.KnowledgeSourceWhereUniqueInput[]
  disconnect?: Prisma.KnowledgeSourceWhereUniqueInput | Prisma.KnowledgeSourceWhereUniqueInput[]
  delete?: Prisma.KnowledgeSourceWhereUniqueInput | Prisma.KnowledgeSourceWhereUniqueInput[]
  connect?: Prisma.KnowledgeSourceWhereUniqueInput | Prisma.KnowledgeSourceWhereUniqueInput[]
  update?: Prisma.KnowledgeSourceUpdateWithWhereUniqueWithoutAgentInput | Prisma.KnowledgeSourceUpdateWithWhereUniqueWithoutAgentInput[]
  updateMany?: Prisma.KnowledgeSourceUpdateManyWithWhereWithoutAgentInput | Prisma.KnowledgeSourceUpdateManyWithWhereWithoutAgentInput[]
  deleteMany?: Prisma.KnowledgeSourceScalarWhereInput | Prisma.KnowledgeSourceScalarWhereInput[]
}

export type EnumsourceTypeFieldUpdateOperationsInput = {
  set?: $Enums.sourceType
}

export type EnumkbStatusFieldUpdateOperationsInput = {
  set?: $Enums.kbStatus
}

export type KnowledgeSourceCreateWithoutUserInput = {
  kbId?: string
  name: string
  originalFileName?: string | null
  storagePath: string
  sourceType: $Enums.sourceType
  status: $Enums.kbStatus
  metadata?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
  lastIndexedAt?: Date | string | null
  uploadedAt?: Date | string
  organization: Prisma.OrganizationCreateNestedOneWithoutKnowledgeSourcesInput
  agent?: Prisma.AgentCreateNestedOneWithoutKnowledgeSourcesInput
}

export type KnowledgeSourceUncheckedCreateWithoutUserInput = {
  kbId?: string
  organizationId: string
  agentId?: string | null
  name: string
  originalFileName?: string | null
  storagePath: string
  sourceType: $Enums.sourceType
  status: $Enums.kbStatus
  metadata?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
  lastIndexedAt?: Date | string | null
  uploadedAt?: Date | string
}

export type KnowledgeSourceCreateOrConnectWithoutUserInput = {
  where: Prisma.KnowledgeSourceWhereUniqueInput
  create: Prisma.XOR<Prisma.KnowledgeSourceCreateWithoutUserInput, Prisma.KnowledgeSourceUncheckedCreateWithoutUserInput>
}

export type KnowledgeSourceCreateManyUserInputEnvelope = {
  data: Prisma.KnowledgeSourceCreateManyUserInput | Prisma.KnowledgeSourceCreateManyUserInput[]
  skipDuplicates?: boolean
}

export type KnowledgeSourceUpsertWithWhereUniqueWithoutUserInput = {
  where: Prisma.KnowledgeSourceWhereUniqueInput
  update: Prisma.XOR<Prisma.KnowledgeSourceUpdateWithoutUserInput, Prisma.KnowledgeSourceUncheckedUpdateWithoutUserInput>
  create: Prisma.XOR<Prisma.KnowledgeSourceCreateWithoutUserInput, Prisma.KnowledgeSourceUncheckedCreateWithoutUserInput>
}

export type KnowledgeSourceUpdateWithWhereUniqueWithoutUserInput = {
  where: Prisma.KnowledgeSourceWhereUniqueInput
  data: Prisma.XOR<Prisma.KnowledgeSourceUpdateWithoutUserInput, Prisma.KnowledgeSourceUncheckedUpdateWithoutUserInput>
}

export type KnowledgeSourceUpdateManyWithWhereWithoutUserInput = {
  where: Prisma.KnowledgeSourceScalarWhereInput
  data: Prisma.XOR<Prisma.KnowledgeSourceUpdateManyMutationInput, Prisma.KnowledgeSourceUncheckedUpdateManyWithoutUserInput>
}

export type KnowledgeSourceScalarWhereInput = {
  AND?: Prisma.KnowledgeSourceScalarWhereInput | Prisma.KnowledgeSourceScalarWhereInput[]
  OR?: Prisma.KnowledgeSourceScalarWhereInput[]
  NOT?: Prisma.KnowledgeSourceScalarWhereInput | Prisma.KnowledgeSourceScalarWhereInput[]
  kbId?: Prisma.StringFilter<"KnowledgeSource"> | string
  organizationId?: Prisma.StringFilter<"KnowledgeSource"> | string
  agentId?: Prisma.StringNullableFilter<"KnowledgeSource"> | string | null
  userId?: Prisma.StringNullableFilter<"KnowledgeSource"> | string | null
  name?: Prisma.StringFilter<"KnowledgeSource"> | string
  originalFileName?: Prisma.StringNullableFilter<"KnowledgeSource"> | string | null
  storagePath?: Prisma.StringFilter<"KnowledgeSource"> | string
  sourceType?: Prisma.EnumsourceTypeFilter<"KnowledgeSource"> | $Enums.sourceType
  status?: Prisma.EnumkbStatusFilter<"KnowledgeSource"> | $Enums.kbStatus
  metadata?: Prisma.JsonNullableFilter<"KnowledgeSource">
  lastIndexedAt?: Prisma.DateTimeNullableFilter<"KnowledgeSource"> | Date | string | null
  uploadedAt?: Prisma.DateTimeFilter<"KnowledgeSource"> | Date | string
}

export type KnowledgeSourceCreateWithoutOrganizationInput = {
  kbId?: string
  name: string
  originalFileName?: string | null
  storagePath: string
  sourceType: $Enums.sourceType
  status: $Enums.kbStatus
  metadata?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
  lastIndexedAt?: Date | string | null
  uploadedAt?: Date | string
  agent?: Prisma.AgentCreateNestedOneWithoutKnowledgeSourcesInput
  user?: Prisma.UserCreateNestedOneWithoutKnowledgeSourcesInput
}

export type KnowledgeSourceUncheckedCreateWithoutOrganizationInput = {
  kbId?: string
  agentId?: string | null
  userId?: string | null
  name: string
  originalFileName?: string | null
  storagePath: string
  sourceType: $Enums.sourceType
  status: $Enums.kbStatus
  metadata?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
  lastIndexedAt?: Date | string | null
  uploadedAt?: Date | string
}

export type KnowledgeSourceCreateOrConnectWithoutOrganizationInput = {
  where: Prisma.KnowledgeSourceWhereUniqueInput
  create: Prisma.XOR<Prisma.KnowledgeSourceCreateWithoutOrganizationInput, Prisma.KnowledgeSourceUncheckedCreateWithoutOrganizationInput>
}

export type KnowledgeSourceCreateManyOrganizationInputEnvelope = {
  data: Prisma.KnowledgeSourceCreateManyOrganizationInput | Prisma.KnowledgeSourceCreateManyOrganizationInput[]
  skipDuplicates?: boolean
}

export type KnowledgeSourceUpsertWithWhereUniqueWithoutOrganizationInput = {
  where: Prisma.KnowledgeSourceWhereUniqueInput
  update: Prisma.XOR<Prisma.KnowledgeSourceUpdateWithoutOrganizationInput, Prisma.KnowledgeSourceUncheckedUpdateWithoutOrganizationInput>
  create: Prisma.XOR<Prisma.KnowledgeSourceCreateWithoutOrganizationInput, Prisma.KnowledgeSourceUncheckedCreateWithoutOrganizationInput>
}

export type KnowledgeSourceUpdateWithWhereUniqueWithoutOrganizationInput = {
  where: Prisma.KnowledgeSourceWhereUniqueInput
  data: Prisma.XOR<Prisma.KnowledgeSourceUpdateWithoutOrganizationInput, Prisma.KnowledgeSourceUncheckedUpdateWithoutOrganizationInput>
}

export type KnowledgeSourceUpdateManyWithWhereWithoutOrganizationInput = {
  where: Prisma.KnowledgeSourceScalarWhereInput
  data: Prisma.XOR<Prisma.KnowledgeSourceUpdateManyMutationInput, Prisma.KnowledgeSourceUncheckedUpdateManyWithoutOrganizationInput>
}

export type KnowledgeSourceCreateWithoutAgentInput = {
  kbId?: string
  name: string
  originalFileName?: string | null
  storagePath: string
  sourceType: $Enums.sourceType
  status: $Enums.kbStatus
  metadata?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
  lastIndexedAt?: Date | string | null
  uploadedAt?: Date | string
  organization: Prisma.OrganizationCreateNestedOneWithoutKnowledgeSourcesInput
  user?: Prisma.UserCreateNestedOneWithoutKnowledgeSourcesInput
}

export type KnowledgeSourceUncheckedCreateWithoutAgentInput = {
  kbId?: string
  organizationId: string
  userId?: string | null
  name: string
  originalFileName?: string | null
  storagePath: string
  sourceType: $Enums.sourceType
  status: $Enums.kbStatus
  metadata?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
  lastIndexedAt?: Date | string | null
  uploadedAt?: Date | string
}

export type KnowledgeSourceCreateOrConnectWithoutAgentInput = {
  where: Prisma.KnowledgeSourceWhereUniqueInput
  create: Prisma.XOR<Prisma.KnowledgeSourceCreateWithoutAgentInput, Prisma.KnowledgeSourceUncheckedCreateWithoutAgentInput>
}

export type KnowledgeSourceCreateManyAgentInputEnvelope = {
  data: Prisma.KnowledgeSourceCreateManyAgentInput | Prisma.KnowledgeSourceCreateManyAgentInput[]
  skipDuplicates?: boolean
}

export type KnowledgeSourceUpsertWithWhereUniqueWithoutAgentInput = {
  where: Prisma.KnowledgeSourceWhereUniqueInput
  update: Prisma.XOR<Prisma.KnowledgeSourceUpdateWithoutAgentInput, Prisma.KnowledgeSourceUncheckedUpdateWithoutAgentInput>
  create: Prisma.XOR<Prisma.KnowledgeSourceCreateWithoutAgentInput, Prisma.KnowledgeSourceUncheckedCreateWithoutAgentInput>
}

export type KnowledgeSourceUpdateWithWhereUniqueWithoutAgentInput = {
  where: Prisma.KnowledgeSourceWhereUniqueInput
  data: Prisma.XOR<Prisma.KnowledgeSourceUpdateWithoutAgentInput, Prisma.KnowledgeSourceUncheckedUpdateWithoutAgentInput>
}

export type KnowledgeSourceUpdateManyWithWhereWithoutAgentInput = {
  where: Prisma.KnowledgeSourceScalarWhereInput
  data: Prisma.XOR<Prisma.KnowledgeSourceUpdateManyMutationInput, Prisma.KnowledgeSourceUncheckedUpdateManyWithoutAgentInput>
}

export type KnowledgeSourceCreateManyUserInput = {
  kbId?: string
  organizationId: string
  agentId?: string | null
  name: string
  originalFileName?: string | null
  storagePath: string
  sourceType: $Enums.sourceType
  status: $Enums.kbStatus
  metadata?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
  lastIndexedAt?: Date | string | null
  uploadedAt?: Date | string
}

export type KnowledgeSourceUpdateWithoutUserInput = {
  kbId?: Prisma.StringFieldUpdateOperationsInput | string
  name?: Prisma.StringFieldUpdateOperationsInput | string
  originalFileName?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  storagePath?: Prisma.StringFieldUpdateOperationsInput | string
  sourceType?: Prisma.EnumsourceTypeFieldUpdateOperationsInput | $Enums.sourceType
  status?: Prisma.EnumkbStatusFieldUpdateOperationsInput | $Enums.kbStatus
  metadata?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
  lastIndexedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
  uploadedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  organization?: Prisma.OrganizationUpdateOneRequiredWithoutKnowledgeSourcesNestedInput
  agent?: Prisma.AgentUpdateOneWithoutKnowledgeSourcesNestedInput
}

export type KnowledgeSourceUncheckedUpdateWithoutUserInput = {
  kbId?: Prisma.StringFieldUpdateOperationsInput | string
  organizationId?: Prisma.StringFieldUpdateOperationsInput | string
  agentId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  name?: Prisma.StringFieldUpdateOperationsInput | string
  originalFileName?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  storagePath?: Prisma.StringFieldUpdateOperationsInput | string
  sourceType?: Prisma.EnumsourceTypeFieldUpdateOperationsInput | $Enums.sourceType
  status?: Prisma.EnumkbStatusFieldUpdateOperationsInput | $Enums.kbStatus
  metadata?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
  lastIndexedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
  uploadedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
}

export type KnowledgeSourceUncheckedUpdateManyWithoutUserInput = {
  kbId?: Prisma.StringFieldUpdateOperationsInput | string
  organizationId?: Prisma.StringFieldUpdateOperationsInput | string
  agentId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  name?: Prisma.StringFieldUpdateOperationsInput | string
  originalFileName?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  storagePath?: Prisma.StringFieldUpdateOperationsInput | string
  sourceType?: Prisma.EnumsourceTypeFieldUpdateOperationsInput | $Enums.sourceType
  status?: Prisma.EnumkbStatusFieldUpdateOperationsInput | $Enums.kbStatus
  metadata?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
  lastIndexedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
  uploadedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
}

export type KnowledgeSourceCreateManyOrganizationInput = {
  kbId?: string
  agentId?: string | null
  userId?: string | null
  name: string
  originalFileName?: string | null
  storagePath: string
  sourceType: $Enums.sourceType
  status: $Enums.kbStatus
  metadata?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
  lastIndexedAt?: Date | string | null
  uploadedAt?: Date | string
}

export type KnowledgeSourceUpdateWithoutOrganizationInput = {
  kbId?: Prisma.StringFieldUpdateOperationsInput | string
  name?: Prisma.StringFieldUpdateOperationsInput | string
  originalFileName?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  storagePath?: Prisma.StringFieldUpdateOperationsInput | string
  sourceType?: Prisma.EnumsourceTypeFieldUpdateOperationsInput | $Enums.sourceType
  status?: Prisma.EnumkbStatusFieldUpdateOperationsInput | $Enums.kbStatus
  metadata?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
  lastIndexedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
  uploadedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  agent?: Prisma.AgentUpdateOneWithoutKnowledgeSourcesNestedInput
  user?: Prisma.UserUpdateOneWithoutKnowledgeSourcesNestedInput
}

export type KnowledgeSourceUncheckedUpdateWithoutOrganizationInput = {
  kbId?: Prisma.StringFieldUpdateOperationsInput | string
  agentId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  userId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  name?: Prisma.StringFieldUpdateOperationsInput | string
  originalFileName?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  storagePath?: Prisma.StringFieldUpdateOperationsInput | string
  sourceType?: Prisma.EnumsourceTypeFieldUpdateOperationsInput | $Enums.sourceType
  status?: Prisma.EnumkbStatusFieldUpdateOperationsInput | $Enums.kbStatus
  metadata?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
  lastIndexedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
  uploadedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
}

export type KnowledgeSourceUncheckedUpdateManyWithoutOrganizationInput = {
  kbId?: Prisma.StringFieldUpdateOperationsInput | string
  agentId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  userId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  name?: Prisma.StringFieldUpdateOperationsInput | string
  originalFileName?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  storagePath?: Prisma.StringFieldUpdateOperationsInput | string
  sourceType?: Prisma.EnumsourceTypeFieldUpdateOperationsInput | $Enums.sourceType
  status?: Prisma.EnumkbStatusFieldUpdateOperationsInput | $Enums.kbStatus
  metadata?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
  lastIndexedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
  uploadedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
}

export type KnowledgeSourceCreateManyAgentInput = {
  kbId?: string
  organizationId: string
  userId?: string | null
  name: string
  originalFileName?: string | null
  storagePath: string
  sourceType: $Enums.sourceType
  status: $Enums.kbStatus
  metadata?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
  lastIndexedAt?: Date | string | null
  uploadedAt?: Date | string
}

export type KnowledgeSourceUpdateWithoutAgentInput = {
  kbId?: Prisma.StringFieldUpdateOperationsInput | string
  name?: Prisma.StringFieldUpdateOperationsInput | string
  originalFileName?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  storagePath?: Prisma.StringFieldUpdateOperationsInput | string
  sourceType?: Prisma.EnumsourceTypeFieldUpdateOperationsInput | $Enums.sourceType
  status?: Prisma.EnumkbStatusFieldUpdateOperationsInput | $Enums.kbStatus
  metadata?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
  lastIndexedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
  uploadedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  organization?: Prisma.OrganizationUpdateOneRequiredWithoutKnowledgeSourcesNestedInput
  user?: Prisma.UserUpdateOneWithoutKnowledgeSourcesNestedInput
}

export type KnowledgeSourceUncheckedUpdateWithoutAgentInput = {
  kbId?: Prisma.StringFieldUpdateOperationsInput | string
  organizationId?: Prisma.StringFieldUpdateOperationsInput | string
  userId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  name?: Prisma.StringFieldUpdateOperationsInput | string
  originalFileName?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  storagePath?: Prisma.StringFieldUpdateOperationsInput | string
  sourceType?: Prisma.EnumsourceTypeFieldUpdateOperationsInput | $Enums.sourceType
  status?: Prisma.EnumkbStatusFieldUpdateOperationsInput | $Enums.kbStatus
  metadata?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
  lastIndexedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
  uploadedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
}

export type KnowledgeSourceUncheckedUpdateManyWithoutAgentInput = {
  kbId?: Prisma.StringFieldUpdateOperationsInput | string
  organizationId?: Prisma.StringFieldUpdateOperationsInput | string
  userId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  name?: Prisma.StringFieldUpdateOperationsInput | string
  originalFileName?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  storagePath?: Prisma.StringFieldUpdateOperationsInput | string
  sourceType?: Prisma.EnumsourceTypeFieldUpdateOperationsInput | $Enums.sourceType
  status?: Prisma.EnumkbStatusFieldUpdateOperationsInput | $Enums.kbStatus
  metadata?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
  lastIndexedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
  uploadedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
}



export type KnowledgeSourceSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
  kbId?: boolean
  organizationId?: boolean
  agentId?: boolean
  userId?: boolean
  name?: boolean
  originalFileName?: boolean
  storagePath?: boolean
  sourceType?: boolean
  status?: boolean
  metadata?: boolean
  lastIndexedAt?: boolean
  uploadedAt?: boolean
  organization?: boolean | Prisma.OrganizationDefaultArgs<ExtArgs>
  agent?: boolean | Prisma.KnowledgeSource$agentArgs<ExtArgs>
  user?: boolean | Prisma.KnowledgeSource$userArgs<ExtArgs>
}, ExtArgs["result"]["knowledgeSource"]>

export type KnowledgeSourceSelectCreateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
  kbId?: boolean
  organizationId?: boolean
  agentId?: boolean
  userId?: boolean
  name?: boolean
  originalFileName?: boolean
  storagePath?: boolean
  sourceType?: boolean
  status?: boolean
  metadata?: boolean
  lastIndexedAt?: boolean
  uploadedAt?: boolean
  organization?: boolean | Prisma.OrganizationDefaultArgs<ExtArgs>
  agent?: boolean | Prisma.KnowledgeSource$agentArgs<ExtArgs>
  user?: boolean | Prisma.KnowledgeSource$userArgs<ExtArgs>
}, ExtArgs["result"]["knowledgeSource"]>

export type KnowledgeSourceSelectUpdateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
  kbId?: boolean
  organizationId?: boolean
  agentId?: boolean
  userId?: boolean
  name?: boolean
  originalFileName?: boolean
  storagePath?: boolean
  sourceType?: boolean
  status?: boolean
  metadata?: boolean
  lastIndexedAt?: boolean
  uploadedAt?: boolean
  organization?: boolean | Prisma.OrganizationDefaultArgs<ExtArgs>
  agent?: boolean | Prisma.KnowledgeSource$agentArgs<ExtArgs>
  user?: boolean | Prisma.KnowledgeSource$userArgs<ExtArgs>
}, ExtArgs["result"]["knowledgeSource"]>

export type KnowledgeSourceSelectScalar = {
  kbId?: boolean
  organizationId?: boolean
  agentId?: boolean
  userId?: boolean
  name?: boolean
  originalFileName?: boolean
  storagePath?: boolean
  sourceType?: boolean
  status?: boolean
  metadata?: boolean
  lastIndexedAt?: boolean
  uploadedAt?: boolean
}

export type KnowledgeSourceOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"kbId" | "organizationId" | "agentId" | "userId" | "name" | "originalFileName" | "storagePath" | "sourceType" | "status" | "metadata" | "lastIndexedAt" | "uploadedAt", ExtArgs["result"]["knowledgeSource"]>
export type KnowledgeSourceInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  organization?: boolean | Prisma.OrganizationDefaultArgs<ExtArgs>
  agent?: boolean | Prisma.KnowledgeSource$agentArgs<ExtArgs>
  user?: boolean | Prisma.KnowledgeSource$userArgs<ExtArgs>
}
export type KnowledgeSourceIncludeCreateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  organization?: boolean | Prisma.OrganizationDefaultArgs<ExtArgs>
  agent?: boolean | Prisma.KnowledgeSource$agentArgs<ExtArgs>
  user?: boolean | Prisma.KnowledgeSource$userArgs<ExtArgs>
}
export type KnowledgeSourceIncludeUpdateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  organization?: boolean | Prisma.OrganizationDefaultArgs<ExtArgs>
  agent?: boolean | Prisma.KnowledgeSource$agentArgs<ExtArgs>
  user?: boolean | Prisma.KnowledgeSource$userArgs<ExtArgs>
}

export type $KnowledgeSourcePayload<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  name: "KnowledgeSource"
  objects: {
    organization: Prisma.$OrganizationPayload<ExtArgs>
    agent: Prisma.$AgentPayload<ExtArgs> | null
    user: Prisma.$UserPayload<ExtArgs> | null
  }
  scalars: runtime.Types.Extensions.GetPayloadResult<{
    kbId: string
    organizationId: string
    agentId: string | null
    userId: string | null
    name: string
    originalFileName: string | null
    storagePath: string
    sourceType: $Enums.sourceType
    status: $Enums.kbStatus
    metadata: runtime.JsonValue | null
    lastIndexedAt: Date | null
    uploadedAt: Date
  }, ExtArgs["result"]["knowledgeSource"]>
  composites: {}
}

export type KnowledgeSourceGetPayload<S extends boolean | null | undefined | KnowledgeSourceDefaultArgs> = runtime.Types.Result.GetResult<Prisma.$KnowledgeSourcePayload, S>

export type KnowledgeSourceCountArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> =
  Omit<KnowledgeSourceFindManyArgs, 'select' | 'include' | 'distinct' | 'omit'> & {
    select?: KnowledgeSourceCountAggregateInputType | true
  }

export interface KnowledgeSourceDelegate<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, GlobalOmitOptions = {}> {
  [K: symbol]: { types: Prisma.TypeMap<ExtArgs>['model']['KnowledgeSource'], meta: { name: 'KnowledgeSource' } }
  /**
   * Find zero or one KnowledgeSource that matches the filter.
   * @param {KnowledgeSourceFindUniqueArgs} args - Arguments to find a KnowledgeSource
   * @example
   * // Get one KnowledgeSource
   * const knowledgeSource = await prisma.knowledgeSource.findUnique({
   *   where: {
   *     // ... provide filter here
   *   }
   * })
   */
  findUnique<T extends KnowledgeSourceFindUniqueArgs>(args: Prisma.SelectSubset<T, KnowledgeSourceFindUniqueArgs<ExtArgs>>): Prisma.Prisma__KnowledgeSourceClient<runtime.Types.Result.GetResult<Prisma.$KnowledgeSourcePayload<ExtArgs>, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>

  /**
   * Find one KnowledgeSource that matches the filter or throw an error with `error.code='P2025'`
   * if no matches were found.
   * @param {KnowledgeSourceFindUniqueOrThrowArgs} args - Arguments to find a KnowledgeSource
   * @example
   * // Get one KnowledgeSource
   * const knowledgeSource = await prisma.knowledgeSource.findUniqueOrThrow({
   *   where: {
   *     // ... provide filter here
   *   }
   * })
   */
  findUniqueOrThrow<T extends KnowledgeSourceFindUniqueOrThrowArgs>(args: Prisma.SelectSubset<T, KnowledgeSourceFindUniqueOrThrowArgs<ExtArgs>>): Prisma.Prisma__KnowledgeSourceClient<runtime.Types.Result.GetResult<Prisma.$KnowledgeSourcePayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

  /**
   * Find the first KnowledgeSource that matches the filter.
   * Note, that providing `undefined` is treated as the value not being there.
   * Read more here: https://pris.ly/d/null-undefined
   * @param {KnowledgeSourceFindFirstArgs} args - Arguments to find a KnowledgeSource
   * @example
   * // Get one KnowledgeSource
   * const knowledgeSource = await prisma.knowledgeSource.findFirst({
   *   where: {
   *     // ... provide filter here
   *   }
   * })
   */
  findFirst<T extends KnowledgeSourceFindFirstArgs>(args?: Prisma.SelectSubset<T, KnowledgeSourceFindFirstArgs<ExtArgs>>): Prisma.Prisma__KnowledgeSourceClient<runtime.Types.Result.GetResult<Prisma.$KnowledgeSourcePayload<ExtArgs>, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>

  /**
   * Find the first KnowledgeSource that matches the filter or
   * throw `PrismaKnownClientError` with `P2025` code if no matches were found.
   * Note, that providing `undefined` is treated as the value not being there.
   * Read more here: https://pris.ly/d/null-undefined
   * @param {KnowledgeSourceFindFirstOrThrowArgs} args - Arguments to find a KnowledgeSource
   * @example
   * // Get one KnowledgeSource
   * const knowledgeSource = await prisma.knowledgeSource.findFirstOrThrow({
   *   where: {
   *     // ... provide filter here
   *   }
   * })
   */
  findFirstOrThrow<T extends KnowledgeSourceFindFirstOrThrowArgs>(args?: Prisma.SelectSubset<T, KnowledgeSourceFindFirstOrThrowArgs<ExtArgs>>): Prisma.Prisma__KnowledgeSourceClient<runtime.Types.Result.GetResult<Prisma.$KnowledgeSourcePayload<ExtArgs>, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

  /**
   * Find zero or more KnowledgeSources that matches the filter.
   * Note, that providing `undefined` is treated as the value not being there.
   * Read more here: https://pris.ly/d/null-undefined
   * @param {KnowledgeSourceFindManyArgs} args - Arguments to filter and select certain fields only.
   * @example
   * // Get all KnowledgeSources
   * const knowledgeSources = await prisma.knowledgeSource.findMany()
   * 
   * // Get first 10 KnowledgeSources
   * const knowledgeSources = await prisma.knowledgeSource.findMany({ take: 10 })
   * 
   * // Only select the `kbId`
   * const knowledgeSourceWithKbIdOnly = await prisma.knowledgeSource.findMany({ select: { kbId: true } })
   * 
   */
  findMany<T extends KnowledgeSourceFindManyArgs>(args?: Prisma.SelectSubset<T, KnowledgeSourceFindManyArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$KnowledgeSourcePayload<ExtArgs>, T, "findMany", GlobalOmitOptions>>

  /**
   * Create a KnowledgeSource.
   * @param {KnowledgeSourceCreateArgs} args - Arguments to create a KnowledgeSource.
   * @example
   * // Create one KnowledgeSource
   * const KnowledgeSource = await prisma.knowledgeSource.create({
   *   data: {
   *     // ... data to create a KnowledgeSource
   *   }
   * })
   * 
   */
  create<T extends KnowledgeSourceCreateArgs>(args: Prisma.SelectSubset<T, KnowledgeSourceCreateArgs<ExtArgs>>): Prisma.Prisma__KnowledgeSourceClient<runtime.Types.Result.GetResult<Prisma.$KnowledgeSourcePayload<ExtArgs>, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

  /**
   * Create many KnowledgeSources.
   * @param {KnowledgeSourceCreateManyArgs} args - Arguments to create many KnowledgeSources.
   * @example
   * // Create many KnowledgeSources
   * const knowledgeSource = await prisma.knowledgeSource.createMany({
   *   data: [
   *     // ... provide data here
   *   ]
   * })
   *     
   */
  createMany<T extends KnowledgeSourceCreateManyArgs>(args?: Prisma.SelectSubset<T, KnowledgeSourceCreateManyArgs<ExtArgs>>): Prisma.PrismaPromise<Prisma.BatchPayload>

  /**
   * Create many KnowledgeSources and returns the data saved in the database.
   * @param {KnowledgeSourceCreateManyAndReturnArgs} args - Arguments to create many KnowledgeSources.
   * @example
   * // Create many KnowledgeSources
   * const knowledgeSource = await prisma.knowledgeSource.createManyAndReturn({
   *   data: [
   *     // ... provide data here
   *   ]
   * })
   * 
   * // Create many KnowledgeSources and only return the `kbId`
   * const knowledgeSourceWithKbIdOnly = await prisma.knowledgeSource.createManyAndReturn({
   *   select: { kbId: true },
   *   data: [
   *     // ... provide data here
   *   ]
   * })
   * Note, that providing `undefined` is treated as the value not being there.
   * Read more here: https://pris.ly/d/null-undefined
   * 
   */
  createManyAndReturn<T extends KnowledgeSourceCreateManyAndReturnArgs>(args?: Prisma.SelectSubset<T, KnowledgeSourceCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$KnowledgeSourcePayload<ExtArgs>, T, "createManyAndReturn", GlobalOmitOptions>>

  /**
   * Delete a KnowledgeSource.
   * @param {KnowledgeSourceDeleteArgs} args - Arguments to delete one KnowledgeSource.
   * @example
   * // Delete one KnowledgeSource
   * const KnowledgeSource = await prisma.knowledgeSource.delete({
   *   where: {
   *     // ... filter to delete one KnowledgeSource
   *   }
   * })
   * 
   */
  delete<T extends KnowledgeSourceDeleteArgs>(args: Prisma.SelectSubset<T, KnowledgeSourceDeleteArgs<ExtArgs>>): Prisma.Prisma__KnowledgeSourceClient<runtime.Types.Result.GetResult<Prisma.$KnowledgeSourcePayload<ExtArgs>, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

  /**
   * Update one KnowledgeSource.
   * @param {KnowledgeSourceUpdateArgs} args - Arguments to update one KnowledgeSource.
   * @example
   * // Update one KnowledgeSource
   * const knowledgeSource = await prisma.knowledgeSource.update({
   *   where: {
   *     // ... provide filter here
   *   },
   *   data: {
   *     // ... provide data here
   *   }
   * })
   * 
   */
  update<T extends KnowledgeSourceUpdateArgs>(args: Prisma.SelectSubset<T, KnowledgeSourceUpdateArgs<ExtArgs>>): Prisma.Prisma__KnowledgeSourceClient<runtime.Types.Result.GetResult<Prisma.$KnowledgeSourcePayload<ExtArgs>, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

  /**
   * Delete zero or more KnowledgeSources.
   * @param {KnowledgeSourceDeleteManyArgs} args - Arguments to filter KnowledgeSources to delete.
   * @example
   * // Delete a few KnowledgeSources
   * const { count } = await prisma.knowledgeSource.deleteMany({
   *   where: {
   *     // ... provide filter here
   *   }
   * })
   * 
   */
  deleteMany<T extends KnowledgeSourceDeleteManyArgs>(args?: Prisma.SelectSubset<T, KnowledgeSourceDeleteManyArgs<ExtArgs>>): Prisma.PrismaPromise<Prisma.BatchPayload>

  /**
   * Update zero or more KnowledgeSources.
   * Note, that providing `undefined` is treated as the value not being there.
   * Read more here: https://pris.ly/d/null-undefined
   * @param {KnowledgeSourceUpdateManyArgs} args - Arguments to update one or more rows.
   * @example
   * // Update many KnowledgeSources
   * const knowledgeSource = await prisma.knowledgeSource.updateMany({
   *   where: {
   *     // ... provide filter here
   *   },
   *   data: {
   *     // ... provide data here
   *   }
   * })
   * 
   */
  updateMany<T extends KnowledgeSourceUpdateManyArgs>(args: Prisma.SelectSubset<T, KnowledgeSourceUpdateManyArgs<ExtArgs>>): Prisma.PrismaPromise<Prisma.BatchPayload>

  /**
   * Update zero or more KnowledgeSources and returns the data updated in the database.
   * @param {KnowledgeSourceUpdateManyAndReturnArgs} args - Arguments to update many KnowledgeSources.
   * @example
   * // Update many KnowledgeSources
   * const knowledgeSource = await prisma.knowledgeSource.updateManyAndReturn({
   *   where: {
   *     // ... provide filter here
   *   },
   *   data: [
   *     // ... provide data here
   *   ]
   * })
   * 
   * // Update zero or more KnowledgeSources and only return the `kbId`
   * const knowledgeSourceWithKbIdOnly = await prisma.knowledgeSource.updateManyAndReturn({
   *   select: { kbId: true },
   *   where: {
   *     // ... provide filter here
   *   },
   *   data: [
   *     // ... provide data here
   *   ]
   * })
   * Note, that providing `undefined` is treated as the value not being there.
   * Read more here: https://pris.ly/d/null-undefined
   * 
   */
  updateManyAndReturn<T extends KnowledgeSourceUpdateManyAndReturnArgs>(args: Prisma.SelectSubset<T, KnowledgeSourceUpdateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$KnowledgeSourcePayload<ExtArgs>, T, "updateManyAndReturn", GlobalOmitOptions>>

  /**
   * Create or update one KnowledgeSource.
   * @param {KnowledgeSourceUpsertArgs} args - Arguments to update or create a KnowledgeSource.
   * @example
   * // Update or create a KnowledgeSource
   * const knowledgeSource = await prisma.knowledgeSource.upsert({
   *   create: {
   *     // ... data to create a KnowledgeSource
   *   },
   *   update: {
   *     // ... in case it already exists, update
   *   },
   *   where: {
   *     // ... the filter for the KnowledgeSource we want to update
   *   }
   * })
   */
  upsert<T extends KnowledgeSourceUpsertArgs>(args: Prisma.SelectSubset<T, KnowledgeSourceUpsertArgs<ExtArgs>>): Prisma.Prisma__KnowledgeSourceClient<runtime.Types.Result.GetResult<Prisma.$KnowledgeSourcePayload<ExtArgs>, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>


  /**
   * Count the number of KnowledgeSources.
   * Note, that providing `undefined` is treated as the value not being there.
   * Read more here: https://pris.ly/d/null-undefined
   * @param {KnowledgeSourceCountArgs} args - Arguments to filter KnowledgeSources to count.
   * @example
   * // Count the number of KnowledgeSources
   * const count = await prisma.knowledgeSource.count({
   *   where: {
   *     // ... the filter for the KnowledgeSources we want to count
   *   }
   * })
  **/
  count<T extends KnowledgeSourceCountArgs>(
    args?: Prisma.Subset<T, KnowledgeSourceCountArgs>,
  ): Prisma.PrismaPromise<
    T extends runtime.Types.Utils.Record<'select', any>
      ? T['select'] extends true
        ? number
        : Prisma.GetScalarType<T['select'], KnowledgeSourceCountAggregateOutputType>
      : number
  >

  /**
   * Allows you to perform aggregations operations on a KnowledgeSource.
   * Note, that providing `undefined` is treated as the value not being there.
   * Read more here: https://pris.ly/d/null-undefined
   * @param {KnowledgeSourceAggregateArgs} args - Select which aggregations you would like to apply and on what fields.
   * @example
   * // Ordered by age ascending
   * // Where email contains prisma.io
   * // Limited to the 10 users
   * const aggregations = await prisma.user.aggregate({
   *   _avg: {
   *     age: true,
   *   },
   *   where: {
   *     email: {
   *       contains: "prisma.io",
   *     },
   *   },
   *   orderBy: {
   *     age: "asc",
   *   },
   *   take: 10,
   * })
  **/
  aggregate<T extends KnowledgeSourceAggregateArgs>(args: Prisma.Subset<T, KnowledgeSourceAggregateArgs>): Prisma.PrismaPromise<GetKnowledgeSourceAggregateType<T>>

  /**
   * Group by KnowledgeSource.
   * Note, that providing `undefined` is treated as the value not being there.
   * Read more here: https://pris.ly/d/null-undefined
   * @param {KnowledgeSourceGroupByArgs} args - Group by arguments.
   * @example
   * // Group by city, order by createdAt, get count
   * const result = await prisma.user.groupBy({
   *   by: ['city', 'createdAt'],
   *   orderBy: {
   *     createdAt: true
   *   },
   *   _count: {
   *     _all: true
   *   },
   * })
   * 
  **/
  groupBy<
    T extends KnowledgeSourceGroupByArgs,
    HasSelectOrTake extends Prisma.Or<
      Prisma.Extends<'skip', Prisma.Keys<T>>,
      Prisma.Extends<'take', Prisma.Keys<T>>
    >,
    OrderByArg extends Prisma.True extends HasSelectOrTake
      ? { orderBy: KnowledgeSourceGroupByArgs['orderBy'] }
      : { orderBy?: KnowledgeSourceGroupByArgs['orderBy'] },
    OrderFields extends Prisma.ExcludeUnderscoreKeys<Prisma.Keys<Prisma.MaybeTupleToUnion<T['orderBy']>>>,
    ByFields extends Prisma.MaybeTupleToUnion<T['by']>,
    ByValid extends Prisma.Has<ByFields, OrderFields>,
    HavingFields extends Prisma.GetHavingFields<T['having']>,
    HavingValid extends Prisma.Has<ByFields, HavingFields>,
    ByEmpty extends T['by'] extends never[] ? Prisma.True : Prisma.False,
    InputErrors extends ByEmpty extends Prisma.True
    ? `Error: "by" must not be empty.`
    : HavingValid extends Prisma.False
    ? {
        [P in HavingFields]: P extends ByFields
          ? never
          : P extends string
          ? `Error: Field "${P}" used in "having" needs to be provided in "by".`
          : [
              Error,
              'Field ',
              P,
              ` in "having" needs to be provided in "by"`,
            ]
      }[HavingFields]
    : 'take' extends Prisma.Keys<T>
    ? 'orderBy' extends Prisma.Keys<T>
      ? ByValid extends Prisma.True
        ? {}
        : {
            [P in OrderFields]: P extends ByFields
              ? never
              : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
          }[OrderFields]
      : 'Error: If you provide "take", you also need to provide "orderBy"'
    : 'skip' extends Prisma.Keys<T>
    ? 'orderBy' extends Prisma.Keys<T>
      ? ByValid extends Prisma.True
        ? {}
        : {
            [P in OrderFields]: P extends ByFields
              ? never
              : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
          }[OrderFields]
      : 'Error: If you provide "skip", you also need to provide "orderBy"'
    : ByValid extends Prisma.True
    ? {}
    : {
        [P in OrderFields]: P extends ByFields
          ? never
          : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
      }[OrderFields]
  >(args: Prisma.SubsetIntersection<T, KnowledgeSourceGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetKnowledgeSourceGroupByPayload<T> : Prisma.PrismaPromise<InputErrors>
/**
 * Fields of the KnowledgeSource model
 */
readonly fields: KnowledgeSourceFieldRefs;
}

/**
 * The delegate class that acts as a "Promise-like" for KnowledgeSource.
 * Why is this prefixed with `Prisma__`?
 * Because we want to prevent naming conflicts as mentioned in
 * https://github.com/prisma/prisma-client-js/issues/707
 */
export interface Prisma__KnowledgeSourceClient<T, Null = never, ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
  readonly [Symbol.toStringTag]: "PrismaPromise"
  organization<T extends Prisma.OrganizationDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.OrganizationDefaultArgs<ExtArgs>>): Prisma.Prisma__OrganizationClient<runtime.Types.Result.GetResult<Prisma.$OrganizationPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
  agent<T extends Prisma.KnowledgeSource$agentArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.KnowledgeSource$agentArgs<ExtArgs>>): Prisma.Prisma__AgentClient<runtime.Types.Result.GetResult<Prisma.$AgentPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
  user<T extends Prisma.KnowledgeSource$userArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.KnowledgeSource$userArgs<ExtArgs>>): Prisma.Prisma__UserClient<runtime.Types.Result.GetResult<Prisma.$UserPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
  /**
   * Attaches callbacks for the resolution and/or rejection of the Promise.
   * @param onfulfilled The callback to execute when the Promise is resolved.
   * @param onrejected The callback to execute when the Promise is rejected.
   * @returns A Promise for the completion of which ever callback is executed.
   */
  then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): runtime.Types.Utils.JsPromise<TResult1 | TResult2>
  /**
   * Attaches a callback for only the rejection of the Promise.
   * @param onrejected The callback to execute when the Promise is rejected.
   * @returns A Promise for the completion of the callback.
   */
  catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): runtime.Types.Utils.JsPromise<T | TResult>
  /**
   * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
   * resolved value cannot be modified from the callback.
   * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
   * @returns A Promise for the completion of the callback.
   */
  finally(onfinally?: (() => void) | undefined | null): runtime.Types.Utils.JsPromise<T>
}




/**
 * Fields of the KnowledgeSource model
 */
export interface KnowledgeSourceFieldRefs {
  readonly kbId: Prisma.FieldRef<"KnowledgeSource", 'String'>
  readonly organizationId: Prisma.FieldRef<"KnowledgeSource", 'String'>
  readonly agentId: Prisma.FieldRef<"KnowledgeSource", 'String'>
  readonly userId: Prisma.FieldRef<"KnowledgeSource", 'String'>
  readonly name: Prisma.FieldRef<"KnowledgeSource", 'String'>
  readonly originalFileName: Prisma.FieldRef<"KnowledgeSource", 'String'>
  readonly storagePath: Prisma.FieldRef<"KnowledgeSource", 'String'>
  readonly sourceType: Prisma.FieldRef<"KnowledgeSource", 'sourceType'>
  readonly status: Prisma.FieldRef<"KnowledgeSource", 'kbStatus'>
  readonly metadata: Prisma.FieldRef<"KnowledgeSource", 'Json'>
  readonly lastIndexedAt: Prisma.FieldRef<"KnowledgeSource", 'DateTime'>
  readonly uploadedAt: Prisma.FieldRef<"KnowledgeSource", 'DateTime'>
}
    

// Custom InputTypes
/**
 * KnowledgeSource findUnique
 */
export type KnowledgeSourceFindUniqueArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the KnowledgeSource
   */
  select?: Prisma.KnowledgeSourceSelect<ExtArgs> | null
  /**
   * Omit specific fields from the KnowledgeSource
   */
  omit?: Prisma.KnowledgeSourceOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.KnowledgeSourceInclude<ExtArgs> | null
  /**
   * Filter, which KnowledgeSource to fetch.
   */
  where: Prisma.KnowledgeSourceWhereUniqueInput
}

/**
 * KnowledgeSource findUniqueOrThrow
 */
export type KnowledgeSourceFindUniqueOrThrowArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the KnowledgeSource
   */
  select?: Prisma.KnowledgeSourceSelect<ExtArgs> | null
  /**
   * Omit specific fields from the KnowledgeSource
   */
  omit?: Prisma.KnowledgeSourceOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.KnowledgeSourceInclude<ExtArgs> | null
  /**
   * Filter, which KnowledgeSource to fetch.
   */
  where: Prisma.KnowledgeSourceWhereUniqueInput
}

/**
 * KnowledgeSource findFirst
 */
export type KnowledgeSourceFindFirstArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the KnowledgeSource
   */
  select?: Prisma.KnowledgeSourceSelect<ExtArgs> | null
  /**
   * Omit specific fields from the KnowledgeSource
   */
  omit?: Prisma.KnowledgeSourceOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.KnowledgeSourceInclude<ExtArgs> | null
  /**
   * Filter, which KnowledgeSource to fetch.
   */
  where?: Prisma.KnowledgeSourceWhereInput
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
   * 
   * Determine the order of KnowledgeSources to fetch.
   */
  orderBy?: Prisma.KnowledgeSourceOrderByWithRelationInput | Prisma.KnowledgeSourceOrderByWithRelationInput[]
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
   * 
   * Sets the position for searching for KnowledgeSources.
   */
  cursor?: Prisma.KnowledgeSourceWhereUniqueInput
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
   * 
   * Take `±n` KnowledgeSources from the position of the cursor.
   */
  take?: number
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
   * 
   * Skip the first `n` KnowledgeSources.
   */
  skip?: number
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
   * 
   * Filter by unique combinations of KnowledgeSources.
   */
  distinct?: Prisma.KnowledgeSourceScalarFieldEnum | Prisma.KnowledgeSourceScalarFieldEnum[]
}

/**
 * KnowledgeSource findFirstOrThrow
 */
export type KnowledgeSourceFindFirstOrThrowArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the KnowledgeSource
   */
  select?: Prisma.KnowledgeSourceSelect<ExtArgs> | null
  /**
   * Omit specific fields from the KnowledgeSource
   */
  omit?: Prisma.KnowledgeSourceOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.KnowledgeSourceInclude<ExtArgs> | null
  /**
   * Filter, which KnowledgeSource to fetch.
   */
  where?: Prisma.KnowledgeSourceWhereInput
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
   * 
   * Determine the order of KnowledgeSources to fetch.
   */
  orderBy?: Prisma.KnowledgeSourceOrderByWithRelationInput | Prisma.KnowledgeSourceOrderByWithRelationInput[]
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
   * 
   * Sets the position for searching for KnowledgeSources.
   */
  cursor?: Prisma.KnowledgeSourceWhereUniqueInput
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
   * 
   * Take `±n` KnowledgeSources from the position of the cursor.
   */
  take?: number
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
   * 
   * Skip the first `n` KnowledgeSources.
   */
  skip?: number
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
   * 
   * Filter by unique combinations of KnowledgeSources.
   */
  distinct?: Prisma.KnowledgeSourceScalarFieldEnum | Prisma.KnowledgeSourceScalarFieldEnum[]
}

/**
 * KnowledgeSource findMany
 */
export type KnowledgeSourceFindManyArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the KnowledgeSource
   */
  select?: Prisma.KnowledgeSourceSelect<ExtArgs> | null
  /**
   * Omit specific fields from the KnowledgeSource
   */
  omit?: Prisma.KnowledgeSourceOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.KnowledgeSourceInclude<ExtArgs> | null
  /**
   * Filter, which KnowledgeSources to fetch.
   */
  where?: Prisma.KnowledgeSourceWhereInput
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
   * 
   * Determine the order of KnowledgeSources to fetch.
   */
  orderBy?: Prisma.KnowledgeSourceOrderByWithRelationInput | Prisma.KnowledgeSourceOrderByWithRelationInput[]
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
   * 
   * Sets the position for listing KnowledgeSources.
   */
  cursor?: Prisma.KnowledgeSourceWhereUniqueInput
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
   * 
   * Take `±n` KnowledgeSources from the position of the cursor.
   */
  take?: number
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
   * 
   * Skip the first `n` KnowledgeSources.
   */
  skip?: number
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
   * 
   * Filter by unique combinations of KnowledgeSources.
   */
  distinct?: Prisma.KnowledgeSourceScalarFieldEnum | Prisma.KnowledgeSourceScalarFieldEnum[]
}

/**
 * KnowledgeSource create
 */
export type KnowledgeSourceCreateArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the KnowledgeSource
   */
  select?: Prisma.KnowledgeSourceSelect<ExtArgs> | null
  /**
   * Omit specific fields from the KnowledgeSource
   */
  omit?: Prisma.KnowledgeSourceOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.KnowledgeSourceInclude<ExtArgs> | null
  /**
   * The data needed to create a KnowledgeSource.
   */
  data: Prisma.XOR<Prisma.KnowledgeSourceCreateInput, Prisma.KnowledgeSourceUncheckedCreateInput>
}

/**
 * KnowledgeSource createMany
 */
export type KnowledgeSourceCreateManyArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * The data used to create many KnowledgeSources.
   */
  data: Prisma.KnowledgeSourceCreateManyInput | Prisma.KnowledgeSourceCreateManyInput[]
  skipDuplicates?: boolean
}

/**
 * KnowledgeSource createManyAndReturn
 */
export type KnowledgeSourceCreateManyAndReturnArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the KnowledgeSource
   */
  select?: Prisma.KnowledgeSourceSelectCreateManyAndReturn<ExtArgs> | null
  /**
   * Omit specific fields from the KnowledgeSource
   */
  omit?: Prisma.KnowledgeSourceOmit<ExtArgs> | null
  /**
   * The data used to create many KnowledgeSources.
   */
  data: Prisma.KnowledgeSourceCreateManyInput | Prisma.KnowledgeSourceCreateManyInput[]
  skipDuplicates?: boolean
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.KnowledgeSourceIncludeCreateManyAndReturn<ExtArgs> | null
}

/**
 * KnowledgeSource update
 */
export type KnowledgeSourceUpdateArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the KnowledgeSource
   */
  select?: Prisma.KnowledgeSourceSelect<ExtArgs> | null
  /**
   * Omit specific fields from the KnowledgeSource
   */
  omit?: Prisma.KnowledgeSourceOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.KnowledgeSourceInclude<ExtArgs> | null
  /**
   * The data needed to update a KnowledgeSource.
   */
  data: Prisma.XOR<Prisma.KnowledgeSourceUpdateInput, Prisma.KnowledgeSourceUncheckedUpdateInput>
  /**
   * Choose, which KnowledgeSource to update.
   */
  where: Prisma.KnowledgeSourceWhereUniqueInput
}

/**
 * KnowledgeSource updateMany
 */
export type KnowledgeSourceUpdateManyArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * The data used to update KnowledgeSources.
   */
  data: Prisma.XOR<Prisma.KnowledgeSourceUpdateManyMutationInput, Prisma.KnowledgeSourceUncheckedUpdateManyInput>
  /**
   * Filter which KnowledgeSources to update
   */
  where?: Prisma.KnowledgeSourceWhereInput
  /**
   * Limit how many KnowledgeSources to update.
   */
  limit?: number
}

/**
 * KnowledgeSource updateManyAndReturn
 */
export type KnowledgeSourceUpdateManyAndReturnArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the KnowledgeSource
   */
  select?: Prisma.KnowledgeSourceSelectUpdateManyAndReturn<ExtArgs> | null
  /**
   * Omit specific fields from the KnowledgeSource
   */
  omit?: Prisma.KnowledgeSourceOmit<ExtArgs> | null
  /**
   * The data used to update KnowledgeSources.
   */
  data: Prisma.XOR<Prisma.KnowledgeSourceUpdateManyMutationInput, Prisma.KnowledgeSourceUncheckedUpdateManyInput>
  /**
   * Filter which KnowledgeSources to update
   */
  where?: Prisma.KnowledgeSourceWhereInput
  /**
   * Limit how many KnowledgeSources to update.
   */
  limit?: number
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.KnowledgeSourceIncludeUpdateManyAndReturn<ExtArgs> | null
}

/**
 * KnowledgeSource upsert
 */
export type KnowledgeSourceUpsertArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the KnowledgeSource
   */
  select?: Prisma.KnowledgeSourceSelect<ExtArgs> | null
  /**
   * Omit specific fields from the KnowledgeSource
   */
  omit?: Prisma.KnowledgeSourceOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.KnowledgeSourceInclude<ExtArgs> | null
  /**
   * The filter to search for the KnowledgeSource to update in case it exists.
   */
  where: Prisma.KnowledgeSourceWhereUniqueInput
  /**
   * In case the KnowledgeSource found by the `where` argument doesn't exist, create a new KnowledgeSource with this data.
   */
  create: Prisma.XOR<Prisma.KnowledgeSourceCreateInput, Prisma.KnowledgeSourceUncheckedCreateInput>
  /**
   * In case the KnowledgeSource was found with the provided `where` argument, update it with this data.
   */
  update: Prisma.XOR<Prisma.KnowledgeSourceUpdateInput, Prisma.KnowledgeSourceUncheckedUpdateInput>
}

/**
 * KnowledgeSource delete
 */
export type KnowledgeSourceDeleteArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the KnowledgeSource
   */
  select?: Prisma.KnowledgeSourceSelect<ExtArgs> | null
  /**
   * Omit specific fields from the KnowledgeSource
   */
  omit?: Prisma.KnowledgeSourceOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.KnowledgeSourceInclude<ExtArgs> | null
  /**
   * Filter which KnowledgeSource to delete.
   */
  where: Prisma.KnowledgeSourceWhereUniqueInput
}

/**
 * KnowledgeSource deleteMany
 */
export type KnowledgeSourceDeleteManyArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Filter which KnowledgeSources to delete
   */
  where?: Prisma.KnowledgeSourceWhereInput
  /**
   * Limit how many KnowledgeSources to delete.
   */
  limit?: number
}

/**
 * KnowledgeSource.agent
 */
export type KnowledgeSource$agentArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the Agent
   */
  select?: Prisma.AgentSelect<ExtArgs> | null
  /**
   * Omit specific fields from the Agent
   */
  omit?: Prisma.AgentOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.AgentInclude<ExtArgs> | null
  where?: Prisma.AgentWhereInput
}

/**
 * KnowledgeSource.user
 */
export type KnowledgeSource$userArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the User
   */
  select?: Prisma.UserSelect<ExtArgs> | null
  /**
   * Omit specific fields from the User
   */
  omit?: Prisma.UserOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.UserInclude<ExtArgs> | null
  where?: Prisma.UserWhereInput
}

/**
 * KnowledgeSource without action
 */
export type KnowledgeSourceDefaultArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the KnowledgeSource
   */
  select?: Prisma.KnowledgeSourceSelect<ExtArgs> | null
  /**
   * Omit specific fields from the KnowledgeSource
   */
  omit?: Prisma.KnowledgeSourceOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.KnowledgeSourceInclude<ExtArgs> | null
}
