> ## 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 Evaluation

> ### Description
Updates a evaluation

### Details
This API can be used to update the evaluation that matches the ID that was passed in as a path parameter. To use this API, pass in the `id` that was returned from your Create Evaluation API call as a path parameter.

Review the request schema to see the fields that can be updated.



## OpenAPI

````yaml https://app.stainlessapi.com/api/spec/documented/sgp/openapi.yml patch /v4/evaluations/{evaluation_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/evaluations/{evaluation_id}:
    patch:
      tags:
        - Evaluations
      summary: Update Evaluation
      description: >-
        ### Description

        Updates a evaluation


        ### Details

        This API can be used to update the evaluation that matches the ID that
        was passed in as a path parameter. To use this API, pass in the `id`
        that was returned from your Create Evaluation API call as a path
        parameter.


        Review the request schema to see the fields that can be updated.
      operationId: PATCH-V4-/evaluations/{evaluation_id}
      parameters:
        - name: evaluation_id
          in: path
          required: true
          schema:
            type: string
            title: Evaluation Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RestorablePartialPatchEvaluationRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LegacyEvaluationResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
      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
            )
            evaluation = client.evaluations.update(
                evaluation_id="evaluation_id",
            )
            print(evaluation.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\tevaluation, err := client.Evaluations.Update(\n\t\tcontext.TODO(),\n\t\t\"evaluation_id\",\n\t\tsgp.EvaluationUpdateParams{\n\t\t\tBody: sgp.EvaluationUpdateParamsBodyPartialPatchEvaluationRequest{\n\t\t\t\tRestore: sgp.F(sgp.EvaluationUpdateParamsBodyPartialPatchEvaluationRequestRestoreFalse),\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", evaluation.ID)\n}\n"
components:
  schemas:
    RestorablePartialPatchEvaluationRequest:
      oneOf:
        - $ref: '#/components/schemas/PartialPatchEvaluationRequest'
        - $ref: '#/components/schemas/RestoreRequest'
      title: RestorablePartialPatchEvaluationRequest
      discriminator:
        propertyName: restore
        mapping:
          'False':
            $ref: '#/components/schemas/PartialPatchEvaluationRequest'
          'True':
            $ref: '#/components/schemas/RestoreRequest'
    LegacyEvaluationResponse:
      properties:
        name:
          type: string
          title: Name
        description:
          title: Description
          type: string
        status:
          $ref: '#/components/schemas/EvaluationORMStatusEnum'
        application_spec_id:
          type: string
          title: Application Spec Id
        application_variant_id:
          type: string
          title: Application Variant Id
        tags:
          title: Tags
          additionalProperties: true
          type: object
        evaluation_config:
          title: Evaluation Config
          additionalProperties: true
          type: object
        evaluation_config_id:
          title: Evaluation Config Id
          description: The ID of the associated evaluation config.
          type: string
        completed_at:
          title: Completed At
          description: >-
            The date and time that all test case results for the evaluation were
            completed for the evaluation in ISO format.
          type: string
          format: date-time
        total_test_case_result_count:
          type: integer
          title: Total Test Case Result Count
          description: The total number of test case results for the evaluation
        completed_test_case_result_count:
          type: integer
          title: Completed Test Case Result Count
          description: >-
            The number of test case results that have been completed for the
            evaluation
        annotation_config:
          $ref: '#/components/schemas/AnnotationConfig'
          description: Annotation configuration for tasking
          can_patch: false
        question_id_to_annotation_config:
          title: Question Id To Annotation Config
          description: >-
            Specifies the annotation configuration to use for specific
            questions.
          can_patch: false
          additionalProperties:
            $ref: '#/components/schemas/AnnotationConfig'
          type: object
        metric_config:
          $ref: '#/components/schemas/MetricConfig'
          description: Specifies the config for the metrics to be computed.
          can_patch: false
        id:
          type: string
          title: Id
          description: The unique identifier of the entity.
        created_at:
          type: string
          format: date-time
          title: Created At
          description: The date and time when the entity was created in ISO format.
        account_id:
          type: string
          title: Account Id
          description: The ID of the account that owns the given entity.
          can_patch: false
        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.
        archived_at:
          title: Archived At
          description: The date and time when the entity was archived in ISO format.
          type: string
          format: date-time
      type: object
      required:
        - name
        - description
        - status
        - application_spec_id
        - total_test_case_result_count
        - completed_test_case_result_count
        - id
        - created_at
        - account_id
        - created_by_user_id
        - created_by_identity_type
      title: LegacyEvaluationResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    PartialPatchEvaluationRequest:
      properties:
        name:
          type: string
          title: Name
        description:
          title: Description
          type: string
        application_spec_id:
          type: string
          title: Application Spec Id
        application_variant_id:
          type: string
          title: Application Variant Id
        tags:
          title: Tags
          additionalProperties: true
          type: object
        evaluation_config:
          title: Evaluation Config
          additionalProperties: true
          type: object
        evaluation_config_id:
          title: Evaluation Config Id
          description: The ID of the associated evaluation config.
          type: string
        question_id_to_annotation_config:
          title: Question Id To Annotation Config
          description: >-
            Specifies the annotation configuration to use for specific
            questions.
          additionalProperties:
            $ref: '#/components/schemas/AnnotationConfig'
          type: object
        annotation_config:
          anyOf:
            - $ref: '#/components/schemas/AnnotationConfigRequestBase'
            - $ref: '#/components/schemas/AnnotationConfigGenerationRequest'
            - $ref: '#/components/schemas/AnnotationConfigMultiturnUseCaseRequest'
            - $ref: '#/components/schemas/AnnotationConfigSummarizationUseCaseRequest'
            - $ref: '#/components/schemas/AnnotationConfigTranslationUseCaseRequest'
          title: Annotation Config
          description: Annotation configuration for tasking
        evaluation_type:
          title: Evaluation Type
          description: >-
            If llm_benchmark is provided, the evaluation will be updated to a
            hybrid evaluation. No-op on existing hybrid evaluations, and not
            available for studio evaluations.
          type: string
          const: llm_benchmark
        restore:
          type: boolean
          const: false
          title: Restore
          description: Set to true to restore the entity from the database.
          default: false
      additionalProperties: false
      type: object
      title: PartialPatchEvaluationRequest
    RestoreRequest:
      properties:
        restore:
          type: boolean
          const: true
          title: Restore
          description: Set to true to restore the entity from the database.
      additionalProperties: false
      type: object
      required:
        - restore
      title: RestoreRequest
    EvaluationORMStatusEnum:
      type: string
      enum:
        - PENDING
        - COMPLETED
        - FAILED
      title: EvaluationORMStatusEnum
    AnnotationConfig:
      properties:
        annotation_config_type:
          $ref: '#/components/schemas/AnnotationConfigType'
          default: flexible
        components:
          title: Components
          items:
            items:
              $ref: '#/components/schemas/AnnotationItem'
            type: array
          type: array
        direction:
          $ref: '#/components/schemas/AnnotationConfigDirectionType'
          default: row
        llm_prompt:
          $ref: '#/components/schemas/AutoEvaluationPrompt'
      type: object
      title: AnnotationConfig
    MetricConfig:
      properties:
        components:
          items:
            $ref: '#/components/schemas/MetricItem'
          type: array
          title: Components
      type: object
      required:
        - components
      title: MetricConfig
    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
    AnnotationConfigRequestBase:
      properties:
        components:
          title: Components
          items:
            items:
              $ref: '#/components/schemas/AnnotationItem'
            type: array
          type: array
        direction:
          $ref: '#/components/schemas/AnnotationConfigDirectionType'
          default: row
        llm_prompt:
          $ref: '#/components/schemas/AutoEvaluationPrompt'
      type: object
      title: AnnotationConfigRequestBase
    AnnotationConfigGenerationRequest:
      properties:
        llm_prompt_template:
          type: string
          title: Llm Prompt Template
      type: object
      required:
        - llm_prompt_template
      title: AnnotationConfigGenerationRequest
    AnnotationConfigMultiturnUseCaseRequest:
      properties:
        messages_loc:
          $ref: '#/components/schemas/DataLoc'
        llm_prompt:
          $ref: '#/components/schemas/AutoEvaluationPrompt'
      type: object
      required:
        - messages_loc
      title: AnnotationConfigMultiturnUseCaseRequest
    AnnotationConfigSummarizationUseCaseRequest:
      properties:
        document_loc:
          $ref: '#/components/schemas/DataLoc'
        summary_loc:
          $ref: '#/components/schemas/DataLoc'
        expected_summary_loc:
          $ref: '#/components/schemas/DataLoc'
        llm_prompt:
          $ref: '#/components/schemas/AutoEvaluationPrompt'
      type: object
      required:
        - document_loc
        - summary_loc
      title: AnnotationConfigSummarizationUseCaseRequest
    AnnotationConfigTranslationUseCaseRequest:
      properties:
        original_text_loc:
          $ref: '#/components/schemas/DataLoc'
        translation_loc:
          $ref: '#/components/schemas/DataLoc'
        language_loc:
          $ref: '#/components/schemas/DataLoc'
        expected_translation_loc:
          $ref: '#/components/schemas/DataLoc'
        llm_prompt:
          $ref: '#/components/schemas/AutoEvaluationPrompt'
      type: object
      required:
        - original_text_loc
        - translation_loc
      title: AnnotationConfigTranslationUseCaseRequest
    AnnotationConfigType:
      type: string
      enum:
        - generation
        - flexible
        - summarization
        - multiturn
        - translation
      title: AnnotationConfigType
    AnnotationItem:
      properties:
        optional:
          type: boolean
          title: Optional
          default: false
        data_loc:
          $ref: '#/components/schemas/DataLoc'
        label:
          title: Label
          type: string
      type: object
      required:
        - data_loc
      title: AnnotationItem
    AnnotationConfigDirectionType:
      type: string
      enum:
        - col
        - row
      title: AnnotationConfigDirectionType
    AutoEvaluationPrompt:
      properties:
        variables:
          items:
            $ref: '#/components/schemas/PromptVariable'
          type: array
          title: Variables
        template:
          type: string
          title: Template
      type: object
      required:
        - variables
        - template
      title: AutoEvaluationPrompt
    MetricItem:
      properties:
        type:
          $ref: '#/components/schemas/MetricScorerType'
        name:
          type: string
          title: Name
        mappings:
          title: Mappings
          additionalProperties:
            $ref: '#/components/schemas/DataLoc'
          type: object
        params:
          title: Params
          additionalProperties: true
          type: object
      type: object
      required:
        - type
        - name
      title: MetricItem
    DataLoc:
      items:
        type: string
      type: array
      title: DataLoc
    PromptVariable:
      properties:
        name:
          type: string
          title: Name
        optional:
          type: boolean
          title: Optional
          default: false
        data_loc:
          $ref: '#/components/schemas/DataLoc'
      type: object
      required:
        - name
        - data_loc
      title: PromptVariable
    MetricScorerType:
      type: string
      enum:
        - rouge
        - rouge1
        - rouge2
        - rougeL
        - bleu
        - meteor
        - cosine_similarity
        - f1
      title: MetricScorerType
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: x-api-key

````