Compare versions

SDK platic.agents.versions.compare()

Review what would change before publishing. Send one version in versionId and the other in with; the response shows each changed section with its previous and new contents.

Example

await platic.agents.versions.compare("agent_123", "v3", "v5");

Path parameters

ParameterTypeDescriptionRequired
agentIdstringAgent id✓
versionIdstringOne version, for example v3. It is the "before" of the comparison✓

Query parameters

ParameterTypeDescriptionRequired
withstringThe other version, for example v5. It is the "after"✓

Response

{
  "status": "success",
  "data": {
    "from": "v3",
    "to": "v5",
    "sections": [
      {
        "section": "instructions",
        "before": "You are the sales assistant for Acme Store.",
        "after": "You are the sales assistant for Acme Store. Answer in under 80 words."
      },
      {
        "section": "followUp",
        "before": {
          "enabled": false,
          "delayMinutes": 60,
          "maxConsecutiveMessages": 1,
          "messageType": "automatic",
          "customMessage": "",
          "customInstructions": ""
        },
        "after": {
          "enabled": true,
          "delayMinutes": 30,
          "maxConsecutiveMessages": 1,
          "messageType": "automatic",
          "customMessage": "",
          "customInstructions": ""
        }
      }
    ]
  }
}
FieldDescription
fromThe version in the path
toThe version in with
sectionsOne entry per section that differs. Empty if the two versions are the same
sections[].sectionName of the section
sections[].beforeThe complete section in from, in its shape: a text (instructions, model), a boolean (memory), an object (guardrails) or a list (subagents)
sections[].afterThe complete section in to, with the same shape

Errors

Statusdetails.codeWhen
400INVALID_REQUESTwith is missing
404AGENT_NOT_FOUNDThe agent doesn't exist in the workspace or was deleted
404VERSION_NOT_FOUNDOne of the two versions doesn't exist on that agent

Notes

  • To see what would change on publishing, compare the published version with the draft's: both are in Get an agent.
  • This comparison is of configuration. To compare how two versions answer with simulated conversations, see Evals.