Update agent config
Edit an existing agent config.
The request body must be a JSON object of the fields to update. The values you include replace the existing values for the fields.
Here’s an example:
Body
Agent config object to update
The success direction of a judge. Offline evaluations use it to decide whether a score passes.
true: A lower score is better. Use this for a judge that scores bad output, such as a toxicity or hallucination judge.false: A higher score is better. Use this for a judge that scores good output, such as an accuracy or relevance judge.
Send this field only when the agent config's mode is judge. If you omit it, the current direction does not change. For a built-in judge key, the API always returns the built-in direction. Built-in judge keys are ld-ai-judge-accuracy, ld-ai-judge-relevance, and ld-ai-judge-toxicity, with or without a -<timestamp> suffix such as ld-ai-judge-accuracy-1760000000000.
The API returns a 400 error in these cases:
isInverted is only supported for judge mode: You send this field and the agent config'smodeisagentorcompletion. Remove the field.isInverted is not supported: Custom judges are not available for your account. Remove the field from the request.
true
The judge's threshold: the pass line for its main score, from 0 to 1. It applies wherever the judge is used. If you omit it, the current threshold does not change. To remove the threshold, send clearDefaultThreshold instead.
The API returns a 400 error in these cases:
Threshold is only supported for judges: You send this field and the agent config'smodeisagentorcompletion.Threshold must be from 0 to 1: The value is below 0 or above 1.Thresholds don't support classifier rules yet: Every active variation of the judge uses classifier rules. Archived variations don't count.Threshold can't be set and cleared in the same request: You send this field andclearDefaultThreshold: true.Threshold is not supported: Thresholds are not available for your account. Remove the field from the request.
0.9
Response
Agent config updated
The success direction of a judge. Offline evaluations use it to decide whether a score passes.
true: A lower score is better. Use this for a judge that scores bad output, such as a toxicity or hallucination judge.false: A higher score is better. Use this for a judge that scores good output, such as an accuracy or relevance judge.
The response includes this field only when mode is judge. For a built-in judge key, the value is always the built-in direction. Built-in judge keys are ld-ai-judge-accuracy, ld-ai-judge-relevance, and ld-ai-judge-toxicity, with or without a -<timestamp> suffix such as ld-ai-judge-accuracy-1760000000000. A custom judge with no stored direction omits this field.
true
The judge's threshold: the pass line for its main score, from 0 to 1. It applies wherever the judge is used. The average score passes when it is at or above this value, or at or below it when isInverted is true.
The response includes this field only when mode is judge and a threshold is set.
0.9