> ## 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 Application Variant

> ### Description
Updates a application variant

### Details
This API can be used to update the application variant 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 Application Variant 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/application-variants/{application_variant_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/application-variants/{application_variant_id}:
    patch:
      tags:
        - Applications
      summary: Update Application Variant
      description: >-
        ### Description

        Updates a application variant


        ### Details

        This API can be used to update the application variant 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 Application Variant API call as
        a path parameter.


        Review the request schema to see the fields that can be updated.
      operationId: PATCH-V4-/application-variants/{application_variant_id}
      parameters:
        - name: application_variant_id
          in: path
          required: true
          schema:
            type: string
            title: Application Variant Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchApplicationVariantRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApplicationVariantResponse'
        '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
            )
            response = client.application_variants.patch(
                application_variant_id="application_variant_id",
            )
            print(response)
        - 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\tresponse, err := client.ApplicationVariants.Patch(\n\t\tcontext.TODO(),\n\t\t\"application_variant_id\",\n\t\tsgp.ApplicationVariantPatchParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response)\n}\n"
components:
  schemas:
    PatchApplicationVariantRequest:
      properties:
        name:
          type: string
          title: Name
        description:
          title: Description
          type: string
        configuration:
          $ref: '#/components/schemas/PatchApplicationVariantConfiguration'
      type: object
      title: PatchApplicationVariantRequest
    ApplicationVariantResponse:
      oneOf:
        - $ref: '#/components/schemas/ApplicationVariantV0Response'
        - $ref: '#/components/schemas/ApplicationVariantAgentsServiceResponse'
        - $ref: '#/components/schemas/OfflineApplicationVariantResponse'
      title: ApplicationVariantResponse
      discriminator:
        propertyName: version
        mapping:
          AGENTS_SERVICE:
            $ref: '#/components/schemas/ApplicationVariantAgentsServiceResponse'
          OFFLINE:
            $ref: '#/components/schemas/OfflineApplicationVariantResponse'
          V0:
            $ref: '#/components/schemas/ApplicationVariantV0Response'
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    PatchApplicationVariantConfiguration:
      properties:
        metadata:
          title: Metadata
          description: The user-defined application variant metadata.
          additionalProperties: true
          type: object
        params:
          title: Params
          description: Configuration sent to agent service.
        raw_configuration:
          title: Raw Configuration
          description: The raw configuration string for the application variant.
          type: string
        type:
          type: string
          enum:
            - WORKFLOW
            - PLAN
            - STATE_MACHINE
          title: Type
      type: object
      title: PatchApplicationVariantConfiguration
    ApplicationVariantV0Response:
      properties:
        id:
          type: string
          title: Id
        name:
          type: string
          title: Name
        description:
          title: Description
          description: Optional description of the application variant
          type: string
        configuration:
          $ref: '#/components/schemas/ApplicationConfigurationV0'
        version:
          type: string
          const: V0
          title: Version
        application_spec_id:
          type: string
          title: Application Spec Id
        draft:
          title: Draft
          description: Boolean to indicate whether the variant is in draft mode
          optional_in_request: true
          type: boolean
        published_at:
          title: Published At
          description: The date and time that the variant was published.
          type: string
          format: date-time
        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.
        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.
      type: object
      required:
        - id
        - name
        - configuration
        - version
        - application_spec_id
        - draft
        - account_id
        - created_at
        - updated_at
      title: ApplicationVariantV0Response
    ApplicationVariantAgentsServiceResponse:
      properties:
        id:
          type: string
          title: Id
        name:
          type: string
          title: Name
        description:
          title: Description
          description: Optional description of the application variant
          type: string
        configuration:
          $ref: '#/components/schemas/ApplicationAgentsServiceConfiguration'
        version:
          type: string
          const: AGENTS_SERVICE
          title: Version
        application_spec_id:
          type: string
          title: Application Spec Id
        draft:
          title: Draft
          description: Boolean to indicate whether the variant is in draft mode
          optional_in_request: true
          type: boolean
        published_at:
          title: Published At
          description: The date and time that the variant was published.
          type: string
          format: date-time
        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.
        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.
      type: object
      required:
        - id
        - name
        - configuration
        - version
        - application_spec_id
        - draft
        - account_id
        - created_at
        - updated_at
      title: ApplicationVariantAgentsServiceResponse
    OfflineApplicationVariantResponse:
      properties:
        id:
          type: string
          title: Id
        name:
          type: string
          title: Name
        description:
          title: Description
          description: Optional description of the application variant
          type: string
        configuration:
          $ref: '#/components/schemas/OfflineApplicationConfiguration'
        version:
          type: string
          const: OFFLINE
          title: Version
        application_spec_id:
          type: string
          title: Application Spec Id
        draft:
          title: Draft
          description: Boolean to indicate whether the variant is in draft mode
          optional_in_request: true
          type: boolean
        published_at:
          title: Published At
          description: The date and time that the variant was published.
          type: string
          format: date-time
        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.
        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.
      type: object
      required:
        - id
        - name
        - configuration
        - version
        - application_spec_id
        - draft
        - account_id
        - created_at
        - updated_at
      title: OfflineApplicationVariantResponse
    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
    ApplicationConfigurationV0:
      properties:
        metadata:
          title: Metadata
          description: User defined metadata about the application
          additionalProperties: true
          type: object
        nodes:
          items:
            $ref: '#/components/schemas/ApplicationNode'
          type: array
          title: Nodes
        edges:
          items:
            $ref: '#/components/schemas/ApplicationEdge'
          type: array
          title: Edges
      type: object
      required:
        - nodes
        - edges
      title: ApplicationConfigurationV0
    IdentifierTypeEnum:
      type: string
      enum:
        - user
        - service_account
      title: IdentifierTypeEnum
    ApplicationAgentsServiceConfiguration:
      properties:
        metadata:
          title: Metadata
          description: User defined metadata about the application
          additionalProperties: true
          type: object
        type:
          type: string
          enum:
            - WORKFLOW
            - PLAN
            - STATE_MACHINE
          title: Type
        params:
          title: Params
        graph:
          $ref: '#/components/schemas/AgentsServiceGraphDescriptor'
          description: The graph of the agents service configuration
        inputs:
          title: Inputs
          description: The starting inputs that this agent configuration expects
          items:
            $ref: '#/components/schemas/ApplicationAgentGraphInput'
          type: array
        inputs_by_node:
          title: Inputs By Node
          description: The inputs that each node expects
          additionalProperties:
            items:
              $ref: '#/components/schemas/ApplicationAgentGraphInput'
            type: array
          type: object
        agent_service_errors:
          title: Agent Service Errors
          description: Errors that occurred when calling agent service
          items:
            type: string
          type: array
        raw_configuration:
          title: Raw Configuration
          description: >-
            Raw configuration entered by the user. May be invalid if variant is
            in draft mode.
          type: string
      type: object
      required:
        - type
        - params
      title: ApplicationAgentsServiceConfiguration
    OfflineApplicationConfiguration:
      properties:
        metadata:
          title: Metadata
          description: User defined metadata about the application
          additionalProperties: true
          type: object
      type: object
      title: OfflineApplicationConfiguration
    ApplicationNode:
      properties:
        id:
          type: string
          title: Id
        application_node_schema_id:
          $ref: '#/components/schemas/NodeSchemaId'
        configuration:
          additionalProperties:
            $ref: '#/components/schemas/ConfigurationFieldValue'
          type: object
          title: Configuration
      type: object
      required:
        - id
        - application_node_schema_id
      title: ApplicationNode
    ApplicationEdge:
      properties:
        from_node:
          type: string
          title: From Node
        to_node:
          type: string
          title: To Node
        from_field:
          type: string
          title: From Field
        to_field:
          type: string
          title: To Field
      type: object
      required:
        - from_node
        - to_node
        - from_field
        - to_field
      title: ApplicationEdge
    AgentsServiceGraphDescriptor:
      properties:
        nodes:
          items:
            $ref: '#/components/schemas/ApplicationAgentGraphNode'
          type: array
          title: Nodes
        edges:
          items:
            $ref: '#/components/schemas/ApplicationAgentGraphEdge'
          type: array
          title: Edges
      type: object
      required:
        - nodes
        - edges
      title: AgentsServiceGraphDescriptor
    ApplicationAgentGraphInput:
      properties:
        name:
          type: string
          title: Name
        required:
          type: boolean
          title: Required
          default: true
        title:
          type: string
          title: Title
        description:
          title: Description
          type: string
        type:
          $ref: '#/components/schemas/AgentUserInputType'
        examples:
          title: Examples
          items:
            type: string
          type: array
        default:
          title: Default
          type: string
        value_constraint:
          $ref: '#/components/schemas/ValueConstraint'
      type: object
      required:
        - name
        - type
      title: ApplicationAgentGraphInput
    NodeSchemaId:
      type: string
      enum:
        - text_input_schema
        - text_output_schema
        - knowledge_base_input_schema
        - knowledge_base_schema
        - multi_knowledge_base_input_schema
        - multi_knowledge_base_schema
        - reranker_schema
        - prompt_engineering_schema
        - completion_model_input_schema
        - completion_model_schema
        - external_endpoint_schema
        - document_input_schema
        - map_reduce_schema
        - document_search_schema
        - document_prompt_schema
      title: NodeSchemaId
    ConfigurationFieldValue:
      properties:
        value:
          title: Value
      type: object
      required:
        - value
      title: ConfigurationFieldValue
    ApplicationAgentGraphNode:
      properties:
        id:
          type: string
          title: Id
        name:
          type: string
          title: Name
        type:
          type: string
          title: Type
        operation_type:
          $ref: '#/components/schemas/ApplicationOperationType'
        config:
          title: Config
          additionalProperties: true
          type: object
        nodes:
          items:
            $ref: '#/components/schemas/ApplicationAgentGraphNode'
          type: array
          title: Nodes
        edges:
          items:
            $ref: '#/components/schemas/ApplicationAgentGraphEdge'
          type: array
          title: Edges
      type: object
      required:
        - id
        - name
        - type
      title: ApplicationAgentGraphNode
    ApplicationAgentGraphEdge:
      properties:
        from_node:
          type: string
          title: From Node
        to_node:
          type: string
          title: To Node
      type: object
      required:
        - from_node
        - to_node
      title: ApplicationAgentGraphEdge
    AgentUserInputType:
      type: string
      enum:
        - ShortText
        - SentenceText
        - ParagraphText
        - ArtifactId
        - ArtifactIds
        - KnowledgeBaseId
        - KnowledgeBaseIds
        - InputImageDir
        - Message
        - Messages
        - integer
        - number
        - string
        - boolean
        - array
        - object
        - unknown
      title: AgentUserInputType
    ValueConstraint:
      properties:
        selection_constraint_type:
          $ref: '#/components/schemas/SelectionConstraintType'
        potential_values:
          items:
            type: string
          type: array
          title: Potential Values
        value_type:
          $ref: '#/components/schemas/AgentUserInputType'
        min_items:
          title: Min Items
          type: integer
        max_items:
          title: Max Items
          type: integer
      type: object
      required:
        - selection_constraint_type
        - potential_values
        - value_type
      title: ValueConstraint
    ApplicationOperationType:
      type: string
      enum:
        - TEXT_INPUT
        - TEXT_OUTPUT
        - COMPLETION_INPUT
        - COMPLETION
        - KB_RETRIEVAL
        - KB_INPUT
        - RERANKING
        - EXTERNAL_ENDPOINT
        - PROMPT_ENGINEERING
        - DOCUMENT_INPUT
        - MAP_REDUCE
        - DOCUMENT_SEARCH
        - DOCUMENT_PROMPT
        - CUSTOM
        - CODE_EXECUTION
        - DATA_MANIPULATION
        - EVALUATION
        - FILE_RETRIEVAL
        - KB_ADD_CHUNK
        - KB_MANAGEMENT
        - GUARDRAIL
        - OUTPUT_GUARDRAIL
        - TRACER
        - AGENT_TRACER
        - AGENT_WORKFLOW
        - STANDALONE
      title: ApplicationOperationType
    SelectionConstraintType:
      type: string
      enum:
        - single
        - multi
      title: SelectionConstraintType
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: x-api-key

````