Prompt Versions

Diff Prompt Versions

Changed on

Compares the templates of two prompt versions side-by-side and returns a unified diff. Requires read access to the prompt.

get/v1/prompts/{id}/versions/diff

Request

  • Base URL: http://localhost:3000
  • URL: http://localhost:3000/v1/prompts/{id}/versions/diff
  • Auth: HTTP bearer

Path parameters

idstring uuid required

Query parameters

fromstring required

The source version number (integer) or version tag (string) to compare from.

tostring required

The target version number (integer) or version tag (string) to compare to.

Response

Versions compared successfully

from_versioninteger required
to_versioninteger required
from_templatestring required
to_templatestring required
diffstring required

Example response

{
  "from_version": 1,
  "to_version": 2,
  "from_template": "Hello {{ .name }}",
  "to_template": "Hello {{ .name }}!\nWelcome to px0.",
  "diff": "--- v1\n+++ v2\n@@ -1 +1,2 @@\n-Hello {{ .name }}\n+Hello {{ .name }}!\n+Welcome to px0.\n"
}

Changes

    • info

      for the query request parameter from, the type was generalized from integer to string

    • info

      for the query request parameter to, the type was generalized from integer to string

    • info

      the endpoint scheme security ApiKeyAuth was removed from the API