> ## Documentation Index
> Fetch the complete documentation index at: https://docs.noxus.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Generic Train Knowledge Base

> Train a knowledge base from a generic source



## OpenAPI

````yaml post /v1/knowledge-bases/{knowledge_base_id}/generic_train
openapi: 3.1.0
info:
  title: Noxus Backend
  description: >-
    Backend API for the Noxus Platform. More information can be found at
    https://docs.noxus.ai
  version: 1.1.0
servers: []
security: []
paths:
  /v1/knowledge-bases/{knowledge_base_id}/generic_train:
    post:
      tags:
        - V1 - Knowledge Bases
      summary: Generic Train Knowledge Base
      operationId: generic_train_knowledge_base
      parameters:
        - name: knowledge_base_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Knowledge Base Id
        - name: prefix
          in: query
          required: false
          schema:
            type: string
            description: The path prefix where to upload
            default: /
            title: Prefix
          description: The path prefix where to upload
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Source'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  type: string
                  format: uuid
                title: Response Generic Train Knowledge Base
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    Source:
      properties:
        source:
          oneOf:
            - $ref: '#/components/schemas/DocumentSource'
            - $ref: '#/components/schemas/GoogleDriveSource'
            - $ref: '#/components/schemas/OneDriveSource'
            - $ref: '#/components/schemas/SharepointSource'
            - $ref: '#/components/schemas/WebsiteSource'
            - $ref: '#/components/schemas/ServiceNowKnowledgeBaseSource'
            - $ref: '#/components/schemas/CustomSource'
          title: Source
          discriminator:
            propertyName: source_type
            mapping:
              Custom:
                $ref: '#/components/schemas/CustomSource'
              Document:
                $ref: '#/components/schemas/DocumentSource'
              Google Drive:
                $ref: '#/components/schemas/GoogleDriveSource'
              OneDrive:
                $ref: '#/components/schemas/OneDriveSource'
              ServiceNow:
                $ref: '#/components/schemas/ServiceNowKnowledgeBaseSource'
              Sharepoint:
                $ref: '#/components/schemas/SharepointSource'
              Website:
                $ref: '#/components/schemas/WebsiteSource'
      type: object
      required:
        - source
      title: Source
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    DocumentSource:
      properties:
        source_type:
          type: string
          const: Document
          title: Source Type
          default: Document
        subtype:
          anyOf:
            - type: string
            - type: 'null'
          title: Subtype
        config_cls:
          title: Config Cls
        config:
          $ref: '#/components/schemas/DocumentSourceConfig'
        integration:
          anyOf:
            - type: string
            - type: 'null'
          title: Integration
        image:
          type: string
          title: Image
          default: ''
        name:
          type: string
          title: Name
          default: File
        exposed:
          type: boolean
          title: Exposed
          default: false
      type: object
      required:
        - config
      title: DocumentSource
    GoogleDriveSource:
      properties:
        source_type:
          type: string
          const: Google Drive
          title: Source Type
          default: Google Drive
        subtype:
          anyOf:
            - type: string
            - type: 'null'
          title: Subtype
        config_cls:
          title: Config Cls
        config:
          $ref: '#/components/schemas/GoogleDriveSourceConfig'
        integration:
          anyOf:
            - type: string
            - type: 'null'
          title: Integration
          default: gdrive
        image:
          type: string
          title: Image
          default: >-
            https://storage.googleapis.com/image-storage-spot-manual/logos/google-drive.svg
        name:
          type: string
          title: Name
          default: Google Drive
        exposed:
          type: boolean
          title: Exposed
          default: true
      type: object
      required:
        - config
      title: GoogleDriveSource
    OneDriveSource:
      properties:
        source_type:
          type: string
          const: OneDrive
          title: Source Type
          default: OneDrive
        subtype:
          anyOf:
            - type: string
            - type: 'null'
          title: Subtype
        config_cls:
          title: Config Cls
        config:
          $ref: '#/components/schemas/OneDriveSourceConfig'
        integration:
          anyOf:
            - type: string
            - type: 'null'
          title: Integration
          default: onedrive
        image:
          type: string
          title: Image
          default: >-
            https://storage.googleapis.com/image-storage-spot-manual/logos/onedrive.png
        name:
          type: string
          title: Name
          default: OneDrive
        exposed:
          type: boolean
          title: Exposed
          default: true
      type: object
      required:
        - config
      title: OneDriveSource
    SharepointSource:
      properties:
        source_type:
          type: string
          const: Sharepoint
          title: Source Type
          default: Sharepoint
        subtype:
          anyOf:
            - type: string
            - type: 'null'
          title: Subtype
        config_cls:
          title: Config Cls
        config:
          $ref: '#/components/schemas/SharepointSourceConfig'
        integration:
          anyOf:
            - type: string
            - type: 'null'
          title: Integration
          default: sharepoint
        image:
          type: string
          title: Image
          default: >-
            https://storage.googleapis.com/image-storage-spot-manual/logos/sharepoint.png
        name:
          type: string
          title: Name
          default: Sharepoint
        exposed:
          type: boolean
          title: Exposed
          default: true
      type: object
      required:
        - config
      title: SharepointSource
    WebsiteSource:
      properties:
        source_type:
          type: string
          const: Website
          title: Source Type
          default: Website
        subtype:
          anyOf:
            - type: string
            - type: 'null'
          title: Subtype
        config_cls:
          title: Config Cls
        config:
          $ref: '#/components/schemas/WebsiteSourceConfig'
        integration:
          anyOf:
            - type: string
            - type: 'null'
          title: Integration
        image:
          type: string
          title: Image
          default: icon:Globe
        name:
          type: string
          title: Name
          default: Website
        exposed:
          type: boolean
          title: Exposed
          default: true
      type: object
      required:
        - config
      title: WebsiteSource
    ServiceNowKnowledgeBaseSource:
      properties:
        source_type:
          type: string
          const: ServiceNow
          title: Source Type
          default: ServiceNow
        subtype:
          anyOf:
            - type: string
            - type: 'null'
          title: Subtype
        config_cls:
          title: Config Cls
        config:
          $ref: '#/components/schemas/ServiceNowKnowledgeBaseSourceConfig'
        integration:
          anyOf:
            - type: string
            - type: 'null'
          title: Integration
          default: servicenow
        image:
          type: string
          title: Image
          default: >-
            https://storage.googleapis.com/image-storage-spot-manual/logos/servicenow.png
        name:
          type: string
          title: Name
          default: ServiceNow
        exposed:
          type: boolean
          title: Exposed
          default: true
      type: object
      required:
        - config
      title: ServiceNowKnowledgeBaseSource
    CustomSource:
      properties:
        source_type:
          type: string
          const: Custom
          title: Source Type
          default: Custom
        subtype:
          anyOf:
            - type: string
            - type: 'null'
          title: Subtype
        config_cls:
          title: Config Cls
        config:
          $ref: '#/components/schemas/CustomSourceConfig'
        integration:
          anyOf:
            - type: string
            - type: 'null'
          title: Integration
        image:
          type: string
          title: Image
          default: icon:Globe
        name:
          type: string
          title: Name
          default: Custom
        exposed:
          type: boolean
          title: Exposed
          default: true
      type: object
      required:
        - config
      title: CustomSource
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    DocumentSourceConfig:
      properties:
        files:
          items:
            $ref: '#/components/schemas/File'
          type: array
          title: Files
          display:
            can_select_multiple_files: false
            col_span: 12
            isPublic: false
            is_disabled: false
            is_subconfig: false
            label: Files
            needs_confirmation: false
            show_optional_label: false
            type: file_array
            variant: regular
          tab: Configuration
          tool_mode: hidden
      type: object
      title: DocumentSourceConfig
    GoogleDriveSourceConfig:
      properties:
        files:
          items:
            $ref: '#/components/schemas/GoogleFile'
          type: array
          title: Files
          description: File or folder to read
          display:
            col_span: 12
            file_type: >-
              application/pdf,text/plain,application/vnd.google-apps.document,application/vnd.google-apps.presentation,application/json,application/vnd.google-apps.folder,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.openxmlformats-officedocument.presentationml.presentation,image/jpeg,image/png,image/gif,image/webp,image/svg+xml,application/vnd.google-apps.spreadsheet
            is_disabled: false
            is_subconfig: false
            label: Path(s)
            multi_select: true
            needs_confirmation: false
            setIncludeFolders: false
            show_optional_label: false
            type: gdrive_picker
          placeholder:
            id: '123'
            name: '123'
          tab: Configuration
          tool_mode: hidden
      type: object
      required:
        - files
      title: GoogleDriveSourceConfig
      description: |-
        text_display_1: str = Parameter(
            default="",
            display=ConfigTextDisplay(
                title="Select files to add to knowledge base",
                text="",
            ),
        )
    OneDriveSourceConfig:
      properties:
        files:
          items:
            $ref: '#/components/schemas/OneDriveFile'
          type: array
          title: Files
          description: Document to read
          display:
            col_span: 12
            file_type: folder
            is_disabled: false
            is_subconfig: false
            label: ''
            multi_select: true
            name: OneDrive
            needs_confirmation: false
            set_include_folders: true
            show_optional_label: false
            type: onedrive_picker
          placeholder:
            - id: '123'
              image: '123'
              name: '123'
          tab: Configuration
          tool_mode: hidden
      type: object
      required:
        - files
      title: OneDriveSourceConfig
      description: |-
        text_display_1: str = Parameter(
            default="",
            display=ConfigTextDisplay(
                title="Select files to add to knowledge base",
                text="",
            ),
        )
    SharepointSourceConfig:
      properties:
        files:
          items:
            $ref: '#/components/schemas/OneDriveFile'
          type: array
          title: Files
          description: Document to read
          display:
            col_span: 12
            file_type: folder
            is_disabled: false
            is_subconfig: false
            label: ''
            multi_select: true
            name: Sharepoint
            needs_confirmation: false
            set_include_folders: true
            show_optional_label: false
            type: onedrive_picker
          placeholder:
            - id: '123'
              image: '123'
              name: '123'
          tab: Configuration
          tool_mode: hidden
      type: object
      required:
        - files
      title: SharepointSourceConfig
      description: |-
        text_display_1: str = Parameter(
            default="",
            display=ConfigTextDisplay(
                title="Select files to add to knowledge base",
                text="",
            ),
        )
    WebsiteSourceConfig:
      properties:
        urls:
          items:
            $ref: '#/components/schemas/WebsiteWithDepth'
          type: array
          title: Urls
          description: URL to read
          display:
            col_span: 12
            is_disabled: false
            is_subconfig: false
            label: URL
            needs_confirmation: false
            show_optional_label: false
            type: config_scrape_website_list
          tab: Configuration
          tool_mode: hidden
      type: object
      required:
        - urls
      title: WebsiteSourceConfig
    ServiceNowKnowledgeBaseSourceConfig:
      properties:
        knowledge_base_id:
          type: string
          title: Knowledge Base Id
          description: ServiceNow Knowledge Base ID (optional - leave empty for all)
          default: ''
          display:
            col_span: 12
            is_code: false
            is_disabled: false
            is_subconfig: false
            is_textarea: false
            label: Knowledge Base ID
            needs_confirmation: false
            number_of_lines: 1
            placeholder: Leave empty for all
            show_optional_label: false
            show_refresh: false
            type: text
          tab: Configuration
          tool_mode: hidden
        published_only:
          type: boolean
          title: Published Only
          description: Only include published articles
          default: true
          display:
            col_span: 12
            is_disabled: false
            is_subconfig: false
            label: Published Only
            needs_confirmation: false
            show_optional_label: false
            type: toggle
          tab: Configuration
          tool_mode: hidden
      type: object
      title: ServiceNowKnowledgeBaseSourceConfig
    CustomSourceConfig:
      properties: {}
      additionalProperties: true
      type: object
      title: CustomSourceConfig
    File:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
        uri:
          type: string
          title: Uri
        name:
          type: string
          title: Name
        content_type:
          type: string
          title: Content Type
          default: text/plain
        size:
          anyOf:
            - type: integer
            - type: 'null'
          title: Size
        source_type:
          $ref: '#/components/schemas/SourceType'
          default: Document
        source_metadata:
          anyOf:
            - $ref: '#/components/schemas/SourceMetadata'
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Source Metadata
      additionalProperties: true
      type: object
      required:
        - uri
        - name
      title: File
    GoogleFile:
      properties:
        id:
          type: string
          title: Id
        name:
          type: string
          title: Name
        mime_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Mime Type
        image:
          anyOf:
            - type: string
            - type: 'null'
          title: Image
      type: object
      required:
        - id
        - name
      title: GoogleFile
    OneDriveFile:
      properties:
        id:
          type: string
          title: Id
        name:
          type: string
          title: Name
        mime_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Mime Type
        image:
          anyOf:
            - type: string
            - type: 'null'
          title: Image
        url:
          anyOf:
            - type: string
            - type: 'null'
          title: Url
        drive_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Drive Id
      type: object
      required:
        - id
        - name
      title: OneDriveFile
    WebsiteWithDepth:
      properties:
        url:
          type: string
          title: Url
        depth:
          type: integer
          title: Depth
      type: object
      required:
        - url
        - depth
      title: WebsiteWithDepth
    SourceType:
      type: string
      enum:
        - Document
        - Google Drive
        - Notion
        - Website
        - OneDrive
        - Slack
        - Linear
        - Github
        - Teams
        - Sharepoint
        - ServiceNow
        - Custom
      title: SourceType
    SourceMetadata:
      properties:
        rel_path:
          anyOf:
            - type: string
            - type: 'null'
          title: Rel Path
      additionalProperties: true
      type: object
      title: SourceMetadata
      description: Base class for source metadata across different source types
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key

````