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

# Update Autogenerated Draft Test Case

> ### Description
Update a test case draft.



## OpenAPI

````yaml https://app.stainlessapi.com/api/spec/documented/sgp/openapi.yml patch /v4/evaluation-datasets/{evaluation_dataset_id}/autogenerated-draft-test-cases/{autogenerated_draft_test_case_id}
openapi: 3.1.0
info:
  title: EGP API V4
  description: >-
    This is the parent API for all EGP APIs. If you are looking for the EGP API,
    please go to https://api.egp.scale.com/docs.
  contact:
    name: Scale Generative AI Platform
    url: https://scale.com/genai-platform
  version: 0.1.0
servers:
  - url: https://api.egp.scale.com
security: []
tags:
  - name: Models
    description: Model API.
paths:
  /v4/evaluation-datasets/{evaluation_dataset_id}/autogenerated-draft-test-cases/{autogenerated_draft_test_case_id}:
    patch:
      tags:
        - Evaluation Datasets
      summary: Update Autogenerated Draft Test Case
      description: |-
        ### Description
        Update a test case draft.
      operationId: >-
        PATCH-V4-/evaluation-datasets/{evaluation_dataset_id}/autogenerated-draft-test-cases/{autogenerated_draft_test_case_id}
      parameters:
        - name: evaluation_dataset_id
          in: path
          required: true
          schema:
            type: string
            title: Evaluation Dataset Id
        - name: autogenerated_draft_test_case_id
          in: path
          required: true
          schema:
            type: string
            title: Autogenerated Draft Test Case Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PartialAutoGeneratedDraftTestCaseRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AutoGeneratedDraftTestCaseResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-codeSamples:
        - lang: Python
          source: >-
            import os

            from scale_gp import SGPClient


            client = SGPClient(
                api_key=os.environ.get("SGP_API_KEY"),  # This is the default and can be omitted
            )

            auto_generated_draft_test_case =
            client.evaluation_datasets.autogenerated_draft_test_cases.update(
                autogenerated_draft_test_case_id="autogenerated_draft_test_case_id",
                evaluation_dataset_id="evaluation_dataset_id",
            )

            print(auto_generated_draft_test_case.id)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/stainless-sdks/sgp-go\"\n\t\"github.com/stainless-sdks/sgp-go/option\"\n)\n\nfunc main() {\n\tclient := sgp.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tautoGeneratedDraftTestCase, err := client.EvaluationDatasets.AutogeneratedDraftTestCases.Update(\n\t\tcontext.TODO(),\n\t\t\"evaluation_dataset_id\",\n\t\t\"autogenerated_draft_test_case_id\",\n\t\tsgp.EvaluationDatasetAutogeneratedDraftTestCaseUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", autoGeneratedDraftTestCase.ID)\n}\n"
components:
  schemas:
    PartialAutoGeneratedDraftTestCaseRequest:
      properties:
        schema_type:
          title: Schema Type
          type: string
          const: GENERATION
        test_case_data:
          anyOf:
            - $ref: '#/components/schemas/ArtifactSchemaGeneration'
            - $ref: '#/components/schemas/SchemaGenerationBase'
          title: Test Case Data
          description: >-
            The data for the test case in a format matching the provided
            schema_type
        approved:
          type: boolean
          title: Approved
          description: Boolean to track whether or not the draft test case is approved
      additionalProperties: false
      type: object
      title: PartialAutoGeneratedDraftTestCaseRequest
    AutoGeneratedDraftTestCaseResponse:
      properties:
        evaluation_dataset_id:
          type: string
          title: Evaluation Dataset Id
          description: The ID of the associated evaluation dataset.
          can_patch: false
        schema_type:
          type: string
          const: GENERATION
          title: Schema Type
          default: GENERATION
        test_case_data:
          anyOf:
            - $ref: '#/components/schemas/ArtifactSchemaGeneration'
            - $ref: '#/components/schemas/SchemaGenerationBase'
          title: Test Case Data
          description: >-
            The data for the test case in a format matching the provided
            schema_type
        approved:
          type: boolean
          title: Approved
          description: Boolean to track whether or not the draft test case is approved
        topic_str:
          title: Topic Str
          can_patch: false
          type: string
        content_metadata:
          additionalProperties: true
          type: object
          title: Content Metadata
          description: >-
            Metadata for the chunks and artifacts that were used to generate
            this draft test case.
          can_patch: false
        id:
          type: string
          title: Id
          description: The unique identifier of the entity.
        account_id:
          type: string
          title: Account Id
          description: The ID of the account that owns the given entity.
          can_patch: false
        created_at:
          type: string
          format: date-time
          title: Created At
          description: The date and time when the entity was created in ISO format.
        updated_at:
          type: string
          format: date-time
          title: Updated At
          description: The date and time when the entity was last updated in ISO format.
        created_by_user_id:
          type: string
          title: Created By User Id
          description: The user who originally created the entity.
        created_by_identity_type:
          $ref: '#/components/schemas/IdentifierTypeEnum'
          description: The type of identity that created the entity.
      type: object
      required:
        - evaluation_dataset_id
        - test_case_data
        - approved
        - content_metadata
        - id
        - account_id
        - created_at
        - updated_at
        - created_by_user_id
        - created_by_identity_type
      title: AutoGeneratedDraftTestCaseResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ArtifactSchemaGeneration:
      properties:
        input:
          type: string
          title: Input
        expected_output:
          title: Expected Output
          type: string
        expected_extra_info:
          $ref: '#/components/schemas/ExtraInfoSchema'
        artifact_ids_filter:
          items:
            type: string
          type: array
          title: Artifact Ids Filter
      type: object
      required:
        - input
        - artifact_ids_filter
      title: ArtifactSchemaGeneration
    SchemaGenerationBase:
      properties:
        input:
          type: string
          title: Input
        expected_output:
          title: Expected Output
          type: string
        expected_extra_info:
          $ref: '#/components/schemas/ExtraInfoSchema'
      type: object
      required:
        - input
      title: SchemaGenerationBase
    IdentifierTypeEnum:
      type: string
      enum:
        - user
        - service_account
      title: IdentifierTypeEnum
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
          additionalProperties: true
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    ExtraInfoSchema:
      oneOf:
        - $ref: '#/components/schemas/ChunkExtraInfoSchema'
        - $ref: '#/components/schemas/StringExtraInfoSchema'
      title: ExtraInfoSchema
      discriminator:
        propertyName: schema_type
        mapping:
          CHUNKS:
            $ref: '#/components/schemas/ChunkExtraInfoSchema'
          STRING:
            $ref: '#/components/schemas/StringExtraInfoSchema'
    ChunkExtraInfoSchema:
      properties:
        schema_type:
          type: string
          const: CHUNKS
          title: Schema Type
          default: CHUNKS
        chunks:
          items:
            $ref: '#/components/schemas/ChunkData'
          type: array
          title: Chunks
      type: object
      required:
        - chunks
      title: ChunkExtraInfoSchema
    StringExtraInfoSchema:
      properties:
        schema_type:
          type: string
          const: STRING
          title: Schema Type
          default: STRING
        info:
          type: string
          title: Info
      type: object
      required:
        - info
      title: StringExtraInfoSchema
    ChunkData:
      properties:
        text:
          type: string
          title: Text
        metadata:
          title: Metadata
          additionalProperties: true
          type: object
      type: object
      required:
        - text
      title: ChunkData

````