Create a Prompt or update it with a new version if it already exists.
Prompts are identified by the ID
or their path
. The parameters (i.e. the prompt template, temperature, model etc.) determine the versions of the Prompt.
If you provide a commit message, then the new version will be committed; otherwise it will be uncommitted. If you try to commit an already committed version, an exception will be raised.
The model instance used, e.g. gpt-4
. See supported models
Path of the Prompt, including the name. This locates the Prompt in the Humanloop filesystem and is used as as a unique identifier. For example: folder/name
or just name
.
ID for an existing Prompt.
The provider model endpoint used.
The template contains the main structure and instructions for the model, including input variables for dynamic values.
For chat models, provide the template as a ChatTemplate (a list of messages), e.g. a system message, followed by a user message with an input variable. For completion models, provide a prompt template as a string.
Input variables should be specified with double curly bracket syntax: {{input_name}}
.
The company providing the underlying model service.
The maximum number of tokens to generate. Provide max_tokens=-1 to dynamically calculate the maximum number of tokens to generate given the length of the prompt
What sampling temperature to use when making a generation. Higher values means the model will be more creative.
An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass.
The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence.
Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far.
Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far.
Other parameter values to be passed to the provider call.
If specified, model will make a best effort to sample deterministically, but it is not guaranteed.
The format of the response. Only {"type": "json_object"}
is currently supported for chat.
The tool specification that the model can choose to call if Tool calling is supported.
The IDs of the Tools in your organization that the model can choose to call if Tool calling is supported. The default deployed version of that tool is called.
Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used.
Message describing the changes made.
Successful Response
Path of the Prompt, including the name, which is used as a unique identifier.
Unique identifier for the Prompt.
The model instance used, e.g. gpt-4
. See supported models
Name of the Prompt.
Unique identifier for the specific Prompt Version. If no query params provided, the default deployed Prompt Version is returned.
The status of the Prompt Version.
The number of logs that have been generated for this Prompt Version
The number of logs that have been generated across all Prompt Versions
Inputs associated to the Prompt. Inputs correspond to any of the variables used within the Prompt template.
ID of the directory that the file is in on Humanloop.
The provider model endpoint used.
The template contains the main structure and instructions for the model, including input variables for dynamic values.
For chat models, provide the template as a ChatTemplate (a list of messages), e.g. a system message, followed by a user message with an input variable. For completion models, provide a prompt template as a string.
Input variables should be specified with double curly bracket syntax: {{input_name}}
.
The company providing the underlying model service.
The maximum number of tokens to generate. Provide max_tokens=-1 to dynamically calculate the maximum number of tokens to generate given the length of the prompt
What sampling temperature to use when making a generation. Higher values means the model will be more creative.
An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass.
The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence.
Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far.
Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far.
Other parameter values to be passed to the provider call.
If specified, model will make a best effort to sample deterministically, but it is not guaranteed.
The format of the response. Only {"type": "json_object"}
is currently supported for chat.
The tool specification that the model can choose to call if Tool calling is supported.
The tools linked to your prompt that the model can call.
Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used.
Message describing the changes made.
The list of environments the Prompt Version is deployed to.
The user who created the Prompt.
The user who committed the Prompt Version.
The date and time the Prompt Version was committed.
Evaluators that have been attached to this Prompt that are used for monitoring logs.
Aggregation of Evaluator results for the Prompt Version.