Agent Control
Create agent optimization
Create a new agent optimization within the given project.
Authorization
ApiKey read, writeAuthorization<token>
In: header
Scope: read, write
Path Parameters
projectKey*string
Request Body
application/json
Agent optimization object to create
key*string
aiConfigKey*string
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
curl -X POST "https://example.com/api/v2/projects/string/agent-optimizations" \ -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, "aiConfigKey": "aiConfigKey", "variableChoices": [ { "key": "" }, { "key": "" } ], "tokenOptimization": true, "tokenLimit": 6, "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 } ] }'{ "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 } ]}