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

# Update dataset file

> Update dataset file



## OpenAPI

````yaml https://api.gbase.ai/openapi-redoc.json put /v1/datasets/{dataset_id}/files
openapi: 3.1.0
info:
  title: GBase
  description: >
    # Introduce

    This API document can help you understand GBase more deeply. 

    You can train your own AI directly through the interface of this document.



    ##  Authentication


    Home page: [https://gbase.ai](https://gbase.ai)


    Huggingface:
    [https://huggingface.co/gptbase](https://huggingface.co/gptbase)


    The GBase API uses API keys for authentication. Visit your API Keys page to
    retrieve the API key you'll use in your requests.


    Remember that your API key is a secret! Do not share it with others or
    expose it in any client-side code (browsers, apps). 

    Production requests must be routed through your own backend server where
    your API key can be securely loaded from an environment variable or key
    management service.


    All API requests should include your API key in an Authorization HTTP header
    as follows:


    Parameter name: Authorization


    Value: Bearer [YOUR_API_KEY](https://admin.gbase.ai/keys)


    ```

    Authorization: Bearer YOUR_API_KEY

    ```


    ## Use steps

    1.Fill in your API keys.


    2.You can create an AI by using either the API interface or the
    administrative backend. Once created, the AI will generate an ID which will
    be required for the subsequent steps.


    3.Use the generated ID to call the file upload interface.


    4.After uploading the file, you can use the question interface to inquire
    about it.
  version: 0.0.1
servers:
  - url: https://api.gbase.ai
security: []
paths:
  /v1/datasets/{dataset_id}/files:
    put:
      tags:
        - Datasets
      summary: Update dataset file
      description: Update dataset file
      operationId: update_dataset_file_v1_datasets__dataset_id__files_put
      parameters:
        - required: true
          schema:
            type: string
            format: uuid
            title: Dataset Id
          name: dataset_id
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VectorFileIn'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VectorFileOut'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - Auth0ImplicitBearer: []
        - Auth0HTTPBearer: []
        - HTTPBearer: []
components:
  schemas:
    VectorFileIn:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        title:
          type: string
          maxLength: 2048
          title: Title
          nullable: true
        filename:
          type: string
          maxLength: 2048
          title: Filename
          description: 对于网页，存储URL；对于本地上传，存储文件名；对于Lark文档，存储file的name字段
          nullable: true
        file_status:
          type: string
          maxLength: 20
          title: File Status
          description: >-
            CRAWLED: crawled<br/>PROCESS: process<br/>COMPLETE:
            complete<br/>FAIL: fail<br/>Exceeded: exceeded<br/>DELETED:
            deleted<br/>READY: ready<br/>INVALID: invalid
          default: ready
        file_lang:
          type: string
          maxLength: 50
          title: File Lang
          nullable: true
        file_size:
          type: integer
          maximum: 2147483647
          minimum: -2147483648
          title: File Size
          default: 0
        token_count:
          type: integer
          maximum: 2147483647
          minimum: -2147483648
          title: Token Count
          default: 0
        characters_count:
          type: integer
          maximum: 2147483647
          minimum: -2147483648
          title: Characters Count
          default: 0
        failed_reason:
          type: string
          title: Failed Reason
          nullable: true
        resources:
          title: Resources
        source_type:
          type: string
          maxLength: 100
          title: Source Type
          description: 文件来源类型
          default: ''
          nullable: true
        learn_type:
          type: integer
          maximum: 2147483647
          minimum: -2147483648
          title: Learn Type
          default: 100
        lark_file:
          allOf:
            - $ref: '#/components/schemas/mygpt.models.LarkFile.leaf'
          title: Lark File
          nullable: true
        extension:
          allOf:
            - $ref: '#/components/schemas/mygpt.models.VectorFileExtension.leaf'
          title: Extension
          nullable: true
        file_name:
          type: string
          title: File Name
          default: ''
        summary:
          type: string
          title: Summary
          default: ''
        source_url:
          type: string
          title: Source Url
          default: ''
        source_path:
          type: string
          title: Source Path
          default: ''
        description:
          type: string
          title: Description
          default: ''
        metadata:
          type: object
          title: Metadata
          default: {}
      additionalProperties: false
      type: object
      title: VectorFileIn
    VectorFileOut:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        created_at:
          type: string
          format: date-time
          title: Created At
          readOnly: true
        updated_at:
          type: string
          format: date-time
          title: Updated At
          readOnly: true
        title:
          type: string
          maxLength: 2048
          title: Title
          nullable: true
        filename:
          type: string
          maxLength: 2048
          title: Filename
          description: 对于网页，存储URL；对于本地上传，存储文件名；对于Lark文档，存储file的name字段
          nullable: true
        file_type:
          type: string
          maxLength: 20
          title: File Type
          description: >-
            UPLOAD: upload<br/>CONVERT: convert<br/>HTML: html<br/>INTEGRATION:
            integration<br/>HTML_PDF: html_pdf<br/>SITEMAP: sitemap<br/>GITBOOK:
            gitbook<br/>FAQ: faq<br/>FAQ_QUESTION: faq_question
        file_status:
          type: string
          maxLength: 20
          title: File Status
          description: >-
            CRAWLED: crawled<br/>PROCESS: process<br/>COMPLETE:
            complete<br/>FAIL: fail<br/>Exceeded: exceeded<br/>DELETED:
            deleted<br/>READY: ready<br/>INVALID: invalid
          default: ready
        file_size:
          type: integer
          maximum: 2147483647
          minimum: -2147483648
          title: File Size
          default: 0
        token_count:
          type: integer
          maximum: 2147483647
          minimum: -2147483648
          title: Token Count
          default: 0
        characters_count:
          type: integer
          maximum: 2147483647
          minimum: -2147483648
          title: Characters Count
          default: 0
        failed_reason:
          type: string
          title: Failed Reason
          nullable: true
        index_ids:
          title: Index Ids
        resources:
          title: Resources
        content_hash:
          type: string
          maxLength: 255
          title: Content Hash
          nullable: true
        source_type:
          type: string
          maxLength: 100
          title: Source Type
          description: 文件来源类型
          nullable: true
        learn_type:
          type: integer
          maximum: 2147483647
          minimum: -2147483648
          title: Learn Type
          default: 100
        dataset_id:
          type: string
          format: uuid
          title: Dataset Id
          nullable: true
        tokens:
          type: integer
          title: Tokens
        lark_file:
          $ref: '#/components/schemas/LarkFileOut'
      additionalProperties: false
      type: object
      required:
        - created_at
        - updated_at
        - file_type
        - tokens
      title: VectorFileOutBase
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    mygpt.models.LarkFile.leaf:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        created_at:
          type: string
          format: date-time
          title: Created At
          readOnly: true
        updated_at:
          type: string
          format: date-time
          title: Updated At
          readOnly: true
        deleted_at:
          type: string
          format: date-time
          title: Deleted At
          nullable: true
        name:
          type: string
          maxLength: 1024
          title: Name
        type:
          type: string
          maxLength: 100
          title: Type
        token:
          type: string
          maxLength: 255
          title: Token
        parent_token:
          type: string
          maxLength: 255
          title: Parent Token
          nullable: true
        created_time:
          type: string
          maxLength: 255
          title: Created Time
        modified_time:
          type: string
          maxLength: 255
          title: Modified Time
        owner_id:
          type: string
          maxLength: 255
          title: Owner Id
          nullable: true
        url:
          type: string
          maxLength: 2048
          title: Url
      additionalProperties: false
      type: object
      required:
        - created_at
        - updated_at
        - name
        - type
        - token
        - created_time
        - modified_time
        - url
      title: LarkFile
    mygpt.models.VectorFileExtension.leaf:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        created_at:
          type: string
          format: date-time
          title: Created At
          readOnly: true
        updated_at:
          type: string
          format: date-time
          title: Updated At
          readOnly: true
        deleted_at:
          type: string
          format: date-time
          title: Deleted At
          nullable: true
        source_url:
          type: string
          maxLength: 2048
          title: Source Url
          description: 文档的源URL
          nullable: true
        source_path:
          type: string
          maxLength: 1024
          title: Source Path
          description: 文档的源路径
          nullable: true
        source_type:
          type: string
          maxLength: 100
          title: Source Type
          description: 文档来源类型（预留字段）
          nullable: true
        file_name:
          type: string
          maxLength: 512
          title: File Name
          description: 文件名
          nullable: true
        title:
          type: string
          maxLength: 512
          title: Title
          description: 文件标题
          nullable: true
        summary:
          type: string
          title: Summary
          description: 文档摘要
          nullable: true
        description:
          type: string
          title: Description
          description: 文件详细描述
          nullable: true
        metadata:
          title: Metadata
          description: 扩展元数据
      additionalProperties: false
      type: object
      required:
        - created_at
        - updated_at
      title: VectorFileExtension
      description: >-
        VectorFile扩展信息表<br/><br/>用于存储VectorFile的扩展信息，采用一对一关系设计。<br/>使用数据库外键约束保证数据一致性。
    LarkFileOut:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        created_at:
          type: string
          format: date-time
          title: Created At
          readOnly: true
        updated_at:
          type: string
          format: date-time
          title: Updated At
          readOnly: true
        name:
          type: string
          maxLength: 1024
          title: Name
        type:
          type: string
          maxLength: 100
          title: Type
        token:
          type: string
          maxLength: 255
          title: Token
        parent_token:
          type: string
          maxLength: 255
          title: Parent Token
          nullable: true
        created_time:
          type: string
          maxLength: 255
          title: Created Time
        modified_time:
          type: string
          maxLength: 255
          title: Modified Time
        owner_id:
          type: string
          maxLength: 255
          title: Owner Id
          nullable: true
        url:
          type: string
          maxLength: 2048
          title: Url
        vector_file_id:
          type: string
          format: uuid
          title: Vector File Id
      additionalProperties: false
      type: object
      required:
        - created_at
        - updated_at
        - name
        - type
        - token
        - created_time
        - modified_time
        - url
        - vector_file_id
      title: LarkFileOut
    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
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````