Agent Control

Update an agent optimization

PATCH
/api/v2/projects/{projectKey}/agent-optimizations/{optimizationKey}

Update an existing agent optimization. Creates a new version of the optimization.

Authorization

ApiKey read, write
Authorization<token>

In: header

Scope: read, write

Path Parameters

projectKey*string
optimizationKey*string

Request Body

application/json

Agent optimization fields to update

maxAttempts?integer
modelChoices?array<string>
judgeModel?string
variableChoices?array<>
acceptanceStatements?array<>
judges?array<>
userInputOptions?array<string>
groundTruthResponses?array<string>
metricKey?string
tokenLimit?integer
variationKey?string
label?string
latencyOptimization?boolean
tokenOptimization?boolean
autoCommit?boolean

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X PATCH "https://example.com/api/v2/projects/string/agent-optimizations/string" \  -H "Content-Type: application/json" \  -d '{    "latencyOptimization": true,    "judgeModel": "judgeModel",    "metricKey": "metricKey",    "groundTruthResponses": [      "groundTruthResponses",      "groundTruthResponses"    ],    "modelChoices": [      "modelChoices",      "modelChoices"    ],    "label": "label",    "userInputOptions": [      "userInputOptions",      "userInputOptions"    ],    "maxAttempts": 0,    "variableChoices": [      {        "key": ""      },      {        "key": ""      }    ],    "tokenOptimization": true,    "tokenLimit": 6,    "variationKey": "variationKey",    "autoCommit": true,    "judges": [      {        "threshold": 1.4658129805029452,        "key": "key"      },      {        "threshold": 1.4658129805029452,        "key": "key"      }    ],    "acceptanceStatements": [      {        "statement": "statement",        "threshold": 6.027456183070403      },      {        "statement": "statement",        "threshold": 6.027456183070403      }    ]  }'
{  "latencyOptimization": true,  "judgeModel": "judgeModel",  "metricKey": "metricKey",  "_links": {    "parent": {      "href": "href",      "type": "type"    },    "self": {      "href": "href",      "type": "type"    }  },  "groundTruthResponses": [    "groundTruthResponses",    "groundTruthResponses"  ],  "modelChoices": [    "modelChoices",    "modelChoices"  ],  "label": "label",  "version": 5,  "userInputOptions": [    "userInputOptions",    "userInputOptions"  ],  "maxAttempts": 0,  "createdAt": 2,  "aiConfigKey": "aiConfigKey",  "_access": {    "allowed": [      {        "reason": {          "role_name": "role_name",          "notActions": [            null,            null          ],          "notResources": [            "notResources",            "notResources"          ],          "effect": "allow",          "resources": [            "proj/*:env/*;qa_*:/flag/*"          ],          "actions": [            "*"          ]        },        "action": "action"      },      {        "reason": {          "role_name": "role_name",          "notActions": [            null,            null          ],          "notResources": [            "notResources",            "notResources"          ],          "effect": "allow",          "resources": [            "proj/*:env/*;qa_*:/flag/*"          ],          "actions": [            "*"          ]        },        "action": "action"      }    ],    "denied": [      {        "reason": {          "role_name": "role_name",          "notActions": [            null,            null          ],          "notResources": [            "notResources",            "notResources"          ],          "effect": "allow",          "resources": [            "proj/*:env/*;qa_*:/flag/*"          ],          "actions": [            "*"          ]        },        "action": "action"      },      {        "reason": {          "role_name": "role_name",          "notActions": [            null,            null          ],          "notResources": [            "notResources",            "notResources"          ],          "effect": "allow",          "resources": [            "proj/*:env/*;qa_*:/flag/*"          ],          "actions": [            "*"          ]        },        "action": "action"      }    ]  },  "variableChoices": [    {      "key": ""    },    {      "key": ""    }  ],  "tokenOptimization": true,  "tokenLimit": 5,  "id": "id",  "variationKey": "variationKey",  "autoCommit": true,  "judges": [    {      "threshold": 1.4658129805029452,      "key": "key"    },    {      "threshold": 1.4658129805029452,      "key": "key"    }  ],  "key": "key",  "acceptanceStatements": [    {      "statement": "statement",      "threshold": 6.027456183070403    },    {      "statement": "statement",      "threshold": 6.027456183070403    }  ]}