Upsert Tool

POST

Create a Tool or update it with a new version if it already exists.

Tools are identified by the ID or their path. The name, description and parameters determine the versions of the Tool.

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.

Request

This endpoint expects an object.
pathstringOptional

Path of the Tool, including the name. This locates the Tool in the Humanloop filesystem and is used as as a unique identifier. For example: folder/name or just name.

idstringOptional

ID for an existing Tool.

functionobjectOptional

Callable function specification of the Tool shown to the model for tool calling.

source_codestringOptional

Code source of the Tool.

setup_valuesmap from strings to anyOptional

Values needed to setup the Tool, defined in JSON Schema format: https://json-schema.org/

attributesmap from strings to anyOptional

Additional fields to describe the Tool. Helpful to separate Tool versions from each other with details on how they were created or used.

tool_typeenumOptional

Type of Tool.

commit_messagestringOptional

Message describing the changes made.

Response

Successful Response

pathstring

Path of the Tool, including the name, which is used as a unique identifier.

idstring

Unique identifier for the Tool.

namestring

Name of the Tool, which is used as a unique identifier.

version_idstring

Unique identifier for the specific Tool Version. If no query params provided, the default deployed Tool Version is returned.

created_atdatetime
updated_atdatetime
statusenum
Allowed values: uncommittedcommitteddeleted

The status of the Tool Version.

last_used_atdatetime
version_logs_countinteger

The number of logs that have been generated for this Tool Version

total_logs_countinteger

The number of logs that have been generated across all Tool Versions

inputslist of objects

Inputs associated to the Prompt. Inputs correspond to any of the variables used within the Tool template.

directory_idstringOptional

ID of the directory that the file is in on Humanloop.

functionobjectOptional

Callable function specification of the Tool shown to the model for tool calling.

source_codestringOptional

Code source of the Tool.

setup_valuesmap from strings to anyOptional

Values needed to setup the Tool, defined in JSON Schema format: https://json-schema.org/

attributesmap from strings to anyOptional

Additional fields to describe the Tool. Helpful to separate Tool versions from each other with details on how they were created or used.

tool_typeenumOptional

Type of Tool.

commit_messagestringOptional

Message describing the changes made.

type"tool"OptionalDefaults to tool
environmentslist of objectsOptional

The list of environments the Tool Version is deployed to.

created_byanyOptional

The user who created the Tool.

committed_byanyOptional

The user who committed the Tool Version.

committed_atdatetimeOptional

The date and time the Tool Version was committed.

evaluatorslist of objectsOptional

Evaluators that have been attached to this Tool that are used for monitoring logs.

signaturestringOptional

Signature of the Tool.

evaluator_aggregateslist of objectsOptional

Aggregation of Evaluator results for the Tool Version.

Errors