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

# Get Evaluation

> Retrieve an evaluation by ID



## OpenAPI

````yaml get /sdk/v1/evaluations/{id}
openapi: 3.0.0
info:
  title: Prompt Foundry API
  version: 1.0.0
  description: The API for managing prompts, tools, evaluations, and evaluation assertions.
servers:
  - url: https://api.promptfoundry.ai
    description: Prompt Foundry Production API
security: []
paths:
  /sdk/v1/evaluations/{id}:
    get:
      summary: Get Evaluation
      description: Retrieve an evaluation by ID
      operationId: getEvaluation
      parameters:
        - schema:
            type: string
            example: '1212121'
          required: true
          name: id
          in: path
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Evaluation'
        '400':
          description: Missing or invalid parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import PromptFoundry from '@prompt-foundry/typescript-sdk';

            const client = new PromptFoundry({
              apiKey: process.env['PROMPT_FOUNDRY_API_KEY'], // This is the default and can be omitted
            });

            async function main() {
              const evaluation = await client.evaluations.get('1212121');

              console.log(evaluation.id);
            }

            main();
        - lang: Python
          source: |-
            import os
            from prompt_foundry_python_sdk import PromptFoundry

            client = PromptFoundry(
                # This is the default and can be omitted
                api_key=os.environ.get("PROMPT_FOUNDRY_API_KEY"),
            )
            evaluation = client.evaluations.get(
                "1212121",
            )
            print(evaluation.id)
components:
  schemas:
    Evaluation:
      type: object
      properties:
        id:
          type: string
        promptId:
          type: string
        appendedMessages:
          type: array
          items:
            $ref: '#/components/schemas/ConversationMessage'
          description: >-
            The messages to append to the completion messages when running the
            evaluation.
        variables:
          $ref: '#/components/schemas/PromptVariables'
        weight:
          type: number
          minimum: 0
          maximum: 1
          default: 1
          description: How heavily to weigh the evaluation within the prompt.
        threshold:
          type: number
          minimum: 0
          maximum: 1
          default: 1
          description: What percentage of assertions must pass for the evaluation to pass.
      required:
        - id
        - promptId
        - appendedMessages
        - variables
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: 'Example: "Prompt ID is required."'
      required:
        - error
    ConversationMessage:
      type: object
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/MessageContentBlockSchema'
        role:
          $ref: '#/components/schemas/PromptMessageRole'
      required:
        - content
        - role
    PromptVariables:
      type: object
      additionalProperties:
        type: string
        nullable: true
      description: The template variables added to the prompt when executing the prompt.
    MessageContentBlockSchema:
      oneOf:
        - $ref: '#/components/schemas/TextContentBlock'
        - $ref: '#/components/schemas/ImageBase64ContentBlock'
        - $ref: '#/components/schemas/ToolCallContentBlock'
        - $ref: '#/components/schemas/ToolResultContentBlock'
      discriminator:
        propertyName: type
        mapping:
          TEXT: '#/components/schemas/TextContentBlock'
          IMAGE_BASE64: '#/components/schemas/ImageBase64ContentBlock'
          TOOL_CALL: '#/components/schemas/ToolCallContentBlock'
          TOOL_RESULT: '#/components/schemas/ToolResultContentBlock'
    PromptMessageRole:
      type: string
      enum:
        - assistant
        - system
        - tool
        - user
    TextContentBlock:
      type: object
      properties:
        type:
          type: string
          enum:
            - TEXT
        text:
          type: string
      required:
        - type
        - text
      title: TextContentBlock
    ImageBase64ContentBlock:
      type: object
      properties:
        type:
          type: string
          enum:
            - IMAGE_BASE64
        imageBase64:
          type: string
        mediaType:
          type: string
      required:
        - type
        - imageBase64
        - mediaType
      title: ImageBase64ContentBlock
    ToolCallContentBlock:
      type: object
      properties:
        type:
          type: string
          enum:
            - TOOL_CALL
        toolCall:
          $ref: '#/components/schemas/ToolFunctionCall'
      required:
        - type
        - toolCall
      title: ToolCallContentBlock
    ToolResultContentBlock:
      type: object
      properties:
        type:
          type: string
          enum:
            - TOOL_RESULT
        toolCallId:
          type: string
        result:
          type: string
      required:
        - type
        - toolCallId
        - result
      title: ToolResultContentBlock
    ToolFunctionCall:
      type: object
      properties:
        toolCallId:
          type: string
          description: TOOL_CALL_1
        type:
          type: string
          enum:
            - function
          description: The type of the tool. Currently, only `function` is supported.
        function:
          type: object
          properties:
            arguments:
              type: string
              description: >-
                The arguments to call the function with, as generated by the
                model in JSON format. Note that the model does not always
                generate valid JSON, and may hallucinate parameters not defined
                by your function schema. Validate the arguments in your code
                before calling your function.
            name:
              type: string
              description: The name of the function to call.
          required:
            - arguments
            - name
      required:
        - toolCallId
        - type
        - function

````