Esta página ainda não foi traduzida. Você está lendo a versão em inglês.
Compare versions TypeScript REST API
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 TypeScript REST API
curl " https://api.platic.ai/v1/agents/ $AGENT_ID /versions/v3/compare?with=v5 " \
-H " Authorization : Bearer $PLATIC_API_KEY "
await platic.agents.versions. compare ( "agent_123" , "v3" , "v5" );
Path parameters Parameter Type Description Required agentIdstring Agent id ✓ versionIdstring One version, for example v3. It is the "before" of the comparison ✓
Query parameters Parameter Type Description Required withstring The 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" : ""
}
}
]
}
}
Field Description 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 Status details.codeWhen 400INVALID_REQUESTwith is missing404AGENT_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 .