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

# Batch Create Application Test Case Outputs

> ### Description
Creates a batch of application test case outputs

### Details
This API can be used to create multiple application test case outputs so users do not have to the incur the cost of repeated network calls. To use this API, pass in a list of application test case outputs in the request body.



## OpenAPI

````yaml https://app.stainlessapi.com/api/spec/documented/sgp/openapi.yml post /v4/application-test-case-outputs/batch
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-test-case-outputs/batch:
    post:
      tags:
        - Applications
      summary: Batch Create Application Test Case Outputs
      description: >-
        ### Description

        Creates a batch of application test case outputs


        ### Details

        This API can be used to create multiple application test case outputs so
        users do not have to the incur the cost of repeated network calls. To
        use this API, pass in a list of application test case outputs in the
        request body.
      operationId: POST-V4-/application-test-case-outputs/batch
      requestBody:
        content:
          application/json:
            schema:
              items:
                $ref: '#/components/schemas/ApplicationTestCaseOutputRequest'
              type: array
              title: Request
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/ApplicationTestCaseOutputResponse'
                type: array
                title: Response Post-V4-/Application-Test-Case-Outputs/Batch
        '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
            )
            page = client.application_test_case_outputs.batch(
                items=[{
                    "account_id": "account_id",
                    "application_variant_id": "application_variant_id",
                    "evaluation_dataset_version_num": 0,
                    "output": {
                        "generation_output": "generation_output"
                    },
                    "test_case_id": "test_case_id",
                }],
            )
            page = page.items[0]
            print(page)
        - 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\t\"github.com/stainless-sdks/sgp-go/shared\"\n)\n\nfunc main() {\n\tclient := sgp.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpage, err := client.ApplicationTestCaseOutputs.Batch(context.TODO(), sgp.ApplicationTestCaseOutputBatchParams{\n\t\tItems: []sgp.ApplicationTestCaseOutputBatchParamsItem{{\n\t\t\tAccountID:                   sgp.F(\"account_id\"),\n\t\t\tApplicationVariantID:        sgp.F(\"application_variant_id\"),\n\t\t\tEvaluationDatasetVersionNum: sgp.F(int64(0)),\n\t\t\tOutput: sgp.F[sgp.ApplicationTestCaseOutputBatchParamsItemsOutputUnion](shared.ResultSchemaGenerationParam{\n\t\t\t\tGenerationOutput: sgp.F(\"generation_output\"),\n\t\t\t}),\n\t\t\tTestCaseID: sgp.F(\"test_case_id\"),\n\t\t}},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", page)\n}\n"
components:
  schemas:
    ApplicationTestCaseOutputRequest:
      properties:
        application_variant_id:
          type: string
          title: Application Variant Id
        test_case_id:
          type: string
          title: Test Case Id
        output:
          anyOf:
            - $ref: '#/components/schemas/ResultSchemaGeneration'
            - $ref: '#/components/schemas/ResultSchemaFlexible'
          title: Output
        account_id:
          type: string
          title: Account Id
        evaluation_dataset_version_num:
          type: integer
          title: Evaluation Dataset Version Num
        trace_spans:
          title: Trace Spans
          description: >-
            List of trace spans associated with the application's execution.
            These spans provide insight into the individual steps taken by nodes
            involved in generating the output.
          items:
            $ref: '#/components/schemas/EvaluationTraceSpanRequest'
          type: array
        metrics:
          title: Metrics
          additionalProperties:
            anyOf:
              - type: integer
              - type: number
          propertyNames:
            maxLength: 128
            minLength: 1
          type: object
        ignore_missing:
          title: Ignore Missing
          description: >-
            If set to true, the output batch will be saved even if there are
            missing outputs for some test cases.
          type: boolean
      type: object
      required:
        - application_variant_id
        - test_case_id
        - output
        - account_id
        - evaluation_dataset_version_num
      title: ApplicationTestCaseOutputRequest
    ApplicationTestCaseOutputResponse:
      oneOf:
        - $ref: '#/components/schemas/ApplicationTestCaseGenerationOutputResponse'
        - $ref: '#/components/schemas/ApplicationTestCaseFlexibleOutputResponse'
      title: ApplicationTestCaseOutputResponse
      discriminator:
        propertyName: schema_type
        mapping:
          FLEXIBLE:
            $ref: '#/components/schemas/ApplicationTestCaseFlexibleOutputResponse'
          GENERATION:
            $ref: '#/components/schemas/ApplicationTestCaseGenerationOutputResponse'
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ResultSchemaGeneration:
      properties:
        generation_output:
          type: string
          title: Generation Output
        generation_extra_info:
          $ref: '#/components/schemas/ExtraInfoSchema'
      type: object
      required:
        - generation_output
      title: ResultSchemaGeneration
    ResultSchemaFlexible:
      properties:
        generation_output:
          anyOf:
            - type: string
            - additionalProperties:
                anyOf:
                  - type: string
                  - type: integer
                  - type: number
                  - items:
                      $ref: '#/components/schemas/FlexibleIOChunk'
                    type: array
                  - items:
                      $ref: '#/components/schemas/ChatMessageV2'
                    type: array
                  - items: {}
                    type: array
                  - additionalProperties: true
                    type: object
                  - $ref: '#/components/schemas/FileIODataType'
                  - type: 'null'
              type: object
          title: Generation Output
        generation_extra_info:
          $ref: '#/components/schemas/ExtraInfoSchema'
      type: object
      required:
        - generation_output
      title: ResultSchemaFlexible
    EvaluationTraceSpanRequest:
      properties:
        node_id:
          type: string
          title: Node Id
          description: Identifier for the node that emitted this trace span.
        operation_type:
          $ref: '#/components/schemas/OperationType'
          description: Type of the operation, e.g., RERANKING.
          default: CUSTOM
        operation_status:
          $ref: '#/components/schemas/OperationStatus'
          description: The outcome of the operation performed by this node.
          default: SUCCESS
        start_timestamp:
          type: string
          format: date-time
          title: Start Timestamp
          description: The start time of the step.
        end_timestamp:
          title: End Timestamp
          description: The end time of the step.
          type: string
          format: date-time
        operation_input:
          $ref: '#/components/schemas/EvaluationSpanIOData'
          description: The JSON representation of the input that this step received.
        operation_output:
          $ref: '#/components/schemas/EvaluationSpanIOData'
          description: The JSON representation of the output that this step emitted.
        operation_metadata:
          additionalProperties: true
          type: object
          title: Operation Metadata
          description: >-
            The JSON representation of the metadata insights emitted during
            execution. This can differ based on different types of operations.
          default: {}
        duration_ms:
          type: integer
          title: Duration Ms
          description: The duration of the operation step in milliseconds.
          default: 0
        account_id:
          title: Account Id
          description: The ID of the account that owns this trace span.
          type: string
        operation_expected:
          $ref: '#/components/schemas/EvaluationSpanIOData'
          description: The JSON representation of the expected output for this step
      type: object
      required:
        - node_id
        - start_timestamp
        - operation_input
        - operation_output
      title: EvaluationTraceSpanRequest
    ApplicationTestCaseGenerationOutputResponse:
      properties:
        application_variant_id:
          type: string
          title: Application Variant Id
        evaluation_dataset_id:
          type: string
          title: Evaluation Dataset Id
        test_case_id:
          type: string
          title: Test Case Id
        output:
          $ref: '#/components/schemas/ResultSchemaGeneration'
        schema_type:
          type: string
          const: GENERATION
          title: Schema Type
          default: GENERATION
        application_interaction_id:
          title: Application Interaction Id
          type: string
        application_test_case_output_group_id:
          title: Application Test Case Output Group Id
          type: string
        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
        metrics:
          title: Metrics
          additionalProperties:
            anyOf:
              - type: integer
              - type: number
          propertyNames:
            maxLength: 128
            minLength: 1
          type: object
      type: object
      required:
        - application_variant_id
        - evaluation_dataset_id
        - test_case_id
        - output
        - id
        - created_at
        - account_id
      title: ApplicationTestCaseGenerationOutputResponse
    ApplicationTestCaseFlexibleOutputResponse:
      properties:
        application_variant_id:
          type: string
          title: Application Variant Id
        evaluation_dataset_id:
          type: string
          title: Evaluation Dataset Id
        test_case_id:
          type: string
          title: Test Case Id
        output:
          $ref: '#/components/schemas/ResultSchemaFlexible'
        schema_type:
          type: string
          const: FLEXIBLE
          title: Schema Type
          default: FLEXIBLE
        application_interaction_id:
          title: Application Interaction Id
          type: string
        application_test_case_output_group_id:
          title: Application Test Case Output Group Id
          type: string
        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
        metrics:
          title: Metrics
          additionalProperties:
            anyOf:
              - type: integer
              - type: number
          propertyNames:
            maxLength: 128
            minLength: 1
          type: object
      type: object
      required:
        - application_variant_id
        - evaluation_dataset_id
        - test_case_id
        - output
        - id
        - created_at
        - account_id
      title: ApplicationTestCaseFlexibleOutputResponse
    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'
    FlexibleIOChunk:
      properties:
        text:
          type: string
          title: Text
        metadata:
          title: Metadata
          additionalProperties: true
          type: object
      type: object
      required:
        - text
      title: FlexibleIOChunk
    ChatMessageV2:
      oneOf:
        - $ref: '#/components/schemas/UserMessage'
        - $ref: '#/components/schemas/AssistantMessage'
        - $ref: '#/components/schemas/SystemMessage'
      title: ChatMessageV2
      discriminator:
        propertyName: role
        mapping:
          assistant:
            $ref: '#/components/schemas/AssistantMessage'
          system:
            $ref: '#/components/schemas/SystemMessage'
          user:
            $ref: '#/components/schemas/UserMessage'
    FileIODataType:
      anyOf:
        - $ref: '#/components/schemas/ExternalFile'
        - $ref: '#/components/schemas/InternalFile'
      title: FileIODataType
    OperationType:
      type: string
      enum:
        - COMPLETION
        - RERANKING
        - RETRIEVAL
        - CUSTOM
      title: OperationType
      description: Enum representing the type of operation performed.
    OperationStatus:
      type: string
      enum:
        - SUCCESS
        - ERROR
      title: OperationStatus
      description: Enum representing the status of an operation.
    EvaluationSpanIOData:
      additionalProperties:
        anyOf:
          - type: string
          - type: integer
          - type: number
          - items:
              $ref: '#/components/schemas/FlexibleIOChunk'
            type: array
          - items:
              $ref: '#/components/schemas/ChatMessageV2'
            type: array
          - items: {}
            type: array
          - additionalProperties: true
            type: object
          - $ref: '#/components/schemas/FileIODataType'
          - type: 'null'
      type: object
      title: EvaluationSpanIOData
    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
    UserMessage:
      properties:
        role:
          type: string
          const: user
          title: Role
          description: >-
            The role of the message. Must be set to 'user'.


            A user message is a message from the user to the AI. This should be
            the message used to send end user input to the AI.
          default: user
        content:
          anyOf:
            - type: string
            - items:
                $ref: '#/components/schemas/UserMessageContentParts'
              type: array
          title: Content
          description: >-
            Input from the user. Can either be text or a list of content parts.
            Not all models support image content parts, or multiple parts.
      type: object
      required:
        - content
      title: User Message
    AssistantMessage:
      properties:
        role:
          type: string
          const: assistant
          title: Role
          description: >-
            The role of the message. Must be set to 'assistant'.


            An assistant message is a message from the AI to the client. It is
            different from an agent message in that it cannot contain a tool
            request. It is simply a direct response from the AI to the client.
          default: assistant
        content:
          type: string
          title: Content
          description: Text response from the assistant
      type: object
      required:
        - content
      title: Assistant Message
    SystemMessage:
      properties:
        role:
          type: string
          const: system
          title: Role
          description: >-
            The role of the message. Must be set to 'system'.


            A system message is different from other messages in that it does
            not originate from a party engaged in a user/AI conversation.
            Instead, it is a message that is injected by either the application
            or system to guide the conversation. For example, a system message
            may be used as initial instructions for an AI entity or to tell the
            AI that it did not do something correctly.
          default: system
        content:
          type: string
          title: Content
          description: Text input from the system.
      type: object
      required:
        - content
      title: System Message
    ExternalFile:
      properties:
        uri:
          type: string
          title: Uri
        file_type:
          type: string
          enum:
            - image
            - pdf
          title: File Type
      type: object
      required:
        - uri
        - file_type
      title: ExternalFile
    InternalFile:
      properties:
        file_id:
          type: string
          title: File Id
        file_type:
          type: string
          enum:
            - image
            - pdf
          title: File Type
      type: object
      required:
        - file_id
        - file_type
      title: InternalFile
    ChunkData:
      properties:
        text:
          type: string
          title: Text
        metadata:
          title: Metadata
          additionalProperties: true
          type: object
      type: object
      required:
        - text
      title: ChunkData
    UserMessageContentParts:
      oneOf:
        - $ref: '#/components/schemas/TextUserMessageContentParts'
        - $ref: '#/components/schemas/ImageUrlUserMessageContentParts'
        - $ref: '#/components/schemas/ImageDataUserMessageContentParts'
      title: UserMessageContentParts
      discriminator:
        propertyName: type
        mapping:
          image_data:
            $ref: '#/components/schemas/ImageDataUserMessageContentParts'
          image_url:
            $ref: '#/components/schemas/ImageUrlUserMessageContentParts'
          text:
            $ref: '#/components/schemas/TextUserMessageContentParts'
    TextUserMessageContentParts:
      properties:
        type:
          type: string
          const: text
          title: Type
          default: text
        text:
          type: string
          title: Text
      type: object
      required:
        - text
      title: TextUserMessageContentParts
    ImageUrlUserMessageContentParts:
      properties:
        type:
          type: string
          const: image_url
          title: Type
          default: image_url
        image_url:
          $ref: '#/components/schemas/ImageUrlSubPart'
          description: >-
            Specifies the image URL and level of detail. Only supported by
            OpenAI models
      type: object
      required:
        - image_url
      title: ImageUrlUserMessageContentParts
    ImageDataUserMessageContentParts:
      properties:
        type:
          type: string
          const: image_data
          title: Type
          default: image_data
        image_data:
          $ref: '#/components/schemas/ImageDataSubPart'
          description: Specifies inline image data
      type: object
      required:
        - image_data
      title: ImageDataUserMessageContentParts
    ImageUrlSubPart:
      properties:
        url:
          type: string
          title: Url
          description: 'The URL of the image. Note: only OpenAI supports this.'
        detail:
          title: Detail
          description: >-
            Only used for OpenAI. Corresponds to OpenAI's image detail
            parameter.
          type: string
          enum:
            - low
            - high
            - auto
      type: object
      required:
        - url
      title: ImageUrlSubPart
    ImageDataSubPart:
      properties:
        type:
          type: string
          const: base64
          title: Type
          description: The type of the image data. Only base64 is supported.
          default: base64
        media_type:
          type: string
          title: Media Type
          description: >-
            The media/mime type of the image data. For example, 'image/png'.
            Check providers' documentation for supported media types.
        data:
          type: string
          title: Data
          description: The base64-encoded image data.
        detail:
          title: Detail
          description: >-
            Only used for OpenAI. Corresponds to OpenAI's image detail
            parameter.
          type: string
          enum:
            - low
            - high
            - auto
      type: object
      required:
        - media_type
        - data
      title: ImageDataSubPart

````