For AI agents: A markdown version of this page is available at https://dnd37xeb23o8n.cloudfront.net/jen.gilbert/astro-base/ja/api/latest/agent-observability/create-or-update-a-custom-evaluator-configuration.md. A documentation index is available at /llms.txt.
Language
Datadog site

Create or update a custom evaluator configuration

警告Note: This endpoint is in preview and is subject to change. If you have any feedback, contact Datadog support.
PUThttps://api.datadoghq.com/api/unstable/llm-obs/config/evaluators/custom/{eval_name}https://api.us3.datadoghq.com/api/unstable/llm-obs/config/evaluators/custom/{eval_name}https://api.us5.datadoghq.com/api/unstable/llm-obs/config/evaluators/custom/{eval_name}https://api.datadoghq.eu/api/unstable/llm-obs/config/evaluators/custom/{eval_name}https://api.ap1.datadoghq.com/api/unstable/llm-obs/config/evaluators/custom/{eval_name}https://api.ap2.datadoghq.com/api/unstable/llm-obs/config/evaluators/custom/{eval_name}https://api.uk1.datadoghq.com/api/unstable/llm-obs/config/evaluators/custom/{eval_name}https://api.ddog-gov.com/api/unstable/llm-obs/config/evaluators/custom/{eval_name}https://api.us2.ddog-gov.com/api/unstable/llm-obs/config/evaluators/custom/{eval_name}

概要

Create or update a custom Agent Observability evaluator configuration by its name.

引数

パスパラメーター

名前
タイプ
説明
eval_name [required]
string

The name of the custom Agent Observability evaluator configuration.

リクエスト

Body Data (required)

Custom evaluator configuration payload.

フィールド
タイプ
説明
data [required]
object

Data object for creating or updating a custom Agent Observability evaluator configuration.

応答

OK

コード例

Create or update a custom evaluator configuration
## default

# Path parameters
export eval_name="my-custom-evaluator"

# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/unstable/llm-obs/config/evaluators/custom/${eval_name}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "llm_judge_config": {
        "inference_params": {
          "max_tokens": 1024,
          "temperature": 0.7
        },
        "parsing_type": "structured_output"
      },
      "llm_provider": {
        "integration_provider": "openai",
        "model_name": "gpt-4o"
      },
      "target": {
        "application_name": "my-llm-app",
        "enabled": true,
        "sampling_percentage": 50
      }
    },
    "id": "my-custom-evaluator",
    "type": "evaluator_config"
  }
}
EOF

## Full example with prompt template, output schema, and assessment criteria

# Path parameters
export eval_name="my-custom-evaluator"

# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/unstable/llm-obs/config/evaluators/custom/${eval_name}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "category": "Custom",
      "eval_name": "my-custom-evaluator",
      "llm_judge_config": {
        "assessment_criteria": {
          "pass_when": false
        },
        "inference_params": {
          "frequency_penalty": 0,
          "max_tokens": 4096,
          "presence_penalty": 0,
          "temperature": 1,
          "top_p": 1
        },
        "output_schema": {
          "name": "boolean_eval",
          "strict": true
        },
        "parsing_type": "structured_output",
        "prompt_template": [
          {
            "content": "You are a judge LLM.",
            "role": "system"
          },
          {
            "content": "{{span_output}}",
            "role": "user"
          }
        ]
      },
      "llm_provider": {
        "integration_account_id": "your-account-uuid",
        "integration_provider": "openai",
        "model_name": "gpt-4o"
      },
      "target": {
        "application_name": "my-llm-app",
        "enabled": true,
        "eval_scope": "span",
        "filter": "@meta.span.kind:llm",
        "root_spans_only": false,
        "sampling_percentage": 100
      }
    },
    "id": "my-custom-evaluator",
    "type": "evaluator_config"
  }
}
EOF
## default

# Path parameters
export eval_name="my-custom-evaluator"

# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/unstable/llm-obs/config/evaluators/custom/${eval_name}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "llm_judge_config": {
        "inference_params": {
          "max_tokens": 1024,
          "temperature": 0.7
        },
        "parsing_type": "structured_output"
      },
      "llm_provider": {
        "integration_provider": "openai",
        "model_name": "gpt-4o"
      },
      "target": {
        "application_name": "my-llm-app",
        "enabled": true,
        "sampling_percentage": 50
      }
    },
    "id": "my-custom-evaluator",
    "type": "evaluator_config"
  }
}
EOF

## Full example with prompt template, output schema, and assessment criteria

# Path parameters
export eval_name="my-custom-evaluator"

# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/unstable/llm-obs/config/evaluators/custom/${eval_name}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "category": "Custom",
      "eval_name": "my-custom-evaluator",
      "llm_judge_config": {
        "assessment_criteria": {
          "pass_when": false
        },
        "inference_params": {
          "frequency_penalty": 0,
          "max_tokens": 4096,
          "presence_penalty": 0,
          "temperature": 1,
          "top_p": 1
        },
        "output_schema": {
          "name": "boolean_eval",
          "strict": true
        },
        "parsing_type": "structured_output",
        "prompt_template": [
          {
            "content": "You are a judge LLM.",
            "role": "system"
          },
          {
            "content": "{{span_output}}",
            "role": "user"
          }
        ]
      },
      "llm_provider": {
        "integration_account_id": "your-account-uuid",
        "integration_provider": "openai",
        "model_name": "gpt-4o"
      },
      "target": {
        "application_name": "my-llm-app",
        "enabled": true,
        "eval_scope": "span",
        "filter": "@meta.span.kind:llm",
        "root_spans_only": false,
        "sampling_percentage": 100
      }
    },
    "id": "my-custom-evaluator",
    "type": "evaluator_config"
  }
}
EOF
## default

# Path parameters
export eval_name="my-custom-evaluator"

# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/unstable/llm-obs/config/evaluators/custom/${eval_name}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "llm_judge_config": {
        "inference_params": {
          "max_tokens": 1024,
          "temperature": 0.7
        },
        "parsing_type": "structured_output"
      },
      "llm_provider": {
        "integration_provider": "openai",
        "model_name": "gpt-4o"
      },
      "target": {
        "application_name": "my-llm-app",
        "enabled": true,
        "sampling_percentage": 50
      }
    },
    "id": "my-custom-evaluator",
    "type": "evaluator_config"
  }
}
EOF

## Full example with prompt template, output schema, and assessment criteria

# Path parameters
export eval_name="my-custom-evaluator"

# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/unstable/llm-obs/config/evaluators/custom/${eval_name}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "category": "Custom",
      "eval_name": "my-custom-evaluator",
      "llm_judge_config": {
        "assessment_criteria": {
          "pass_when": false
        },
        "inference_params": {
          "frequency_penalty": 0,
          "max_tokens": 4096,
          "presence_penalty": 0,
          "temperature": 1,
          "top_p": 1
        },
        "output_schema": {
          "name": "boolean_eval",
          "strict": true
        },
        "parsing_type": "structured_output",
        "prompt_template": [
          {
            "content": "You are a judge LLM.",
            "role": "system"
          },
          {
            "content": "{{span_output}}",
            "role": "user"
          }
        ]
      },
      "llm_provider": {
        "integration_account_id": "your-account-uuid",
        "integration_provider": "openai",
        "model_name": "gpt-4o"
      },
      "target": {
        "application_name": "my-llm-app",
        "enabled": true,
        "eval_scope": "span",
        "filter": "@meta.span.kind:llm",
        "root_spans_only": false,
        "sampling_percentage": 100
      }
    },
    "id": "my-custom-evaluator",
    "type": "evaluator_config"
  }
}
EOF
## default

# Path parameters
export eval_name="my-custom-evaluator"

# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/unstable/llm-obs/config/evaluators/custom/${eval_name}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "llm_judge_config": {
        "inference_params": {
          "max_tokens": 1024,
          "temperature": 0.7
        },
        "parsing_type": "structured_output"
      },
      "llm_provider": {
        "integration_provider": "openai",
        "model_name": "gpt-4o"
      },
      "target": {
        "application_name": "my-llm-app",
        "enabled": true,
        "sampling_percentage": 50
      }
    },
    "id": "my-custom-evaluator",
    "type": "evaluator_config"
  }
}
EOF

## Full example with prompt template, output schema, and assessment criteria

# Path parameters
export eval_name="my-custom-evaluator"

# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/unstable/llm-obs/config/evaluators/custom/${eval_name}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "category": "Custom",
      "eval_name": "my-custom-evaluator",
      "llm_judge_config": {
        "assessment_criteria": {
          "pass_when": false
        },
        "inference_params": {
          "frequency_penalty": 0,
          "max_tokens": 4096,
          "presence_penalty": 0,
          "temperature": 1,
          "top_p": 1
        },
        "output_schema": {
          "name": "boolean_eval",
          "strict": true
        },
        "parsing_type": "structured_output",
        "prompt_template": [
          {
            "content": "You are a judge LLM.",
            "role": "system"
          },
          {
            "content": "{{span_output}}",
            "role": "user"
          }
        ]
      },
      "llm_provider": {
        "integration_account_id": "your-account-uuid",
        "integration_provider": "openai",
        "model_name": "gpt-4o"
      },
      "target": {
        "application_name": "my-llm-app",
        "enabled": true,
        "eval_scope": "span",
        "filter": "@meta.span.kind:llm",
        "root_spans_only": false,
        "sampling_percentage": 100
      }
    },
    "id": "my-custom-evaluator",
    "type": "evaluator_config"
  }
}
EOF
## default

# Path parameters
export eval_name="my-custom-evaluator"

# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/unstable/llm-obs/config/evaluators/custom/${eval_name}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "llm_judge_config": {
        "inference_params": {
          "max_tokens": 1024,
          "temperature": 0.7
        },
        "parsing_type": "structured_output"
      },
      "llm_provider": {
        "integration_provider": "openai",
        "model_name": "gpt-4o"
      },
      "target": {
        "application_name": "my-llm-app",
        "enabled": true,
        "sampling_percentage": 50
      }
    },
    "id": "my-custom-evaluator",
    "type": "evaluator_config"
  }
}
EOF

## Full example with prompt template, output schema, and assessment criteria

# Path parameters
export eval_name="my-custom-evaluator"

# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/unstable/llm-obs/config/evaluators/custom/${eval_name}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "category": "Custom",
      "eval_name": "my-custom-evaluator",
      "llm_judge_config": {
        "assessment_criteria": {
          "pass_when": false
        },
        "inference_params": {
          "frequency_penalty": 0,
          "max_tokens": 4096,
          "presence_penalty": 0,
          "temperature": 1,
          "top_p": 1
        },
        "output_schema": {
          "name": "boolean_eval",
          "strict": true
        },
        "parsing_type": "structured_output",
        "prompt_template": [
          {
            "content": "You are a judge LLM.",
            "role": "system"
          },
          {
            "content": "{{span_output}}",
            "role": "user"
          }
        ]
      },
      "llm_provider": {
        "integration_account_id": "your-account-uuid",
        "integration_provider": "openai",
        "model_name": "gpt-4o"
      },
      "target": {
        "application_name": "my-llm-app",
        "enabled": true,
        "eval_scope": "span",
        "filter": "@meta.span.kind:llm",
        "root_spans_only": false,
        "sampling_percentage": 100
      }
    },
    "id": "my-custom-evaluator",
    "type": "evaluator_config"
  }
}
EOF
## default

# Path parameters
export eval_name="my-custom-evaluator"

# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/unstable/llm-obs/config/evaluators/custom/${eval_name}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "llm_judge_config": {
        "inference_params": {
          "max_tokens": 1024,
          "temperature": 0.7
        },
        "parsing_type": "structured_output"
      },
      "llm_provider": {
        "integration_provider": "openai",
        "model_name": "gpt-4o"
      },
      "target": {
        "application_name": "my-llm-app",
        "enabled": true,
        "sampling_percentage": 50
      }
    },
    "id": "my-custom-evaluator",
    "type": "evaluator_config"
  }
}
EOF

## Full example with prompt template, output schema, and assessment criteria

# Path parameters
export eval_name="my-custom-evaluator"

# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/unstable/llm-obs/config/evaluators/custom/${eval_name}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "category": "Custom",
      "eval_name": "my-custom-evaluator",
      "llm_judge_config": {
        "assessment_criteria": {
          "pass_when": false
        },
        "inference_params": {
          "frequency_penalty": 0,
          "max_tokens": 4096,
          "presence_penalty": 0,
          "temperature": 1,
          "top_p": 1
        },
        "output_schema": {
          "name": "boolean_eval",
          "strict": true
        },
        "parsing_type": "structured_output",
        "prompt_template": [
          {
            "content": "You are a judge LLM.",
            "role": "system"
          },
          {
            "content": "{{span_output}}",
            "role": "user"
          }
        ]
      },
      "llm_provider": {
        "integration_account_id": "your-account-uuid",
        "integration_provider": "openai",
        "model_name": "gpt-4o"
      },
      "target": {
        "application_name": "my-llm-app",
        "enabled": true,
        "eval_scope": "span",
        "filter": "@meta.span.kind:llm",
        "root_spans_only": false,
        "sampling_percentage": 100
      }
    },
    "id": "my-custom-evaluator",
    "type": "evaluator_config"
  }
}
EOF
## default

# Path parameters
export eval_name="my-custom-evaluator"

# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/unstable/llm-obs/config/evaluators/custom/${eval_name}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "llm_judge_config": {
        "inference_params": {
          "max_tokens": 1024,
          "temperature": 0.7
        },
        "parsing_type": "structured_output"
      },
      "llm_provider": {
        "integration_provider": "openai",
        "model_name": "gpt-4o"
      },
      "target": {
        "application_name": "my-llm-app",
        "enabled": true,
        "sampling_percentage": 50
      }
    },
    "id": "my-custom-evaluator",
    "type": "evaluator_config"
  }
}
EOF

## Full example with prompt template, output schema, and assessment criteria

# Path parameters
export eval_name="my-custom-evaluator"

# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/unstable/llm-obs/config/evaluators/custom/${eval_name}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "category": "Custom",
      "eval_name": "my-custom-evaluator",
      "llm_judge_config": {
        "assessment_criteria": {
          "pass_when": false
        },
        "inference_params": {
          "frequency_penalty": 0,
          "max_tokens": 4096,
          "presence_penalty": 0,
          "temperature": 1,
          "top_p": 1
        },
        "output_schema": {
          "name": "boolean_eval",
          "strict": true
        },
        "parsing_type": "structured_output",
        "prompt_template": [
          {
            "content": "You are a judge LLM.",
            "role": "system"
          },
          {
            "content": "{{span_output}}",
            "role": "user"
          }
        ]
      },
      "llm_provider": {
        "integration_account_id": "your-account-uuid",
        "integration_provider": "openai",
        "model_name": "gpt-4o"
      },
      "target": {
        "application_name": "my-llm-app",
        "enabled": true,
        "eval_scope": "span",
        "filter": "@meta.span.kind:llm",
        "root_spans_only": false,
        "sampling_percentage": 100
      }
    },
    "id": "my-custom-evaluator",
    "type": "evaluator_config"
  }
}
EOF
## default

# Path parameters
export eval_name="my-custom-evaluator"

# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/unstable/llm-obs/config/evaluators/custom/${eval_name}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "llm_judge_config": {
        "inference_params": {
          "max_tokens": 1024,
          "temperature": 0.7
        },
        "parsing_type": "structured_output"
      },
      "llm_provider": {
        "integration_provider": "openai",
        "model_name": "gpt-4o"
      },
      "target": {
        "application_name": "my-llm-app",
        "enabled": true,
        "sampling_percentage": 50
      }
    },
    "id": "my-custom-evaluator",
    "type": "evaluator_config"
  }
}
EOF

## Full example with prompt template, output schema, and assessment criteria

# Path parameters
export eval_name="my-custom-evaluator"

# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/unstable/llm-obs/config/evaluators/custom/${eval_name}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "category": "Custom",
      "eval_name": "my-custom-evaluator",
      "llm_judge_config": {
        "assessment_criteria": {
          "pass_when": false
        },
        "inference_params": {
          "frequency_penalty": 0,
          "max_tokens": 4096,
          "presence_penalty": 0,
          "temperature": 1,
          "top_p": 1
        },
        "output_schema": {
          "name": "boolean_eval",
          "strict": true
        },
        "parsing_type": "structured_output",
        "prompt_template": [
          {
            "content": "You are a judge LLM.",
            "role": "system"
          },
          {
            "content": "{{span_output}}",
            "role": "user"
          }
        ]
      },
      "llm_provider": {
        "integration_account_id": "your-account-uuid",
        "integration_provider": "openai",
        "model_name": "gpt-4o"
      },
      "target": {
        "application_name": "my-llm-app",
        "enabled": true,
        "eval_scope": "span",
        "filter": "@meta.span.kind:llm",
        "root_spans_only": false,
        "sampling_percentage": 100
      }
    },
    "id": "my-custom-evaluator",
    "type": "evaluator_config"
  }
}
EOF
## default

# Path parameters
export eval_name="my-custom-evaluator"

# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/unstable/llm-obs/config/evaluators/custom/${eval_name}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "llm_judge_config": {
        "inference_params": {
          "max_tokens": 1024,
          "temperature": 0.7
        },
        "parsing_type": "structured_output"
      },
      "llm_provider": {
        "integration_provider": "openai",
        "model_name": "gpt-4o"
      },
      "target": {
        "application_name": "my-llm-app",
        "enabled": true,
        "sampling_percentage": 50
      }
    },
    "id": "my-custom-evaluator",
    "type": "evaluator_config"
  }
}
EOF

## Full example with prompt template, output schema, and assessment criteria

# Path parameters
export eval_name="my-custom-evaluator"

# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/unstable/llm-obs/config/evaluators/custom/${eval_name}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "category": "Custom",
      "eval_name": "my-custom-evaluator",
      "llm_judge_config": {
        "assessment_criteria": {
          "pass_when": false
        },
        "inference_params": {
          "frequency_penalty": 0,
          "max_tokens": 4096,
          "presence_penalty": 0,
          "temperature": 1,
          "top_p": 1
        },
        "output_schema": {
          "name": "boolean_eval",
          "strict": true
        },
        "parsing_type": "structured_output",
        "prompt_template": [
          {
            "content": "You are a judge LLM.",
            "role": "system"
          },
          {
            "content": "{{span_output}}",
            "role": "user"
          }
        ]
      },
      "llm_provider": {
        "integration_account_id": "your-account-uuid",
        "integration_provider": "openai",
        "model_name": "gpt-4o"
      },
      "target": {
        "application_name": "my-llm-app",
        "enabled": true,
        "eval_scope": "span",
        "filter": "@meta.span.kind:llm",
        "root_spans_only": false,
        "sampling_percentage": 100
      }
    },
    "id": "my-custom-evaluator",
    "type": "evaluator_config"
  }
}
EOF