Prompts

Create or replace prompt

Changed on

Create or replace prompt. If there is an existing prompt in the project with the same slug as the one specified in the request, a new version of the prompt will be appended and returned

put/v1/prompt

Request

  • Base URL
    https://api.braintrust.dev
  • Auth
    • HTTP bearer
    • or none

Request body

project_idstring uuid required

Unique identifier for the project that the prompt belongs under

namestring required

Name of the prompt

slugstring required

Unique identifier for the prompt

descriptionstring nullable

Textual description of the prompt

tagsstring[] nullable

A list of tags for the prompt

function_type'llm' | 'scorer' | 'task' | 'tool' | 'custom_view' | 'preprocessor' | 'facet' | 'classifier' | 'tag' | 'parameters' | 'sandbox' | 'null' nullable
environment_slugsstring[] nullable

A list of environment slugs to assign the prompt to. Each slug must reference an existing environment; if any slug does not exist, the entire request fails and the prompt is not created.

Response

Returns the new prompt object

idstring uuid required

Unique identifier for the prompt

_xact_idstring required

The transaction id of an event is unique to the network operation that processed the event insertion. Transaction ids are monotonically increasing over time and can be used to retrieve a versioned snapshot of the prompt (see the version parameter)

project_idstring uuid required

Unique identifier for the project that the prompt belongs under

log_id'p' required

A literal 'p' which identifies the object as a project prompt

org_idstring uuid required

Unique identifier for the organization

namestring required

Name of the prompt

slugstring required

Unique identifier for the prompt

descriptionstring nullable

Textual description of the prompt

createdstring date-time nullable

Date of prompt creation

tagsstring[] nullable

A list of tags for the prompt

metadataobject nullable

User-controlled metadata about the prompt

function_type'llm' | 'scorer' | 'task' | 'tool' | 'custom_view' | 'preprocessor' | 'facet' | 'classifier' | 'tag' | 'parameters' | 'sandbox' | 'null' nullable

Changes

    • breaking

      the request property became not nullable

    • breaking

      the request property became not nullable

    • breaking

      the request property became not nullable

    • breaking

      the request property became not nullable

    • breaking

      the request property / became not nullable

    • breaking

      the request property //// became not nullable

    • breaking

      the request property //// became not nullable

    • breaking

      the request property / became not nullable

    • breaking

      the request property // became not nullable

    • breaking

      the request property //// became not nullable

    • breaking

      the request property ///// became not nullable

    • breaking

      the request property ///////// became not nullable

    • breaking

      the request property /////// became not nullable

    • breaking

      the request property //// became not nullable

    • breaking

      the request property //// became not nullable

    • breaking

      the request property //// became not nullable

    • breaking

      the request property //// became not nullable

    • breaking

      the request property / became not nullable

    • breaking

      the request property / became not nullable

    • breaking

      the request property ////// became not nullable

    • breaking

      the request property ////// became not nullable

    • breaking

      the request property ////// became not nullable

    • breaking

      the request property //////// became not nullable

    • breaking

      the request property //////// became not nullable

    • breaking

      the request property ////// became not nullable

    • breaking

      the request property ////// became not nullable

    • breaking

      the request property ////// became not nullable

    • breaking

      the request property ////// became not nullable

    • breaking

      the request property / became not nullable

    • breaking

      the request property / became not nullable

    • breaking

      the request property became not nullable

    • breaking

      removed the enum value undefined of the request property ////////

    • breaking

      removed the enum value undefined of the request property /////

    • info

      removed the undefined enum value from the //////// response property for the response status

    • info

      removed the undefined enum value from the ///// response property for the response status

    • info

      added the new optional request property ////

    • info

      added the optional property //// to the response with the status