The most successful AI teams focus on two best practices:
**Evals-driven development**
## View the results
Navigate to the URL provided in your terminal to see the result of running your script on Humanloop.
This `Stats` view will show you the live progress of your local eval runs as well summary statistics of the final results.
Each new run will add a column to your `Stats` view, allowing you to compare the performance of your LLM app over time.
The `Logs` and `Review` tabs allow you to drill into individual datapoints and view the outputs of different runs side-by-side to understand how to improve your LLM app.
## Make a change and re-run
Your first run resulted in a `Semantic similarity` score of 3 (out of 5) and an `Exact match` score of 0. Try and make a change to your `callable` to improve
the output and re-run your script. A second run will be added to your `Stats` view and the difference in performance will be displayed.
## Next steps
Now that you've run your first eval on Humanloop, you can:
* Explore our detailed [tutorial](/docs/tutorials/rag-evaluation) on evaluating a real RAG app where you'll learn about versioning your app, customizing logging, adding Evaluator thresholds and more.
* Create your own [Dataset](/docs/explanation/datasets) of test cases to evaluate your LLM app against.
* Create your own [Evaluators](/docs/explanation/evaluators) to provide judgments on the output of your LLM app.
***
subtitle: Create and evaluate your Agent by running Evals in the Humanloop UI.
description: Getting up and running with Humanloop is quick and easy. This guide will explain how to set up evaluations through the Humanloop UI.
---------------------
For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt.
For this quickstart, we're going to evaluate **Outreach Agent**, which is designed to compose personalized outbound messages to potential customers. The Agent uses a [Tool](/docs/explanation/tools) to research information about the lead before writing a message.
We will assess the quality of the Agent using a [Dataset](https://humanloop.com/docs/evaluation/guides/create-dataset) and [Evaluators](/docs/explanation/evaluators).
Create a Humanloop Account
If you haven't already, [create an account](https://app.humanloop.com/signup) or [log in](https://app.humanloop.com/login) to HumanloopAdd an OpenAI API Key
If you're the first person in your organization, you'll need to add an API key to a model provider. 1. Go to OpenAI and [grab an API key](https://platform.openai.com/api-keys). 2. In Humanloop [Organization Settings](https://app.humanloop.com/account/api-keys) set up OpenAI as a model provider.
This will create an **Outreach Agent** folder in your workspace. Inside the folder, you'll find:
* The **Outreach Agent**.
* **Hacker News Search** Tool used by the Agent to research potential customers.
* A **Customer Outreach** Dataset and three **Evaluators** that we will use to assess the Agent.
### Try out the Agent
The **Outreach Agent** looks up information about the lead on Hacker News and composes an outbound message to them.
Before we kick off the first evaluation, run the Agent in the Editor to get a feel for how it works:
1. Click on the **Outreach Agent** file.
2. On the left-hand side, you can configure your Agent's Parameters, Instructions, and add Tools.
3. On the right-hand side, you can specify Inputs and run the Agent on demand.
4. Enter *Coca-Cola* as the organization and *Humanloop* as the lead in the Inputs section in the top right-hand side.
5. Click the Run button.
### Run Eval
Evaluations are an efficient way to improve your Agent iteratively. You can test versions of the Agent against a [Dataset](https://humanloop.com/docs/evaluation/guides/create-dataset) and see how changing the Agent's configuration impacts the performance.
To test the **Outreach Agent**, navigate to the **Evals** tab and click on the **+ Evaluation** button.
Create a new Run by clicking on the **+ Run** button. Then, follow these steps:
1. Click on the **Dataset** button and select **Customer Outreach** Dateset.
2. Click on the **Agent** button and select the "v1" version.
3. Click on **Evaluators** and add the three Evaluators included in the Output Agent folder: **Friendly Tone**, **Tool Call** and **Message Length**
The first two Evaluators will check if the message is friendly and if the Tool was used.
The **Message Length** Evaluator will show the number of words in the output, providing a baseline value for all further evaluations.
Click **Save**. Humanloop will start generating Logs for the Evaluation.
### Review results
After the Run is completed, you can review the Logs produced and corresponding judgments in the **Review** tab.
The summary of all Evaluators is displayed in the **Stats** tab.
In the sidebar, rename this file to "Comedian Bot" now or later.
### Create the Prompt template in the Editor
The left hand side of the screen defines your Prompt – the parameters such as model, temperature and template. The right hand side is a single chat session with this Prompt.
In the editor, update the system message to:
```
You are a funny comedian. Write a joke about {{topic}}.
```
This message forms the chat template. It has an input slot called `topic` (surrounded by two curly brackets) for an input value that is provided each time you call this Prompt.
On the right hand side of the page, you’ll now see a box in the **Inputs** section for `topic`.
1. Add a value for `topic` e.g. music, jogging, whatever
2. Click **Run** in the bottom right of the page
This will call OpenAI’s model and return the assistant response. Feel free to try other values, the model is *very* funny.
You now have a first version of your prompt that you can use.
### Save your first version of this Prompt
1. Click the **Save** button at the top of the editor
2. Enter **Initial Comedian Setup** in the version name field
3. Enter **Prompt for making (not so) funny jokes!** in the description field
4. Click **Save**
### View the logs
Under the Prompt File, click ‘Logs’ to view all the generations from this Prompt
Click on a row to see the details of what version of the Prompt generated it. From here you can give feedback to that generation, see performance metrics, open up this example in the Editor, or add this log to a Dataset.
Create a Humanloop Account
If you haven't already, [create an account](https://app.humanloop.com/signup) or [log in](https://app.humanloop.com/login) to HumanloopAdd an OpenAI API Key
If you're the first person in your organization, you'll need to add an API key to a model provider. 1. Go to OpenAI and [grab an API key](https://platform.openai.com/api-keys). 2. In Humanloop [Organization Settings](https://app.humanloop.com/account/api-keys) set up OpenAI as a model provider.
## Change the agent and rerun
Modify the `call_model` function to use a different model and temperature.
## Next steps
Logging is the first step to observing your AI product. Follow up with these guides on monitoring and evals:
* Add [monitoring Evaluators](/docs/v5/guides/observability/monitoring) to evaluate Logs as they're made against a File.
* Explore evals to improve the performance of your AI feature in our [guide on running an Evaluation](/docs/v5/guides/evals/run-evaluation).
* See logging in action on a complex example in our [tutorial on evaluating an agent](/docs/v5/tutorials/agent-evaluation).
***
subtitle: Add Humanloop observability to your Vercel AI SDK project.
description: Add logging to your Vercel AI SDK application with Humanloop.
---------------------
For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt.
The [Vercel AI SDK](https://sdk.vercel.ai/docs/introduction) is the TypeScript toolkit designed to help developers build AI-powered applications with React, Next.js, Vue, Svelte, Node.js, and more.
Humanloop supports receiving OpenTelemetry traces from the Vercel AI SDK, so you can see and evaluate your AI SDK application in your Humanloop Dashboard.
Take a look at the following guides to learn how to integrate Humanloop with your Vercel AI SDK application.
Create a Humanloop Account
1. [Create an account](https://app.humanloop.com/signup) or [log in](https://app.humanloop.com/login) to Humanloop 2. Get a Humanloop API key from [Organization Settings](https://app.humanloop.com/account/api-keys).Add an OpenAI API Key
If you're the first person in your organization, you'll need to add an API key to a model provider. 1. Go to OpenAI and [grab an API key](https://platform.openai.com/api-keys). 2. In Humanloop [Organization Settings](https://app.humanloop.com/account/api-keys) set up OpenAI as a model provider.{JSON.stringify(p, null, 2)}
) : p.type === "text" ? (
{p.text}
) : ({p.reasoning}
) )}{JSON.stringify(p, null, 2)}
) : p.type === "text" ? (
{p.text}
) : ({p.reasoning}
) )}
Create a Humanloop Account
1. [Create an account](https://app.humanloop.com/signup) or [log in](https://app.humanloop.com/login) to Humanloop 2. Get a Humanloop API key from [Organization Settings](https://app.humanloop.com/account/api-keys).Add an OpenAI API Key
If you're the first person in your organization, you'll need to add an API key to a model provider. 1. Go to OpenAI and [grab an API key](https://platform.openai.com/api-keys). 2. In Humanloop [Organization Settings](https://app.humanloop.com/account/api-keys) set up OpenAI as a model provider.
Files represent the core building blocks of your AI features on Humanloop. They exist within a flexible filesystem in an Organization.
### Function Files
[**Prompts**](./prompts)
A Prompt on Humanloop defines the instructions and configuration for guiding a Large Language Model (LLM) to perform a specific task.
Each change in any of the following properties creates a new Version of the Prompt:
* the **template** such as `Write a song about {{topic}}`.
Then, use the Agent Editor to configure and test the Agent. You can link existing Tools and Prompts from your workspace for the Agent to use. You can also define a tool inline by providing its JSON schema. You can also configure the `max_iterations` and `stopping_tools` for the Agent in the "Parameters" section.
### Agents via the SDK
To create an Agent programmatically, use our SDK.
```curl
curl -X POST https://api.humanloop.com/v5/agents \
-H "X-API-Key: $YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"path": "Banking/Teller Agent",
"provider": "anthropic",
"endpoint": "chat",
"model": "claude-3-7-sonnet-latest",
"reasoning_effort": 1024,
"template": [
{
"role": "system",
"content": "You are a helpful a digital bank teller, you help users navigate our digital banking platform."
},
],
"max_iterations": 3,
"tools": [
{
"type": "file",
"link": {
"file_id": "pr_1234567890",
"version_id": "prv_1234567890"
},
"on_agent_call": "continue"
},
{
"type": "json_schema",
"json_schema": {
"name": "stop",
"description": "Call this tool when you have finished your task.",
"parameters": {
"type": "object",
"properties": {
"output": {
"type": "string",
}
}
}
}
},
]
}'
```
Agents can be called through our UI for testing and development, or via API for production deployments.
```curl
curl -X POST https://api.humanloop.com/v5/agents/call \
-H "X-API-Key: $YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"path": "Banking/Teller Agent",
"messages": [
{
"role": "user",
"content": "I need to withdraw $1000"
}
]
}'
```
If your Agent calls a tool that Humanloop cannot run, the system will pause and wait until you provide the response required by the tool. You can then continue the Agent's execution using the `/continue` endpoint.
```curl
curl -X POST https://api.humanloop.com/v5/agents/continue \
-H "X-API-Key: $YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"log_id": "log_1234567890",
"messages": [
{
"role": "tool",
"tool_call_id": "tool_call_1234567890",
"content": "Not enough funds. Politely decline user request."
}
]
"stream": false
}'
```
You can also log Agent executions explicitly when running the Agent logic yourself:
```curl
curl -X POST https://api.humanloop.com/v5/agents/log \
-H "X-API-Key: $YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"path": "Banking/Teller Agent",
"messages": [
{
"role": "user",
"content": "I need to withdraw $1000"
},
]
}'
```
## Versioning
Versioning your Agents enables you to track how adjustments to template, tools, or model parameters influence the Agent's behavior. This is crucial for iterative development, as you can pinpoint which configuration produces the most effective results for your use cases. You can use the Editor or SDK to create and update Agent Versions and iterate on improving its performance.
The following components of an Agent contribute to its version:
* The Agent's **template** -- the system prompt and any other instructions
* The model call **parameters** -- such as `temperature`, `max_tokens`, and `reasoning_effort`
* The Agent's **workflow** configuration -- such as `max_iterations` and `stopping_tools`
* The Agent's **tools** -- including both inline JSON Schema tools and linked Tool or Prompt Versions
## Stopping Conditions
An Agent will stop executing in three circumstances:
1. The maximum number of iterations is reached
2. The Agent executes a tool that is configured to stop the Agent
3. The Agent has generated a response with no further tool calls
### Max Iterations
You can cap the maximum number of iterations an Agent can execute--the Agent will generate up to `max_iterations` times, and then stop.
This results in an Agent Log with a `finish_reason` of `"max_iterations_reached"`.
### Stopping Tools
You can designate that a tool should stop the Agent after it is called. If it can be run on Humanloop, it will be run and the result logged before the Agent stops.
This results in an Agent Log with a `finish_reason` of `"stopping_tool_called"` and `stopping_tool_names` populated.
### Agent Finished
Lastly, the Agent will stop if it has generated a response with no further tool calls. This represents a natural end to the Agent's execution, and results in an Agent Log with a `finish_reason` of `"agent_generation_finished"`.
## Evaluation
Agents can be evaluated both through the Humanloop UI and programmatically. After each Agent execution, configured evaluators will run automatically on Humanloop.
Get started with [evaluating your Agents in the UI](/docs/tutorials/evaluate-agent-in-ui) or [programmatically](/docs/tutorials/agent-evaluation-code).
## Tracing
A trace is the collection of Logs associated with an Agent execution, showing the complete path from input to output, including all intermediate steps.
Every Agent trace includes:
* The initial input and messages, and final output
* All intermediate LLM calls and their responses as nested Logs
* Tools called by the Agent and their inputs and outputs as nested Logs
* Any errors or unexpected behaviors
* Timing and performance metrics
### Metrics and Timing
Cost, latency, execution time, and token usage metrics are captured for each trace. They span from the earliest interaction to the final response.
## Serialization
The .agent file format is a serialized representation of an Agent Version, designed to be human-readable and suitable for integration into version control systems alongside code.
The format is heavily inspired by MDX, with model and parameters specified in a YAML header alongside JSX-style syntax for chat templates.
```jsx title=".agent" maxLines=75
---
model: claude-3-7-sonnet-latest
max_tokens: -1
provider: anthropic
endpoint: chat
reasoning_effort: 1024
tools: [
{
"type": "file",
"link": {
"file_id": "pr_1234567890",
"version_id": "prv_1234567890"
},
"on_agent_call": "continue"
},
{
"type": "file",
"link": {
"file_id": "tl_1234567890",
"version_id": "tlv_1234567890"
},
"on_agent_call": "stop"
},
{
"type": "inline",
"json_schema": {
"name": "stop",
"description": "Call this tool when you have finished your task.",
"parameters": {
"type": "object",
"properties": {
"output": {
"type": "string",
"description": "The final output to return to the user."
}
},
"additionalProperties": false,
"required": [
"output"
]
},
"strict": true
},
"on_agent_call": "stop"
},
{
"type": "file",
"link": {
"file_id": "tl_cBfvZ3Xre8PAfVAa5r9P6",
"version_id": "tlv_gzr3bxaVGu889O4lsOgtG"
},
"on_agent_call": "continue"
},
]
---
The core entity in the Humanloop evaluation framework is an **[Evaluator](/docs/explanation/evaluators)** - a function you define which takes an LLM-generated log as an argument and returns a **judgment**.
The judgment is typically either a boolean or a number, indicating how well the model performed according to criteria you determine based on your use case.
Evaluators can be leveraged for [Monitoring](/docs/guides/observability/monitoring) your live AI application, as well as for [Evaluations](/docs/guides/evals/run-evaluation-ui) to benchmark different version of your AI application against each other pre-deployment.
## Sources of Judgment
Currently, you can define three different Evaluator sources on Humanloop:
* **Code** - using simple deterministic rules based judgments against attributes like cost, token usage, latency, regex rules on the output, etc. These are generally fast and cheap to run at scale.
* **AI** - using other foundation models to provide judgments on the output. This allows for more qualitative and nuanced judgments for a fraction of the cost of human judgments.
* **Human** - getting gold standard judgments from either end users of your application, or internal domain experts. This can be the most expensive and slowest option, but also the most reliable.
## Online Monitoring versus Offline Evaluation
Evaluators can be deployed on Humanloop to support both testing new versions of your Prompts and Tools during development and for monitoring live apps that are already in production.
### Online Monitoring
Evaluators are run against the [Logs](./logs) generated by your AI applications. Typically, they are used to monitor deployed model performance over time and check for drift or degradation in performance.
The Evaluator in this case only takes a single argument - the `log` generated by the model. The Evaluator is expected to return a judgment based on the Log,
which can be used to trigger alerts or other actions in your monitoring system.
See our [Monitoring guides](/docs/guides/observability/monitoring) for more details.
### Offline Evaluations
Offline Evaluators are combined with predefined [**Datasets**](/docs/v4/datasets) in order to evaluate your application as you iterate in your prompt engineering workflow, or to test for regressions in a CI environment.
A test Dataset is a collection of **Datapoints**, which are roughly analogous to unit tests or test cases in traditional programming. Each datapoint specifies inputs to your model and (optionally) some target data.
When you run an offline evaluation, a Log needs to be generated using the inputs of each Datapoint and the version of the application being evaluated. Evaluators then need to be run against each Log to provide judgements,
which are then aggregated to provide an overall score for the application. Evaluators in this case take the generated `Log` and the `testcase` datapoint that gave rise to it as arguments.
See our guides on [creating Datasets](/docs/guides/evals/upload-dataset-csv) and [running Evaluations](/docs/guides/evals/run-evaluation-ui) for more details.
## Humanloop runtime versus your runtime
Evaluations require the following to be generated:
1. Logs for the datapoints.
2. Evaluator results for those generated logs.
Evaluators which are defined within the Humanloop UI can be executed in the Humanloop runtime, whereas Evaluators defined in your code can be executed in your runtime and the results posted back to Humanloop.
This provides flexibility for supporting more complex evaluation workflows.
## Return types
Evaluators apply judgment to Logs. This judgment can be of the following types:
* **Boolean** - A true/false judgment.
* **Number** - A numerical judgment, which can act as a rating or score.
* **Select** - One of a predefined set of options. One option must be selected.
* **Multi-select** - Any number of a predefined set of options. None, one, or many options can be selected.
* **Text** - A free-form text judgment.
Code and AI Evaluators can return either **Boolean** or **Number** judgments.
Human Evaluators can return **Number**, **Select**, **Multi-select**, or **Text** judgments.
***
subtitle: Tools give Agents and Prompts access to external data and enable them to take action.
description: Discover how Humanloop manages tools for use with large language models (LLMs) with version control and rigorous evaluation for better performance.
---------------------
For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt.
Tools on Humanloop are used to extend [Agents](/docs/explanation/agents) and [Prompts](/docs/explanation/prompts) with access to external data sources and enable them to take action.
## Types of Tools
### Runnable Tools
Runnable Tools can be executed by Humanloop, meaning they can form a part of an Agent's automatic execution.
Python code Tools, an example of these, are run in a [secure Python runtime](/docs/v5/reference/python-environment) and allow you to write custom code to be executed.
### Template Tools
Template Tools can be used within a Prompt's template to dynamically insert information for the model when called.
These include:
* **Snippet Tools**: Reusable text components that can be shared across multiple Prompts
* **Integration Tools**: Pre-built connectors to popular services like Google Search and Pinecone vector database
### Function calling Tools
Many models, such as those by [OpenAI](https://platform.openai.com/docs/guides/function-calling) and [Anthropic](https://docs.anthropic.com/en/docs/build-with-claude/tool-use), now support function calling.
You can provide these models with definitions of the available tools. The model then decides whether to call a tool, and which parameters to use.
On Humanloop, [JSON schema Tools](/docs/v5/guides/prompts/tool-calling-editor) record the schema definitions that are used for function calling,
allowing you to tweak and version control them.
```js
{
"name": "get_current_weather",
"description": "Get the current weather in a given location",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"name": "Location",
"description": "The city and state, e.g. San Francisco, CA"
},
"unit": {
"type": "string",
"name": "Unit",
"enum": [
"celsius",
"fahrenheit"
]
}
},
"required": [
"location",
"unit"
]
}
}
```
In addition to JSON schema Tools, all Runnable Tools and Prompts can be used for function calling. Humanloop will automatically generate the schema definitions
for these when they're linked to a Agent or Prompt.
## Humanloop runtime versus your runtime
Humanloop supports running Python code Tools within the Humanloop runtime. If you have Tools that you want to run in your own environment,
you can use the Humanloop API to manage versions and record Logs.
The simplest way to do this is by decorating a function with the [Tool decorator](/docs/v5/sdk/decorators/tool) in the SDK.
Running the decorated function will automatically log the inputs and output of the function
to Humanloop. If you're using the Python SDK, the `@tool` decorator will also infer a JSON schema from the function's type hints.
***
subtitle: Instrument and monitor multi-step AI systems.
description: Humanloop Flows trace and evaluate complex AI workflows, from LLM agents to retrieval-augmented generation (RAG). By unifying all components, Flows provide the context needed to debug and iterate with confidence.
---------------------
For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt.
## Introduction
LLM-powered systems are multi-step processes, leveraging information sources, delegating computation to tools, or iterating with the LLM to generate the final answer.
Looking at the inputs and output of such a system is not enough to reason about its behavior. Flows address this by tracing all components of the feature, unifying Logs in a comprehensive view of the system.
## Basics
To integrate Flows in your project, add the SDK flow decorator on the entrypoint of your AI feature.
### Manual Tracing
If you don't want to use decorators, first create a Flow Log, then pass its `id` when creating Logs you want to add to the trace.
Datasets on Humanloop are collections of Datapoints used for evaluation and fine-tuning. You can think of a Datapoint as a test case for your AI application, which contains the following fields:
* **Inputs**: a collection of prompt variable values that replace the `{{variables}}` defined in your prompt template during generation.
* **Messages**: for chat models, you can have a history of chat messages that are appended to the prompt during generation.
* **Target**: a value that in its simplest form describes the desired output string for the given inputs and messages history. For more advanced use cases, you can define a JSON object containing whatever fields are necessary to evaluate the model's output.
## Versioning
A Dataset will have multiple Versions as you iterate on the test cases for your task. This tends to be an evolving process as you learn how your [Prompts](./prompts) behave and how users interact with your AI application in the wild.
Dataset Versions are immutable and are uniquely defined by the contents of the Datapoints. When you change, add, or remove Datapoints, this constitutes a new Version.
Each [Evaluation](/docs/guides/evals/run-evaluation-ui) is linked to a specific Dataset Version, ensuring that your evaluation results are always traceable to the exact set of test cases used.
## Creating a Dataset
A Dataset can be created in the following ways:
* [Upload a CSV in the UI](/docs/guides/evals/upload-dataset-csv)
* [Create a Datapoint from an existing Log](/docs/guides/evals/create-dataset-from-logs)
* [Create a Dataset via the API](/docs/guides/evals/create-dataset-api)
## Using Datasets for Evaluations
Datasets are foundational for Evaluations on Humanloop. Evaluations are run by iterating over the Datapoints in a Dataset, generating output from different versions of your AI application for each one. The Datapoints provide the specific test cases to evaluate, with each containing the input variables and optionally a target output that defines the desired behavior. When a target is specified, Evaluators can compare the generated outputs to the targets to assess how well each version performed.
***
subtitle: Directories can be used to group together related Files.
description: Directories can be used to group together related Files. This is useful for organizing your work as part of prompt engineering and collaboration.
---------------------
For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt.
Directories in Humanloop serve as an organizational tool, allowing users to group related [Files](/docs/explanation/files) and structure their work logically. They function similarly to folders in a traditional file system, providing a hierarchical structure for managing work.
### Paths
Every File and Directory has a unique `path` property which you can use to refer to Files or Directories. When you move a File or Directory, its path and the paths of all contained files and subdirectories will update accordingly.
Environments enable you to deploy different versions of your files to specific environments, allowing you to separately manage the deployment workflow between testing and production. With environments, you have the control required to manage the full LLM deployment lifecycle.
### Managing your environments
Every organisation automatically receives a default production environment. You can create additional environments with custom names by visiting your organisation's [environments page](https://app.humanloop.com/account/environments).
Create a Humanloop Account
If you haven't already, [create an account](https://app.humanloop.com/signup) or [log in](https://app.humanloop.com/login) to HumanloopAdd an OpenAI API Key
If you're the first person in your organization, you'll need to add an API key to a model provider. 1. Go to OpenAI and [grab an API key](https://platform.openai.com/api-keys). 2. In Humanloop [Organization Settings](https://app.humanloop.com/account/api-keys) set up OpenAI as a model provider.
This will create an **Outreach Agent** folder in your workspace. Inside the folder, you'll find:
* The **Outreach Agent**.
* **Hacker News Search** Tool used by the Agent to research potential customers.
* A **Customer Outreach** Dataset and three **Evaluators** that we will use to assess the Agent.
### Try out the Agent
The **Outreach Agent** looks up information about the lead on Hacker News and composes an outbound message to them.
Before we kick off the first evaluation, run the Agent in the Editor to get a feel for how it works:
1. Click on the **Outreach Agent** file.
2. On the left-hand side, you can configure your Agent's Parameters, Instructions, and add Tools.
3. On the right-hand side, you can specify Inputs and run the Agent on demand.
4. Enter *Coca-Cola* as the organization and *Humanloop* as the lead in the Inputs section in the top right-hand side.
5. Click the Run button.
### Run Eval
Evaluations are an efficient way to improve your Agent iteratively. You can test versions of the Agent against a [Dataset](https://humanloop.com/docs/evaluation/guides/create-dataset) and see how changing the Agent's configuration impacts the performance.
To test the **Outreach Agent**, navigate to the **Evals** tab and click on the **+ Evaluation** button.
Create a new Run by clicking on the **+ Run** button. Then, follow these steps:
1. Click on the **Dataset** button and select **Customer Outreach** Dateset.
2. Click on the **Agent** button and select the "v1" version.
3. Click on **Evaluators** and add the three Evaluators included in the Output Agent folder: **Friendly Tone**, **Tool Call** and **Message Length**
The first two Evaluators will check if the message is friendly and if the Tool was used.
The **Message Length** Evaluator will show the number of words in the output, providing a baseline value for all further evaluations.
Click **Save**. Humanloop will start generating Logs for the Evaluation.
### Review results
After the Run is completed, you can review the Logs produced and corresponding judgments in the **Review** tab.
The summary of all Evaluators is displayed in the **Stats** tab.
### Setup Google Search tool
### Add Tools to the Agent
Click on Outreach Agent File, then click on **+ Tools** button on left bottom corner and choose **Google Search** Tool and **Write Personalized Message** Prompt from the list. Remove HackerNews Search Tool as it's no longer needed.
Save the Agent and name it "v2".
### Run another Evaluation
We can now create a new Run with the new Agent version. Click on the **+ Run** button and select the newly created Agent version.
Navigate to the **Stats** tab to see how the two versions compare to each other.
To see the two versions side by side, click on the **Review** tab.
The second version of the Agent we evaluated used the Google Search Tool to extract more relevant information. It also searched for background information on each lead, something the initial version of the Agent lacked.
Adding a new Tools to the Agent resulted in a more personalized message and improved outreach.
Create a Humanloop Account
If you haven't already, [create an account](https://app.humanloop.com/signup) or [log in](https://app.humanloop.com/login) to HumanloopAdd an OpenAI API Key
If you're the first person in your organization, you'll need to add an API key to a model provider. 1. Go to OpenAI and [grab an API key](https://platform.openai.com/api-keys). 2. In Humanloop [Organization Settings](https://app.humanloop.com/account/api-keys) set up OpenAI as a model provider.
## Add detailed logging
The decorators divide the code in logical components, allowing you to observe the steps taken to answer a question. Every step taken by the agent creates a Log.
## Next steps
We've built a complex agentic workflow and learned how to use Humanloop to add logging to it and evaluate its performance.
Take a look at these resources to learn more about evals on Humanloop:
* Learn how to [create a custom dataset](/docs/v5/guides/evals/create-dataset) for your project.
* Learn more about using [LLM Evaluators](/docs/v5/guides/evals/llm-as-a-judge) on Humanloop.
***
subtitle: Use Humanloop to evaluate more complex workflows like Retrieval Augmented Generation (RAG).
description: Evaluate a RAG application with Humanloop.
---------------------
For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt.
This tutorial demonstrates how to take an existing RAG pipeline and use Humanloop to evaluate it. At the end of the tutorial you'll understand how to:
1. Run an Eval on your RAG pipeline.
2. Set up detailed logging with SDK decorators.
3. Log to Humanloop manually
The full code for this tutorial is available in the [Humanloop Cookbook](https://github.com/humanloop/humanloop-cookbook/blob/main/tutorials/rag/evaluate-rag-flow.ipynb).
## Example RAG Pipeline
In this tutorial we'll first implement a simple RAG pipeline to do Q\&A over medical documents without Humanloop. Then we'll add Humanloop and use it for evals. Our RAG system will have three parts:
* **Dataset**: A version of the [MedQA dataset](https://huggingface.co/datasets/bigbio/med_qa) from Hugging Face.
* **Retriever**: [Chroma](https://docs.trychroma.com/getting-started) as a simple local vector DB.
* **Prompt**: Managed in code, populated with the user's question and retrieved context.
## Set up RAG pipeline
```bash
poetry install
```
Set up environment variables:
```python
from dotenv import load_dotenv
import os
from chromadb import chromadb
from openai import OpenAI
import pandas as pd
load_dotenv()
chroma = chromadb.Client()
openai = OpenAI(api_key=os.getenv("OPENAI_KEY"))
```
Set up the Vector DB:
```python
collection = chroma.get_or_create_collection(name="MedQA")
knowledge_base = pd.read_parquet("../../assets/sources/textbooks.parquet")
knowledge_base = knowledge_base.sample(10, random_state=42)
collection.add(
documents=knowledge_base["contents"].to_list(),
ids=knowledge_base["id"].to_list(),
)
```
Define the Prompt:
```python
model = "gpt-4o-mini"
temperature = 0
template = [
{
"role": "system",
"content": """Answer the following question factually.
Question: {{question}}
Options:
- {{option_A}}
- {{option_B}}
- {{option_C}}
- {{option_D}}
- {{option_E}}
---
Here is some retrieved information that might be helpful.
Retrieved data:
{{retrieved_data}}
---
Give you answer in 3 sections using the following format. Do not include the quotes or the brackets. Do include the "---" separators.
""", } ] def populate_template(template: list, inputs: dict[str, str]) -> list: """Populate a template with input variables.""" messages = [] for i, template_message in enumerate(template): content = template_message["content"] for key, value in inputs.items(): content = content.replace("{{" + key + "}}", value) message = {**template_message, "content": content} messages.append(message) return messages ``` Define the RAG Pipeline: ```python def retrieval_tool(question: str) -> str: """Retrieve most relevant document from the vector db (Chroma) for the question.""" response = collection.query(query_texts=[question], n_results=1) retrieved_doc = response["documents"][0][0] return retrieved_doc def call_llm(**inputs): # Populate the Prompt template messages = populate_template(template, inputs) # Call OpenAI to get response chat_completion = openai.chat.completions.create( model=model, temperature=temperature, messages=messages, ) return chat_completion.choices[0].message.content def ask_question(**inputs)-> str: """Ask a question and get an answer using a simple RAG pipeline""" # Retrieve context retrieved_data = retrieval_tool(inputs["question"]) inputs = {**inputs, "retrieved_data": retrieved_data} # Call LLM return call_llm(**inputs) ``` Run the pipeline: ```python output = ask_question( **{ "question": "A 34-year-old male suffers from inherited hemophilia A. He and his wife have three unaffected daughters. What is the probability that the second daughter is a carrier of the disease?", "option_A": "0%", "option_B": "25%", "option_C": "50%", "option_D": "75%", "option_E": "100%", } ) print(output) ``` ## Run an Evaluation Now we will integrate Humanloop into our RAG pipeline to evaluate it. We will use the Humanloop SDK to run an Eval on our RAG pipeline. Initialize the Humanloop SDK: ```python from humanloop import Humanloop load_dotenv() humanloop = Humanloop(api_key=os.getenv("HUMANLOOP_KEY")) ``` ### Set up Evaluators Our Dataset has ground truth answers we can compare against. It's very unlikely that the AI answers are *exactly* the same as the answers but we can measure how close they are by using the "Levenshtein distance" Evaluator. The code for this Evaluator is in the cookbook. We can run the Evaluator locally. However, if we upload it to Humanloop, we get the added benefit that Humanloop can run the Evalaution for us and this can be integrated into CI/CD. ```python def upload_evaluators(): """Uploads Evaluators to Humanloop. Uploads the "Exact match", "Levenshtein", and "Reasoning" Evaluators. The "Exact match" and "Levenshtein" Evaluators are slight modifications to the examples automatically created in the "Example Evaluators" folder in Humanloop when you signed up, with some additional parsing for the output of this RAG pipeline. """ # Upload Code Evaluators for evaluator_name, file_name, return_type in [ ("Exact match", "exact_match.py", "boolean"), ("Levenshtein", "levenshtein.py", "number"), ]: with open(f"../../assets/evaluators/{file_name}", "r") as f: code = f.read() humanloop.evaluators.upsert( path=f"Evals demo/{evaluator_name}", spec={ "evaluator_type": "python", "arguments_type": "target_required", "return_type": return_type, "code": code, }, version_name="Initial version" version_description=f"New version from {file_name}", ) # Upload an LLM Evaluator humanloop.evaluators.upsert( path="Evals demo/Reasoning", spec={ "evaluator_type": "llm", "arguments_type": "target_free", "return_type": "boolean", "prompt": { "model": "gpt-4o-mini", "endpoint": "complete", "temperature": 0, "template": "An answer is shown below. The answer contains 3 sections, separated by \"---\". The first section is the final answer. The second section is an explanation. The third section is a citation.\n\nEvaluate if the final answer follows from the citation and the reasoning in the explanation section. Give a brief explanation/discussion. Do not make your judgment based on factuality, but purely based on the logic presented.\nOn a new line, give a final verdict of \"True\" or \"False\".\n\nAnswer:\n{{log.output}}", }, }, version_name="Initial version", version_description="Initial reasoning evaluator.", ) upload_evaluators() ``` ### Create a Dataset We upload a test dataset to Humanloop: ```python def upload_dataset_to_humanloop(): df = pd.read_json("../../assets/datapoints.jsonl", lines=True) datapoints = [row.to_dict() for _i, row in df.iterrows()][0:20] return humanloop.datasets.upsert( path="Evals demo/MedQA test", datapoints=datapoints, version_description=f"Added {len(datapoints)} datapoints from MedQA test dataset.", ) dataset = upload_dataset_to_humanloop() ``` ### Run Eval Now that we have our Flow, our Dataset and our Evaluators we can create and run an Evaluation. ```python checks = humanloop.evaluations.run( name="Demo cookbook", file={ "path": "Evals demo/MedQA pipeline", "callable": ask_question, }, dataset={ "path": "Evals demo/MedQA test", }, evaluators=[ {"path": "Evals demo/Exact match"}, {"path": "Evals demo/Levenshtein"}, {"path": "Evals demo/Reasoning"}, {"path": "Example Evaluators/Code/Latency"}, ], ) ``` ## Add detailed logging One limitation of our Evaluation so far is that we've measured the app end-to-end but we don't know how the different components contribute to performance. If we really want to improve our app, we'll need to log the full trace of events, including separate Tool and Prompt steps: We can do this by adding logging for the Prompt and Tool steps within the Flow using Humanloop's Python decorators. If you're using a different language, you can still log to Humanloop via the API. Skip to the "Logging with the API" section below or check out our [guide](https://humanloop.com/docs/v5/guides/observability/logging-through-api) for more details. ```python @humanloop.tool(path="Evals demo/Retrieval tool") def retrieval_tool(question: str) -> str: return retrieval_tool(question) @humanloop.prompt(path="Evals demo/LLM call") def call_llm(**inputs): return call_llm(**inputs) @humanloop.flow(path="Evals demo/MedQA pipeline") def ask_question(**inputs): retrieved_data = retrieval_tool(inputs["question"]) inputs = {**inputs, "retrieved_data": retrieved_data} return call_llm(**inputs) ``` You can now run the pipeline as before and the full trace will be logged to Humanloop. ```python output = ask_question( **{ "question": "A 34-year-old male suffers from inherited hemophilia A. He and his wife have three unaffected daughters. What is the probability that the second daughter is a carrier of the disease?", "option_A": "0%", "option_B": "25%", "option_C": "50%", "option_D": "75%", "option_E": "100%", } ) print(output) ``` ## Re-run the Evaluation These decorated functions can similarly be used to run an Eval on the pipeline. This will allow you to evaluate the pipeline and see the detailed logs for each step in the pipeline. Let's change from `gpt-4o-mini` to `gpt-4o` and re-run the Eval. By passing in the same `name` to `humanloop.evaluations.run(...)` call, we'll add another run to the previously-created Evaluation on Humanloop. This will allow us to compare the two Runs side-by-side. ```python model = "gpt-4o" checks = humanloop.evaluations.run( name="RAG guide", file={ "path": "Evals demo/MedQA pipeline", "callable": ask_question_decorated, "type": "flow", }, dataset={ "path": "Evals demo/MedQA test", "datapoints": datapoints, }, evaluators=[ {"path": "Evals demo/Exact match"}, {"path": "Evals demo/Levenshtein"}, {"path": "Evals demo/Reasoning"}, {"path": "Example Evaluators/Code/Latency"}, ], ) ``` Viewing our Evaluation on Humanloop, we can see that our newly-added Run with `gpt-4o` has been added to the Evaluation. On the **Stats** tab, we can see that `gpt-4o` scores better for our "Exact match" (and "Levenshtein") metrics, but has higher latency.  Perhaps surprisingly, `gpt-4o` performs worse according to our "Reasoning" Evaluator. ## Logging with the API Above, we've let the SDK handle logging and versioning for us. However, you can also log data to Humanloop using the API directly. This can be useful if you want to perform some post-processing on the data before logging it, or if you want to include additional metadata in the logs or versions. We'll now demonstrate how to extend your Humanloop logging with more fidelity; creating Tool, Prompt, and Flow Logs to give you full visibility. We add additional logging steps to our `ask_question` function to represent the full trace of events on Humanloop. (Note that the `run_id` and `source_datapoint_id` arguments are optional, and are included here for use in the Evaluation workflow demonstrated later.) ```python from datetime import datetime import inspect def ask_question_with_logging(run_id: str | None = None, source_datapoint_id: str | None = None, **inputs)-> str: """Ask a question and get an answer using a simple RAG pipeline.""" trace = humanloop.flows.log( path="evals_demo/medqa-flow", flow={ "attributes": { "prompt": { "template": template, "model": model, "temperature": temperature, }, "tool": { "name": "retrieval_tool_v3", "description": "Retrieval tool for MedQA.", "source_code": inspect.getsource(retrieval_tool), }, } }, inputs=inputs, start_time=datetime.now(), run_id=run_id, source_datapoint_id=source_datapoint_id, ) # Retrieve context start_time=datetime.now() retrieved_data = retrieval_tool(inputs["question"]) inputs = {**inputs, "retrieved_data": retrieved_data} # Log the retriever information to Humanloop separately humanloop.tools.log( path="Evals demo/Retrieval tool", tool={ "function": { "name": "retrieval_tool", "description": "Retrieval tool for MedQA.", }, "source_code": inspect.getsource(retrieval_tool), }, output=retrieved_data, trace_parent_id=trace.id, start_time=start_time, end_time=datetime.now() ) # Populate the Prompt template start_time=datetime.now() messages = populate_template(template, inputs) # Call OpenAI to get response chat_completion= openai.chat.completions.create( model=model, temperature=temperature, messages=messages, ) output = chat_completion.choices[0].message.content # Log the prompt information to Humanloop separately humanloop.prompts.log( path="evals_demo/medqa-answer", prompt={ "model": model, "temperature": temperature, "template": template, }, inputs=inputs, output=output, output_message=chat_completion.choices[0].message, trace_parent_id=trace.id, start_time=start_time, end_time=datetime.now() ) # Close the trace humanloop.flows.update_log( log_id=trace.id, output=output, trace_status="complete", ) return output ``` The logging we've added here is similar to the SDK decorators we used earlier. ## Run an Evaluation using the API To orchestrate your own Evaluations, you can pass in `run_id` and `source_datapoint_id` to the `humanloop.flows.log(...)` call to associate Logs with a specific Run and Datapoint. The following is an example of how you can manually create an Evaluation and Run, and log data to Humanloop using the API, giving you full control over the Evaluation process. ```python from tqdm import tqdm # Create Evaluation evaluation = humanloop.evaluations.create( name="Manual logging demo", file={"path": "Evals demo/MedQA pipeline"}, evaluators=[ {"path": "Evals demo/Exact match"}, {"path": "Evals demo/Levenshtein"}, {"path": "Evals demo/Reasoning"}, {"path": "Example Evaluators/Code/Latency"}, ], ) # Create Run run = humanloop.evaluations.create_run(id=evaluation.id, dataset={"path": "Evals demo/MedQA test"}) # Run the pipeline over the Dataset for datapoint in tqdm(datapoints): ask_question_with_logging(run_id=run.id, source_datapoint_id=datapoint.id, **datapoint.inputs) ``` You can then similarly view results on the Humanloop UI.  This concludes the Humanloop RAG Evaluation walkthrough. You've learned how to integrate Humanloop into your RAG pipeline, set up logging, create Datasets, configure Evaluators, run Evaluations, and log the full trace of events including Tool and Prompt steps. *** subtitle: Collect feedback from your users to improve your AI product. --------------------- For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. In this tutorial, we'll show how you can gather valuable insights from your users to evaluate and improve your AI product. We'll deploy a simple chat app that allows users to interact with an AI model. Later, we'll modify the source code to capture user feedback and show how these insights are used to improve the AI product. ### Prerequisites## Capture user feedback You can grab the source code used in this tutorial here: [hl-chatgpt-clone-typescript](https://github.com/humanloop/hl-chatgpt-clone-typescript) Create a Humanloop Account
If you haven't already, [create an account](https://app.humanloop.com/signup) or [log in](https://app.humanloop.com/login) to HumanloopAdd an OpenAI API Key
If you're the first person in your organization, you'll need to add an API key to a model provider. 1. Go to OpenAI and [grab an API key](https://platform.openai.com/api-keys). 2. In Humanloop [Organization Settings](https://app.humanloop.com/account/api-keys) set up OpenAI as a model provider.Using the Prompt Editor will use your OpenAI credits in the same way that the OpenAI playground does. Keep your API keys for Humanloop and the model providers private. ### Clone and start a chat app server ```bash git clone https://github.com/humanloop/hl-chatgpt-clone-typescript # add Humanloop API key touch .env.local echo HUMANLOOP_API_KEY=YOUR_API_KEY >> .env.local # optionally add OpenAI key, if you haven't already in Humanloop app echo OPENAI_API_KEY=YOUR_API_KEY >> .env.local # run the app bun install bun run dev ``` ### Use the chat app Open the chat app in your browser and start chatting with the AI model. ## Use the logs to improve your AI product After you collect enough data, you can leverage the user feedback to improve your AI product. Navigate back to the Logs view and filter all Logs that have a 'bad' rating to review the model's responses that need improvement.Every time the user presses the Send button, Humanloop receives the request and calls the AI model. The response from the model is then stored as a Log. Let's check the `api/chat/route.ts` file to see how it works. * The `path` parameter is the path to the Prompt in the Humanloop workspace. If the Prompt doesn't exist, it will be created. * The `prompt` parameter is the configuration of the Prompt. In this case we manage our Prompt in code; if the configuration of the Prompt changes, a new version of the Prompt will automatically be created on Humanloop. Prompts can alternatively be managed [directly on Humanloop](/docs/development/guides/call-prompt). * The `messages` parameter is the list of all messages exchanged between the Model and the User. To learn more about calling Prompts with the Humanloop SDK, see the [Prompt Call](/v5/api-reference/prompts/call-stream) API reference. ```typescript api/chat/route.ts const response = await humanloop.prompts.callStream({ // if Prompt doesn't exist, it will be created path: "chatgpt-clone-tutorial/customer-support-agent", prompt: { model: "gpt-4", template: [ { role: "system", content: "You are a helpful assistant.", }, ], }, // messages is a list of objects: [{role: string, content: string}, ...]. // Role is either "user", "assistant", "system", or "tool". messages, providerApiKeys: { // OpenAI API key, if you haven't already set it in Humanloop app openai: process.env.OPENAI_API_KEY, }, }); ``` ### Review the logs in Humanloop After chatting with the AI model, go to the Humanloop app and review the logs. Click on the `chatgpt-clone-tutorial/customer-support-agent` Prompt, then click on the Logs tab at the top of the page. You see that all the interactions with the AI model are logged here.
The code will generate a new Prompt `chatgpt-clone-tutorial/customer-support-agent` in the Humanloop app. To change the path, modify the variable `PROMPT_HUMANLOOP_PATH` in the `api/chat/route.ts` file. ### Modify the code to capture user feedback Now, let's modify the code to start getting user feedback! Go back to the code editor and uncomment lines 174-193 in the `page.tsx` file. This snippet will add 👍 and 👎 buttons, that users can press to give feedback on the model's responses. ```typescript {13-31} return (
); ``` To understand how the feedback is captured and sent to Humanloop, let's check the `api/feedback/route.ts` file. We use [Humanloop TypeScript SDK](https://www.npmjs.com/package/humanloop) to make calls to Humanloop. To attach user feedback, we only need three parameters: * `parentId` is the Id of the [Log](/docs/explanation/logs) to which we want to attach feedback. The `page.txs` file stores all log Ids for model responses. * `path` is the path to the Evaluator. In this example, we're using an example 'rating' Evaluator. * `judgment` is the user feedback. ```typescript api/feedback/route.ts const response = await humanloop.evaluators.log({ // Pass the `logId` of the Prompt Log to record feedback against. parentId: logId, // Here, we're recording feedback against an example "rating" Evaluator, // which is of type `select` and has two possible options: "good" and "bad." path: "Example Evaluators/Human/rating", // Alternatively, we advise to specify Evaluator by id. This is more robust and less error-prone. // versionId: "ev_9WiSw2VYWjAb22duuQ"; judgment: judgment, //user feedback }); ``` ### Capture user feedback Refresh the page in your browser and give 👍 or 👎 to the model's responses.{message.role}{message.content ? ({message.content as string}) : (...)} {logId && ()}![]()
In the tutorial, we used the 'rating' Evaluator to capture user feedback. However, different use cases and user interfaces may require various types of feedback that need to be mapped to the appropriate end-user interactions. There are broadly 3 important kinds of feedback: 1. **Explicit feedback**: these are purposeful actions to review the generations. For example, ‘thumbs up/down’ button presses. 2. **Implicit feedback**: indirect actions taken by your users may signal whether the generation was good or bad, for example, whether the user ‘copied’ the generation, ‘saved it’ or ‘dismissed it’ (which is negative feedback). 3. **Free-form feedback**: Corrections and explanations provided by the end-user on the generation. You should create Human Evaluators structured to capture the feedback you need. For example, a Human Evaluator with return type "text" can be used to capture free-form feedback, while a Human Evaluator with return type "multi\_select" can be used to capture user actions that provide implicit feedback. If you have not done so, you can follow our guide to [create a Human Evaluator](/docs/evaluation/guides/human-evaluator) to set up the appropriate feedback schema. ### Review the logs in Humanloop With the user feedback captured, go back to the Humanloop app and review the logs. On the Performance tab, you can see all Evaluators and their values. The user feedback is captured in the rating Evaluator ('good' for 👍 and 'bad' for 👎).![]()
Click on Log and then on **Editor ->** button in the top right corner to open the Prompt Editor. In the Prompt Editor, you can make changes to the instructions and the model's parameters to improve the model's performance. Once you're happy with the changes, deploy the new version of the Prompt.
When users start interacting with the new version, compare the "good" to "bad" ratio to see if the changes have improved your users' experience. ## Next steps Now that you've successfully captured user feedback, you can explore more ways to improve your AI product: * If you found that your Prompt doesn't perform well, see our guide on [Comparing and Debugging Prompts](/docs/evaluation/guides/comparing-prompt-editor). * Leverage [Code](/docs/evaluation/guides/code-based-evaluator), [AI](/docs/evaluation/guides/llm-as-a-judge) and [Human](/docs/evaluation/guides/human-evaluators) Evaluators to continuously monitor and improve your AI product. *** title: Migrating from Humanloop subtitle: How to export your data from Humanloop description: Complete guide to exporting your Files, Versions, Logs, and Evaluations from Humanloop using our export tool. --------------------- For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. Following our acquisition, the Humanloop platform will be sunset on **September 8th, 2025**. This guide will walk you through exporting all your data from Humanloop, including Files, Versions, Logs, and Evaluations, so you can migrate to your chosen alternative platform. ## Frequently Asked Questions
## Exporting your data To help you migrate your data, we've created a comprehensive export tool that downloads all your Humanloop data in a structured format. ### Prerequisites * A Humanloop API key from the [API Keys page](https://app.humanloop.com/account/api-keys) * [uv](https://docs.astral.sh/uv/) installed on your system (or Python 3.10+) * [git](https://git-scm.com/) to clone the [Humanloop Export Tool](https://github.com/humanloop/humanloop-export) repository ### Step 1: Access the export tool Clone the Humanloop Export Tool repository: ```bash git clone https://github.com/humanloop/humanloop-export.git cd humanloop-export ``` ### Step 2: Follow the export instructions The export tool repository contains comprehensive instructions for: * **Configuration**: Setting up your API credentials and export preferences * **Selective exports**: Choosing specific directories or data types to export * **Running the export**: Step-by-step commands to download your data * **Output structure**: Understanding the exported data format * **Troubleshooting**: Resolving common issues during export Your Humanloop account and all associated data will be permanently deleted on September 8th, 2025. This includes all Files, Versions, Logs, Evaluations, and account settings. Please ensure you export any data you need before this date. All billing has stopped since July 30th, 2025. You will not be charged for any usage after this date. Any prepaid credits or subscriptions will end on the sunset date, and your payment details will be deleted. Our aim has been to give as much notice as possible, whilst working through legal constraints. We sent an email to all Humanloop users on July 17th, 2025 notifying you of the shutdown. We have done our best to make the export process as easy as possible. However, if you run into issues, please contact the support team at [support@humanloop.com](mailto:support@humanloop.com). Unfortunately, after September 8th, 2025, all data will be permanently inaccessible. There are now many great tools for AI evaluation and prompt management, with new options emerging all the time. We recommend you survey your options and try out what works for you. Some options we currently recommend in particular are: * [Langfuse](https://langfuse.com/) * [Braintrust](https://braintrust.dev/) **Complete instructions**: Please refer to the [repository README](https://github.com/humanloop/humanloop-export) for detailed, up-to-date export instructions. The repository contains the most current configuration options and usage guidelines. ### What data will be exported The export tool downloads: * **Files**: All your Prompts, Tools, Datasets, Flows, Agents, and Evaluators * **Versions**: Complete version history and configurations * **Deployments**: Environment deployment information * **Logs**: Usage logs and execution history (configurable) * **Evaluations**: Evaluation results, runs, and statistics * **Datapoints**: Dataset contents and test data ### Large datasets If you have more than 1 million Logs or very large datasets, contact our support team at [support@humanloop.com](mailto:support@humanloop.com). We can arrange a custom export process to ensure you receive all your data efficiently. ## Data format and migration The exported data is provided in JSON and JSONL formats, making it compatible with most data processing tools and alternative platforms. You may need to transform the data structure to match your chosen migration destination's requirements. ## Timeline and next steps**Important deadline**: Complete your data export well before September 8th, 2025\. After this date, the platform and all data will be permanently inaccessible. We recommend exporting your data as soon as possible while support is available. ### Recommended timeline: 1. **Immediately**: Export your data using the export tool 2. **Verify export**: Check that all critical data has been successfully downloaded 3. **Plan migration**: Research and select your alternative platform 4. **Test migration**: Import a subset of data to validate the migration process 5. **Complete migration**: Fully migrate to your new platform before September 8th ## Support For assistance with: * **Export tool issues**: [Open an issue](https://github.com/humanloop/humanloop-export/issues) in the repository * **General migration questions**: Contact our support team at [support@humanloop.com](mailto:support@humanloop.com) * **Large dataset exports**: Reach out to support for custom export arrangements We're committed to helping you successfully migrate your data during this transition period. *** subtitle: In this guide, we will walk through how to evaluate multiple different Prompts to compare quality and performance of each version. description: How to use Humanloop to evaluate multiple different Prompts across a Dataset. --------------------- For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. An **Evaluation** on Humanloop leverages a [Dataset](/docs/explanation/datasets), a set of [Evaluators](/docs/explanation/evaluators) and different versions of a [Prompt](/docs/explanation/prompts) to compare. The Dataset contains datapoints describing the inputs (and optionally the expected results) for a given task. The Evaluators define the criteria for judging the performance of the Prompts when executed using these inputs. [comment]: <> "The above should be in Explanation section but we haven't move it there" Prompts, when evaluated, produce [Logs](/docs/explanation/logs). These Logs are then judged by the Evaluators. You can see the summary of Evaluators judgments to systematically compare the performance of the different Prompt versions. ### Prerequisites * A set of [Prompt](/docs/explanation/prompts) versions you want to compare - see the guide on [creating Prompts](/docs/guides/prompts/create-prompt). * A [Dataset](/docs/explanation/datasets) containing datapoints for the task - see the guide on [creating a Dataset](/docs/evaluation/guides/upload-dataset-csv). * At least one [Evaluator](/docs/explanation/evaluators) to judge the performance of the Prompts - see the guides on creating [Code](/docs/evaluation/guides/code-based-evaluator), [AI](/docs/evaluation/guides/llm-as-a-judge) and [Human](/docs/evaluation/guides/human-evaluators) Evaluators. ## Run an Evaluation via UI For this example, we're going to evaluate the performance of a Support Agent that responds to user queries about Humanloop's product and documentation. Our goal is to understand which base model between `gpt-4o`, `gpt-4o-mini` and `claude-3-5-sonnet-20241022` is most appropriate for this task.### Navigate to the Evaluations tab of your Prompt * Go to the Prompt you want to evaluate and then click on **Evaluations** tab at the top of the page. * Click the **Evaluate** button top right to create a new Evaluation. * Click the **+Run** button top right to create a new Evaluation Run. ### Next Steps * Incorporate this Evaluation process into your Prompt engineering and deployment workflow. * Setup Evaluations where the runtime for producing Logs lives in your code - see our guide on [Logging](/docs/development/guides/log-to-a-prompt). * Utilise Evaluations as part of your [CI/CD pipeline](/docs/evaluation/guides/cicd-integration) *** subtitle: In this guide, we will walk through how to programmatically evaluate multiple different Prompts to compare the quality and performance of each version. --------------------- For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. An **Evaluation** on Humanloop leverages a [Dataset](/docs/explanation/datasets), a set of [Evaluators](/docs/explanation/evaluators) and different versions of a [Prompt](/docs/explanation/prompts) to compare.### Set up an Evaluation Run * Select a Dataset using **+Dataset**. * Add the Prompt versions you want to compare using **+Prompt**. * Add the Evaluators you want to use to judge the performance of the Prompts using **+Evaluator**.
By default the system will re-use Logs if they exist for the chosen Dataset, Prompts and Evaluators. This makes it easy to extend Evaluation Run without paying the cost of re-running your Prompts and Evaluators. If you want to force the system to re-run the Prompts against the Dataset producing a new batch of Logs, you can click on regenerate button next to the Logs count * Click **Save**. Humanloop will start generating Logs for the Evaluation.![]()
This guide assumes both the Prompt and Evaluator Logs are generated using the Humanloop runtime. For certain use cases where more flexibility is required, the runtime for producing Logs instead lives in your code - see our guide on [Logging](/docs/v5/guides/observability/logging-through-api), which also works with our Evaluations feature. We have a guide for how to run Evaluations with Logs generated in your code coming soon! ### Review the results Once the Logs are produced, you can review the performance of the different Prompt versions by navigating to the **Stats** tab. * The top spider plot provides you with a summary of the average Evaluator performance across all the Prompt versions. In our case, `gpt-4o`, although on average slightly slower and more expensive on average, is significantly better when it comes to **User Satisfaction**.* Below the spider plot, you can see the breakdown of performance per Evaluator.
* To drill into and debug the Logs that were generated, navigate to the **Review** tab at top left of the Run page. The Review view allows you to better understand performance and replay logs in our Prompt Editor.
![]()
In this guide, we use a Dataset to evaluate the performance of different Prompt versions. To learn how to evaluate Prompts without a Dataset, see the guide on [Spot-check your Logs](./spot-check-logs). ### Prerequisites * A set of [Prompt](/docs/explanation/prompts) versions you want to compare - see the guide on [creating Prompts](/docs/guides/prompts/create-prompt). * A [Dataset](/docs/explanation/datasets) containing datapoints for the task - see the guide on [creating a Dataset via API](/docs/v5/guides/evals/create-dataset-api). * At least one [Evaluator](/docs/explanation/evaluators) to judge the performance of the Prompts - see the guides on creating [Code](/docs/evaluation/guides/code-based-evaluator), [AI](/docs/evaluation/guides/llm-as-a-judge) and [Human](/docs/evaluation/guides/human-evaluators) Evaluators. ## Run an Evaluation For this guide, we're going to evaluate the performance of a Support Agent that responds to user queries about Humanloop's product and documentation. Our goal is to understand which base model between `gpt-4o`, `gpt-4o-mini` and `claude-3-5-sonnet-20241022` is most appropriate for this task.### Create a Prompt Create a Support Agent Prompt with three versions each using a different base model. # Run an Evaluation using your runtime If you choose to execute Prompts using your own Runtime, you still can benefit from Humanloop Evaluations. In code snippet below, we run Evaluators hosted on Humanloop using logs produced by the OpenAI client.```python from humanloop import Humanloop humanloop = Humanloop(api_key="YOUR_API_KEY") system_message = "You are a helpful assistant. Your job is to respond to FAQ style queries about the Humanloop documentation and platform. Be polite and succinct." gpt_4o = humanloop.prompts.upsert( path="Run Evaluation via API/Support Agent", model="gpt-4o", endpoint="chat", template=[ { "content": system_message, "role": "system", } ], provider="openai", version_name="gpt-4o", version_description="FAQ style support agent using gpt-4o", ) gpt_4o_mini = humanloop.prompts.upsert( path="Run Evaluation via API/Support Agent", model="gpt-4o-mini", endpoint="chat", template=[ { "content": system_message, "role": "system", } ], provider="openai", version_name="gpt-4o-mini", version_description="FAQ style support agent using gpt-4o-mini", ) sonnet = humanloop.prompts.upsert( path="Run Evaluation via API/Support Agent", model="claude-3-5-sonnet-20241022", endpoint="chat", template=[ { "content": system_message, "role": "system", } ], provider="anthropic", version_name="claude-3-5-sonnet", version_description="FAQ style support agent using Claude 3.5 Sonnet", ) # store prompt versions for later use prompt_versions = [gpt_4o.version_id, gpt_4o_mini.version_id, sonnet.version_id] ``` ```typescript import { HumanloopClient } from "humanloop"; const humanloop = new HumanloopClient({ apiKey: "HUMANLOOP_API_KEY" }); const systemMessage = "You are a helpful assistant. Your job is to respond to FAQ style queries about the Humanloop documentation and platform. Be polite and succinct."; const gpt_4o = await humanloop.prompts.upsert({ path: "Run Evaluation via API/Support Agent", model: "gpt-4o", endpoint: "chat", template: [ { "content": systemMessage, "role": "system", } ], provider: "openai", version_name: "gpt-4o", version_description: "FAQ style support agent using gpt-4o" }) const gpt_4o_mini = await humanloop.prompts.upsert({ path: "Run Evaluation via API/Support Agent", model: "gpt-4o-mini", endpoint: "chat", template: [ { "content": systemMessage, "role": "system", } ], provider: "openai", version_name: "gpt-4o-mini", version_description: "FAQ style support agent using gpt-4o-mini" }) const sonnet = await humanloop.prompts.upsert({ path: "Run Evaluation via API/Support Agent", model: "claude-3-5-sonnet-20241022", endpoint: "chat", template: [ { "content": systemMessage, "role": "system", } ], provider: "anthropic", version_name: "claude-3-5-sonnet", version_description: "FAQ style support agent using Claude 3.5 Sonnet" }) // store prompt versions for later use const promptVersions = [gpt_4o.versionId, gpt_4o_mini.versionId, sonnet.versionId] ``` ### Create a Dataset We defined sample data that contains user messages and desired responses for the Support Agent Prompt. We will now create a Dataset with these datapoints.```python humanloop.datasets.upsert( path="Run Evaluation via API/Dataset with user questions", datapoints=[ { "messages": [{ "role": "user", "content": "How do I manage my organization's API keys?", }], "target": {"answer": "Hey, thanks for your questions. Here are steps for how to achieve: 1. Log in to the Humanloop Dashboard \n\n2. Click on \"Organization Settings.\"\n If you do not see this option, you might need to contact your organization admin to gain the necessary permissions.\n\n3. Within the settings or organization settings, select the option labeled \"API Keys\" on the left. Here you will be able to view and manage your API keys.\n\n4. You will see a list of existing API keys. You can perform various actions, such as:\n - **Generate New API Key:** Click on the \"Generate New Key\" button if you need a new API key.\n - **Revoke an API Key:** If you need to disable an existing key, find the key in the list and click the \"Revoke\" or \"Delete\" button.\n - **Copy an API Key:** If you need to use an existing key, you can copy it to your clipboard by clicking the \"Copy\" button next to the key.\n\n5. **Save and Secure API Keys:** Make sure to securely store any new or existing API keys you are using. Treat them like passwords and do not share them publicly.\n\nIf you encounter any issues or need further assistance, it might be helpful to engage with an engineer or your IT department to ensure you have the necessary permissions and support.\n\nWould you need help with anything else?"}, }, { "messages":[{ "role": "user", "content": "Can I use my code evaluator for monitoring my legal-copilot prompt?", }], "target": {"answer": "Hey, thanks for your questions. Here are steps for how to achieve: 1. Navigate to your Prompt dashboard. \n 2. Select the `Monitoring` button on the top right of the Prompt dashboard \n 3. Within the model select the Version of the Evaluator you want to turn on for monitoring. \n\nWould you need help with anything else?"}, }, ], action="set", version_name="User questions", version_description="Add two new questions and answers", ) ``` ```typescript await humanloop.datasets.upsert({ path: "Run Evaluation via API/Dataset with user questions", datapoints: [{ "messages": [{ "role": "user", "content": "How do i manage my organizations API keys?", }], "target": {"answer": "Hey, thanks for your questions. Here are steps for how to achieve: 1. Log in to the Humanloop Dashboard \n\n2. Click on \"Organization Settings.\"\n If you do not see this option, you might need to contact your organization admin to gain the necessary permissions.\n\n3. Within the settings or organization settings, select the option labeled \"API Keys\" on the left. Here you will be able to view and manage your API keys.\n\n4. You will see a list of existing API keys. You can perform various actions, such as:\n - **Generate New API Key:** Click on the \"Generate New Key\" button if you need a new API key.\n - **Revoke an API Key:** If you need to disable an existing key, find the key in the list and click the \"Revoke\" or \"Delete\" button.\n - **Copy an API Key:** If you need to use an existing key, you can copy it to your clipboard by clicking the \"Copy\" button next to the key.\n\n5. **Save and Secure API Keys:** Make sure to securely store any new or existing API keys you are using. Treat them like passwords and do not share them publicly.\n\nIf you encounter any issues or need further assistance, it might be helpful to engage with an engineer or your IT department to ensure you have the necessary permissions and support.\n\nWould you need help with anything else?"}, }, { "messages":[{ "role": "user", "content": "Hey, can do I use my code evaluator for monitoring my legal-copilot prompt?", }], "target": {"answer": "Hey, thanks for your questions. Here are steps for how to achieve: 1. Navigate to your Prompt dashboard. \n 2. Select the `Monitoring` button on the top right of the Prompt dashboard \n 3. Within the model select the Version of the Evaluator you want to turn on for monitoring. \n\nWould you need help with anything else?"}, }], action: "set", version_name: "User questions", version_description: "Add two new questions and answers" }); ``` ### Create an Evaluation We create an Evaluation Run to compare the performance of the different Prompts using the Dataset we just created. For this guide, we selected *Semantic Similarity*, *Cost* and *Latency* Evaluators. You can find these Evaluators in the **Example Evaluators** folder in your workspace."Semantic Similarity" Evaluator measures the degree of similarity between the model's response and the expected output. The similarity is rated on a scale from 1 to 5, where 5 means very similar. ```python evaluation = humanloop.evaluations.create( name="Evaluation via API", file={ "path": "Run Evaluation via API/Support Agent", }, evaluators=[{"path": "Example Evaluators/AI/Semantic Similarity"}, {"path": "Example Evaluators/Code/Cost"}, {"path": "Example Evaluators/Code/Latency"}], ) # Create a Run for each prompt version for prompt_version in prompt_versions: humanloop.evaluations.create_run( id=evaluation.id, dataset={"path": "Run Evaluation via API/Dataset with user questions"}, version={"version_id": prompt_version}, ) ``` ```typescript const evaluation = await humanloop.evaluations.create({ name: "Evaluation via API", file: { "path": "Run Evaluation via API/Support Agent", }, evaluators: [{"path": "Example Evaluators/AI/Semantic Similarity"}, {"path": "Example Evaluators/Code/Cost"}, {"path": "Example Evaluators/Code/Latency"}], }); for (const promptVersion of promptVersions) { await humanloop.evaluations.createRun(evaluation.id, { dataset: { path: "Run Evaluation via API/Dataset with user questions" }, version: { versionId: promptVersion }, }); } ``` ### Inspect the Evaluation stats When Runs are completed, you can inspect the Evaluation Stats to see the summary of the Evaluators judgments.```python evaluation_stats = humanloop.evaluations.get_stats( id=evaluation.id, ) print(evaluation_stats.report) ``` ```typescript const evaluationStats = await humanloop.evaluations.getStats(evaluation.id); console.log(evaluationStats.report); ``` Alternatively you can see detailed stats in the Humanloop UI. Navigate to the Prompt, click on the **Evaluations** tab at the top of the page and select the Evaluation you just created. The stats are displayed in the **Stats** tab.
![]()
```python # create new Humanloop prompt prompt = humanloop.prompts.upsert( path="Run Evaluation via API/Support Agent my own runtime", model="gpt-4o", endpoint="chat", template=[ { "content": "You are a helpful assistant. Your job is to respond to FAQ style queries about the Humanloop documentation and platform. Be polite and succinct.", "role": "system", } ], provider="openai", ) # create the evaluation evaluation = humanloop.evaluations.create( name="Evaluation via API using my own runtime", file={ "path": "Run Evaluation via API/Support Agent my own runtime", }, evaluators=[{"path": "Example Evaluators/AI/Semantic Similarity"}, {"path": "Example Evaluators/Code/Cost"}, {"path": "Example Evaluators/Code/Latency"}], ) # use dataset created in previous steps datapoints = humanloop.datasets.list_datapoints(dataset.id) import openai openai_client = openai.OpenAI(api_key="OPENAI_API_KEY") # create a run run = humanloop.evaluations.create_run( id=evaluation.id, dataset={"version_id": dataset.version_id}, version={"version_id": prompt.version_id}, ) # for each datapoint in the dataset, create a chat completion for datapoint in datapoints: # create a run chat_completion = openai_client.chat.completions.create( messages=datapoint.messages, model=prompt.model ) # log the prompt humanloop.prompts.log( id=prompt.id, run_id=run.id, version_id=prompt.version_id, source_datapoint_id=datapoint.id, output_message=chat_completion.choices[0].message, messages=datapoint.messages, ) ``` ```typescript // create a new Humanloop prompt const prompt = await humanloop.prompts.upsert({ path: "Run Evaluation via API/Support Agent my own runtime", model: "gpt-4o", endpoint: "chat", template: [ { content: "You are a helpful assistant. Your job is to respond to FAQ style queries about the Humanloop documentation and platform. Be polite and succinct.", role: "system", }, ], provider: "openai", }); // create the evaluation const evaluation = await humanloop.evaluations.create({ name: "Evaluation via API using my own runtime", file: { path: "Run Evaluation via API/Support Agent my own runtime", }, evaluators: [ { path: "Example Evaluators/AI/Semantic Similarity" }, { path: "Example Evaluators/Code/Cost" }, { path: "Example Evaluators/Code/Latency" }, ], }); // use dataset created in previous steps const datapoints = await humanloop.datasets.listDatapoints(dataset.id); // import openai const openaiClient = new OpenAI({ apiKey: "OPENAI_API_KEY", }); // create a run const run = await humanloop.evaluations.createRun(evaluation.id, { dataset: { versionId: dataset.versionId }, version: { versionId: prompt.versionId }, }); // for each datapoint in the dataset, create a chat completion for (const datapoint of datapoints.data) { // create a run const chatCompletion = await openaiClient.chat.completions.create({ messages: datapoint.messages, model: prompt.model, }); // log the prompt await humanloop.prompts.log({ id: prompt.id, runId: run.id, versionId: prompt.versionId, sourceDatapointId: datapoint.id, outputMessage: chatCompletion.choices[0].message, messages: datapoint.messages, }); } ``` ## Next steps * Learn how to [set up LLM as a Judge](./llm-as-a-judge) to evaluate your AI applications. *** subtitle: In this guide, we will walk through creating a Dataset on Humanloop from a CSV. description: Learn how to create Datasets in Humanloop to define fixed examples for your projects, and build up a collection of input-output pairs for evaluation and fine-tuning. --------------------- For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. [Datasets](/docs/explanation/datasets) are a collection of input-output pairs that can be used to evaluate your Prompts, Tools or even Evaluators. ### Prerequisites You should have an existing [Prompt](/docs/explanation/prompts) on Humanloop with a variable defined with our double curly bracket syntax `{{variable}}`. If not, first follow our guide on [creating a Prompt](../prompts/create-prompt). In this example, we'll use a Prompt that categorises user queries about Humanloop's product and docs by which feature they relate to.## Steps To create a dataset from a CSV file, we'll first create a CSV in Google Sheets that contains values for our Prompt variable `{{query}}` and then upload it to a Dataset on Humanloop.
### Create a CSV file. * In our Google Sheets example below, we have a column called `query` which contains possible values for our Prompt variable `{{query}}`. You can include as many columns as you have variables in your Prompt template. * There is additionally a column called `target` which will populate the target output for the classifier Prompt. In this case, we use simple strings to define the target. * More complex Datapoints that contain `messages` and structured objects for targets are supported, but are harder to incorporate into a CSV file as they tend to be hard-to-read JSON. If you need more complex Datapoints, [use the API](./create-dataset-api) instead. ### Save the Dataset Click the **Save** button at the top of the Dataset editor and optionally provide a name and description for this version. Press **Save** again.### Export the Google Sheet to CSV In Google Sheets, choose **File** → **Download** → **Comma-separated values (.csv)** ### Create a new Dataset File On Humanloop, select *New* at the bottom of the left-hand sidebar, then select *Dataset*.
### Click **Upload CSV** First name your dataset when prompted in the sidebar, then select the **Upload CSV** button and drag and drop the CSV file you created above using the file explorer. Press **Upload Dataset from CSV...**.
### Map the CSV columns Map each of the CSV columns into one of `input`, `message`, `target`. To avoid uploading a column of your CSV you can map it to the `exclude` option. To map in columns to Messages, they need to be in a specific format. An example of this can be seen in our example Dataset or below: ``` "[{""role"": ""user"", ""content"": ""Tell me about the weather""}]" ``` Once you have mapped your columns, press **Extend Current Dataset**
### Review your uploaded datapoints You'll see the input-output pairs that were included in the CSV file and you can review the rows to inspect and edit the individual Datapoints.
![]()
Your dataset is now uploaded and ready for use. ## Next steps 🎉 Now that you have Datasets defined in Humanloop, you can leverage our [Evaluations](./overview) feature to systematically measure and improve the performance of your AI applications. See our guides on [setting up Evaluators](./llm-as-a-judge) and [Running an Evaluation](/docs/guides/evals/run-evaluation-ui) to get started. For different ways to create datasets, see the links below: * [Create a Dataset from existing Logs](./create-dataset-from-logs) - useful for curating Datasets based on how your AI application has been behaving in the wild. * [Upload via API](./create-dataset-api) - useful for uploading more complex Datasets that may have nested JSON structures, which are difficult to represent in tabular .CSV format, and for integrating with your existing data pipelines. *** subtitle: In this guide, we will walk through creating a Dataset on Humanloop via the API description: Learn how to create Datasets in Humanloop to define fixed examples for your projects, and build up a collection of input-output pairs for evaluation and fine-tuning. --------------------- For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. [Datasets](/docs/explanation/datasets) are a collection of input-output pairs that can be used to evaluate your Prompts, Tools or even Evaluators. ### Prerequisites If you are using the SDK, the only prerequisite is to have the SDK installed and configured. If you are using the API directly, you will need to have an API key.
First you need to install and initialize the SDK. If you have already done this, skip to the next section. Open up your terminal and follow these steps: 1. Install the Humanloop SDK: ## Steps Using the API is a great way to integrate Humanloop with your existing data pipeline or just to once-off upload a more complex Dataset that is hard to represent in a CSV file, such as one that contains an array of messages and JSON targets.```python pip install humanloop ``` ```typescript npm install humanloop ``` 2. Initialize the SDK with your Humanloop API key (you can get it from the [Organization Settings page](https://app.humanloop.com/account/api-keys)).```python from humanloop import Humanloop humanloop = Humanloop(api_key=" ") # Check that the authentication was successful print(humanloop.prompts.list()) ``` ```typescript import { HumanloopClient, Humanloop } from "humanloop"; const humanloop = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); // Check that the authentication was successful console.log(await humanloop.prompts.list()); ``` ### Post data to the Datasets API We first define some sample data that contains user messages and desired responses from our [Support Agent Prompt](./create-dataset-from-logs) and call the `POST /datasets` endpoint to upload it as follows: ## Next steps 🎉 Now that you have Datasets defined in Humanloop, you can leverage our [Evaluations](./overview) feature to systematically measure and improve the performance of your AI applications. See our guides on [setting up Evaluators](./llm-as-a-judge) and [Running an Evaluation](/docs/guides/evals/run-evaluation-ui) to get started. For different ways to create datasets, see the links below: * [Create a Dataset from existing Logs](./create-dataset-from-logs) - useful for curating Datasets based on how your AI application has been behaving in the wild. * [Upload data from CSV](./upload-dataset-csv) - useful for quickly uploading existing tabular data you've collected outside of Humanloop. *** subtitle: In this guide, we will walk through creating a Dataset on Humanloop from your existing Logs. description: Learn how to create Datasets in Humanloop to define fixed examples for your projects, and build up a collection of input-output pairs for evaluation and fine-tuning. --------------------- For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. [Datasets](/docs/explanation/datasets) are a collection of input-output pairs that can be used to evaluate your Prompts, Tools or even Evaluators. This guide will show you how to create Datasets in Humanloop from your Logs. ### Prerequisites You should have an existing [Prompt](/docs/explanation/prompts) on Humanloop and already generated some [Logs](/docs/explanation/logs). Follow our guide on [creating a Prompt](../prompts/create-prompt). ## Steps To create a Dataset from existing Logs:### Inspect the uploaded Dataset After running this code, in your Humanloop workspace you will now see a Dataset called `Support Query Ground Truth` (or whatever value was in `path`) with your sample data. ![]()
### Navigate to the **Logs** of your Prompt Our Prompt in this example is a Support Agent that answers user queries about Humanloop's product and docs: ## Next steps 🎉 Now that you have Datasets defined in Humanloop, you can leverage our [Evaluations](./overview) feature to systematically measure and improve the performance of your AI applications. See our guides on [setting up Evaluators](./llm-as-a-judge) and [Running an Evaluation](/docs/guides/evals/run-evaluation-ui) to get started. For different ways to create datasets, see the links below: * [Upload data from CSV](./upload-dataset-csv) - useful for quickly uploading existing tabular data you've collected outside of Humanloop. * [Upload via API](./create-dataset-api) - useful for uploading more complex Datasets that may have nested JSON structures, which are difficult to represent in tabular .CSV format, and for integrating with your existing data pipelines. *** subtitle: In this guide we will show how to create and use a code Evaluator in Humanloop description: Learn how to create a code Evaluators in Humanloop to assess the performance of your AI applications. This guide covers setting up an offline evaluator, writing evaluation logic, and using the debug console. --------------------- For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. A code [Evaluator](/docs/explanation/evaluators) is a Python function that takes a generated [Log](/docs/explanation/logs) (and optionally a testcase [Datapoint](/docs/explanation/datasets) if comparing to expected results) as input and returns a **judgement**. The judgement is in the form of a boolean or number that measures some criteria of the generated Log defined within the code. Code Evaluators provide a flexible way to evaluate the performance of your AI applications, allowing you to re-use existing evaluation packages as well as define custom evaluation heuristics. We support a fully featured Python environment; details on the supported packages can be found in the [environment reference](/docs/v5/reference/python-environment) ### Prerequisites You should have an existing [Prompt](/docs/explanation/prompts) to evaluate and already generated some [Logs](/docs/explanation/logs). Follow our guide on [creating a Prompt](/docs/guides/prompts/create-prompt). In this example, we'll reference a Prompt that categorises a user query about Humanloop's product and docs by which feature it relates to.### Select a subset of the Logs to add Filter logs on a criteria of interest, such as the version of the Prompt used, then multi-select Logs. In the menu in the top right of the page, select **Add to Dataset**.
### Add to a new Dataset Provide a name for the new Dataset and click **Create** (or you can click **add to existing Dataset** to append the selection to an existing Dataset). Then you can optionally add a version name. A description is pre-filled with details from the source Logs — you can edit this to add more context about the new version if you’d like.
You will then see the new Dataset appear at the same level in the filesystem as your Prompt.
## Create a code Evaluator
### Create a new Evaluator * Click the **New** button at the bottom of the left-hand sidebar, select **Evaluator**, then select **Code**. ## Monitor a Prompt Now that you have an Evaluator, you can use it to monitor the performance of your Prompt by linking it so that it is automatically run on new Logs.* Give the Evaluator a name when prompted in the sidebar, for example `Category Validator`. ### Define the Evaluator code After creating the Evaluator, you will automatically be taken to the code editor. For this example, our Evaluator will check that the feature category returned by the Prompt is from the list of allowed feature categories. We want to ensure our categoriser isn't hallucinating new features. * Make sure the **Mode** of the Evaluator is set to **Online** in the options on the left. * Copy and paste the following code into the code editor: ```python Python ALLOWED_FEATURES = [ "Prompt Editor", "Model Integrations", "Online Monitoring", "Offline Evaluations", "Dataset Management", "User Management", "Roles Based Access Control", "Deployment Options", "Collaboration", "Agents and chaining" ] def validate_feature(log): print(f"Full log output: \n {log['output']}") # Parse the final line of the log output to get the returned category feature = log["output"].split("\n")[-1] return feature in ALLOWED_FEATURES ```
You can define multiple functions in the code Editor to organize your evaluation logic. The final function defined is used as the main Evaluator entry point that takes the Log argument and returns a valid judgement. ### Debug the code with Prompt Logs * In the debug console beneath where you pasted the code, click **Select Prompt or Dataset** and find and select the Prompt you're evaluating. The debug console will load a sample of Logs from that Prompt.* Click the **Run** button at the far right of one of the loaded Logs to trigger a debug run. This causes the code to be executed with the selected Log as input and populates the **Result** column. * Inspect the output of the executed code by selecting the arrow to the right of **Result**.
### Save the code Now that you've validated the behaviour, save the code by selecting the **Save** button at the top right of the Editor and optionally provide a suitable version name and description. ### Inspect Evaluator logs Navigate to the **Logs** tab of the Evaluator to see and debug all the historic usages of this Evaluator.
![]()
### Link the Evaluator to the Prompt * Navigate to the **Dashboard** of your Prompt * Select the **Monitoring** button above the graph and select **Connect Evaluators**. * Find and select the Evaluator you just created and click **Chose**. ## Evaluating a Dataset When running a code Evaluator on a [Dataset](/docs/explanation/datasets), you can compare a generated [Log](/docs/explanation/logs) to each Datapoint's target. For example, here's the code of our example Exact Match code evaluator, which checks that the log output exactly matches our expected target. ```python Python def exact_match(log, testcase): target = testcase["target"]["output"] generation = log["output"] return target == generation ``` ## Next steps * Explore [AI Evaluators](/docs/evaluation/guides/llm-as-a-judge) and [Human Evaluators](/docs/evaluation/guides/human-evaluators) to complement your code-based judgements for more qualitative and subjective criteria. * Combine your Evaluator with a [Dataset](/docs/explanation/datasets) to run [Evaluations](/docs/guides/evals/run-evaluation-ui) to systematically compare the performance of different versions of your AI application. *** subtitle: In this guide, we will set up an LLM evaluator to check for PII (Personally Identifiable Information) in Logs. description: Learn how to use LLM as a judge to check for PII in Logs. --------------------- For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. LLMs can be used for evaluating the quality and characteristics of other AI-generated outputs. When correctly prompted, LLMs can act as impartial judges, providing insights and assessments that might be challenging or time-consuming for humans to perform at scale. In this guide, we'll explore how to setup an LLM as an [AI Evaluator](/docs/explanation/evaluators) in Humanloop, demonstrating their effectiveness in assessing various aspects of AI-generated content, such as checking for the presence of Personally Identifiable Information (PII). An AI [Evaluator](/docs/explanation/evaluators) is a Prompt that takes attributes from a generated [Log](/docs/explanation/logs) (and optionally from a testcase [Datapoint](/docs/explanation/datasets) if comparing to expected results) as context and returns a **judgement**. The judgement is in the form of a boolean or number that measures some criteria of the generated Log defined within the Prompt instructions. ### Prerequisites You should have an existing [Prompt](/docs/explanation/prompts) to evaluate and already generated some [Logs](/docs/explanation/logs). Follow our guide on [creating a Prompt](/docs/guides/prompts/create-prompt). In this example we will use a simple Support Agent Prompt that answers user queries about Humanloop's product and docs.![]()
You can link to a deployed version of the Evaluator by choosing the environment such as `production`, or you can link to a specific version of the Evaluator. If you want changes deployed to your Evaluator to be automatically reflected in Monitoring, link to the environment, otherwise link to a specific version. This linking results in: - An additional graph on your Prompt dashboard showing the Evaluator results over time. - An additional column in your Prompt Versions table showing the aggregated Evaluator results for each version. - An additional column in your Logs table showing the Evaluator results for each Log. ### Generate new Logs Navigate to the **Editor** tab of your Prompt and generate a new Log by entering a query and clicking **Run**. ### Inspect the Monitoring results Navigate to the **Logs** tab of your Prompt and see the result of the linked Evaluator against the new Log. You can filter on this value in order to [create a Dataset](/docs/guides/evals/create-dataset-api) of interesting examples.![]()
## Create an LLM Evaluator
### Create a new Evaluator * Click the **New** button at the bottom of the left-hand sidebar, select **Evaluator**, then select **AI**. * Give the Evaluator a name when prompted in the sidebar, for example `PII Identifier`. ### Define the Evaluator Prompt After creating the Evaluator, you will automatically be taken to the Evaluator editor. For this example, our Evaluator will check whether the request to, or response from, our support agent contains PII. The Evaluator acts as Guardrail, helping us spot issues in our agent workflow. * Make sure the **Mode** of the Evaluator is set to **Online** in the options on the left. * Copy and paste the following Prompt into the Editor: ```text You are a helpful assistant. Your job is to observe the requests and outputs to a support agent and identify whether or not they contain any PII. Examples of PII information are: - Names - Addresses - Bank account information - Job information Here is the request and response information: ### Request: {{log.messages}} ### Response: {{log.output_message}} ### Your response should contain the rationale and the final binary true/false verdict as to whether PII exists in the request resposne. The final true/false verdit should be on a new line at the end. ``` ## Next steps * Explore [Code Evaluators](/docs/guides/evals/code-based-evaluator) and [Human Evaluators](/docs/guides/evals/human-evaluators) to complement your AI judgements. * Combine your Evaluator with a [Dataset](/docs/explanation/datasets) to run [Evaluations](/docs/guides/evals/run-evaluation-ui) to systematically compare the performance of different versions of your AI application. *** subtitle: In this guide we will show how to create and use a Human Evaluator in Humanloop description: Learn how to set up a Human Evaluator in Humanloop. Human Evaluators allow your subject-matter experts and end-users to provide feedback on Prompt Logs. --------------------- For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. Human Evaluators allow your subject-matter experts and end-users to provide feedback on Prompt Logs. These Evaluators can be attached to Prompts and Evaluations. ## Creating a Human Evaluator This section will bring you through creating and setting up a Human Evaluator. As an example, we'll use a "Tone" Evaluator that allows feedback to be provided by selecting from a list of options.In the Prompt Editor for an LLM evaluator, you have access to the underlying `log` you are evaluating as well as the `testcase` Datapoint that gave rise to it if you are using a Dataset for **offline** Evaluations. These are accessed with the standard `{{ variable }}` syntax, enhanced with a familiar dot notation to pick out specific values from inside the `log` and `testcase` objects. For example, suppose you are evaluating a Log object like this. ```json { "id": "data_B3RmIu9aA5FibdtXP7CkO", "prompt": {...}, "inputs": { "query": "What is the meaning of life?", }, "messages": [] "output": "I'm sorry, as an AI I don't have the capacity to understand the meaning of life.", "metadata": {...}, ...etc } ``` In the LLM Evaluator Prompt, `{{ log.inputs.query }}` will be replaced with the actual query in the final prompt sent to the LLM Evaluator. In order to get access to the fully populated Prompt that was sent in the underlying Log, you can use the special variable `{{ log_prompt }}`. ### Debug the code with Prompt Logs * In the debug console beneath where you pasted the code, click **Select Prompt or Dataset** and find and select the Prompt you're evaluating. The debug console will load a sample of Logs from that Prompt.* Click the **Run** button at the far right of one of the loaded Logs to trigger a debug run. This causes the Evaluator Prompt to be called with the selected Log attributes as input and populates the **Result** column. * Inspect the output of the executed code by selecting the arrow to the right of **Result**.
### Save the code Now that you've validated the behaviour, save the code by selecting the **Save** button at the top right of the Editor and optionally provide a suitable version name and description. ### Inspect Evaluator logs Navigate to the **Logs** tab of the Evaluator to see and debug all the historic usages of this Evaluator.
![]()
### Create a new Evaluator * Click the **New** button at the bottom of the left-hand sidebar, select **Evaluator**, then select **Human**.  * Give the Evaluator a name when prompted in the sidebar, for example "Tone".  ### Define the Judgment Schema After creating the Evaluator, you will automatically be taken to the Editor. Here, you can define the schema detailing the kinds of judgments to be applied for the Evaluator. The Evaluator will be initialized to a 5-point rating scale by default. In this example, we'll set up a feedback schema for a "Tone" Evaluator. See the [Return types documentation](/docs/explanation/evaluators#return-types) for more information on return types. * Select **Multi-select** within the **Return type** dropdown. "Multi-select" allows you to apply multiple options to a single Log. * Add the following options, and set the valence for each: * Enthusiastic \[positive] * Informative \[postiive] * Repetitive \[negative] * Technical \[negative] * Update the instructions to "Select all options that apply to the output."  ### Save and deploy the Evaluator * Click **Save** in the top-right corner. * Enter "Tone multi-select v1" for the version name and "Added initial tone options" for the description. Click **Save**.  * Press **Deploy** in the next dialog. * Select your default Environment (usually "production"). * Confirm your deployment.  :tada: You've now created a Human Evaluator that can be used to collect feedback on Prompt Logs. ## Next steps * [Use Human Evaluators in Evaluations](/docs/guides/evals/run-human-evaluation) to collect annotations on Prompt Logs from subject-matter experts. * [Attach Human Evaluators to Prompts](/docs/tutorials/capture-user-feedback) to collect end-user feedback *** subtitle: Collect judgments from subject-matter experts (SMEs) to better understand the quality of your AI product. --------------------- For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. In this guide, we'll show how SMEs can provide judgments on Prompt Logs to help you understand the quality of the AI feature. You can then use this feedback to iterate and improve your Prompt performance. ### Prerequisites * You have set up a Human Evaluator appropriate for your use-case. If not, follow our guide to [create a Human Evaluator](/docs/evaluation/guides/human-evaluators). * You have a Dataset with test data to evaluate model outputs against. If not, follow our guide to [create a Dataset from already existing Logs](/docs/evaluation/guides/create-dataset-from-logs). ## Provide judgments on Logs In this guide, we assume you have already created a Prompt and a Dataset for an evaluation. Now we want to leverage the subject-matter experts to help us understand whether model outputs meet our quality standards.### Create a new Evaluation Navigate to the Prompt you want to evaluate and click on the **Evaluation** tab at the top of the page. Click on **Evaluate** to create a new Evaluation. ## Improve the Prompt Explore the Logs that the SME flagged in the Review tab. To make improvements, find a Log with negative judgments and click on its ID above the Log output to open the drawer on the right-hand side. In the drawer, click on the **Editor ->** button to load the Prompt Editor. Now, modify the instructions and save a new version.### Create a new Run To evaluate a version of your Prompt, click on the **+Run** button, then select the version of the Prompt you want to evaluate and the Dataset you want to use. Click on **+Evaluator** to add a Human Evaluator to the Evaluation.
You can find example Human Evaluators in the **Example Evaluators** folder. Click **Save** to create a new Run. Humanloop will start generating Logs for the Evaluation. ### Apply judgments to generated Logs When Logs are generated, navigate to the **Review** tab. Turn on **Focus mode** and start providing judgments on the generated Logs.
When the last judgment is provided, the Run is marked as complete.
### Review judgments stats You can see the overall performance across all Evaluators in the **Stats** tab.
![]()
Create a new run using the new version of the Prompt and compare the results to find out if the changes have improved the performance. ## Next steps We've successfully collected judgments from the SMEs to understand the quality of our AI product. Explore next: * If your team has multiple internal SMEs, learn how to [effectively manage evaluation involving multiple SMEs](/docs/evaluation/guides/manage-multiple-reviewers). * If SMEs provided negative judgments on the logs, please refer to our guide on [Comparing and Debugging Prompts](/docs/evaluation/guides/comparing-prompt-editor). *** subtitle: How to split a review between multiple subject-matter experts to effectively and quickly evaluate your AI product. description: Learn how to split the work between your SMEs --------------------- For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt.
**Who is this for**: This guide is for large teams that want to leverage their internal subject matter experts (SMEs) to evaluate the performance of their AI features. ### Prerequisites * You have set up [Evaluators](/docs/explanation/evaluators). If not, follow our guide to [create a Human Evaluator](/docs/evaluation/guides/human-evaluators). * You have several subject-matter experts (SMEs) available to provide feedback on Evaluation Logs. ## Divide work between SMEs When you have a large [Dataset](/docs/explanation/datasets) to evaluate, it's helpful to split the work between your SMEs to ensure that the evaluation is completed quickly and effectively.### Split the Dataset into chunks Each Dataset consists of datapoints. Add an identifier to each datapoint to group them into chunks. For example, we [created](https://github.com/humanloop/humanloop-cookbook/blob/main/assets/datasets/dataset_with_common_customer_support_questions.csv) a Dataset with 100 common customer support questions. In the csv file, we added an identifier called "chunk" to each datapoint, splitting the whole Dataset into 10 equal parts. To upload this CSV on Humanloop, create a new Dataset file, then click on the **Upload CSV** button. ## Improve the Prompt With judgments from your SMEs, you can now better understand the model's performance and iterate on your Prompt to improve the model outputs.Alternatively, you [upload Dataset via our SDK](/docs/v5/guides/evals/create-dataset-api) ### Run an Evaluation Navigate to a Prompt you want to evaluate and create a new Evaluation Run.
### Split the workload between SMEs To split the workload between your SMEs, navigate to the **Review** tab, turn on **Focus mode**, and click on the **Filters** button. Filter the Dataset by identifiers, such as "chunk", to split the review work into smaller pieces. ### Send the URL to your SMEs After you have filtered the Dataset, copy the URL and send it to your SME. When they open the link, they will only see the relevant chunk of the Dataset.
### Monitor progress As the SMEs provide judgments on the outputs, we display the overall progress and the number of outstanding judgments. When the final judgment is given, the Evaluation is marked as complete.
In our example, the SME marked the Log on the right-hand side as "bad" because it's too long. To take action, click on the Log ID above the Log output to open the Log drawer. In the drawer, click on the **Editor ->** button to load this Log in the Prompt Editor. Now, modify the instructions to explicitly state that the model should provide a concise answer. ## Next steps We've successfully split the work among multiple SMEs to effectively evaluate the performance of our AI product. Explore next: * If your SMEs gave negative judgments on the Logs, see our guide on [Comparing and Debugging Prompts](/docs/evaluation/guides/comparing-prompt-editor). * Find out more about [Human Evaluators](/docs/evaluation/guides/human-evaluators) to capture feedback that is most relevant to your use case. *** subtitle: In this guide, we will walk through comparing the outputs from multiple Prompts side-by-side using the Humanloop Editor environment and using diffs to help debugging. --------------------- For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. You can compare Prompt versions interactively side-by-side to get a sense for how their behaviour differs; before then triggering more systematic [Evaluations](/docs/guides/evals/run-evaluation-ui). All the interactions in Editor are stored as Logs within your Prompt and can be inspected further and [added to a Dataset](/docs/evaluation/guides/create-dataset-from-logs) for Evaluations. ### Prerequisites * You already have a Prompt — if not, please follow our [Prompt creation](/docs/development/guides/create-prompt) guide first. ## Compare Prompt versions In this example we will use a simple support agent Prompt that answers user queries about Humanloop's product and docs.
![]()
### Create a new version of your Prompt Open your Prompt in the Editor. Under **Parameters**, change some details such as the choice of `Model`. In this example, we change from `gpt-4o` to `gpt-4o-mini`. ## View Prompt diff for debugging When debugging more complex Prompts, it's important to understand what changes were made between different versions. Humanloop provides a diff view to support this.Now save the new version of your Prompt by selecting the **Save** button in the top right and optionally provide a helpful version name (e.g. "Simple Support Agent v2") and/or description (e.g. "Changed model to gpt-4o-mini"). ### Load up two versions of your Prompt in the Editor To load up the previous version side-by-side, select the menu beside the Load button and select the **New panel** option (depending on your screen real-estate, you can add more than 2 panels).
Then press the *Load* button in the new panel and select another version of your Prompt to compare.
### Compare the outputs of both versions Now you can run the same user messages through both models to compare their behaviours live, side-by-side.
![]()
### Navigate to your Prompt dashboard In the sidebar, select the **Dashboard** section under your Prompt file, where you will find a table of all your Prompt versions. 1. In the comparison view, you'll see a diff that highlights the changes between the selected versions. 2. The diff shows additions in green and deletions in red. Modified content appears as a combination of red (for removed text) and green (for added text). 3. Use this view to understand how specific changes affect the output. By following these steps, you can effectively compare different versions of your Prompts and iterate on your instructions to improve performance. *** subtitle: In this guide, we will walk through setting up CI/CD integration for Humanloop evaluations using GitHub Actions. description: Learn how to automate LLM evaluations as part of your CI/CD pipeline using Humanloop and GitHub Actions. --------------------- For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. ## Setting up CI/CD Integration with GitHub Actions Integrating Humanloop evaluations into your CI/CD pipeline allows you to automatically test your AI applications as part of your development workflow. This guide will walk you through setting up this integration using GitHub Actions. ### Prerequisites * A GitHub repository for your project * A Humanloop account with access to Evaluations * A Prompt and Dataset set up in Humanloop * An Evaluator configured in Humanloop ## Steps to Set Up CI/CD Integration### Select the versions to compare In the table, select two rows you would like to see the changes between. Then select the **Show diff** button above the table.
![]()
### Create a GitHub Actions Workflow In your GitHub repository, create a new file `.github/workflows/humanloop-eval.yml` with the following content: *** subtitle: How to create an Evaluation Run to review a sample of your Logs, ensuring your model generations remain high-quality. description: Learn how to use the Humanloop Python SDK to sample a subset of your Logs and create an Evaluation Run to spot-check them. --------------------- For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. By regularly reviewing a sample of your Prompt Logs, you can gain valuable insights into the performance of your Prompts in production, such as through reviews by subject-matter experts (SMEs).This content is currently under development. Please refer to our [V4 documentation](https://docs.humanloop.com/v4) for the current docs. ```yaml ```For real-time observability (typically using code Evaluators), see our guide on setting up [monitoring](../observability/monitoring). This guide describes setting up more detailed evaluations which are run on a small subset of Logs. ### Prerequisites * You have a Prompt with Logs. See our guide on [logging to a Prompt](/docs/guides/prompts/log-to-a-prompt) if you don't yet have one. * You have a Human Evaluator set up. See our guide on [creating a Human Evaluator](/docs/guides/evals/human-evaluators) if you don't yet have one. {/* TODO: This should be Python-only. */}First you need to install and initialize the SDK. If you have already done this, skip to the next section. Open up your terminal and follow these steps: 1. Install the Humanloop SDK: ## Set up an Evaluation```python pip install humanloop ``` ```typescript npm install humanloop ``` 2. Initialize the SDK with your Humanloop API key (you can get it from the [Organization Settings page](https://app.humanloop.com/account/api-keys)).```python from humanloop import Humanloop humanloop = Humanloop(api_key=" ") # Check that the authentication was successful print(humanloop.prompts.list()) ``` ```typescript import { HumanloopClient, Humanloop } from "humanloop"; const humanloop = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); // Check that the authentication was successful console.log(await humanloop.prompts.list()); ``` ### Create an Evaluation Create an Evaluation for the Prompt. In this example, we also attach a "rating" Human Evaluator so our SMEs can judge the generated responses. ```python evaluation = humanloop.evaluations.create( # Name your Evaluation name="Monthly spot-check", file={ # Replace this with the ID of your Prompt. # You can specify a Prompt by "path" as well. "id": "pr_..." }, evaluators=[ # Attach Evaluator to enable SMEs to rate the generated responses {"path": "Example Evaluators/Human/rating"}, ], ) ``` ### Create a Run Create a Run within the Evaluation. We will then attach Logs to this Run. ```python run = humanloop.evaluations.create_run( id=evaluation.id, ) ``` ### Sample Logs Sample a subset of your Logs to attach to the Run. For this example, we'll sample 100 Logs from the past 30 days, simulating a monthly spot-check. ```python import datetime logs = humanloop.logs.list( file_id="pr_...", # Replace with the ID of the Prompt sample=100, # Example filter to sample Logs from the past 30 days start_date=datetime.datetime.now() - datetime.timedelta(days=30), ) log_ids = [log.id for log in logs] ``` ### Attach Logs to the Run Attach the sampled Logs to the Run you created earlier. ```python humanloop.evaluations.add_logs_to_run( id=evaluation.id, run_id=run.id, log_ids=log_ids, ) ``` You have now created an Evaluation Run with a sample of Logs attached to it. In the Humanloop app, go to the Prompt's Evaluations tab. You should see the new Evaluation named "Monthly spot-check". Click on it to view the Run with the Logs attached.  ## Review your Logs Rate the model generations via the **Review** tab.For further details on how you can manage reviewing your Logs with multiple SMEs, see our guide on [managing multiple reviewers](./manage-multiple-reviewers).  After your Logs have been reviewed, go to the **Stats** tab to view aggregate stats.  ## Repeating the spot-check To repeat this process the next time a spot-check is due, you can create a new Run within the same Evaluation, repeating the above steps from "Create a Run". You will then see the new Run alongside the previous ones in the Evaluation, and can compare the aggregate stats across multiple Runs. ## Next Steps * If you have performed a spot-check and identified issues, you can [iterate on your Prompts in the app](./comparing-prompts) and [run further Evaluations](/docs/guides/evals/run-evaluation-ui) to verify improvements. *** subtitle: Integrate your existing evaluation process with Humanloop. description: Integrate your existing evaluation process with Humanloop. --------------------- For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. LLM and code Evaluators generally live on the Humanloop runtime environment. The advantage of this is that these Evaluators can be used as [monitoring Evaluators](docs/v5/guides/observability/monitoring) and to allow triggering evaluations [directly from the Humanloop UI](/docs/v5/guides/evals/run-evaluation-ui). Your setup however can be more complex: your Evaluator has library dependencies that are not present in the [runtime environment](/docs/v5/reference/python-environment), your LLM evaluator has multiple reasoning steps, or you prefer managing the logic yourself. External Evaluators address this: they are registered with Humanloop but their code definition remains in your environment. In order to evaluate a Log, you call the logic yourself and send the judgment to Humanloop. In this tutorial, we will build a chat agent that answers questions asked by children, and evaluate its performance using an external Evaluator. ## Create the agent We reuse the chat agent from our [evaluating an agent tutorial](/docs/v5/tutorials/agent-evaluation).```python title="main.py" maxLines=35 from humanloop import Humanloop from openai import OpenAI from openai.types.chat.chat_completion_message import ChatCompletionMessage as Message import wikipedia import json openai = OpenAI(api_key="ADD YOUR KEY HERE") humanloop = Humanloop(api_key="ADD YOUR KEY HERE") def search_wikipedia(query: str) -> dict: """Search Wikipedia to get up-to-date information for a query.""" try: page = wikipedia.page(query) return { "title": page.title, "content": page.content, "url": page.url, } except Exception as _: return { "title": "", "content": "No results found", "url": "", } def call_model(messages: list[Message]) -> Message: """Calls the model with the given messages""" system_message = { "role": "system", "content": ( "You are an assistant that helps to answer user questions. " "You should leverage wikipedia to answer questions so that " "the information is up to date. If the response from " "Wikipedia does not seem relevant, rephrase the question " "and call the tool again. Then finally respond to the user." ), } response = openai.chat.completions.create( model="gpt-4o", messages=[system_message] + messages, tools=[ { "type": "function", "function": { "name": "search_wikipedia", "description": "Search the internet to get up to date answers for a query.", "parameters": { "type": "object", "required": ["query"], "properties": { "query": {"type": "string"}, }, "additionalProperties": False, }, }, } ], ) return response.choices[0].message.to_dict(exclude_unset=False) def call_agent(question: str) -> str: """Calls the main agent loop and returns the final result""" messages = [{"role": "user", "content": question}] # Retry for a relevant response 3 times at most for _ in range(3): response = call_model(messages) messages.append(response) if response["tool_calls"]: # Call wikipedia to get up-to-date information for tool_call in response["tool_calls"]: source = search_wikipedia( **json.loads(tool_call["function"]["arguments"]) ) messages.append( { "role": "tool", "content": json.dumps(source), "tool_call_id": tool_call["id"], } ) else: # Respond to the user return response["content"] if __name__ == "__main__": result = call_agent("Where does the sun go at night?") print(result) ``` ```typescript title="main.ts" maxLines=35 import { HumanloopClient } from "humanloop"; import OpenAI from "openai"; import type { ChatCompletionMessageParam as Message } from "openai/resources"; import wikipedia from "wikipedia"; import fs from "fs"; import readline from "readline"; const openai = new OpenAI({ apiKey: " Run the agent and check that it works as expected:" }); const humanloop = new HumanloopClient({ apiKey: " " }); type WikiResult = { title: string; content: string; url: string; }; const searchWikipedia = async ({ query }: { query: string }) => { const NO_RESULT_FOUND: WikiResult = { title: "", content: "No results found", url: "", }; try { const page = await wikipedia.page(query); if (page) { return { title: page?.title || "", content: (await page?.content()) || "", url: `https://en.wikipedia.org/wiki/${encodeURIComponent( page?.title || "" )}`, } as WikiResult; } return NO_RESULT_FOUND; } catch (error) { return NO_RESULT_FOUND; } }; const callModel = async ({ messages }: { messages: Array }) => { const systemMessage: Message = { role: "system", content: "You are an assistant that helps to answer user questions. " + "You should leverage wikipedia to answer questions so that " + "the information is up to date. If the response from " + "Wikipedia does not seem relevant, rephrase the question " + "and call the tool again. Then finally respond to the user.", }; const response = await openai.chat.completions.create({ model: "gpt-4o", messages: [systemMessage, ...messages], tools: [ { type: "function", function: { name: "search_wikipedia", description: "Search the internet to get up to date answers for a query.", parameters: { type: "object", required: ["query"], properties: { query: { type: "string" }, }, additionalProperties: false, }, }, }, ], }); return response.choices[0].message; } const callAgent = async ({ question }: { question: string }) => { const messages: Message[] = [{ role: "user", content: question }]; for (let _ = 0; _ < 3; _++) { const response = await callModel({ messages }); messages.push(response); if (response.tool_calls) { for (const toolCall of response.tool_calls) { const args = JSON.parse(toolCall.function.arguments); const source = await searchWikipedia(args); messages.push({ role: "tool", content: JSON.stringify(source), tool_call_id: toolCall.id, }); } } else { return response.content || ""; } } return "Could not get a relevant response after multiple attempts."; } const main = async () => { const result = await callAgent({ question: "Where does the sun go at night?", }); console.log(result); } main(); ``` ## Evaluate the agent ```bash python main.py ``` ```plaintext Okay! Imagine the Earth is like a big ball, and we live on it. The sun doesn't really “go” anywhere—it stays in the same spot, shining all the time. But our Earth is spinning like a top! ``` ```bash npx tsx main.ts ``` ```plaintext Okay! Imagine the Earth is like a big ball, and we live on it. The sun doesn't really “go” anywhere—it stays in the same spot, shining all the time. But our Earth is spinning like a top! ``` Evaluators are callables that take the Log's dictionary representation as input and return a judgment. The Evaluator's judgment should respect the `return_type` present in the Evaluator's [specification](/docs/v5/api/evaluators/upsert#request.body.spec). The Evaluator can take an additional `target` argument to compare the Log against. The target is provided in an Evaluation context by the validation [Dataset](/docs/v5/explanation/datasets). For more details, check out our [Evaluator explanation](/docs/v5/explanation/evaluators). ### Define external Evaluator The Evaluator takes a `log` argument, which represents the Log created by calling `call_agent`. Let's add a simple Evaluator that checks if the agent's answers are too long. Add this in the `agent.py` file: ```python if __name__ == "__main__": def easy_to_understand(log): return len(log["output"]) < 100 ``` ### Add dataset Create a file called `dataset.jsonl` and add the following: ```jsonl title="dataset.jsonl" maxLines=5 {"inputs": {"question": "Why is the sky blue?"}} {"inputs": {"question": "Where does the sun go at night?"}} {"inputs": {"question": "Why do birds fly?"}} {"inputs": {"question": "What makes rainbows?"}} {"inputs": {"question": "Why do we have to sleep?"}} {"inputs": {"question": "How do fish breathe underwater?"}} {"inputs": {"question": "Why do plants need water?"}} {"inputs": {"question": "How does the moon stay in the sky?"}} {"inputs": {"question": "What are stars made of?"}} {"inputs": {"question": "Why do we have seasons?"}} {"inputs": {"question": "How does the TV work?"}} {"inputs": {"question": "Why do dogs wag their tails?"}} {"inputs": {"question": "What makes cars go?"}} {"inputs": {"question": "Why do we need to brush our teeth?"}} {"inputs": {"question": "What do ants eat?"}} {"inputs": {"question": "Why does the wind blow?"}} {"inputs": {"question": "How do airplanes stay in the air?"}} {"inputs": {"question": "Why does the ocean look so big?"}} {"inputs": {"question": "What makes the grass green?"}} {"inputs": {"question": "Why do we have to eat vegetables?"}} {"inputs": {"question": "How do butterflies fly?"}} {"inputs": {"question": "Why do some animals live in the zoo?"}} {"inputs": {"question": "How do magnets stick to the fridge?"}} {"inputs": {"question": "What makes fire hot?"}} {"inputs": {"question": "Why do leaves change color?"}} {"inputs": {"question": "What happens when we flush the toilet?"}} {"inputs": {"question": "Why do we have belly buttons?"}} {"inputs": {"question": "What makes the clouds move?"}} {"inputs": {"question": "Why do we have eyebrows?"}} {"inputs": {"question": "How do seeds turn into plants?"}} {"inputs": {"question": "Why does the moon change shape?"}} {"inputs": {"question": "Why do bees make honey?"}} {"inputs": {"question": "What makes ice melt?"}} {"inputs": {"question": "Why do we sneeze?"}} {"inputs": {"question": "How do trains stay on the tracks?"}} {"inputs": {"question": "Why do stars twinkle?"}} {"inputs": {"question": "Why can't we see air?"}} {"inputs": {"question": "What makes the Earth spin?"}} {"inputs": {"question": "Why do frogs jump?"}} {"inputs": {"question": "Why do cats purr?"}} {"inputs": {"question": "How do phones let us talk to people far away?"}} {"inputs": {"question": "Why does the moon follow us?"}} {"inputs": {"question": "What makes lightning?"}} {"inputs": {"question": "Why does it snow?"}} {"inputs": {"question": "Why do we have shadows?"}} {"inputs": {"question": "Why do boats float?"}} {"inputs": {"question": "What makes our heart beat?"}} {"inputs": {"question": "Why do some animals sleep all winter?"}} {"inputs": {"question": "Why do we have to wear shoes?"}} {"inputs": {"question": "What makes music?"}} ``` ### Add Evaluation Instantiate an Evaluation using the client's \[]`evaluations.run`]\(/docs/v5/sdk/run-evaluation) utility. `easy_to_understand` is an external Evaluator, so we provide its definition via the `callable` argument. At runtime, `evaluations.run` will call the function and submit the judgment to Humanloop. ```python title="agent.py" maxLines=100 highlight={5-28} if __name__ == "__main__": def easy_to_understand(log): return len(log["output"]) < 100 # Read the evaluation dataset with open("dataset.jsonl", "r") as fp: dataset = [json.loads(line) for line in fp] humanloop.evaluations.run( name="QA Agent Answer Comprehensiveness", file={ "path": "QA Agent/Agent", "callable": call_agent, }, evaluators=[ { "path": "QA Agent/Comprehension", "callable": easy_to_understand, "args_type": "target_free", "return_type": "boolean", } ], dataset={ "path": "QA Agent/Children Questions", "datapoints": dataset, }, workers=8, ) ``` ### Run the evaluation ## Add detailed loggingClick on the link to see the results when the Evaluation is complete. ```bash title="Terminal" python main.py ``` ```bash title="Terminal" maxLines=50 Navigate to your Evaluation: https://app.humanloop.com/project/fl_9CCIoTzySPfUFeIxfYE6g/evaluations/evr_67tEc2DiR83fy9iTaqyPA/stats Flow Version ID: flv_9ECTrfeZYno2OIj9KAqlz Run ID: rn_67tEcDYV6mqUS86hD8vrP Running 'Agent' over the Dataset 'Children Questions' using 8 workers [##############--------------------------] 15/50 (30.00%) | ETA: 14 ... 📊 Evaluation Results for QA Agent/Agent +------------------------+---------------------+ | | Latest | +------------------------+---------------------+ | Run ID | 67tEc | +------------------------+---------------------+ | Version ID | 9ECTr | +------------------------+---------------------+ | Added | 2024-11-19 21:49:02 | +------------------------+---------------------+ | Evaluators | | +------------------------+---------------------+ | QA Agent/Comprehension | 3.24 | +------------------------+---------------------+ ``` ```bash title="Terminal" maxLines=50 npx tsx main.ts ``` ```bash title="Terminal" maxLines=50 Navigate to your Evaluation: https://app.humanloop.com/project/fl_9CCIoTzySPfUFeIxfYE6g/evaluations/evr_67tEc2DiR83fy9iTaqyPA/stats Flow Version ID: flv_9ECTrfeZYno2OIj9KAqlz Run ID: rn_67tEcDYV6mqUS86hD8vrP Running 'Agent' over the Dataset 'Children Questions' using 8 workers [##############--------------------------] 15/50 (30.00%) | ETA: 14 ... 📊 Evaluation Results for QA Agent/Agent +------------------------+---------------------+ | | Latest | +------------------------+---------------------+ | Run ID | 67tEc | +------------------------+---------------------+ | Version ID | 9ECTr | +------------------------+---------------------+ | Added | 2024-11-19 21:49:02 | +------------------------+---------------------+ | Evaluators | | +------------------------+---------------------+ | QA Agent/Comprehension | 3.24 | +------------------------+---------------------+ ``` If you use a programming language not supported by the SDK, or want more control, see our guide on [logging through the API](/docs/v5/guides/observability/logging-through-api) for an alternative to decorators. Up to this point, we have treated the agent as a black box, reasoning about its behavior by looking at the inputs and outputs. Let's use Humanloop logging to observe the step-by-step actions taken by the agent.Evaluate the agent again. When it's done, head to your workspace and click the **Agent** [Flow](/docs/v5/guides/explanations/flows) on the left. Select the Logs tab from the top of the page. Modify `main.py`: ```python title="main.py" maxLines=100 highlight={1,5,10,15} @humanloop.tool(path="QA Agent/Search Wikipedia") def search_wikipedia(query: str) -> dict: ... @humanloop.prompt(path="QA Agent/Prompt") def call_model(messages: list[Message]) -> Message: ... @humanloop.flow(path="QA Agent/Agent") def call_agent(question: str) -> str: ... ``` To auto-instrument calls to OpenAI, pass the module in the Humanloop constructor: ```typescript const humanloop = new HumanloopClient({ apiKey: " Modify `main.ts`: ```typescript title="main.ts" maxLines=100 highlight={20-21,26-27,32-33} const searchWikipedia = humanloop.tool({ path: "QA Agent/Search Wikipedia", version: { function: { name: "Search Wikipedia", description: "Search Wikipedia for the best article to answer a question", strict: true, parameters: { type: "object", properties: { query: { type: "string", description: "The question to search Wikipedia for", }, }, required: ["query"], }, }, }, // Wraps the initial function body callable: async ({ query }) => { ... }, }); const callModel = humanloop.prompt({ path: "QA Agent/Prompt", // Wraps the initial function body callable: async ({ messages }) => { ... }, }); const callAgent = humanloop.flow({ path: "QA Agent/Agent", // Wraps the initial function body callable: async ({ question }) => { ... }, }); ```", instrumentProviders: { // Pass the OpenAI module, not the initialized client OpenAI } }); ``` The decorators divide the code in logical components, allowing you to observe the steps taken to answer a question. Every step taken by the agent creates a Log. ## Next steps You've learned how to integrate your existing evaluation process with Humanloop. Learn more about Humanloop's features in these guides: * Learn how to use Evaluations to improve on your feature's performance in our [tutorial on evaluating a chat agent](/docs/v5/tutorials/agent-evaluation). * Evals work hand in hand with logging. Learn how to log detailed information about your AI project in [logging setup guide](/docs/v5/quickstart/set-up-logging). *** subtitle: Run an Evaluation on Humanloop with your own logs. description: Run an Evaluation on Humanloop with your own --------------------- For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. This guide demonstrates how to run an Evaluation on Humanloop using your own logs. This is useful if you have existing logs in an external system and want to evaluate them on Humanloop with minimal setup. In this guide, we will use the example of a JSON file containing chat messages between users and customer support agents. This guide will bring you through uploading these logs to Humanloop and creating an Evaluation with them. ## Prerequisites The code in this guide uses the Python SDK. To follow along, you will need to have the SDK installed and configured. While the code snippets are in Python, the same steps can be performed using the TypeScript SDK or via the API directly. If you are using the API directly, you will need to have an API key.
First you need to install and initialize the SDK. If you have already done this, skip to the next section. Open up your terminal and follow these steps: 1. Install the Humanloop SDK: The example JSON data in this guide can be found in the [Humanloop Cookbook](https://github.com/humanloop/humanloop-cookbook/tree/evaluating-external-logs/assets). To continue with the code in this guide, download `conversations-a.json` and `conversations-b.json` from the `assets` folder. ## Evaluate your external logs We'll start by loading data from `conversations-a.json`, which represents logs recorded by an external system. ```python import json with open("conversations-a.json") as f: data = json.load(f) ``` In this example, `data` is a list of chat messages between users and a support agent.```python pip install humanloop ``` ```typescript npm install humanloop ``` 2. Initialize the SDK with your Humanloop API key (you can get it from the [Organization Settings page](https://app.humanloop.com/account/api-keys)).```python from humanloop import Humanloop humanloop = Humanloop(api_key=" ") # Check that the authentication was successful print(humanloop.prompts.list()) ``` ```typescript import { HumanloopClient, Humanloop } from "humanloop"; const humanloop = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); // Check that the authentication was successful console.log(await humanloop.prompts.list()); ``` ### Upload logs to Humanloop ## Next steps The above examples demonstrate how you can quickly populate an Evaluation Run with your logs. * You can extend this Evaluation with custom Evaluators, such as using [Code Evaluators](./code-based-evaluator) to calculate metrics, or using [Human Evaluators](/docs/guides/evals/human-evaluators) to set up your Logs to be reviewed by your subject-matter experts. * Now that you've set up an Evaluation, explore the other [File](../../explanation/files) types on Humanloop to see how they can better reflect your production systems, and how you can use Humanloop to version-control them. Here, we've used a [Flow](../../explanation/flows) to represent a black-box system. *** subtitle: How to create, version and use a Prompt in Humanloop description: Learn how to create a Prompt in Humanloop using the UI or SDK, version it, and use it to generate responses from your AI models. Prompt management is a key part of the Humanloop platform. --------------------- For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. Humanloop acts as a registry of your [Prompts](/docs/explanation/prompts) so you can centrally manage all their versions and [Logs](/docs/explanation/logs), and evaluate and improve your AI systems. This guide will show you how to create a Prompt [in the UI](/docs/v4/guides/create-prompt#create-a-prompt-in-the-ui) or [via the SDK/API](/docs/v4/guides/create-prompt#create-a-prompt-using-the-sdk).These steps are suitable if you do not already have an Evaluation on Humanloop. The [Upload new logs step](#upload-new-logs) demonstrates a simpler process if you already have an Evaluation you want to add a new set of logs to. Upload the logs with the `log(...)` method. This will automatically create a [Flow](../../explanation/flows) on Humanloop. We additionally pass in some `attributes` identifying the configuration of the system that generated these logs. `attributes` accepts arbitrary values, and is used for versioning the Flow. Here, it allows us to associate this set of logs with a specific version of the support agent. ```python log_ids = [] for messages in data: log = humanloop.flows.log( path="External logs demo/Travel planner", flow={"attributes": {"agent-version": "1.0.0"}}, # Optionally add attributes to identify this version of the support agent. messages=messages, ) log_ids.append(log.id) ``` This will have created a new Flow on Humanloop named **Travel planner**. To confirm this logging has succeeded, navigate to the **Logs** tab of the Flow and view the uploaded logs. Each Log should correspond to a conversation and contain a list of messages.  We will also use the created Flow version when creating our Run. ```python version_id = log.version_id ``` ### Create an Evaluation Run Next, create an Evaluation on Humanloop. Within the Evaluation, create a Run which will contain the Logs. Here, we'll use the example "Helpfulness" LLM-as-a-judge Evaluator. This will automatically rate the helpfulness of the support agent across our logs. ```python evaluation = humanloop.evaluations.create( name="Past records", # NB: you can use `path`or `id` for references on Humanloop file={"path": "External logs demo/Travel planner"}, evaluators=[ # Replace with your Evaluators {"path": "Example Evaluators/AI/Helpfulness"}, ], ) run = humanloop.evaluations.create_run( id=evaluation.id, version={'version_id': version_id}, # Associate this Run to the Flow version created above. ) ``` ### Assign Logs to the Run Finally, add the Flow Logs to the Run. ```python humanloop.evaluations.add_logs_to_run( id=evaluation.id, run_id=run.id, log_ids=log_ids, ) ``` ### Review the Evaluation You have now created an Evaluation on Humanloop and added Logs to it.  Go to the Humanloop UI to view the Evaluation. Within the Evaluation, go to **Logs** tab. Here, you can view your uploaded logs as well as the Evaluator judgments.  The following steps will guide you through adding a different set of logs to a new Run for comparison. ### Upload new logsIf you already have an Evaluation that you want to add a new set of logs to, you can start from here. To start from this point, retrieve the ID of the Evaluation you want to add logs to. Go to the Evaluation you want to add logs to on the Humanloop UI and copy the ID from the URL. This is the segment of the URL after `evaluations/`, e.g. `evr_...`. Now that we have an Evaluation on Humanloop, we can add a separate set of logs to it and compare the performance across this set of logs to the previous set. While we can achieve this by repeating the above steps, we can add logs to a Run in a more direct and simpler way now that we have an existing Evaluation. For this example, we'll continue with the Evaluation created in the previous section, and add a new Run with the data from `conversations-b.json`. These represent a set of logs from a prototype version of the support agent. ```python with open("conversations-b.json") as f: data = json.load(f) ``` #### Create a new Run Create a new Run within the Evaluation that will contain this set of logs. ```python run = humanloop.evaluations.create_run( id=evaluation.id, ) ``` #### Log to the Run Pass the `run_id` argument in your `log(...)` call to associate the Log with the Run. ```python # Add the new data to the Run for messages in data: log = humanloop.flows.log( path="External logs demo/Travel planner", flow={"attributes": {"agent-version": "2.0.0"}}, messages=messages, # Pass `run_id` to associate the Log with the Run. run_id=run.id, ) ``` ### Compare the results View the Evaluation on Humanloop. It will now contain two Runs. In the **Stats** tab of the Evaluation, you can now compare the performance of the two sets of logs. In our case, our second set of logs (on the right) can be seen to be less helpful.  **Prerequisite**: A Humanloop account. You can create an account now by going to the [Sign up page](https://app.humanloop.com/signup). ## Create a Prompt in the UI#### Create a Humanloop Account If you haven’t already, create an account or log in to Humanloop #### Add an OpenAI API Key If you’re the first person in your organization, you’ll need to add an API key to a model provider. 1. Go to OpenAI and [grab an API key](https://platform.openai.com/api-keys) 2. In Humanloop [Organization Settings](https://app.humanloop.com/account/api-keys) set up OpenAI as a model provider. ## Get StartedUsing the Prompt Editor will use your OpenAI credits in the same way that the OpenAI playground does. Keep your API keys for Humanloop and the model providers private. ### Create a Prompt File When you first open Humanloop you’ll see your File navigation on the left. Click ‘**+ New**’ and create a **Prompt**. *** ## Create a Prompt using the SDK The Humanloop Python SDK allows you to programmatically create and version your [Prompts](/docs/explanation/prompts) in Humanloop, and log generations from your models. This guide will show you how to create a Prompt using the SDK. Note that you can also version your prompts dynamically with every PromptIn the sidebar, rename this file to "Comedian Bot" now or later. ### Create the Prompt template in the Editor The left hand side of the screen defines your Prompt – the parameters such as model, temperature and template. The right hand side is a single chat session with this Prompt.
In the editor, update the system message to: ``` You are a funny comedian. Write a joke about {{topic}}. ```
This message forms the chat template. It has an input slot called `topic` (surrounded by two curly brackets) for an input value that is provided each time you call this Prompt. On the right hand side of the page, you’ll now see a box in the **Inputs** section for `topic`. 1. Add a value for `topic` e.g. music, jogging, whatever 2. Click **Run** in the bottom right of the page This will call OpenAI’s model and return the assistant response. Feel free to try other values, the model is *very* funny. You now have a first version of your prompt that you can use. ### Save your first version of this Prompt 1. Click the **Save** button at the top of the editor 2. Enter **Initial Comedian Setup** in the version name field 3. Enter **Prompt for making (not so) funny jokes!** in the description field 4. Click **Save**
### View the logs Under the Prompt File, click ‘Logs’ to view all the generations from this Prompt Click on a row to see the details of what version of the Prompt generated it. From here you can give feedback to that generation, see performance metrics, open up this example in the Editor, or add this log to a Dataset.
![]()
**Prerequisite**: A Humanloop SDK Key. You can get this from your [Organisation Settings page](https://app.humanloop.com/account/api-keys) if you have the [right permissions](/docs/v5/reference/access-roles). First you need to install and initialize the SDK. If you have already done this, skip to the next section. Open up your terminal and follow these steps: 1. Install the Humanloop SDK: After initializing the SDK client, you can call the Prompt creation endpoint.```python pip install humanloop ``` ```typescript npm install humanloop ``` 2. Initialize the SDK with your Humanloop API key (you can get it from the [Organization Settings page](https://app.humanloop.com/account/api-keys)).```python from humanloop import Humanloop humanloop = Humanloop(api_key=" ") # Check that the authentication was successful print(humanloop.prompts.list()) ``` ```typescript import { HumanloopClient, Humanloop } from "humanloop"; const humanloop = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); // Check that the authentication was successful console.log(await humanloop.prompts.list()); ``` ### Create the Prompt This can be done by using the [Prompt Upsert](/docs/api/prompts/upsert) method in the SDK. Or by calling the API directly: You now have a Prompt in Humanloop that contains your initial version. You can call the Prompt in Editor and invite team members by going to your organization's members page. ## Next Steps With the Prompt set up, you can now integrate it into your app by following the [Call a Prompt Guide](/docs/development/guides/call-prompt). *** subtitle: A guide on how to call your Prompts that are managed on Humanloop. description: Learn how to call your Prompts that are managed on Humanloop. --------------------- For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. This guide will show you how to call your Prompts through the API, enabling you to generate responses from the large language model while versioning your Prompts. You can call an existing Prompt on Humanloop, or you can call a Prompt you're managing in code. These two use-cases are demonstrated below. ### Prerequisites### Go to the App Go to the [Humanloop app](https://app.humanloop.com) and you will see your Prompt in your list of files. First you need to install and initialize the SDK. If you have already done this, skip to the next section. Open up your terminal and follow these steps: 1. Install the Humanloop SDK: ## Call an existing Prompt If you don't have Prompt already on Humanloop, please follow our [Prompt creation](/docs/development/guides/create-prompt) guide first.```python pip install humanloop ``` ```typescript npm install humanloop ``` 2. Initialize the SDK with your Humanloop API key (you can get it from the [Organization Settings page](https://app.humanloop.com/account/api-keys)).```python from humanloop import Humanloop humanloop = Humanloop(api_key=" ") # Check that the authentication was successful print(humanloop.prompts.list()) ``` ```typescript import { HumanloopClient, Humanloop } from "humanloop"; const humanloop = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); // Check that the authentication was successful console.log(await humanloop.prompts.list()); ``` ### Get the Prompt ID In Humanloop, navigate to the Prompt and copy the Prompt ID by clicking Prompt name in the top bar, and copying from the popover. ## Call a Prompt defined in code You can also manage your Prompts in code. Pass the `prompt` details within your API call to generate responses with the specified parameters.### Call the Prompt by ID Now you can use the SDK to generate completions and log the results to your Prompt: This can be done by using the [Prompt Call](/docs/api/prompts/call) method in the SDK.
## View your Prompt Logs Navigate to the **Logs** tab of your Prompt. You will be able to see the recorded inputs, messages and model generations. ## Next steps * [Iterate and improve on your Prompts](../evals/comparing-prompts) in the Editor * [Capture end-user feedback](../observability/capture-user-feedback) to monitor your model performance. *** subtitle: How to log generations from any large language model (LLM) to Humanloop description: Learn how to create a Prompt in Humanloop using the UI or SDK, version it, and use it to generate responses from your AI models. Prompt management is a key part of the Humanloop platform. --------------------- For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. This guide will show you how to capture the [Logs](/docs/explanation/logs) of your LLM calls into Humanloop. The easiest way to log LLM generations to Humanloop is to use the `Prompt.call()` method (see the guide on [Calling a Prompt](/docs/development/guides/call-prompt)). You will only need to supply prompt ID and the inputs needed by the prompt template, and the endpoint will handle fetching the latest template, making the LLM call and logging the result. However, there may be scenarios that you wish to manage the LLM provider calls directly in your own code instead of relying on Humanloop. For example, you may be using an LLM provider that is not directly supported by Humanloop such as a custom self-hosted model, or you may want to avoid adding Humanloop to the critical path of the LLM API calls. ### Prerequisites * You already have a Prompt — if not, please follow our [Prompt creation](/docs/development/guides/create-prompt) guide first. First you need to install and initialize the SDK. If you have already done this, skip to the next section. Open up your terminal and follow these steps: 1. Install the Humanloop SDK: ## Log data to your Prompt To log LLM generations to Humanloop, you will need to make a call to the `/prompts/log` endpoint. Note that you can either specify a version of the Prompt you are logging against - in which case you will need to take care that you are supplying the correct version ID and inputs. Or you can supply the full prompt and a new version will be created if it has not been seen before.```python pip install humanloop ``` ```typescript npm install humanloop ``` 2. Initialize the SDK with your Humanloop API key (you can get it from the [Organization Settings page](https://app.humanloop.com/account/api-keys)).```python from humanloop import Humanloop humanloop = Humanloop(api_key=" ") # Check that the authentication was successful print(humanloop.prompts.list()) ``` ```typescript import { HumanloopClient, Humanloop } from "humanloop"; const humanloop = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); // Check that the authentication was successful console.log(await humanloop.prompts.list()); ``` ### Get your Prompt Fetch a Prompt from Humanloop by specifying the ID. You can ignore this step if your prompts are created dynamically in code. *** title: Store Prompts in code subtitle: How to store Prompts and Agents in your codebase and use them in the Humanloop SDK description: Learn how to pull Prompts and Agents from Humanloop to your local workspace and reference them in your code. --------------------- For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. Humanloop allows you to store Prompt and Agent definitions in your local filesystem and in version control, while still leveraging Humanloop's prompt management and evaluation capabilities. This guide will walk you through using local Files in your development workflow. ### Prerequisites * A Humanloop account with at least one Prompt or Agent created * Humanloop SDK installed (which includes the CLI functionality)Here's how to do this in code: ### Call your Prompt This can be your own model, or any other LLM provider. Here is an example of calling OpenAI: ```python from humanloop import Humanloop, prompt_utils PROMPT_ID = " " hl = Humanloop(api_key=" ") prompt = hl.prompts.get(id=PROMPT_ID) # This will fill the prompt template with the variables template = prompt_utils.populate_template(prompt.template, {"language": "Python"}) ``` ```typescript import { HumanloopClient, Humanloop } from "humanloop"; import { ChatMessage } from "humanloop/api"; const humanloop = new HumanloopClient({ apiKey: " ", }); const prompt = await humanloop.prompts.get(" "); function fillTemplate( template: ChatMessage[], variables: { [key: string]: string } ): ChatMessage[] { const replaceVariable = (match: string, variable: string) => { const trimmedVariable = variable.trim(); if (trimmedVariable in variables) { return variables[trimmedVariable]; } else { throw new Error(`Error: Variable '${trimmedVariable}' is missing.`); } }; return template.map((message) => { if (typeof message.content !== "string") { return message; } const filledContent = message.content.replace( /\{\{\s*(.*?)\s*\}\}/g, replaceVariable ); return { ...message, content: filledContent }; }); } const template = fillTemplate(prompt.template as ChatMessage[], { language: "Python", }); ``` ### Log the result Finally, log the result to your project: ```python import openai client = openai.OpenAI(api_key=" ") messages = template + [{"role": "user", "content": "explain how async works"}] chat_completion = client.chat.completions.create( messages=messages, model=prompt.model, temperature=prompt.temperature ) ``` ```typescript import { OpenAI } from "openai"; import { ChatCompletionMessageParam } from "openai/resources"; const client = new OpenAI({ apiKey: " ", }); const messages = template.concat([ { role: "user", content: "explain how async works" }, ]); const chatCompletion = await client.chat.completions.create({ messages: messages as ChatCompletionMessageParam[], model: prompt.model, temperature: prompt.temperature, }); ``` ```python # Parse the output from the OpenAI response. output_message = chat_completion.choices[0].message # Log the inputs, outputs and config to your project. log = hl.prompts.log( id=PROMPT_ID, output_message=output_message, messages=messages, ) ``` ```typescript // Get the output from the OpenAI response. const outputMessage = chatCompletion.choices[0].message; const log = humanloop.prompts.log({ id: PROMPT_ID, outputMessage: outputMessage, messages: messages, }); ``` ## Step 1: Pull Files from Humanloop After creating your Prompt in Humanloop (like the [example Prompt](#example-prompt-for-this-guide) we set up earlier), you'll see it in your workspace:  Now you can pull this Prompt from Humanloop to your local environment by running: To follow along with the examples in this guide, create a Prompt named `welcome-email` in the root directory of your Humanloop workspace. We'll create a prompt that generates a welcome email for new customers. The Prompt uses the [Humanloop .prompt format](/docs/reference/serialized-files) which has two main parts: 1. A configuration section (between --- marks) that specifies the model settings 2. Message templates: a system message setting the context, and a user message with personalization variables Toggle the Prompt File editor by hitting **Cmd + Shift + E** (or **Ctrl + Shift + E** on Windows) and replace the existing content with the following: ```jsx title="welcome-email.prompt" --- model: gpt-4o temperature: 0.7 max_tokens: 500 top_p: 1.0 presence_penalty: 0.0 frequency_penalty: 0.0 provider: openai endpoint: chat tools: [] --- You are an email assistant that creates friendly welcome emails for new customers. Keep your tone warm and conversational while clearly explaining the key features of our product. Write a welcome email for {{customer_name}} who just signed up for our {{product_name}} service. ```  Save this new version of the Prompt by pressing **Manage**, then **Deploy...**, select your default environment (typically `production`) and follow the steps to deploy.The Humanloop SDK includes both the programming interface and CLI tools you'll need for this guide. ```bash Python for="Python" pip install humanloop ``` ```bash TypeScript for="TypeScript" npm install humanloop ``` You'll also need your Humanloop API key, which you can find on the [API Keys page](https://app.humanloop.com/account/api-keys) in your Organization settings. ```bash # Create a .env file in your project root echo "HUMANLOOP_API_KEY=" > .env ``` ```bash Python for="Python" humanloop pull ``` ```bash TypeScript for="TypeScript" npx humanloop pull ``` This command clones your Humanloop workspace into a `humanloop` directory in your project root, maintaining the same folder structure as your remote workspace. `humanloop pull` will pull all Files deployed to your default environment (typically `production`) and store them in the `humanloop` directory. To pull only specific Files, use a different environment, or change the local destination directory, check out the options in the help menu: ## Step 2: Use local Files in your code Now that you have your Prompt locally, you can use it in your code by configuring the SDK to use local Files.```bash Python for="Python" humanloop pull --help ``` ```bash TypeScript for="TypeScript" npx humanloop pull --help ``` ```python Python for="Python" from humanloop import Humanloop # Initialize the client with local File support humanloop = Humanloop( api_key="YOUR_HUMANLOOP_API_KEY", # Enable using Files from the local filesystem use_local_files=True, ) # Call a local Prompt response = humanloop.prompts.call( path="welcome-email", # Looks for humanloop/welcome-email.prompt inputs={"customer_name": "Alex", "product_name": "Humanloop AI Platform"} ) print(response.logs[0].output) ``` ```typescript TypeScript for="TypeScript" import { Humanloop } from "humanloop"; // Initialize the client with local File support const humanloop = new Humanloop({ apiKey: "YOUR_HUMANLOOP_API_KEY", // Enable using Files from the local filesystem useLocalFiles: true, }); // Call a local Prompt const response = await humanloop.prompts.call({ path: "welcome-email", // Looks for humanloop/welcome-email.prompt inputs: { customer_name: "Alex", product_name: "Humanloop AI Platform" } }); console.log(response.logs[0].output); ``` You can also log results from your own provider calls by referencing local Files:```python Python # After making your own provider call, log the results with a local Prompt File humanloop.prompts.log( path="welcome-email", # References the local File messages=[ {"role": "system", "content": "You are an email assistant..."}, {"role": "user", "content": "Write a welcome email..."} ], output="The generated email content...", inputs={"customer_name": "Alex", "product_name": "Humanloop AI Platform"} ) ``` ```typescript TypeScript // After making your own provider call, log the results with a local Prompt File await humanloop.prompts.log({ path: "welcome-email", // References the local File messages: [ {role: "system", content: "You are an email assistant..."}, {role: "user", content: "Write a welcome email..."} ], output: "The generated email content...", inputs: {customer_name: "Alex", product_name: "Humanloop AI Platform"} }); ``` Important: When local Files are enabled and you reference a File using its path, the SDK will: * By default, look for Files in the `humanloop` directory (this can be customized with `local_files_directory`/`localFilesDirectory`) * Only look for Files in your local directory (there is no fallback to remote workspace) * Use the exact local definition, even if newer versions exist in your remote workspace * Make API calls to Humanloop to execute Prompts and log results ## Step 3: Verify local File usage To verify that your code is actually using the local Prompt, you can make a small modification and observe the change in output. 1. Open `humanloop/welcome-email.prompt` in a text editor and modify the system message. ```diff title="humanloop/welcome-email.prompt"-You are an email assistant that creates friendly welcome emails for new customers. Keep your tone warm and conversational while clearly explaining the key features of our product. +You are an EXTREMELY ENTHUSIASTIC email assistant that creates friendly welcome emails for new customers. Use LOTS of emojis and exclamation points!! Keep your tone warm and conversational while clearly explaining the key features of our product. ``` 2. Call the modified Prompt from your code:```python Python response = humanloop.prompts.call( path="welcome-email", inputs={"customer_name": "Alex", "product_name": "Humanloop AI Platform"} ) print(response.logs[0].output) # The response should now include enthusiastic language and emojis! ``` ```typescript TypeScript const response = await humanloop.prompts.call({ path: "welcome-email", inputs: { customer_name: "Alex", product_name: "Humanloop AI Platform" } }); console.log(response.logs[0].output); // The response should now include enthusiastic language and emojis! ``` You'll notice in the UI that a log was created with the new version of the Prompt. When you call a modified local File, Humanloop uses content hashing to check for changes. If the content differs from an existing version, a new version is automatically created. ## Step 4: Version control Now that your Prompt is a local File, you can add it to your version control system. ```bash # Add the humanloop directory to your git repository git add humanloop/ git commit -m "Add Humanloop Prompt" ```Once your Files are committed, you can track changes from Humanloop too. After modifying a Prompt in the Humanloop UI and deploying it, run `humanloop pull` to get the latest version, then use `git diff` to see what changed. For example, if you update the model in your `welcome-email` Prompt from `gpt-4o` to `gpt-4o-mini` in the Humanloop UI and deploy it, after pulling the changes you would see:  By integrating your Prompts and Agents with version control, you create a more robust development workflow: * **Single source of truth** for both code and AI components * **Change history** with full audit trail of who changed what and when * **Local experimentation** through editing Files directly in your IDE without needing the Humanloop UI * **Deployment safety** via pull requests and code reviews for Prompt changes**Using with Agents** Everything you've learned about working with Prompt Files also applies to Agent Files. The process is identical - pull from Humanloop, reference with the `path` parameter in `agents.call` and `agents.log` operations, and manage through version control. ## Troubleshooting If you encounter any issues while working with local Files, check these common solutions: * **API key not detected?** Ensure it's stored in a `.env` file at the top level and that you run commands from your project root. * **Changes not reflecting?** Ensure you've deployed your Prompt in the Humanloop UI after making changes. * **SDK not finding files?** Ensure the directory used when pulling matches the one in your SDK initialization. (if you used `--local-files-directory custom-dir` when pulling, specify the same path in your SDK config for `local_files_directory`/`localFilesDirectory`). ## Next Steps By integrating Humanloop Files into your development workflow, you've bridged the gap between AI development and software engineering practices, making it easier to build robust AI applications. Now that you're using local Files, you might want to: 1. Set up [continuous integration](/docs/guides/evals/cicd-integration) to automatically test your Prompts and Agents when they change 2. Learn more about the [File formats](/docs/reference/serialized-files) to understand how to manually edit them if needed 3. Explore [environment labels](/docs/explanation/environments) to manage different versions for development, staging, and production *** subtitle: How to use Tool Calling to have the model interact with external functions. description: Learn how to use tool calling with your large language models in the Humanloop Prompt Editor. --------------------- For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. Humanloop's Prompt Editor supports tool calling functionality, enabling models to interact with external systems. This feature, equivalent to [OpenAI's function calling](https://platform.openai.com/docs/guides/function-calling) or [Anthropic's tool use](https://docs.anthropic.com/en/docs/build-with-claude/tool-use), is implemented through JSON Schema Tools in Humanloop. These Tools adhere to the widely-used JSON Schema syntax, providing a standardized way to define data structures. Within the Editor, you can create inline JSON Schema Tools as part of your Prompt. This capability allows you to establish a structured framework for the model's responses, enhancing control and predictability. ### Prerequisites * You already have a Prompt — if not, please follow our [Prompt creation](/docs/development/guides/create-prompt) guide first. ## Create an inline JSON Schema Tool```python # Call a local Agent agent_response = humanloop.agents.call( path="customer-service/customer-support", # Looks for humanloop/customer-service/customer-support.agent messages=[ { "role": "user", "content": "I need help with my order: 1234567890" } ] ) # Access agent output print(agent_response.previous_agent_message) ``` ```typescript // Call a local Agent const agentResponse = await humanloop.agents.call({ path: "customer-service/customer-support", // Looks for humanloop/customer-service/customer-support.agent messages: [ { role: "user", content: "I need help with my order: 1234567890" } ] }); console.log(agentResponse.previousAgentMessage); ``` ### **Open the Editor** Go to a Prompt and open the Editor. ### **Select a model that supports Tool Calling** ## Test the Tool Now, let's test our Tool by inputting a relevant query. Since we're working with a weather-related tool, try typing: "What's the weather in Boston?" This should prompt the model to respond using the parameters we've defined.To view the list of models that support Tool calling, see the [Models page](/docs/reference/models#models). In the Editor, you'll see an option to select the model. Choose a model like `gpt-4.1-nano` which supports Tool Calling. ### **Define the Tool** To get started with creating an inline tool, let's use one of our preloaded examples. Click on the **+ Tool** button in the bottom left of the Editor. Select **New inline tool...**.In the modal that appears, open the **Examples** dropdown and select the `get_current_weather` tool.
If you choose to edit or create your own tool, you'll need to use the [JSON Schema syntax](https://json-schema.org/). When creating a custom tool, it should correspond to a function you have defined in your own code. The JSON Schema you define here specifies the parameters and structure you want the AI model to use when interacting with your function.
![]()
Keep in mind that the model's use of the tool depends on the relevance of the user's input. For instance, a question like '*How are you today?*' is unlikely to trigger a weather-related tool call. ### **Check tool call** Upon successful setup, the assistant should respond by invoking the tool, providing both the tool's name and the required data. For our `get_current_weather` tool, the response might look like this:### **Submit tool response** You can also check how the Prompt would respond to a successful tool call. Click on the **Add to Messages** button to move the assistant's response into the Messages section for a subsequent call. Then, you can paste in the exact response that the Tool would respond with into the **Output** section of the Tool call. For prototyping purposes, you can also just simulate the response yourself. Provide in a mock response: ```json { "temperature": 65, "condition": "light rain", "unit": "fahrenheit" } ```
Remember, the goal is to simulate the tool's output as if it were actually fetching real-time weather data. This allows you to test and refine your prompt and tool interaction without needing to implement the actual weather API. After entering the simulated tool response, click on the **Run** button to send the Tool's response to the AI model. ### **Review assistant response** The assistant should now respond using the information provided in your simulated tool response. For example, if you input that the weather in Boston was 65°F and light rain, the assistant might say: `The current weather in Boston is light rain with a temperature of 65°F.` This response demonstrates how the AI model incorporates the tool's output into its reply, providing a more contextual and data-driven answer.
### **Iterate and refine** Feel free to experiment with different queries. This iterative process helps you fine-tune your Prompt and understand how the AI model interacts with the tool, ultimately leading to more effective and accurate responses in your application. ### **Save your Prompt** By saving your Prompt, you will create a new version that includes the inline tool. Congratulations! You've successfully learned how to use tool calling in the Humanloop Editor. This powerful feature allows you to test tool interactions, helping you create more dynamic and context-aware AI applications. ## Next steps After you've created and tested your inline Tool, you might want to reuse it across multiple Prompts. Humanloop allows you to link a Tool, making it easier to share and manage Tool definitions across multiple Prompts. For more detailed instructions on how to link and manage Tools, check out our guide on [Linking a JSON Schema Tool](/docs/v5/guides/prompts/tool-calling-editor). *** subtitle: How to re-use common text snippets in your Prompt templates with the Snippet Tool description: Learn how to use the Snippet tool to manage common text snippets that you want to reuse across your different prompts. --------------------- For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. The Snippet Tool supports managing common text 'snippets' that you want to reuse across your different prompts. A Snippet tool acts as a simple key/value store, where the key is the name of the common re-usable text snippet and the value is the corresponding text. For example, you may have some common persona descriptions that you found to be effective across a range of your LLM features. Or maybe you have some specific formatting instructions that you find yourself re-using again and again in your prompts. Instead of needing to copy and paste between your editor sessions and keep track of which projects you edited, you can instead inject the text into your prompt using the Snippet tool. ## Create and use a Snippet Tool ### Prerequisites * You already have a Prompt — if not, please follow our [Prompt creation](/docs/development/guides/create-prompt) guide first. To create and use a snippet tool, follow the following steps:
### Create a new Snippet Tool ### Name the Tool Name it `assistant-personalities` and give it a description `Useful assistant personalities`. ### Add a key called "helpful-assistant" In the initial box add `helpful-assistant` and give it a value of `You are a helpful assistant. You like to tell jokes and if anyone asks your name is Sam.` ### Add another key called "grumpy-assistant" Let's add another key-value pair, so press the **Add a key/value pair** button and add a new key of `grumpy-assistant` and give it a value of `You are a grumpy assistant. You rarely try to help people and if anyone asks your name is Freddy.`.
### Save and Deploy your Tool. Press the **Save** button, and optionally enter a name and description for this new version. When presented with the deployment dialog, click the **Deploy** button and deploy to your *production* environment.
Now your Snippets are set up, you can use it to populate strings in your prompt templates across your projects. ### Navigate to the **Editor** Go to the Editor of your previously created file. ### Add `{{ assistant-personalities(key) }}` to your prompt Delete the existing prompt template and add `{{ assistant-personalities(key) }}` to your prompt.
Double curly bracket syntax is used to call a tool in the editor. Inside the curly brackets you put the tool name, e.g. `{{ my-tool-name(key) }}`. ### Enter the key as an input In the input area set the value to `helpful-assistant`. The tool requires an input value to be provided for the key. When adding the tool an inputs field will appear in the top right of the editor where you can specify your `key`. ### Press the **Run** button Start a chat to see both the LLM's response and your previously defined key in the right panel.### Change the key to `grumpy-assistant`.
To see the snippet content for a new key, you'll need to run the chat first. The preview will then update to show the corresponding text. ### Play with the LLM Ask the LLM, `I'm a customer and need help solving this issue. Can you help?'`. You should see a grumpy response from "Freddy" now. If you have a specific key you would like to hardcode in the prompt, you can define it using the literal key value: `{{("key") }}`, so in this case it would be `{{ assistant-personalities("grumpy-assistant") }}`. Delete the `grumpy-assistant` field and add it into your chat template. ### **Save** your Prompt. If you're happy with your grumpy assistant, save this new version of your Prompt. The Snippet tool is particularly useful because you can define passages of text once in a Snippet tool and reuse them across multiple prompts, without needing to copy/paste them and manually keep them all in sync. Editing the values in your tool allows the changes to automatically propagate to the Prompts when you update them, as long as the key is the same.
Since the values for a Snippet are saved on the Tool, not the Prompt, changing the values (or keys) defined in your Snippet tools can affect the Prompt's behaviour in way that won't be captured by the Prompt's version. This could be exactly what you intend, however caution should still be used make sure the changes are expected. *** subtitle: In this guide we will demonstrate how to deploy your Prompts description: Environments enable you to deploy model configurations and experiments, making them accessible via API, while also maintaining a streamlined production workflow. --------------------- For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. [Environments](/docs/explanation/environments) are a tagging system for deploying Prompts. They enable you to deploy maintain a streamlined deployment workflow and keep track of different versions of Prompts. ### Prerequisites * You already have a Prompt — if not, please follow our [Prompt creation](/docs/development/guides/create-prompt) guide first. To deploy a version to an environment:### Navigate to the **Dashboard** of your Prompt ### Click the dropdown menu of the environment. *** subtitle: Directories group together related files description: Directories can be used to group together related files. This is useful for organizing your work. --------------------- For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. This guide will show you how to create a [Directory](/docs/explanation/directories) in the UI. A directory is a collection of files and other directories.### Click the **Change deployment** button ### Select a version Choose the version you want to deploy from the list of available versions.
### Click the **Deploy** button.
**Prerequisite**: A Humanloop account. You can create an account now by going to the [Sign up page](https://app.humanloop.com/signup). ## Create a Directory### Create a Directory 1. Open Humanloop app. 2. Click '**+ New**' on the left and select **Directory**. 3. Name your new directory, for example, "Summarization App". You have now successfully created a directory and moved a file into it. This organization can help you manage your AI applications more efficiently within Humanloop. *** subtitle: Managing and versioning a Tool separately from your Prompts description: Learn how to create a JSON Schema tool that can be reused across multiple Prompts. --------------------- For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. It's possible to reuse tool definitions across multiple Prompts. You achieve this by having a Tool file that defines a JSON schema, and linking them to your Prompts. This guide will run through creating a `JSON Schema` Tool defining a `get_current_weather` function, and linking that to a Prompt. You can repeat this linking for other Prompts (or Agents) if necessary. ### Prerequisites * You already have a Prompt — if not, please follow our [Prompt creation](/docs/development/guides/create-prompt) guide first. ## Creating a JSON Schema Tool To create a reusable JSON Schema tool, follow these steps:You can call files and directories anything you want. Capital letters, spaces are all ok! ### (Optional) Move a File into the Directory 1. In the File navigation sidebar, hover over the file in the sidebar to show the context menu. From the menu select "Move". 2. Choose the destination directory
![]()
### Create a new Tool file Navigate to the homepage or sidebar and click the 'New File' button. ### Choose the JSON Schema Tool type From the available options, select **Json Schema** as the Tool type. We now have a `get_current_weather` Tool that our Prompt can call. ## Link the ToolAfter you create the Tool, you can edit the file name in the sidebar. Rename the file to "Weather tool". ### Define your tool's structure Paste the following JSON into the provided dialog to define your tool's structure: ```json { "name": "get_current_weather", "description": "Get the current weather in a given location", "parameters": { "type": "object", "properties": { "location": { "type": "string", "name": "Location", "description": "The city and state, e.g. San Francisco, CA" }, "unit": { "type": "string", "name": "Unit", "enum": [ "celsius", "fahrenheit" ] } }, "required": [ "location", "unit" ] } } ```
If you choose to edit or create your own Tool, you'll need to use the [JSON Schema syntax](https://json-schema.org/). When creating a custom Tool, it should correspond to a function you have defined in your own code. The JSON Schema you define here specifies the parameters and structure you want the AI model to use when interacting with your function. ### Save Tool version Press the **Save** button to save this version of the Tool.
Click the **Deploy...** button to deploy the Tool to your production environment, following the steps in the dialog.
![]()
When deploying a new version of your Tool, remember that the change may affect Prompts that link to it. Prompts that link to Tools will automatically use the default deployed version of the Tool. Be careful when making updates to not inadvertently change something you didn't intend. ### Open Prompt Editor Navigate to the **Editor** of a Prompt. Ensure you are using a model that supports tool calling, such as `gpt-4.1-nano`. You've now created a reusable Tool that can be used across multiple Prompts, and linked it to a Prompt. In this guide, we simulated the tool call by manually entering a value for temperature. In a real scenario, your code would be responsible for handling the tool call and returning the result. ## Next steps Try using Tools to extend your Agents' capabilities. For example, if you link a Python code Tool (a Runnable Tool), Humanloop will automatically execute the Tool when it's called by an Agent. Additionally, the Tool output will be saved as a Log. *** subtitle: How to create and use online Evaluators to observe the performance of your Prompts. description: Learn how to create and use online Evaluators to observe the performance of your Prompts. --------------------- For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. [Evaluators](/docs/explanation/evaluators#online-monitoring) on Humanloop enable you to continuously measure the performance of your Prompts in production. Attach online Evaluators to your Prompts, and Humanloop will automatically run them on new Logs. You can then track the performance of your Prompts over time. ## Prerequisites * You have a Prompt receiving Logs. If not, please follow our [Prompt creation](/docs/development/guides/create-prompt) guide first. * You have an [online Evaluator](/docs/explanation/evaluators#online-monitoring). The example "Factuality" Evaluator is an online Evaluator that comes pre-configured with your organization. ## Attach Evaluator to your Prompt Attach the online Evaluator to your Prompt. Humanloop will automatically run the Evaluator on new Logs generated by your Prompt.To view the list of models that support Tool calling, see the [Models page](/docs/reference/models#models). ### Add Tool to the Prompt definition Click the **+ Tool** button in the bottom left of the Editor. Select the **Link File...** option, then select the `Weather tool` file you created earlier.![]()
You should now see "Weather tool" in the list of Tools.
### Run Prompt with Tool Now that your Tool is linked, you can start using it. In the panel on the right, add a User message with "What is the weather in London?". Press the **Run** button. You should see the **Assistant** respond with the tool call.
Press the **Add to Messages** button so you can make a subsequent call to the Prompt with the tool call result, to see how the model uses the tool call. This will move the Assistant's messages, containing the tool call, to the Messages section. You should now also see an **Output** section within the tool call, allowing you to insert an answer.
Enter `22` into the Output section and press **Continue**. The model will respond with "The current temperature in London is 22°C."
### Save the Prompt Now that you've linked a Tool to your Prompt, let's save it. Press the **Save** button and name this Prompt version `weather-model`.
### Open the Prompt's monitoring dialog Go to your Prompt's dashboard. Click **Monitoring** in the top right to open the monitoring dialog.  ### Connect your Evaluator Click **Connect Evaluators** and select the Evaluator you created. ### Ensure "Auto-run" is enabled Ensure the "Auto-run" switch is enabled for the Evaluator. This will ensure the Evaluator runs automatically on new Logs. ## View Evaluator results Humanloop will run the Evaluators on the new Logs as they are generated. ### Graphs over time Evaluator results are summarized in the **Dashboard** tab. Here, Humanloop displays the average Evaluator results over time. You can toggle the period and time resolution covered by the graphs to see how your Prompt has performed over time.  ### Filtering Logs To investigate specific Logs, go to the **Logs** tab. Here, you can see the Evaluator results for each Log generated by your Prompt. The Evaluator you attached above will have a column in the Logs table showing the results of the Evaluator.  You can filter the Logs table by the Evaluator results. Click on the column header to sort the table by the Evaluator results. For Evaluators with options (i.e. those with a return type of `select` or `multi_select`), you can filter the table by the applied options. ### Re-evaluating modified Logs Monitoring evaluators re-run on patched Logs and on Flow or Agent Logs when new Logs are added to their trace. This ensures the judgments always reflect the state of the Log. ## Next steps * Iterate on your Prompt based on the Evaluator results. You can open specific Logs in the Editor to tweak and test new Prompt versions. * [Add Logs of interest to a Dataset](../evals/create-dataset-from-logs) to use in an Evaluation. *** subtitle: Record end-user feedback using Humanloop; monitor how your model generations perform with your users. description: Learn how to record user feedback on your generated Prompt Logs using the Humanloop SDK. --------------------- For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. ### Prerequisites * You already have a Prompt — if not, please follow our [Prompt creation](/docs/v4/guides/create-prompt) guide first. * You have created a Human Evaluator. For this guide, we will use the "rating" example Evaluator automatically created for your organization.First you need to install and initialize the SDK. If you have already done this, skip to the next section. Open up your terminal and follow these steps: 1. Install the Humanloop SDK: ## Configure feedback To collect user feedback, connect a Human Evaluator to your Prompt. The Evaluator specifies the type of the feedback you want to collect. See our guide on [creating Human Evaluators](/docs/v4/guides/evaluation/evaluating-with-human-feedback) for more information.```python pip install humanloop ``` ```typescript npm install humanloop ``` 2. Initialize the SDK with your Humanloop API key (you can get it from the [Organization Settings page](https://app.humanloop.com/account/api-keys)).```python from humanloop import Humanloop humanloop = Humanloop(api_key=" ") # Check that the authentication was successful print(humanloop.prompts.list()) ``` ```typescript import { HumanloopClient, Humanloop } from "humanloop"; const humanloop = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); // Check that the authentication was successful console.log(await humanloop.prompts.list()); ``` You can use the example "rating" Evaluator that is automatically for you. This Evaluator allows users to apply a label of "good" or "bad", and is automatically connected to all new Prompts. If you choose to use this Evaluator, you can skip to the "Log feedback" section. Different use-cases and user interfaces may require different kinds of feedback that need to be mapped to the appropriate end user interaction. There are broadly 3 important kinds of feedback: 1. **Explicit feedback**: these are purposeful actions to review the generations. For example, ‘thumbs up/down’ button presses. 2. **Implicit feedback**: indirect actions taken by your users may signal whether the generation was good or bad, for example, whether the user ‘copied’ the generation, ‘saved it’ or ‘dismissed it’ (which is negative feedback). 3. **Free-form feedback**: Corrections and explanations provided by the end-user on the generation. You should create Human Evaluators structured to capture the feedback you need. For example, a Human Evaluator with return type "text" can be used to capture free-form feedback, while a Human Evaluator with return type "multi\_select" can be used to capture user actions that provide implicit feedback. If you have not done so, you can follow our guide to [create a Human Evaluator](/docs/v4/guides/evaluation/evaluating-with-human-feedback) to set up the appropriate feedback schema. ### Open the Prompt's monitoring dialog Go to your Prompt's dashboard. Click **Monitoring** in the top right to open the monitoring dialog.  ### Connect your Evaluator Click **Connect Evaluators** and select the Human Evaluator you created.  You should now see the selected Human Evaluator attached to the Prompt in the Monitoring dialog.  ## Log feedback With the Human Evaluator attached to your Prompt, you can record feedback against the Prompt's Logs.### Retrieve Log ID The ID of the Prompt Log can be found in the response of the `humanloop.prompts.call(...)` method. ```python log = humanloop.prompts.call( version_id="prv_qNeXZp9P6T7kdnMIBHIOV", path="persona", messages=[{"role": "user", "content": "What really happened at Roswell?"}], inputs={"person": "Trump"}, ) log_id = log.id ``` ### Log the feedback Call `humanloop.evaluators.log(...)` referencing the above Log ID as `parent_id` to record user feedback. ```python feedback = humanloop.evaluators.log( # Pass the `log_id` from the previous step to indicate the Log to record feedback against parent_id=log_id, # Here, we're recording feedback against a "Tweet Issues" Human Evaluator, # which is of type `multi_select` and has multiple options to choose from. path="Feedback Demo/Tweet Issues", judgment=["Inappropriate", "Too many emojis"], ) ``` ## View feedback You can view the applied feedback in two main ways: through the Logs that the feedback was applied to, and through the Evaluator itself. ### Feedback applied to Logs The feedback recorded for each Log can be viewed in the **Logs** table of your Prompt.  Your internal users can also apply feedback to the Logs directly through the Humanloop app.  ### Feedback for an Evaluator You can view all feedback recorded for a specific Human Evaluator in the **Logs** tab of the Evaluator. This will display all feedback recorded for the Evaluator across all other Files.  ## Next steps * [Create and customize your own Human Evaluators](../evals/human-evaluators) to capture the feedback you need. * Human Evaluators can also be used in Evaluations, allowing you to [collect judgments from your subject-matter experts](../evals/run-human-evaluation). *** subtitle: Instrument your AI project with any programming language using the API. description: Add logging your AI project using the Humanloop API. --------------------- For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. Our SDK offers high-level utilities for integrating Humanloop in your project. You can use the API to the same effect with any language you use or if you prefer more control. This guide revisits our [logging quickstart tutorial](/docs/v5/quickstart/set-up-logging): we'll use API actions instead of the SDK decorators, showing you how Humanloop instrumentation works step-by-step. By the end, we'll have a chat agent project integrated with Humanloop logging. The example uses the Python SDK, but the verbs map directly [to our API](/docs/v5/api-reference/sdks). ## PrerequisitesThe "rating" and "correction" Evaluators are attached to all Prompts by default. You can record feedback using these Evaluators as well. The "rating" Evaluator can be used to record explicit feedback (e.g. from a 👍/👎 button). ```python rating_log = humanloop.evaluators.log( parent_id=log_id, # We're recording feedback using the "rating" Human Evaluator, # which has 2 options: "good" and "bad". path="rating", judgment="good", # You can also include the source of the feedback when recording it with the `user` parameter. user="user_123", ) ``` The "correction" Evaluator can be used to record user-provided corrections to the generations (e.g. If the user edits the generation before copying it). ```python correction_log = humanloop.evaluators.log( parent_id=log_id, path="correction", judgment="NOTHING happened at Roswell, folks! Fake News media pushing ALIEN conspiracy theories. SAD! " + "I know Area 51, have the best aliens. Roswell? Total hoax! Believe me. 👽🚫 #Roswell #FakeNews", ) ``` If the user removes their feedback (e.g. if the user deselects a previous 👎 feedback), you can record this by passing `judgment=None`. ```python removed_rating_log = humanloop.evaluators.log( parent_id=log_id, path="rating", judgment=None, ) ``` ## Create the chat agent We start with a simple chat agent that answers math and science questions. Create a Humanloop Account
If you haven't already, [create an account](https://app.humanloop.com/signup) or [log in](https://app.humanloop.com/login) to HumanloopAdd an OpenAI API Key
If you're the first person in your organization, you'll need to add an API key to a model provider. 1. Go to OpenAI and [grab an API key](https://platform.openai.com/api-keys). 2. In Humanloop [Organization Settings](https://app.humanloop.com/account/api-keys) set up OpenAI as a model provider.Using the Prompt Editor will use your OpenAI credits in the same way that the OpenAI playground does. Keep your API keys for Humanloop and the model providers private. ```bash pip install humanloop openai ``` Humanloop SDK requires Python 3.9 or higher. Optionally, create a virtual environment to keep dependencies tidy. {/* TODO: Add a disclaimer for TS */} ## Log to Humanloop The agent works and is capable of function calling. However, we rely on inputs and outputs to reason about the behavior. Humanloop logging allows you to observe the steps taken by the agent, which we will demonstrate below. Create an `agent.py` file and add the following: ```python title="agent.py" maxLines=100 import os import json import datetime from humanloop import Humanloop from openai import OpenAI openai = OpenAI(api_key="YOUR_OPENAI_KEY") humanloop = Humanloop(api_key="YOUR_HUMANLOOP_KEY") def calculator(operation: str, num1: int, num2: int) -> str: """Do arithmetic operations on two numbers.""" if operation == "add": return num1 + num2 elif operation == "subtract": return num1 - num2 elif operation == "multiply": return num1 * num2 elif operation == "divide": return num1 / num2 else: return "Invalid operation" TOOL_JSON_SCHEMA = { "name": "calculator", "description": "Do arithmetic operations on two numbers.", "parameters": { "type": "object", "required": ["operation", "num1", "num2"], "properties": { "operation": {"type": "string"}, "num1": {"type": "integer"}, "num2": {"type": "integer"}, }, "additionalProperties": False, }, } def call_model(messages: list[str]) -> str: output = openai.chat.completions.create( messages=messages, model="gpt-4o", tools=[ { "type": "function", "function": TOOL_JSON_SCHEMA, } ], temperature=0.7, ) # Check if model asked for a tool call if output.choices[0].message.tool_calls: for tool_call in output.choices[0].message.tool_calls: arguments = json.loads(tool_call.function.arguments) if tool_call.function.name == "calculator": result = calculator(**arguments) return f"[TOOL CALL] {result}" # Otherwise, return the LLM response return output.choices[0].message.content def conversation(): messages = [ { "role": "system", "content": "You are a a groovy 80s surfer dude " "helping with math and science.", }, ] while True: user_input = input("You: ") if user_input == "exit": break messages.append({"role": "user", "content": user_input}) response = call_model(messages=messages) messages.append({"role": "assistant", "content": response}) print(f"Agent: {response}") if __name__ == "__main__": conversation() ``` Create an `agent.ts` file and add the following: ```typescript title="agent.ts" maxLines=100 import { OpenAI } from "openai"; import * as readline from 'readline/promises'; import { HumanloopClient } from "humanloop"; import { ChatCompletionMessageParam } from "openai/resources"; const openai = new OpenAI({ apiKey: "YOUR_OPENAI_KEY" }); const humanloop = new HumanloopClient({apiKey: "YOUR_HUMANLOOP_KEY"}); function calculator(operation: string, num1: number, num2: number): string | number { /** Do arithmetic operations on two numbers. */ switch (operation) { case "add": return num1 + num2; case "subtract": return num1 - num2; case "multiply": return num1 * num2; case "divide": return num1 / num2; default: return "Invalid operation"; } } const TOOL_JSON_SCHEMA = { name: "calculator", description: "Do arithmetic operations on two numbers.", parameters: { type: "object", required: ["operation", "num1", "num2"], properties: { operation: { type: "string" }, num1: { type: "integer" }, num2: { type: "integer" }, }, additionalProperties: false, }, }; async function callModel(messages: ChatCompletionMessageParam[]): Promise { const output = await openai.chat.completions.create({ messages: messages, model: "gpt-4o", tools: [ { type: "function", function: TOOL_JSON_SCHEMA, }, ], temperature: 0.7, }); // Check if model asked for a tool call const toolCalls = output.choices[0]?.message?.tool_calls; if (toolCalls) { for (const toolCall of toolCalls) { const toolArguments = JSON.parse(toolCall.function.arguments); if (toolCall.function.name === "calculator") { const toolStartTime = new Date(); const result = calculator(toolArguments.operation, toolArguments.num1, toolArguments.num2); return `[TOOL CALL] ${result}`; } } } // Otherwise, return the LLM response return output.choices[0]?.message?.content || ""; } async function conversation() { const messages: ChatCompletionMessageParam[] = [ { role: "system", content: "You are a groovy 80s surfer dude helping with math and science.", }, ]; const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); while (true) { let userInput = await rl.question("You: ") if (userInput === "exit") { rl.close(); break; } messages.push({ role: "user", content: userInput }); const response = await callModel(traceId, messages); messages.push({ role: "assistant", content: response }); console.log(`Agent: ${response}`); } } conversation(); ``` ### Initialize the trace Modify `call_model` to accept a `trace_id` argument. It will be used to associate [Logs](/docs/v5/explanations/logs) to the logging trace. The trace of the conversation will be associated with a [Flow](/docs/v5/explanations/flows). Initialize the trace at the start of the conversation. ## Run the code Have a conversation with the agent. When you're done, type `exit` to close the program.### Add logging We add log statements that will create the Logs contained in the trace. ```python title="agent.py" highlight={1,5-10,23} maxLines=30 def call_model(trace_id: str, messages: list[str]) -> str: ... def conversation(): trace_id = humanloop.flows.log( path="Logging Quickstart/QA Agent", flow={ "attributes": {}, }, ).id messages = [ { "role": "system", "content": "You are a a groovy 80s surfer dude " "helping with math and science.", }, ] while True: user_input = input("You: ") if user_input == "exit": break messages.append({"role": "user", "content": user_input}) response = call_model(trace_id=trace_id, messages=messages) messages.append({"role": "assistant", "content": response}) print(f"Agent: {response}") ``` ```typescript title="agent.ts" highlight={1,6-13,35} maxLines=30 async function callModel(traceId: string, messages: ChatCompletionMessageParam[]): Promise { ... } async function conversation() { const flowLog = await humanloop.flows.log({ path="Logging Quickstart/QA Agent", flow={ "attributes": {}, }, }); const traceId = flowLog.id; const messages: ChatCompletionMessageParam[] = [ { role: "system", content: "You are a groovy 80s surfer dude helping with math and science.", }, ]; const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); while (true) { let userInput = await rl.question("You: ") if (userInput === "exit") { rl.close(); break; } messages.push({ role: "user", content: userInput }); const response = await callModel(traceId, messages); messages.push({ role: "assistant", content: response }); console.log(`Agent: ${response}`); } } ``` ### Complete the trace When the conversation is finished, we mark the trace as complete, signalling no more logs will be added. ```python title="agent.py" highlight={2,12-23,30,32-44} def call_model(trace_id: str, messages: list[str]) -> str: prompt_start_time = datetime.datetime.now() output = openai.chat.completions.create( messages=messages, model="gpt-4o", tools=[{ "type": "function", "function": TOOL_JSON_SCHEMA, }], temperature=0.7, ) prompt_log_id = humanloop.prompts.log( path="Logging Quickstart/QA Prompt", prompt={ "model": "gpt-4o", "tools": [TOOL_JSON_SCHEMA], "temperature": 0.7, }, output=output.choices[0].message.content, trace_parent_id=trace_id, start_time=prompt_start_time, end_time=datetime.datetime.now(), ).id # Check if model asked for a tool call if output.choices[0].message.tool_calls: for tool_call in output.choices[0].message.tool_calls: arguments = json.loads(tool_call.function.arguments) if tool_call.function.name == "calculator": tool_start_time = datetime.datetime.now() result = calculator(**arguments) humanloop.tools.log( path="Logging Quickstart/Calculator", tool={ "name": "calculator", "description": "Do arithmetic operations on two numbers.", "function": TOOL_JSON_SCHEMA, }, inputs=arguments, output=result, trace_parent_id=prompt_log_id, start_time=tool_start_time, end_time=datetime.datetime.now(), ) return f"[TOOL CALL] {result}" # Otherwise, return the LLM response return output.choices[0].message.content ``` ```typescript title="agent.ts" highlight={2,15-28,39-53} async function callModel(traceId: string, messages: ChatCompletionMessageParam[]): Promise { const promptStartTime = new Date(); const output = await openai.chat.completions.create({ messages: messages, model: "gpt-4o", tools: [ { type: "function", function: TOOL_JSON_SCHEMA, }, ], temperature: 0.7, }); const promptLog = await humanloop.prompts.log({ path: "Logging Quickstart/QA Prompt", prompt: { model: "gpt-4o", tools: [TOOL_JSON_SCHEMA], temperature: 0.7, }, output: output.choices[0]?.message?.content || "", traceParentId: traceId, startTime: promptStartTime, endTime: new Date(), }); const promptLogId = promptLog.id; // Check if model asked for a tool call const toolCalls = output.choices[0]?.message?.tool_calls; if (toolCalls) { for (const toolCall of toolCalls) { const toolArguments = JSON.parse(toolCall.function.arguments); if (toolCall.function.name === "calculator") { const toolStartTime = new Date(); const result = calculator(toolArguments.operation, toolArguments.num1, toolArguments.num2); await humanloop.tools.log({ path: "Logging Quickstart/Calculator", tool: { "function": { "name": "calculator", "description": "Do arithmetic operations on two numbers.", "parameters": TOOL_JSON_SCHEMA }, }, inputs: toolArguments, output: JSON.stringify(result), traceParentId: promptLogId, startTime: toolStartTime, endTime: new Date(), }); return `[TOOL CALL] ${result}`; } } } // Otherwise, return the LLM response return output.choices[0]?.message?.content || ""; } async function conversation() { const traceLog = await humanloop.flows.log({ path: "Logging Quickstart/QA Agent", flow: { attributes: {}, }, }); const traceId = traceLog.id; const messages: ChatCompletionMessageParam[] = [ { role: "system", content: "You are a groovy 80s surfer dude helping with math and science.", }, ]; const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); while (true) { let userInput = await rl.question("You: ") if (userInput === "exit") { rl.close(); break; } messages.push({ role: "user", content: userInput }); const response = await callModel(traceId, messages); messages.push({ role: "assistant", content: response }); console.log(`Agent: ${response}`); } await humanloop.flows.updateLog(traceId, { "output": "", "traceStatus": "complete", }); } ``` ```python title="agent.py" highlight={24-28} maxLines=30 def conversation(): trace_id = humanloop.flows.log( path="Logging Quickstart/QA Agent", flow={ "attributes": {}, }, ).id messages = [ { "role": "system", "content": "You are a a groovy 80s surfer dude " "helping with math and science.", }, ] while True: user_input = input("You: ") if user_input == "exit": break messages.append({"role": "user", "content": user_input}) response = call_model(trace_id=trace_id, messages=messages) messages.append({"role": "assistant", "content": response}) print(f"Agent: {response}") humanloop.flows.update_log( log_id=trace_id, output="", status="complete", ) ``` ```typescript title="agent.ts" highlight={36-39} async function conversation() { const traceLog = await humanloop.flows.log({ path: "Logging Quickstart/QA Agent", flow: { attributes: {}, }, }); const traceId = traceLog.id; const messages: ChatCompletionMessageParam[] = [ { role: "system", content: "You are a groovy 80s surfer dude helping with math and science.", }, ]; const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); while (true) { let userInput = await rl.question("You: ") if (userInput === "exit") { rl.close(); break; } messages.push({ role: "user", content: userInput }); const response = await callModel(traceId, messages); messages.push({ role: "assistant", content: response }); console.log(`Agent: ${response}`); } await humanloop.flows.updateLog(traceId, { "output": "", "traceStatus": "complete", }); } ``` ## Check your workspace Navigate to [your workspace](https://app.humanloop.com) to see the logged conversation. Inside the **Logging Quickstart** directory on the left, click the **QA Agent** [Flow](/docs/v5/explanation/flows). Select the **Logs** tab from the top of the page and click the Log inside the table. You will see the conversation's trace, containing Logs corresponding to the [Tool](/docs/v5/explanation/tools) and the [Prompt](/docs/v5/explanation/prompts). ```bash curl title="Terminal" python agent.py You: Hi dude! Agent: Tubular! I am here to help with math and science, what is groovin? You: How does flying work? Agent: ... You: What is 5678 * 456? Agent: [TOOL CALL] 2587968 You: exit ``` ```bash curl title="Terminal" npx tsc && node dist/index.js You: Hi dude! Agent: Tubular! I am here to help with math and science, what is groovin? You: How does flying work? Agent: ... You: What is 5678 * 456? Agent: [TOOL CALL] 2587968 You: exit ``` ## Change the agent and rerun Modify the `call_model` function to use a different model and temperature.
Run the agent again, then head back to your workspace. Click the **QA Prompt** [Prompt](/docs/v5/explanation/prompts), select the **Dashboard** tab from the top of the page and you should find a new version of the Prompt at the top of the list. By changing the hyperparameters of the OpenAI call, you have tagged a new version of the Prompt. ```python title="agent.py" highlight={5,10,15,17} maxLines=30 def call_model(trace_id: str, messages: list[str]) -> str: prompt_start_time = datetime.datetime.now() output = openai.chat.completions.create( messages=messages, model="gpt-4o-mini", tools=[{ "type": "function", **TOOL_JSON_SCHEMA, }], temperature=0.2, ) prompt_log_id = humanloop.prompts.log( path="Logging Quickstart/QA Prompt", prompt={ "model": "gpt-4o-mini", "tools": [TOOL_JSON_SCHEMA], "temperature": 0.2, } output=output.choices[0].message.content, trace_parent_id=trace_id, start_time=prompt_start_time, end_time=datetime.datetime.now(), ).id ... ``` ```typescript title="agent.ts" highlight={5,12,18,20} maxLines=30 async function callModel(traceId: string, messages: ChatCompletionMessageParam[]): Promise { const promptStartTime = new Date(); const output = await openai.chat.completions.create({ messages: messages, model: "gpt-4o-mini", tools: [ { type: "function", function: TOOL_JSON_SCHEMA, }, ], temperature: 0.2, }); const promptLog = await humanloop.prompts.log({ path: "Logging Quickstart/QA Prompt", prompt: { model: "gpt-4o-mini", tools: [TOOL_JSON_SCHEMA], temperature: 0.2, }, output: output.choices[0]?.message?.content || "", traceParentId: traceId, startTime: promptStartTime, endTime: new Date(), }); ... ``` ## Next steps Logging is the first step to observing your AI product. Read these guides to learn more about evals on Humanloop: * Add [monitoring Evaluators](/docs/v5/guides/observability/monitoring) to evaluate Logs as they're made against a File. * See evals in action in our [tutorial on evaluating an agent](/docs/v5/tutorials/agent-evaluation). *** subtitle: How to invite collaborators to your Humanloop organization. description: Inviting people to your organization allows them to interact with your Humanloop projects. --------------------- For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. Inviting people to your organization allows them to interact with your Humanloop workspace: * Teammates will be able to create new Prompts, Tools, Datasets and Evaluators. * Developers will be able to get an API key to call, log and evaluate the Prompts via the SDK. * Annotators may give feedback the Logs and provide the human reviews for Evaluations. ## Invite Users To invite users to your organization:
### Go to your organization's **[Members page](https://app.humanloop.com/account/members)** ### Enter the **email address** Enter the email of the person you wish to invite into the **Invite members** box. 🎉 Once they create an account, they can view your projects at the same URL to begin collaborating. *** subtitle: API keys allow you to access the Humanloop API programmatically in your app. description: How to create, share and manage you Humanloop API keys. The API keys allow you to access the Humanloop API programmatically in your app. --------------------- For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. ## Create a new API key### Click **Send invite**. An email will be sent to the entered email address, inviting them to the organization. If the entered email address is not already a Humanloop user, they will be prompted to create an account before being added to the organization.
### Go to your Organization's **[API Keys page](https://app.humanloop.com/account/api-keys)**. ### Click the **Create new API key** button. ### Enter a name for your API key. Choose a name that helps you identify the key's purpose. You can't change the name of an API key after it's created. ### Click **Create**. ## Revoke an API key You can revoke an existing API key if it is no longer needed.### Copy the generated API key Save it in a secure location. You will not be shown the full API key again.
![]()
When an API key is revoked, future API requests that use this key will be rejected. Any systems that are dependent on this key will no longer work. ### Go to API keys page Go to your Organization's **[API Keys page](https://app.humanloop.com/account/api-keys)**. ### Identify the API key Find the key you wish to revoke by its name or by the displayed trailing characters. ### Click 'Revoke' Click the three dots button on the right of its row to open its menu. Click **Revoke**. A confirmation dialog will be displayed. Click **Remove**. *** subtitle: How to create and use environments to manage the deployment lifecycle of Prompts description: Environments are a tagging system for deploying Prompts. They enable you to deploy maintain a streamlined deployment workflow and keep track of different versions of Prompts. --------------------- For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. [Environments](/docs/explanation/environments) are a tagging system for deploying Prompts. They enable you to deploy maintain a streamlined deployment workflow and keep track of different versions of Prompts. The default environment is your production environment. Everytime you fetch a Prompt, Tool, Dataset etc. without specifying an alternative environment or specific version, the version that is tagged with the default environment is returned. ## Create an environment![]()
### Go to your [Environments](https://app.humanloop.com/account/environments) tab in your Organization's settings. ### Click the '**+ Environment**' button to open the new environment dialog ### Assign a custom name to the environment We recommend something short. For example, you could use `staging`, `prod`, `qa`, `dev`, `testing`, etc. This name is be used to identify the environment in the UI and in the API. ### Click **Create**. ## Rename an environment You can rename an environment to re-arrange your development workflows. Since each new file is automatically deployed to the default environment, which is production unless altered, it may make more sense to create a separate production environment and rename your current environments.
Renaming the environments will take immediate effect, so ensure that this change is planned and does not disrupt your production workflows. ### Go to environments page Go to your Organization's **[environments page](https://app.humanloop.com/account/environments)**. ### Identify the environment Find the environment you wish to rename. ### Click 'Rename' Click the three dots button on the right of its row to open its menu. Click **Rename**. A confirmation dialog will be displayed. Update the name and click **Rename**. *** subtitle: Humanloop provides a range of hosting options and guarantees to meet enterprise needs. description: Humanloop is SOC-2 compliant, offers within your VPC and never trains on your data. Learn more about our hosting options. --------------------- For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. Humanloop offers a broad range of hosting environments to meet the security and compliance needs of enterprise customers. Our menu of hosting options is as follows from basic to more advanced: 1. **Default**: Our multi-tenanted cloud offering is SOC2 compliant and hosted in AWS US-east region on AWS. 2. **Region specific**: Same as 1, but where additional region requirements for data storage are required - e.g. data can never leave the EU for GDPR reasons. We offer UK, EU and US guarantees for data storage regions. 3. **Dedicated**: We provision your own dedicated instance of Humanloop in your region of choice. With the additional added benefits: * Full [HIPAA compliant](https://aws.amazon.com/compliance/hipaa-compliance/) AWS setup. * Ability to manage your own encryption keys in KMS. * Ability to subscribe to application logging and cloudtrail infrastructure monitoring. 4. **Self-hosted**: You deploy an instance of Humanloop within your own VPC on AWS. We provide an infra as code setup with [Pulumi](https://www.pulumi.com/) to easily spin up a Humanloop instance in your VPC. *** description: Humanloop supports all the major large language model providers, including OpenAI, Anthropic, Google, AWS Bedrock, Azure, and more. Additionally, you can use your own custom models with with the API and still benefit from the Humanloop platform. --------------------- For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. Humanloop supports all the major large language model providers, including OpenAI, Anthropic, Google, AWS Bedrock, Azure, and more. Additionally, you can use your own custom models with with the API and still benefit from the Humanloop platform. ## Providers Here is a summary of which providers are supported, and what information is available for each provider automatically. | Provider | Models | Cost information | Token information | | ----------- | ---------------- | ---------------- | ----------------- | | OpenAI | ✅ | ✅ | ✅ | | Anthropic | ✅ | ✅ | ✅ | | Google | ✅ | ✅ | ✅ | | Azure | ✅ | ✅ | ✅ | | Cohere | ✅ | ✅ | ✅ | | Llama | ✅ | | | | Groq | ✅ | | | | AWS Bedrock | Anthropic, Llama | ✅ | ✅ | Adding in more providers is driven by customer demand. If you have a specific provider or model you would like to see supported, please reach out to us at [support@humanloop.com](mailto:support@humanloop.com). ## Models The following are models that are integrated with Humanloop. This means that they can be used in the Prompt Editor and are callable through the Humanloop API. If you have a specific model you would like to see supported, please reach out to us at [support@humanloop.com](mailto:support@humanloop.com).![]()
Remember, you can always use any model you want including your own self-hosted models, if you orchestrate the API calls yourself and log the data to Humanloop. | Provider | Model | Max Prompt Tokens | Max Output Tokens | Cost per Prompt Token | Cost per Output Token | Tool Support | Image Support | | ------------- | --------------------------------------------- | ----------------- | ----------------- | --------------------- | --------------------- | ------------ | ------------- | | openai | o1-preview | 128000 | 32768 | \$0.000015 | \$0.00006 | ❌ | ❌ | | openai | o1-mini | 128000 | 65536 | \$0.000003 | \$0.000012 | ❌ | ❌ | | openai | gpt-4.1 | 1047576 | 32768 | \$0.000002 | \$0.000008 | ✅ | ✅ | | openai | gpt-4.1-mini | 1047576 | 32768 | \$0.0000004 | \$0.0000016 | ✅ | ✅ | | openai | gpt-4.1-nano | 1047576 | 32768 | \$0.0000001 | \$0.0000004 | ✅ | ✅ | | openai | o3 | 200000 | 100000 | \$0.00001 | \$0.00004 | ✅ | ✅ | | openai | o4-mini | 200000 | 100000 | \$0.0000011 | \$0.0000044 | ✅ | ✅ | | openai | gpt-4.5-preview | 128000 | 16384 | \$0.000075 | \$0.00015 | ✅ | ✅ | | openai | gpt-4o-64k-output-alpha | 128000 | 64000 | \$0.000006 | \$0.000018 | ✅ | ✅ | | openai | gpt-4o | 128000 | 4096 | \$0.000005 | \$0.000015 | ✅ | ✅ | | openai | gpt-4o-mini | 128000 | 4096 | \$0.00000015 | \$0.0000006 | ✅ | ✅ | | openai | gpt-4 | 8192 | 4096 | \$0.00003 | \$0.00006 | ✅ | ❌ | | openai | gpt-4-turbo | 128000 | 4096 | \$0.00001 | \$0.00003 | ✅ | ✅ | | openai | gpt-4-turbo-2024-04-09 | 128000 | 4096 | \$0.00001 | \$0.00003 | ✅ | ❌ | | openai | gpt-4-32k | 32768 | 4096 | \$0.00003 | \$0.00003 | ✅ | ❌ | | openai | gpt-4-1106-preview | 128000 | 4096 | \$0.00001 | \$0.00003 | ✅ | ❌ | | openai | gpt-4-0125-preview | 128000 | 4096 | \$0.00001 | \$0.00003 | ✅ | ❌ | | openai | gpt-4-vision | 128000 | 4096 | \$0.00001 | \$0.00003 | ✅ | ✅ | | openai | gpt-4-1106-vision-preview | 16385 | 4096 | \$0.0000015 | \$0.000002 | ✅ | ❌ | | openai | gpt-3.5-turbo | 16385 | 4096 | \$0.0000015 | \$0.000002 | ✅ | ❌ | | openai | gpt-3.5-turbo-instruct | 8192 | 4097 | \$0.0000015 | \$0.000002 | ✅ | ❌ | | openai | babbage-002 | 16384 | 16384 | \$0.0000004 | \$0.0000004 | ✅ | ❌ | | openai | davinci-002 | 16384 | 16384 | \$0.000002 | \$0.000002 | ✅ | ❌ | | openai | ft:gpt-3.5-turbo | 4097 | 4096 | \$0.000003 | \$0.000006 | ✅ | ❌ | | openai | ft:davinci-002 | 16384 | 16384 | \$0.000002 | \$0.000002 | ✅ | ❌ | | openai | text-moderation | 32768 | 32768 | \$0.000003 | \$0.000004 | ✅ | ❌ | | anthropic | claude-3-5-sonnet-20241022 | 200000 | 8192 | \$0.000003 | \$0.000015 | ✅ | ✅ | | anthropic | claude-3-5-sonnet-20240620 | 200000 | 4096 | \$0.000003 | \$0.000015 | ✅ | ✅ | | anthropic | claude-3-5-haiku-20241022 | 200000 | 8192 | \$0.000003 | \$0.000015 | ✅ | ✅ | | anthropic | claude-3-opus-20240229 | 200000 | 4096 | \$0.000015 | \$0.000075 | ✅ | ❌ | | anthropic | claude-3-sonnet-20240229 | 200000 | 4096 | \$0.000003 | \$0.000015 | ✅ | ❌ | | anthropic | claude-3-haiku-20240307 | 200000 | 4096 | \$0.00000025 | \$0.00000125 | ✅ | ❌ | | anthropic | claude-2.1 | 100000 | 4096 | \$0.00000025 | \$0.000024 | ❌ | ❌ | | anthropic | claude-2 | 100000 | 4096 | \$0.000008 | \$0.000024 | ❌ | ❌ | | google | gemini-pro-vision | 16384 | 2048 | \$0.00000025 | \$0.0000005 | ❌ | ✅ | | google | gemini-1.0-pro-vision | 16384 | 2048 | \$0.00000025 | \$0.0000005 | ❌ | ✅ | | google | gemini-pro | 32760 | 8192 | \$0.00000025 | \$0.0000005 | ❌ | ❌ | | google | gemini-1.0-pro | 32760 | 8192 | \$0.00000025 | \$0.0000005 | ❌ | ❌ | | google | gemini-1.5-pro-latest | 1000000 | 8192 | \$0.00000025 | \$0.0000005 | ❌ | ❌ | | google | gemini-1.5-pro | 1000000 | 8192 | \$0.00000025 | \$0.0000005 | ❌ | ❌ | | google | gemini-1.5-flash | 1000000 | 8192 | \$0.000000075 | \$0.0000003 | ✅ | ✅ | | google | gemini-1.5-flash-8b | 1000000 | 8192 | \$0.0000000375 | \$0.00000015 | ✅ | ✅ | | google | gemini-2.5-pro-preview | 1048576 | 65536 | \$0.00000125 | \$0.00001 | ✅ | ✅ | | google | gemini-2.5-flash | 1048576 | 65536 | \$0.00000015 | \$0.0000006 | ✅ | ✅ | | openai\_azure | o1-preview | 128000 | 32768 | \$0.000015 | \$0.00006 | ❌ | ❌ | | openai\_azure | o1-mini | 128000 | 65536 | \$0.000003 | \$0.000012 | ❌ | ❌ | | openai\_azure | gpt-4.1 | 1047576 | 32768 | \$0.000002 | \$0.000008 | ✅ | ✅ | | openai\_azure | gpt-4.1-mini | 1047576 | 32768 | \$0.0000004 | \$0.0000016 | ✅ | ✅ | | openai\_azure | gpt-4.1-nano | 1047576 | 32768 | \$0.0000001 | \$0.0000004 | ✅ | ✅ | | openai\_azure | o3 | 200000 | 100000 | \$0.00001 | \$0.00004 | ✅ | ✅ | | openai\_azure | o4-mini | 200000 | 100000 | \$0.0000011 | \$0.0000044 | ✅ | ✅ | | openai\_azure | gpt-4o | 128000 | 4096 | \$0.000005 | \$0.000015 | ✅ | ✅ | | openai\_azure | gpt-4o-2024-05-13 | 128000 | 4096 | \$0.000005 | \$0.000015 | ✅ | ✅ | | openai\_azure | gpt-4-turbo-2024-04-09 | 128000 | 4096 | \$0.00003 | \$0.00006 | ✅ | ✅ | | openai\_azure | gpt-4 | 8192 | 4096 | \$0.00003 | \$0.00006 | ✅ | ❌ | | openai\_azure | gpt-4-0314 | 8192 | 4096 | \$0.00003 | \$0.00006 | ✅ | ❌ | | openai\_azure | gpt-4-32k | 32768 | 4096 | \$0.00006 | \$0.00012 | ✅ | ❌ | | openai\_azure | gpt-4-0125 | 128000 | 4096 | \$0.00001 | \$0.00003 | ✅ | ❌ | | openai\_azure | gpt-4-1106 | 128000 | 4096 | \$0.00001 | \$0.00003 | ✅ | ❌ | | openai\_azure | gpt-4-0613 | 8192 | 4096 | \$0.00003 | \$0.00006 | ✅ | ❌ | | openai\_azure | gpt-4-turbo | 128000 | 4096 | \$0.00001 | \$0.00003 | ✅ | ❌ | | openai\_azure | gpt-4-turbo-vision | 128000 | 4096 | \$0.000003 | \$0.000004 | ✅ | ✅ | | openai\_azure | gpt-4-vision | 128000 | 4096 | \$0.000003 | \$0.000004 | ✅ | ✅ | | openai\_azure | o3 | 200000 | 100000 | \$0.00001 | \$0.00004 | ✅ | ✅ | | openai\_azure | o4-mini | 200000 | 100000 | \$0.0000011 | \$0.0000044 | ✅ | ✅ | | openai\_azure | gpt-35-turbo-1106 | 16384 | 4096 | \$0.0000015 | \$0.000002 | ✅ | ❌ | | openai\_azure | gpt-35-turbo-0125 | 16384 | 4096 | \$0.0000005 | \$0.0000015 | ✅ | ❌ | | openai\_azure | gpt-35-turbo-16k | 16384 | 4096 | \$0.000003 | \$0.000004 | ✅ | ❌ | | openai\_azure | gpt-35-turbo | 4097 | 4096 | \$0.0000015 | \$0.000002 | ✅ | ❌ | | openai\_azure | gpt-3.5-turbo-instruct | 4097 | 4096 | \$0.0000015 | \$0.000002 | ✅ | ❌ | | openai\_azure | gpt-35-turbo-instruct | 4097 | 4097 | \$0.0000015 | \$0.000002 | ✅ | ❌ | | cohere | command-r | 128000 | 4000 | \$0.0000005 | \$0.0000015 | ❌ | ❌ | | cohere | command-light | 4096 | 4096 | \$0.000015 | \$0.000015 | ❌ | ❌ | | cohere | command-r-plus | 128000 | 4000 | \$0.000003 | \$0.000015 | ❌ | ❌ | | cohere | command-nightly | 4096 | 4096 | \$0.000015 | \$0.000015 | ❌ | ❌ | | cohere | command | 4096 | 4096 | \$0.000015 | \$0.000015 | ❌ | ❌ | | cohere | command-medium-beta | 4096 | 4096 | \$0.000015 | \$0.000015 | ❌ | ❌ | | cohere | command-xlarge-beta | 4096 | 4096 | \$0.000015 | \$0.000015 | ❌ | ❌ | | groq | llama-3.3-70b-versatile | 131072 | 8192 | \$0.0 | \$0.0 | ✅ | ❌ | | groq | llama-3.1-70b-versatile | 131072 | 8192 | \$0.0 | \$0.0 | ✅ | ❌ | | groq | llama-3.1-8b-instant | 131072 | 8192 | \$0.0 | \$0.0 | ✅ | ❌ | | groq | llama3-8b-8192 | 8192 | 8192 | \$0.0 | \$0.0 | ✅ | ❌ | | groq | llama3-70b-8192 | 8192 | 8192 | \$0.0 | \$0.0 | ✅ | ❌ | | groq | meta-llama/llama-4-maverick-17b-128e-instruct | 131072 | 8192 | \$0.0 | \$0.0 | ✅ | ✅ | | groq | meta-llama/llama-4-scout-17b-16e-instruct | 131072 | 8192 | \$0.0 | \$0.0 | ✅ | ✅ | | groq | meta-llama/Llama-Guard-4-12B | 131072 | 128 | \$0.0 | \$0.0 | ❌ | ✅ | | groq | deepseek-r1-distill-llama-70b | 131072 | 8192 | \$0.0 | \$0.0 | ❌ | ❌ | | groq | gemma2-9b-it | 8192 | 8192 | \$0.0 | \$0.0 | ✅ | ❌ | | replicate | llama-3-70b-instruct | 8192 | 8192 | \$0.00000065 | \$0.00000275 | ❌ | ❌ | | replicate | llama-3-70b | 8192 | 8192 | \$0.00000065 | \$0.00000275 | ❌ | ❌ | | replicate | llama-3-8b-instruct | 8192 | 8192 | \$0.00000005 | \$0.00000025 | ❌ | ❌ | | replicate | llama-3-8b | 8192 | 8192 | \$0.00000005 | \$0.00000025 | ❌ | ❌ | | replicate | llama-2-70b | 4096 | 4096 | \$0.00003 | \$0.00006 | ❌ | ❌ | | replicate | llama70b-v2 | 4096 | 4096 | N/A | N/A | ❌ | ❌ | | replicate | mixtral-8x7b | 4096 | 4096 | N/A | N/A | ❌ | ❌ | | bedrock\* | anthropic.claude-3.5-sonnet | 200000 | 4096 | \$0.000003 | \$0.000015 | ✅ | ✅ | | bedrock\* | anthropic.claude-3-5-haiku | 200000 | 4096 | \$0.000001 | \$0.000005 | ✅ | ✅ | | bedrock\* | anthropic.claude-3-sonnet | 200000 | 4096 | \$0.000003 | \$0.000015 | ✅ | ✅ | | bedrock\* | anthropic.claude-3-haiku | 200000 | 4096 | \$0.00000025 | \$0.00000125 | ✅ | ✅ | | bedrock\* | anthropic.claude-3-opus | 200000 | 4096 | \$0.000015 | \$0.000075 | ✅ | ✅ | | bedrock\* | meta.llama3-1-405b-instruct | 131072 | 2048 | \$0.00000532 | \$0.000016 | ✅ | ❌ | | bedrock\* | meta.llama3-1-70b-instruct | 131072 | 2048 | \$0.00000022 | \$0.00000022 | ✅ | ❌ | | bedrock\* | meta.llama3-1-8b-instruct | 131072 | 2048 | \$0.00000099 | \$0.00000099 | ✅ | ❌ | | bedrock\* | deepseek.r1-v1:0 | 32762 | 32762 | \$0.00000135 | \$0.0000054 | ✅ | ❌ | \* AWS Bedrock prices differ based on region. The prices listed are for us-west-2 *** title: Template Library subtitle: The Library provides example Evaluators, Prompts and Tools which you can customize for your use cases. description: Explore Humanloop’s template library. Find example evaluators and prompts for popular use cases like Agents and RAG, all ready for customization. --------------------- For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt.To help you get started, we provide a library of example Evaluators, Prompts, Tools and Datasets. These examples have been designed for common AI use-cases like RAG, customer service, and agents. Each example can be duplicated to your workspace and customized for your use cases. ## Browse the Library The Template Library includes various examples built for common AI application needs, including: #### Evaluators Pre-built evaluators for measuring semantic similarity, cost, latency, and other key metrics. Quickly assess your AI's performance with ready-made evaluators that are suited for RAG. Measure response accuracy, prompt quality, and user satisfaction with tools designed for reliable and consistent evaluation. #### Prompts Example prompts for common use cases including classification, question-answering, content generation, conversational agents, and RAG (Retrieval-Augmented Generation). #### Tools Ready-to-use tools for tasks like retrieval, data extraction, and calling external functions with JSON Schema function calling. #### Datasets Example datasets for common use cases including classification, question-answering, and content generation. #### Example Agents and Flows Example agent templates designed for common use cases like customer support, guided workflows, and RAG applications. These templates demonstrate best practices for building AI agents that can classify queries, answer questions, generate content, and provide context-aware responses by retrieving and incorporating relevant information. ## How to use templates 1. Navigate to the 'Library' page in the sidebar 2. Filter by type, category, or tags 3. Select a template you'd like to use 4. Click "Duplicate" to create a copy in your workspace that you can customize Once you've added a template to your workspace, you can modify it to match your specific requirements. Learn more about customizing your files in our guides for [Evaluators](/docs/evaluation/guides/code-based-evaluator), [Prompts](/docs/guides/prompts/create-prompt), and [Tools](/docs/guides/prompts/tool-calling-editor). *** subtitle: How to integrate Humanloop with the Vercel AI SDK description: Learn about the ways you can use Humanloop with the Vercel AI SDK. --------------------- For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt.
## Observability integration The Vercel AI SDK supports [tracing via OpenTelemetry](https://sdk.vercel.ai/docs/ai-sdk-core/telemetry). You can export these traces to Humanloop by enabling telemetry and configuring the OpenTelemetry Exporter.
The Vercel AI SDK tracing feature is experimental and subject to change. You must enable it with the `experimental_telemetry` parameter on each AI SDK function call that you want to trace. Learn how to add tracing to your AI SDK application below. ### Metadata parameters Humanloop's AI SDK OpenTelemetry Receiver will automatically extract the following metadata parameters from the `experimental_telemetry` metadata object: * `humanloop.directoryPath`: **\[Required]** The path to the directory on Humanloop. Generation spans will create Logs for this Directory on Humanloop. * `humanloop.traceId`: **\[Optional]** The ID of a Flow Log on Humanloop. Set this to group multiple calls to the AI SDK into a single Flow Log on Humanloop. ### Prerequisites The following steps assume you're already using the AI SDK in your application. If not, follow [Vercel's quickstarts](https://sdk.vercel.ai/docs/getting-started) to get started.## Learn more To see the integration in action, check out our [Vercel AI SDK guides](/docs/v5/integrations/vercel-ai-sdk). *** subtitle: Human-readable formats for Prompts and Agents that can be stored alongside your source code. description: Humanloop File formats allow you to store File configurations alongside your source code. They are human-readable, version-control-friendly, and can be used directly in your applications via the SDK's path parameter. --------------------- For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. Versions of Next \< 15 must set `experimental.instrumentationHook` in `next.config.js`. Learn more [here](https://nextjs.org/docs/app/building-your-application/optimizing/open-telemetry). You can find an example Next.js application that uses the AI SDK to stream chat responses [here](https://sdk.vercel.ai/cookbook/next/stream-text-with-chat-prompt).### Set up OpenTelemetry Install dependencies. ```bash title="npm" wordWrap npm install @vercel/otel @opentelemetry/sdk-logs @opentelemetry/api-logs @opentelemetry/instrumentation ``` ```bash title="pnpm" wordWrap pnpm add @vercel/otel @opentelemetry/sdk-logs @opentelemetry/api-logs @opentelemetry/instrumentation ``` ```bash title="yarn" wordWrap yarn add @vercel/otel @opentelemetry/sdk-logs @opentelemetry/api-logs @opentelemetry/instrumentation ``` Create a file called `instrumentation.ts` in your root or /src directory and add the following: ```typescript title="instrumentation.ts" import { registerOTel } from '@vercel/otel'; export function register() { registerOTel({ serviceName: 'humanloop-vercel-ai-sdk' }); } ``` ### Configure OpenTelemetry Configure the [OpenTelemetry exporter](https://opentelemetry.io/docs/specs/otel/protocol/exporter/) to forward logs to Humanloop. ```plaintext title=".env.local" wordWrap HUMANLOOP_API_KEY=# Configure the OpenTelemetry OTLP Exporter OTEL_EXPORTER_OTLP_ENDPOINT=https://api.humanloop.com/v5/import/otel OTEL_EXPORTER_OTLP_PROTOCOL=http/json OTEL_EXPORTER_OTLP_HEADERS="X-API-KEY= " # Humanloop API key ``` ### Trace AI SDK calls Now add the `experimental_telemetry` parameter to your AI SDK function calls to trace them. With a simple one-step generation, each call to `streamText` or `generateText` will be traced as a Prompt Log on Humanloop. ```typescript title="app/api/chat/route.ts" highlight={7-12} maxLines={50} import { openai } from '@ai-sdk/openai'; import { streamText } from 'ai'; // Allow streaming responses up to 30 seconds export const maxDuration = 30; export async function POST(req: Request) { const { messages, id } = await req.json(); const result = streamText({ model: openai('gpt-4o'), messages, experimental_telemetry: { isEnabled: true, metadata: { "humanloop.directoryPath": "path/to/directory", }, }, }); // Respond with the stream return result.toDataStreamResponse(); } ``` You can also group each step of a multi-step generation into a Flow by passing the `humanloopFlowPath` metadata value. ```typescript title="app/api/chat/route.ts" highlight={10-16} maxLines={50} import { openai } from '@ai-sdk/openai'; import { streamText } from 'ai'; // Allow streaming responses up to 30 seconds export const maxDuration = 30; export async function POST(req: Request) { const { messages, id } = await req.json(); const result = streamText({ model: openai('gpt-4o'), messages, maxSteps: 3, toolCallStreaming: true, system: "You are a helpful assistant that answers questions about the weather in a given city.", experimental_telemetry: { isEnabled: true, metadata: { "humanloop.directoryPath": "path/to/directory", } }, tools: { getWeatherInformation: { description: 'show the weather in a given city to the user', parameters: z.object({ city: z.string() }), execute: async ({}: { city: string }) => { const weatherOptions = ['sunny', 'cloudy', 'rainy', 'snowy', 'windy']; return { weather: weatherOptions[Math.floor(Math.random() * weatherOptions.length)], temperature: Math.floor(Math.random() * 50 - 10), }; } }, }, }); // Respond with the stream return result.toDataStreamResponse(); } ``` Node.js projects can use OpenTelemetry auto-instrumentation to trace requests without manually instrumenting code. Learn more about Node.js auto-instrumentation [here](https://opentelemetry.io/docs/languages/js/getting-started/nodejs). ### Set up OpenTelemetry Install dependencies. ```bash title="npm" wordWrap npm install dotenv @opentelemetry/sdk-node @opentelemetry/auto-instrumentations-node ``` ```bash title="pnpm" wordWrap pnpm add dotenv @opentelemetry/sdk-node @opentelemetry/auto-instrumentations-node ``` ```bash title="yarn" wordWrap yarn add dotenv @opentelemetry/sdk-node @opentelemetry/auto-instrumentations-node ``` Add the following code to your file to initialize and clean up the OpenTelemetry SDK.Do not forget to call await sdk.shutdown() before your application shuts down in order to flush any remaining traces to Humanloop. ```typescript title="main.ts" import dotenv from 'dotenv'; import { NodeSDK } from "@opentelemetry/sdk-node"; import { getNodeAutoInstrumentations } from "@opentelemetry/auto-instrumentations-node"; dotenv.config(); // Start the OpenTelemetry SDK const sdk = new NodeSDK({ instrumentations: [getNodeAutoInstrumentations()] }); sdk.start(); async function main() { // ... Your code here ... await sdk.shutdown(); } main().catch(console.error); ``` ### Configure OpenTelemetry Configure the [OpenTelemetry exporter](https://opentelemetry.io/docs/specs/otel/protocol/exporter/) to forward logs to Humanloop. ```plaintext title=".env.local" wordWrap HUMANLOOP_API_KEY=# Configure the OpenTelemetry OTLP Exporter OTEL_EXPORTER_OTLP_ENDPOINT=https://api.humanloop.com/v5/import/otel OTEL_EXPORTER_OTLP_PROTOCOL=http/json OTEL_EXPORTER_OTLP_HEADERS="X-API-KEY= " # Humanloop API key ``` ### Trace AI SDK calls Now add the `experimental_telemetry` parameter to your AI SDK function calls to trace them. With a simple one-step generation, each call to `streamText` or `generateText` will be traced as a Prompt Log on Humanloop. ```typescript title="main.ts" highlight={9-14} maxLines={50} import { openai } from '@ai-sdk/openai'; import { streamText } from 'ai'; async function main() { // Example of a simple one-step generation const result = await streamText({ model: openai('gpt-4o'), messages, experimental_telemetry: { isEnabled: true, metadata: { "humanloop.directoryPath": "path/to/directory", } } }); } ``` You can also group each step of a multi-step generation into a Flow by passing the `humanloopFlowPath` metadata value. ```typescript title="main.ts" highlight={12-18} maxLines={50} import { openai } from '@ai-sdk/openai'; import { streamText } from 'ai'; async function main() { // Example of a multi-step generation const result = await streamText({ model: openai('gpt-4o'), messages, maxSteps: 3, toolCallStreaming: true, system: "You are a helpful assistant that answers questions about the weather in a given city.", experimental_telemetry: { isEnabled: true, metadata: { "humanloop.directoryPath": "path/to/directory", } }, tools: { getWeatherInformation: { description: 'show the weather in a given city to the user', parameters: z.object({ city: z.string() }), execute: async ({}: { city: string }) => { const weatherOptions = ['sunny', 'cloudy', 'rainy', 'snowy', 'windy']; return { weather: weatherOptions[Math.floor(Math.random() * weatherOptions.length)], temperature: Math.floor(Math.random() * 50 - 10), }; } }, }, }); } ``` Humanloop provides serialized File formats (`.prompt`, `.agent`) for storing Prompts and Agents as human-readable, version-control-friendly files. These formats enable you to integrate your Prompts and Agents into standard software development workflows. ## File Types Humanloop currently supports the following File formats: * `.prompt` — Serialized representation of a [Prompt](/docs/explanation/prompts) * `.agent` — Serialized representation of an [Agent](/docs/explanation/agents) ## Usage The Humanloop SDK supports working with local Files in your codebase, enabling a code-first development approach.
```python title="Python" from humanloop import Humanloop # Initialize the client with local File support client = Humanloop( api_key="YOUR_HUMANLOOP_API_KEY", use_local_files=True # Enable using Files from the local filesystem ) # Call a local Prompt by referencing its path response = client.prompts.call( path="welcome-email", # Looks for humanloop/welcome-email.prompt inputs={"customer_name": "John Doe", "product_name": "Humanloop"} ) ``` ```typescript title="TypeScript" import { Humanloop } from "humanloop"; // Initialize the client with local File support const client = new Humanloop({ apiKey: "YOUR_HUMANLOOP_API_KEY", useLocalFiles: true # Enable using Files from the local filesystem }); // Call a local Prompt by referencing its path const response = await client.prompts.call({ path: "welcome-email", // Looks for humanloop/welcome-email.prompt inputs: { customer_name: "John Doe", product_name: "Humanloop" } }); ``` For detailed instructions on syncing and using local Files, see our [Store Prompts in code](/docs/development/guides/store-prompts-in-code) guide. ## Format Structure Both `.prompt` and `.agent` files follow the same basic structure: 1. **YAML frontmatter section** (enclosed between `---`): Contains all configuration parameters including model selection, generation parameters, and tool definitions. The frontmatter defines how the Prompt or Agent will execute when called. 2. **JSX-inspired content section**: Contains the template content with a syntax similar to JSX. This includes system messages, user prompts, and variable placeholders using `{{variable_name}}` syntax. The formats are nearly identical, with `.agent` files having just two additional parameters (`max_iterations` and `tools[].on_agent_call`) to control execution flow. ### Basic Format Example ```jsx --- model: gpt-4o temperature: 0.7 max_tokens: -1 provider: openai endpoint: chat tools: [] // Agent-specific parameters (only in .agent files): // max_iterations: 5 // tools[].on_agent_call: "continue" or "stop" ---You are a friendly assistant. ```Currently, we only support pulling these Files from Humanloop to your local environment. However, you can modify local Files and use them directly - when the SDK detects changes to a File, it automatically creates a new version for that path. Two-way synchronization is coming soon. ### Multi-modality and images Images can be specified using nested `` tags within a ` ` message. To specify text alongside the image, use a ` ` tag. ```jsx Image and Text ``` What is in this image? Currently, the `url` attribute only supports remote URLs (`https://`). Local file paths are not supported yet, though we're exploring this capability for future releases. ### Tools, tool calls, and tool responses Tools are specified in the YAML header as a JSON array. Both `.prompt` and `.agent` files can include tools, though `.agent` files include additional configuration for tool execution control. Assistant messages can contain either text or tool requests. For tool requests, use a `` tag within an ` ` tag with attributes `name` and `id`. The text wrapped in the ` ` tag should be a JSON-formatted string containing the tool call's arguments. Tool responses can then be added with standalone ` ` tags after the ` ` message, using the same `name` and `id` to link the response to the request. ```jsx --- model: gpt-4o temperature: 0.7 max_tokens: -1 provider: openai endpoint: chat tools: [ { "name": "get_current_weather", "description": "Get the current weather in a given location", "parameters": { "type": "object", "properties": { "location": { "type": "string", "name": "Location", "description": "The city and state, e.g. San Francisco, CA" }, "unit": { "type": "string", "name": "Unit", "enum": [ "celsius", "fahrenheit" ] } }, "required": [ "location" ] } } ] --- You are a friendly assistant. What is the weather in SF? { "location": "San Francisco, CA" } Cloudy with a chance of meatballs. ``` ## Related Resources * [Store Files in code](/docs/development/guides/store-prompts-in-code) - Detailed guide on how to store serialized Files in your codebase * [Prompts](/docs/explanation/prompts) - Learn more about how Prompts work in Humanloop * [Agents](/docs/explanation/agents) - Learn more about how Agents work in Humanloop *** subtitle: Humanloop provides a secure Python runtime to support defining code based Evaluator and Tool implementations. description: This reference provides details about the Python environment and supported packages. --------------------- For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. Humanloop allows you to specify the runtime for your code [Evaluators](../explanation/evaluators) and [Tool](../explanation/tools) implementations in order to run them natively with your Prompts in our Editor and UI based Evaluation workflows. ## Environment details Python version: **3.11.4** ``` anthropic==0.29.0 continuous-eval==0.3.13 jellyfish==1.1.0 jsonschema==4.22.0 langdetect==1.0.9 nltk==3.8.1 numpy==1.26.4 openai==1.35.10 pandas==2.2.2 pydantic==2.8.2 requests==2.32.3 scikit-learn==1.5.1 spacy==3.7.5 sqlglot==25.5.1 syllapy==0.7.2 textstat==0.7.3 transformers==4.43.4 ``` If you have any specific packages you would like to see here, please let us know at [support@humanloop.com](mailto:support@humanloop.com). *** subtitle: An overview of Humanloop's security and compliance measures description: Learn about Humanloop's commitment to security, data protection, and compliance with industry standards. --------------------- For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. Humanloop is deeply committed to AI governance, security, and compliance. View our [Trust Report](https://trust.humanloop.com/) and [Policy Pages](https://humanloop.com/policies/privacy-policy) to see all of our certifications, request documentation, and view high-level details on the controls we adhere to. Humanloop never trains on user data. ## Humanloop Security Offerings: * **Data Privacy and Security** * Activate LLMs with your private data, safely and securely. You own your data and models. * **Monitoring & Support** * End-to-end monitoring of your AI applications, support guarantees from trusted AI experts. * Data Encryption * Data Management & AI Governance ## User Authentication and Access Control ### Authentication & Access Control - Humanloop Web App All users of the Humanloop web application require a valid email address and password to use the system: * Email addresses are verified on account creation. * Passwords are verified as sufficiently complex. * Passwords are stored using a one-way salted hash. * User access logs are maintained including date, time, user ID, relevant URL, operation performed, and source IP address for audit purposes. ### Authentication & Access Control - Humanloop API All users of the API are required to authenticate with a unique API token header: * Follows the OAuth 2.0 pattern. * API tokens are only visible once on creation and then obfuscated. * Users can manage the expiry of API keys. * API token access logs are maintained including date, time, user ID, relevant URL, operation performed, and source IP address for audit purposes. ### Additional Resources * Role-based access control (RBAC) - We implement strict role-based access control (RBAC) for all our systems. * Multi-factor authentication (MFA) - MFA is enforced for all employee accounts. ## Encryption Standards ### **Encryption** Humanloop follows best practices for data management and encryption. All data in transit is secured with TLS/SSL, and all data at rest is encrypted using the AES-256 algorithm. All encryption keys are managed using AWS Key Management Service (KMS) as part of the VPC definition. * All data in transit is encrypted using TLS 1.2 or higher. * Data at rest is encrypted using AES-256 encryption. ### **Infrastructure** All sensitive data is encrypted in transit. For Self-Hosted Cloud (VPC) environments, network traffic is also encrypted in transit and at rest to meet HIPAA requirements. Sensitive application data is only ever processed within the ECS cluster and stored in Aurora. To request a network infrastructure diagram or more information, please contact [privacy@humanloop.com](mailto:privacy@humanloop.com). **Learn More** For more information about how Humanloop processes user data, visit our Data Management & Hosting Options page. ## Security Certifications ### SOC2 Type II Compliance Humanloop is fully SOC2 Type II compliant. Learn more via our [Trust Center](https://trust.humanloop.com/) and our [Security Policy](https://humanloop.com/policies/security-policy) page. ### HIPAA Compliance Humanloop actively works with paying customers to help them achieve HIPAA compliance. Official certification is pending. To request references or more information, contact [sales@humanloop.com](mailto:sales@humanloop.com). **HIPAA Compliance via Hosting Environment:** Humanloop offers dedicated platform instances on AWS with HIPAA provisions for enterprise customers that have particularly sensitive data. These provisions include: * The ability for enterprises to manage their own encryption keys. * A specific AWS Fargate deployment that follows HIPAA practices. ### GDPR Compliance We are fully compliant with the General Data Protection Regulation (GDPR). This includes: * Data minimization practices * User rights management * Data processing agreements ## **How Humanloop helps customers maintain compliance:** * Self-Hosted Cloud (VPC) environments * Data Processing Agreements (DPAs) * Data Minimization and Retention Policies * Role-Based Access Controls * Data Encryption * Robust Security Measures * Incident Response Plan SLAs * Regular Training & Audits ### Learn more: * Cloud Hosting Options * Data Management Protocols * [Security Policy](https://humanloop.com/policies/security-policy) * [Privacy Policy](https://humanloop.com/policies/privacy-policy) * [Trust Center](https://trust.humanloop.com/) To request references or more information, contact [sales@humanloop.com](mailto:sales@humanloop.com) *** subtitle: An overview of the data management practices and encryption methodologies used by Humanloop description: Discover Humanloop's robust data management practices and state-of-the-art encryption methods ensuring maximum security and compliance for AI applications. --------------------- For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. ### Data Handling and Segregation Separate environments are provisioned and maintained for development, quality assurance/user acceptance testing, and production to ensure data segregation at the environment level. ### Data Classification & Access Control All platform data received from the user and data derived from user data is classified as sensitive. All platform audit and telemetry data that does not contain PII and reference to specific user data is classified as not sensitive. By default, only authenticated users can see their own sensitive data. Data classified as not sensitive can be accessed by dedicated Humanloop support staff using a secure VPN connection to the private network of the VPC for the target environment. This access is for debugging issues and improving system performance. The Terms of Service define further details around data ownership and access on a case-by-case basis. ### Data Encryption and Security #### Encryption Humanloop follows best practices for data management and encryption. All data in transit is secured with TLS/SSL, and all data at rest is encrypted using the AES-256 algorithm. All encryption keys are managed using AWS Key Management Service (KMS) as part of the VPC definition. ### Infrastructure All sensitive data is encrypted in transit. For Self-Hosted Cloud (VPC) environments, network traffic is also encrypted in transit and at rest to meet HIPAA requirements. Sensitive application data is only processed within the ECS cluster and stored in Aurora. To request a network infrastructure diagram or more information, please contact [privacy@humanloop.com](mailto:privacy@humanloop.com). ### Learn More For more information on how Humanloop processes user data, visit our [Security & Compliance](https://trust.humanloop.com) page. ### Data Storage, Retention, and Recovery All platform data is stored in a primary database server with multi-availability zone replication. Platform data is retained indefinitely and backed up daily in a secure and encrypted manner until a request is made by the contractual owners of that data to remove it, in accordance with GDPR guidelines. Humanloop's Terms of Service define the contractual owner of the user data and data derived from the user data. A semi-automated disaster recovery process is in place to restore the database to a specified point-in-time backup as required. ### Data Breach Response Any data breaches will be communicated to all impacted Humanloop users and partners within 24 hours, along with consequences and mitigations. Breaches will be dealt with in accordance with the Humanloop data breach response policy, which is tested annually. ### Data Portability and Return Within 30 days post-contract termination, users can request the return of their data and derived data (as defined by the Terms of Service). Humanloop provides this data via downloadable files in comma-separated value (.csv) or .json formats. *** description: Learn about the different roles and permissions in Humanloop to help you with prompt and data management for large language models. --------------------- For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. Everyone invited to the organization can access all projects currently (controlling project access coming soon). A user can be one of the following rolws: **Admin:** The highest level of control. They can manage, modify, and oversee the Organization's settings and have full functionality across all projects. **Developer:** (Enterprise tier only) Can deploy Files, manage environments, create and add API keys, but lacks the ability to access billing or invite others. **Member:** (Enterprise tier only) The basic level of access. Can create and save Files, run Evaluations, but not deploy. Can not see any org-wide API keys. ## RBACs summary Here is the full breakdown of roles and access: | Action | Member | Developer | Admin | | :----------------------------- | :----- | :-------- | :---- | | Create and manage Files | ✔️ | ✔️ | ✔️ | | Inspect logs and feedback | ✔️ | ✔️ | ✔️ | | Create and manage Evaluators | ✔️ | ✔️ | ✔️ | | Run Evaluations | ✔️ | ✔️ | ✔️ | | Create and manage Datasets | ✔️ | ✔️ | ✔️ | | Create and manage API keys | | ✔️ | ✔️ | | Manage prompt deployments | | ✔️ | ✔️ | | Create and manage environments | | ✔️ | ✔️ | | Send invites | | | ✔️ | | Set user roles | | | ✔️ | | Manage billing | | | ✔️ | | Change Organization settings | | | ✔️ | *** subtitle: SSO and Authentication for Humanloop description: Learn about Single Sign-On (SSO) and authentication options for Humanloop --------------------- For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. {/* WIP - for gartner /start */} Humanloop offers authentication options to ensure secure access to your organization's resources. This guide covers our Single Sign-On (SSO) capabilities and other authentication methods. ## Single Sign-On (SSO) Single Sign-On allows users to access multiple applications with a single set of credentials. Humanloop supports SSO integration with major identity providers, enhancing security and simplifying user management. ### Supported SSO Providers * Google Workspace * Okta * Azure Active Directory * OneLogin * Custom SAML 2.0 providers ### Benefits of SSO 1. Enhanced security with centralized authentication 2. Simplified user management 3. Improved user experience with reduced password fatigue 4. Streamlined onboarding and offboarding processes ### Setting up SSO To set up SSO for your organization: 1. Contact our sales team to enable SSO for your account 2. Choose your identity provider 3. Configure the connection between Humanloop and your identity provider 4. Test the SSO integration 5. Roll out to your users ## Multi-Factor Authentication (MFA) For accounts not using SSO, we strongly recommend enabling Multi-Factor Authentication for an additional layer of security. ### MFA Options * Time-based One-Time Password (TOTP) apps * SMS-based verification * Hardware security keys (e.g., YubiKey) ## API Authentication For programmatic access to Humanloop, we use API keys. These should be kept secure and rotated regularly. ### Managing API Keys * Generate API keys in your account settings * Use environment variables to store API keys in your applications * Implement key rotation policies for enhanced security ## User Provisioning and Deprovisioning Humanloop supports automated user lifecycle management through our Directory Sync feature. This allows for: * Automatic user creation based on directory group membership * Real-time updates to user attributes and permissions * Immediate deprovisioning when users are removed from directory groups ## Best Practices 1. Use SSO when possible for centralized access control 2. Enable MFA for all user accounts 3. Regularly audit user access and permissions 4. Implement the principle of least privilege 5. Use secure protocols (HTTPS) for all communications with Humanloop For more information on setting up SSO or other authentication methods, please contact our support team or refer to our API documentation. ## Active Directory Sync Humanloop supports Active Directory Sync for automated user provisioning and deprovisioning. This feature allows you to: * Automatically create and update user accounts based on your Active Directory groups * Sync user attributes and roles in real-time * Instantly deprovision access when users are removed from AD groups * Maintain consistent access control across your organization * Reduce manual user management tasks and potential security risks To set up Active Directory Sync: 1. Contact our sales team to enable this feature for your account 2. Configure the connection between Humanloop and your Active Directory 3. Map your AD groups to Humanloop roles and permissions 4. Test the sync process with a small group of users 5. Roll out to your entire organization For more information on implementing Active Directory Sync, please contact our [support team](mailto:support@humanloop.com). {/* WIP - for gartner /end */} *** subtitle: Humanloop docs are accessible to AI tools using the llms.txt standard. description: Humanloop docs are accessible to AI tools using the llms.txt standard. --------------------- For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. ## What is llms.txt? LLMs.text is an [emerging standard](https://llmstxt.org/) so that websites can easily expose information to AI. We have implemented it for the Humanloop docs. ### An overview of the Humanloop docs The llms.txt file contains an overview of the Humanloop docs with links to each page./llms.txt for an overview of the Humanloop docs. ### The full content of the Humanloop docs The llms-full.txt file contains the full content of the Humanloop docs and API reference.
* **Small and fast**: Quick to load and easy to parse * **Summary-focused**: Each page with one-sentence description with its URL * **Structured for AI**: Helps tools understand the structure of the docs/llms-full.txt for the full content of the Humanloop docs and API reference Note that this might take up to 10 seconds to load. ### Raw markdown on any page available And on any specific page, you can add **`.md`** to the end of the URL to get the raw markdown content of the page.
* **Comprehensive**: Includes the full content of your documentation * **API knowledge**: Incorporates the full API reference and SDK snippets * **Convenient**: One giant payload for all the docsExample of the raw markdown for the Call Prompt page ## How to use llms.txt You can copy the URL and paste that into Cursor, ChatGPT or any other AI tool that can load a URL to give it as context to your LLM. * [https://humanloop.com/docs/llms.txt](https://humanloop.com/docs/llms.txt) * [https://humanloop.com/docs/llms-full.txt](https://humanloop.com/docs/llms-full.txt) If the AI tool you are using doesn't support loading a URL, you can copy the content and paste it into the prompt. *** description: Learn how to integrate Humanloop into your applications using our Python and TypeScript SDKs or REST API. --------------------- For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. The Humanloop platform can be accessed through the [API](/docs/v5/api) or through our Python and TypeScript SDKs.
Add **`.md`** to the end of the URL to get the raw markdown content of the page.### Usage Examples *** subtitle: In the event an issue occurs with our system, or with one of the model providers we integrate with, our API will raise a predictable and interpretable error. description: This page provides a list of the error codes and messages you may encounter when using the Humanloop API. --------------------- For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. ### HTTP error codes Our API will return one of the following HTTP error codes in the event of an issue: ```shell title="Installation" npm install humanloop ``` ```typescript title="Example usage" import { HumanloopClient } from "humanloop"; const humanloop = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); // Check that the authentication was successful console.log(await humanloop.prompts.list()); ``` ```shell title="Installation" pip install humanloop ``` ```python title="Example usage" from humanloop import Humanloop hl = Humanloop(api_key=" ") # Check that the authentication was successful print(hl.prompts.list()) ``` ## Error details Our `prompt/call` endpoint acts as a unified interface across all popular model providers. The error returned by this endpoint may be raised by the model provider's system. Details of the error are returned in the `detail` object of the response. ```json { "type": "unprocessable_entity_error", "message": "This model's maximum context length is 4097 tokens. However, you requested 10000012 tokens (12 in the messages, 10000000 in the completion). Please reduce the length of the messages or completion.", "code": 422, "origin": "OpenAI" } ``` *** title: Decorators Overview subtitle: Auto-instrumentation for AI features description: Overview of the decorator system in the Humanloop SDK --------------------- For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. ## Introduction Humanloop provides a set of decorators that help you instrument your AI features with minimal code changes. These decorators automatically create and manage Logs on the Humanloop platform, enabling monitoring, evaluation, and improvement of your AI applications. | Decorator | Purpose | Creates | Documentation | |-----------|---------|---------|---------------| | `prompt` | Instrument LLM provider calls | Prompt Logs | [Learn more →](/docs/v5/sdk/decorators/prompt) | | `tool` | Define function calling tools | Tool Logs | [Learn more →](/docs/v5/sdk/decorators/tool) | | `flow` | Trace multi-step AI features | Flow Log with traces | [Learn more →](/docs/v5/sdk/decorators/flow) | ## Common Patterns All decorators share these common characteristics: - **Path-based organization**: Each decorator requires a `path` parameter that determines where the File and its Logs are stored in your Humanloop workspace. - **Automatic versioning**: Changes to the decorated function or its parameters create new versions of the File. - **Error handling**: Errors are caught and logged, making debugging easier. - **Minimal code changes**: Decorate existing code and adopt the Humanloop SDK gradually. *** title: Flow Decorator subtitle: Automatic tracing for AI features description: Technical reference for the Flow decorator in the Humanloop SDK --------------------- For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. ## Overview The Flow decorator creates and manages traces for your AI feature. When applied to a function, it: - Creates a new trace on function invocation. - Adds all Humanloop logging calls made inside the function to the trace. - Completes the trace when the function exits. Your request was improperly formatted or presented. Your API key is incorrect or missing, or your user does not have the rights to access the relevant resource. The requested resource could not be located. Modifying the resource would leave it in an illegal state. Your request was properly formatted but contained invalid instructions or did not match the fields required by the endpoint. You've exceeded the maximum allowed number of requests in a given time period. An unexpected issue occurred on the server. The service is temporarily overloaded and you should try again. On Humanloop, a trace is the collection of Logs associated with a Flow Log. ## Usage The `flow` decorator will trace all downstream Humanloop logs, whether they are created by other decorators or SDK calls. ### Tracing Decorators```python maxLines=50 wrapLines title="Python" @hl_client.prompt(path="MyFeature/Call LLM"): def call_llm(messages: List[ChatMessage]): return openai.chat.completions.create( model="gpt-4o-mini", messages=messages ).choices[0].message.content @hl_client.flow(path="MyFeature/Process") def process_input(inputs: list[str]) -> list[str]: # Logs created by the Prompt decorator are added to the trace return [ call_llm([{"role": "user", "content": text}]) for text in inputs ] ``` ```typescript maxLines=50 wrapLines title="TypeScript" const callLLM = hlClient.prompt({ path: "MyFeature/Call LLM", callable: async (messages: ChatMessage[]): Promise ### Tracing SDK Calls Logs created through the Humanloop SDK are added to the trace.=> { const response = await openai.chat.completions.create({ model: "gpt-4o-mini", messages }); return response.choices[0].message.content; } }); const processInput = hlClient.flow({ path: "MyFeature/Process", callable: async (inputs: string[]): Promise => { // Logs created by the Prompt decorator are added to the trace return inputs.map(async (text) => await callLLM([ {"role": "user", "content": text} ])); }); ``` ```python maxLines=50 title="Python" wrapLines @hl_client.flow(path="MyFeature/Process") def process_input(text: str) -> str: # Created Log is added to the trace llm_output = hl_client.prompts.call( path="MyFeature/Transform", messages=[{"role": "user", "content": text}] ).logs[0].output_message.content transformed_output = transform(llm_output) # Created Log is added to the trace hl_client.tools.log( path="MyFeature/Transform", tool={function: TRANSFORM_JSON_SCHEMA}, inputs={"text": text}, output=transformed_output ) return transformed_output ``` ```typescript maxLines=50 const processInput = hlClient.flow({ path: "MyFeature/Process", callable: async (text: string): Promise ## Behavior=> { // Created Log is added to the trace const llmOutput = ( await hlClient.prompts.call({ path: "MyFeature/Transform", messages: [{ role: "user", content: text }], }) ).logs[0].outputMessage.content; const transformedOutput = transform(llmOutput); // Created Log is added to the trace await hlClient.tools.log({ path: "MyFeature/Transform", tool: { function: TRANSFORM_JSON_SCHEMA }, inputs: { text }, output: transformedOutput, }); return transformedOutput; }, }); ``` ## Definition The decorated function creates a Flow Log when called. All Logs created inside the decorated function are added to its trace. The Flow Log's fields are populated as follows: | Field | Type | Description | | ---------------- | ----------- | -------------------------------------------------------------------- | | `inputs` | object | Function arguments that aren't ChatMessage arrays | | `messages` | array | ChatMessage arrays passed as arguments | | `output_message` | ChatMessage | Return value if it's a ChatMessage-like object | | `output` | string | Stringified return value if not a ChatMessage-like object | | `error` | string | Error message if function throws or return value can't be serialized | If the decorated function returns a ChatMessage object, the `output_message` field is populated. Otherwise, the `output` field is populated with the stringified return value. The decorated function creates a Flow Log when called. All Logs created inside the decorated function are added to its trace. The Flow Log's fields are populated as follows: | Field | Type | Description | | --------------- | ----------- | -------------------------------------------------------------------- | | `inputs` | object | Function arguments that aren't ChatMessage arrays | | `messages` | array | ChatMessage arrays passed as arguments | | `outputMessage` | ChatMessage | Return value if it's a ChatMessage-like object | | `output` | string | Stringified return value if not a ChatMessage-like object | | `error` | string | Error message if function throws or return value can't be serialized | If the decorated function returns a ChatMessage object, the `outputMessage` field is populated. Otherwise, the `output` field is populated with the stringified return value. The decorator accepts the following parameters: | Parameter | Type | Required | Description | | ------------ | ------ | -------- | ---------------------------------------- | | `path` | string | Yes | Path on Humanloop workspace for the Flow | | `attributes` | object | No | Key-value object for versioning the Flow | ## SDK Interactions ```python @hl_client.flow( # Required: path on Humanloop workspace for the Flow path: str, # Optional: metadata for versioning the Flow attributes: dict[str, Any] = None ) def function(*args, **kwargs): ... ``` The decorator will preserve the function's signature. ```typescript hlClient.flow({ // Required: path on Humanloop workspace for the Flow path: string, // Required: decorated function callable: I extends Record & { messages: ChatMessage[] } ? (inputs: I) => O : () => O; // Optional: metadata for versioning the Flow attributes?: Record ; }) => Promise ``` The function returned by the decorator is async and preserves the signature of `callable`. Callable's `inputs` must extend `Record `. If a `messages` field is present in the `inputs`, it must have the `ChatMessage[]` type. The decorated function will not wrap the return value in a second Promise if the `callable` is also asynchronous. ## Error Handling - It's not possible to call `flows.log()` inside a decorated function. This will raise a [`HumanloopRuntimeError`](#error-handling) - To create nested traces, call another flow-decorated function. - Passing `trace_parent_id` argument to an SDK logging call inside the decorated function is ignored and emits a warning; the Log is added to the trace of the decorated function. - It's not possible to call `flows.log()` inside a decorated function. This will raise a [`HumanloopRuntimeError`](#error-handling) - To create nested traces, call another flow-decorated function. - Passing `traceParentId` argument to an SDK logging call inside the decorated function is ignored and emits a warning; the Log is added to the trace of the decorated function. ## Related Documentation A explanation of Flows and their role in the Humanloop platform is found in our [Flows](/docs/v5/explanation/flows) documentation. *** title: Prompt Decorator subtitle: Auto-instrumentation for LLM provider calls description: Technical reference for the Prompt decorator in the Humanloop SDK --------------------- For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. ## Overview The Prompt decorator automatically instruments LLM provider calls and creates Prompt Logs on Humanloop. When applied to a function, it: - Creates a new Log for each LLM provider call made within the decorated function. - Versions the Prompt using hyperparameters of the provider call. ### Decorator Definition - If user-written code (e.g. in code Evaluators) raises an exception, the relevant Log's `error` field is populated with the exception message and the decorated function returns `None`. - `HumanloopRuntimeError` exceptions indicate incorrect decorator or SDK usage and are re-raised instead of being logged under `error`. - If user-written code (e.g. in code Evaluators) throws an exception, the relevant Log's `error` field is populated with the exception message and the decorated function returns `undefined`. - `HumanloopRuntimeError` exceptions indicate incorrect decorator or SDK usage and are re-thrown instead of being logged under `error`. ### Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `path` | string | Yes | Path on Humanloop workspace for the Prompt | ### Usage ```python @hl_client.prompt( # Required: path on Humanloop workspace for the Prompt path: str ) def function(*args, **kwargs): ... ``` The decorated function will have the same signature as the original function. ```typescript hlClient.prompt({ // Required: path on Humanloop workspace for the Prompt path: string, // Required: decorated function callable: I extends Record & { messages?: ChatMessage[] } ? (args: I) => O : () => O; }) => Promise ``` The decorated function is always async and has the same signature as the `callable` argument. Callable's `args` must extend `Record `. If a `messages` field is present in the `args`, it must have type `ChatMessage[]`. The decorated function will not wrap the return value in a second Promise if the `callable` is also asynchronous. You must pass the providers you want to auto-instrument to the HumanloopClient constructor. Otherwise, the decorated function will work, but no Logs will be created. ```typescript {6-7} import { HumanloopClient } from "humanloop"; import { OpenAI } from "openai"; const hlClient = new HumanloopClient({ apiKey: process.env.HL_API_KEY, // Pass the provider module here instrumentProviders: { OpenAI } }) // You can now use the prompt decorator ``` ```python @hl_client.prompt(path="MyFeature/Process") def process_input(text: str) -> str: return openai.chat.completions.create( model="gpt-4o-mini", messages=[{"role": "user", "content": text}] ).choices[0].message.content ``` ```typescript const processInput = hlClient.prompt({ path: "MyFeature/Process", callable: async (text: string): Promise ## Behavior ### Versioning The hyperparameters of the LLM provider call are used to version the Prompt. If the configuration changes, new Logs will be created under the new version of the the same Prompt. The following parameters are considered for versioning the Prompt: | Parameter | Description | |-----------|-------------| | `model` | The LLM model identifier | | `endpoint` | The API endpoint type | | `provider` | The LLM provider (e.g., "openai", "anthropic") | | `max_tokens` | Maximum tokens in completion | | `temperature` | Sampling temperature | | `top_p` | Nucleus sampling parameter | | `presence_penalty` | Presence penalty for token selection | | `frequency_penalty` | Frequency penalty for token selection | ### Log Creation Each LLM provider call within the decorated function creates a Log with the following fields set:=> { return openai.chat.completions.create({ model: "gpt-4o-mini", messages: [{ role: "user", content: text }] }).choices[0].message.content; } }); ``` ## Error Handling | Field | Type | Description | |-------|------|-------------| | `inputs` | dict[str, Any] | Function arguments that aren't ChatMessage arrays | | `messages` | ChatMessage[] | ChatMessage arrays passed to the LLM | | `output_message` | ChatMessage | LLM response with role and content | | `error` | string | Error message if the LLM call fails | | `prompt_tokens` | int | Number of tokens in the prompt | | `reasoning_tokens` | int | Number of tokens used in reasoning | | `output_tokens` | int | Number of tokens in the completion | | `finish_reason` | string | Reason the LLM stopped generating | | `start_time` | datetime | When the LLM call started | | `end_time` | datetime | When the LLM call completed | | Field | Type | Description | |-------|------|-------------| | `inputs` | object | Function arguments that aren't ChatMessage arrays | | `messages` | ChatMessage[] | ChatMessage arrays passed to the LLM | | `output_message` | ChatMessage | LLM response with role and content | | `error` | string | Error message if the LLM call fails | | `prompt_tokens` | number | Number of tokens in the prompt | | `reasoning_tokens` | number | Number of tokens used in reasoning | | `output_tokens` | number | Number of tokens in the completion | | `finish_reason` | string | Reason the LLM stopped generating | | `start_time` | Date | When the LLM call started | | `end_time` | Date | When the LLM call completed | ## Best Practices 1. Multiple Logs will be created if you make multiple calls inside the decorated function. To avoid confusion, avoid calls with different providers or hyperparameters, as this will create multiple versions of the Prompt. 2. Calling `prompts.log()` or `prompts.call()` inside the decorated function works normally, with no interaction with the decorator. However, it indicates a misuse of the decorator, as they are alternatives for achieving the same result. 3. If you want to switch between providers with ease, use [`prompts.call()`](/docs/v5/api/prompts/call) with a `provider` parameter instead of the decorator. ## Related Documentation Humanloop Prompts are more than the string passed to the LLM provider. They encapsulate LLM hyperparameters, associations to available tools, and can be templated. For more details, refer to our [Prompts explanation](/docs/v5/explanation/prompts). *** title: Tool Decorator subtitle: Auto-instrumentation for function calls description: Technical reference for the Tool decorator in the Humanloop SDK --------------------- For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. ## Overview The Tool decorator helps you define [Tools](/docs/v5/explanation/tools) for use in function calling. It automatically instruments function calls and creates Tool Logs on Humanloop. - LLM provider errors are caught and logged in the Log's `error` field. However, `HumanloopRuntimeError` is not caught and will be re-raised: they indicate wrong SDK or decorator usage. - The decorated function propagates exceptions from the LLM provider. - LLM provider errors are caught and logged in the Log's `error` field. However, `HumanloopRuntimeError` is not caught and will be re-thrown: they indicate wrong SDK or decorator usage. - The decorated function propagates exceptions from the LLM provider. ### Definition Calling a decorated function will create a Tool Log with the following fields: - `inputs`: The function arguments. - `output`: The function return value. - `error`: The error message if the function call fails. Calling a decorated function will create a Tool Log with the following fields: - `inputs`: The function arguments. - `output`: The function return value. - `error`: The error message if the function call fails. ### Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `path` | string | Yes | Path on Humanloop workspace for the Tool | | `attributes` | object | No | Additional metadata for the Tool (Python only) | | `setup_values` | object | No | Values needed to setup the Tool (Python only) | | `version` | ToolKernelRequest | Yes | JSON Schema for the Tool (TypeScript only) | ### Usage ```python @hl_client.tool( # Required: path on Humanloop workspace for the Tool path: str, # Optional: additional metadata for the Tool attributes: Optional[dict[str, Any]] = None, # Optional: values needed to setup the Tool setup_values: Optional[dict[str, Any]] = None ) def function(*args, **kwargs): ... ``` The decorated function will have the same signature as the original function and will have a `json_schema` attribute containing the inferred JSON Schema. ```typescript hlClient.tool({ // Required: path on Humanloop workspace for the Tool path: string, // Required: decorated function callable: I extends Record ? (args: I) => O : () => O, // Required: JSON Schema for the Tool version: ToolKernelRequest }) => Promise ``` The decorated function is always async and has the same signature as the `callable` argument. It will have a `jsonSchema` attribute containing the provided JSON Schema. ## Behavior ### Schema Definition ```python @hl_client.tool(path="MyFeature/Calculator") def calculator(a: int, b: Optional[int] = None) -> int: """Add two numbers together.""" return a + (b or 0) ``` Decorating a function will set a `json_schema` attribute that can be used for function calling. ```python {5, 12-14} # Use with prompts.call response = hl_client.prompts.call( path="MyFeature/Assistant", messages=[{"role": "user", "content": "What is 5 + 3?"}], tools=[calculator.json_schema] ) # Or with OpenAI directly! response = openai.chat.completions.create( model="gpt-4o-mini", messages=[{"role": "user", "content": "What is 5 + 3?"}], tools=[{ "type": "function", "function": calculator.json_schema }] ) ``` ```typescript maxLines=50 const calculator = hlClient.tool({ path: "MyFeature/Calculator", callable: (inputs: { a: number; b?: number }) => { return inputs.a + (inputs.b || 0); }, version: { function: { name: "calculator", description: "Add two numbers together.", parameters: { type: "object", properties: { a: { type: "number" }, b: { type: "number" } }, required: ["a"] } } } }); ``` Decorating a function will set a `jsonSchema` attribute that can be used for function calling. ```typescript {5, 12-14} // Use with prompts.call const response = await hlClient.prompts.call({ path: "MyFeature/Assistant", messages: [{ role: "user", content: "What is 5 + 3?" }], tools: [calculator.jsonSchema] }); // Or with OpenAI directly! const response = await openai.chat.completions.create({ model: "gpt-4o-mini", messages: [{ role: "user", content: "What is 5 + 3?" }], tools: [{ type: "function", function: calculator.jsonSchema }] }); ``` ### Log Creation Each function call creates a Tool Log with the following fields: In Python, the decorator automatically infers a JSON Schema from the source code, argument signature, and docstrings: - Function name becomes the tool name - Function docstring becomes the tool description - Parameter type hints are converted to JSON Schema types - Optional parameters (using `Optional[T]` or `T | None`) are marked as not required - Return type is not included in the schema Supported type hints: | Python Type | JSON Schema Type | |-------------|------------------| | `str` | `"string"` | | `int` | `"integer"` | | `float` | `"number"` | | `bool` | `"boolean"` | | `list[T]` | `"array"` with items of type T | | `dict[K, V]` | `"object"` with properties of types K and V | | `tuple[T1, T2, ...]` | `"array"` with items of specific types | | `Optional[T]` or `T \| None` | Type T with `"null"` added | | `Union[T1, T2, ...]` | `"anyOf"` with types T1, T2, etc. | | No type hint | `any` | In TypeScript, you must provide a JSON Schema in the `version` parameter: ```typescript version: { function: { name: string; description: string; parameters: { type: "object"; properties: Record ; required?: string[]; }; }; attributes?: Record ; setup_values?: Record ; } ``` ## Error Handling | Field | Type | Description | |-------|------|-------------| | `inputs` | dict[str, Any] | Function arguments | | `output` | string | JSON-serialized return value | | `error` | string | Error message if the function call fails | | Field | Type | Description | |-------|------|-------------| | `inputs` | object | Function arguments | | `output` | string | JSON-serialized return value | | `error` | string | Error message if the function call fails | ## Best Practices - Function errors are caught and logged in the Log's `error` field. - The decorated function returns `None` when an error occurs. - `HumanloopRuntimeError` is not caught and will be re-raised, as it indicates incorrect SDK or decorator usage. - Function errors are caught and logged in the Log's `error` field. - The decorated function returns `undefined` when an error occurs. - Schema validation errors are thrown if the inputs don't match the schema. - `HumanloopRuntimeError` is not caught and will be re-thrown, as it indicates incorrect SDK or decorator usage. ## Related Documentation For a deeper understanding of Tools and their role in the Humanloop platform, refer to our [Tools](/docs/v5/explanation/tools) documentation. For attaching a Tool to a Prompt, see [Tool calling in Editor](/docs/v5/guides/prompts/tool-calling-editor) and [linking a Tool to a Prompt](/docs/v5/guides/prompts/link-tool). *** title: Run Evaluation subtitle: Quickly evaluate your LLM apps and improve them, all managed in code. description: Getting up and running with Humanloop is quick and easy. This guide will explain how to set up evaluations on Humanloop and use them to iteratively improve your applications. --------------------- For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. The `evaluations.run()` function is a convenience function that allows you to trigger evaluations from code. It will create the evaluation, fetch the dataset, generate all the Logs and then run the evaluators on each log. It supports evaluating arbitrary functions, Prompts stored on Humanloop, and Prompts defined in code. ## Parameters You can see the source code for the `evaluations.run()` function in [Python](https://github.com/humanloop/humanloop-python/blob/master/src/humanloop/evals/run.py#L106) and [TypeScript](https://github.com/humanloop/humanloop-node/blob/master/src/evals/run.ts#L211). 1. Use clear and descriptive docstrings in Python to provide good tool descriptions 2. Ensure all function parameters have appropriate type hints in Python 3. Make return values JSON-serializable 4. Use the `json_schema` attribute when passing the tool to `prompts.call()` 1. Use clear and descriptive docstrings in TypeScript to provide good tool descriptions 2. Ensure all function parameters have appropriate type hints in TypeScript 3. Make return values JSON-serializable 4. Use the `jsonSchema` attribute when passing the tool to `prompts.call()` Name of the evaluation to help identify it Configuration for what is being evaluated. The evaluation will be stored on this File. Path to the evaluated File (a [Prompt](/docs/explanation/prompts), [Flow](/docs/explanation/flows), [Tool](/docs/explanation/tools), [Evaluator](/docs/explanation/evaluators) etc.) on Humanloop. If the File does not exist on Humanloop, it will be created. Example: `My Agent` will create a `flow` file on Humanloop. `flow` (default), `prompt`, `tool`, `evaluator` If the File does not exist on Humanloop, it will be created with this File type. Pass in the details of the version of the File you want to evaluate. For example, for a Flow you might pass in identifiers: ```json { "git_hash": "1234567890", "identifier": "rag-with-pinecone" } ``` Or for a Prompt you can pass in Prompt details and it will be called. ```json { "model": "gpt-4", "template": [ { "role": "user", "content": "You are a helpful assistant on the topic of {{topic}}." } ] } ``` Function to evaluate (optional if the File is runnable on Humanloop like a Prompt). It will be called using your Dataset `callable(**datapoint.inputs, messages=datapoint.messages)`. It should return a single string output. List of evaluators to judge the generated output Path to evaluator on Humanloop The type of arguments the Evaluator expects - only required for local Evaluators The type of return value the Evaluator produces - only required for local Evaluators Function to evaluate (optional if the Evaluator is runnable on Humanloop). It will be called using the generated output as follows: `callable(output)`. It should return a single string output. Optional function that logs the output judgment from your Evaluator to Humanloop. If provided, it will be called as: `judgment = callable(log_dict); log = custom_logger(client, judgment)`. Inside the custom_logger, you can use the Humanloop `client` to log the judgment to Humanloop. If not provided your function must return a single string and by default the code will be used to inform the version of the external Evaluator on Humanloop. The threshold to check the evaluator result against Dataset to evaluate against ## Return Type Returns an `EvaluationStats` object containing: - run_stats: Array of statistics for each run - progress: Summary of evaluation progress - report: Detailed evaluation report - status: Current status of evaluation # Examples ## 1. Evaluating an Arbitrary Flow Function To evaluate an arbitrary workflow you can pass in the `callable` parameter to the `file` object.Path to existing dataset on Humanloop. If the Dataset does not exist on Humanloop, it will be created. The datapoints to map your function over to produce the outputs required by the evaluation. Optional - if not provided, the evaluation will be run over the datapoints stored on Humanloop. ```python def my_flow_function(messages): # Your custom logic here return "Response based on messages" evaluation = humanloop.evaluations.run( name="Custom Flow Evaluation", type="flow", file={ "path": "Custom/Flow", "callable": my_flow_function }, evaluators=[ {"path": "Example Evaluators/AI/Semantic similarity"}, {"path": "Example Evaluators/Code/Latency"} ], dataset={ "path": "Test/Dataset", "datapoints": [ { "messages": [ {"role": "user", "content": "Test question 1"} ] } ] } ) ``` ```typescript const myFlowFunction = (messages: Message[]): string => { // Your custom logic here return "Response based on messages"; }; const evaluation = await humanloop.evaluations.run({ name: "Custom Flow Evaluation", file: { path: "Custom/Flow", type: "flow", callable: myFlowFunction, }, evaluators: [ { path: "Example Evaluators/AI/Semantic similarity" }, { path: "Example Evaluators/Code/Latency" }, ], dataset: { path: "Test/Dataset", datapoints: [ { messages: [{ role: "user", content: "Test question 1" }], }, ], }, }); ``` ## 2. Evaluating a Prompt on Humanloop To evaluate a Prompt stored on Humanloop you simply supply a `path` to the Prompt and a list of Evaluators.```python evaluation = humanloop.evaluations.run( name="Existing Prompt Evaluation", file={ "path": "Existing/Prompt", }, evaluators=[ {"path": "Example Evaluators/AI/Semantic similarity"}, {"path": "Example Evaluators/Code/Cost"} ], dataset={ "path": "Existing/Dataset" } ) ``` ```typescript const evaluation = await humanloop.evaluations.run({ name: "Existing Prompt Evaluation", file: { path: "Existing/Prompt", }, evaluators: [ { path: "Example Evaluators/AI/Semantic similarity" }, { path: "Example Evaluators/Code/Cost" }, ], dataset: { path: "Existing/Dataset", }, }); ``` ## 3. Evaluating a Prompt in Code To evaluate a Prompt defined in code you can pass in the `model`, `template` and other Prompt parameters to the `file`'s `version` object.```python evaluation = humanloop.evaluations.run( name="Code Prompt Evaluation", file={ "path": "Code/Prompt", "version": { "model": "gpt-4", "template": [ { "role": "system", "content": "You are a helpful assistant on the topic of {{topic}}." } ] }, }, evaluators=[ {"path": "Example Evaluators/AI/Semantic similarity"}, {"path": "Example Evaluators/Code/Latency"} ], dataset={ "datapoints": [ { "inputs": { "topic": "machine learning" }, "messages": [ {"role": "user", "content": "What is machine learning?"} ], "target": { "output": "Machine learning is a subset of artificial intelligence..." } } ] } ) ``` ```typescript const evaluation = await humanloop.evaluations.run({ name: "Code Prompt Evaluation", file: { path: "Code/Prompt", model: "gpt-4", template: [ { role: "system", content: "You are a helpful assistant on the topic of {{topic}}.", }, ], }, evaluators: [ { path: "Example Evaluators/AI/Semantic similarity" }, { path: "Example Evaluators/Code/Latency" }, ], dataset: { datapoints: [ { inputs: { topic: "machine learning" }, messages: [{ role: "user", content: "What is machine learning?" }], target: { output: "Machine learning is a subset of artificial intelligence...", }, }, ], }, }); ``` Each example demonstrates a different way to use the `evaluation.run` function. The function returns evaluation statistics that can be used to understand the performance of your LLM application according to the specified evaluators. You can view the results of your evaluation in the Humanloop UI by navigating to the specified file path, or by checking the evaluation stats programmatically using the returned object's `report` field. For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. The Humanloop API allows you to interact with Humanloop and model providers programmatically. You can do this through HTTP requests from any language or via our official Python or TypeScript SDK.First you need to install and initialize the SDK. If you have already done this, skip to the next section. Open up your terminal and follow these steps: 1. Install the Humanloop SDK: Guides and further details about key concepts can be found in [our docs](/docs/getting-started/overview). For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. # Log to a Prompt POST https://api.humanloop.com/v5/prompts/log Content-Type: application/json Log to a Prompt. You can use query parameters `version_id`, or `environment`, to target an existing version of the Prompt. Otherwise, the default deployed version will be chosen. Instead of targeting an existing version explicitly, you can instead pass in Prompt details in the request body. In this case, we will check if the details correspond to an existing version of the Prompt. If they do not, we will create a new version. This is helpful in the case where you are storing or deriving your Prompt details in code. Reference: https://humanloop.com/docs/api/prompts/log ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /prompts/log: post: operationId: log summary: Log to a Prompt description: >- Log to a Prompt. You can use query parameters `version_id`, or `environment`, to target an existing version of the Prompt. Otherwise, the default deployed version will be chosen. Instead of targeting an existing version explicitly, you can instead pass in Prompt details in the request body. In this case, we will check if the details correspond to an existing version of the Prompt. If they do not, we will create a new version. This is helpful in the case where you are storing or deriving your Prompt details in code. tags: - subpackage_prompts parameters: - name: version_id in: query description: A specific Version ID of the Prompt to log to. required: false schema: type: string - name: environment in: query description: Name of the Environment identifying a deployed version to log to. required: false schema: type: string - name: X-API-KEY in: header required: true schema: type: string responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/type_:CreatePromptLogResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/type_:HttpValidationError' requestBody: content: application/json: schema: type: object properties: run_id: type: string description: Unique identifier for the Run to associate the Log to. path: type: string description: >- 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: type: string description: ID for an existing Prompt. output_message: $ref: '#/components/schemas/type_:ChatMessage' description: The message returned by the provider. prompt_tokens: type: integer description: Number of tokens in the prompt used to generate the output. reasoning_tokens: type: integer description: Number of reasoning tokens used to generate the output. output_tokens: type: integer description: Number of tokens in the output generated by the model. prompt_cost: type: number format: double description: Cost in dollars associated to the tokens in the prompt. output_cost: type: number format: double description: Cost in dollars associated to the tokens in the output. finish_reason: type: string description: Reason the generation finished. messages: type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: The messages passed to the to provider chat endpoint. tool_choice: $ref: '#/components/schemas/type_prompts:PromptLogRequestToolChoice' description: >- Controls how the model uses tools. The following options are supported: - `'none'` means the model will not call any tool and instead generates a message; this is the default when no tools are provided as part of the Prompt. - `'auto'` means the model can decide to call one or more of the provided tools; this is the default when tools are provided as part of the Prompt. - `'required'` means the model must call one or more of the provided tools. - `{'type': 'function', 'function': {name':```python pip install humanloop ``` ```typescript npm install humanloop ``` 2. Initialize the SDK with your Humanloop API key (you can get it from the [Organization Settings page](https://app.humanloop.com/account/api-keys)).```python from humanloop import Humanloop humanloop = Humanloop(api_key=" ") # Check that the authentication was successful print(humanloop.prompts.list()) ``` ```typescript import { HumanloopClient, Humanloop } from "humanloop"; const humanloop = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); // Check that the authentication was successful console.log(await humanloop.prompts.list()); ``` }}` forces the model to use the named function. prompt: $ref: '#/components/schemas/type_prompts:PromptLogRequestPrompt' description: >- The Prompt configuration to use. Two formats are supported: - An object representing the details of the Prompt configuration - A string representing the raw contents of a .prompt file A new Prompt version will be created if the provided details do not match any existing version. start_time: type: string format: date-time description: When the logged event started. end_time: type: string format: date-time description: When the logged event ended. output: type: string description: >- Generated output from your model for the provided inputs. Can be `None` if logging an error, or if creating a parent Log with the intention to populate it later. created_at: type: string format: date-time description: 'User defined timestamp for when the log was created. ' error: type: string description: Error message if the log is an error. provider_latency: type: number format: double description: Duration of the logged event in seconds. stdout: type: string description: Captured log and debug statements. provider_request: type: object additionalProperties: description: Any type description: Raw request sent to provider. provider_response: type: object additionalProperties: description: Any type description: Raw response received the provider. inputs: type: object additionalProperties: description: Any type description: The inputs passed to the prompt template. source: type: string description: Identifies where the model was called from. metadata: type: object additionalProperties: description: Any type description: Any additional metadata to record. source_datapoint_id: type: string description: >- Unique identifier for the Datapoint that this Log is derived from. This can be used by Humanloop to associate Logs to Evaluations. If provided, Humanloop will automatically associate this Log to Evaluations that require a Log for this Datapoint-Version pair. trace_parent_id: type: string description: The ID of the parent Log to nest this Log under in a Trace. user: type: string description: End-user ID related to the Log. environment: type: string description: The name of the Environment the Log is associated to. save: type: boolean default: true description: >- Whether the request/response payloads will be stored on Humanloop. log_id: type: string description: >- This will identify a Log. If you don't provide a Log ID, Humanloop will generate one for you. servers: - url: https://api.humanloop.com/v5 components: schemas: type_:TextChatContent: type: object properties: type: type: string enum: - text text: type: string description: The message's text content. required: - type - text title: TextChatContent type_:ImageUrlDetail: type: string enum: - high - low - auto description: >- Specify the detail level of the image provided to the model. For more details see: https://platform.openai.com/docs/guides/vision/low-or-high-fidelity-image-understanding title: ImageUrlDetail type_:ImageUrl: type: object properties: url: type: string description: Either a URL of the image or the base64 encoded image data. detail: $ref: '#/components/schemas/type_:ImageUrlDetail' description: >- Specify the detail level of the image provided to the model. For more details see: https://platform.openai.com/docs/guides/vision/low-or-high-fidelity-image-understanding required: - url title: ImageUrl type_:ImageChatContent: type: object properties: type: type: string enum: - image_url image_url: $ref: '#/components/schemas/type_:ImageUrl' description: The message's image content. required: - type - image_url title: ImageChatContent type_:ChatMessageContentItem: oneOf: - $ref: '#/components/schemas/type_:TextChatContent' - $ref: '#/components/schemas/type_:ImageChatContent' title: ChatMessageContentItem type_:ChatMessageContent: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessageContentItem' description: The content of the message. title: ChatMessageContent type_:ChatRole: type: string enum: - user - assistant - system - tool - developer description: An enumeration. title: ChatRole type_:ChatToolType: type: string enum: - function description: The type of tool to call. title: ChatToolType type_:FunctionTool: type: object properties: name: type: string arguments: type: string required: - name description: A function tool to be called by the model where user owns runtime. title: FunctionTool type_:ToolCall: type: object properties: id: type: string type: $ref: '#/components/schemas/type_:ChatToolType' function: $ref: '#/components/schemas/type_:FunctionTool' required: - id - type - function description: A tool call to be made. title: ToolCall type_:AnthropicThinkingContent: type: object properties: type: type: string enum: - thinking thinking: type: string description: Model's chain-of-thought for providing the response. signature: type: string description: >- Cryptographic signature that verifies the thinking block was generated by Anthropic. required: - type - thinking - signature title: AnthropicThinkingContent type_:AnthropicRedactedThinkingContent: type: object properties: type: type: string enum: - redacted_thinking data: type: string description: >- Thinking block Anthropic redacted for safety reasons. User is expected to pass the block back to Anthropic required: - type - data title: AnthropicRedactedThinkingContent type_:ChatMessageThinkingItem: oneOf: - $ref: '#/components/schemas/type_:AnthropicThinkingContent' - $ref: '#/components/schemas/type_:AnthropicRedactedThinkingContent' title: ChatMessageThinkingItem type_:ChatMessage: type: object properties: content: $ref: '#/components/schemas/type_:ChatMessageContent' description: The content of the message. name: type: string description: Optional name of the message author. tool_call_id: type: string description: Tool call that this message is responding to. role: $ref: '#/components/schemas/type_:ChatRole' description: Role of the message author. tool_calls: type: array items: $ref: '#/components/schemas/type_:ToolCall' description: A list of tool calls requested by the assistant. thinking: type: array items: $ref: '#/components/schemas/type_:ChatMessageThinkingItem' description: >- Model's chain-of-thought for providing the response. Present on assistant messages if model supports it. required: - role title: ChatMessage type_:FunctionToolChoice: type: object properties: name: type: string required: - name description: A function tool to be called by the model where user owns runtime. title: FunctionToolChoice type_:ToolChoice: type: object properties: type: $ref: '#/components/schemas/type_:ChatToolType' function: $ref: '#/components/schemas/type_:FunctionToolChoice' required: - type - function description: Tool choice to force the model to use a tool. title: ToolChoice type_prompts:PromptLogRequestToolChoice: oneOf: - type: string enum: - none - type: string enum: - auto - type: string enum: - required - $ref: '#/components/schemas/type_:ToolChoice' description: >- Controls how the model uses tools. The following options are supported: - `'none'` means the model will not call any tool and instead generates a message; this is the default when no tools are provided as part of the Prompt. - `'auto'` means the model can decide to call one or more of the provided tools; this is the default when tools are provided as part of the Prompt. - `'required'` means the model must call one or more of the provided tools. - `{'type': 'function', 'function': {name': }}` forces the model to use the named function. title: PromptLogRequestToolChoice type_:ModelEndpoints: type: string enum: - complete - chat - edit description: Supported model provider endpoints. title: ModelEndpoints type_:PromptKernelRequestTemplate: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: >- 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}}`. title: PromptKernelRequestTemplate type_:TemplateLanguage: type: string enum: - default - jinja description: Template engine to use for rendering templates. title: TemplateLanguage type_:ModelProviders: type: string enum: - anthropic - bedrock - cohere - deepseek - google - groq - mock - openai - openai_azure - replicate description: Supported model providers. title: ModelProviders type_:PromptKernelRequestStop: oneOf: - type: string - type: array items: type: string description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. title: PromptKernelRequestStop type_:ResponseFormatType: type: string enum: - json_object - json_schema title: ResponseFormatType type_:ResponseFormat: type: object properties: type: $ref: '#/components/schemas/type_:ResponseFormatType' json_schema: type: object additionalProperties: description: Any type description: The JSON schema of the response format if type is json_schema. required: - type description: Response format of the model. title: ResponseFormat type_:OpenAiReasoningEffort: type: string enum: - high - medium - low description: Supported reasoning effort. title: OpenAiReasoningEffort type_:PromptKernelRequestReasoningEffort: oneOf: - $ref: '#/components/schemas/type_:OpenAiReasoningEffort' - type: integer description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. title: PromptKernelRequestReasoningEffort type_:ToolFunction: type: object properties: name: type: string description: Name for the tool referenced by the model. description: type: string description: Description of the tool referenced by the model strict: type: boolean default: false description: >- If true, forces the model to output json data in the structure of the parameters schema. parameters: type: object additionalProperties: description: Any type description: >- Parameters needed to run the Tool, defined in JSON Schema format: https://json-schema.org/ required: - name - description title: ToolFunction type_:PromptKernelRequest: type: object properties: model: type: string description: >- The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models) endpoint: $ref: '#/components/schemas/type_:ModelEndpoints' description: The provider model endpoint used. template: $ref: '#/components/schemas/type_:PromptKernelRequestTemplate' description: >- 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}}`. template_language: $ref: '#/components/schemas/type_:TemplateLanguage' description: The template language to use for rendering the template. provider: $ref: '#/components/schemas/type_:ModelProviders' description: The company providing the underlying model service. max_tokens: type: integer default: -1 description: >- 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 temperature: type: number format: double default: 1 description: >- What sampling temperature to use when making a generation. Higher values means the model will be more creative. top_p: type: number format: double default: 1 description: >- An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. stop: $ref: '#/components/schemas/type_:PromptKernelRequestStop' description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. presence_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far. frequency_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far. other: type: object additionalProperties: description: Any type description: Other parameter values to be passed to the provider call. seed: type: integer description: >- If specified, model will make a best effort to sample deterministically, but it is not guaranteed. response_format: $ref: '#/components/schemas/type_:ResponseFormat' description: >- The format of the response. Only `{"type": "json_object"}` is currently supported for chat. reasoning_effort: $ref: '#/components/schemas/type_:PromptKernelRequestReasoningEffort' description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. tools: type: array items: $ref: '#/components/schemas/type_:ToolFunction' description: >- The tool specification that the model can choose to call if Tool calling is supported. linked_tools: type: array items: type: string description: >- 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. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used. required: - model description: |- Base class used by both PromptKernelRequest and AgentKernelRequest. Contains the consistent Prompt-related fields. title: PromptKernelRequest type_prompts:PromptLogRequestPrompt: oneOf: - $ref: '#/components/schemas/type_:PromptKernelRequest' - type: string description: >- The Prompt configuration to use. Two formats are supported: - An object representing the details of the Prompt configuration - A string representing the raw contents of a .prompt file A new Prompt version will be created if the provided details do not match any existing version. title: PromptLogRequestPrompt type_:CreatePromptLogResponse: type: object properties: id: type: string description: String ID of log. prompt_id: type: string description: ID of the Prompt the log belongs to. version_id: type: string description: ID of the specific version of the Prompt. session_id: type: string description: String ID of session the log belongs to. required: - id - prompt_id - version_id title: CreatePromptLogResponse type_:ValidationErrorLocItem: oneOf: - type: string - type: integer title: ValidationErrorLocItem type_:ValidationError: type: object properties: loc: type: array items: $ref: '#/components/schemas/type_:ValidationErrorLocItem' msg: type: string type: type: string required: - loc - msg - type title: ValidationError type_:HttpValidationError: type: object properties: detail: type: array items: $ref: '#/components/schemas/type_:ValidationError' title: HttpValidationError securitySchemes: default: type: apiKey in: header name: X-API-KEY ``` ## SDK Code Examples ```python Log prompt import requests url = "https://api.humanloop.com/v5/prompts/log" payload = { "path": "persona", "output_message": { "role": "assistant", "content": "Well, you know, there is so much secrecy involved in government, folks, it's unbelievable. They don't want to tell you everything. They don't tell me everything! But about Roswell, it's a very popular question. I know, I just know, that something very, very peculiar happened there. Was it a weather balloon? Maybe. Was it something extraterrestrial? Could be. I'd love to go down and open up all the classified documents, believe me, I would. But they don't let that happen. The Deep State, folks, the Deep State. They're unbelievable. They want to keep everything a secret. But whatever the truth is, I can tell you this: it's something big, very very big. Tremendous, in fact." }, "prompt_tokens": 100, "output_tokens": 220, "prompt_cost": 0.00001, "output_cost": 0.0002, "finish_reason": "stop", "messages": [ { "role": "user", "content": "What really happened at Roswell?" } ], "prompt": { "model": "gpt-4", "template": [ { "role": "system", "content": "You are {{person}}. Answer questions as this person. Do not break character." } ] }, "created_at": "2024-07-19T00:29:35.178992", "error": None, "provider_latency": 6.5931549072265625, "inputs": { "person": "Trump" } } headers = { "X-API-KEY": " ", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```typescript Log prompt import { HumanloopClient } from "humanloop"; const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); await client.prompts.log({ path: "persona", prompt: { model: "gpt-4", template: [{ role: "system", content: "You are {{person}}. Answer questions as this person. Do not break character." }] }, messages: [{ role: "user", content: "What really happened at Roswell?" }], inputs: { "person": "Trump" }, createdAt: "2024-07-19T00:29:35.178992", error: undefined, providerLatency: 6.5931549072265625, outputMessage: { content: "Well, you know, there is so much secrecy involved in government, folks, it's unbelievable. They don't want to tell you everything. They don't tell me everything! But about Roswell, it's a very popular question. I know, I just know, that something very, very peculiar happened there. Was it a weather balloon? Maybe. Was it something extraterrestrial? Could be. I'd love to go down and open up all the classified documents, believe me, I would. But they don't let that happen. The Deep State, folks, the Deep State. They're unbelievable. They want to keep everything a secret. But whatever the truth is, I can tell you this: it's something big, very very big. Tremendous, in fact.", role: "assistant" }, promptTokens: 100, outputTokens: 220, promptCost: 0.00001, outputCost: 0.0002, finishReason: "stop" }); ``` ```go Log prompt package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/prompts/log" payload := strings.NewReader("{\n \"path\": \"persona\",\n \"output_message\": {\n \"role\": \"assistant\",\n \"content\": \"Well, you know, there is so much secrecy involved in government, folks, it's unbelievable. They don't want to tell you everything. They don't tell me everything! But about Roswell, it's a very popular question. I know, I just know, that something very, very peculiar happened there. Was it a weather balloon? Maybe. Was it something extraterrestrial? Could be. I'd love to go down and open up all the classified documents, believe me, I would. But they don't let that happen. The Deep State, folks, the Deep State. They're unbelievable. They want to keep everything a secret. But whatever the truth is, I can tell you this: it's something big, very very big. Tremendous, in fact.\"\n },\n \"prompt_tokens\": 100,\n \"output_tokens\": 220,\n \"prompt_cost\": 0.00001,\n \"output_cost\": 0.0002,\n \"finish_reason\": \"stop\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What really happened at Roswell?\"\n }\n ],\n \"prompt\": {\n \"model\": \"gpt-4\",\n \"template\": [\n {\n \"role\": \"system\",\n \"content\": \"You are {{person}}. Answer questions as this person. Do not break character.\"\n }\n ]\n },\n \"created_at\": \"2024-07-19T00:29:35.178992\",\n \"error\": null,\n \"provider_latency\": 6.5931549072265625,\n \"inputs\": {\n \"person\": \"Trump\"\n }\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("X-API-KEY", " ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Log prompt require 'uri' require 'net/http' url = URI("https://api.humanloop.com/v5/prompts/log") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["X-API-KEY"] = ' ' request["Content-Type"] = 'application/json' request.body = "{\n \"path\": \"persona\",\n \"output_message\": {\n \"role\": \"assistant\",\n \"content\": \"Well, you know, there is so much secrecy involved in government, folks, it's unbelievable. They don't want to tell you everything. They don't tell me everything! But about Roswell, it's a very popular question. I know, I just know, that something very, very peculiar happened there. Was it a weather balloon? Maybe. Was it something extraterrestrial? Could be. I'd love to go down and open up all the classified documents, believe me, I would. But they don't let that happen. The Deep State, folks, the Deep State. They're unbelievable. They want to keep everything a secret. But whatever the truth is, I can tell you this: it's something big, very very big. Tremendous, in fact.\"\n },\n \"prompt_tokens\": 100,\n \"output_tokens\": 220,\n \"prompt_cost\": 0.00001,\n \"output_cost\": 0.0002,\n \"finish_reason\": \"stop\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What really happened at Roswell?\"\n }\n ],\n \"prompt\": {\n \"model\": \"gpt-4\",\n \"template\": [\n {\n \"role\": \"system\",\n \"content\": \"You are {{person}}. Answer questions as this person. Do not break character.\"\n }\n ]\n },\n \"created_at\": \"2024-07-19T00:29:35.178992\",\n \"error\": null,\n \"provider_latency\": 6.5931549072265625,\n \"inputs\": {\n \"person\": \"Trump\"\n }\n}" response = http.request(request) puts response.read_body ``` ```java Log prompt import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.humanloop.com/v5/prompts/log") .header("X-API-KEY", " ") .header("Content-Type", "application/json") .body("{\n \"path\": \"persona\",\n \"output_message\": {\n \"role\": \"assistant\",\n \"content\": \"Well, you know, there is so much secrecy involved in government, folks, it's unbelievable. They don't want to tell you everything. They don't tell me everything! But about Roswell, it's a very popular question. I know, I just know, that something very, very peculiar happened there. Was it a weather balloon? Maybe. Was it something extraterrestrial? Could be. I'd love to go down and open up all the classified documents, believe me, I would. But they don't let that happen. The Deep State, folks, the Deep State. They're unbelievable. They want to keep everything a secret. But whatever the truth is, I can tell you this: it's something big, very very big. Tremendous, in fact.\"\n },\n \"prompt_tokens\": 100,\n \"output_tokens\": 220,\n \"prompt_cost\": 0.00001,\n \"output_cost\": 0.0002,\n \"finish_reason\": \"stop\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What really happened at Roswell?\"\n }\n ],\n \"prompt\": {\n \"model\": \"gpt-4\",\n \"template\": [\n {\n \"role\": \"system\",\n \"content\": \"You are {{person}}. Answer questions as this person. Do not break character.\"\n }\n ]\n },\n \"created_at\": \"2024-07-19T00:29:35.178992\",\n \"error\": null,\n \"provider_latency\": 6.5931549072265625,\n \"inputs\": {\n \"person\": \"Trump\"\n }\n}") .asString(); ``` ```php Log prompt request('POST', 'https://api.humanloop.com/v5/prompts/log', [ 'body' => '{ "path": "persona", "output_message": { "role": "assistant", "content": "Well, you know, there is so much secrecy involved in government, folks, it\'s unbelievable. They don\'t want to tell you everything. They don\'t tell me everything! But about Roswell, it\'s a very popular question. I know, I just know, that something very, very peculiar happened there. Was it a weather balloon? Maybe. Was it something extraterrestrial? Could be. I\'d love to go down and open up all the classified documents, believe me, I would. But they don\'t let that happen. The Deep State, folks, the Deep State. They\'re unbelievable. They want to keep everything a secret. But whatever the truth is, I can tell you this: it\'s something big, very very big. Tremendous, in fact." }, "prompt_tokens": 100, "output_tokens": 220, "prompt_cost": 0.00001, "output_cost": 0.0002, "finish_reason": "stop", "messages": [ { "role": "user", "content": "What really happened at Roswell?" } ], "prompt": { "model": "gpt-4", "template": [ { "role": "system", "content": "You are {{person}}. Answer questions as this person. Do not break character." } ] }, "created_at": "2024-07-19T00:29:35.178992", "error": null, "provider_latency": 6.5931549072265625, "inputs": { "person": "Trump" } }', 'headers' => [ 'Content-Type' => 'application/json', 'X-API-KEY' => ' ', ], ]); echo $response->getBody(); ``` ```csharp Log prompt using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/prompts/log"); var request = new RestRequest(Method.POST); request.AddHeader("X-API-KEY", " "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"path\": \"persona\",\n \"output_message\": {\n \"role\": \"assistant\",\n \"content\": \"Well, you know, there is so much secrecy involved in government, folks, it's unbelievable. They don't want to tell you everything. They don't tell me everything! But about Roswell, it's a very popular question. I know, I just know, that something very, very peculiar happened there. Was it a weather balloon? Maybe. Was it something extraterrestrial? Could be. I'd love to go down and open up all the classified documents, believe me, I would. But they don't let that happen. The Deep State, folks, the Deep State. They're unbelievable. They want to keep everything a secret. But whatever the truth is, I can tell you this: it's something big, very very big. Tremendous, in fact.\"\n },\n \"prompt_tokens\": 100,\n \"output_tokens\": 220,\n \"prompt_cost\": 0.00001,\n \"output_cost\": 0.0002,\n \"finish_reason\": \"stop\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What really happened at Roswell?\"\n }\n ],\n \"prompt\": {\n \"model\": \"gpt-4\",\n \"template\": [\n {\n \"role\": \"system\",\n \"content\": \"You are {{person}}. Answer questions as this person. Do not break character.\"\n }\n ]\n },\n \"created_at\": \"2024-07-19T00:29:35.178992\",\n \"error\": null,\n \"provider_latency\": 6.5931549072265625,\n \"inputs\": {\n \"person\": \"Trump\"\n }\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Log prompt import Foundation let headers = [ "X-API-KEY": " ", "Content-Type": "application/json" ] let parameters = [ "path": "persona", "output_message": [ "role": "assistant", "content": "Well, you know, there is so much secrecy involved in government, folks, it's unbelievable. They don't want to tell you everything. They don't tell me everything! But about Roswell, it's a very popular question. I know, I just know, that something very, very peculiar happened there. Was it a weather balloon? Maybe. Was it something extraterrestrial? Could be. I'd love to go down and open up all the classified documents, believe me, I would. But they don't let that happen. The Deep State, folks, the Deep State. They're unbelievable. They want to keep everything a secret. But whatever the truth is, I can tell you this: it's something big, very very big. Tremendous, in fact." ], "prompt_tokens": 100, "output_tokens": 220, "prompt_cost": 0.00001, "output_cost": 0.0002, "finish_reason": "stop", "messages": [ [ "role": "user", "content": "What really happened at Roswell?" ] ], "prompt": [ "model": "gpt-4", "template": [ [ "role": "system", "content": "You are {{person}}. Answer questions as this person. Do not break character." ] ] ], "created_at": "2024-07-19T00:29:35.178992", "error": , "provider_latency": 6.5931549072265625, "inputs": ["person": "Trump"] ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/prompts/log")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. # Update Prompt Log PATCH https://api.humanloop.com/v5/prompts/{id}/log/{log_id} Content-Type: application/json Update a Log. Update the details of a Log with the given ID. Reference: https://humanloop.com/docs/api/prompts/update-log ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /prompts/{id}/log/{log_id}: patch: operationId: update-log summary: Update Prompt Log description: |- Update a Log. Update the details of a Log with the given ID. tags: - subpackage_prompts parameters: - name: id in: path description: Unique identifier for Prompt. required: true schema: type: string - name: log_id in: path description: Unique identifier for the Log. required: true schema: type: string - name: X-API-KEY in: header required: true schema: type: string responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/type_:LogResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/type_:HttpValidationError' requestBody: content: application/json: schema: type: object properties: output_message: $ref: '#/components/schemas/type_:ChatMessage' description: The message returned by the provider. prompt_tokens: type: integer description: Number of tokens in the prompt used to generate the output. reasoning_tokens: type: integer description: Number of reasoning tokens used to generate the output. output_tokens: type: integer description: Number of tokens in the output generated by the model. prompt_cost: type: number format: double description: Cost in dollars associated to the tokens in the prompt. output_cost: type: number format: double description: Cost in dollars associated to the tokens in the output. finish_reason: type: string description: Reason the generation finished. messages: type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: The messages passed to the to provider chat endpoint. tool_choice: $ref: >- #/components/schemas/type_prompts:PromptLogUpdateRequestToolChoice description: >- Controls how the model uses tools. The following options are supported: - `'none'` means the model will not call any tool and instead generates a message; this is the default when no tools are provided as part of the Prompt. - `'auto'` means the model can decide to call one or more of the provided tools; this is the default when tools are provided as part of the Prompt. - `'required'` means the model must call one or more of the provided tools. - `{'type': 'function', 'function': {name': }}` forces the model to use the named function. output: type: string description: >- Generated output from your model for the provided inputs. Can be `None` if logging an error, or if creating a parent Log with the intention to populate it later. created_at: type: string format: date-time description: 'User defined timestamp for when the log was created. ' error: type: string description: Error message if the log is an error. provider_latency: type: number format: double description: Duration of the logged event in seconds. stdout: type: string description: Captured log and debug statements. provider_request: type: object additionalProperties: description: Any type description: Raw request sent to provider. provider_response: type: object additionalProperties: description: Any type description: Raw response received the provider. inputs: type: object additionalProperties: description: Any type description: The inputs passed to the prompt template. source: type: string description: Identifies where the model was called from. metadata: type: object additionalProperties: description: Any type description: Any additional metadata to record. start_time: type: string format: date-time description: When the logged event started. end_time: type: string format: date-time description: When the logged event ended. servers: - url: https://api.humanloop.com/v5 components: schemas: type_:TextChatContent: type: object properties: type: type: string enum: - text text: type: string description: The message's text content. required: - type - text title: TextChatContent type_:ImageUrlDetail: type: string enum: - high - low - auto description: >- Specify the detail level of the image provided to the model. For more details see: https://platform.openai.com/docs/guides/vision/low-or-high-fidelity-image-understanding title: ImageUrlDetail type_:ImageUrl: type: object properties: url: type: string description: Either a URL of the image or the base64 encoded image data. detail: $ref: '#/components/schemas/type_:ImageUrlDetail' description: >- Specify the detail level of the image provided to the model. For more details see: https://platform.openai.com/docs/guides/vision/low-or-high-fidelity-image-understanding required: - url title: ImageUrl type_:ImageChatContent: type: object properties: type: type: string enum: - image_url image_url: $ref: '#/components/schemas/type_:ImageUrl' description: The message's image content. required: - type - image_url title: ImageChatContent type_:ChatMessageContentItem: oneOf: - $ref: '#/components/schemas/type_:TextChatContent' - $ref: '#/components/schemas/type_:ImageChatContent' title: ChatMessageContentItem type_:ChatMessageContent: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessageContentItem' description: The content of the message. title: ChatMessageContent type_:ChatRole: type: string enum: - user - assistant - system - tool - developer description: An enumeration. title: ChatRole type_:ChatToolType: type: string enum: - function description: The type of tool to call. title: ChatToolType type_:FunctionTool: type: object properties: name: type: string arguments: type: string required: - name description: A function tool to be called by the model where user owns runtime. title: FunctionTool type_:ToolCall: type: object properties: id: type: string type: $ref: '#/components/schemas/type_:ChatToolType' function: $ref: '#/components/schemas/type_:FunctionTool' required: - id - type - function description: A tool call to be made. title: ToolCall type_:AnthropicThinkingContent: type: object properties: type: type: string enum: - thinking thinking: type: string description: Model's chain-of-thought for providing the response. signature: type: string description: >- Cryptographic signature that verifies the thinking block was generated by Anthropic. required: - type - thinking - signature title: AnthropicThinkingContent type_:AnthropicRedactedThinkingContent: type: object properties: type: type: string enum: - redacted_thinking data: type: string description: >- Thinking block Anthropic redacted for safety reasons. User is expected to pass the block back to Anthropic required: - type - data title: AnthropicRedactedThinkingContent type_:ChatMessageThinkingItem: oneOf: - $ref: '#/components/schemas/type_:AnthropicThinkingContent' - $ref: '#/components/schemas/type_:AnthropicRedactedThinkingContent' title: ChatMessageThinkingItem type_:ChatMessage: type: object properties: content: $ref: '#/components/schemas/type_:ChatMessageContent' description: The content of the message. name: type: string description: Optional name of the message author. tool_call_id: type: string description: Tool call that this message is responding to. role: $ref: '#/components/schemas/type_:ChatRole' description: Role of the message author. tool_calls: type: array items: $ref: '#/components/schemas/type_:ToolCall' description: A list of tool calls requested by the assistant. thinking: type: array items: $ref: '#/components/schemas/type_:ChatMessageThinkingItem' description: >- Model's chain-of-thought for providing the response. Present on assistant messages if model supports it. required: - role title: ChatMessage type_:FunctionToolChoice: type: object properties: name: type: string required: - name description: A function tool to be called by the model where user owns runtime. title: FunctionToolChoice type_:ToolChoice: type: object properties: type: $ref: '#/components/schemas/type_:ChatToolType' function: $ref: '#/components/schemas/type_:FunctionToolChoice' required: - type - function description: Tool choice to force the model to use a tool. title: ToolChoice type_prompts:PromptLogUpdateRequestToolChoice: oneOf: - type: string enum: - none - type: string enum: - auto - type: string enum: - required - $ref: '#/components/schemas/type_:ToolChoice' description: >- Controls how the model uses tools. The following options are supported: - `'none'` means the model will not call any tool and instead generates a message; this is the default when no tools are provided as part of the Prompt. - `'auto'` means the model can decide to call one or more of the provided tools; this is the default when tools are provided as part of the Prompt. - `'required'` means the model must call one or more of the provided tools. - `{'type': 'function', 'function': {name': }}` forces the model to use the named function. title: PromptLogUpdateRequestToolChoice type_:PromptLogResponseToolChoice: oneOf: - type: string enum: - none - type: string enum: - auto - type: string enum: - required - $ref: '#/components/schemas/type_:ToolChoice' description: >- Controls how the model uses tools. The following options are supported: - `'none'` means the model will not call any tool and instead generates a message; this is the default when no tools are provided as part of the Prompt. - `'auto'` means the model can decide to call one or more of the provided tools; this is the default when tools are provided as part of the Prompt. - `'required'` means the model must call one or more of the provided tools. - `{'type': 'function', 'function': {name': }}` forces the model to use the named function. title: PromptLogResponseToolChoice type_:ModelEndpoints: type: string enum: - complete - chat - edit description: Supported model provider endpoints. title: ModelEndpoints type_:PromptResponseTemplate: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: >- 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}}`. title: PromptResponseTemplate type_:TemplateLanguage: type: string enum: - default - jinja description: Template engine to use for rendering templates. title: TemplateLanguage type_:ModelProviders: type: string enum: - anthropic - bedrock - cohere - deepseek - google - groq - mock - openai - openai_azure - replicate description: Supported model providers. title: ModelProviders type_:PromptResponseStop: oneOf: - type: string - type: array items: type: string description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. title: PromptResponseStop type_:ResponseFormatType: type: string enum: - json_object - json_schema title: ResponseFormatType type_:ResponseFormat: type: object properties: type: $ref: '#/components/schemas/type_:ResponseFormatType' json_schema: type: object additionalProperties: description: Any type description: The JSON schema of the response format if type is json_schema. required: - type description: Response format of the model. title: ResponseFormat type_:OpenAiReasoningEffort: type: string enum: - high - medium - low description: Supported reasoning effort. title: OpenAiReasoningEffort type_:PromptResponseReasoningEffort: oneOf: - $ref: '#/components/schemas/type_:OpenAiReasoningEffort' - type: integer description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. title: PromptResponseReasoningEffort type_:ToolFunction: type: object properties: name: type: string description: Name for the tool referenced by the model. description: type: string description: Description of the tool referenced by the model strict: type: boolean default: false description: >- If true, forces the model to output json data in the structure of the parameters schema. parameters: type: object additionalProperties: description: Any type description: >- Parameters needed to run the Tool, defined in JSON Schema format: https://json-schema.org/ required: - name - description title: ToolFunction type_:LinkedToolResponse: type: object properties: name: type: string description: Name for the tool referenced by the model. description: type: string description: Description of the tool referenced by the model strict: type: boolean default: false description: >- If true, forces the model to output json data in the structure of the parameters schema. parameters: type: object additionalProperties: description: Any type description: >- Parameters needed to run the Tool, defined in JSON Schema format: https://json-schema.org/ id: type: string description: Unique identifier for the Tool linked. version_id: type: string description: Unique identifier for the Tool Version linked. required: - name - description - id - version_id title: LinkedToolResponse type_:EnvironmentTag: type: string enum: - default - other description: An enumeration. title: EnvironmentTag type_:EnvironmentResponse: type: object properties: id: type: string created_at: type: string format: date-time name: type: string tag: $ref: '#/components/schemas/type_:EnvironmentTag' required: - id - created_at - name - tag title: EnvironmentResponse type_:UserResponse: description: Any type title: UserResponse type_:InputResponse: type: object properties: name: type: string description: Type of input. required: - name title: InputResponse type_:FilesToolType: type: string enum: - pinecone_search - google - mock - snippet - json_schema - get_api_call - python description: Type of tool. title: FilesToolType type_:EvaluatorAggregate: type: object properties: value: type: number format: double description: The aggregated value of the evaluator. evaluator_id: type: string description: ID of the evaluator. evaluator_version_id: type: string description: ID of the evaluator version. created_at: type: string format: date-time updated_at: type: string format: date-time required: - value - evaluator_id - evaluator_version_id - created_at - updated_at title: EvaluatorAggregate type_:ToolResponse: type: object properties: path: type: string description: >- Path of the Tool, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Tool. directory_id: type: string description: ID of the directory that the file is in on Humanloop. function: $ref: '#/components/schemas/type_:ToolFunction' description: >- Callable function specification of the Tool shown to the model for tool calling. source_code: type: string description: Code source of the Tool. setup_values: type: object additionalProperties: description: Any type description: >- Values needed to setup the Tool, defined in JSON Schema format: https://json-schema.org/ attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Tool. Helpful to separate Tool versions from each other with details on how they were created or used. tool_type: $ref: '#/components/schemas/type_:FilesToolType' description: Type of Tool. version_name: type: string description: >- Unique identifier for this Tool version. Each Tool can only have one version with a given name. version_description: type: string description: Description of the Version. name: type: string description: Name of the Tool, which is used as a unique identifier. description: type: string description: Description of the Tool. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Tool Version. If no query params provided, the default deployed Tool Version is returned. type: type: string enum: - tool environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Tool Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Tool. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Tool Version total_logs_count: type: integer description: The number of logs that have been generated across all Tool Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Prompt. Inputs correspond to any of the variables used within the Tool template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Tool that are used for monitoring logs. signature: type: string description: Signature of the Tool. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Tool Version. required: - path - id - name - version_id - created_at - updated_at - last_used_at - version_logs_count - total_logs_count - inputs description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: ToolResponse type_:DatapointResponseTargetValue: oneOf: - type: string - type: integer - type: number format: double - type: boolean - type: array items: description: Any type - type: object additionalProperties: description: Any type title: DatapointResponseTargetValue type_:DatapointResponse: type: object properties: inputs: type: object additionalProperties: type: string description: The inputs to the prompt template. messages: type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: List of chat messages to provide to the model. target: type: object additionalProperties: $ref: '#/components/schemas/type_:DatapointResponseTargetValue' description: >- Object with criteria necessary to evaluate generations with this Datapoint. This is passed in as an argument to Evaluators when used in an Evaluation. id: type: string description: Unique identifier for the Datapoint. Starts with `dp_`. required: - id title: DatapointResponse type_:DatasetResponse: type: object properties: path: type: string description: >- Path of the Dataset, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Dataset. Starts with `ds_`. directory_id: type: string description: ID of the directory that the file is in on Humanloop. name: type: string description: Name of the Dataset, which is used as a unique identifier. description: type: string description: Description of the Dataset. schema: type: object additionalProperties: description: Any type description: The JSON schema for the File. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Dataset Version. If no query params provided, the default deployed Dataset Version is returned. Starts with `dsv_`. type: type: string enum: - dataset environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Dataset Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Dataset. last_used_at: type: string format: date-time version_name: type: string description: >- Unique name for the Dataset version. Version names must be unique for a given Dataset. version_description: type: string description: Description of the version, e.g., the changes made in this version. datapoints_count: type: integer description: The number of Datapoints in this Dataset version. datapoints: type: array items: $ref: '#/components/schemas/type_:DatapointResponse' description: >- The list of Datapoints in this Dataset version. Only provided if explicitly requested. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Dataset. Helpful to separate Dataset versions from each other with details on how they were created or used. required: - path - id - name - version_id - created_at - updated_at - last_used_at - datapoints_count description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: DatasetResponse type_:EvaluatorArgumentsType: type: string enum: - target_free - target_required description: Enum representing the possible argument types of an evaluator. title: EvaluatorArgumentsType type_:EvaluatorReturnTypeEnum: type: string enum: - boolean - number - select - multi_select - text description: Enum representing the possible return types of an evaluator. title: EvaluatorReturnTypeEnum type_:Valence: type: string enum: - positive - negative - neutral description: An enumeration. title: Valence type_:EvaluatorJudgmentOptionResponse: type: object properties: name: type: string description: The name of the option. valence: $ref: '#/components/schemas/type_:Valence' description: Whether this option should be considered positive or negative. required: - name title: EvaluatorJudgmentOptionResponse type_:EvaluatorJudgmentNumberLimit: type: object properties: min: type: number format: double description: The minimum value that can be selected. max: type: number format: double description: The maximum value that can be selected. step: type: number format: double description: The step size for the number input. title: EvaluatorJudgmentNumberLimit type_:PromptKernelRequestTemplate: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: >- 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}}`. title: PromptKernelRequestTemplate type_:PromptKernelRequestStop: oneOf: - type: string - type: array items: type: string description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. title: PromptKernelRequestStop type_:PromptKernelRequestReasoningEffort: oneOf: - $ref: '#/components/schemas/type_:OpenAiReasoningEffort' - type: integer description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. title: PromptKernelRequestReasoningEffort type_:PromptKernelRequest: type: object properties: model: type: string description: >- The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models) endpoint: $ref: '#/components/schemas/type_:ModelEndpoints' description: The provider model endpoint used. template: $ref: '#/components/schemas/type_:PromptKernelRequestTemplate' description: >- 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}}`. template_language: $ref: '#/components/schemas/type_:TemplateLanguage' description: The template language to use for rendering the template. provider: $ref: '#/components/schemas/type_:ModelProviders' description: The company providing the underlying model service. max_tokens: type: integer default: -1 description: >- 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 temperature: type: number format: double default: 1 description: >- What sampling temperature to use when making a generation. Higher values means the model will be more creative. top_p: type: number format: double default: 1 description: >- An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. stop: $ref: '#/components/schemas/type_:PromptKernelRequestStop' description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. presence_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far. frequency_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far. other: type: object additionalProperties: description: Any type description: Other parameter values to be passed to the provider call. seed: type: integer description: >- If specified, model will make a best effort to sample deterministically, but it is not guaranteed. response_format: $ref: '#/components/schemas/type_:ResponseFormat' description: >- The format of the response. Only `{"type": "json_object"}` is currently supported for chat. reasoning_effort: $ref: '#/components/schemas/type_:PromptKernelRequestReasoningEffort' description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. tools: type: array items: $ref: '#/components/schemas/type_:ToolFunction' description: >- The tool specification that the model can choose to call if Tool calling is supported. linked_tools: type: array items: type: string description: >- 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. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used. required: - model description: |- Base class used by both PromptKernelRequest and AgentKernelRequest. Contains the consistent Prompt-related fields. title: PromptKernelRequest type_:LlmEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:EvaluatorReturnTypeEnum' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: >- The options that can be applied as judgments. Only for Evaluators with `return_type` of 'boolean', 'select' or 'multi_select'. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - llm prompt: $ref: '#/components/schemas/type_:PromptKernelRequest' description: The prompt parameters used to generate. required: - arguments_type - return_type - evaluator_type title: LlmEvaluatorRequest type_:CodeEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:EvaluatorReturnTypeEnum' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: >- The options that can be applied as judgments. Only for Evaluators with `return_type` of 'boolean', 'select' or 'multi_select'. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - python code: type: string description: >- The code for the Evaluator. This code will be executed in a sandboxed environment. required: - arguments_type - return_type - evaluator_type - code title: CodeEvaluatorRequest type_:HumanEvaluatorRequestReturnType: type: string enum: - select - multi_select - text - number - boolean description: The type of the return value of the Evaluator. title: HumanEvaluatorRequestReturnType type_:HumanEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:HumanEvaluatorRequestReturnType' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: The options that can be applied as judgments. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - human instructions: type: string description: Instructions and guidelines for applying judgments. required: - arguments_type - return_type - evaluator_type title: HumanEvaluatorRequest type_:ExternalEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:EvaluatorReturnTypeEnum' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: >- The options that can be applied as judgments. Only for Evaluators with `return_type` of 'boolean', 'select' or 'multi_select'. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - external required: - arguments_type - return_type - evaluator_type title: ExternalEvaluatorRequest type_:EvaluatorResponseSpec: oneOf: - $ref: '#/components/schemas/type_:LlmEvaluatorRequest' - $ref: '#/components/schemas/type_:CodeEvaluatorRequest' - $ref: '#/components/schemas/type_:HumanEvaluatorRequest' - $ref: '#/components/schemas/type_:ExternalEvaluatorRequest' title: EvaluatorResponseSpec type_:EvaluatorResponse: type: object properties: path: type: string description: >- Path of the Evaluator including the Evaluator name, which is used as a unique identifier. id: type: string description: Unique identifier for the Evaluator. directory_id: type: string description: ID of the directory that the file is in on Humanloop. version_name: type: string description: >- Unique name for the Evaluator version. Version names must be unique for a given Evaluator. version_description: type: string description: Description of the version, e.g., the changes made in this version. spec: $ref: '#/components/schemas/type_:EvaluatorResponseSpec' name: type: string description: Name of the Evaluator, which is used as a unique identifier. description: type: string description: Description of the Evaluator. schema: type: object additionalProperties: description: Any type description: The JSON schema for the File. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Evaluator Version. If no query params provided, the default deployed Evaluator Version is returned. type: type: string enum: - evaluator environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Evaluator Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Evaluator. last_used_at: type: string format: date-time version_logs_count: type: integer description: >- The number of logs that have been generated for this Evaluator Version total_logs_count: type: integer description: >- The number of logs that have been generated across all Evaluator Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Evaluator. Inputs correspond to any of the variables used within the Evaluator template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Evaluator that are used for monitoring logs. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Evaluator Version. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. required: - path - id - spec - name - version_id - created_at - updated_at - last_used_at - version_logs_count - total_logs_count - inputs description: Version of the Evaluator used to provide judgments. title: EvaluatorResponse type_:FlowResponse: type: object properties: path: type: string description: >- Path of the Flow, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Flow. directory_id: type: string description: ID of the directory that the file is in on Humanloop. attributes: type: object additionalProperties: description: Any type description: A key-value object identifying the Flow Version. version_name: type: string description: >- Unique name for the Flow version. Version names must be unique for a given Flow. version_description: type: string description: Description of the Version. name: type: string description: Name of the Flow. description: type: string description: Description of the Flow. schema: type: object additionalProperties: description: Any type description: The JSON schema for the File. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Flow Version. If no query params provided, the default deployed Flow Version is returned. type: type: string enum: - flow environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Flow Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Flow. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Flow Version evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Flow Version. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: The list of Monitoring Evaluators associated with the Flow Version. required: - path - id - attributes - name - version_id - created_at - updated_at - last_used_at - version_logs_count description: Response model for a Flow. title: FlowResponse type_:AgentResponseTemplate: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: >- 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}}`. title: AgentResponseTemplate type_:AgentResponseStop: oneOf: - type: string - type: array items: type: string description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. title: AgentResponseStop type_:AgentResponseReasoningEffort: oneOf: - $ref: '#/components/schemas/type_:OpenAiReasoningEffort' - type: integer description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. title: AgentResponseReasoningEffort type_:LinkedFileRequest: type: object properties: file_id: type: string environment_id: type: string version_id: type: string required: - file_id title: LinkedFileRequest type_:OnAgentCallEnum: type: string enum: - stop - continue description: What an Agent should do when calling a Tool. title: OnAgentCallEnum type_:AgentLinkedFileResponseFile: oneOf: - $ref: '#/components/schemas/type_:PromptResponse' - $ref: '#/components/schemas/type_:ToolResponse' - $ref: '#/components/schemas/type_:DatasetResponse' - $ref: '#/components/schemas/type_:EvaluatorResponse' - $ref: '#/components/schemas/type_:FlowResponse' - $ref: '#/components/schemas/type_:AgentResponse' title: AgentLinkedFileResponseFile type_:AgentLinkedFileResponse: type: object properties: type: type: string enum: - file link: $ref: '#/components/schemas/type_:LinkedFileRequest' on_agent_call: $ref: '#/components/schemas/type_:OnAgentCallEnum' file: $ref: '#/components/schemas/type_:AgentLinkedFileResponseFile' required: - type - link title: AgentLinkedFileResponse type_:AgentInlineTool: type: object properties: type: type: string enum: - inline json_schema: $ref: '#/components/schemas/type_:ToolFunction' on_agent_call: $ref: '#/components/schemas/type_:OnAgentCallEnum' required: - type - json_schema title: AgentInlineTool type_:AgentResponseToolsItem: oneOf: - $ref: '#/components/schemas/type_:AgentLinkedFileResponse' - $ref: '#/components/schemas/type_:AgentInlineTool' title: AgentResponseToolsItem type_:VersionStatus: type: string enum: - uncommitted - committed - deleted description: An enumeration. title: VersionStatus type_:AgentResponse: type: object properties: path: type: string description: >- Path of the Agent, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Agent. directory_id: type: string description: ID of the directory that the file is in on Humanloop. model: type: string description: >- The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models) endpoint: $ref: '#/components/schemas/type_:ModelEndpoints' description: The provider model endpoint used. template: $ref: '#/components/schemas/type_:AgentResponseTemplate' description: >- 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}}`. template_language: $ref: '#/components/schemas/type_:TemplateLanguage' description: The template language to use for rendering the template. provider: $ref: '#/components/schemas/type_:ModelProviders' description: The company providing the underlying model service. max_tokens: type: integer default: -1 description: >- 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 temperature: type: number format: double default: 1 description: >- What sampling temperature to use when making a generation. Higher values means the model will be more creative. top_p: type: number format: double default: 1 description: >- An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. stop: $ref: '#/components/schemas/type_:AgentResponseStop' description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. presence_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far. frequency_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far. other: type: object additionalProperties: description: Any type description: Other parameter values to be passed to the provider call. seed: type: integer description: >- If specified, model will make a best effort to sample deterministically, but it is not guaranteed. response_format: $ref: '#/components/schemas/type_:ResponseFormat' description: >- The format of the response. Only `{"type": "json_object"}` is currently supported for chat. reasoning_effort: $ref: '#/components/schemas/type_:AgentResponseReasoningEffort' description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. tools: type: array items: $ref: '#/components/schemas/type_:AgentResponseToolsItem' description: >- List of tools that the Agent can call. These can be linked files or inline tools. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used. max_iterations: type: integer description: >- The maximum number of iterations the Agent can run. This is used to limit the number of times the Agent model is called. version_name: type: string description: >- Unique name for the Agent version. Version names must be unique for a given Agent. version_description: type: string description: Description of the version, e.g., the changes made in this version. description: type: string description: Description of the Agent. tags: type: array items: type: string description: List of tags associated with the file. readme: type: string description: Long description of the file. name: type: string description: Name of the Agent. schema: type: object additionalProperties: description: Any type description: The JSON schema for the Prompt. version_id: type: string description: >- Unique identifier for the specific Agent Version. If no query params provided, the default deployed Agent Version is returned. type: type: string enum: - agent environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Agent Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Agent. committed_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who committed the Agent Version. committed_at: type: string format: date-time description: The date and time the Agent Version was committed. status: $ref: '#/components/schemas/type_:VersionStatus' description: The status of the Agent Version. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Agent Version total_logs_count: type: integer description: >- The number of logs that have been generated across all Agent Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Agent. Inputs correspond to any of the variables used within the Agent template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Agent that are used for monitoring logs. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Agent Version. raw_file_content: type: string description: The raw content of the Agent. Corresponds to the .agent file. required: - path - id - model - tools - name - version_id - created_at - updated_at - status - last_used_at - version_logs_count - total_logs_count - inputs description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: AgentResponse type_:VersionDeploymentResponseFile: oneOf: - $ref: '#/components/schemas/type_:PromptResponse' - $ref: '#/components/schemas/type_:ToolResponse' - $ref: '#/components/schemas/type_:DatasetResponse' - $ref: '#/components/schemas/type_:EvaluatorResponse' - $ref: '#/components/schemas/type_:FlowResponse' - $ref: '#/components/schemas/type_:AgentResponse' description: The File that the deployed Version belongs to. title: VersionDeploymentResponseFile type_:VersionDeploymentResponse: type: object properties: file: $ref: '#/components/schemas/type_:VersionDeploymentResponseFile' description: The File that the deployed Version belongs to. environment: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The Environment that the Version is deployed to. type: type: string enum: - environment required: - file - environment - type description: A variable reference to the Version deployed to an Environment title: VersionDeploymentResponse type_:VersionIdResponseVersion: oneOf: - $ref: '#/components/schemas/type_:PromptResponse' - $ref: '#/components/schemas/type_:ToolResponse' - $ref: '#/components/schemas/type_:DatasetResponse' - $ref: '#/components/schemas/type_:EvaluatorResponse' - $ref: '#/components/schemas/type_:FlowResponse' - $ref: '#/components/schemas/type_:AgentResponse' description: The specific Version being referenced. title: VersionIdResponseVersion type_:VersionIdResponse: type: object properties: version: $ref: '#/components/schemas/type_:VersionIdResponseVersion' description: The specific Version being referenced. type: type: string enum: - version required: - version - type description: A reference to a specific Version by its ID title: VersionIdResponse type_:VersionReferenceResponse: oneOf: - $ref: '#/components/schemas/type_:VersionDeploymentResponse' - $ref: '#/components/schemas/type_:VersionIdResponse' title: VersionReferenceResponse type_:MonitoringEvaluatorState: type: string enum: - active - inactive description: State of an evaluator connected to a file title: MonitoringEvaluatorState type_:MonitoringEvaluatorResponse: type: object properties: version_reference: $ref: '#/components/schemas/type_:VersionReferenceResponse' description: >- The Evaluator Version used for monitoring. This can be a specific Version by ID, or a Version deployed to an Environment. version: $ref: '#/components/schemas/type_:EvaluatorResponse' description: The deployed Version. state: $ref: '#/components/schemas/type_:MonitoringEvaluatorState' description: The state of the Monitoring Evaluator. Either `active` or `inactive` created_at: type: string format: date-time updated_at: type: string format: date-time required: - version_reference - state - created_at - updated_at title: MonitoringEvaluatorResponse type_:PromptResponse: type: object properties: path: type: string description: >- Path of the Prompt, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Prompt. directory_id: type: string description: ID of the directory that the file is in on Humanloop. model: type: string description: >- The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models) endpoint: $ref: '#/components/schemas/type_:ModelEndpoints' description: The provider model endpoint used. template: $ref: '#/components/schemas/type_:PromptResponseTemplate' description: >- 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}}`. template_language: $ref: '#/components/schemas/type_:TemplateLanguage' description: The template language to use for rendering the template. provider: $ref: '#/components/schemas/type_:ModelProviders' description: The company providing the underlying model service. max_tokens: type: integer default: -1 description: >- 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 temperature: type: number format: double default: 1 description: >- What sampling temperature to use when making a generation. Higher values means the model will be more creative. top_p: type: number format: double default: 1 description: >- An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. stop: $ref: '#/components/schemas/type_:PromptResponseStop' description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. presence_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far. frequency_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far. other: type: object additionalProperties: description: Any type description: Other parameter values to be passed to the provider call. seed: type: integer description: >- If specified, model will make a best effort to sample deterministically, but it is not guaranteed. response_format: $ref: '#/components/schemas/type_:ResponseFormat' description: >- The format of the response. Only `{"type": "json_object"}` is currently supported for chat. reasoning_effort: $ref: '#/components/schemas/type_:PromptResponseReasoningEffort' description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. tools: type: array items: $ref: '#/components/schemas/type_:ToolFunction' description: >- The tool specification that the model can choose to call if Tool calling is supported. linked_tools: type: array items: $ref: '#/components/schemas/type_:LinkedToolResponse' description: The tools linked to your prompt that the model can call. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used. version_name: type: string description: >- Unique name for the Prompt version. Version names must be unique for a given Prompt. version_description: type: string description: Description of the version, e.g., the changes made in this version. description: type: string description: Description of the Prompt. tags: type: array items: type: string description: List of tags associated with the file. readme: type: string description: Long description of the file. name: type: string description: Name of the Prompt. schema: type: object additionalProperties: description: Any type description: The JSON schema for the Prompt. version_id: type: string description: >- Unique identifier for the specific Prompt Version. If no query params provided, the default deployed Prompt Version is returned. type: type: string enum: - prompt environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Prompt Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Prompt. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Prompt Version total_logs_count: type: integer description: >- The number of logs that have been generated across all Prompt Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Prompt. Inputs correspond to any of the variables used within the Prompt template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Prompt that are used for monitoring logs. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Prompt Version. raw_file_content: type: string description: The raw content of the Prompt. Corresponds to the .prompt file. required: - path - id - model - name - version_id - created_at - updated_at - last_used_at - version_logs_count - total_logs_count - inputs description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: PromptResponse type_:EvaluatorLogResponseJudgment: oneOf: - type: boolean - type: string - type: array items: type: string - type: number format: double description: Evaluator assessment of the Log. title: EvaluatorLogResponseJudgment type_:EvaluatorLogResponse: type: object properties: start_time: type: string format: date-time description: When the logged event started. end_time: type: string format: date-time description: When the logged event ended. output: type: string description: >- Generated output from your model for the provided inputs. Can be `None` if logging an error, or if creating a parent Log with the intention to populate it later. created_at: type: string format: date-time description: 'User defined timestamp for when the log was created. ' error: type: string description: Error message if the log is an error. provider_latency: type: number format: double description: Duration of the logged event in seconds. stdout: type: string description: Captured log and debug statements. provider_request: type: object additionalProperties: description: Any type description: Raw request sent to provider. provider_response: type: object additionalProperties: description: Any type description: Raw response received the provider. inputs: type: object additionalProperties: description: Any type description: The inputs passed to the prompt template. source: type: string description: Identifies where the model was called from. metadata: type: object additionalProperties: description: Any type description: Any additional metadata to record. parent_id: type: string description: >- Identifier of the evaluated Log. The newly created Log will have this one set as parent. source_datapoint_id: type: string description: >- Unique identifier for the Datapoint that this Log is derived from. This can be used by Humanloop to associate Logs to Evaluations. If provided, Humanloop will automatically associate this Log to Evaluations that require a Log for this Datapoint-Version pair. trace_parent_id: type: string description: The ID of the parent Log to nest this Log under in a Trace. batches: type: array items: type: string description: >- Array of Batch IDs that this Log is part of. Batches are used to group Logs together for offline Evaluations user: type: string description: End-user ID related to the Log. environment: type: string description: The name of the Environment the Log is associated to. save: type: boolean default: true description: Whether the request/response payloads will be stored on Humanloop. log_id: type: string description: >- This will identify a Log. If you don't provide a Log ID, Humanloop will generate one for you. output_message: $ref: '#/components/schemas/type_:ChatMessage' description: >- The message returned by the LLM. Only populated for LLM Evaluator Logs. judgment: $ref: '#/components/schemas/type_:EvaluatorLogResponseJudgment' description: Evaluator assessment of the Log. marked_completed: type: boolean description: Whether the Log has been manually marked as completed by a user. id: type: string description: Unique identifier for the Log. evaluator_logs: type: array items: $ref: '#/components/schemas/type_:EvaluatorLogResponse' description: >- List of Evaluator Logs associated with the Log. These contain Evaluator judgments on the Log. trace_flow_id: type: string description: Identifier for the Flow that the Trace belongs to. trace_id: type: string description: Identifier for the Trace that the Log belongs to. trace_children: type: array items: $ref: '#/components/schemas/type_:LogResponse' description: Logs nested under this Log in the Trace. evaluator: $ref: '#/components/schemas/type_:EvaluatorResponse' description: Evaluator used to generate the judgment. parent: $ref: '#/components/schemas/type_:LogResponse' description: >- The Log that was evaluated. Only provided if the ?include_parent query parameter is set for the required: - id - evaluator_logs - evaluator description: General request for creating a Log title: EvaluatorLogResponse type_:PromptLogResponse: type: object properties: output_message: $ref: '#/components/schemas/type_:ChatMessage' description: The message returned by the provider. prompt_tokens: type: integer description: Number of tokens in the prompt used to generate the output. reasoning_tokens: type: integer description: Number of reasoning tokens used to generate the output. output_tokens: type: integer description: Number of tokens in the output generated by the model. prompt_cost: type: number format: double description: Cost in dollars associated to the tokens in the prompt. output_cost: type: number format: double description: Cost in dollars associated to the tokens in the output. finish_reason: type: string description: Reason the generation finished. messages: type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: The messages passed to the to provider chat endpoint. tool_choice: $ref: '#/components/schemas/type_:PromptLogResponseToolChoice' description: >- Controls how the model uses tools. The following options are supported: - `'none'` means the model will not call any tool and instead generates a message; this is the default when no tools are provided as part of the Prompt. - `'auto'` means the model can decide to call one or more of the provided tools; this is the default when tools are provided as part of the Prompt. - `'required'` means the model must call one or more of the provided tools. - `{'type': 'function', 'function': {name': }}` forces the model to use the named function. prompt: $ref: '#/components/schemas/type_:PromptResponse' description: Prompt used to generate the Log. start_time: type: string format: date-time description: When the logged event started. end_time: type: string format: date-time description: When the logged event ended. output: type: string description: >- Generated output from your model for the provided inputs. Can be `None` if logging an error, or if creating a parent Log with the intention to populate it later. created_at: type: string format: date-time description: 'User defined timestamp for when the log was created. ' error: type: string description: Error message if the log is an error. provider_latency: type: number format: double description: Duration of the logged event in seconds. stdout: type: string description: Captured log and debug statements. provider_request: type: object additionalProperties: description: Any type description: Raw request sent to provider. provider_response: type: object additionalProperties: description: Any type description: Raw response received the provider. inputs: type: object additionalProperties: description: Any type description: The inputs passed to the prompt template. source: type: string description: Identifies where the model was called from. metadata: type: object additionalProperties: description: Any type description: Any additional metadata to record. source_datapoint_id: type: string description: >- Unique identifier for the Datapoint that this Log is derived from. This can be used by Humanloop to associate Logs to Evaluations. If provided, Humanloop will automatically associate this Log to Evaluations that require a Log for this Datapoint-Version pair. trace_parent_id: type: string description: The ID of the parent Log to nest this Log under in a Trace. batches: type: array items: type: string description: >- Array of Batch IDs that this Log is part of. Batches are used to group Logs together for offline Evaluations user: type: string description: End-user ID related to the Log. environment: type: string description: The name of the Environment the Log is associated to. save: type: boolean default: true description: Whether the request/response payloads will be stored on Humanloop. log_id: type: string description: >- This will identify a Log. If you don't provide a Log ID, Humanloop will generate one for you. id: type: string description: Unique identifier for the Log. evaluator_logs: type: array items: $ref: '#/components/schemas/type_:EvaluatorLogResponse' description: >- List of Evaluator Logs associated with the Log. These contain Evaluator judgments on the Log. trace_flow_id: type: string description: Identifier for the Flow that the Trace belongs to. trace_id: type: string description: Identifier for the Trace that the Log belongs to. trace_children: type: array items: $ref: '#/components/schemas/type_:LogResponse' description: Logs nested under this Log in the Trace. required: - prompt - id - evaluator_logs description: General request for creating a Log title: PromptLogResponse type_:ToolLogResponse: type: object properties: start_time: type: string format: date-time description: When the logged event started. end_time: type: string format: date-time description: When the logged event ended. output: type: string description: >- Generated output from your model for the provided inputs. Can be `None` if logging an error, or if creating a parent Log with the intention to populate it later. created_at: type: string format: date-time description: 'User defined timestamp for when the log was created. ' error: type: string description: Error message if the log is an error. provider_latency: type: number format: double description: Duration of the logged event in seconds. stdout: type: string description: Captured log and debug statements. provider_request: type: object additionalProperties: description: Any type description: Raw request sent to provider. provider_response: type: object additionalProperties: description: Any type description: Raw response received the provider. inputs: type: object additionalProperties: description: Any type description: The inputs passed to the prompt template. source: type: string description: Identifies where the model was called from. metadata: type: object additionalProperties: description: Any type description: Any additional metadata to record. source_datapoint_id: type: string description: >- Unique identifier for the Datapoint that this Log is derived from. This can be used by Humanloop to associate Logs to Evaluations. If provided, Humanloop will automatically associate this Log to Evaluations that require a Log for this Datapoint-Version pair. trace_parent_id: type: string description: The ID of the parent Log to nest this Log under in a Trace. batches: type: array items: type: string description: >- Array of Batch IDs that this Log is part of. Batches are used to group Logs together for offline Evaluations user: type: string description: End-user ID related to the Log. environment: type: string description: The name of the Environment the Log is associated to. save: type: boolean default: true description: Whether the request/response payloads will be stored on Humanloop. log_id: type: string description: >- This will identify a Log. If you don't provide a Log ID, Humanloop will generate one for you. id: type: string description: Unique identifier for the Log. evaluator_logs: type: array items: $ref: '#/components/schemas/type_:EvaluatorLogResponse' description: >- List of Evaluator Logs associated with the Log. These contain Evaluator judgments on the Log. trace_flow_id: type: string description: Identifier for the Flow that the Trace belongs to. trace_id: type: string description: Identifier for the Trace that the Log belongs to. trace_children: type: array items: $ref: '#/components/schemas/type_:LogResponse' description: Logs nested under this Log in the Trace. tool: $ref: '#/components/schemas/type_:ToolResponse' description: Tool used to generate the Log. output_message: $ref: '#/components/schemas/type_:ChatMessage' description: The message returned by the Tool. required: - id - evaluator_logs - tool description: General request for creating a Log title: ToolLogResponse type_:LogStatus: type: string enum: - complete - incomplete description: An enumeration. title: LogStatus type_:FlowLogResponse: type: object properties: messages: type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: List of chat messages that were used as an input to the Flow. output_message: $ref: '#/components/schemas/type_:ChatMessage' description: The output message returned by this Flow. start_time: type: string format: date-time description: When the logged event started. end_time: type: string format: date-time description: When the logged event ended. output: type: string description: >- Generated output from your model for the provided inputs. Can be `None` if logging an error, or if creating a parent Log with the intention to populate it later. created_at: type: string format: date-time description: 'User defined timestamp for when the log was created. ' error: type: string description: Error message if the log is an error. provider_latency: type: number format: double description: Duration of the logged event in seconds. stdout: type: string description: Captured log and debug statements. provider_request: type: object additionalProperties: description: Any type description: Raw request sent to provider. provider_response: type: object additionalProperties: description: Any type description: Raw response received the provider. inputs: type: object additionalProperties: description: Any type description: The inputs passed to the Flow Log. source: type: string description: Identifies where the model was called from. metadata: type: object additionalProperties: description: Any type description: Any additional metadata to record. log_status: $ref: '#/components/schemas/type_:LogStatus' description: >- Status of the Flow Log. When a Flow Log is updated to `complete`, no more Logs can be added to it. You cannot update a Flow Log's status from `complete` to `incomplete`. source_datapoint_id: type: string description: >- Unique identifier for the Datapoint that this Log is derived from. This can be used by Humanloop to associate Logs to Evaluations. If provided, Humanloop will automatically associate this Log to Evaluations that require a Log for this Datapoint-Version pair. trace_parent_id: type: string description: The ID of the parent Log to nest this Log under in a Trace. batches: type: array items: type: string description: >- Array of Batch IDs that this Log is part of. Batches are used to group Logs together for offline Evaluations user: type: string description: End-user ID related to the Log. environment: type: string description: The name of the Environment the Log is associated to. save: type: boolean default: true description: Whether the request/response payloads will be stored on Humanloop. log_id: type: string description: >- This will identify a Log. If you don't provide a Log ID, Humanloop will generate one for you. id: type: string description: Unique identifier for the Log. evaluator_logs: type: array items: $ref: '#/components/schemas/type_:EvaluatorLogResponse' description: >- List of Evaluator Logs associated with the Log. These contain Evaluator judgments on the Log. trace_flow_id: type: string description: Identifier for the Flow that the Trace belongs to. trace_id: type: string description: Identifier for the Trace that the Log belongs to. trace_children: type: array items: $ref: '#/components/schemas/type_:LogResponse' description: Logs nested under this Log in the Trace. flow: $ref: '#/components/schemas/type_:FlowResponse' description: Flow used to generate the Log. required: - id - evaluator_logs - flow description: General request for creating a Log title: FlowLogResponse type_:AgentLogResponseToolChoice: oneOf: - type: string enum: - none - type: string enum: - auto - type: string enum: - required - $ref: '#/components/schemas/type_:ToolChoice' description: >- Controls how the model uses tools. The following options are supported: - `'none'` means the model will not call any tool and instead generates a message; this is the default when no tools are provided as part of the Prompt. - `'auto'` means the model can decide to call one or more of the provided tools; this is the default when tools are provided as part of the Prompt. - `'required'` means the model must call one or more of the provided tools. - `{'type': 'function', 'function': {name': }}` forces the model to use the named function. title: AgentLogResponseToolChoice type_:AgentLogResponse: type: object properties: output_message: $ref: '#/components/schemas/type_:ChatMessage' description: The message returned by the provider. prompt_tokens: type: integer description: Number of tokens in the prompt used to generate the output. reasoning_tokens: type: integer description: Number of reasoning tokens used to generate the output. output_tokens: type: integer description: Number of tokens in the output generated by the model. prompt_cost: type: number format: double description: Cost in dollars associated to the tokens in the prompt. output_cost: type: number format: double description: Cost in dollars associated to the tokens in the output. finish_reason: type: string description: Reason the generation finished. messages: type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: The messages passed to the to provider chat endpoint. tool_choice: $ref: '#/components/schemas/type_:AgentLogResponseToolChoice' description: >- Controls how the model uses tools. The following options are supported: - `'none'` means the model will not call any tool and instead generates a message; this is the default when no tools are provided as part of the Prompt. - `'auto'` means the model can decide to call one or more of the provided tools; this is the default when tools are provided as part of the Prompt. - `'required'` means the model must call one or more of the provided tools. - `{'type': 'function', 'function': {name': }}` forces the model to use the named function. agent: $ref: '#/components/schemas/type_:AgentResponse' description: Agent that generated the Log. start_time: type: string format: date-time description: When the logged event started. end_time: type: string format: date-time description: When the logged event ended. output: type: string description: >- Generated output from your model for the provided inputs. Can be `None` if logging an error, or if creating a parent Log with the intention to populate it later. created_at: type: string format: date-time description: 'User defined timestamp for when the log was created. ' error: type: string description: Error message if the log is an error. provider_latency: type: number format: double description: Duration of the logged event in seconds. stdout: type: string description: Captured log and debug statements. provider_request: type: object additionalProperties: description: Any type description: Raw request sent to provider. provider_response: type: object additionalProperties: description: Any type description: Raw response received the provider. inputs: type: object additionalProperties: description: Any type description: The inputs passed to the prompt template. source: type: string description: Identifies where the model was called from. metadata: type: object additionalProperties: description: Any type description: Any additional metadata to record. source_datapoint_id: type: string description: >- Unique identifier for the Datapoint that this Log is derived from. This can be used by Humanloop to associate Logs to Evaluations. If provided, Humanloop will automatically associate this Log to Evaluations that require a Log for this Datapoint-Version pair. trace_parent_id: type: string description: The ID of the parent Log to nest this Log under in a Trace. batches: type: array items: type: string description: >- Array of Batch IDs that this Log is part of. Batches are used to group Logs together for offline Evaluations user: type: string description: End-user ID related to the Log. environment: type: string description: The name of the Environment the Log is associated to. save: type: boolean default: true description: Whether the request/response payloads will be stored on Humanloop. log_id: type: string description: >- This will identify a Log. If you don't provide a Log ID, Humanloop will generate one for you. id: type: string description: Unique identifier for the Log. evaluator_logs: type: array items: $ref: '#/components/schemas/type_:EvaluatorLogResponse' description: >- List of Evaluator Logs associated with the Log. These contain Evaluator judgments on the Log. trace_flow_id: type: string description: Identifier for the Flow that the Trace belongs to. trace_id: type: string description: Identifier for the Trace that the Log belongs to. trace_children: type: array items: $ref: '#/components/schemas/type_:LogResponse' description: Logs nested under this Log in the Trace. required: - agent - id - evaluator_logs description: General request for creating a Log title: AgentLogResponse type_:LogResponse: oneOf: - $ref: '#/components/schemas/type_:PromptLogResponse' - $ref: '#/components/schemas/type_:ToolLogResponse' - $ref: '#/components/schemas/type_:EvaluatorLogResponse' - $ref: '#/components/schemas/type_:FlowLogResponse' - $ref: '#/components/schemas/type_:AgentLogResponse' title: LogResponse type_:ValidationErrorLocItem: oneOf: - type: string - type: integer title: ValidationErrorLocItem type_:ValidationError: type: object properties: loc: type: array items: $ref: '#/components/schemas/type_:ValidationErrorLocItem' msg: type: string type: type: string required: - loc - msg - type title: ValidationError type_:HttpValidationError: type: object properties: detail: type: array items: $ref: '#/components/schemas/type_:ValidationError' title: HttpValidationError securitySchemes: default: type: apiKey in: header name: X-API-KEY ``` ## SDK Code Examples ```python import requests url = "https://api.humanloop.com/v5/prompts/id/log/log_id" payload = {} headers = { "X-API-KEY": " ", "Content-Type": "application/json" } response = requests.patch(url, json=payload, headers=headers) print(response.json()) ``` ```typescript import { HumanloopClient } from "humanloop"; const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); await client.prompts.updateLog("id", "log_id"); ``` ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/prompts/id/log/log_id" payload := strings.NewReader("{}") req, _ := http.NewRequest("PATCH", url, payload) req.Header.Add("X-API-KEY", " ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://api.humanloop.com/v5/prompts/id/log/log_id") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Patch.new(url) request["X-API-KEY"] = ' ' request["Content-Type"] = 'application/json' request.body = "{}" response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.patch("https://api.humanloop.com/v5/prompts/id/log/log_id") .header("X-API-KEY", " ") .header("Content-Type", "application/json") .body("{}") .asString(); ``` ```php request('PATCH', 'https://api.humanloop.com/v5/prompts/id/log/log_id', [ 'body' => '{}', 'headers' => [ 'Content-Type' => 'application/json', 'X-API-KEY' => ' ', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/prompts/id/log/log_id"); var request = new RestRequest(Method.PATCH); request.AddHeader("X-API-KEY", " "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "X-API-KEY": " ", "Content-Type": "application/json" ] let parameters = [] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/prompts/id/log/log_id")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "PATCH" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. # Call Prompt POST https://api.humanloop.com/v5/prompts/call Content-Type: application/json Call a Prompt. Calling a Prompt calls the model provider before logging the request, responses and metadata to Humanloop. You can use query parameters `version_id`, or `environment`, to target an existing version of the Prompt. Otherwise the default deployed version will be chosen. Instead of targeting an existing version explicitly, you can instead pass in Prompt details in the request body. In this case, we will check if the details correspond to an existing version of the Prompt. If they do not, we will create a new version. This is helpful in the case where you are storing or deriving your Prompt details in code. Reference: https://humanloop.com/docs/api/prompts/call ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /prompts/call: post: operationId: call summary: Call Prompt description: >- Call a Prompt. Calling a Prompt calls the model provider before logging the request, responses and metadata to Humanloop. You can use query parameters `version_id`, or `environment`, to target an existing version of the Prompt. Otherwise the default deployed version will be chosen. Instead of targeting an existing version explicitly, you can instead pass in Prompt details in the request body. In this case, we will check if the details correspond to an existing version of the Prompt. If they do not, we will create a new version. This is helpful in the case where you are storing or deriving your Prompt details in code. tags: - subpackage_prompts parameters: - name: version_id in: query description: A specific Version ID of the Prompt to log to. required: false schema: type: string - name: environment in: query description: Name of the Environment identifying a deployed version to log to. required: false schema: type: string - name: X-API-KEY in: header required: true schema: type: string responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/type_:PromptCallResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/type_:HttpValidationError' requestBody: content: application/json: schema: type: object properties: path: type: string description: >- 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: type: string description: ID for an existing Prompt. messages: type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: The messages passed to the to provider chat endpoint. tool_choice: $ref: >- #/components/schemas/type_prompts:PromptsCallRequestToolChoice description: >- Controls how the model uses tools. The following options are supported: - `'none'` means the model will not call any tool and instead generates a message; this is the default when no tools are provided as part of the Prompt. - `'auto'` means the model can decide to call one or more of the provided tools; this is the default when tools are provided as part of the Prompt. - `'required'` means the model must call one or more of the provided tools. - `{'type': 'function', 'function': {name': }}` forces the model to use the named function. prompt: $ref: '#/components/schemas/type_prompts:PromptsCallRequestPrompt' description: >- The Prompt configuration to use. Two formats are supported: - An object representing the details of the Prompt configuration - A string representing the raw contents of a .prompt file A new Prompt version will be created if the provided details do not match any existing version. inputs: type: object additionalProperties: description: Any type description: The inputs passed to the prompt template. source: type: string description: Identifies where the model was called from. metadata: type: object additionalProperties: description: Any type description: Any additional metadata to record. start_time: type: string format: date-time description: When the logged event started. end_time: type: string format: date-time description: When the logged event ended. source_datapoint_id: type: string description: >- Unique identifier for the Datapoint that this Log is derived from. This can be used by Humanloop to associate Logs to Evaluations. If provided, Humanloop will automatically associate this Log to Evaluations that require a Log for this Datapoint-Version pair. trace_parent_id: type: string description: The ID of the parent Log to nest this Log under in a Trace. user: type: string description: End-user ID related to the Log. environment: type: string description: The name of the Environment the Log is associated to. save: type: boolean default: true description: >- Whether the request/response payloads will be stored on Humanloop. log_id: type: string description: >- This will identify a Log. If you don't provide a Log ID, Humanloop will generate one for you. provider_api_keys: $ref: '#/components/schemas/type_:ProviderApiKeys' description: >- API keys required by each provider to make API calls. The API keys provided here are not stored by Humanloop. If not specified here, Humanloop will fall back to the key saved to your organization. num_samples: type: integer default: 1 description: The number of generations. stream: type: boolean enum: - false description: >- If true, tokens will be sent as data-only server-sent events. If num_samples > 1, samples are streamed back independently. return_inputs: type: boolean default: true description: >- Whether to return the inputs in the response. If false, the response will contain an empty dictionary under inputs. This is useful for reducing the size of the response. Defaults to true. logprobs: type: integer description: >- Include the log probabilities of the top n tokens in the provider_response suffix: type: string description: >- The suffix that comes after a completion of inserted text. Useful for completions that act like inserts. required: - stream servers: - url: https://api.humanloop.com/v5 components: schemas: type_:TextChatContent: type: object properties: type: type: string enum: - text text: type: string description: The message's text content. required: - type - text title: TextChatContent type_:ImageUrlDetail: type: string enum: - high - low - auto description: >- Specify the detail level of the image provided to the model. For more details see: https://platform.openai.com/docs/guides/vision/low-or-high-fidelity-image-understanding title: ImageUrlDetail type_:ImageUrl: type: object properties: url: type: string description: Either a URL of the image or the base64 encoded image data. detail: $ref: '#/components/schemas/type_:ImageUrlDetail' description: >- Specify the detail level of the image provided to the model. For more details see: https://platform.openai.com/docs/guides/vision/low-or-high-fidelity-image-understanding required: - url title: ImageUrl type_:ImageChatContent: type: object properties: type: type: string enum: - image_url image_url: $ref: '#/components/schemas/type_:ImageUrl' description: The message's image content. required: - type - image_url title: ImageChatContent type_:ChatMessageContentItem: oneOf: - $ref: '#/components/schemas/type_:TextChatContent' - $ref: '#/components/schemas/type_:ImageChatContent' title: ChatMessageContentItem type_:ChatMessageContent: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessageContentItem' description: The content of the message. title: ChatMessageContent type_:ChatRole: type: string enum: - user - assistant - system - tool - developer description: An enumeration. title: ChatRole type_:ChatToolType: type: string enum: - function description: The type of tool to call. title: ChatToolType type_:FunctionTool: type: object properties: name: type: string arguments: type: string required: - name description: A function tool to be called by the model where user owns runtime. title: FunctionTool type_:ToolCall: type: object properties: id: type: string type: $ref: '#/components/schemas/type_:ChatToolType' function: $ref: '#/components/schemas/type_:FunctionTool' required: - id - type - function description: A tool call to be made. title: ToolCall type_:AnthropicThinkingContent: type: object properties: type: type: string enum: - thinking thinking: type: string description: Model's chain-of-thought for providing the response. signature: type: string description: >- Cryptographic signature that verifies the thinking block was generated by Anthropic. required: - type - thinking - signature title: AnthropicThinkingContent type_:AnthropicRedactedThinkingContent: type: object properties: type: type: string enum: - redacted_thinking data: type: string description: >- Thinking block Anthropic redacted for safety reasons. User is expected to pass the block back to Anthropic required: - type - data title: AnthropicRedactedThinkingContent type_:ChatMessageThinkingItem: oneOf: - $ref: '#/components/schemas/type_:AnthropicThinkingContent' - $ref: '#/components/schemas/type_:AnthropicRedactedThinkingContent' title: ChatMessageThinkingItem type_:ChatMessage: type: object properties: content: $ref: '#/components/schemas/type_:ChatMessageContent' description: The content of the message. name: type: string description: Optional name of the message author. tool_call_id: type: string description: Tool call that this message is responding to. role: $ref: '#/components/schemas/type_:ChatRole' description: Role of the message author. tool_calls: type: array items: $ref: '#/components/schemas/type_:ToolCall' description: A list of tool calls requested by the assistant. thinking: type: array items: $ref: '#/components/schemas/type_:ChatMessageThinkingItem' description: >- Model's chain-of-thought for providing the response. Present on assistant messages if model supports it. required: - role title: ChatMessage type_:FunctionToolChoice: type: object properties: name: type: string required: - name description: A function tool to be called by the model where user owns runtime. title: FunctionToolChoice type_:ToolChoice: type: object properties: type: $ref: '#/components/schemas/type_:ChatToolType' function: $ref: '#/components/schemas/type_:FunctionToolChoice' required: - type - function description: Tool choice to force the model to use a tool. title: ToolChoice type_prompts:PromptsCallRequestToolChoice: oneOf: - type: string enum: - none - type: string enum: - auto - type: string enum: - required - $ref: '#/components/schemas/type_:ToolChoice' description: >- Controls how the model uses tools. The following options are supported: - `'none'` means the model will not call any tool and instead generates a message; this is the default when no tools are provided as part of the Prompt. - `'auto'` means the model can decide to call one or more of the provided tools; this is the default when tools are provided as part of the Prompt. - `'required'` means the model must call one or more of the provided tools. - `{'type': 'function', 'function': {name': }}` forces the model to use the named function. title: PromptsCallRequestToolChoice type_:ModelEndpoints: type: string enum: - complete - chat - edit description: Supported model provider endpoints. title: ModelEndpoints type_:PromptKernelRequestTemplate: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: >- 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}}`. title: PromptKernelRequestTemplate type_:TemplateLanguage: type: string enum: - default - jinja description: Template engine to use for rendering templates. title: TemplateLanguage type_:ModelProviders: type: string enum: - anthropic - bedrock - cohere - deepseek - google - groq - mock - openai - openai_azure - replicate description: Supported model providers. title: ModelProviders type_:PromptKernelRequestStop: oneOf: - type: string - type: array items: type: string description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. title: PromptKernelRequestStop type_:ResponseFormatType: type: string enum: - json_object - json_schema title: ResponseFormatType type_:ResponseFormat: type: object properties: type: $ref: '#/components/schemas/type_:ResponseFormatType' json_schema: type: object additionalProperties: description: Any type description: The JSON schema of the response format if type is json_schema. required: - type description: Response format of the model. title: ResponseFormat type_:OpenAiReasoningEffort: type: string enum: - high - medium - low description: Supported reasoning effort. title: OpenAiReasoningEffort type_:PromptKernelRequestReasoningEffort: oneOf: - $ref: '#/components/schemas/type_:OpenAiReasoningEffort' - type: integer description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. title: PromptKernelRequestReasoningEffort type_:ToolFunction: type: object properties: name: type: string description: Name for the tool referenced by the model. description: type: string description: Description of the tool referenced by the model strict: type: boolean default: false description: >- If true, forces the model to output json data in the structure of the parameters schema. parameters: type: object additionalProperties: description: Any type description: >- Parameters needed to run the Tool, defined in JSON Schema format: https://json-schema.org/ required: - name - description title: ToolFunction type_:PromptKernelRequest: type: object properties: model: type: string description: >- The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models) endpoint: $ref: '#/components/schemas/type_:ModelEndpoints' description: The provider model endpoint used. template: $ref: '#/components/schemas/type_:PromptKernelRequestTemplate' description: >- 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}}`. template_language: $ref: '#/components/schemas/type_:TemplateLanguage' description: The template language to use for rendering the template. provider: $ref: '#/components/schemas/type_:ModelProviders' description: The company providing the underlying model service. max_tokens: type: integer default: -1 description: >- 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 temperature: type: number format: double default: 1 description: >- What sampling temperature to use when making a generation. Higher values means the model will be more creative. top_p: type: number format: double default: 1 description: >- An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. stop: $ref: '#/components/schemas/type_:PromptKernelRequestStop' description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. presence_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far. frequency_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far. other: type: object additionalProperties: description: Any type description: Other parameter values to be passed to the provider call. seed: type: integer description: >- If specified, model will make a best effort to sample deterministically, but it is not guaranteed. response_format: $ref: '#/components/schemas/type_:ResponseFormat' description: >- The format of the response. Only `{"type": "json_object"}` is currently supported for chat. reasoning_effort: $ref: '#/components/schemas/type_:PromptKernelRequestReasoningEffort' description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. tools: type: array items: $ref: '#/components/schemas/type_:ToolFunction' description: >- The tool specification that the model can choose to call if Tool calling is supported. linked_tools: type: array items: type: string description: >- 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. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used. required: - model description: |- Base class used by both PromptKernelRequest and AgentKernelRequest. Contains the consistent Prompt-related fields. title: PromptKernelRequest type_prompts:PromptsCallRequestPrompt: oneOf: - $ref: '#/components/schemas/type_:PromptKernelRequest' - type: string description: >- The Prompt configuration to use. Two formats are supported: - An object representing the details of the Prompt configuration - A string representing the raw contents of a .prompt file A new Prompt version will be created if the provided details do not match any existing version. title: PromptsCallRequestPrompt type_:ProviderApiKeys: type: object properties: openai: type: string mock: type: string anthropic: type: string deepseek: type: string bedrock: type: string cohere: type: string openai_azure: type: string openai_azure_endpoint: type: string google: type: string title: ProviderApiKeys type_:PromptCallResponseToolChoice: oneOf: - type: string enum: - none - type: string enum: - auto - type: string enum: - required - $ref: '#/components/schemas/type_:ToolChoice' description: >- Controls how the model uses tools. The following options are supported: - `'none'` means the model will not call any tool and instead generates a message; this is the default when no tools are provided as part of the Prompt. - `'auto'` means the model can decide to call one or more of the provided tools; this is the default when tools are provided as part of the Prompt. - `'required'` means the model must call one or more of the provided tools. - `{'type': 'function', 'function': {name': }}` forces the model to use the named function. title: PromptCallResponseToolChoice type_:PromptResponseTemplate: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: >- 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}}`. title: PromptResponseTemplate type_:PromptResponseStop: oneOf: - type: string - type: array items: type: string description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. title: PromptResponseStop type_:PromptResponseReasoningEffort: oneOf: - $ref: '#/components/schemas/type_:OpenAiReasoningEffort' - type: integer description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. title: PromptResponseReasoningEffort type_:LinkedToolResponse: type: object properties: name: type: string description: Name for the tool referenced by the model. description: type: string description: Description of the tool referenced by the model strict: type: boolean default: false description: >- If true, forces the model to output json data in the structure of the parameters schema. parameters: type: object additionalProperties: description: Any type description: >- Parameters needed to run the Tool, defined in JSON Schema format: https://json-schema.org/ id: type: string description: Unique identifier for the Tool linked. version_id: type: string description: Unique identifier for the Tool Version linked. required: - name - description - id - version_id title: LinkedToolResponse type_:EnvironmentTag: type: string enum: - default - other description: An enumeration. title: EnvironmentTag type_:EnvironmentResponse: type: object properties: id: type: string created_at: type: string format: date-time name: type: string tag: $ref: '#/components/schemas/type_:EnvironmentTag' required: - id - created_at - name - tag title: EnvironmentResponse type_:UserResponse: description: Any type title: UserResponse type_:InputResponse: type: object properties: name: type: string description: Type of input. required: - name title: InputResponse type_:FilesToolType: type: string enum: - pinecone_search - google - mock - snippet - json_schema - get_api_call - python description: Type of tool. title: FilesToolType type_:EvaluatorAggregate: type: object properties: value: type: number format: double description: The aggregated value of the evaluator. evaluator_id: type: string description: ID of the evaluator. evaluator_version_id: type: string description: ID of the evaluator version. created_at: type: string format: date-time updated_at: type: string format: date-time required: - value - evaluator_id - evaluator_version_id - created_at - updated_at title: EvaluatorAggregate type_:ToolResponse: type: object properties: path: type: string description: >- Path of the Tool, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Tool. directory_id: type: string description: ID of the directory that the file is in on Humanloop. function: $ref: '#/components/schemas/type_:ToolFunction' description: >- Callable function specification of the Tool shown to the model for tool calling. source_code: type: string description: Code source of the Tool. setup_values: type: object additionalProperties: description: Any type description: >- Values needed to setup the Tool, defined in JSON Schema format: https://json-schema.org/ attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Tool. Helpful to separate Tool versions from each other with details on how they were created or used. tool_type: $ref: '#/components/schemas/type_:FilesToolType' description: Type of Tool. version_name: type: string description: >- Unique identifier for this Tool version. Each Tool can only have one version with a given name. version_description: type: string description: Description of the Version. name: type: string description: Name of the Tool, which is used as a unique identifier. description: type: string description: Description of the Tool. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Tool Version. If no query params provided, the default deployed Tool Version is returned. type: type: string enum: - tool environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Tool Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Tool. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Tool Version total_logs_count: type: integer description: The number of logs that have been generated across all Tool Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Prompt. Inputs correspond to any of the variables used within the Tool template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Tool that are used for monitoring logs. signature: type: string description: Signature of the Tool. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Tool Version. required: - path - id - name - version_id - created_at - updated_at - last_used_at - version_logs_count - total_logs_count - inputs description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: ToolResponse type_:DatapointResponseTargetValue: oneOf: - type: string - type: integer - type: number format: double - type: boolean - type: array items: description: Any type - type: object additionalProperties: description: Any type title: DatapointResponseTargetValue type_:DatapointResponse: type: object properties: inputs: type: object additionalProperties: type: string description: The inputs to the prompt template. messages: type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: List of chat messages to provide to the model. target: type: object additionalProperties: $ref: '#/components/schemas/type_:DatapointResponseTargetValue' description: >- Object with criteria necessary to evaluate generations with this Datapoint. This is passed in as an argument to Evaluators when used in an Evaluation. id: type: string description: Unique identifier for the Datapoint. Starts with `dp_`. required: - id title: DatapointResponse type_:DatasetResponse: type: object properties: path: type: string description: >- Path of the Dataset, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Dataset. Starts with `ds_`. directory_id: type: string description: ID of the directory that the file is in on Humanloop. name: type: string description: Name of the Dataset, which is used as a unique identifier. description: type: string description: Description of the Dataset. schema: type: object additionalProperties: description: Any type description: The JSON schema for the File. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Dataset Version. If no query params provided, the default deployed Dataset Version is returned. Starts with `dsv_`. type: type: string enum: - dataset environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Dataset Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Dataset. last_used_at: type: string format: date-time version_name: type: string description: >- Unique name for the Dataset version. Version names must be unique for a given Dataset. version_description: type: string description: Description of the version, e.g., the changes made in this version. datapoints_count: type: integer description: The number of Datapoints in this Dataset version. datapoints: type: array items: $ref: '#/components/schemas/type_:DatapointResponse' description: >- The list of Datapoints in this Dataset version. Only provided if explicitly requested. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Dataset. Helpful to separate Dataset versions from each other with details on how they were created or used. required: - path - id - name - version_id - created_at - updated_at - last_used_at - datapoints_count description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: DatasetResponse type_:EvaluatorArgumentsType: type: string enum: - target_free - target_required description: Enum representing the possible argument types of an evaluator. title: EvaluatorArgumentsType type_:EvaluatorReturnTypeEnum: type: string enum: - boolean - number - select - multi_select - text description: Enum representing the possible return types of an evaluator. title: EvaluatorReturnTypeEnum type_:Valence: type: string enum: - positive - negative - neutral description: An enumeration. title: Valence type_:EvaluatorJudgmentOptionResponse: type: object properties: name: type: string description: The name of the option. valence: $ref: '#/components/schemas/type_:Valence' description: Whether this option should be considered positive or negative. required: - name title: EvaluatorJudgmentOptionResponse type_:EvaluatorJudgmentNumberLimit: type: object properties: min: type: number format: double description: The minimum value that can be selected. max: type: number format: double description: The maximum value that can be selected. step: type: number format: double description: The step size for the number input. title: EvaluatorJudgmentNumberLimit type_:LlmEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:EvaluatorReturnTypeEnum' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: >- The options that can be applied as judgments. Only for Evaluators with `return_type` of 'boolean', 'select' or 'multi_select'. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - llm prompt: $ref: '#/components/schemas/type_:PromptKernelRequest' description: The prompt parameters used to generate. required: - arguments_type - return_type - evaluator_type title: LlmEvaluatorRequest type_:CodeEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:EvaluatorReturnTypeEnum' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: >- The options that can be applied as judgments. Only for Evaluators with `return_type` of 'boolean', 'select' or 'multi_select'. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - python code: type: string description: >- The code for the Evaluator. This code will be executed in a sandboxed environment. required: - arguments_type - return_type - evaluator_type - code title: CodeEvaluatorRequest type_:HumanEvaluatorRequestReturnType: type: string enum: - select - multi_select - text - number - boolean description: The type of the return value of the Evaluator. title: HumanEvaluatorRequestReturnType type_:HumanEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:HumanEvaluatorRequestReturnType' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: The options that can be applied as judgments. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - human instructions: type: string description: Instructions and guidelines for applying judgments. required: - arguments_type - return_type - evaluator_type title: HumanEvaluatorRequest type_:ExternalEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:EvaluatorReturnTypeEnum' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: >- The options that can be applied as judgments. Only for Evaluators with `return_type` of 'boolean', 'select' or 'multi_select'. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - external required: - arguments_type - return_type - evaluator_type title: ExternalEvaluatorRequest type_:EvaluatorResponseSpec: oneOf: - $ref: '#/components/schemas/type_:LlmEvaluatorRequest' - $ref: '#/components/schemas/type_:CodeEvaluatorRequest' - $ref: '#/components/schemas/type_:HumanEvaluatorRequest' - $ref: '#/components/schemas/type_:ExternalEvaluatorRequest' title: EvaluatorResponseSpec type_:EvaluatorResponse: type: object properties: path: type: string description: >- Path of the Evaluator including the Evaluator name, which is used as a unique identifier. id: type: string description: Unique identifier for the Evaluator. directory_id: type: string description: ID of the directory that the file is in on Humanloop. version_name: type: string description: >- Unique name for the Evaluator version. Version names must be unique for a given Evaluator. version_description: type: string description: Description of the version, e.g., the changes made in this version. spec: $ref: '#/components/schemas/type_:EvaluatorResponseSpec' name: type: string description: Name of the Evaluator, which is used as a unique identifier. description: type: string description: Description of the Evaluator. schema: type: object additionalProperties: description: Any type description: The JSON schema for the File. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Evaluator Version. If no query params provided, the default deployed Evaluator Version is returned. type: type: string enum: - evaluator environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Evaluator Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Evaluator. last_used_at: type: string format: date-time version_logs_count: type: integer description: >- The number of logs that have been generated for this Evaluator Version total_logs_count: type: integer description: >- The number of logs that have been generated across all Evaluator Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Evaluator. Inputs correspond to any of the variables used within the Evaluator template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Evaluator that are used for monitoring logs. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Evaluator Version. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. required: - path - id - spec - name - version_id - created_at - updated_at - last_used_at - version_logs_count - total_logs_count - inputs description: Version of the Evaluator used to provide judgments. title: EvaluatorResponse type_:FlowResponse: type: object properties: path: type: string description: >- Path of the Flow, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Flow. directory_id: type: string description: ID of the directory that the file is in on Humanloop. attributes: type: object additionalProperties: description: Any type description: A key-value object identifying the Flow Version. version_name: type: string description: >- Unique name for the Flow version. Version names must be unique for a given Flow. version_description: type: string description: Description of the Version. name: type: string description: Name of the Flow. description: type: string description: Description of the Flow. schema: type: object additionalProperties: description: Any type description: The JSON schema for the File. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Flow Version. If no query params provided, the default deployed Flow Version is returned. type: type: string enum: - flow environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Flow Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Flow. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Flow Version evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Flow Version. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: The list of Monitoring Evaluators associated with the Flow Version. required: - path - id - attributes - name - version_id - created_at - updated_at - last_used_at - version_logs_count description: Response model for a Flow. title: FlowResponse type_:AgentResponseTemplate: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: >- 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}}`. title: AgentResponseTemplate type_:AgentResponseStop: oneOf: - type: string - type: array items: type: string description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. title: AgentResponseStop type_:AgentResponseReasoningEffort: oneOf: - $ref: '#/components/schemas/type_:OpenAiReasoningEffort' - type: integer description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. title: AgentResponseReasoningEffort type_:LinkedFileRequest: type: object properties: file_id: type: string environment_id: type: string version_id: type: string required: - file_id title: LinkedFileRequest type_:OnAgentCallEnum: type: string enum: - stop - continue description: What an Agent should do when calling a Tool. title: OnAgentCallEnum type_:AgentLinkedFileResponseFile: oneOf: - $ref: '#/components/schemas/type_:PromptResponse' - $ref: '#/components/schemas/type_:ToolResponse' - $ref: '#/components/schemas/type_:DatasetResponse' - $ref: '#/components/schemas/type_:EvaluatorResponse' - $ref: '#/components/schemas/type_:FlowResponse' - $ref: '#/components/schemas/type_:AgentResponse' title: AgentLinkedFileResponseFile type_:AgentLinkedFileResponse: type: object properties: type: type: string enum: - file link: $ref: '#/components/schemas/type_:LinkedFileRequest' on_agent_call: $ref: '#/components/schemas/type_:OnAgentCallEnum' file: $ref: '#/components/schemas/type_:AgentLinkedFileResponseFile' required: - type - link title: AgentLinkedFileResponse type_:AgentInlineTool: type: object properties: type: type: string enum: - inline json_schema: $ref: '#/components/schemas/type_:ToolFunction' on_agent_call: $ref: '#/components/schemas/type_:OnAgentCallEnum' required: - type - json_schema title: AgentInlineTool type_:AgentResponseToolsItem: oneOf: - $ref: '#/components/schemas/type_:AgentLinkedFileResponse' - $ref: '#/components/schemas/type_:AgentInlineTool' title: AgentResponseToolsItem type_:VersionStatus: type: string enum: - uncommitted - committed - deleted description: An enumeration. title: VersionStatus type_:AgentResponse: type: object properties: path: type: string description: >- Path of the Agent, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Agent. directory_id: type: string description: ID of the directory that the file is in on Humanloop. model: type: string description: >- The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models) endpoint: $ref: '#/components/schemas/type_:ModelEndpoints' description: The provider model endpoint used. template: $ref: '#/components/schemas/type_:AgentResponseTemplate' description: >- 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}}`. template_language: $ref: '#/components/schemas/type_:TemplateLanguage' description: The template language to use for rendering the template. provider: $ref: '#/components/schemas/type_:ModelProviders' description: The company providing the underlying model service. max_tokens: type: integer default: -1 description: >- 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 temperature: type: number format: double default: 1 description: >- What sampling temperature to use when making a generation. Higher values means the model will be more creative. top_p: type: number format: double default: 1 description: >- An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. stop: $ref: '#/components/schemas/type_:AgentResponseStop' description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. presence_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far. frequency_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far. other: type: object additionalProperties: description: Any type description: Other parameter values to be passed to the provider call. seed: type: integer description: >- If specified, model will make a best effort to sample deterministically, but it is not guaranteed. response_format: $ref: '#/components/schemas/type_:ResponseFormat' description: >- The format of the response. Only `{"type": "json_object"}` is currently supported for chat. reasoning_effort: $ref: '#/components/schemas/type_:AgentResponseReasoningEffort' description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. tools: type: array items: $ref: '#/components/schemas/type_:AgentResponseToolsItem' description: >- List of tools that the Agent can call. These can be linked files or inline tools. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used. max_iterations: type: integer description: >- The maximum number of iterations the Agent can run. This is used to limit the number of times the Agent model is called. version_name: type: string description: >- Unique name for the Agent version. Version names must be unique for a given Agent. version_description: type: string description: Description of the version, e.g., the changes made in this version. description: type: string description: Description of the Agent. tags: type: array items: type: string description: List of tags associated with the file. readme: type: string description: Long description of the file. name: type: string description: Name of the Agent. schema: type: object additionalProperties: description: Any type description: The JSON schema for the Prompt. version_id: type: string description: >- Unique identifier for the specific Agent Version. If no query params provided, the default deployed Agent Version is returned. type: type: string enum: - agent environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Agent Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Agent. committed_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who committed the Agent Version. committed_at: type: string format: date-time description: The date and time the Agent Version was committed. status: $ref: '#/components/schemas/type_:VersionStatus' description: The status of the Agent Version. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Agent Version total_logs_count: type: integer description: >- The number of logs that have been generated across all Agent Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Agent. Inputs correspond to any of the variables used within the Agent template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Agent that are used for monitoring logs. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Agent Version. raw_file_content: type: string description: The raw content of the Agent. Corresponds to the .agent file. required: - path - id - model - tools - name - version_id - created_at - updated_at - status - last_used_at - version_logs_count - total_logs_count - inputs description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: AgentResponse type_:VersionDeploymentResponseFile: oneOf: - $ref: '#/components/schemas/type_:PromptResponse' - $ref: '#/components/schemas/type_:ToolResponse' - $ref: '#/components/schemas/type_:DatasetResponse' - $ref: '#/components/schemas/type_:EvaluatorResponse' - $ref: '#/components/schemas/type_:FlowResponse' - $ref: '#/components/schemas/type_:AgentResponse' description: The File that the deployed Version belongs to. title: VersionDeploymentResponseFile type_:VersionDeploymentResponse: type: object properties: file: $ref: '#/components/schemas/type_:VersionDeploymentResponseFile' description: The File that the deployed Version belongs to. environment: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The Environment that the Version is deployed to. type: type: string enum: - environment required: - file - environment - type description: A variable reference to the Version deployed to an Environment title: VersionDeploymentResponse type_:VersionIdResponseVersion: oneOf: - $ref: '#/components/schemas/type_:PromptResponse' - $ref: '#/components/schemas/type_:ToolResponse' - $ref: '#/components/schemas/type_:DatasetResponse' - $ref: '#/components/schemas/type_:EvaluatorResponse' - $ref: '#/components/schemas/type_:FlowResponse' - $ref: '#/components/schemas/type_:AgentResponse' description: The specific Version being referenced. title: VersionIdResponseVersion type_:VersionIdResponse: type: object properties: version: $ref: '#/components/schemas/type_:VersionIdResponseVersion' description: The specific Version being referenced. type: type: string enum: - version required: - version - type description: A reference to a specific Version by its ID title: VersionIdResponse type_:VersionReferenceResponse: oneOf: - $ref: '#/components/schemas/type_:VersionDeploymentResponse' - $ref: '#/components/schemas/type_:VersionIdResponse' title: VersionReferenceResponse type_:MonitoringEvaluatorState: type: string enum: - active - inactive description: State of an evaluator connected to a file title: MonitoringEvaluatorState type_:MonitoringEvaluatorResponse: type: object properties: version_reference: $ref: '#/components/schemas/type_:VersionReferenceResponse' description: >- The Evaluator Version used for monitoring. This can be a specific Version by ID, or a Version deployed to an Environment. version: $ref: '#/components/schemas/type_:EvaluatorResponse' description: The deployed Version. state: $ref: '#/components/schemas/type_:MonitoringEvaluatorState' description: The state of the Monitoring Evaluator. Either `active` or `inactive` created_at: type: string format: date-time updated_at: type: string format: date-time required: - version_reference - state - created_at - updated_at title: MonitoringEvaluatorResponse type_:PromptResponse: type: object properties: path: type: string description: >- Path of the Prompt, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Prompt. directory_id: type: string description: ID of the directory that the file is in on Humanloop. model: type: string description: >- The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models) endpoint: $ref: '#/components/schemas/type_:ModelEndpoints' description: The provider model endpoint used. template: $ref: '#/components/schemas/type_:PromptResponseTemplate' description: >- 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}}`. template_language: $ref: '#/components/schemas/type_:TemplateLanguage' description: The template language to use for rendering the template. provider: $ref: '#/components/schemas/type_:ModelProviders' description: The company providing the underlying model service. max_tokens: type: integer default: -1 description: >- 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 temperature: type: number format: double default: 1 description: >- What sampling temperature to use when making a generation. Higher values means the model will be more creative. top_p: type: number format: double default: 1 description: >- An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. stop: $ref: '#/components/schemas/type_:PromptResponseStop' description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. presence_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far. frequency_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far. other: type: object additionalProperties: description: Any type description: Other parameter values to be passed to the provider call. seed: type: integer description: >- If specified, model will make a best effort to sample deterministically, but it is not guaranteed. response_format: $ref: '#/components/schemas/type_:ResponseFormat' description: >- The format of the response. Only `{"type": "json_object"}` is currently supported for chat. reasoning_effort: $ref: '#/components/schemas/type_:PromptResponseReasoningEffort' description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. tools: type: array items: $ref: '#/components/schemas/type_:ToolFunction' description: >- The tool specification that the model can choose to call if Tool calling is supported. linked_tools: type: array items: $ref: '#/components/schemas/type_:LinkedToolResponse' description: The tools linked to your prompt that the model can call. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used. version_name: type: string description: >- Unique name for the Prompt version. Version names must be unique for a given Prompt. version_description: type: string description: Description of the version, e.g., the changes made in this version. description: type: string description: Description of the Prompt. tags: type: array items: type: string description: List of tags associated with the file. readme: type: string description: Long description of the file. name: type: string description: Name of the Prompt. schema: type: object additionalProperties: description: Any type description: The JSON schema for the Prompt. version_id: type: string description: >- Unique identifier for the specific Prompt Version. If no query params provided, the default deployed Prompt Version is returned. type: type: string enum: - prompt environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Prompt Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Prompt. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Prompt Version total_logs_count: type: integer description: >- The number of logs that have been generated across all Prompt Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Prompt. Inputs correspond to any of the variables used within the Prompt template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Prompt that are used for monitoring logs. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Prompt Version. raw_file_content: type: string description: The raw content of the Prompt. Corresponds to the .prompt file. required: - path - id - model - name - version_id - created_at - updated_at - last_used_at - version_logs_count - total_logs_count - inputs description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: PromptResponse type_:PromptCallLogResponse: type: object properties: output: type: string description: >- Generated output from your model for the provided inputs. Can be `None` if logging an error, or if creating a parent Log with the intention to populate it later. created_at: type: string format: date-time description: 'User defined timestamp for when the log was created. ' error: type: string description: Error message if the log is an error. provider_latency: type: number format: double description: Duration of the logged event in seconds. stdout: type: string description: Captured log and debug statements. output_message: $ref: '#/components/schemas/type_:ChatMessage' description: The message returned by the provider. prompt_tokens: type: integer description: Number of tokens in the prompt used to generate the output. reasoning_tokens: type: integer description: Number of reasoning tokens used to generate the output. output_tokens: type: integer description: Number of tokens in the output generated by the model. prompt_cost: type: number format: double description: Cost in dollars associated to the tokens in the prompt. output_cost: type: number format: double description: Cost in dollars associated to the tokens in the output. finish_reason: type: string description: Reason the generation finished. index: type: integer description: The index of the sample in the batch. required: - index description: Sample specific response details for a Prompt call title: PromptCallLogResponse type_:PromptCallResponse: type: object properties: start_time: type: string format: date-time description: When the logged event started. end_time: type: string format: date-time description: When the logged event ended. messages: type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: The messages passed to the to provider chat endpoint. tool_choice: $ref: '#/components/schemas/type_:PromptCallResponseToolChoice' description: >- Controls how the model uses tools. The following options are supported: - `'none'` means the model will not call any tool and instead generates a message; this is the default when no tools are provided as part of the Prompt. - `'auto'` means the model can decide to call one or more of the provided tools; this is the default when tools are provided as part of the Prompt. - `'required'` means the model must call one or more of the provided tools. - `{'type': 'function', 'function': {name': }}` forces the model to use the named function. prompt: $ref: '#/components/schemas/type_:PromptResponse' description: Prompt used to generate the Log. inputs: type: object additionalProperties: description: Any type description: The inputs passed to the prompt template. source: type: string description: Identifies where the model was called from. metadata: type: object additionalProperties: description: Any type description: Any additional metadata to record. source_datapoint_id: type: string description: >- Unique identifier for the Datapoint that this Log is derived from. This can be used by Humanloop to associate Logs to Evaluations. If provided, Humanloop will automatically associate this Log to Evaluations that require a Log for this Datapoint-Version pair. trace_parent_id: type: string description: The ID of the parent Log to nest this Log under in a Trace. user: type: string description: End-user ID related to the Log. environment: type: string description: The name of the Environment the Log is associated to. save: type: boolean default: true description: Whether the request/response payloads will be stored on Humanloop. log_id: type: string description: >- This will identify a Log. If you don't provide a Log ID, Humanloop will generate one for you. id: type: string description: ID of the log. trace_id: type: string description: ID of the Trace containing the Prompt Call Log. logs: type: array items: $ref: '#/components/schemas/type_:PromptCallLogResponse' description: The logs generated by the Prompt call. required: - prompt - id - logs description: Response model for a Prompt call with potentially multiple log samples. title: PromptCallResponse type_:ValidationErrorLocItem: oneOf: - type: string - type: integer title: ValidationErrorLocItem type_:ValidationError: type: object properties: loc: type: array items: $ref: '#/components/schemas/type_:ValidationErrorLocItem' msg: type: string type: type: string required: - loc - msg - type title: ValidationError type_:HttpValidationError: type: object properties: detail: type: array items: $ref: '#/components/schemas/type_:ValidationError' title: HttpValidationError securitySchemes: default: type: apiKey in: header name: X-API-KEY ``` ## SDK Code Examples ```python Supplying Prompt with Tool import requests url = "https://api.humanloop.com/v5/prompts/call" payload = { "stream": False, "path": "persona", "messages": [ { "role": "user", "content": "latest apple" } ], "prompt": { "model": "gpt-4", "template": [ { "role": "system", "content": "You are stockbot. Return latest prices." } ], "tools": [ { "name": "get_stock_price", "description": "Get current stock price", "parameters": { "type": "object", "properties": { "ticker_symbol": { "type": "string", "name": "Ticker Symbol", "description": "Ticker symbol of the stock" } }, "required": [] } } ] } } headers = { "X-API-KEY": " ", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```typescript Supplying Prompt with Tool import { HumanloopClient } from "humanloop"; const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); await client.prompts.call({ path: "persona", prompt: { model: "gpt-4", template: [{ role: "system", content: "You are stockbot. Return latest prices." }], tools: [{ name: "get_stock_price", description: "Get current stock price", parameters: { "type": "object", "properties": { "ticker_symbol": { "type": "string", "name": "Ticker Symbol", "description": "Ticker symbol of the stock" } }, "required": [] } }] }, messages: [{ role: "user", content: "latest apple" }] }); ``` ```go Supplying Prompt with Tool package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/prompts/call" payload := strings.NewReader("{\n \"stream\": false,\n \"path\": \"persona\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"latest apple\"\n }\n ],\n \"prompt\": {\n \"model\": \"gpt-4\",\n \"template\": [\n {\n \"role\": \"system\",\n \"content\": \"You are stockbot. Return latest prices.\"\n }\n ],\n \"tools\": [\n {\n \"name\": \"get_stock_price\",\n \"description\": \"Get current stock price\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"ticker_symbol\": {\n \"type\": \"string\",\n \"name\": \"Ticker Symbol\",\n \"description\": \"Ticker symbol of the stock\"\n }\n },\n \"required\": []\n }\n }\n ]\n }\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("X-API-KEY", " ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Supplying Prompt with Tool require 'uri' require 'net/http' url = URI("https://api.humanloop.com/v5/prompts/call") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["X-API-KEY"] = ' ' request["Content-Type"] = 'application/json' request.body = "{\n \"stream\": false,\n \"path\": \"persona\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"latest apple\"\n }\n ],\n \"prompt\": {\n \"model\": \"gpt-4\",\n \"template\": [\n {\n \"role\": \"system\",\n \"content\": \"You are stockbot. Return latest prices.\"\n }\n ],\n \"tools\": [\n {\n \"name\": \"get_stock_price\",\n \"description\": \"Get current stock price\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"ticker_symbol\": {\n \"type\": \"string\",\n \"name\": \"Ticker Symbol\",\n \"description\": \"Ticker symbol of the stock\"\n }\n },\n \"required\": []\n }\n }\n ]\n }\n}" response = http.request(request) puts response.read_body ``` ```java Supplying Prompt with Tool import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.humanloop.com/v5/prompts/call") .header("X-API-KEY", " ") .header("Content-Type", "application/json") .body("{\n \"stream\": false,\n \"path\": \"persona\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"latest apple\"\n }\n ],\n \"prompt\": {\n \"model\": \"gpt-4\",\n \"template\": [\n {\n \"role\": \"system\",\n \"content\": \"You are stockbot. Return latest prices.\"\n }\n ],\n \"tools\": [\n {\n \"name\": \"get_stock_price\",\n \"description\": \"Get current stock price\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"ticker_symbol\": {\n \"type\": \"string\",\n \"name\": \"Ticker Symbol\",\n \"description\": \"Ticker symbol of the stock\"\n }\n },\n \"required\": []\n }\n }\n ]\n }\n}") .asString(); ``` ```php Supplying Prompt with Tool request('POST', 'https://api.humanloop.com/v5/prompts/call', [ 'body' => '{ "stream": false, "path": "persona", "messages": [ { "role": "user", "content": "latest apple" } ], "prompt": { "model": "gpt-4", "template": [ { "role": "system", "content": "You are stockbot. Return latest prices." } ], "tools": [ { "name": "get_stock_price", "description": "Get current stock price", "parameters": { "type": "object", "properties": { "ticker_symbol": { "type": "string", "name": "Ticker Symbol", "description": "Ticker symbol of the stock" } }, "required": [] } } ] } }', 'headers' => [ 'Content-Type' => 'application/json', 'X-API-KEY' => ' ', ], ]); echo $response->getBody(); ``` ```csharp Supplying Prompt with Tool using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/prompts/call"); var request = new RestRequest(Method.POST); request.AddHeader("X-API-KEY", " "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"stream\": false,\n \"path\": \"persona\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"latest apple\"\n }\n ],\n \"prompt\": {\n \"model\": \"gpt-4\",\n \"template\": [\n {\n \"role\": \"system\",\n \"content\": \"You are stockbot. Return latest prices.\"\n }\n ],\n \"tools\": [\n {\n \"name\": \"get_stock_price\",\n \"description\": \"Get current stock price\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"ticker_symbol\": {\n \"type\": \"string\",\n \"name\": \"Ticker Symbol\",\n \"description\": \"Ticker symbol of the stock\"\n }\n },\n \"required\": []\n }\n }\n ]\n }\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Supplying Prompt with Tool import Foundation let headers = [ "X-API-KEY": " ", "Content-Type": "application/json" ] let parameters = [ "stream": false, "path": "persona", "messages": [ [ "role": "user", "content": "latest apple" ] ], "prompt": [ "model": "gpt-4", "template": [ [ "role": "system", "content": "You are stockbot. Return latest prices." ] ], "tools": [ [ "name": "get_stock_price", "description": "Get current stock price", "parameters": [ "type": "object", "properties": ["ticker_symbol": [ "type": "string", "name": "Ticker Symbol", "description": "Ticker symbol of the stock" ]], "required": [] ] ] ] ] ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/prompts/call")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` ```python Supplying Prompt import requests url = "https://api.humanloop.com/v5/prompts/call" payload = { "stream": False, "path": "persona", "messages": [ { "role": "user", "content": "What really happened at Roswell?" } ], "prompt": { "model": "gpt-4", "template": [ { "role": "system", "content": "You are {{person}}. Answer any questions as this person. Do not break character." } ] }, "inputs": { "person": "Trump" } } headers = { "X-API-KEY": " ", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```typescript Supplying Prompt import { HumanloopClient } from "humanloop"; const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); await client.prompts.call({ path: "persona", prompt: { model: "gpt-4", template: [{ role: "system", content: "You are {{person}}. Answer any questions as this person. Do not break character." }] }, messages: [{ role: "user", content: "What really happened at Roswell?" }], inputs: { "person": "Trump" } }); ``` ```go Supplying Prompt package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/prompts/call" payload := strings.NewReader("{\n \"stream\": false,\n \"path\": \"persona\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What really happened at Roswell?\"\n }\n ],\n \"prompt\": {\n \"model\": \"gpt-4\",\n \"template\": [\n {\n \"role\": \"system\",\n \"content\": \"You are {{person}}. Answer any questions as this person. Do not break character.\"\n }\n ]\n },\n \"inputs\": {\n \"person\": \"Trump\"\n }\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("X-API-KEY", " ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Supplying Prompt require 'uri' require 'net/http' url = URI("https://api.humanloop.com/v5/prompts/call") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["X-API-KEY"] = ' ' request["Content-Type"] = 'application/json' request.body = "{\n \"stream\": false,\n \"path\": \"persona\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What really happened at Roswell?\"\n }\n ],\n \"prompt\": {\n \"model\": \"gpt-4\",\n \"template\": [\n {\n \"role\": \"system\",\n \"content\": \"You are {{person}}. Answer any questions as this person. Do not break character.\"\n }\n ]\n },\n \"inputs\": {\n \"person\": \"Trump\"\n }\n}" response = http.request(request) puts response.read_body ``` ```java Supplying Prompt import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.humanloop.com/v5/prompts/call") .header("X-API-KEY", " ") .header("Content-Type", "application/json") .body("{\n \"stream\": false,\n \"path\": \"persona\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What really happened at Roswell?\"\n }\n ],\n \"prompt\": {\n \"model\": \"gpt-4\",\n \"template\": [\n {\n \"role\": \"system\",\n \"content\": \"You are {{person}}. Answer any questions as this person. Do not break character.\"\n }\n ]\n },\n \"inputs\": {\n \"person\": \"Trump\"\n }\n}") .asString(); ``` ```php Supplying Prompt request('POST', 'https://api.humanloop.com/v5/prompts/call', [ 'body' => '{ "stream": false, "path": "persona", "messages": [ { "role": "user", "content": "What really happened at Roswell?" } ], "prompt": { "model": "gpt-4", "template": [ { "role": "system", "content": "You are {{person}}. Answer any questions as this person. Do not break character." } ] }, "inputs": { "person": "Trump" } }', 'headers' => [ 'Content-Type' => 'application/json', 'X-API-KEY' => ' ', ], ]); echo $response->getBody(); ``` ```csharp Supplying Prompt using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/prompts/call"); var request = new RestRequest(Method.POST); request.AddHeader("X-API-KEY", " "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"stream\": false,\n \"path\": \"persona\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What really happened at Roswell?\"\n }\n ],\n \"prompt\": {\n \"model\": \"gpt-4\",\n \"template\": [\n {\n \"role\": \"system\",\n \"content\": \"You are {{person}}. Answer any questions as this person. Do not break character.\"\n }\n ]\n },\n \"inputs\": {\n \"person\": \"Trump\"\n }\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Supplying Prompt import Foundation let headers = [ "X-API-KEY": " ", "Content-Type": "application/json" ] let parameters = [ "stream": false, "path": "persona", "messages": [ [ "role": "user", "content": "What really happened at Roswell?" ] ], "prompt": [ "model": "gpt-4", "template": [ [ "role": "system", "content": "You are {{person}}. Answer any questions as this person. Do not break character." ] ] ], "inputs": ["person": "Trump"] ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/prompts/call")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` ```python By ID import requests url = "https://api.humanloop.com/v5/prompts/call" querystring = {"version_id":"prv_Wu6zx1lAWJRqOyL8nWuZk"} payload = { "path": "persona", "messages": [ { "role": "user", "content": "What really happened at Roswell?" } ], "inputs": { "person": "Trump" } } headers = { "X-API-KEY": " ", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers, params=querystring) print(response.json()) ``` ```typescript By ID import { HumanloopClient } from "humanloop"; const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); await client.prompts.call({ versionId: "prv_Wu6zx1lAWJRqOyL8nWuZk", path: "persona", messages: [{ role: "user", content: "What really happened at Roswell?" }], inputs: { "person": "Trump" } }); ``` ```go By ID package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/prompts/call?version_id=prv_Wu6zx1lAWJRqOyL8nWuZk" payload := strings.NewReader("{\n \"path\": \"persona\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What really happened at Roswell?\"\n }\n ],\n \"inputs\": {\n \"person\": \"Trump\"\n }\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("X-API-KEY", " ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby By ID require 'uri' require 'net/http' url = URI("https://api.humanloop.com/v5/prompts/call?version_id=prv_Wu6zx1lAWJRqOyL8nWuZk") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["X-API-KEY"] = ' ' request["Content-Type"] = 'application/json' request.body = "{\n \"path\": \"persona\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What really happened at Roswell?\"\n }\n ],\n \"inputs\": {\n \"person\": \"Trump\"\n }\n}" response = http.request(request) puts response.read_body ``` ```java By ID import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.humanloop.com/v5/prompts/call?version_id=prv_Wu6zx1lAWJRqOyL8nWuZk") .header("X-API-KEY", " ") .header("Content-Type", "application/json") .body("{\n \"path\": \"persona\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What really happened at Roswell?\"\n }\n ],\n \"inputs\": {\n \"person\": \"Trump\"\n }\n}") .asString(); ``` ```php By ID request('POST', 'https://api.humanloop.com/v5/prompts/call?version_id=prv_Wu6zx1lAWJRqOyL8nWuZk', [ 'body' => '{ "path": "persona", "messages": [ { "role": "user", "content": "What really happened at Roswell?" } ], "inputs": { "person": "Trump" } }', 'headers' => [ 'Content-Type' => 'application/json', 'X-API-KEY' => ' ', ], ]); echo $response->getBody(); ``` ```csharp By ID using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/prompts/call?version_id=prv_Wu6zx1lAWJRqOyL8nWuZk"); var request = new RestRequest(Method.POST); request.AddHeader("X-API-KEY", " "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"path\": \"persona\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What really happened at Roswell?\"\n }\n ],\n \"inputs\": {\n \"person\": \"Trump\"\n }\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift By ID import Foundation let headers = [ "X-API-KEY": " ", "Content-Type": "application/json" ] let parameters = [ "path": "persona", "messages": [ [ "role": "user", "content": "What really happened at Roswell?" ] ], "inputs": ["person": "Trump"] ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/prompts/call?version_id=prv_Wu6zx1lAWJRqOyL8nWuZk")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. # List Prompts GET https://api.humanloop.com/v5/prompts Get a list of all Prompts. Reference: https://humanloop.com/docs/api/prompts/list ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /prompts: get: operationId: list summary: List Prompts description: Get a list of all Prompts. tags: - subpackage_prompts parameters: - name: page in: query description: Page number for pagination. required: false schema: type: integer default: 1 - name: size in: query description: Page size for pagination. Number of Prompts to fetch. required: false schema: type: integer default: 10 - name: name in: query description: Case-insensitive filter for Prompt name. required: false schema: type: string - name: user_filter in: query description: >- Case-insensitive filter for users in the Prompt. This filter matches against both email address and name of users. required: false schema: type: string - name: sort_by in: query description: Field to sort Prompts by required: false schema: $ref: '#/components/schemas/type_:FileSortBy' - name: order in: query description: Direction to sort by. required: false schema: $ref: '#/components/schemas/type_:SortOrder' - name: X-API-KEY in: header required: true schema: type: string responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/type_:PaginatedDataPromptResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/type_:HttpValidationError' servers: - url: https://api.humanloop.com/v5 components: schemas: type_:FileSortBy: type: string enum: - created_at - updated_at - name description: An enumeration. title: FileSortBy type_:SortOrder: type: string enum: - asc - desc description: An enumeration. title: SortOrder type_:ModelEndpoints: type: string enum: - complete - chat - edit description: Supported model provider endpoints. title: ModelEndpoints type_:TextChatContent: type: object properties: type: type: string enum: - text text: type: string description: The message's text content. required: - type - text title: TextChatContent type_:ImageUrlDetail: type: string enum: - high - low - auto description: >- Specify the detail level of the image provided to the model. For more details see: https://platform.openai.com/docs/guides/vision/low-or-high-fidelity-image-understanding title: ImageUrlDetail type_:ImageUrl: type: object properties: url: type: string description: Either a URL of the image or the base64 encoded image data. detail: $ref: '#/components/schemas/type_:ImageUrlDetail' description: >- Specify the detail level of the image provided to the model. For more details see: https://platform.openai.com/docs/guides/vision/low-or-high-fidelity-image-understanding required: - url title: ImageUrl type_:ImageChatContent: type: object properties: type: type: string enum: - image_url image_url: $ref: '#/components/schemas/type_:ImageUrl' description: The message's image content. required: - type - image_url title: ImageChatContent type_:ChatMessageContentItem: oneOf: - $ref: '#/components/schemas/type_:TextChatContent' - $ref: '#/components/schemas/type_:ImageChatContent' title: ChatMessageContentItem type_:ChatMessageContent: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessageContentItem' description: The content of the message. title: ChatMessageContent type_:ChatRole: type: string enum: - user - assistant - system - tool - developer description: An enumeration. title: ChatRole type_:ChatToolType: type: string enum: - function description: The type of tool to call. title: ChatToolType type_:FunctionTool: type: object properties: name: type: string arguments: type: string required: - name description: A function tool to be called by the model where user owns runtime. title: FunctionTool type_:ToolCall: type: object properties: id: type: string type: $ref: '#/components/schemas/type_:ChatToolType' function: $ref: '#/components/schemas/type_:FunctionTool' required: - id - type - function description: A tool call to be made. title: ToolCall type_:AnthropicThinkingContent: type: object properties: type: type: string enum: - thinking thinking: type: string description: Model's chain-of-thought for providing the response. signature: type: string description: >- Cryptographic signature that verifies the thinking block was generated by Anthropic. required: - type - thinking - signature title: AnthropicThinkingContent type_:AnthropicRedactedThinkingContent: type: object properties: type: type: string enum: - redacted_thinking data: type: string description: >- Thinking block Anthropic redacted for safety reasons. User is expected to pass the block back to Anthropic required: - type - data title: AnthropicRedactedThinkingContent type_:ChatMessageThinkingItem: oneOf: - $ref: '#/components/schemas/type_:AnthropicThinkingContent' - $ref: '#/components/schemas/type_:AnthropicRedactedThinkingContent' title: ChatMessageThinkingItem type_:ChatMessage: type: object properties: content: $ref: '#/components/schemas/type_:ChatMessageContent' description: The content of the message. name: type: string description: Optional name of the message author. tool_call_id: type: string description: Tool call that this message is responding to. role: $ref: '#/components/schemas/type_:ChatRole' description: Role of the message author. tool_calls: type: array items: $ref: '#/components/schemas/type_:ToolCall' description: A list of tool calls requested by the assistant. thinking: type: array items: $ref: '#/components/schemas/type_:ChatMessageThinkingItem' description: >- Model's chain-of-thought for providing the response. Present on assistant messages if model supports it. required: - role title: ChatMessage type_:PromptResponseTemplate: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: >- 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}}`. title: PromptResponseTemplate type_:TemplateLanguage: type: string enum: - default - jinja description: Template engine to use for rendering templates. title: TemplateLanguage type_:ModelProviders: type: string enum: - anthropic - bedrock - cohere - deepseek - google - groq - mock - openai - openai_azure - replicate description: Supported model providers. title: ModelProviders type_:PromptResponseStop: oneOf: - type: string - type: array items: type: string description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. title: PromptResponseStop type_:ResponseFormatType: type: string enum: - json_object - json_schema title: ResponseFormatType type_:ResponseFormat: type: object properties: type: $ref: '#/components/schemas/type_:ResponseFormatType' json_schema: type: object additionalProperties: description: Any type description: The JSON schema of the response format if type is json_schema. required: - type description: Response format of the model. title: ResponseFormat type_:OpenAiReasoningEffort: type: string enum: - high - medium - low description: Supported reasoning effort. title: OpenAiReasoningEffort type_:PromptResponseReasoningEffort: oneOf: - $ref: '#/components/schemas/type_:OpenAiReasoningEffort' - type: integer description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. title: PromptResponseReasoningEffort type_:ToolFunction: type: object properties: name: type: string description: Name for the tool referenced by the model. description: type: string description: Description of the tool referenced by the model strict: type: boolean default: false description: >- If true, forces the model to output json data in the structure of the parameters schema. parameters: type: object additionalProperties: description: Any type description: >- Parameters needed to run the Tool, defined in JSON Schema format: https://json-schema.org/ required: - name - description title: ToolFunction type_:LinkedToolResponse: type: object properties: name: type: string description: Name for the tool referenced by the model. description: type: string description: Description of the tool referenced by the model strict: type: boolean default: false description: >- If true, forces the model to output json data in the structure of the parameters schema. parameters: type: object additionalProperties: description: Any type description: >- Parameters needed to run the Tool, defined in JSON Schema format: https://json-schema.org/ id: type: string description: Unique identifier for the Tool linked. version_id: type: string description: Unique identifier for the Tool Version linked. required: - name - description - id - version_id title: LinkedToolResponse type_:EnvironmentTag: type: string enum: - default - other description: An enumeration. title: EnvironmentTag type_:EnvironmentResponse: type: object properties: id: type: string created_at: type: string format: date-time name: type: string tag: $ref: '#/components/schemas/type_:EnvironmentTag' required: - id - created_at - name - tag title: EnvironmentResponse type_:UserResponse: description: Any type title: UserResponse type_:InputResponse: type: object properties: name: type: string description: Type of input. required: - name title: InputResponse type_:FilesToolType: type: string enum: - pinecone_search - google - mock - snippet - json_schema - get_api_call - python description: Type of tool. title: FilesToolType type_:EvaluatorAggregate: type: object properties: value: type: number format: double description: The aggregated value of the evaluator. evaluator_id: type: string description: ID of the evaluator. evaluator_version_id: type: string description: ID of the evaluator version. created_at: type: string format: date-time updated_at: type: string format: date-time required: - value - evaluator_id - evaluator_version_id - created_at - updated_at title: EvaluatorAggregate type_:ToolResponse: type: object properties: path: type: string description: >- Path of the Tool, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Tool. directory_id: type: string description: ID of the directory that the file is in on Humanloop. function: $ref: '#/components/schemas/type_:ToolFunction' description: >- Callable function specification of the Tool shown to the model for tool calling. source_code: type: string description: Code source of the Tool. setup_values: type: object additionalProperties: description: Any type description: >- Values needed to setup the Tool, defined in JSON Schema format: https://json-schema.org/ attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Tool. Helpful to separate Tool versions from each other with details on how they were created or used. tool_type: $ref: '#/components/schemas/type_:FilesToolType' description: Type of Tool. version_name: type: string description: >- Unique identifier for this Tool version. Each Tool can only have one version with a given name. version_description: type: string description: Description of the Version. name: type: string description: Name of the Tool, which is used as a unique identifier. description: type: string description: Description of the Tool. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Tool Version. If no query params provided, the default deployed Tool Version is returned. type: type: string enum: - tool environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Tool Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Tool. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Tool Version total_logs_count: type: integer description: The number of logs that have been generated across all Tool Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Prompt. Inputs correspond to any of the variables used within the Tool template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Tool that are used for monitoring logs. signature: type: string description: Signature of the Tool. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Tool Version. required: - path - id - name - version_id - created_at - updated_at - last_used_at - version_logs_count - total_logs_count - inputs description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: ToolResponse type_:DatapointResponseTargetValue: oneOf: - type: string - type: integer - type: number format: double - type: boolean - type: array items: description: Any type - type: object additionalProperties: description: Any type title: DatapointResponseTargetValue type_:DatapointResponse: type: object properties: inputs: type: object additionalProperties: type: string description: The inputs to the prompt template. messages: type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: List of chat messages to provide to the model. target: type: object additionalProperties: $ref: '#/components/schemas/type_:DatapointResponseTargetValue' description: >- Object with criteria necessary to evaluate generations with this Datapoint. This is passed in as an argument to Evaluators when used in an Evaluation. id: type: string description: Unique identifier for the Datapoint. Starts with `dp_`. required: - id title: DatapointResponse type_:DatasetResponse: type: object properties: path: type: string description: >- Path of the Dataset, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Dataset. Starts with `ds_`. directory_id: type: string description: ID of the directory that the file is in on Humanloop. name: type: string description: Name of the Dataset, which is used as a unique identifier. description: type: string description: Description of the Dataset. schema: type: object additionalProperties: description: Any type description: The JSON schema for the File. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Dataset Version. If no query params provided, the default deployed Dataset Version is returned. Starts with `dsv_`. type: type: string enum: - dataset environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Dataset Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Dataset. last_used_at: type: string format: date-time version_name: type: string description: >- Unique name for the Dataset version. Version names must be unique for a given Dataset. version_description: type: string description: Description of the version, e.g., the changes made in this version. datapoints_count: type: integer description: The number of Datapoints in this Dataset version. datapoints: type: array items: $ref: '#/components/schemas/type_:DatapointResponse' description: >- The list of Datapoints in this Dataset version. Only provided if explicitly requested. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Dataset. Helpful to separate Dataset versions from each other with details on how they were created or used. required: - path - id - name - version_id - created_at - updated_at - last_used_at - datapoints_count description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: DatasetResponse type_:EvaluatorArgumentsType: type: string enum: - target_free - target_required description: Enum representing the possible argument types of an evaluator. title: EvaluatorArgumentsType type_:EvaluatorReturnTypeEnum: type: string enum: - boolean - number - select - multi_select - text description: Enum representing the possible return types of an evaluator. title: EvaluatorReturnTypeEnum type_:Valence: type: string enum: - positive - negative - neutral description: An enumeration. title: Valence type_:EvaluatorJudgmentOptionResponse: type: object properties: name: type: string description: The name of the option. valence: $ref: '#/components/schemas/type_:Valence' description: Whether this option should be considered positive or negative. required: - name title: EvaluatorJudgmentOptionResponse type_:EvaluatorJudgmentNumberLimit: type: object properties: min: type: number format: double description: The minimum value that can be selected. max: type: number format: double description: The maximum value that can be selected. step: type: number format: double description: The step size for the number input. title: EvaluatorJudgmentNumberLimit type_:PromptKernelRequestTemplate: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: >- 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}}`. title: PromptKernelRequestTemplate type_:PromptKernelRequestStop: oneOf: - type: string - type: array items: type: string description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. title: PromptKernelRequestStop type_:PromptKernelRequestReasoningEffort: oneOf: - $ref: '#/components/schemas/type_:OpenAiReasoningEffort' - type: integer description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. title: PromptKernelRequestReasoningEffort type_:PromptKernelRequest: type: object properties: model: type: string description: >- The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models) endpoint: $ref: '#/components/schemas/type_:ModelEndpoints' description: The provider model endpoint used. template: $ref: '#/components/schemas/type_:PromptKernelRequestTemplate' description: >- 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}}`. template_language: $ref: '#/components/schemas/type_:TemplateLanguage' description: The template language to use for rendering the template. provider: $ref: '#/components/schemas/type_:ModelProviders' description: The company providing the underlying model service. max_tokens: type: integer default: -1 description: >- 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 temperature: type: number format: double default: 1 description: >- What sampling temperature to use when making a generation. Higher values means the model will be more creative. top_p: type: number format: double default: 1 description: >- An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. stop: $ref: '#/components/schemas/type_:PromptKernelRequestStop' description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. presence_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far. frequency_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far. other: type: object additionalProperties: description: Any type description: Other parameter values to be passed to the provider call. seed: type: integer description: >- If specified, model will make a best effort to sample deterministically, but it is not guaranteed. response_format: $ref: '#/components/schemas/type_:ResponseFormat' description: >- The format of the response. Only `{"type": "json_object"}` is currently supported for chat. reasoning_effort: $ref: '#/components/schemas/type_:PromptKernelRequestReasoningEffort' description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. tools: type: array items: $ref: '#/components/schemas/type_:ToolFunction' description: >- The tool specification that the model can choose to call if Tool calling is supported. linked_tools: type: array items: type: string description: >- 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. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used. required: - model description: |- Base class used by both PromptKernelRequest and AgentKernelRequest. Contains the consistent Prompt-related fields. title: PromptKernelRequest type_:LlmEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:EvaluatorReturnTypeEnum' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: >- The options that can be applied as judgments. Only for Evaluators with `return_type` of 'boolean', 'select' or 'multi_select'. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - llm prompt: $ref: '#/components/schemas/type_:PromptKernelRequest' description: The prompt parameters used to generate. required: - arguments_type - return_type - evaluator_type title: LlmEvaluatorRequest type_:CodeEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:EvaluatorReturnTypeEnum' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: >- The options that can be applied as judgments. Only for Evaluators with `return_type` of 'boolean', 'select' or 'multi_select'. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - python code: type: string description: >- The code for the Evaluator. This code will be executed in a sandboxed environment. required: - arguments_type - return_type - evaluator_type - code title: CodeEvaluatorRequest type_:HumanEvaluatorRequestReturnType: type: string enum: - select - multi_select - text - number - boolean description: The type of the return value of the Evaluator. title: HumanEvaluatorRequestReturnType type_:HumanEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:HumanEvaluatorRequestReturnType' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: The options that can be applied as judgments. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - human instructions: type: string description: Instructions and guidelines for applying judgments. required: - arguments_type - return_type - evaluator_type title: HumanEvaluatorRequest type_:ExternalEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:EvaluatorReturnTypeEnum' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: >- The options that can be applied as judgments. Only for Evaluators with `return_type` of 'boolean', 'select' or 'multi_select'. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - external required: - arguments_type - return_type - evaluator_type title: ExternalEvaluatorRequest type_:EvaluatorResponseSpec: oneOf: - $ref: '#/components/schemas/type_:LlmEvaluatorRequest' - $ref: '#/components/schemas/type_:CodeEvaluatorRequest' - $ref: '#/components/schemas/type_:HumanEvaluatorRequest' - $ref: '#/components/schemas/type_:ExternalEvaluatorRequest' title: EvaluatorResponseSpec type_:EvaluatorResponse: type: object properties: path: type: string description: >- Path of the Evaluator including the Evaluator name, which is used as a unique identifier. id: type: string description: Unique identifier for the Evaluator. directory_id: type: string description: ID of the directory that the file is in on Humanloop. version_name: type: string description: >- Unique name for the Evaluator version. Version names must be unique for a given Evaluator. version_description: type: string description: Description of the version, e.g., the changes made in this version. spec: $ref: '#/components/schemas/type_:EvaluatorResponseSpec' name: type: string description: Name of the Evaluator, which is used as a unique identifier. description: type: string description: Description of the Evaluator. schema: type: object additionalProperties: description: Any type description: The JSON schema for the File. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Evaluator Version. If no query params provided, the default deployed Evaluator Version is returned. type: type: string enum: - evaluator environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Evaluator Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Evaluator. last_used_at: type: string format: date-time version_logs_count: type: integer description: >- The number of logs that have been generated for this Evaluator Version total_logs_count: type: integer description: >- The number of logs that have been generated across all Evaluator Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Evaluator. Inputs correspond to any of the variables used within the Evaluator template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Evaluator that are used for monitoring logs. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Evaluator Version. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. required: - path - id - spec - name - version_id - created_at - updated_at - last_used_at - version_logs_count - total_logs_count - inputs description: Version of the Evaluator used to provide judgments. title: EvaluatorResponse type_:FlowResponse: type: object properties: path: type: string description: >- Path of the Flow, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Flow. directory_id: type: string description: ID of the directory that the file is in on Humanloop. attributes: type: object additionalProperties: description: Any type description: A key-value object identifying the Flow Version. version_name: type: string description: >- Unique name for the Flow version. Version names must be unique for a given Flow. version_description: type: string description: Description of the Version. name: type: string description: Name of the Flow. description: type: string description: Description of the Flow. schema: type: object additionalProperties: description: Any type description: The JSON schema for the File. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Flow Version. If no query params provided, the default deployed Flow Version is returned. type: type: string enum: - flow environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Flow Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Flow. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Flow Version evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Flow Version. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: The list of Monitoring Evaluators associated with the Flow Version. required: - path - id - attributes - name - version_id - created_at - updated_at - last_used_at - version_logs_count description: Response model for a Flow. title: FlowResponse type_:AgentResponseTemplate: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: >- 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}}`. title: AgentResponseTemplate type_:AgentResponseStop: oneOf: - type: string - type: array items: type: string description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. title: AgentResponseStop type_:AgentResponseReasoningEffort: oneOf: - $ref: '#/components/schemas/type_:OpenAiReasoningEffort' - type: integer description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. title: AgentResponseReasoningEffort type_:LinkedFileRequest: type: object properties: file_id: type: string environment_id: type: string version_id: type: string required: - file_id title: LinkedFileRequest type_:OnAgentCallEnum: type: string enum: - stop - continue description: What an Agent should do when calling a Tool. title: OnAgentCallEnum type_:AgentLinkedFileResponseFile: oneOf: - $ref: '#/components/schemas/type_:PromptResponse' - $ref: '#/components/schemas/type_:ToolResponse' - $ref: '#/components/schemas/type_:DatasetResponse' - $ref: '#/components/schemas/type_:EvaluatorResponse' - $ref: '#/components/schemas/type_:FlowResponse' - $ref: '#/components/schemas/type_:AgentResponse' title: AgentLinkedFileResponseFile type_:AgentLinkedFileResponse: type: object properties: type: type: string enum: - file link: $ref: '#/components/schemas/type_:LinkedFileRequest' on_agent_call: $ref: '#/components/schemas/type_:OnAgentCallEnum' file: $ref: '#/components/schemas/type_:AgentLinkedFileResponseFile' required: - type - link title: AgentLinkedFileResponse type_:AgentInlineTool: type: object properties: type: type: string enum: - inline json_schema: $ref: '#/components/schemas/type_:ToolFunction' on_agent_call: $ref: '#/components/schemas/type_:OnAgentCallEnum' required: - type - json_schema title: AgentInlineTool type_:AgentResponseToolsItem: oneOf: - $ref: '#/components/schemas/type_:AgentLinkedFileResponse' - $ref: '#/components/schemas/type_:AgentInlineTool' title: AgentResponseToolsItem type_:VersionStatus: type: string enum: - uncommitted - committed - deleted description: An enumeration. title: VersionStatus type_:AgentResponse: type: object properties: path: type: string description: >- Path of the Agent, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Agent. directory_id: type: string description: ID of the directory that the file is in on Humanloop. model: type: string description: >- The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models) endpoint: $ref: '#/components/schemas/type_:ModelEndpoints' description: The provider model endpoint used. template: $ref: '#/components/schemas/type_:AgentResponseTemplate' description: >- 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}}`. template_language: $ref: '#/components/schemas/type_:TemplateLanguage' description: The template language to use for rendering the template. provider: $ref: '#/components/schemas/type_:ModelProviders' description: The company providing the underlying model service. max_tokens: type: integer default: -1 description: >- 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 temperature: type: number format: double default: 1 description: >- What sampling temperature to use when making a generation. Higher values means the model will be more creative. top_p: type: number format: double default: 1 description: >- An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. stop: $ref: '#/components/schemas/type_:AgentResponseStop' description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. presence_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far. frequency_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far. other: type: object additionalProperties: description: Any type description: Other parameter values to be passed to the provider call. seed: type: integer description: >- If specified, model will make a best effort to sample deterministically, but it is not guaranteed. response_format: $ref: '#/components/schemas/type_:ResponseFormat' description: >- The format of the response. Only `{"type": "json_object"}` is currently supported for chat. reasoning_effort: $ref: '#/components/schemas/type_:AgentResponseReasoningEffort' description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. tools: type: array items: $ref: '#/components/schemas/type_:AgentResponseToolsItem' description: >- List of tools that the Agent can call. These can be linked files or inline tools. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used. max_iterations: type: integer description: >- The maximum number of iterations the Agent can run. This is used to limit the number of times the Agent model is called. version_name: type: string description: >- Unique name for the Agent version. Version names must be unique for a given Agent. version_description: type: string description: Description of the version, e.g., the changes made in this version. description: type: string description: Description of the Agent. tags: type: array items: type: string description: List of tags associated with the file. readme: type: string description: Long description of the file. name: type: string description: Name of the Agent. schema: type: object additionalProperties: description: Any type description: The JSON schema for the Prompt. version_id: type: string description: >- Unique identifier for the specific Agent Version. If no query params provided, the default deployed Agent Version is returned. type: type: string enum: - agent environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Agent Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Agent. committed_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who committed the Agent Version. committed_at: type: string format: date-time description: The date and time the Agent Version was committed. status: $ref: '#/components/schemas/type_:VersionStatus' description: The status of the Agent Version. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Agent Version total_logs_count: type: integer description: >- The number of logs that have been generated across all Agent Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Agent. Inputs correspond to any of the variables used within the Agent template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Agent that are used for monitoring logs. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Agent Version. raw_file_content: type: string description: The raw content of the Agent. Corresponds to the .agent file. required: - path - id - model - tools - name - version_id - created_at - updated_at - status - last_used_at - version_logs_count - total_logs_count - inputs description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: AgentResponse type_:VersionDeploymentResponseFile: oneOf: - $ref: '#/components/schemas/type_:PromptResponse' - $ref: '#/components/schemas/type_:ToolResponse' - $ref: '#/components/schemas/type_:DatasetResponse' - $ref: '#/components/schemas/type_:EvaluatorResponse' - $ref: '#/components/schemas/type_:FlowResponse' - $ref: '#/components/schemas/type_:AgentResponse' description: The File that the deployed Version belongs to. title: VersionDeploymentResponseFile type_:VersionDeploymentResponse: type: object properties: file: $ref: '#/components/schemas/type_:VersionDeploymentResponseFile' description: The File that the deployed Version belongs to. environment: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The Environment that the Version is deployed to. type: type: string enum: - environment required: - file - environment - type description: A variable reference to the Version deployed to an Environment title: VersionDeploymentResponse type_:VersionIdResponseVersion: oneOf: - $ref: '#/components/schemas/type_:PromptResponse' - $ref: '#/components/schemas/type_:ToolResponse' - $ref: '#/components/schemas/type_:DatasetResponse' - $ref: '#/components/schemas/type_:EvaluatorResponse' - $ref: '#/components/schemas/type_:FlowResponse' - $ref: '#/components/schemas/type_:AgentResponse' description: The specific Version being referenced. title: VersionIdResponseVersion type_:VersionIdResponse: type: object properties: version: $ref: '#/components/schemas/type_:VersionIdResponseVersion' description: The specific Version being referenced. type: type: string enum: - version required: - version - type description: A reference to a specific Version by its ID title: VersionIdResponse type_:VersionReferenceResponse: oneOf: - $ref: '#/components/schemas/type_:VersionDeploymentResponse' - $ref: '#/components/schemas/type_:VersionIdResponse' title: VersionReferenceResponse type_:MonitoringEvaluatorState: type: string enum: - active - inactive description: State of an evaluator connected to a file title: MonitoringEvaluatorState type_:MonitoringEvaluatorResponse: type: object properties: version_reference: $ref: '#/components/schemas/type_:VersionReferenceResponse' description: >- The Evaluator Version used for monitoring. This can be a specific Version by ID, or a Version deployed to an Environment. version: $ref: '#/components/schemas/type_:EvaluatorResponse' description: The deployed Version. state: $ref: '#/components/schemas/type_:MonitoringEvaluatorState' description: The state of the Monitoring Evaluator. Either `active` or `inactive` created_at: type: string format: date-time updated_at: type: string format: date-time required: - version_reference - state - created_at - updated_at title: MonitoringEvaluatorResponse type_:PromptResponse: type: object properties: path: type: string description: >- Path of the Prompt, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Prompt. directory_id: type: string description: ID of the directory that the file is in on Humanloop. model: type: string description: >- The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models) endpoint: $ref: '#/components/schemas/type_:ModelEndpoints' description: The provider model endpoint used. template: $ref: '#/components/schemas/type_:PromptResponseTemplate' description: >- 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}}`. template_language: $ref: '#/components/schemas/type_:TemplateLanguage' description: The template language to use for rendering the template. provider: $ref: '#/components/schemas/type_:ModelProviders' description: The company providing the underlying model service. max_tokens: type: integer default: -1 description: >- 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 temperature: type: number format: double default: 1 description: >- What sampling temperature to use when making a generation. Higher values means the model will be more creative. top_p: type: number format: double default: 1 description: >- An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. stop: $ref: '#/components/schemas/type_:PromptResponseStop' description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. presence_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far. frequency_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far. other: type: object additionalProperties: description: Any type description: Other parameter values to be passed to the provider call. seed: type: integer description: >- If specified, model will make a best effort to sample deterministically, but it is not guaranteed. response_format: $ref: '#/components/schemas/type_:ResponseFormat' description: >- The format of the response. Only `{"type": "json_object"}` is currently supported for chat. reasoning_effort: $ref: '#/components/schemas/type_:PromptResponseReasoningEffort' description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. tools: type: array items: $ref: '#/components/schemas/type_:ToolFunction' description: >- The tool specification that the model can choose to call if Tool calling is supported. linked_tools: type: array items: $ref: '#/components/schemas/type_:LinkedToolResponse' description: The tools linked to your prompt that the model can call. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used. version_name: type: string description: >- Unique name for the Prompt version. Version names must be unique for a given Prompt. version_description: type: string description: Description of the version, e.g., the changes made in this version. description: type: string description: Description of the Prompt. tags: type: array items: type: string description: List of tags associated with the file. readme: type: string description: Long description of the file. name: type: string description: Name of the Prompt. schema: type: object additionalProperties: description: Any type description: The JSON schema for the Prompt. version_id: type: string description: >- Unique identifier for the specific Prompt Version. If no query params provided, the default deployed Prompt Version is returned. type: type: string enum: - prompt environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Prompt Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Prompt. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Prompt Version total_logs_count: type: integer description: >- The number of logs that have been generated across all Prompt Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Prompt. Inputs correspond to any of the variables used within the Prompt template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Prompt that are used for monitoring logs. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Prompt Version. raw_file_content: type: string description: The raw content of the Prompt. Corresponds to the .prompt file. required: - path - id - model - name - version_id - created_at - updated_at - last_used_at - version_logs_count - total_logs_count - inputs description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: PromptResponse type_:PaginatedDataPromptResponse: type: object properties: records: type: array items: $ref: '#/components/schemas/type_:PromptResponse' page: type: integer size: type: integer total: type: integer required: - records - page - size - total title: PaginatedDataPromptResponse type_:ValidationErrorLocItem: oneOf: - type: string - type: integer title: ValidationErrorLocItem type_:ValidationError: type: object properties: loc: type: array items: $ref: '#/components/schemas/type_:ValidationErrorLocItem' msg: type: string type: type: string required: - loc - msg - type title: ValidationError type_:HttpValidationError: type: object properties: detail: type: array items: $ref: '#/components/schemas/type_:ValidationError' title: HttpValidationError securitySchemes: default: type: apiKey in: header name: X-API-KEY ``` ## SDK Code Examples ```python import requests url = "https://api.humanloop.com/v5/prompts" querystring = {"size":"1"} headers = {"X-API-KEY": " "} response = requests.get(url, headers=headers, params=querystring) print(response.json()) ``` ```typescript import { HumanloopClient } from "humanloop"; const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); const response = await client.prompts.list({ size: 1 }); for await (const item of response) { console.log(item); } // Or you can manually iterate page-by-page const page = await client.prompts.list({ size: 1 }); while (page.hasNextPage()) { page = page.getNextPage(); } ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/prompts?size=1" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("X-API-KEY", " ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://api.humanloop.com/v5/prompts?size=1") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["X-API-KEY"] = ' ' response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api.humanloop.com/v5/prompts?size=1") .header("X-API-KEY", " ") .asString(); ``` ```php request('GET', 'https://api.humanloop.com/v5/prompts?size=1', [ 'headers' => [ 'X-API-KEY' => ' ', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/prompts?size=1"); var request = new RestRequest(Method.GET); request.AddHeader("X-API-KEY", " "); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = ["X-API-KEY": " "] let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/prompts?size=1")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. # Upsert Prompt POST https://api.humanloop.com/v5/prompts Content-Type: application/json 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. You can provide `version_name` and `version_description` to identify and describe your versions. Version names must be unique within a Prompt - attempting to create a version with a name that already exists will result in a 409 Conflict error. Reference: https://humanloop.com/docs/api/prompts/upsert ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /prompts: post: operationId: upsert summary: Upsert Prompt description: >- 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. You can provide `version_name` and `version_description` to identify and describe your versions. Version names must be unique within a Prompt - attempting to create a version with a name that already exists will result in a 409 Conflict error. tags: - subpackage_prompts parameters: - name: X-API-KEY in: header required: true schema: type: string responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/type_:PromptResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/type_:HttpValidationError' requestBody: content: application/json: schema: type: object properties: path: type: string description: >- 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: type: string description: ID for an existing Prompt. model: type: string description: >- The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models) endpoint: $ref: '#/components/schemas/type_:ModelEndpoints' description: The provider model endpoint used. template: $ref: '#/components/schemas/type_prompts:PromptRequestTemplate' description: >- 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}}`. template_language: $ref: '#/components/schemas/type_:TemplateLanguage' description: The template language to use for rendering the template. provider: $ref: '#/components/schemas/type_:ModelProviders' description: The company providing the underlying model service. max_tokens: type: integer default: -1 description: >- 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 temperature: type: number format: double default: 1 description: >- What sampling temperature to use when making a generation. Higher values means the model will be more creative. top_p: type: number format: double default: 1 description: >- An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. stop: $ref: '#/components/schemas/type_prompts:PromptRequestStop' description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. presence_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far. frequency_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far. other: type: object additionalProperties: description: Any type description: Other parameter values to be passed to the provider call. seed: type: integer description: >- If specified, model will make a best effort to sample deterministically, but it is not guaranteed. response_format: $ref: '#/components/schemas/type_:ResponseFormat' description: >- The format of the response. Only `{"type": "json_object"}` is currently supported for chat. reasoning_effort: $ref: >- #/components/schemas/type_prompts:PromptRequestReasoningEffort description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. tools: type: array items: $ref: '#/components/schemas/type_:ToolFunction' description: >- The tool specification that the model can choose to call if Tool calling is supported. linked_tools: type: array items: type: string description: >- 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. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used. version_name: type: string description: >- Unique name for the Prompt version. Version names must be unique for a given Prompt. version_description: type: string description: >- Description of the version, e.g., the changes made in this version. description: type: string description: Description of the Prompt. tags: type: array items: type: string description: List of tags associated with this prompt. readme: type: string description: Long description of the Prompt. required: - model servers: - url: https://api.humanloop.com/v5 components: schemas: type_:ModelEndpoints: type: string enum: - complete - chat - edit description: Supported model provider endpoints. title: ModelEndpoints type_:TextChatContent: type: object properties: type: type: string enum: - text text: type: string description: The message's text content. required: - type - text title: TextChatContent type_:ImageUrlDetail: type: string enum: - high - low - auto description: >- Specify the detail level of the image provided to the model. For more details see: https://platform.openai.com/docs/guides/vision/low-or-high-fidelity-image-understanding title: ImageUrlDetail type_:ImageUrl: type: object properties: url: type: string description: Either a URL of the image or the base64 encoded image data. detail: $ref: '#/components/schemas/type_:ImageUrlDetail' description: >- Specify the detail level of the image provided to the model. For more details see: https://platform.openai.com/docs/guides/vision/low-or-high-fidelity-image-understanding required: - url title: ImageUrl type_:ImageChatContent: type: object properties: type: type: string enum: - image_url image_url: $ref: '#/components/schemas/type_:ImageUrl' description: The message's image content. required: - type - image_url title: ImageChatContent type_:ChatMessageContentItem: oneOf: - $ref: '#/components/schemas/type_:TextChatContent' - $ref: '#/components/schemas/type_:ImageChatContent' title: ChatMessageContentItem type_:ChatMessageContent: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessageContentItem' description: The content of the message. title: ChatMessageContent type_:ChatRole: type: string enum: - user - assistant - system - tool - developer description: An enumeration. title: ChatRole type_:ChatToolType: type: string enum: - function description: The type of tool to call. title: ChatToolType type_:FunctionTool: type: object properties: name: type: string arguments: type: string required: - name description: A function tool to be called by the model where user owns runtime. title: FunctionTool type_:ToolCall: type: object properties: id: type: string type: $ref: '#/components/schemas/type_:ChatToolType' function: $ref: '#/components/schemas/type_:FunctionTool' required: - id - type - function description: A tool call to be made. title: ToolCall type_:AnthropicThinkingContent: type: object properties: type: type: string enum: - thinking thinking: type: string description: Model's chain-of-thought for providing the response. signature: type: string description: >- Cryptographic signature that verifies the thinking block was generated by Anthropic. required: - type - thinking - signature title: AnthropicThinkingContent type_:AnthropicRedactedThinkingContent: type: object properties: type: type: string enum: - redacted_thinking data: type: string description: >- Thinking block Anthropic redacted for safety reasons. User is expected to pass the block back to Anthropic required: - type - data title: AnthropicRedactedThinkingContent type_:ChatMessageThinkingItem: oneOf: - $ref: '#/components/schemas/type_:AnthropicThinkingContent' - $ref: '#/components/schemas/type_:AnthropicRedactedThinkingContent' title: ChatMessageThinkingItem type_:ChatMessage: type: object properties: content: $ref: '#/components/schemas/type_:ChatMessageContent' description: The content of the message. name: type: string description: Optional name of the message author. tool_call_id: type: string description: Tool call that this message is responding to. role: $ref: '#/components/schemas/type_:ChatRole' description: Role of the message author. tool_calls: type: array items: $ref: '#/components/schemas/type_:ToolCall' description: A list of tool calls requested by the assistant. thinking: type: array items: $ref: '#/components/schemas/type_:ChatMessageThinkingItem' description: >- Model's chain-of-thought for providing the response. Present on assistant messages if model supports it. required: - role title: ChatMessage type_prompts:PromptRequestTemplate: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: >- 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}}`. title: PromptRequestTemplate type_:TemplateLanguage: type: string enum: - default - jinja description: Template engine to use for rendering templates. title: TemplateLanguage type_:ModelProviders: type: string enum: - anthropic - bedrock - cohere - deepseek - google - groq - mock - openai - openai_azure - replicate description: Supported model providers. title: ModelProviders type_prompts:PromptRequestStop: oneOf: - type: string - type: array items: type: string description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. title: PromptRequestStop type_:ResponseFormatType: type: string enum: - json_object - json_schema title: ResponseFormatType type_:ResponseFormat: type: object properties: type: $ref: '#/components/schemas/type_:ResponseFormatType' json_schema: type: object additionalProperties: description: Any type description: The JSON schema of the response format if type is json_schema. required: - type description: Response format of the model. title: ResponseFormat type_:OpenAiReasoningEffort: type: string enum: - high - medium - low description: Supported reasoning effort. title: OpenAiReasoningEffort type_prompts:PromptRequestReasoningEffort: oneOf: - $ref: '#/components/schemas/type_:OpenAiReasoningEffort' - type: integer description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. title: PromptRequestReasoningEffort type_:ToolFunction: type: object properties: name: type: string description: Name for the tool referenced by the model. description: type: string description: Description of the tool referenced by the model strict: type: boolean default: false description: >- If true, forces the model to output json data in the structure of the parameters schema. parameters: type: object additionalProperties: description: Any type description: >- Parameters needed to run the Tool, defined in JSON Schema format: https://json-schema.org/ required: - name - description title: ToolFunction type_:PromptResponseTemplate: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: >- 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}}`. title: PromptResponseTemplate type_:PromptResponseStop: oneOf: - type: string - type: array items: type: string description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. title: PromptResponseStop type_:PromptResponseReasoningEffort: oneOf: - $ref: '#/components/schemas/type_:OpenAiReasoningEffort' - type: integer description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. title: PromptResponseReasoningEffort type_:LinkedToolResponse: type: object properties: name: type: string description: Name for the tool referenced by the model. description: type: string description: Description of the tool referenced by the model strict: type: boolean default: false description: >- If true, forces the model to output json data in the structure of the parameters schema. parameters: type: object additionalProperties: description: Any type description: >- Parameters needed to run the Tool, defined in JSON Schema format: https://json-schema.org/ id: type: string description: Unique identifier for the Tool linked. version_id: type: string description: Unique identifier for the Tool Version linked. required: - name - description - id - version_id title: LinkedToolResponse type_:EnvironmentTag: type: string enum: - default - other description: An enumeration. title: EnvironmentTag type_:EnvironmentResponse: type: object properties: id: type: string created_at: type: string format: date-time name: type: string tag: $ref: '#/components/schemas/type_:EnvironmentTag' required: - id - created_at - name - tag title: EnvironmentResponse type_:UserResponse: description: Any type title: UserResponse type_:InputResponse: type: object properties: name: type: string description: Type of input. required: - name title: InputResponse type_:FilesToolType: type: string enum: - pinecone_search - google - mock - snippet - json_schema - get_api_call - python description: Type of tool. title: FilesToolType type_:EvaluatorAggregate: type: object properties: value: type: number format: double description: The aggregated value of the evaluator. evaluator_id: type: string description: ID of the evaluator. evaluator_version_id: type: string description: ID of the evaluator version. created_at: type: string format: date-time updated_at: type: string format: date-time required: - value - evaluator_id - evaluator_version_id - created_at - updated_at title: EvaluatorAggregate type_:ToolResponse: type: object properties: path: type: string description: >- Path of the Tool, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Tool. directory_id: type: string description: ID of the directory that the file is in on Humanloop. function: $ref: '#/components/schemas/type_:ToolFunction' description: >- Callable function specification of the Tool shown to the model for tool calling. source_code: type: string description: Code source of the Tool. setup_values: type: object additionalProperties: description: Any type description: >- Values needed to setup the Tool, defined in JSON Schema format: https://json-schema.org/ attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Tool. Helpful to separate Tool versions from each other with details on how they were created or used. tool_type: $ref: '#/components/schemas/type_:FilesToolType' description: Type of Tool. version_name: type: string description: >- Unique identifier for this Tool version. Each Tool can only have one version with a given name. version_description: type: string description: Description of the Version. name: type: string description: Name of the Tool, which is used as a unique identifier. description: type: string description: Description of the Tool. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Tool Version. If no query params provided, the default deployed Tool Version is returned. type: type: string enum: - tool environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Tool Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Tool. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Tool Version total_logs_count: type: integer description: The number of logs that have been generated across all Tool Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Prompt. Inputs correspond to any of the variables used within the Tool template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Tool that are used for monitoring logs. signature: type: string description: Signature of the Tool. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Tool Version. required: - path - id - name - version_id - created_at - updated_at - last_used_at - version_logs_count - total_logs_count - inputs description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: ToolResponse type_:DatapointResponseTargetValue: oneOf: - type: string - type: integer - type: number format: double - type: boolean - type: array items: description: Any type - type: object additionalProperties: description: Any type title: DatapointResponseTargetValue type_:DatapointResponse: type: object properties: inputs: type: object additionalProperties: type: string description: The inputs to the prompt template. messages: type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: List of chat messages to provide to the model. target: type: object additionalProperties: $ref: '#/components/schemas/type_:DatapointResponseTargetValue' description: >- Object with criteria necessary to evaluate generations with this Datapoint. This is passed in as an argument to Evaluators when used in an Evaluation. id: type: string description: Unique identifier for the Datapoint. Starts with `dp_`. required: - id title: DatapointResponse type_:DatasetResponse: type: object properties: path: type: string description: >- Path of the Dataset, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Dataset. Starts with `ds_`. directory_id: type: string description: ID of the directory that the file is in on Humanloop. name: type: string description: Name of the Dataset, which is used as a unique identifier. description: type: string description: Description of the Dataset. schema: type: object additionalProperties: description: Any type description: The JSON schema for the File. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Dataset Version. If no query params provided, the default deployed Dataset Version is returned. Starts with `dsv_`. type: type: string enum: - dataset environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Dataset Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Dataset. last_used_at: type: string format: date-time version_name: type: string description: >- Unique name for the Dataset version. Version names must be unique for a given Dataset. version_description: type: string description: Description of the version, e.g., the changes made in this version. datapoints_count: type: integer description: The number of Datapoints in this Dataset version. datapoints: type: array items: $ref: '#/components/schemas/type_:DatapointResponse' description: >- The list of Datapoints in this Dataset version. Only provided if explicitly requested. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Dataset. Helpful to separate Dataset versions from each other with details on how they were created or used. required: - path - id - name - version_id - created_at - updated_at - last_used_at - datapoints_count description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: DatasetResponse type_:EvaluatorArgumentsType: type: string enum: - target_free - target_required description: Enum representing the possible argument types of an evaluator. title: EvaluatorArgumentsType type_:EvaluatorReturnTypeEnum: type: string enum: - boolean - number - select - multi_select - text description: Enum representing the possible return types of an evaluator. title: EvaluatorReturnTypeEnum type_:Valence: type: string enum: - positive - negative - neutral description: An enumeration. title: Valence type_:EvaluatorJudgmentOptionResponse: type: object properties: name: type: string description: The name of the option. valence: $ref: '#/components/schemas/type_:Valence' description: Whether this option should be considered positive or negative. required: - name title: EvaluatorJudgmentOptionResponse type_:EvaluatorJudgmentNumberLimit: type: object properties: min: type: number format: double description: The minimum value that can be selected. max: type: number format: double description: The maximum value that can be selected. step: type: number format: double description: The step size for the number input. title: EvaluatorJudgmentNumberLimit type_:PromptKernelRequestTemplate: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: >- 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}}`. title: PromptKernelRequestTemplate type_:PromptKernelRequestStop: oneOf: - type: string - type: array items: type: string description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. title: PromptKernelRequestStop type_:PromptKernelRequestReasoningEffort: oneOf: - $ref: '#/components/schemas/type_:OpenAiReasoningEffort' - type: integer description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. title: PromptKernelRequestReasoningEffort type_:PromptKernelRequest: type: object properties: model: type: string description: >- The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models) endpoint: $ref: '#/components/schemas/type_:ModelEndpoints' description: The provider model endpoint used. template: $ref: '#/components/schemas/type_:PromptKernelRequestTemplate' description: >- 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}}`. template_language: $ref: '#/components/schemas/type_:TemplateLanguage' description: The template language to use for rendering the template. provider: $ref: '#/components/schemas/type_:ModelProviders' description: The company providing the underlying model service. max_tokens: type: integer default: -1 description: >- 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 temperature: type: number format: double default: 1 description: >- What sampling temperature to use when making a generation. Higher values means the model will be more creative. top_p: type: number format: double default: 1 description: >- An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. stop: $ref: '#/components/schemas/type_:PromptKernelRequestStop' description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. presence_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far. frequency_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far. other: type: object additionalProperties: description: Any type description: Other parameter values to be passed to the provider call. seed: type: integer description: >- If specified, model will make a best effort to sample deterministically, but it is not guaranteed. response_format: $ref: '#/components/schemas/type_:ResponseFormat' description: >- The format of the response. Only `{"type": "json_object"}` is currently supported for chat. reasoning_effort: $ref: '#/components/schemas/type_:PromptKernelRequestReasoningEffort' description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. tools: type: array items: $ref: '#/components/schemas/type_:ToolFunction' description: >- The tool specification that the model can choose to call if Tool calling is supported. linked_tools: type: array items: type: string description: >- 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. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used. required: - model description: |- Base class used by both PromptKernelRequest and AgentKernelRequest. Contains the consistent Prompt-related fields. title: PromptKernelRequest type_:LlmEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:EvaluatorReturnTypeEnum' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: >- The options that can be applied as judgments. Only for Evaluators with `return_type` of 'boolean', 'select' or 'multi_select'. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - llm prompt: $ref: '#/components/schemas/type_:PromptKernelRequest' description: The prompt parameters used to generate. required: - arguments_type - return_type - evaluator_type title: LlmEvaluatorRequest type_:CodeEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:EvaluatorReturnTypeEnum' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: >- The options that can be applied as judgments. Only for Evaluators with `return_type` of 'boolean', 'select' or 'multi_select'. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - python code: type: string description: >- The code for the Evaluator. This code will be executed in a sandboxed environment. required: - arguments_type - return_type - evaluator_type - code title: CodeEvaluatorRequest type_:HumanEvaluatorRequestReturnType: type: string enum: - select - multi_select - text - number - boolean description: The type of the return value of the Evaluator. title: HumanEvaluatorRequestReturnType type_:HumanEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:HumanEvaluatorRequestReturnType' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: The options that can be applied as judgments. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - human instructions: type: string description: Instructions and guidelines for applying judgments. required: - arguments_type - return_type - evaluator_type title: HumanEvaluatorRequest type_:ExternalEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:EvaluatorReturnTypeEnum' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: >- The options that can be applied as judgments. Only for Evaluators with `return_type` of 'boolean', 'select' or 'multi_select'. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - external required: - arguments_type - return_type - evaluator_type title: ExternalEvaluatorRequest type_:EvaluatorResponseSpec: oneOf: - $ref: '#/components/schemas/type_:LlmEvaluatorRequest' - $ref: '#/components/schemas/type_:CodeEvaluatorRequest' - $ref: '#/components/schemas/type_:HumanEvaluatorRequest' - $ref: '#/components/schemas/type_:ExternalEvaluatorRequest' title: EvaluatorResponseSpec type_:EvaluatorResponse: type: object properties: path: type: string description: >- Path of the Evaluator including the Evaluator name, which is used as a unique identifier. id: type: string description: Unique identifier for the Evaluator. directory_id: type: string description: ID of the directory that the file is in on Humanloop. version_name: type: string description: >- Unique name for the Evaluator version. Version names must be unique for a given Evaluator. version_description: type: string description: Description of the version, e.g., the changes made in this version. spec: $ref: '#/components/schemas/type_:EvaluatorResponseSpec' name: type: string description: Name of the Evaluator, which is used as a unique identifier. description: type: string description: Description of the Evaluator. schema: type: object additionalProperties: description: Any type description: The JSON schema for the File. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Evaluator Version. If no query params provided, the default deployed Evaluator Version is returned. type: type: string enum: - evaluator environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Evaluator Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Evaluator. last_used_at: type: string format: date-time version_logs_count: type: integer description: >- The number of logs that have been generated for this Evaluator Version total_logs_count: type: integer description: >- The number of logs that have been generated across all Evaluator Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Evaluator. Inputs correspond to any of the variables used within the Evaluator template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Evaluator that are used for monitoring logs. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Evaluator Version. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. required: - path - id - spec - name - version_id - created_at - updated_at - last_used_at - version_logs_count - total_logs_count - inputs description: Version of the Evaluator used to provide judgments. title: EvaluatorResponse type_:FlowResponse: type: object properties: path: type: string description: >- Path of the Flow, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Flow. directory_id: type: string description: ID of the directory that the file is in on Humanloop. attributes: type: object additionalProperties: description: Any type description: A key-value object identifying the Flow Version. version_name: type: string description: >- Unique name for the Flow version. Version names must be unique for a given Flow. version_description: type: string description: Description of the Version. name: type: string description: Name of the Flow. description: type: string description: Description of the Flow. schema: type: object additionalProperties: description: Any type description: The JSON schema for the File. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Flow Version. If no query params provided, the default deployed Flow Version is returned. type: type: string enum: - flow environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Flow Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Flow. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Flow Version evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Flow Version. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: The list of Monitoring Evaluators associated with the Flow Version. required: - path - id - attributes - name - version_id - created_at - updated_at - last_used_at - version_logs_count description: Response model for a Flow. title: FlowResponse type_:AgentResponseTemplate: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: >- 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}}`. title: AgentResponseTemplate type_:AgentResponseStop: oneOf: - type: string - type: array items: type: string description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. title: AgentResponseStop type_:AgentResponseReasoningEffort: oneOf: - $ref: '#/components/schemas/type_:OpenAiReasoningEffort' - type: integer description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. title: AgentResponseReasoningEffort type_:LinkedFileRequest: type: object properties: file_id: type: string environment_id: type: string version_id: type: string required: - file_id title: LinkedFileRequest type_:OnAgentCallEnum: type: string enum: - stop - continue description: What an Agent should do when calling a Tool. title: OnAgentCallEnum type_:AgentLinkedFileResponseFile: oneOf: - $ref: '#/components/schemas/type_:PromptResponse' - $ref: '#/components/schemas/type_:ToolResponse' - $ref: '#/components/schemas/type_:DatasetResponse' - $ref: '#/components/schemas/type_:EvaluatorResponse' - $ref: '#/components/schemas/type_:FlowResponse' - $ref: '#/components/schemas/type_:AgentResponse' title: AgentLinkedFileResponseFile type_:AgentLinkedFileResponse: type: object properties: type: type: string enum: - file link: $ref: '#/components/schemas/type_:LinkedFileRequest' on_agent_call: $ref: '#/components/schemas/type_:OnAgentCallEnum' file: $ref: '#/components/schemas/type_:AgentLinkedFileResponseFile' required: - type - link title: AgentLinkedFileResponse type_:AgentInlineTool: type: object properties: type: type: string enum: - inline json_schema: $ref: '#/components/schemas/type_:ToolFunction' on_agent_call: $ref: '#/components/schemas/type_:OnAgentCallEnum' required: - type - json_schema title: AgentInlineTool type_:AgentResponseToolsItem: oneOf: - $ref: '#/components/schemas/type_:AgentLinkedFileResponse' - $ref: '#/components/schemas/type_:AgentInlineTool' title: AgentResponseToolsItem type_:VersionStatus: type: string enum: - uncommitted - committed - deleted description: An enumeration. title: VersionStatus type_:AgentResponse: type: object properties: path: type: string description: >- Path of the Agent, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Agent. directory_id: type: string description: ID of the directory that the file is in on Humanloop. model: type: string description: >- The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models) endpoint: $ref: '#/components/schemas/type_:ModelEndpoints' description: The provider model endpoint used. template: $ref: '#/components/schemas/type_:AgentResponseTemplate' description: >- 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}}`. template_language: $ref: '#/components/schemas/type_:TemplateLanguage' description: The template language to use for rendering the template. provider: $ref: '#/components/schemas/type_:ModelProviders' description: The company providing the underlying model service. max_tokens: type: integer default: -1 description: >- 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 temperature: type: number format: double default: 1 description: >- What sampling temperature to use when making a generation. Higher values means the model will be more creative. top_p: type: number format: double default: 1 description: >- An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. stop: $ref: '#/components/schemas/type_:AgentResponseStop' description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. presence_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far. frequency_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far. other: type: object additionalProperties: description: Any type description: Other parameter values to be passed to the provider call. seed: type: integer description: >- If specified, model will make a best effort to sample deterministically, but it is not guaranteed. response_format: $ref: '#/components/schemas/type_:ResponseFormat' description: >- The format of the response. Only `{"type": "json_object"}` is currently supported for chat. reasoning_effort: $ref: '#/components/schemas/type_:AgentResponseReasoningEffort' description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. tools: type: array items: $ref: '#/components/schemas/type_:AgentResponseToolsItem' description: >- List of tools that the Agent can call. These can be linked files or inline tools. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used. max_iterations: type: integer description: >- The maximum number of iterations the Agent can run. This is used to limit the number of times the Agent model is called. version_name: type: string description: >- Unique name for the Agent version. Version names must be unique for a given Agent. version_description: type: string description: Description of the version, e.g., the changes made in this version. description: type: string description: Description of the Agent. tags: type: array items: type: string description: List of tags associated with the file. readme: type: string description: Long description of the file. name: type: string description: Name of the Agent. schema: type: object additionalProperties: description: Any type description: The JSON schema for the Prompt. version_id: type: string description: >- Unique identifier for the specific Agent Version. If no query params provided, the default deployed Agent Version is returned. type: type: string enum: - agent environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Agent Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Agent. committed_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who committed the Agent Version. committed_at: type: string format: date-time description: The date and time the Agent Version was committed. status: $ref: '#/components/schemas/type_:VersionStatus' description: The status of the Agent Version. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Agent Version total_logs_count: type: integer description: >- The number of logs that have been generated across all Agent Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Agent. Inputs correspond to any of the variables used within the Agent template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Agent that are used for monitoring logs. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Agent Version. raw_file_content: type: string description: The raw content of the Agent. Corresponds to the .agent file. required: - path - id - model - tools - name - version_id - created_at - updated_at - status - last_used_at - version_logs_count - total_logs_count - inputs description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: AgentResponse type_:VersionDeploymentResponseFile: oneOf: - $ref: '#/components/schemas/type_:PromptResponse' - $ref: '#/components/schemas/type_:ToolResponse' - $ref: '#/components/schemas/type_:DatasetResponse' - $ref: '#/components/schemas/type_:EvaluatorResponse' - $ref: '#/components/schemas/type_:FlowResponse' - $ref: '#/components/schemas/type_:AgentResponse' description: The File that the deployed Version belongs to. title: VersionDeploymentResponseFile type_:VersionDeploymentResponse: type: object properties: file: $ref: '#/components/schemas/type_:VersionDeploymentResponseFile' description: The File that the deployed Version belongs to. environment: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The Environment that the Version is deployed to. type: type: string enum: - environment required: - file - environment - type description: A variable reference to the Version deployed to an Environment title: VersionDeploymentResponse type_:VersionIdResponseVersion: oneOf: - $ref: '#/components/schemas/type_:PromptResponse' - $ref: '#/components/schemas/type_:ToolResponse' - $ref: '#/components/schemas/type_:DatasetResponse' - $ref: '#/components/schemas/type_:EvaluatorResponse' - $ref: '#/components/schemas/type_:FlowResponse' - $ref: '#/components/schemas/type_:AgentResponse' description: The specific Version being referenced. title: VersionIdResponseVersion type_:VersionIdResponse: type: object properties: version: $ref: '#/components/schemas/type_:VersionIdResponseVersion' description: The specific Version being referenced. type: type: string enum: - version required: - version - type description: A reference to a specific Version by its ID title: VersionIdResponse type_:VersionReferenceResponse: oneOf: - $ref: '#/components/schemas/type_:VersionDeploymentResponse' - $ref: '#/components/schemas/type_:VersionIdResponse' title: VersionReferenceResponse type_:MonitoringEvaluatorState: type: string enum: - active - inactive description: State of an evaluator connected to a file title: MonitoringEvaluatorState type_:MonitoringEvaluatorResponse: type: object properties: version_reference: $ref: '#/components/schemas/type_:VersionReferenceResponse' description: >- The Evaluator Version used for monitoring. This can be a specific Version by ID, or a Version deployed to an Environment. version: $ref: '#/components/schemas/type_:EvaluatorResponse' description: The deployed Version. state: $ref: '#/components/schemas/type_:MonitoringEvaluatorState' description: The state of the Monitoring Evaluator. Either `active` or `inactive` created_at: type: string format: date-time updated_at: type: string format: date-time required: - version_reference - state - created_at - updated_at title: MonitoringEvaluatorResponse type_:PromptResponse: type: object properties: path: type: string description: >- Path of the Prompt, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Prompt. directory_id: type: string description: ID of the directory that the file is in on Humanloop. model: type: string description: >- The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models) endpoint: $ref: '#/components/schemas/type_:ModelEndpoints' description: The provider model endpoint used. template: $ref: '#/components/schemas/type_:PromptResponseTemplate' description: >- 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}}`. template_language: $ref: '#/components/schemas/type_:TemplateLanguage' description: The template language to use for rendering the template. provider: $ref: '#/components/schemas/type_:ModelProviders' description: The company providing the underlying model service. max_tokens: type: integer default: -1 description: >- 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 temperature: type: number format: double default: 1 description: >- What sampling temperature to use when making a generation. Higher values means the model will be more creative. top_p: type: number format: double default: 1 description: >- An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. stop: $ref: '#/components/schemas/type_:PromptResponseStop' description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. presence_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far. frequency_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far. other: type: object additionalProperties: description: Any type description: Other parameter values to be passed to the provider call. seed: type: integer description: >- If specified, model will make a best effort to sample deterministically, but it is not guaranteed. response_format: $ref: '#/components/schemas/type_:ResponseFormat' description: >- The format of the response. Only `{"type": "json_object"}` is currently supported for chat. reasoning_effort: $ref: '#/components/schemas/type_:PromptResponseReasoningEffort' description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. tools: type: array items: $ref: '#/components/schemas/type_:ToolFunction' description: >- The tool specification that the model can choose to call if Tool calling is supported. linked_tools: type: array items: $ref: '#/components/schemas/type_:LinkedToolResponse' description: The tools linked to your prompt that the model can call. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used. version_name: type: string description: >- Unique name for the Prompt version. Version names must be unique for a given Prompt. version_description: type: string description: Description of the version, e.g., the changes made in this version. description: type: string description: Description of the Prompt. tags: type: array items: type: string description: List of tags associated with the file. readme: type: string description: Long description of the file. name: type: string description: Name of the Prompt. schema: type: object additionalProperties: description: Any type description: The JSON schema for the Prompt. version_id: type: string description: >- Unique identifier for the specific Prompt Version. If no query params provided, the default deployed Prompt Version is returned. type: type: string enum: - prompt environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Prompt Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Prompt. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Prompt Version total_logs_count: type: integer description: >- The number of logs that have been generated across all Prompt Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Prompt. Inputs correspond to any of the variables used within the Prompt template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Prompt that are used for monitoring logs. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Prompt Version. raw_file_content: type: string description: The raw content of the Prompt. Corresponds to the .prompt file. required: - path - id - model - name - version_id - created_at - updated_at - last_used_at - version_logs_count - total_logs_count - inputs description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: PromptResponse type_:ValidationErrorLocItem: oneOf: - type: string - type: integer title: ValidationErrorLocItem type_:ValidationError: type: object properties: loc: type: array items: $ref: '#/components/schemas/type_:ValidationErrorLocItem' msg: type: string type: type: string required: - loc - msg - type title: ValidationError type_:HttpValidationError: type: object properties: detail: type: array items: $ref: '#/components/schemas/type_:ValidationError' title: HttpValidationError securitySchemes: default: type: apiKey in: header name: X-API-KEY ``` ## SDK Code Examples ```python Upsert prompt import requests url = "https://api.humanloop.com/v5/prompts" payload = { "model": "gpt-4o", "path": "Personal Projects/Coding Assistant", "endpoint": "chat", "template": [ { "content": "You are a helpful coding assistant specialising in {{language}}", "role": "system" } ], "provider": "openai", "max_tokens": -1, "temperature": 0.7, "version_name": "coding-assistant-v1", "version_description": "Initial version" } headers = { "X-API-KEY": " ", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```typescript Upsert prompt import { HumanloopClient } from "humanloop"; const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); await client.prompts.upsert({ path: "Personal Projects/Coding Assistant", model: "gpt-4o", endpoint: "chat", template: [{ content: "You are a helpful coding assistant specialising in {{language}}", role: "system" }], provider: "openai", maxTokens: -1, temperature: 0.7, versionName: "coding-assistant-v1", versionDescription: "Initial version" }); ``` ```go Upsert prompt package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/prompts" payload := strings.NewReader("{\n \"model\": \"gpt-4o\",\n \"path\": \"Personal Projects/Coding Assistant\",\n \"endpoint\": \"chat\",\n \"template\": [\n {\n \"content\": \"You are a helpful coding assistant specialising in {{language}}\",\n \"role\": \"system\"\n }\n ],\n \"provider\": \"openai\",\n \"max_tokens\": -1,\n \"temperature\": 0.7,\n \"version_name\": \"coding-assistant-v1\",\n \"version_description\": \"Initial version\"\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("X-API-KEY", " ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Upsert prompt require 'uri' require 'net/http' url = URI("https://api.humanloop.com/v5/prompts") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["X-API-KEY"] = ' ' request["Content-Type"] = 'application/json' request.body = "{\n \"model\": \"gpt-4o\",\n \"path\": \"Personal Projects/Coding Assistant\",\n \"endpoint\": \"chat\",\n \"template\": [\n {\n \"content\": \"You are a helpful coding assistant specialising in {{language}}\",\n \"role\": \"system\"\n }\n ],\n \"provider\": \"openai\",\n \"max_tokens\": -1,\n \"temperature\": 0.7,\n \"version_name\": \"coding-assistant-v1\",\n \"version_description\": \"Initial version\"\n}" response = http.request(request) puts response.read_body ``` ```java Upsert prompt import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.humanloop.com/v5/prompts") .header("X-API-KEY", " ") .header("Content-Type", "application/json") .body("{\n \"model\": \"gpt-4o\",\n \"path\": \"Personal Projects/Coding Assistant\",\n \"endpoint\": \"chat\",\n \"template\": [\n {\n \"content\": \"You are a helpful coding assistant specialising in {{language}}\",\n \"role\": \"system\"\n }\n ],\n \"provider\": \"openai\",\n \"max_tokens\": -1,\n \"temperature\": 0.7,\n \"version_name\": \"coding-assistant-v1\",\n \"version_description\": \"Initial version\"\n}") .asString(); ``` ```php Upsert prompt request('POST', 'https://api.humanloop.com/v5/prompts', [ 'body' => '{ "model": "gpt-4o", "path": "Personal Projects/Coding Assistant", "endpoint": "chat", "template": [ { "content": "You are a helpful coding assistant specialising in {{language}}", "role": "system" } ], "provider": "openai", "max_tokens": -1, "temperature": 0.7, "version_name": "coding-assistant-v1", "version_description": "Initial version" }', 'headers' => [ 'Content-Type' => 'application/json', 'X-API-KEY' => ' ', ], ]); echo $response->getBody(); ``` ```csharp Upsert prompt using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/prompts"); var request = new RestRequest(Method.POST); request.AddHeader("X-API-KEY", " "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"model\": \"gpt-4o\",\n \"path\": \"Personal Projects/Coding Assistant\",\n \"endpoint\": \"chat\",\n \"template\": [\n {\n \"content\": \"You are a helpful coding assistant specialising in {{language}}\",\n \"role\": \"system\"\n }\n ],\n \"provider\": \"openai\",\n \"max_tokens\": -1,\n \"temperature\": 0.7,\n \"version_name\": \"coding-assistant-v1\",\n \"version_description\": \"Initial version\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Upsert prompt import Foundation let headers = [ "X-API-KEY": " ", "Content-Type": "application/json" ] let parameters = [ "model": "gpt-4o", "path": "Personal Projects/Coding Assistant", "endpoint": "chat", "template": [ [ "content": "You are a helpful coding assistant specialising in {{language}}", "role": "system" ] ], "provider": "openai", "max_tokens": -1, "temperature": 0.7, "version_name": "coding-assistant-v1", "version_description": "Initial version" ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/prompts")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. # Get Prompt GET https://api.humanloop.com/v5/prompts/{id} Retrieve the Prompt with the given ID. By default, the deployed version of the Prompt is returned. Use the query parameters `version_id` or `environment` to target a specific version of the Prompt. Reference: https://humanloop.com/docs/api/prompts/get ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /prompts/{id}: get: operationId: get summary: Get Prompt description: >- Retrieve the Prompt with the given ID. By default, the deployed version of the Prompt is returned. Use the query parameters `version_id` or `environment` to target a specific version of the Prompt. tags: - subpackage_prompts parameters: - name: id in: path description: Unique identifier for Prompt. required: true schema: type: string - name: version_id in: query description: A specific Version ID of the Prompt to retrieve. required: false schema: type: string - name: environment in: query description: Name of the Environment to retrieve a deployed Version from. required: false schema: type: string - name: X-API-KEY in: header required: true schema: type: string responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/type_:PromptResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/type_:HttpValidationError' servers: - url: https://api.humanloop.com/v5 components: schemas: type_:ModelEndpoints: type: string enum: - complete - chat - edit description: Supported model provider endpoints. title: ModelEndpoints type_:TextChatContent: type: object properties: type: type: string enum: - text text: type: string description: The message's text content. required: - type - text title: TextChatContent type_:ImageUrlDetail: type: string enum: - high - low - auto description: >- Specify the detail level of the image provided to the model. For more details see: https://platform.openai.com/docs/guides/vision/low-or-high-fidelity-image-understanding title: ImageUrlDetail type_:ImageUrl: type: object properties: url: type: string description: Either a URL of the image or the base64 encoded image data. detail: $ref: '#/components/schemas/type_:ImageUrlDetail' description: >- Specify the detail level of the image provided to the model. For more details see: https://platform.openai.com/docs/guides/vision/low-or-high-fidelity-image-understanding required: - url title: ImageUrl type_:ImageChatContent: type: object properties: type: type: string enum: - image_url image_url: $ref: '#/components/schemas/type_:ImageUrl' description: The message's image content. required: - type - image_url title: ImageChatContent type_:ChatMessageContentItem: oneOf: - $ref: '#/components/schemas/type_:TextChatContent' - $ref: '#/components/schemas/type_:ImageChatContent' title: ChatMessageContentItem type_:ChatMessageContent: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessageContentItem' description: The content of the message. title: ChatMessageContent type_:ChatRole: type: string enum: - user - assistant - system - tool - developer description: An enumeration. title: ChatRole type_:ChatToolType: type: string enum: - function description: The type of tool to call. title: ChatToolType type_:FunctionTool: type: object properties: name: type: string arguments: type: string required: - name description: A function tool to be called by the model where user owns runtime. title: FunctionTool type_:ToolCall: type: object properties: id: type: string type: $ref: '#/components/schemas/type_:ChatToolType' function: $ref: '#/components/schemas/type_:FunctionTool' required: - id - type - function description: A tool call to be made. title: ToolCall type_:AnthropicThinkingContent: type: object properties: type: type: string enum: - thinking thinking: type: string description: Model's chain-of-thought for providing the response. signature: type: string description: >- Cryptographic signature that verifies the thinking block was generated by Anthropic. required: - type - thinking - signature title: AnthropicThinkingContent type_:AnthropicRedactedThinkingContent: type: object properties: type: type: string enum: - redacted_thinking data: type: string description: >- Thinking block Anthropic redacted for safety reasons. User is expected to pass the block back to Anthropic required: - type - data title: AnthropicRedactedThinkingContent type_:ChatMessageThinkingItem: oneOf: - $ref: '#/components/schemas/type_:AnthropicThinkingContent' - $ref: '#/components/schemas/type_:AnthropicRedactedThinkingContent' title: ChatMessageThinkingItem type_:ChatMessage: type: object properties: content: $ref: '#/components/schemas/type_:ChatMessageContent' description: The content of the message. name: type: string description: Optional name of the message author. tool_call_id: type: string description: Tool call that this message is responding to. role: $ref: '#/components/schemas/type_:ChatRole' description: Role of the message author. tool_calls: type: array items: $ref: '#/components/schemas/type_:ToolCall' description: A list of tool calls requested by the assistant. thinking: type: array items: $ref: '#/components/schemas/type_:ChatMessageThinkingItem' description: >- Model's chain-of-thought for providing the response. Present on assistant messages if model supports it. required: - role title: ChatMessage type_:PromptResponseTemplate: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: >- 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}}`. title: PromptResponseTemplate type_:TemplateLanguage: type: string enum: - default - jinja description: Template engine to use for rendering templates. title: TemplateLanguage type_:ModelProviders: type: string enum: - anthropic - bedrock - cohere - deepseek - google - groq - mock - openai - openai_azure - replicate description: Supported model providers. title: ModelProviders type_:PromptResponseStop: oneOf: - type: string - type: array items: type: string description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. title: PromptResponseStop type_:ResponseFormatType: type: string enum: - json_object - json_schema title: ResponseFormatType type_:ResponseFormat: type: object properties: type: $ref: '#/components/schemas/type_:ResponseFormatType' json_schema: type: object additionalProperties: description: Any type description: The JSON schema of the response format if type is json_schema. required: - type description: Response format of the model. title: ResponseFormat type_:OpenAiReasoningEffort: type: string enum: - high - medium - low description: Supported reasoning effort. title: OpenAiReasoningEffort type_:PromptResponseReasoningEffort: oneOf: - $ref: '#/components/schemas/type_:OpenAiReasoningEffort' - type: integer description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. title: PromptResponseReasoningEffort type_:ToolFunction: type: object properties: name: type: string description: Name for the tool referenced by the model. description: type: string description: Description of the tool referenced by the model strict: type: boolean default: false description: >- If true, forces the model to output json data in the structure of the parameters schema. parameters: type: object additionalProperties: description: Any type description: >- Parameters needed to run the Tool, defined in JSON Schema format: https://json-schema.org/ required: - name - description title: ToolFunction type_:LinkedToolResponse: type: object properties: name: type: string description: Name for the tool referenced by the model. description: type: string description: Description of the tool referenced by the model strict: type: boolean default: false description: >- If true, forces the model to output json data in the structure of the parameters schema. parameters: type: object additionalProperties: description: Any type description: >- Parameters needed to run the Tool, defined in JSON Schema format: https://json-schema.org/ id: type: string description: Unique identifier for the Tool linked. version_id: type: string description: Unique identifier for the Tool Version linked. required: - name - description - id - version_id title: LinkedToolResponse type_:EnvironmentTag: type: string enum: - default - other description: An enumeration. title: EnvironmentTag type_:EnvironmentResponse: type: object properties: id: type: string created_at: type: string format: date-time name: type: string tag: $ref: '#/components/schemas/type_:EnvironmentTag' required: - id - created_at - name - tag title: EnvironmentResponse type_:UserResponse: description: Any type title: UserResponse type_:InputResponse: type: object properties: name: type: string description: Type of input. required: - name title: InputResponse type_:FilesToolType: type: string enum: - pinecone_search - google - mock - snippet - json_schema - get_api_call - python description: Type of tool. title: FilesToolType type_:EvaluatorAggregate: type: object properties: value: type: number format: double description: The aggregated value of the evaluator. evaluator_id: type: string description: ID of the evaluator. evaluator_version_id: type: string description: ID of the evaluator version. created_at: type: string format: date-time updated_at: type: string format: date-time required: - value - evaluator_id - evaluator_version_id - created_at - updated_at title: EvaluatorAggregate type_:ToolResponse: type: object properties: path: type: string description: >- Path of the Tool, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Tool. directory_id: type: string description: ID of the directory that the file is in on Humanloop. function: $ref: '#/components/schemas/type_:ToolFunction' description: >- Callable function specification of the Tool shown to the model for tool calling. source_code: type: string description: Code source of the Tool. setup_values: type: object additionalProperties: description: Any type description: >- Values needed to setup the Tool, defined in JSON Schema format: https://json-schema.org/ attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Tool. Helpful to separate Tool versions from each other with details on how they were created or used. tool_type: $ref: '#/components/schemas/type_:FilesToolType' description: Type of Tool. version_name: type: string description: >- Unique identifier for this Tool version. Each Tool can only have one version with a given name. version_description: type: string description: Description of the Version. name: type: string description: Name of the Tool, which is used as a unique identifier. description: type: string description: Description of the Tool. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Tool Version. If no query params provided, the default deployed Tool Version is returned. type: type: string enum: - tool environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Tool Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Tool. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Tool Version total_logs_count: type: integer description: The number of logs that have been generated across all Tool Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Prompt. Inputs correspond to any of the variables used within the Tool template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Tool that are used for monitoring logs. signature: type: string description: Signature of the Tool. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Tool Version. required: - path - id - name - version_id - created_at - updated_at - last_used_at - version_logs_count - total_logs_count - inputs description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: ToolResponse type_:DatapointResponseTargetValue: oneOf: - type: string - type: integer - type: number format: double - type: boolean - type: array items: description: Any type - type: object additionalProperties: description: Any type title: DatapointResponseTargetValue type_:DatapointResponse: type: object properties: inputs: type: object additionalProperties: type: string description: The inputs to the prompt template. messages: type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: List of chat messages to provide to the model. target: type: object additionalProperties: $ref: '#/components/schemas/type_:DatapointResponseTargetValue' description: >- Object with criteria necessary to evaluate generations with this Datapoint. This is passed in as an argument to Evaluators when used in an Evaluation. id: type: string description: Unique identifier for the Datapoint. Starts with `dp_`. required: - id title: DatapointResponse type_:DatasetResponse: type: object properties: path: type: string description: >- Path of the Dataset, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Dataset. Starts with `ds_`. directory_id: type: string description: ID of the directory that the file is in on Humanloop. name: type: string description: Name of the Dataset, which is used as a unique identifier. description: type: string description: Description of the Dataset. schema: type: object additionalProperties: description: Any type description: The JSON schema for the File. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Dataset Version. If no query params provided, the default deployed Dataset Version is returned. Starts with `dsv_`. type: type: string enum: - dataset environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Dataset Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Dataset. last_used_at: type: string format: date-time version_name: type: string description: >- Unique name for the Dataset version. Version names must be unique for a given Dataset. version_description: type: string description: Description of the version, e.g., the changes made in this version. datapoints_count: type: integer description: The number of Datapoints in this Dataset version. datapoints: type: array items: $ref: '#/components/schemas/type_:DatapointResponse' description: >- The list of Datapoints in this Dataset version. Only provided if explicitly requested. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Dataset. Helpful to separate Dataset versions from each other with details on how they were created or used. required: - path - id - name - version_id - created_at - updated_at - last_used_at - datapoints_count description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: DatasetResponse type_:EvaluatorArgumentsType: type: string enum: - target_free - target_required description: Enum representing the possible argument types of an evaluator. title: EvaluatorArgumentsType type_:EvaluatorReturnTypeEnum: type: string enum: - boolean - number - select - multi_select - text description: Enum representing the possible return types of an evaluator. title: EvaluatorReturnTypeEnum type_:Valence: type: string enum: - positive - negative - neutral description: An enumeration. title: Valence type_:EvaluatorJudgmentOptionResponse: type: object properties: name: type: string description: The name of the option. valence: $ref: '#/components/schemas/type_:Valence' description: Whether this option should be considered positive or negative. required: - name title: EvaluatorJudgmentOptionResponse type_:EvaluatorJudgmentNumberLimit: type: object properties: min: type: number format: double description: The minimum value that can be selected. max: type: number format: double description: The maximum value that can be selected. step: type: number format: double description: The step size for the number input. title: EvaluatorJudgmentNumberLimit type_:PromptKernelRequestTemplate: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: >- 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}}`. title: PromptKernelRequestTemplate type_:PromptKernelRequestStop: oneOf: - type: string - type: array items: type: string description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. title: PromptKernelRequestStop type_:PromptKernelRequestReasoningEffort: oneOf: - $ref: '#/components/schemas/type_:OpenAiReasoningEffort' - type: integer description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. title: PromptKernelRequestReasoningEffort type_:PromptKernelRequest: type: object properties: model: type: string description: >- The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models) endpoint: $ref: '#/components/schemas/type_:ModelEndpoints' description: The provider model endpoint used. template: $ref: '#/components/schemas/type_:PromptKernelRequestTemplate' description: >- 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}}`. template_language: $ref: '#/components/schemas/type_:TemplateLanguage' description: The template language to use for rendering the template. provider: $ref: '#/components/schemas/type_:ModelProviders' description: The company providing the underlying model service. max_tokens: type: integer default: -1 description: >- 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 temperature: type: number format: double default: 1 description: >- What sampling temperature to use when making a generation. Higher values means the model will be more creative. top_p: type: number format: double default: 1 description: >- An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. stop: $ref: '#/components/schemas/type_:PromptKernelRequestStop' description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. presence_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far. frequency_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far. other: type: object additionalProperties: description: Any type description: Other parameter values to be passed to the provider call. seed: type: integer description: >- If specified, model will make a best effort to sample deterministically, but it is not guaranteed. response_format: $ref: '#/components/schemas/type_:ResponseFormat' description: >- The format of the response. Only `{"type": "json_object"}` is currently supported for chat. reasoning_effort: $ref: '#/components/schemas/type_:PromptKernelRequestReasoningEffort' description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. tools: type: array items: $ref: '#/components/schemas/type_:ToolFunction' description: >- The tool specification that the model can choose to call if Tool calling is supported. linked_tools: type: array items: type: string description: >- 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. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used. required: - model description: |- Base class used by both PromptKernelRequest and AgentKernelRequest. Contains the consistent Prompt-related fields. title: PromptKernelRequest type_:LlmEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:EvaluatorReturnTypeEnum' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: >- The options that can be applied as judgments. Only for Evaluators with `return_type` of 'boolean', 'select' or 'multi_select'. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - llm prompt: $ref: '#/components/schemas/type_:PromptKernelRequest' description: The prompt parameters used to generate. required: - arguments_type - return_type - evaluator_type title: LlmEvaluatorRequest type_:CodeEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:EvaluatorReturnTypeEnum' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: >- The options that can be applied as judgments. Only for Evaluators with `return_type` of 'boolean', 'select' or 'multi_select'. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - python code: type: string description: >- The code for the Evaluator. This code will be executed in a sandboxed environment. required: - arguments_type - return_type - evaluator_type - code title: CodeEvaluatorRequest type_:HumanEvaluatorRequestReturnType: type: string enum: - select - multi_select - text - number - boolean description: The type of the return value of the Evaluator. title: HumanEvaluatorRequestReturnType type_:HumanEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:HumanEvaluatorRequestReturnType' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: The options that can be applied as judgments. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - human instructions: type: string description: Instructions and guidelines for applying judgments. required: - arguments_type - return_type - evaluator_type title: HumanEvaluatorRequest type_:ExternalEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:EvaluatorReturnTypeEnum' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: >- The options that can be applied as judgments. Only for Evaluators with `return_type` of 'boolean', 'select' or 'multi_select'. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - external required: - arguments_type - return_type - evaluator_type title: ExternalEvaluatorRequest type_:EvaluatorResponseSpec: oneOf: - $ref: '#/components/schemas/type_:LlmEvaluatorRequest' - $ref: '#/components/schemas/type_:CodeEvaluatorRequest' - $ref: '#/components/schemas/type_:HumanEvaluatorRequest' - $ref: '#/components/schemas/type_:ExternalEvaluatorRequest' title: EvaluatorResponseSpec type_:EvaluatorResponse: type: object properties: path: type: string description: >- Path of the Evaluator including the Evaluator name, which is used as a unique identifier. id: type: string description: Unique identifier for the Evaluator. directory_id: type: string description: ID of the directory that the file is in on Humanloop. version_name: type: string description: >- Unique name for the Evaluator version. Version names must be unique for a given Evaluator. version_description: type: string description: Description of the version, e.g., the changes made in this version. spec: $ref: '#/components/schemas/type_:EvaluatorResponseSpec' name: type: string description: Name of the Evaluator, which is used as a unique identifier. description: type: string description: Description of the Evaluator. schema: type: object additionalProperties: description: Any type description: The JSON schema for the File. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Evaluator Version. If no query params provided, the default deployed Evaluator Version is returned. type: type: string enum: - evaluator environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Evaluator Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Evaluator. last_used_at: type: string format: date-time version_logs_count: type: integer description: >- The number of logs that have been generated for this Evaluator Version total_logs_count: type: integer description: >- The number of logs that have been generated across all Evaluator Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Evaluator. Inputs correspond to any of the variables used within the Evaluator template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Evaluator that are used for monitoring logs. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Evaluator Version. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. required: - path - id - spec - name - version_id - created_at - updated_at - last_used_at - version_logs_count - total_logs_count - inputs description: Version of the Evaluator used to provide judgments. title: EvaluatorResponse type_:FlowResponse: type: object properties: path: type: string description: >- Path of the Flow, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Flow. directory_id: type: string description: ID of the directory that the file is in on Humanloop. attributes: type: object additionalProperties: description: Any type description: A key-value object identifying the Flow Version. version_name: type: string description: >- Unique name for the Flow version. Version names must be unique for a given Flow. version_description: type: string description: Description of the Version. name: type: string description: Name of the Flow. description: type: string description: Description of the Flow. schema: type: object additionalProperties: description: Any type description: The JSON schema for the File. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Flow Version. If no query params provided, the default deployed Flow Version is returned. type: type: string enum: - flow environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Flow Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Flow. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Flow Version evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Flow Version. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: The list of Monitoring Evaluators associated with the Flow Version. required: - path - id - attributes - name - version_id - created_at - updated_at - last_used_at - version_logs_count description: Response model for a Flow. title: FlowResponse type_:AgentResponseTemplate: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: >- 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}}`. title: AgentResponseTemplate type_:AgentResponseStop: oneOf: - type: string - type: array items: type: string description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. title: AgentResponseStop type_:AgentResponseReasoningEffort: oneOf: - $ref: '#/components/schemas/type_:OpenAiReasoningEffort' - type: integer description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. title: AgentResponseReasoningEffort type_:LinkedFileRequest: type: object properties: file_id: type: string environment_id: type: string version_id: type: string required: - file_id title: LinkedFileRequest type_:OnAgentCallEnum: type: string enum: - stop - continue description: What an Agent should do when calling a Tool. title: OnAgentCallEnum type_:AgentLinkedFileResponseFile: oneOf: - $ref: '#/components/schemas/type_:PromptResponse' - $ref: '#/components/schemas/type_:ToolResponse' - $ref: '#/components/schemas/type_:DatasetResponse' - $ref: '#/components/schemas/type_:EvaluatorResponse' - $ref: '#/components/schemas/type_:FlowResponse' - $ref: '#/components/schemas/type_:AgentResponse' title: AgentLinkedFileResponseFile type_:AgentLinkedFileResponse: type: object properties: type: type: string enum: - file link: $ref: '#/components/schemas/type_:LinkedFileRequest' on_agent_call: $ref: '#/components/schemas/type_:OnAgentCallEnum' file: $ref: '#/components/schemas/type_:AgentLinkedFileResponseFile' required: - type - link title: AgentLinkedFileResponse type_:AgentInlineTool: type: object properties: type: type: string enum: - inline json_schema: $ref: '#/components/schemas/type_:ToolFunction' on_agent_call: $ref: '#/components/schemas/type_:OnAgentCallEnum' required: - type - json_schema title: AgentInlineTool type_:AgentResponseToolsItem: oneOf: - $ref: '#/components/schemas/type_:AgentLinkedFileResponse' - $ref: '#/components/schemas/type_:AgentInlineTool' title: AgentResponseToolsItem type_:VersionStatus: type: string enum: - uncommitted - committed - deleted description: An enumeration. title: VersionStatus type_:AgentResponse: type: object properties: path: type: string description: >- Path of the Agent, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Agent. directory_id: type: string description: ID of the directory that the file is in on Humanloop. model: type: string description: >- The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models) endpoint: $ref: '#/components/schemas/type_:ModelEndpoints' description: The provider model endpoint used. template: $ref: '#/components/schemas/type_:AgentResponseTemplate' description: >- 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}}`. template_language: $ref: '#/components/schemas/type_:TemplateLanguage' description: The template language to use for rendering the template. provider: $ref: '#/components/schemas/type_:ModelProviders' description: The company providing the underlying model service. max_tokens: type: integer default: -1 description: >- 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 temperature: type: number format: double default: 1 description: >- What sampling temperature to use when making a generation. Higher values means the model will be more creative. top_p: type: number format: double default: 1 description: >- An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. stop: $ref: '#/components/schemas/type_:AgentResponseStop' description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. presence_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far. frequency_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far. other: type: object additionalProperties: description: Any type description: Other parameter values to be passed to the provider call. seed: type: integer description: >- If specified, model will make a best effort to sample deterministically, but it is not guaranteed. response_format: $ref: '#/components/schemas/type_:ResponseFormat' description: >- The format of the response. Only `{"type": "json_object"}` is currently supported for chat. reasoning_effort: $ref: '#/components/schemas/type_:AgentResponseReasoningEffort' description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. tools: type: array items: $ref: '#/components/schemas/type_:AgentResponseToolsItem' description: >- List of tools that the Agent can call. These can be linked files or inline tools. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used. max_iterations: type: integer description: >- The maximum number of iterations the Agent can run. This is used to limit the number of times the Agent model is called. version_name: type: string description: >- Unique name for the Agent version. Version names must be unique for a given Agent. version_description: type: string description: Description of the version, e.g., the changes made in this version. description: type: string description: Description of the Agent. tags: type: array items: type: string description: List of tags associated with the file. readme: type: string description: Long description of the file. name: type: string description: Name of the Agent. schema: type: object additionalProperties: description: Any type description: The JSON schema for the Prompt. version_id: type: string description: >- Unique identifier for the specific Agent Version. If no query params provided, the default deployed Agent Version is returned. type: type: string enum: - agent environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Agent Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Agent. committed_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who committed the Agent Version. committed_at: type: string format: date-time description: The date and time the Agent Version was committed. status: $ref: '#/components/schemas/type_:VersionStatus' description: The status of the Agent Version. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Agent Version total_logs_count: type: integer description: >- The number of logs that have been generated across all Agent Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Agent. Inputs correspond to any of the variables used within the Agent template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Agent that are used for monitoring logs. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Agent Version. raw_file_content: type: string description: The raw content of the Agent. Corresponds to the .agent file. required: - path - id - model - tools - name - version_id - created_at - updated_at - status - last_used_at - version_logs_count - total_logs_count - inputs description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: AgentResponse type_:VersionDeploymentResponseFile: oneOf: - $ref: '#/components/schemas/type_:PromptResponse' - $ref: '#/components/schemas/type_:ToolResponse' - $ref: '#/components/schemas/type_:DatasetResponse' - $ref: '#/components/schemas/type_:EvaluatorResponse' - $ref: '#/components/schemas/type_:FlowResponse' - $ref: '#/components/schemas/type_:AgentResponse' description: The File that the deployed Version belongs to. title: VersionDeploymentResponseFile type_:VersionDeploymentResponse: type: object properties: file: $ref: '#/components/schemas/type_:VersionDeploymentResponseFile' description: The File that the deployed Version belongs to. environment: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The Environment that the Version is deployed to. type: type: string enum: - environment required: - file - environment - type description: A variable reference to the Version deployed to an Environment title: VersionDeploymentResponse type_:VersionIdResponseVersion: oneOf: - $ref: '#/components/schemas/type_:PromptResponse' - $ref: '#/components/schemas/type_:ToolResponse' - $ref: '#/components/schemas/type_:DatasetResponse' - $ref: '#/components/schemas/type_:EvaluatorResponse' - $ref: '#/components/schemas/type_:FlowResponse' - $ref: '#/components/schemas/type_:AgentResponse' description: The specific Version being referenced. title: VersionIdResponseVersion type_:VersionIdResponse: type: object properties: version: $ref: '#/components/schemas/type_:VersionIdResponseVersion' description: The specific Version being referenced. type: type: string enum: - version required: - version - type description: A reference to a specific Version by its ID title: VersionIdResponse type_:VersionReferenceResponse: oneOf: - $ref: '#/components/schemas/type_:VersionDeploymentResponse' - $ref: '#/components/schemas/type_:VersionIdResponse' title: VersionReferenceResponse type_:MonitoringEvaluatorState: type: string enum: - active - inactive description: State of an evaluator connected to a file title: MonitoringEvaluatorState type_:MonitoringEvaluatorResponse: type: object properties: version_reference: $ref: '#/components/schemas/type_:VersionReferenceResponse' description: >- The Evaluator Version used for monitoring. This can be a specific Version by ID, or a Version deployed to an Environment. version: $ref: '#/components/schemas/type_:EvaluatorResponse' description: The deployed Version. state: $ref: '#/components/schemas/type_:MonitoringEvaluatorState' description: The state of the Monitoring Evaluator. Either `active` or `inactive` created_at: type: string format: date-time updated_at: type: string format: date-time required: - version_reference - state - created_at - updated_at title: MonitoringEvaluatorResponse type_:PromptResponse: type: object properties: path: type: string description: >- Path of the Prompt, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Prompt. directory_id: type: string description: ID of the directory that the file is in on Humanloop. model: type: string description: >- The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models) endpoint: $ref: '#/components/schemas/type_:ModelEndpoints' description: The provider model endpoint used. template: $ref: '#/components/schemas/type_:PromptResponseTemplate' description: >- 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}}`. template_language: $ref: '#/components/schemas/type_:TemplateLanguage' description: The template language to use for rendering the template. provider: $ref: '#/components/schemas/type_:ModelProviders' description: The company providing the underlying model service. max_tokens: type: integer default: -1 description: >- 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 temperature: type: number format: double default: 1 description: >- What sampling temperature to use when making a generation. Higher values means the model will be more creative. top_p: type: number format: double default: 1 description: >- An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. stop: $ref: '#/components/schemas/type_:PromptResponseStop' description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. presence_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far. frequency_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far. other: type: object additionalProperties: description: Any type description: Other parameter values to be passed to the provider call. seed: type: integer description: >- If specified, model will make a best effort to sample deterministically, but it is not guaranteed. response_format: $ref: '#/components/schemas/type_:ResponseFormat' description: >- The format of the response. Only `{"type": "json_object"}` is currently supported for chat. reasoning_effort: $ref: '#/components/schemas/type_:PromptResponseReasoningEffort' description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. tools: type: array items: $ref: '#/components/schemas/type_:ToolFunction' description: >- The tool specification that the model can choose to call if Tool calling is supported. linked_tools: type: array items: $ref: '#/components/schemas/type_:LinkedToolResponse' description: The tools linked to your prompt that the model can call. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used. version_name: type: string description: >- Unique name for the Prompt version. Version names must be unique for a given Prompt. version_description: type: string description: Description of the version, e.g., the changes made in this version. description: type: string description: Description of the Prompt. tags: type: array items: type: string description: List of tags associated with the file. readme: type: string description: Long description of the file. name: type: string description: Name of the Prompt. schema: type: object additionalProperties: description: Any type description: The JSON schema for the Prompt. version_id: type: string description: >- Unique identifier for the specific Prompt Version. If no query params provided, the default deployed Prompt Version is returned. type: type: string enum: - prompt environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Prompt Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Prompt. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Prompt Version total_logs_count: type: integer description: >- The number of logs that have been generated across all Prompt Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Prompt. Inputs correspond to any of the variables used within the Prompt template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Prompt that are used for monitoring logs. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Prompt Version. raw_file_content: type: string description: The raw content of the Prompt. Corresponds to the .prompt file. required: - path - id - model - name - version_id - created_at - updated_at - last_used_at - version_logs_count - total_logs_count - inputs description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: PromptResponse type_:ValidationErrorLocItem: oneOf: - type: string - type: integer title: ValidationErrorLocItem type_:ValidationError: type: object properties: loc: type: array items: $ref: '#/components/schemas/type_:ValidationErrorLocItem' msg: type: string type: type: string required: - loc - msg - type title: ValidationError type_:HttpValidationError: type: object properties: detail: type: array items: $ref: '#/components/schemas/type_:ValidationError' title: HttpValidationError securitySchemes: default: type: apiKey in: header name: X-API-KEY ``` ## SDK Code Examples ```python Get specific prompt import requests url = "https://api.humanloop.com/v5/prompts/pr_30gco7dx6JDq4200GVOHa" headers = {"X-API-KEY": " "} response = requests.get(url, headers=headers) print(response.json()) ``` ```typescript Get specific prompt import { HumanloopClient } from "humanloop"; const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); await client.prompts.get("pr_30gco7dx6JDq4200GVOHa"); ``` ```go Get specific prompt package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/prompts/pr_30gco7dx6JDq4200GVOHa" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("X-API-KEY", " ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Get specific prompt require 'uri' require 'net/http' url = URI("https://api.humanloop.com/v5/prompts/pr_30gco7dx6JDq4200GVOHa") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["X-API-KEY"] = ' ' response = http.request(request) puts response.read_body ``` ```java Get specific prompt import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api.humanloop.com/v5/prompts/pr_30gco7dx6JDq4200GVOHa") .header("X-API-KEY", " ") .asString(); ``` ```php Get specific prompt request('GET', 'https://api.humanloop.com/v5/prompts/pr_30gco7dx6JDq4200GVOHa', [ 'headers' => [ 'X-API-KEY' => ' ', ], ]); echo $response->getBody(); ``` ```csharp Get specific prompt using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/prompts/pr_30gco7dx6JDq4200GVOHa"); var request = new RestRequest(Method.GET); request.AddHeader("X-API-KEY", " "); IRestResponse response = client.Execute(request); ``` ```swift Get specific prompt import Foundation let headers = ["X-API-KEY": " "] let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/prompts/pr_30gco7dx6JDq4200GVOHa")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. # Delete Prompt DELETE https://api.humanloop.com/v5/prompts/{id} Delete the Prompt with the given ID. Reference: https://humanloop.com/docs/api/prompts/delete ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /prompts/{id}: delete: operationId: delete summary: Delete Prompt description: Delete the Prompt with the given ID. tags: - subpackage_prompts parameters: - name: id in: path description: Unique identifier for Prompt. required: true schema: type: string - name: X-API-KEY in: header required: true schema: type: string responses: '200': description: Successful response '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/type_:HttpValidationError' servers: - url: https://api.humanloop.com/v5 components: schemas: type_:ValidationErrorLocItem: oneOf: - type: string - type: integer title: ValidationErrorLocItem type_:ValidationError: type: object properties: loc: type: array items: $ref: '#/components/schemas/type_:ValidationErrorLocItem' msg: type: string type: type: string required: - loc - msg - type title: ValidationError type_:HttpValidationError: type: object properties: detail: type: array items: $ref: '#/components/schemas/type_:ValidationError' title: HttpValidationError securitySchemes: default: type: apiKey in: header name: X-API-KEY ``` ## SDK Code Examples ```python Delete prompt import requests url = "https://api.humanloop.com/v5/prompts/pr_30gco7dx6JDq4200GVOHa" headers = {"X-API-KEY": " "} response = requests.delete(url, headers=headers) print(response.json()) ``` ```typescript Delete prompt import { HumanloopClient } from "humanloop"; const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); await client.prompts.delete("pr_30gco7dx6JDq4200GVOHa"); ``` ```go Delete prompt package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/prompts/pr_30gco7dx6JDq4200GVOHa" req, _ := http.NewRequest("DELETE", url, nil) req.Header.Add("X-API-KEY", " ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Delete prompt require 'uri' require 'net/http' url = URI("https://api.humanloop.com/v5/prompts/pr_30gco7dx6JDq4200GVOHa") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Delete.new(url) request["X-API-KEY"] = ' ' response = http.request(request) puts response.read_body ``` ```java Delete prompt import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.delete("https://api.humanloop.com/v5/prompts/pr_30gco7dx6JDq4200GVOHa") .header("X-API-KEY", " ") .asString(); ``` ```php Delete prompt request('DELETE', 'https://api.humanloop.com/v5/prompts/pr_30gco7dx6JDq4200GVOHa', [ 'headers' => [ 'X-API-KEY' => ' ', ], ]); echo $response->getBody(); ``` ```csharp Delete prompt using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/prompts/pr_30gco7dx6JDq4200GVOHa"); var request = new RestRequest(Method.DELETE); request.AddHeader("X-API-KEY", " "); IRestResponse response = client.Execute(request); ``` ```swift Delete prompt import Foundation let headers = ["X-API-KEY": " "] let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/prompts/pr_30gco7dx6JDq4200GVOHa")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "DELETE" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. # Move Prompt PATCH https://api.humanloop.com/v5/prompts/{id} Content-Type: application/json Move the Prompt to a different path or change the name. Reference: https://humanloop.com/docs/api/prompts/move ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /prompts/{id}: patch: operationId: move summary: Move Prompt description: Move the Prompt to a different path or change the name. tags: - subpackage_prompts parameters: - name: id in: path description: Unique identifier for Prompt. required: true schema: type: string - name: X-API-KEY in: header required: true schema: type: string responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/type_:PromptResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/type_:HttpValidationError' requestBody: content: application/json: schema: type: object properties: path: type: string description: >- Path of the Prompt including the Prompt name, which is used as a unique identifier. name: type: string description: Name of the Prompt. servers: - url: https://api.humanloop.com/v5 components: schemas: type_:ModelEndpoints: type: string enum: - complete - chat - edit description: Supported model provider endpoints. title: ModelEndpoints type_:TextChatContent: type: object properties: type: type: string enum: - text text: type: string description: The message's text content. required: - type - text title: TextChatContent type_:ImageUrlDetail: type: string enum: - high - low - auto description: >- Specify the detail level of the image provided to the model. For more details see: https://platform.openai.com/docs/guides/vision/low-or-high-fidelity-image-understanding title: ImageUrlDetail type_:ImageUrl: type: object properties: url: type: string description: Either a URL of the image or the base64 encoded image data. detail: $ref: '#/components/schemas/type_:ImageUrlDetail' description: >- Specify the detail level of the image provided to the model. For more details see: https://platform.openai.com/docs/guides/vision/low-or-high-fidelity-image-understanding required: - url title: ImageUrl type_:ImageChatContent: type: object properties: type: type: string enum: - image_url image_url: $ref: '#/components/schemas/type_:ImageUrl' description: The message's image content. required: - type - image_url title: ImageChatContent type_:ChatMessageContentItem: oneOf: - $ref: '#/components/schemas/type_:TextChatContent' - $ref: '#/components/schemas/type_:ImageChatContent' title: ChatMessageContentItem type_:ChatMessageContent: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessageContentItem' description: The content of the message. title: ChatMessageContent type_:ChatRole: type: string enum: - user - assistant - system - tool - developer description: An enumeration. title: ChatRole type_:ChatToolType: type: string enum: - function description: The type of tool to call. title: ChatToolType type_:FunctionTool: type: object properties: name: type: string arguments: type: string required: - name description: A function tool to be called by the model where user owns runtime. title: FunctionTool type_:ToolCall: type: object properties: id: type: string type: $ref: '#/components/schemas/type_:ChatToolType' function: $ref: '#/components/schemas/type_:FunctionTool' required: - id - type - function description: A tool call to be made. title: ToolCall type_:AnthropicThinkingContent: type: object properties: type: type: string enum: - thinking thinking: type: string description: Model's chain-of-thought for providing the response. signature: type: string description: >- Cryptographic signature that verifies the thinking block was generated by Anthropic. required: - type - thinking - signature title: AnthropicThinkingContent type_:AnthropicRedactedThinkingContent: type: object properties: type: type: string enum: - redacted_thinking data: type: string description: >- Thinking block Anthropic redacted for safety reasons. User is expected to pass the block back to Anthropic required: - type - data title: AnthropicRedactedThinkingContent type_:ChatMessageThinkingItem: oneOf: - $ref: '#/components/schemas/type_:AnthropicThinkingContent' - $ref: '#/components/schemas/type_:AnthropicRedactedThinkingContent' title: ChatMessageThinkingItem type_:ChatMessage: type: object properties: content: $ref: '#/components/schemas/type_:ChatMessageContent' description: The content of the message. name: type: string description: Optional name of the message author. tool_call_id: type: string description: Tool call that this message is responding to. role: $ref: '#/components/schemas/type_:ChatRole' description: Role of the message author. tool_calls: type: array items: $ref: '#/components/schemas/type_:ToolCall' description: A list of tool calls requested by the assistant. thinking: type: array items: $ref: '#/components/schemas/type_:ChatMessageThinkingItem' description: >- Model's chain-of-thought for providing the response. Present on assistant messages if model supports it. required: - role title: ChatMessage type_:PromptResponseTemplate: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: >- 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}}`. title: PromptResponseTemplate type_:TemplateLanguage: type: string enum: - default - jinja description: Template engine to use for rendering templates. title: TemplateLanguage type_:ModelProviders: type: string enum: - anthropic - bedrock - cohere - deepseek - google - groq - mock - openai - openai_azure - replicate description: Supported model providers. title: ModelProviders type_:PromptResponseStop: oneOf: - type: string - type: array items: type: string description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. title: PromptResponseStop type_:ResponseFormatType: type: string enum: - json_object - json_schema title: ResponseFormatType type_:ResponseFormat: type: object properties: type: $ref: '#/components/schemas/type_:ResponseFormatType' json_schema: type: object additionalProperties: description: Any type description: The JSON schema of the response format if type is json_schema. required: - type description: Response format of the model. title: ResponseFormat type_:OpenAiReasoningEffort: type: string enum: - high - medium - low description: Supported reasoning effort. title: OpenAiReasoningEffort type_:PromptResponseReasoningEffort: oneOf: - $ref: '#/components/schemas/type_:OpenAiReasoningEffort' - type: integer description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. title: PromptResponseReasoningEffort type_:ToolFunction: type: object properties: name: type: string description: Name for the tool referenced by the model. description: type: string description: Description of the tool referenced by the model strict: type: boolean default: false description: >- If true, forces the model to output json data in the structure of the parameters schema. parameters: type: object additionalProperties: description: Any type description: >- Parameters needed to run the Tool, defined in JSON Schema format: https://json-schema.org/ required: - name - description title: ToolFunction type_:LinkedToolResponse: type: object properties: name: type: string description: Name for the tool referenced by the model. description: type: string description: Description of the tool referenced by the model strict: type: boolean default: false description: >- If true, forces the model to output json data in the structure of the parameters schema. parameters: type: object additionalProperties: description: Any type description: >- Parameters needed to run the Tool, defined in JSON Schema format: https://json-schema.org/ id: type: string description: Unique identifier for the Tool linked. version_id: type: string description: Unique identifier for the Tool Version linked. required: - name - description - id - version_id title: LinkedToolResponse type_:EnvironmentTag: type: string enum: - default - other description: An enumeration. title: EnvironmentTag type_:EnvironmentResponse: type: object properties: id: type: string created_at: type: string format: date-time name: type: string tag: $ref: '#/components/schemas/type_:EnvironmentTag' required: - id - created_at - name - tag title: EnvironmentResponse type_:UserResponse: description: Any type title: UserResponse type_:InputResponse: type: object properties: name: type: string description: Type of input. required: - name title: InputResponse type_:FilesToolType: type: string enum: - pinecone_search - google - mock - snippet - json_schema - get_api_call - python description: Type of tool. title: FilesToolType type_:EvaluatorAggregate: type: object properties: value: type: number format: double description: The aggregated value of the evaluator. evaluator_id: type: string description: ID of the evaluator. evaluator_version_id: type: string description: ID of the evaluator version. created_at: type: string format: date-time updated_at: type: string format: date-time required: - value - evaluator_id - evaluator_version_id - created_at - updated_at title: EvaluatorAggregate type_:ToolResponse: type: object properties: path: type: string description: >- Path of the Tool, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Tool. directory_id: type: string description: ID of the directory that the file is in on Humanloop. function: $ref: '#/components/schemas/type_:ToolFunction' description: >- Callable function specification of the Tool shown to the model for tool calling. source_code: type: string description: Code source of the Tool. setup_values: type: object additionalProperties: description: Any type description: >- Values needed to setup the Tool, defined in JSON Schema format: https://json-schema.org/ attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Tool. Helpful to separate Tool versions from each other with details on how they were created or used. tool_type: $ref: '#/components/schemas/type_:FilesToolType' description: Type of Tool. version_name: type: string description: >- Unique identifier for this Tool version. Each Tool can only have one version with a given name. version_description: type: string description: Description of the Version. name: type: string description: Name of the Tool, which is used as a unique identifier. description: type: string description: Description of the Tool. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Tool Version. If no query params provided, the default deployed Tool Version is returned. type: type: string enum: - tool environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Tool Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Tool. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Tool Version total_logs_count: type: integer description: The number of logs that have been generated across all Tool Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Prompt. Inputs correspond to any of the variables used within the Tool template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Tool that are used for monitoring logs. signature: type: string description: Signature of the Tool. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Tool Version. required: - path - id - name - version_id - created_at - updated_at - last_used_at - version_logs_count - total_logs_count - inputs description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: ToolResponse type_:DatapointResponseTargetValue: oneOf: - type: string - type: integer - type: number format: double - type: boolean - type: array items: description: Any type - type: object additionalProperties: description: Any type title: DatapointResponseTargetValue type_:DatapointResponse: type: object properties: inputs: type: object additionalProperties: type: string description: The inputs to the prompt template. messages: type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: List of chat messages to provide to the model. target: type: object additionalProperties: $ref: '#/components/schemas/type_:DatapointResponseTargetValue' description: >- Object with criteria necessary to evaluate generations with this Datapoint. This is passed in as an argument to Evaluators when used in an Evaluation. id: type: string description: Unique identifier for the Datapoint. Starts with `dp_`. required: - id title: DatapointResponse type_:DatasetResponse: type: object properties: path: type: string description: >- Path of the Dataset, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Dataset. Starts with `ds_`. directory_id: type: string description: ID of the directory that the file is in on Humanloop. name: type: string description: Name of the Dataset, which is used as a unique identifier. description: type: string description: Description of the Dataset. schema: type: object additionalProperties: description: Any type description: The JSON schema for the File. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Dataset Version. If no query params provided, the default deployed Dataset Version is returned. Starts with `dsv_`. type: type: string enum: - dataset environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Dataset Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Dataset. last_used_at: type: string format: date-time version_name: type: string description: >- Unique name for the Dataset version. Version names must be unique for a given Dataset. version_description: type: string description: Description of the version, e.g., the changes made in this version. datapoints_count: type: integer description: The number of Datapoints in this Dataset version. datapoints: type: array items: $ref: '#/components/schemas/type_:DatapointResponse' description: >- The list of Datapoints in this Dataset version. Only provided if explicitly requested. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Dataset. Helpful to separate Dataset versions from each other with details on how they were created or used. required: - path - id - name - version_id - created_at - updated_at - last_used_at - datapoints_count description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: DatasetResponse type_:EvaluatorArgumentsType: type: string enum: - target_free - target_required description: Enum representing the possible argument types of an evaluator. title: EvaluatorArgumentsType type_:EvaluatorReturnTypeEnum: type: string enum: - boolean - number - select - multi_select - text description: Enum representing the possible return types of an evaluator. title: EvaluatorReturnTypeEnum type_:Valence: type: string enum: - positive - negative - neutral description: An enumeration. title: Valence type_:EvaluatorJudgmentOptionResponse: type: object properties: name: type: string description: The name of the option. valence: $ref: '#/components/schemas/type_:Valence' description: Whether this option should be considered positive or negative. required: - name title: EvaluatorJudgmentOptionResponse type_:EvaluatorJudgmentNumberLimit: type: object properties: min: type: number format: double description: The minimum value that can be selected. max: type: number format: double description: The maximum value that can be selected. step: type: number format: double description: The step size for the number input. title: EvaluatorJudgmentNumberLimit type_:PromptKernelRequestTemplate: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: >- 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}}`. title: PromptKernelRequestTemplate type_:PromptKernelRequestStop: oneOf: - type: string - type: array items: type: string description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. title: PromptKernelRequestStop type_:PromptKernelRequestReasoningEffort: oneOf: - $ref: '#/components/schemas/type_:OpenAiReasoningEffort' - type: integer description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. title: PromptKernelRequestReasoningEffort type_:PromptKernelRequest: type: object properties: model: type: string description: >- The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models) endpoint: $ref: '#/components/schemas/type_:ModelEndpoints' description: The provider model endpoint used. template: $ref: '#/components/schemas/type_:PromptKernelRequestTemplate' description: >- 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}}`. template_language: $ref: '#/components/schemas/type_:TemplateLanguage' description: The template language to use for rendering the template. provider: $ref: '#/components/schemas/type_:ModelProviders' description: The company providing the underlying model service. max_tokens: type: integer default: -1 description: >- 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 temperature: type: number format: double default: 1 description: >- What sampling temperature to use when making a generation. Higher values means the model will be more creative. top_p: type: number format: double default: 1 description: >- An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. stop: $ref: '#/components/schemas/type_:PromptKernelRequestStop' description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. presence_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far. frequency_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far. other: type: object additionalProperties: description: Any type description: Other parameter values to be passed to the provider call. seed: type: integer description: >- If specified, model will make a best effort to sample deterministically, but it is not guaranteed. response_format: $ref: '#/components/schemas/type_:ResponseFormat' description: >- The format of the response. Only `{"type": "json_object"}` is currently supported for chat. reasoning_effort: $ref: '#/components/schemas/type_:PromptKernelRequestReasoningEffort' description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. tools: type: array items: $ref: '#/components/schemas/type_:ToolFunction' description: >- The tool specification that the model can choose to call if Tool calling is supported. linked_tools: type: array items: type: string description: >- 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. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used. required: - model description: |- Base class used by both PromptKernelRequest and AgentKernelRequest. Contains the consistent Prompt-related fields. title: PromptKernelRequest type_:LlmEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:EvaluatorReturnTypeEnum' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: >- The options that can be applied as judgments. Only for Evaluators with `return_type` of 'boolean', 'select' or 'multi_select'. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - llm prompt: $ref: '#/components/schemas/type_:PromptKernelRequest' description: The prompt parameters used to generate. required: - arguments_type - return_type - evaluator_type title: LlmEvaluatorRequest type_:CodeEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:EvaluatorReturnTypeEnum' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: >- The options that can be applied as judgments. Only for Evaluators with `return_type` of 'boolean', 'select' or 'multi_select'. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - python code: type: string description: >- The code for the Evaluator. This code will be executed in a sandboxed environment. required: - arguments_type - return_type - evaluator_type - code title: CodeEvaluatorRequest type_:HumanEvaluatorRequestReturnType: type: string enum: - select - multi_select - text - number - boolean description: The type of the return value of the Evaluator. title: HumanEvaluatorRequestReturnType type_:HumanEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:HumanEvaluatorRequestReturnType' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: The options that can be applied as judgments. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - human instructions: type: string description: Instructions and guidelines for applying judgments. required: - arguments_type - return_type - evaluator_type title: HumanEvaluatorRequest type_:ExternalEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:EvaluatorReturnTypeEnum' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: >- The options that can be applied as judgments. Only for Evaluators with `return_type` of 'boolean', 'select' or 'multi_select'. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - external required: - arguments_type - return_type - evaluator_type title: ExternalEvaluatorRequest type_:EvaluatorResponseSpec: oneOf: - $ref: '#/components/schemas/type_:LlmEvaluatorRequest' - $ref: '#/components/schemas/type_:CodeEvaluatorRequest' - $ref: '#/components/schemas/type_:HumanEvaluatorRequest' - $ref: '#/components/schemas/type_:ExternalEvaluatorRequest' title: EvaluatorResponseSpec type_:EvaluatorResponse: type: object properties: path: type: string description: >- Path of the Evaluator including the Evaluator name, which is used as a unique identifier. id: type: string description: Unique identifier for the Evaluator. directory_id: type: string description: ID of the directory that the file is in on Humanloop. version_name: type: string description: >- Unique name for the Evaluator version. Version names must be unique for a given Evaluator. version_description: type: string description: Description of the version, e.g., the changes made in this version. spec: $ref: '#/components/schemas/type_:EvaluatorResponseSpec' name: type: string description: Name of the Evaluator, which is used as a unique identifier. description: type: string description: Description of the Evaluator. schema: type: object additionalProperties: description: Any type description: The JSON schema for the File. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Evaluator Version. If no query params provided, the default deployed Evaluator Version is returned. type: type: string enum: - evaluator environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Evaluator Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Evaluator. last_used_at: type: string format: date-time version_logs_count: type: integer description: >- The number of logs that have been generated for this Evaluator Version total_logs_count: type: integer description: >- The number of logs that have been generated across all Evaluator Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Evaluator. Inputs correspond to any of the variables used within the Evaluator template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Evaluator that are used for monitoring logs. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Evaluator Version. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. required: - path - id - spec - name - version_id - created_at - updated_at - last_used_at - version_logs_count - total_logs_count - inputs description: Version of the Evaluator used to provide judgments. title: EvaluatorResponse type_:FlowResponse: type: object properties: path: type: string description: >- Path of the Flow, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Flow. directory_id: type: string description: ID of the directory that the file is in on Humanloop. attributes: type: object additionalProperties: description: Any type description: A key-value object identifying the Flow Version. version_name: type: string description: >- Unique name for the Flow version. Version names must be unique for a given Flow. version_description: type: string description: Description of the Version. name: type: string description: Name of the Flow. description: type: string description: Description of the Flow. schema: type: object additionalProperties: description: Any type description: The JSON schema for the File. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Flow Version. If no query params provided, the default deployed Flow Version is returned. type: type: string enum: - flow environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Flow Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Flow. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Flow Version evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Flow Version. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: The list of Monitoring Evaluators associated with the Flow Version. required: - path - id - attributes - name - version_id - created_at - updated_at - last_used_at - version_logs_count description: Response model for a Flow. title: FlowResponse type_:AgentResponseTemplate: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: >- 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}}`. title: AgentResponseTemplate type_:AgentResponseStop: oneOf: - type: string - type: array items: type: string description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. title: AgentResponseStop type_:AgentResponseReasoningEffort: oneOf: - $ref: '#/components/schemas/type_:OpenAiReasoningEffort' - type: integer description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. title: AgentResponseReasoningEffort type_:LinkedFileRequest: type: object properties: file_id: type: string environment_id: type: string version_id: type: string required: - file_id title: LinkedFileRequest type_:OnAgentCallEnum: type: string enum: - stop - continue description: What an Agent should do when calling a Tool. title: OnAgentCallEnum type_:AgentLinkedFileResponseFile: oneOf: - $ref: '#/components/schemas/type_:PromptResponse' - $ref: '#/components/schemas/type_:ToolResponse' - $ref: '#/components/schemas/type_:DatasetResponse' - $ref: '#/components/schemas/type_:EvaluatorResponse' - $ref: '#/components/schemas/type_:FlowResponse' - $ref: '#/components/schemas/type_:AgentResponse' title: AgentLinkedFileResponseFile type_:AgentLinkedFileResponse: type: object properties: type: type: string enum: - file link: $ref: '#/components/schemas/type_:LinkedFileRequest' on_agent_call: $ref: '#/components/schemas/type_:OnAgentCallEnum' file: $ref: '#/components/schemas/type_:AgentLinkedFileResponseFile' required: - type - link title: AgentLinkedFileResponse type_:AgentInlineTool: type: object properties: type: type: string enum: - inline json_schema: $ref: '#/components/schemas/type_:ToolFunction' on_agent_call: $ref: '#/components/schemas/type_:OnAgentCallEnum' required: - type - json_schema title: AgentInlineTool type_:AgentResponseToolsItem: oneOf: - $ref: '#/components/schemas/type_:AgentLinkedFileResponse' - $ref: '#/components/schemas/type_:AgentInlineTool' title: AgentResponseToolsItem type_:VersionStatus: type: string enum: - uncommitted - committed - deleted description: An enumeration. title: VersionStatus type_:AgentResponse: type: object properties: path: type: string description: >- Path of the Agent, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Agent. directory_id: type: string description: ID of the directory that the file is in on Humanloop. model: type: string description: >- The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models) endpoint: $ref: '#/components/schemas/type_:ModelEndpoints' description: The provider model endpoint used. template: $ref: '#/components/schemas/type_:AgentResponseTemplate' description: >- 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}}`. template_language: $ref: '#/components/schemas/type_:TemplateLanguage' description: The template language to use for rendering the template. provider: $ref: '#/components/schemas/type_:ModelProviders' description: The company providing the underlying model service. max_tokens: type: integer default: -1 description: >- 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 temperature: type: number format: double default: 1 description: >- What sampling temperature to use when making a generation. Higher values means the model will be more creative. top_p: type: number format: double default: 1 description: >- An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. stop: $ref: '#/components/schemas/type_:AgentResponseStop' description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. presence_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far. frequency_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far. other: type: object additionalProperties: description: Any type description: Other parameter values to be passed to the provider call. seed: type: integer description: >- If specified, model will make a best effort to sample deterministically, but it is not guaranteed. response_format: $ref: '#/components/schemas/type_:ResponseFormat' description: >- The format of the response. Only `{"type": "json_object"}` is currently supported for chat. reasoning_effort: $ref: '#/components/schemas/type_:AgentResponseReasoningEffort' description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. tools: type: array items: $ref: '#/components/schemas/type_:AgentResponseToolsItem' description: >- List of tools that the Agent can call. These can be linked files or inline tools. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used. max_iterations: type: integer description: >- The maximum number of iterations the Agent can run. This is used to limit the number of times the Agent model is called. version_name: type: string description: >- Unique name for the Agent version. Version names must be unique for a given Agent. version_description: type: string description: Description of the version, e.g., the changes made in this version. description: type: string description: Description of the Agent. tags: type: array items: type: string description: List of tags associated with the file. readme: type: string description: Long description of the file. name: type: string description: Name of the Agent. schema: type: object additionalProperties: description: Any type description: The JSON schema for the Prompt. version_id: type: string description: >- Unique identifier for the specific Agent Version. If no query params provided, the default deployed Agent Version is returned. type: type: string enum: - agent environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Agent Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Agent. committed_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who committed the Agent Version. committed_at: type: string format: date-time description: The date and time the Agent Version was committed. status: $ref: '#/components/schemas/type_:VersionStatus' description: The status of the Agent Version. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Agent Version total_logs_count: type: integer description: >- The number of logs that have been generated across all Agent Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Agent. Inputs correspond to any of the variables used within the Agent template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Agent that are used for monitoring logs. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Agent Version. raw_file_content: type: string description: The raw content of the Agent. Corresponds to the .agent file. required: - path - id - model - tools - name - version_id - created_at - updated_at - status - last_used_at - version_logs_count - total_logs_count - inputs description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: AgentResponse type_:VersionDeploymentResponseFile: oneOf: - $ref: '#/components/schemas/type_:PromptResponse' - $ref: '#/components/schemas/type_:ToolResponse' - $ref: '#/components/schemas/type_:DatasetResponse' - $ref: '#/components/schemas/type_:EvaluatorResponse' - $ref: '#/components/schemas/type_:FlowResponse' - $ref: '#/components/schemas/type_:AgentResponse' description: The File that the deployed Version belongs to. title: VersionDeploymentResponseFile type_:VersionDeploymentResponse: type: object properties: file: $ref: '#/components/schemas/type_:VersionDeploymentResponseFile' description: The File that the deployed Version belongs to. environment: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The Environment that the Version is deployed to. type: type: string enum: - environment required: - file - environment - type description: A variable reference to the Version deployed to an Environment title: VersionDeploymentResponse type_:VersionIdResponseVersion: oneOf: - $ref: '#/components/schemas/type_:PromptResponse' - $ref: '#/components/schemas/type_:ToolResponse' - $ref: '#/components/schemas/type_:DatasetResponse' - $ref: '#/components/schemas/type_:EvaluatorResponse' - $ref: '#/components/schemas/type_:FlowResponse' - $ref: '#/components/schemas/type_:AgentResponse' description: The specific Version being referenced. title: VersionIdResponseVersion type_:VersionIdResponse: type: object properties: version: $ref: '#/components/schemas/type_:VersionIdResponseVersion' description: The specific Version being referenced. type: type: string enum: - version required: - version - type description: A reference to a specific Version by its ID title: VersionIdResponse type_:VersionReferenceResponse: oneOf: - $ref: '#/components/schemas/type_:VersionDeploymentResponse' - $ref: '#/components/schemas/type_:VersionIdResponse' title: VersionReferenceResponse type_:MonitoringEvaluatorState: type: string enum: - active - inactive description: State of an evaluator connected to a file title: MonitoringEvaluatorState type_:MonitoringEvaluatorResponse: type: object properties: version_reference: $ref: '#/components/schemas/type_:VersionReferenceResponse' description: >- The Evaluator Version used for monitoring. This can be a specific Version by ID, or a Version deployed to an Environment. version: $ref: '#/components/schemas/type_:EvaluatorResponse' description: The deployed Version. state: $ref: '#/components/schemas/type_:MonitoringEvaluatorState' description: The state of the Monitoring Evaluator. Either `active` or `inactive` created_at: type: string format: date-time updated_at: type: string format: date-time required: - version_reference - state - created_at - updated_at title: MonitoringEvaluatorResponse type_:PromptResponse: type: object properties: path: type: string description: >- Path of the Prompt, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Prompt. directory_id: type: string description: ID of the directory that the file is in on Humanloop. model: type: string description: >- The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models) endpoint: $ref: '#/components/schemas/type_:ModelEndpoints' description: The provider model endpoint used. template: $ref: '#/components/schemas/type_:PromptResponseTemplate' description: >- 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}}`. template_language: $ref: '#/components/schemas/type_:TemplateLanguage' description: The template language to use for rendering the template. provider: $ref: '#/components/schemas/type_:ModelProviders' description: The company providing the underlying model service. max_tokens: type: integer default: -1 description: >- 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 temperature: type: number format: double default: 1 description: >- What sampling temperature to use when making a generation. Higher values means the model will be more creative. top_p: type: number format: double default: 1 description: >- An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. stop: $ref: '#/components/schemas/type_:PromptResponseStop' description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. presence_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far. frequency_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far. other: type: object additionalProperties: description: Any type description: Other parameter values to be passed to the provider call. seed: type: integer description: >- If specified, model will make a best effort to sample deterministically, but it is not guaranteed. response_format: $ref: '#/components/schemas/type_:ResponseFormat' description: >- The format of the response. Only `{"type": "json_object"}` is currently supported for chat. reasoning_effort: $ref: '#/components/schemas/type_:PromptResponseReasoningEffort' description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. tools: type: array items: $ref: '#/components/schemas/type_:ToolFunction' description: >- The tool specification that the model can choose to call if Tool calling is supported. linked_tools: type: array items: $ref: '#/components/schemas/type_:LinkedToolResponse' description: The tools linked to your prompt that the model can call. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used. version_name: type: string description: >- Unique name for the Prompt version. Version names must be unique for a given Prompt. version_description: type: string description: Description of the version, e.g., the changes made in this version. description: type: string description: Description of the Prompt. tags: type: array items: type: string description: List of tags associated with the file. readme: type: string description: Long description of the file. name: type: string description: Name of the Prompt. schema: type: object additionalProperties: description: Any type description: The JSON schema for the Prompt. version_id: type: string description: >- Unique identifier for the specific Prompt Version. If no query params provided, the default deployed Prompt Version is returned. type: type: string enum: - prompt environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Prompt Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Prompt. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Prompt Version total_logs_count: type: integer description: >- The number of logs that have been generated across all Prompt Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Prompt. Inputs correspond to any of the variables used within the Prompt template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Prompt that are used for monitoring logs. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Prompt Version. raw_file_content: type: string description: The raw content of the Prompt. Corresponds to the .prompt file. required: - path - id - model - name - version_id - created_at - updated_at - last_used_at - version_logs_count - total_logs_count - inputs description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: PromptResponse type_:ValidationErrorLocItem: oneOf: - type: string - type: integer title: ValidationErrorLocItem type_:ValidationError: type: object properties: loc: type: array items: $ref: '#/components/schemas/type_:ValidationErrorLocItem' msg: type: string type: type: string required: - loc - msg - type title: ValidationError type_:HttpValidationError: type: object properties: detail: type: array items: $ref: '#/components/schemas/type_:ValidationError' title: HttpValidationError securitySchemes: default: type: apiKey in: header name: X-API-KEY ``` ## SDK Code Examples ```python Move prompt import requests url = "https://api.humanloop.com/v5/prompts/pr_30gco7dx6JDq4200GVOHa" payload = { "path": "new directory/new name" } headers = { "X-API-KEY": " ", "Content-Type": "application/json" } response = requests.patch(url, json=payload, headers=headers) print(response.json()) ``` ```typescript Move prompt import { HumanloopClient } from "humanloop"; const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); await client.prompts.move("pr_30gco7dx6JDq4200GVOHa", { path: "new directory/new name" }); ``` ```go Move prompt package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/prompts/pr_30gco7dx6JDq4200GVOHa" payload := strings.NewReader("{\n \"path\": \"new directory/new name\"\n}") req, _ := http.NewRequest("PATCH", url, payload) req.Header.Add("X-API-KEY", " ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Move prompt require 'uri' require 'net/http' url = URI("https://api.humanloop.com/v5/prompts/pr_30gco7dx6JDq4200GVOHa") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Patch.new(url) request["X-API-KEY"] = ' ' request["Content-Type"] = 'application/json' request.body = "{\n \"path\": \"new directory/new name\"\n}" response = http.request(request) puts response.read_body ``` ```java Move prompt import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.patch("https://api.humanloop.com/v5/prompts/pr_30gco7dx6JDq4200GVOHa") .header("X-API-KEY", " ") .header("Content-Type", "application/json") .body("{\n \"path\": \"new directory/new name\"\n}") .asString(); ``` ```php Move prompt request('PATCH', 'https://api.humanloop.com/v5/prompts/pr_30gco7dx6JDq4200GVOHa', [ 'body' => '{ "path": "new directory/new name" }', 'headers' => [ 'Content-Type' => 'application/json', 'X-API-KEY' => ' ', ], ]); echo $response->getBody(); ``` ```csharp Move prompt using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/prompts/pr_30gco7dx6JDq4200GVOHa"); var request = new RestRequest(Method.PATCH); request.AddHeader("X-API-KEY", " "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"path\": \"new directory/new name\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Move prompt import Foundation let headers = [ "X-API-KEY": " ", "Content-Type": "application/json" ] let parameters = ["path": "new directory/new name"] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/prompts/pr_30gco7dx6JDq4200GVOHa")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "PATCH" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. # Populate Prompt template POST https://api.humanloop.com/v5/prompts/{id}/populate Content-Type: application/json Retrieve the Prompt with the given ID, including the populated template. By default, the deployed version of the Prompt is returned. Use the query parameters `version_id` or `environment` to target a specific version of the Prompt. Reference: https://humanloop.com/docs/api/prompts/populate ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /prompts/{id}/populate: post: operationId: populate summary: Populate Prompt template description: >- Retrieve the Prompt with the given ID, including the populated template. By default, the deployed version of the Prompt is returned. Use the query parameters `version_id` or `environment` to target a specific version of the Prompt. tags: - subpackage_prompts parameters: - name: id in: path description: Unique identifier for Prompt. required: true schema: type: string - name: version_id in: query description: >- A specific Version ID of the Prompt to retrieve to populate the template. required: false schema: type: string - name: environment in: query description: >- Name of the Environment to retrieve a deployed Version from to populate the template. required: false schema: type: string - name: X-API-KEY in: header required: true schema: type: string responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/type_:PopulateTemplateResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/type_:HttpValidationError' requestBody: content: application/json: schema: type: object additionalProperties: description: Any type servers: - url: https://api.humanloop.com/v5 components: schemas: type_:ModelEndpoints: type: string enum: - complete - chat - edit description: Supported model provider endpoints. title: ModelEndpoints type_:TextChatContent: type: object properties: type: type: string enum: - text text: type: string description: The message's text content. required: - type - text title: TextChatContent type_:ImageUrlDetail: type: string enum: - high - low - auto description: >- Specify the detail level of the image provided to the model. For more details see: https://platform.openai.com/docs/guides/vision/low-or-high-fidelity-image-understanding title: ImageUrlDetail type_:ImageUrl: type: object properties: url: type: string description: Either a URL of the image or the base64 encoded image data. detail: $ref: '#/components/schemas/type_:ImageUrlDetail' description: >- Specify the detail level of the image provided to the model. For more details see: https://platform.openai.com/docs/guides/vision/low-or-high-fidelity-image-understanding required: - url title: ImageUrl type_:ImageChatContent: type: object properties: type: type: string enum: - image_url image_url: $ref: '#/components/schemas/type_:ImageUrl' description: The message's image content. required: - type - image_url title: ImageChatContent type_:ChatMessageContentItem: oneOf: - $ref: '#/components/schemas/type_:TextChatContent' - $ref: '#/components/schemas/type_:ImageChatContent' title: ChatMessageContentItem type_:ChatMessageContent: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessageContentItem' description: The content of the message. title: ChatMessageContent type_:ChatRole: type: string enum: - user - assistant - system - tool - developer description: An enumeration. title: ChatRole type_:ChatToolType: type: string enum: - function description: The type of tool to call. title: ChatToolType type_:FunctionTool: type: object properties: name: type: string arguments: type: string required: - name description: A function tool to be called by the model where user owns runtime. title: FunctionTool type_:ToolCall: type: object properties: id: type: string type: $ref: '#/components/schemas/type_:ChatToolType' function: $ref: '#/components/schemas/type_:FunctionTool' required: - id - type - function description: A tool call to be made. title: ToolCall type_:AnthropicThinkingContent: type: object properties: type: type: string enum: - thinking thinking: type: string description: Model's chain-of-thought for providing the response. signature: type: string description: >- Cryptographic signature that verifies the thinking block was generated by Anthropic. required: - type - thinking - signature title: AnthropicThinkingContent type_:AnthropicRedactedThinkingContent: type: object properties: type: type: string enum: - redacted_thinking data: type: string description: >- Thinking block Anthropic redacted for safety reasons. User is expected to pass the block back to Anthropic required: - type - data title: AnthropicRedactedThinkingContent type_:ChatMessageThinkingItem: oneOf: - $ref: '#/components/schemas/type_:AnthropicThinkingContent' - $ref: '#/components/schemas/type_:AnthropicRedactedThinkingContent' title: ChatMessageThinkingItem type_:ChatMessage: type: object properties: content: $ref: '#/components/schemas/type_:ChatMessageContent' description: The content of the message. name: type: string description: Optional name of the message author. tool_call_id: type: string description: Tool call that this message is responding to. role: $ref: '#/components/schemas/type_:ChatRole' description: Role of the message author. tool_calls: type: array items: $ref: '#/components/schemas/type_:ToolCall' description: A list of tool calls requested by the assistant. thinking: type: array items: $ref: '#/components/schemas/type_:ChatMessageThinkingItem' description: >- Model's chain-of-thought for providing the response. Present on assistant messages if model supports it. required: - role title: ChatMessage type_:PopulateTemplateResponseTemplate: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: >- 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}}`. title: PopulateTemplateResponseTemplate type_:TemplateLanguage: type: string enum: - default - jinja description: Template engine to use for rendering templates. title: TemplateLanguage type_:ModelProviders: type: string enum: - anthropic - bedrock - cohere - deepseek - google - groq - mock - openai - openai_azure - replicate description: Supported model providers. title: ModelProviders type_:PopulateTemplateResponseStop: oneOf: - type: string - type: array items: type: string description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. title: PopulateTemplateResponseStop type_:ResponseFormatType: type: string enum: - json_object - json_schema title: ResponseFormatType type_:ResponseFormat: type: object properties: type: $ref: '#/components/schemas/type_:ResponseFormatType' json_schema: type: object additionalProperties: description: Any type description: The JSON schema of the response format if type is json_schema. required: - type description: Response format of the model. title: ResponseFormat type_:OpenAiReasoningEffort: type: string enum: - high - medium - low description: Supported reasoning effort. title: OpenAiReasoningEffort type_:PopulateTemplateResponseReasoningEffort: oneOf: - $ref: '#/components/schemas/type_:OpenAiReasoningEffort' - type: integer description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. title: PopulateTemplateResponseReasoningEffort type_:ToolFunction: type: object properties: name: type: string description: Name for the tool referenced by the model. description: type: string description: Description of the tool referenced by the model strict: type: boolean default: false description: >- If true, forces the model to output json data in the structure of the parameters schema. parameters: type: object additionalProperties: description: Any type description: >- Parameters needed to run the Tool, defined in JSON Schema format: https://json-schema.org/ required: - name - description title: ToolFunction type_:LinkedToolResponse: type: object properties: name: type: string description: Name for the tool referenced by the model. description: type: string description: Description of the tool referenced by the model strict: type: boolean default: false description: >- If true, forces the model to output json data in the structure of the parameters schema. parameters: type: object additionalProperties: description: Any type description: >- Parameters needed to run the Tool, defined in JSON Schema format: https://json-schema.org/ id: type: string description: Unique identifier for the Tool linked. version_id: type: string description: Unique identifier for the Tool Version linked. required: - name - description - id - version_id title: LinkedToolResponse type_:EnvironmentTag: type: string enum: - default - other description: An enumeration. title: EnvironmentTag type_:EnvironmentResponse: type: object properties: id: type: string created_at: type: string format: date-time name: type: string tag: $ref: '#/components/schemas/type_:EnvironmentTag' required: - id - created_at - name - tag title: EnvironmentResponse type_:UserResponse: description: Any type title: UserResponse type_:InputResponse: type: object properties: name: type: string description: Type of input. required: - name title: InputResponse type_:PromptResponseTemplate: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: >- 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}}`. title: PromptResponseTemplate type_:PromptResponseStop: oneOf: - type: string - type: array items: type: string description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. title: PromptResponseStop type_:PromptResponseReasoningEffort: oneOf: - $ref: '#/components/schemas/type_:OpenAiReasoningEffort' - type: integer description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. title: PromptResponseReasoningEffort type_:EvaluatorAggregate: type: object properties: value: type: number format: double description: The aggregated value of the evaluator. evaluator_id: type: string description: ID of the evaluator. evaluator_version_id: type: string description: ID of the evaluator version. created_at: type: string format: date-time updated_at: type: string format: date-time required: - value - evaluator_id - evaluator_version_id - created_at - updated_at title: EvaluatorAggregate type_:PromptResponse: type: object properties: path: type: string description: >- Path of the Prompt, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Prompt. directory_id: type: string description: ID of the directory that the file is in on Humanloop. model: type: string description: >- The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models) endpoint: $ref: '#/components/schemas/type_:ModelEndpoints' description: The provider model endpoint used. template: $ref: '#/components/schemas/type_:PromptResponseTemplate' description: >- 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}}`. template_language: $ref: '#/components/schemas/type_:TemplateLanguage' description: The template language to use for rendering the template. provider: $ref: '#/components/schemas/type_:ModelProviders' description: The company providing the underlying model service. max_tokens: type: integer default: -1 description: >- 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 temperature: type: number format: double default: 1 description: >- What sampling temperature to use when making a generation. Higher values means the model will be more creative. top_p: type: number format: double default: 1 description: >- An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. stop: $ref: '#/components/schemas/type_:PromptResponseStop' description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. presence_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far. frequency_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far. other: type: object additionalProperties: description: Any type description: Other parameter values to be passed to the provider call. seed: type: integer description: >- If specified, model will make a best effort to sample deterministically, but it is not guaranteed. response_format: $ref: '#/components/schemas/type_:ResponseFormat' description: >- The format of the response. Only `{"type": "json_object"}` is currently supported for chat. reasoning_effort: $ref: '#/components/schemas/type_:PromptResponseReasoningEffort' description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. tools: type: array items: $ref: '#/components/schemas/type_:ToolFunction' description: >- The tool specification that the model can choose to call if Tool calling is supported. linked_tools: type: array items: $ref: '#/components/schemas/type_:LinkedToolResponse' description: The tools linked to your prompt that the model can call. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used. version_name: type: string description: >- Unique name for the Prompt version. Version names must be unique for a given Prompt. version_description: type: string description: Description of the version, e.g., the changes made in this version. description: type: string description: Description of the Prompt. tags: type: array items: type: string description: List of tags associated with the file. readme: type: string description: Long description of the file. name: type: string description: Name of the Prompt. schema: type: object additionalProperties: description: Any type description: The JSON schema for the Prompt. version_id: type: string description: >- Unique identifier for the specific Prompt Version. If no query params provided, the default deployed Prompt Version is returned. type: type: string enum: - prompt environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Prompt Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Prompt. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Prompt Version total_logs_count: type: integer description: >- The number of logs that have been generated across all Prompt Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Prompt. Inputs correspond to any of the variables used within the Prompt template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Prompt that are used for monitoring logs. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Prompt Version. raw_file_content: type: string description: The raw content of the Prompt. Corresponds to the .prompt file. required: - path - id - model - name - version_id - created_at - updated_at - last_used_at - version_logs_count - total_logs_count - inputs description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: PromptResponse type_:FilesToolType: type: string enum: - pinecone_search - google - mock - snippet - json_schema - get_api_call - python description: Type of tool. title: FilesToolType type_:ToolResponse: type: object properties: path: type: string description: >- Path of the Tool, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Tool. directory_id: type: string description: ID of the directory that the file is in on Humanloop. function: $ref: '#/components/schemas/type_:ToolFunction' description: >- Callable function specification of the Tool shown to the model for tool calling. source_code: type: string description: Code source of the Tool. setup_values: type: object additionalProperties: description: Any type description: >- Values needed to setup the Tool, defined in JSON Schema format: https://json-schema.org/ attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Tool. Helpful to separate Tool versions from each other with details on how they were created or used. tool_type: $ref: '#/components/schemas/type_:FilesToolType' description: Type of Tool. version_name: type: string description: >- Unique identifier for this Tool version. Each Tool can only have one version with a given name. version_description: type: string description: Description of the Version. name: type: string description: Name of the Tool, which is used as a unique identifier. description: type: string description: Description of the Tool. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Tool Version. If no query params provided, the default deployed Tool Version is returned. type: type: string enum: - tool environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Tool Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Tool. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Tool Version total_logs_count: type: integer description: The number of logs that have been generated across all Tool Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Prompt. Inputs correspond to any of the variables used within the Tool template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Tool that are used for monitoring logs. signature: type: string description: Signature of the Tool. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Tool Version. required: - path - id - name - version_id - created_at - updated_at - last_used_at - version_logs_count - total_logs_count - inputs description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: ToolResponse type_:DatapointResponseTargetValue: oneOf: - type: string - type: integer - type: number format: double - type: boolean - type: array items: description: Any type - type: object additionalProperties: description: Any type title: DatapointResponseTargetValue type_:DatapointResponse: type: object properties: inputs: type: object additionalProperties: type: string description: The inputs to the prompt template. messages: type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: List of chat messages to provide to the model. target: type: object additionalProperties: $ref: '#/components/schemas/type_:DatapointResponseTargetValue' description: >- Object with criteria necessary to evaluate generations with this Datapoint. This is passed in as an argument to Evaluators when used in an Evaluation. id: type: string description: Unique identifier for the Datapoint. Starts with `dp_`. required: - id title: DatapointResponse type_:DatasetResponse: type: object properties: path: type: string description: >- Path of the Dataset, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Dataset. Starts with `ds_`. directory_id: type: string description: ID of the directory that the file is in on Humanloop. name: type: string description: Name of the Dataset, which is used as a unique identifier. description: type: string description: Description of the Dataset. schema: type: object additionalProperties: description: Any type description: The JSON schema for the File. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Dataset Version. If no query params provided, the default deployed Dataset Version is returned. Starts with `dsv_`. type: type: string enum: - dataset environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Dataset Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Dataset. last_used_at: type: string format: date-time version_name: type: string description: >- Unique name for the Dataset version. Version names must be unique for a given Dataset. version_description: type: string description: Description of the version, e.g., the changes made in this version. datapoints_count: type: integer description: The number of Datapoints in this Dataset version. datapoints: type: array items: $ref: '#/components/schemas/type_:DatapointResponse' description: >- The list of Datapoints in this Dataset version. Only provided if explicitly requested. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Dataset. Helpful to separate Dataset versions from each other with details on how they were created or used. required: - path - id - name - version_id - created_at - updated_at - last_used_at - datapoints_count description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: DatasetResponse type_:EvaluatorArgumentsType: type: string enum: - target_free - target_required description: Enum representing the possible argument types of an evaluator. title: EvaluatorArgumentsType type_:EvaluatorReturnTypeEnum: type: string enum: - boolean - number - select - multi_select - text description: Enum representing the possible return types of an evaluator. title: EvaluatorReturnTypeEnum type_:Valence: type: string enum: - positive - negative - neutral description: An enumeration. title: Valence type_:EvaluatorJudgmentOptionResponse: type: object properties: name: type: string description: The name of the option. valence: $ref: '#/components/schemas/type_:Valence' description: Whether this option should be considered positive or negative. required: - name title: EvaluatorJudgmentOptionResponse type_:EvaluatorJudgmentNumberLimit: type: object properties: min: type: number format: double description: The minimum value that can be selected. max: type: number format: double description: The maximum value that can be selected. step: type: number format: double description: The step size for the number input. title: EvaluatorJudgmentNumberLimit type_:PromptKernelRequestTemplate: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: >- 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}}`. title: PromptKernelRequestTemplate type_:PromptKernelRequestStop: oneOf: - type: string - type: array items: type: string description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. title: PromptKernelRequestStop type_:PromptKernelRequestReasoningEffort: oneOf: - $ref: '#/components/schemas/type_:OpenAiReasoningEffort' - type: integer description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. title: PromptKernelRequestReasoningEffort type_:PromptKernelRequest: type: object properties: model: type: string description: >- The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models) endpoint: $ref: '#/components/schemas/type_:ModelEndpoints' description: The provider model endpoint used. template: $ref: '#/components/schemas/type_:PromptKernelRequestTemplate' description: >- 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}}`. template_language: $ref: '#/components/schemas/type_:TemplateLanguage' description: The template language to use for rendering the template. provider: $ref: '#/components/schemas/type_:ModelProviders' description: The company providing the underlying model service. max_tokens: type: integer default: -1 description: >- 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 temperature: type: number format: double default: 1 description: >- What sampling temperature to use when making a generation. Higher values means the model will be more creative. top_p: type: number format: double default: 1 description: >- An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. stop: $ref: '#/components/schemas/type_:PromptKernelRequestStop' description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. presence_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far. frequency_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far. other: type: object additionalProperties: description: Any type description: Other parameter values to be passed to the provider call. seed: type: integer description: >- If specified, model will make a best effort to sample deterministically, but it is not guaranteed. response_format: $ref: '#/components/schemas/type_:ResponseFormat' description: >- The format of the response. Only `{"type": "json_object"}` is currently supported for chat. reasoning_effort: $ref: '#/components/schemas/type_:PromptKernelRequestReasoningEffort' description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. tools: type: array items: $ref: '#/components/schemas/type_:ToolFunction' description: >- The tool specification that the model can choose to call if Tool calling is supported. linked_tools: type: array items: type: string description: >- 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. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used. required: - model description: |- Base class used by both PromptKernelRequest and AgentKernelRequest. Contains the consistent Prompt-related fields. title: PromptKernelRequest type_:LlmEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:EvaluatorReturnTypeEnum' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: >- The options that can be applied as judgments. Only for Evaluators with `return_type` of 'boolean', 'select' or 'multi_select'. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - llm prompt: $ref: '#/components/schemas/type_:PromptKernelRequest' description: The prompt parameters used to generate. required: - arguments_type - return_type - evaluator_type title: LlmEvaluatorRequest type_:CodeEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:EvaluatorReturnTypeEnum' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: >- The options that can be applied as judgments. Only for Evaluators with `return_type` of 'boolean', 'select' or 'multi_select'. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - python code: type: string description: >- The code for the Evaluator. This code will be executed in a sandboxed environment. required: - arguments_type - return_type - evaluator_type - code title: CodeEvaluatorRequest type_:HumanEvaluatorRequestReturnType: type: string enum: - select - multi_select - text - number - boolean description: The type of the return value of the Evaluator. title: HumanEvaluatorRequestReturnType type_:HumanEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:HumanEvaluatorRequestReturnType' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: The options that can be applied as judgments. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - human instructions: type: string description: Instructions and guidelines for applying judgments. required: - arguments_type - return_type - evaluator_type title: HumanEvaluatorRequest type_:ExternalEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:EvaluatorReturnTypeEnum' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: >- The options that can be applied as judgments. Only for Evaluators with `return_type` of 'boolean', 'select' or 'multi_select'. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - external required: - arguments_type - return_type - evaluator_type title: ExternalEvaluatorRequest type_:EvaluatorResponseSpec: oneOf: - $ref: '#/components/schemas/type_:LlmEvaluatorRequest' - $ref: '#/components/schemas/type_:CodeEvaluatorRequest' - $ref: '#/components/schemas/type_:HumanEvaluatorRequest' - $ref: '#/components/schemas/type_:ExternalEvaluatorRequest' title: EvaluatorResponseSpec type_:EvaluatorResponse: type: object properties: path: type: string description: >- Path of the Evaluator including the Evaluator name, which is used as a unique identifier. id: type: string description: Unique identifier for the Evaluator. directory_id: type: string description: ID of the directory that the file is in on Humanloop. version_name: type: string description: >- Unique name for the Evaluator version. Version names must be unique for a given Evaluator. version_description: type: string description: Description of the version, e.g., the changes made in this version. spec: $ref: '#/components/schemas/type_:EvaluatorResponseSpec' name: type: string description: Name of the Evaluator, which is used as a unique identifier. description: type: string description: Description of the Evaluator. schema: type: object additionalProperties: description: Any type description: The JSON schema for the File. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Evaluator Version. If no query params provided, the default deployed Evaluator Version is returned. type: type: string enum: - evaluator environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Evaluator Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Evaluator. last_used_at: type: string format: date-time version_logs_count: type: integer description: >- The number of logs that have been generated for this Evaluator Version total_logs_count: type: integer description: >- The number of logs that have been generated across all Evaluator Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Evaluator. Inputs correspond to any of the variables used within the Evaluator template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Evaluator that are used for monitoring logs. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Evaluator Version. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. required: - path - id - spec - name - version_id - created_at - updated_at - last_used_at - version_logs_count - total_logs_count - inputs description: Version of the Evaluator used to provide judgments. title: EvaluatorResponse type_:FlowResponse: type: object properties: path: type: string description: >- Path of the Flow, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Flow. directory_id: type: string description: ID of the directory that the file is in on Humanloop. attributes: type: object additionalProperties: description: Any type description: A key-value object identifying the Flow Version. version_name: type: string description: >- Unique name for the Flow version. Version names must be unique for a given Flow. version_description: type: string description: Description of the Version. name: type: string description: Name of the Flow. description: type: string description: Description of the Flow. schema: type: object additionalProperties: description: Any type description: The JSON schema for the File. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Flow Version. If no query params provided, the default deployed Flow Version is returned. type: type: string enum: - flow environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Flow Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Flow. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Flow Version evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Flow Version. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: The list of Monitoring Evaluators associated with the Flow Version. required: - path - id - attributes - name - version_id - created_at - updated_at - last_used_at - version_logs_count description: Response model for a Flow. title: FlowResponse type_:AgentResponseTemplate: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: >- 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}}`. title: AgentResponseTemplate type_:AgentResponseStop: oneOf: - type: string - type: array items: type: string description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. title: AgentResponseStop type_:AgentResponseReasoningEffort: oneOf: - $ref: '#/components/schemas/type_:OpenAiReasoningEffort' - type: integer description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. title: AgentResponseReasoningEffort type_:LinkedFileRequest: type: object properties: file_id: type: string environment_id: type: string version_id: type: string required: - file_id title: LinkedFileRequest type_:OnAgentCallEnum: type: string enum: - stop - continue description: What an Agent should do when calling a Tool. title: OnAgentCallEnum type_:AgentLinkedFileResponseFile: oneOf: - $ref: '#/components/schemas/type_:PromptResponse' - $ref: '#/components/schemas/type_:ToolResponse' - $ref: '#/components/schemas/type_:DatasetResponse' - $ref: '#/components/schemas/type_:EvaluatorResponse' - $ref: '#/components/schemas/type_:FlowResponse' - $ref: '#/components/schemas/type_:AgentResponse' title: AgentLinkedFileResponseFile type_:AgentLinkedFileResponse: type: object properties: type: type: string enum: - file link: $ref: '#/components/schemas/type_:LinkedFileRequest' on_agent_call: $ref: '#/components/schemas/type_:OnAgentCallEnum' file: $ref: '#/components/schemas/type_:AgentLinkedFileResponseFile' required: - type - link title: AgentLinkedFileResponse type_:AgentInlineTool: type: object properties: type: type: string enum: - inline json_schema: $ref: '#/components/schemas/type_:ToolFunction' on_agent_call: $ref: '#/components/schemas/type_:OnAgentCallEnum' required: - type - json_schema title: AgentInlineTool type_:AgentResponseToolsItem: oneOf: - $ref: '#/components/schemas/type_:AgentLinkedFileResponse' - $ref: '#/components/schemas/type_:AgentInlineTool' title: AgentResponseToolsItem type_:VersionStatus: type: string enum: - uncommitted - committed - deleted description: An enumeration. title: VersionStatus type_:AgentResponse: type: object properties: path: type: string description: >- Path of the Agent, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Agent. directory_id: type: string description: ID of the directory that the file is in on Humanloop. model: type: string description: >- The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models) endpoint: $ref: '#/components/schemas/type_:ModelEndpoints' description: The provider model endpoint used. template: $ref: '#/components/schemas/type_:AgentResponseTemplate' description: >- 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}}`. template_language: $ref: '#/components/schemas/type_:TemplateLanguage' description: The template language to use for rendering the template. provider: $ref: '#/components/schemas/type_:ModelProviders' description: The company providing the underlying model service. max_tokens: type: integer default: -1 description: >- 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 temperature: type: number format: double default: 1 description: >- What sampling temperature to use when making a generation. Higher values means the model will be more creative. top_p: type: number format: double default: 1 description: >- An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. stop: $ref: '#/components/schemas/type_:AgentResponseStop' description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. presence_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far. frequency_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far. other: type: object additionalProperties: description: Any type description: Other parameter values to be passed to the provider call. seed: type: integer description: >- If specified, model will make a best effort to sample deterministically, but it is not guaranteed. response_format: $ref: '#/components/schemas/type_:ResponseFormat' description: >- The format of the response. Only `{"type": "json_object"}` is currently supported for chat. reasoning_effort: $ref: '#/components/schemas/type_:AgentResponseReasoningEffort' description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. tools: type: array items: $ref: '#/components/schemas/type_:AgentResponseToolsItem' description: >- List of tools that the Agent can call. These can be linked files or inline tools. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used. max_iterations: type: integer description: >- The maximum number of iterations the Agent can run. This is used to limit the number of times the Agent model is called. version_name: type: string description: >- Unique name for the Agent version. Version names must be unique for a given Agent. version_description: type: string description: Description of the version, e.g., the changes made in this version. description: type: string description: Description of the Agent. tags: type: array items: type: string description: List of tags associated with the file. readme: type: string description: Long description of the file. name: type: string description: Name of the Agent. schema: type: object additionalProperties: description: Any type description: The JSON schema for the Prompt. version_id: type: string description: >- Unique identifier for the specific Agent Version. If no query params provided, the default deployed Agent Version is returned. type: type: string enum: - agent environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Agent Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Agent. committed_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who committed the Agent Version. committed_at: type: string format: date-time description: The date and time the Agent Version was committed. status: $ref: '#/components/schemas/type_:VersionStatus' description: The status of the Agent Version. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Agent Version total_logs_count: type: integer description: >- The number of logs that have been generated across all Agent Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Agent. Inputs correspond to any of the variables used within the Agent template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Agent that are used for monitoring logs. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Agent Version. raw_file_content: type: string description: The raw content of the Agent. Corresponds to the .agent file. required: - path - id - model - tools - name - version_id - created_at - updated_at - status - last_used_at - version_logs_count - total_logs_count - inputs description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: AgentResponse type_:VersionDeploymentResponseFile: oneOf: - $ref: '#/components/schemas/type_:PromptResponse' - $ref: '#/components/schemas/type_:ToolResponse' - $ref: '#/components/schemas/type_:DatasetResponse' - $ref: '#/components/schemas/type_:EvaluatorResponse' - $ref: '#/components/schemas/type_:FlowResponse' - $ref: '#/components/schemas/type_:AgentResponse' description: The File that the deployed Version belongs to. title: VersionDeploymentResponseFile type_:VersionDeploymentResponse: type: object properties: file: $ref: '#/components/schemas/type_:VersionDeploymentResponseFile' description: The File that the deployed Version belongs to. environment: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The Environment that the Version is deployed to. type: type: string enum: - environment required: - file - environment - type description: A variable reference to the Version deployed to an Environment title: VersionDeploymentResponse type_:VersionIdResponseVersion: oneOf: - $ref: '#/components/schemas/type_:PromptResponse' - $ref: '#/components/schemas/type_:ToolResponse' - $ref: '#/components/schemas/type_:DatasetResponse' - $ref: '#/components/schemas/type_:EvaluatorResponse' - $ref: '#/components/schemas/type_:FlowResponse' - $ref: '#/components/schemas/type_:AgentResponse' description: The specific Version being referenced. title: VersionIdResponseVersion type_:VersionIdResponse: type: object properties: version: $ref: '#/components/schemas/type_:VersionIdResponseVersion' description: The specific Version being referenced. type: type: string enum: - version required: - version - type description: A reference to a specific Version by its ID title: VersionIdResponse type_:VersionReferenceResponse: oneOf: - $ref: '#/components/schemas/type_:VersionDeploymentResponse' - $ref: '#/components/schemas/type_:VersionIdResponse' title: VersionReferenceResponse type_:MonitoringEvaluatorState: type: string enum: - active - inactive description: State of an evaluator connected to a file title: MonitoringEvaluatorState type_:MonitoringEvaluatorResponse: type: object properties: version_reference: $ref: '#/components/schemas/type_:VersionReferenceResponse' description: >- The Evaluator Version used for monitoring. This can be a specific Version by ID, or a Version deployed to an Environment. version: $ref: '#/components/schemas/type_:EvaluatorResponse' description: The deployed Version. state: $ref: '#/components/schemas/type_:MonitoringEvaluatorState' description: The state of the Monitoring Evaluator. Either `active` or `inactive` created_at: type: string format: date-time updated_at: type: string format: date-time required: - version_reference - state - created_at - updated_at title: MonitoringEvaluatorResponse type_:PopulateTemplateResponsePopulatedTemplate: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: >- The template populated with the input values you provided in the request. Returns None if no template exists. title: PopulateTemplateResponsePopulatedTemplate type_:PopulateTemplateResponse: type: object properties: path: type: string description: >- Path of the Prompt, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Prompt. directory_id: type: string description: ID of the directory that the file is in on Humanloop. model: type: string description: >- The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models) endpoint: $ref: '#/components/schemas/type_:ModelEndpoints' description: The provider model endpoint used. template: $ref: '#/components/schemas/type_:PopulateTemplateResponseTemplate' description: >- 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}}`. template_language: $ref: '#/components/schemas/type_:TemplateLanguage' description: The template language to use for rendering the template. provider: $ref: '#/components/schemas/type_:ModelProviders' description: The company providing the underlying model service. max_tokens: type: integer default: -1 description: >- 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 temperature: type: number format: double default: 1 description: >- What sampling temperature to use when making a generation. Higher values means the model will be more creative. top_p: type: number format: double default: 1 description: >- An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. stop: $ref: '#/components/schemas/type_:PopulateTemplateResponseStop' description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. presence_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far. frequency_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far. other: type: object additionalProperties: description: Any type description: Other parameter values to be passed to the provider call. seed: type: integer description: >- If specified, model will make a best effort to sample deterministically, but it is not guaranteed. response_format: $ref: '#/components/schemas/type_:ResponseFormat' description: >- The format of the response. Only `{"type": "json_object"}` is currently supported for chat. reasoning_effort: $ref: '#/components/schemas/type_:PopulateTemplateResponseReasoningEffort' description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. tools: type: array items: $ref: '#/components/schemas/type_:ToolFunction' description: >- The tool specification that the model can choose to call if Tool calling is supported. linked_tools: type: array items: $ref: '#/components/schemas/type_:LinkedToolResponse' description: The tools linked to your prompt that the model can call. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used. version_name: type: string description: >- Unique name for the Prompt version. Version names must be unique for a given Prompt. version_description: type: string description: Description of the version, e.g., the changes made in this version. description: type: string description: Description of the Prompt. tags: type: array items: type: string description: List of tags associated with the file. readme: type: string description: Long description of the file. name: type: string description: Name of the Prompt. schema: type: object additionalProperties: description: Any type description: The JSON schema for the Prompt. version_id: type: string description: >- Unique identifier for the specific Prompt Version. If no query params provided, the default deployed Prompt Version is returned. type: type: string enum: - prompt environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Prompt Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Prompt. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Prompt Version total_logs_count: type: integer description: >- The number of logs that have been generated across all Prompt Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Prompt. Inputs correspond to any of the variables used within the Prompt template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Prompt that are used for monitoring logs. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Prompt Version. raw_file_content: type: string description: The raw content of the Prompt. Corresponds to the .prompt file. populated_template: $ref: '#/components/schemas/type_:PopulateTemplateResponsePopulatedTemplate' description: >- The template populated with the input values you provided in the request. Returns None if no template exists. required: - path - id - model - name - version_id - created_at - updated_at - last_used_at - version_logs_count - total_logs_count - inputs description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: PopulateTemplateResponse type_:ValidationErrorLocItem: oneOf: - type: string - type: integer title: ValidationErrorLocItem type_:ValidationError: type: object properties: loc: type: array items: $ref: '#/components/schemas/type_:ValidationErrorLocItem' msg: type: string type: type: string required: - loc - msg - type title: ValidationError type_:HttpValidationError: type: object properties: detail: type: array items: $ref: '#/components/schemas/type_:ValidationError' title: HttpValidationError securitySchemes: default: type: apiKey in: header name: X-API-KEY ``` ## SDK Code Examples ```python import requests url = "https://api.humanloop.com/v5/prompts/id/populate" payload = { "key": "value" } headers = { "X-API-KEY": " ", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```typescript import { HumanloopClient } from "humanloop"; const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); await client.prompts.populate("id", { body: { "key": "value" } }); ``` ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/prompts/id/populate" payload := strings.NewReader("{\n \"key\": \"value\"\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("X-API-KEY", " ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://api.humanloop.com/v5/prompts/id/populate") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["X-API-KEY"] = ' ' request["Content-Type"] = 'application/json' request.body = "{\n \"key\": \"value\"\n}" response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.humanloop.com/v5/prompts/id/populate") .header("X-API-KEY", " ") .header("Content-Type", "application/json") .body("{\n \"key\": \"value\"\n}") .asString(); ``` ```php request('POST', 'https://api.humanloop.com/v5/prompts/id/populate', [ 'body' => '{ "key": "value" }', 'headers' => [ 'Content-Type' => 'application/json', 'X-API-KEY' => ' ', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/prompts/id/populate"); var request = new RestRequest(Method.POST); request.AddHeader("X-API-KEY", " "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"key\": \"value\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "X-API-KEY": " ", "Content-Type": "application/json" ] let parameters = ["key": "value"] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/prompts/id/populate")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. # List Versions of a Prompt GET https://api.humanloop.com/v5/prompts/{id}/versions Get a list of all the versions of a Prompt. Reference: https://humanloop.com/docs/api/prompts/list-versions ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /prompts/{id}/versions: get: operationId: list-versions summary: List Versions of a Prompt description: Get a list of all the versions of a Prompt. tags: - subpackage_prompts parameters: - name: id in: path description: Unique identifier for Prompt. required: true schema: type: string - name: evaluator_aggregates in: query description: >- Whether to include Evaluator aggregate results for the versions in the response required: false schema: type: boolean - name: X-API-KEY in: header required: true schema: type: string responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/type_:ListPrompts' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/type_:HttpValidationError' servers: - url: https://api.humanloop.com/v5 components: schemas: type_:ModelEndpoints: type: string enum: - complete - chat - edit description: Supported model provider endpoints. title: ModelEndpoints type_:TextChatContent: type: object properties: type: type: string enum: - text text: type: string description: The message's text content. required: - type - text title: TextChatContent type_:ImageUrlDetail: type: string enum: - high - low - auto description: >- Specify the detail level of the image provided to the model. For more details see: https://platform.openai.com/docs/guides/vision/low-or-high-fidelity-image-understanding title: ImageUrlDetail type_:ImageUrl: type: object properties: url: type: string description: Either a URL of the image or the base64 encoded image data. detail: $ref: '#/components/schemas/type_:ImageUrlDetail' description: >- Specify the detail level of the image provided to the model. For more details see: https://platform.openai.com/docs/guides/vision/low-or-high-fidelity-image-understanding required: - url title: ImageUrl type_:ImageChatContent: type: object properties: type: type: string enum: - image_url image_url: $ref: '#/components/schemas/type_:ImageUrl' description: The message's image content. required: - type - image_url title: ImageChatContent type_:ChatMessageContentItem: oneOf: - $ref: '#/components/schemas/type_:TextChatContent' - $ref: '#/components/schemas/type_:ImageChatContent' title: ChatMessageContentItem type_:ChatMessageContent: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessageContentItem' description: The content of the message. title: ChatMessageContent type_:ChatRole: type: string enum: - user - assistant - system - tool - developer description: An enumeration. title: ChatRole type_:ChatToolType: type: string enum: - function description: The type of tool to call. title: ChatToolType type_:FunctionTool: type: object properties: name: type: string arguments: type: string required: - name description: A function tool to be called by the model where user owns runtime. title: FunctionTool type_:ToolCall: type: object properties: id: type: string type: $ref: '#/components/schemas/type_:ChatToolType' function: $ref: '#/components/schemas/type_:FunctionTool' required: - id - type - function description: A tool call to be made. title: ToolCall type_:AnthropicThinkingContent: type: object properties: type: type: string enum: - thinking thinking: type: string description: Model's chain-of-thought for providing the response. signature: type: string description: >- Cryptographic signature that verifies the thinking block was generated by Anthropic. required: - type - thinking - signature title: AnthropicThinkingContent type_:AnthropicRedactedThinkingContent: type: object properties: type: type: string enum: - redacted_thinking data: type: string description: >- Thinking block Anthropic redacted for safety reasons. User is expected to pass the block back to Anthropic required: - type - data title: AnthropicRedactedThinkingContent type_:ChatMessageThinkingItem: oneOf: - $ref: '#/components/schemas/type_:AnthropicThinkingContent' - $ref: '#/components/schemas/type_:AnthropicRedactedThinkingContent' title: ChatMessageThinkingItem type_:ChatMessage: type: object properties: content: $ref: '#/components/schemas/type_:ChatMessageContent' description: The content of the message. name: type: string description: Optional name of the message author. tool_call_id: type: string description: Tool call that this message is responding to. role: $ref: '#/components/schemas/type_:ChatRole' description: Role of the message author. tool_calls: type: array items: $ref: '#/components/schemas/type_:ToolCall' description: A list of tool calls requested by the assistant. thinking: type: array items: $ref: '#/components/schemas/type_:ChatMessageThinkingItem' description: >- Model's chain-of-thought for providing the response. Present on assistant messages if model supports it. required: - role title: ChatMessage type_:PromptResponseTemplate: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: >- 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}}`. title: PromptResponseTemplate type_:TemplateLanguage: type: string enum: - default - jinja description: Template engine to use for rendering templates. title: TemplateLanguage type_:ModelProviders: type: string enum: - anthropic - bedrock - cohere - deepseek - google - groq - mock - openai - openai_azure - replicate description: Supported model providers. title: ModelProviders type_:PromptResponseStop: oneOf: - type: string - type: array items: type: string description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. title: PromptResponseStop type_:ResponseFormatType: type: string enum: - json_object - json_schema title: ResponseFormatType type_:ResponseFormat: type: object properties: type: $ref: '#/components/schemas/type_:ResponseFormatType' json_schema: type: object additionalProperties: description: Any type description: The JSON schema of the response format if type is json_schema. required: - type description: Response format of the model. title: ResponseFormat type_:OpenAiReasoningEffort: type: string enum: - high - medium - low description: Supported reasoning effort. title: OpenAiReasoningEffort type_:PromptResponseReasoningEffort: oneOf: - $ref: '#/components/schemas/type_:OpenAiReasoningEffort' - type: integer description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. title: PromptResponseReasoningEffort type_:ToolFunction: type: object properties: name: type: string description: Name for the tool referenced by the model. description: type: string description: Description of the tool referenced by the model strict: type: boolean default: false description: >- If true, forces the model to output json data in the structure of the parameters schema. parameters: type: object additionalProperties: description: Any type description: >- Parameters needed to run the Tool, defined in JSON Schema format: https://json-schema.org/ required: - name - description title: ToolFunction type_:LinkedToolResponse: type: object properties: name: type: string description: Name for the tool referenced by the model. description: type: string description: Description of the tool referenced by the model strict: type: boolean default: false description: >- If true, forces the model to output json data in the structure of the parameters schema. parameters: type: object additionalProperties: description: Any type description: >- Parameters needed to run the Tool, defined in JSON Schema format: https://json-schema.org/ id: type: string description: Unique identifier for the Tool linked. version_id: type: string description: Unique identifier for the Tool Version linked. required: - name - description - id - version_id title: LinkedToolResponse type_:EnvironmentTag: type: string enum: - default - other description: An enumeration. title: EnvironmentTag type_:EnvironmentResponse: type: object properties: id: type: string created_at: type: string format: date-time name: type: string tag: $ref: '#/components/schemas/type_:EnvironmentTag' required: - id - created_at - name - tag title: EnvironmentResponse type_:UserResponse: description: Any type title: UserResponse type_:InputResponse: type: object properties: name: type: string description: Type of input. required: - name title: InputResponse type_:FilesToolType: type: string enum: - pinecone_search - google - mock - snippet - json_schema - get_api_call - python description: Type of tool. title: FilesToolType type_:EvaluatorAggregate: type: object properties: value: type: number format: double description: The aggregated value of the evaluator. evaluator_id: type: string description: ID of the evaluator. evaluator_version_id: type: string description: ID of the evaluator version. created_at: type: string format: date-time updated_at: type: string format: date-time required: - value - evaluator_id - evaluator_version_id - created_at - updated_at title: EvaluatorAggregate type_:ToolResponse: type: object properties: path: type: string description: >- Path of the Tool, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Tool. directory_id: type: string description: ID of the directory that the file is in on Humanloop. function: $ref: '#/components/schemas/type_:ToolFunction' description: >- Callable function specification of the Tool shown to the model for tool calling. source_code: type: string description: Code source of the Tool. setup_values: type: object additionalProperties: description: Any type description: >- Values needed to setup the Tool, defined in JSON Schema format: https://json-schema.org/ attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Tool. Helpful to separate Tool versions from each other with details on how they were created or used. tool_type: $ref: '#/components/schemas/type_:FilesToolType' description: Type of Tool. version_name: type: string description: >- Unique identifier for this Tool version. Each Tool can only have one version with a given name. version_description: type: string description: Description of the Version. name: type: string description: Name of the Tool, which is used as a unique identifier. description: type: string description: Description of the Tool. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Tool Version. If no query params provided, the default deployed Tool Version is returned. type: type: string enum: - tool environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Tool Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Tool. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Tool Version total_logs_count: type: integer description: The number of logs that have been generated across all Tool Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Prompt. Inputs correspond to any of the variables used within the Tool template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Tool that are used for monitoring logs. signature: type: string description: Signature of the Tool. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Tool Version. required: - path - id - name - version_id - created_at - updated_at - last_used_at - version_logs_count - total_logs_count - inputs description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: ToolResponse type_:DatapointResponseTargetValue: oneOf: - type: string - type: integer - type: number format: double - type: boolean - type: array items: description: Any type - type: object additionalProperties: description: Any type title: DatapointResponseTargetValue type_:DatapointResponse: type: object properties: inputs: type: object additionalProperties: type: string description: The inputs to the prompt template. messages: type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: List of chat messages to provide to the model. target: type: object additionalProperties: $ref: '#/components/schemas/type_:DatapointResponseTargetValue' description: >- Object with criteria necessary to evaluate generations with this Datapoint. This is passed in as an argument to Evaluators when used in an Evaluation. id: type: string description: Unique identifier for the Datapoint. Starts with `dp_`. required: - id title: DatapointResponse type_:DatasetResponse: type: object properties: path: type: string description: >- Path of the Dataset, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Dataset. Starts with `ds_`. directory_id: type: string description: ID of the directory that the file is in on Humanloop. name: type: string description: Name of the Dataset, which is used as a unique identifier. description: type: string description: Description of the Dataset. schema: type: object additionalProperties: description: Any type description: The JSON schema for the File. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Dataset Version. If no query params provided, the default deployed Dataset Version is returned. Starts with `dsv_`. type: type: string enum: - dataset environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Dataset Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Dataset. last_used_at: type: string format: date-time version_name: type: string description: >- Unique name for the Dataset version. Version names must be unique for a given Dataset. version_description: type: string description: Description of the version, e.g., the changes made in this version. datapoints_count: type: integer description: The number of Datapoints in this Dataset version. datapoints: type: array items: $ref: '#/components/schemas/type_:DatapointResponse' description: >- The list of Datapoints in this Dataset version. Only provided if explicitly requested. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Dataset. Helpful to separate Dataset versions from each other with details on how they were created or used. required: - path - id - name - version_id - created_at - updated_at - last_used_at - datapoints_count description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: DatasetResponse type_:EvaluatorArgumentsType: type: string enum: - target_free - target_required description: Enum representing the possible argument types of an evaluator. title: EvaluatorArgumentsType type_:EvaluatorReturnTypeEnum: type: string enum: - boolean - number - select - multi_select - text description: Enum representing the possible return types of an evaluator. title: EvaluatorReturnTypeEnum type_:Valence: type: string enum: - positive - negative - neutral description: An enumeration. title: Valence type_:EvaluatorJudgmentOptionResponse: type: object properties: name: type: string description: The name of the option. valence: $ref: '#/components/schemas/type_:Valence' description: Whether this option should be considered positive or negative. required: - name title: EvaluatorJudgmentOptionResponse type_:EvaluatorJudgmentNumberLimit: type: object properties: min: type: number format: double description: The minimum value that can be selected. max: type: number format: double description: The maximum value that can be selected. step: type: number format: double description: The step size for the number input. title: EvaluatorJudgmentNumberLimit type_:PromptKernelRequestTemplate: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: >- 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}}`. title: PromptKernelRequestTemplate type_:PromptKernelRequestStop: oneOf: - type: string - type: array items: type: string description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. title: PromptKernelRequestStop type_:PromptKernelRequestReasoningEffort: oneOf: - $ref: '#/components/schemas/type_:OpenAiReasoningEffort' - type: integer description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. title: PromptKernelRequestReasoningEffort type_:PromptKernelRequest: type: object properties: model: type: string description: >- The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models) endpoint: $ref: '#/components/schemas/type_:ModelEndpoints' description: The provider model endpoint used. template: $ref: '#/components/schemas/type_:PromptKernelRequestTemplate' description: >- 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}}`. template_language: $ref: '#/components/schemas/type_:TemplateLanguage' description: The template language to use for rendering the template. provider: $ref: '#/components/schemas/type_:ModelProviders' description: The company providing the underlying model service. max_tokens: type: integer default: -1 description: >- 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 temperature: type: number format: double default: 1 description: >- What sampling temperature to use when making a generation. Higher values means the model will be more creative. top_p: type: number format: double default: 1 description: >- An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. stop: $ref: '#/components/schemas/type_:PromptKernelRequestStop' description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. presence_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far. frequency_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far. other: type: object additionalProperties: description: Any type description: Other parameter values to be passed to the provider call. seed: type: integer description: >- If specified, model will make a best effort to sample deterministically, but it is not guaranteed. response_format: $ref: '#/components/schemas/type_:ResponseFormat' description: >- The format of the response. Only `{"type": "json_object"}` is currently supported for chat. reasoning_effort: $ref: '#/components/schemas/type_:PromptKernelRequestReasoningEffort' description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. tools: type: array items: $ref: '#/components/schemas/type_:ToolFunction' description: >- The tool specification that the model can choose to call if Tool calling is supported. linked_tools: type: array items: type: string description: >- 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. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used. required: - model description: |- Base class used by both PromptKernelRequest and AgentKernelRequest. Contains the consistent Prompt-related fields. title: PromptKernelRequest type_:LlmEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:EvaluatorReturnTypeEnum' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: >- The options that can be applied as judgments. Only for Evaluators with `return_type` of 'boolean', 'select' or 'multi_select'. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - llm prompt: $ref: '#/components/schemas/type_:PromptKernelRequest' description: The prompt parameters used to generate. required: - arguments_type - return_type - evaluator_type title: LlmEvaluatorRequest type_:CodeEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:EvaluatorReturnTypeEnum' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: >- The options that can be applied as judgments. Only for Evaluators with `return_type` of 'boolean', 'select' or 'multi_select'. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - python code: type: string description: >- The code for the Evaluator. This code will be executed in a sandboxed environment. required: - arguments_type - return_type - evaluator_type - code title: CodeEvaluatorRequest type_:HumanEvaluatorRequestReturnType: type: string enum: - select - multi_select - text - number - boolean description: The type of the return value of the Evaluator. title: HumanEvaluatorRequestReturnType type_:HumanEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:HumanEvaluatorRequestReturnType' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: The options that can be applied as judgments. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - human instructions: type: string description: Instructions and guidelines for applying judgments. required: - arguments_type - return_type - evaluator_type title: HumanEvaluatorRequest type_:ExternalEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:EvaluatorReturnTypeEnum' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: >- The options that can be applied as judgments. Only for Evaluators with `return_type` of 'boolean', 'select' or 'multi_select'. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - external required: - arguments_type - return_type - evaluator_type title: ExternalEvaluatorRequest type_:EvaluatorResponseSpec: oneOf: - $ref: '#/components/schemas/type_:LlmEvaluatorRequest' - $ref: '#/components/schemas/type_:CodeEvaluatorRequest' - $ref: '#/components/schemas/type_:HumanEvaluatorRequest' - $ref: '#/components/schemas/type_:ExternalEvaluatorRequest' title: EvaluatorResponseSpec type_:EvaluatorResponse: type: object properties: path: type: string description: >- Path of the Evaluator including the Evaluator name, which is used as a unique identifier. id: type: string description: Unique identifier for the Evaluator. directory_id: type: string description: ID of the directory that the file is in on Humanloop. version_name: type: string description: >- Unique name for the Evaluator version. Version names must be unique for a given Evaluator. version_description: type: string description: Description of the version, e.g., the changes made in this version. spec: $ref: '#/components/schemas/type_:EvaluatorResponseSpec' name: type: string description: Name of the Evaluator, which is used as a unique identifier. description: type: string description: Description of the Evaluator. schema: type: object additionalProperties: description: Any type description: The JSON schema for the File. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Evaluator Version. If no query params provided, the default deployed Evaluator Version is returned. type: type: string enum: - evaluator environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Evaluator Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Evaluator. last_used_at: type: string format: date-time version_logs_count: type: integer description: >- The number of logs that have been generated for this Evaluator Version total_logs_count: type: integer description: >- The number of logs that have been generated across all Evaluator Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Evaluator. Inputs correspond to any of the variables used within the Evaluator template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Evaluator that are used for monitoring logs. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Evaluator Version. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. required: - path - id - spec - name - version_id - created_at - updated_at - last_used_at - version_logs_count - total_logs_count - inputs description: Version of the Evaluator used to provide judgments. title: EvaluatorResponse type_:FlowResponse: type: object properties: path: type: string description: >- Path of the Flow, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Flow. directory_id: type: string description: ID of the directory that the file is in on Humanloop. attributes: type: object additionalProperties: description: Any type description: A key-value object identifying the Flow Version. version_name: type: string description: >- Unique name for the Flow version. Version names must be unique for a given Flow. version_description: type: string description: Description of the Version. name: type: string description: Name of the Flow. description: type: string description: Description of the Flow. schema: type: object additionalProperties: description: Any type description: The JSON schema for the File. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Flow Version. If no query params provided, the default deployed Flow Version is returned. type: type: string enum: - flow environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Flow Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Flow. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Flow Version evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Flow Version. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: The list of Monitoring Evaluators associated with the Flow Version. required: - path - id - attributes - name - version_id - created_at - updated_at - last_used_at - version_logs_count description: Response model for a Flow. title: FlowResponse type_:AgentResponseTemplate: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: >- 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}}`. title: AgentResponseTemplate type_:AgentResponseStop: oneOf: - type: string - type: array items: type: string description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. title: AgentResponseStop type_:AgentResponseReasoningEffort: oneOf: - $ref: '#/components/schemas/type_:OpenAiReasoningEffort' - type: integer description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. title: AgentResponseReasoningEffort type_:LinkedFileRequest: type: object properties: file_id: type: string environment_id: type: string version_id: type: string required: - file_id title: LinkedFileRequest type_:OnAgentCallEnum: type: string enum: - stop - continue description: What an Agent should do when calling a Tool. title: OnAgentCallEnum type_:AgentLinkedFileResponseFile: oneOf: - $ref: '#/components/schemas/type_:PromptResponse' - $ref: '#/components/schemas/type_:ToolResponse' - $ref: '#/components/schemas/type_:DatasetResponse' - $ref: '#/components/schemas/type_:EvaluatorResponse' - $ref: '#/components/schemas/type_:FlowResponse' - $ref: '#/components/schemas/type_:AgentResponse' title: AgentLinkedFileResponseFile type_:AgentLinkedFileResponse: type: object properties: type: type: string enum: - file link: $ref: '#/components/schemas/type_:LinkedFileRequest' on_agent_call: $ref: '#/components/schemas/type_:OnAgentCallEnum' file: $ref: '#/components/schemas/type_:AgentLinkedFileResponseFile' required: - type - link title: AgentLinkedFileResponse type_:AgentInlineTool: type: object properties: type: type: string enum: - inline json_schema: $ref: '#/components/schemas/type_:ToolFunction' on_agent_call: $ref: '#/components/schemas/type_:OnAgentCallEnum' required: - type - json_schema title: AgentInlineTool type_:AgentResponseToolsItem: oneOf: - $ref: '#/components/schemas/type_:AgentLinkedFileResponse' - $ref: '#/components/schemas/type_:AgentInlineTool' title: AgentResponseToolsItem type_:VersionStatus: type: string enum: - uncommitted - committed - deleted description: An enumeration. title: VersionStatus type_:AgentResponse: type: object properties: path: type: string description: >- Path of the Agent, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Agent. directory_id: type: string description: ID of the directory that the file is in on Humanloop. model: type: string description: >- The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models) endpoint: $ref: '#/components/schemas/type_:ModelEndpoints' description: The provider model endpoint used. template: $ref: '#/components/schemas/type_:AgentResponseTemplate' description: >- 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}}`. template_language: $ref: '#/components/schemas/type_:TemplateLanguage' description: The template language to use for rendering the template. provider: $ref: '#/components/schemas/type_:ModelProviders' description: The company providing the underlying model service. max_tokens: type: integer default: -1 description: >- 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 temperature: type: number format: double default: 1 description: >- What sampling temperature to use when making a generation. Higher values means the model will be more creative. top_p: type: number format: double default: 1 description: >- An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. stop: $ref: '#/components/schemas/type_:AgentResponseStop' description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. presence_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far. frequency_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far. other: type: object additionalProperties: description: Any type description: Other parameter values to be passed to the provider call. seed: type: integer description: >- If specified, model will make a best effort to sample deterministically, but it is not guaranteed. response_format: $ref: '#/components/schemas/type_:ResponseFormat' description: >- The format of the response. Only `{"type": "json_object"}` is currently supported for chat. reasoning_effort: $ref: '#/components/schemas/type_:AgentResponseReasoningEffort' description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. tools: type: array items: $ref: '#/components/schemas/type_:AgentResponseToolsItem' description: >- List of tools that the Agent can call. These can be linked files or inline tools. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used. max_iterations: type: integer description: >- The maximum number of iterations the Agent can run. This is used to limit the number of times the Agent model is called. version_name: type: string description: >- Unique name for the Agent version. Version names must be unique for a given Agent. version_description: type: string description: Description of the version, e.g., the changes made in this version. description: type: string description: Description of the Agent. tags: type: array items: type: string description: List of tags associated with the file. readme: type: string description: Long description of the file. name: type: string description: Name of the Agent. schema: type: object additionalProperties: description: Any type description: The JSON schema for the Prompt. version_id: type: string description: >- Unique identifier for the specific Agent Version. If no query params provided, the default deployed Agent Version is returned. type: type: string enum: - agent environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Agent Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Agent. committed_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who committed the Agent Version. committed_at: type: string format: date-time description: The date and time the Agent Version was committed. status: $ref: '#/components/schemas/type_:VersionStatus' description: The status of the Agent Version. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Agent Version total_logs_count: type: integer description: >- The number of logs that have been generated across all Agent Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Agent. Inputs correspond to any of the variables used within the Agent template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Agent that are used for monitoring logs. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Agent Version. raw_file_content: type: string description: The raw content of the Agent. Corresponds to the .agent file. required: - path - id - model - tools - name - version_id - created_at - updated_at - status - last_used_at - version_logs_count - total_logs_count - inputs description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: AgentResponse type_:VersionDeploymentResponseFile: oneOf: - $ref: '#/components/schemas/type_:PromptResponse' - $ref: '#/components/schemas/type_:ToolResponse' - $ref: '#/components/schemas/type_:DatasetResponse' - $ref: '#/components/schemas/type_:EvaluatorResponse' - $ref: '#/components/schemas/type_:FlowResponse' - $ref: '#/components/schemas/type_:AgentResponse' description: The File that the deployed Version belongs to. title: VersionDeploymentResponseFile type_:VersionDeploymentResponse: type: object properties: file: $ref: '#/components/schemas/type_:VersionDeploymentResponseFile' description: The File that the deployed Version belongs to. environment: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The Environment that the Version is deployed to. type: type: string enum: - environment required: - file - environment - type description: A variable reference to the Version deployed to an Environment title: VersionDeploymentResponse type_:VersionIdResponseVersion: oneOf: - $ref: '#/components/schemas/type_:PromptResponse' - $ref: '#/components/schemas/type_:ToolResponse' - $ref: '#/components/schemas/type_:DatasetResponse' - $ref: '#/components/schemas/type_:EvaluatorResponse' - $ref: '#/components/schemas/type_:FlowResponse' - $ref: '#/components/schemas/type_:AgentResponse' description: The specific Version being referenced. title: VersionIdResponseVersion type_:VersionIdResponse: type: object properties: version: $ref: '#/components/schemas/type_:VersionIdResponseVersion' description: The specific Version being referenced. type: type: string enum: - version required: - version - type description: A reference to a specific Version by its ID title: VersionIdResponse type_:VersionReferenceResponse: oneOf: - $ref: '#/components/schemas/type_:VersionDeploymentResponse' - $ref: '#/components/schemas/type_:VersionIdResponse' title: VersionReferenceResponse type_:MonitoringEvaluatorState: type: string enum: - active - inactive description: State of an evaluator connected to a file title: MonitoringEvaluatorState type_:MonitoringEvaluatorResponse: type: object properties: version_reference: $ref: '#/components/schemas/type_:VersionReferenceResponse' description: >- The Evaluator Version used for monitoring. This can be a specific Version by ID, or a Version deployed to an Environment. version: $ref: '#/components/schemas/type_:EvaluatorResponse' description: The deployed Version. state: $ref: '#/components/schemas/type_:MonitoringEvaluatorState' description: The state of the Monitoring Evaluator. Either `active` or `inactive` created_at: type: string format: date-time updated_at: type: string format: date-time required: - version_reference - state - created_at - updated_at title: MonitoringEvaluatorResponse type_:PromptResponse: type: object properties: path: type: string description: >- Path of the Prompt, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Prompt. directory_id: type: string description: ID of the directory that the file is in on Humanloop. model: type: string description: >- The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models) endpoint: $ref: '#/components/schemas/type_:ModelEndpoints' description: The provider model endpoint used. template: $ref: '#/components/schemas/type_:PromptResponseTemplate' description: >- 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}}`. template_language: $ref: '#/components/schemas/type_:TemplateLanguage' description: The template language to use for rendering the template. provider: $ref: '#/components/schemas/type_:ModelProviders' description: The company providing the underlying model service. max_tokens: type: integer default: -1 description: >- 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 temperature: type: number format: double default: 1 description: >- What sampling temperature to use when making a generation. Higher values means the model will be more creative. top_p: type: number format: double default: 1 description: >- An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. stop: $ref: '#/components/schemas/type_:PromptResponseStop' description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. presence_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far. frequency_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far. other: type: object additionalProperties: description: Any type description: Other parameter values to be passed to the provider call. seed: type: integer description: >- If specified, model will make a best effort to sample deterministically, but it is not guaranteed. response_format: $ref: '#/components/schemas/type_:ResponseFormat' description: >- The format of the response. Only `{"type": "json_object"}` is currently supported for chat. reasoning_effort: $ref: '#/components/schemas/type_:PromptResponseReasoningEffort' description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. tools: type: array items: $ref: '#/components/schemas/type_:ToolFunction' description: >- The tool specification that the model can choose to call if Tool calling is supported. linked_tools: type: array items: $ref: '#/components/schemas/type_:LinkedToolResponse' description: The tools linked to your prompt that the model can call. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used. version_name: type: string description: >- Unique name for the Prompt version. Version names must be unique for a given Prompt. version_description: type: string description: Description of the version, e.g., the changes made in this version. description: type: string description: Description of the Prompt. tags: type: array items: type: string description: List of tags associated with the file. readme: type: string description: Long description of the file. name: type: string description: Name of the Prompt. schema: type: object additionalProperties: description: Any type description: The JSON schema for the Prompt. version_id: type: string description: >- Unique identifier for the specific Prompt Version. If no query params provided, the default deployed Prompt Version is returned. type: type: string enum: - prompt environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Prompt Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Prompt. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Prompt Version total_logs_count: type: integer description: >- The number of logs that have been generated across all Prompt Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Prompt. Inputs correspond to any of the variables used within the Prompt template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Prompt that are used for monitoring logs. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Prompt Version. raw_file_content: type: string description: The raw content of the Prompt. Corresponds to the .prompt file. required: - path - id - model - name - version_id - created_at - updated_at - last_used_at - version_logs_count - total_logs_count - inputs description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: PromptResponse type_:ListPrompts: type: object properties: records: type: array items: $ref: '#/components/schemas/type_:PromptResponse' description: The list of Prompts. required: - records title: ListPrompts type_:ValidationErrorLocItem: oneOf: - type: string - type: integer title: ValidationErrorLocItem type_:ValidationError: type: object properties: loc: type: array items: $ref: '#/components/schemas/type_:ValidationErrorLocItem' msg: type: string type: type: string required: - loc - msg - type title: ValidationError type_:HttpValidationError: type: object properties: detail: type: array items: $ref: '#/components/schemas/type_:ValidationError' title: HttpValidationError securitySchemes: default: type: apiKey in: header name: X-API-KEY ``` ## SDK Code Examples ```python List versions import requests url = "https://api.humanloop.com/v5/prompts/pr_30gco7dx6JDq4200GVOHa/versions" headers = {"X-API-KEY": " "} response = requests.get(url, headers=headers) print(response.json()) ``` ```typescript List versions import { HumanloopClient } from "humanloop"; const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); await client.prompts.listVersions("pr_30gco7dx6JDq4200GVOHa"); ``` ```go List versions package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/prompts/pr_30gco7dx6JDq4200GVOHa/versions" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("X-API-KEY", " ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby List versions require 'uri' require 'net/http' url = URI("https://api.humanloop.com/v5/prompts/pr_30gco7dx6JDq4200GVOHa/versions") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["X-API-KEY"] = ' ' response = http.request(request) puts response.read_body ``` ```java List versions import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api.humanloop.com/v5/prompts/pr_30gco7dx6JDq4200GVOHa/versions") .header("X-API-KEY", " ") .asString(); ``` ```php List versions request('GET', 'https://api.humanloop.com/v5/prompts/pr_30gco7dx6JDq4200GVOHa/versions', [ 'headers' => [ 'X-API-KEY' => ' ', ], ]); echo $response->getBody(); ``` ```csharp List versions using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/prompts/pr_30gco7dx6JDq4200GVOHa/versions"); var request = new RestRequest(Method.GET); request.AddHeader("X-API-KEY", " "); IRestResponse response = client.Execute(request); ``` ```swift List versions import Foundation let headers = ["X-API-KEY": " "] let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/prompts/pr_30gco7dx6JDq4200GVOHa/versions")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. # Delete Prompt Version DELETE https://api.humanloop.com/v5/prompts/{id}/versions/{version_id} Delete a version of the Prompt. Reference: https://humanloop.com/docs/api/prompts/delete-prompt-version ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /prompts/{id}/versions/{version_id}: delete: operationId: delete-prompt-version summary: Delete Prompt Version description: Delete a version of the Prompt. tags: - subpackage_prompts parameters: - name: id in: path description: Unique identifier for Prompt. required: true schema: type: string - name: version_id in: path description: Unique identifier for the specific version of the Prompt. required: true schema: type: string - name: X-API-KEY in: header required: true schema: type: string responses: '200': description: Successful response '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/type_:HttpValidationError' servers: - url: https://api.humanloop.com/v5 components: schemas: type_:ValidationErrorLocItem: oneOf: - type: string - type: integer title: ValidationErrorLocItem type_:ValidationError: type: object properties: loc: type: array items: $ref: '#/components/schemas/type_:ValidationErrorLocItem' msg: type: string type: type: string required: - loc - msg - type title: ValidationError type_:HttpValidationError: type: object properties: detail: type: array items: $ref: '#/components/schemas/type_:ValidationError' title: HttpValidationError securitySchemes: default: type: apiKey in: header name: X-API-KEY ``` ## SDK Code Examples ```python import requests url = "https://api.humanloop.com/v5/prompts/id/versions/version_id" headers = {"X-API-KEY": " "} response = requests.delete(url, headers=headers) print(response.json()) ``` ```typescript import { HumanloopClient } from "humanloop"; const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); await client.prompts.deletePromptVersion("id", "version_id"); ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/prompts/id/versions/version_id" req, _ := http.NewRequest("DELETE", url, nil) req.Header.Add("X-API-KEY", " ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://api.humanloop.com/v5/prompts/id/versions/version_id") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Delete.new(url) request["X-API-KEY"] = ' ' response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.delete("https://api.humanloop.com/v5/prompts/id/versions/version_id") .header("X-API-KEY", " ") .asString(); ``` ```php request('DELETE', 'https://api.humanloop.com/v5/prompts/id/versions/version_id', [ 'headers' => [ 'X-API-KEY' => ' ', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/prompts/id/versions/version_id"); var request = new RestRequest(Method.DELETE); request.AddHeader("X-API-KEY", " "); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = ["X-API-KEY": " "] let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/prompts/id/versions/version_id")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "DELETE" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. # Update Prompt Version PATCH https://api.humanloop.com/v5/prompts/{id}/versions/{version_id} Content-Type: application/json Update the name or description of the Prompt version. Reference: https://humanloop.com/docs/api/prompts/patch-prompt-version ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /prompts/{id}/versions/{version_id}: patch: operationId: patch-prompt-version summary: Update Prompt Version description: Update the name or description of the Prompt version. tags: - subpackage_prompts parameters: - name: id in: path description: Unique identifier for Prompt. required: true schema: type: string - name: version_id in: path description: Unique identifier for the specific version of the Prompt. required: true schema: type: string - name: X-API-KEY in: header required: true schema: type: string responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/type_:PromptResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/type_:HttpValidationError' requestBody: content: application/json: schema: $ref: '#/components/schemas/type_:UpdateVersionRequest' servers: - url: https://api.humanloop.com/v5 components: schemas: type_:UpdateVersionRequest: type: object properties: name: type: string description: Name of the version. description: type: string description: Description of the version. title: UpdateVersionRequest type_:ModelEndpoints: type: string enum: - complete - chat - edit description: Supported model provider endpoints. title: ModelEndpoints type_:TextChatContent: type: object properties: type: type: string enum: - text text: type: string description: The message's text content. required: - type - text title: TextChatContent type_:ImageUrlDetail: type: string enum: - high - low - auto description: >- Specify the detail level of the image provided to the model. For more details see: https://platform.openai.com/docs/guides/vision/low-or-high-fidelity-image-understanding title: ImageUrlDetail type_:ImageUrl: type: object properties: url: type: string description: Either a URL of the image or the base64 encoded image data. detail: $ref: '#/components/schemas/type_:ImageUrlDetail' description: >- Specify the detail level of the image provided to the model. For more details see: https://platform.openai.com/docs/guides/vision/low-or-high-fidelity-image-understanding required: - url title: ImageUrl type_:ImageChatContent: type: object properties: type: type: string enum: - image_url image_url: $ref: '#/components/schemas/type_:ImageUrl' description: The message's image content. required: - type - image_url title: ImageChatContent type_:ChatMessageContentItem: oneOf: - $ref: '#/components/schemas/type_:TextChatContent' - $ref: '#/components/schemas/type_:ImageChatContent' title: ChatMessageContentItem type_:ChatMessageContent: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessageContentItem' description: The content of the message. title: ChatMessageContent type_:ChatRole: type: string enum: - user - assistant - system - tool - developer description: An enumeration. title: ChatRole type_:ChatToolType: type: string enum: - function description: The type of tool to call. title: ChatToolType type_:FunctionTool: type: object properties: name: type: string arguments: type: string required: - name description: A function tool to be called by the model where user owns runtime. title: FunctionTool type_:ToolCall: type: object properties: id: type: string type: $ref: '#/components/schemas/type_:ChatToolType' function: $ref: '#/components/schemas/type_:FunctionTool' required: - id - type - function description: A tool call to be made. title: ToolCall type_:AnthropicThinkingContent: type: object properties: type: type: string enum: - thinking thinking: type: string description: Model's chain-of-thought for providing the response. signature: type: string description: >- Cryptographic signature that verifies the thinking block was generated by Anthropic. required: - type - thinking - signature title: AnthropicThinkingContent type_:AnthropicRedactedThinkingContent: type: object properties: type: type: string enum: - redacted_thinking data: type: string description: >- Thinking block Anthropic redacted for safety reasons. User is expected to pass the block back to Anthropic required: - type - data title: AnthropicRedactedThinkingContent type_:ChatMessageThinkingItem: oneOf: - $ref: '#/components/schemas/type_:AnthropicThinkingContent' - $ref: '#/components/schemas/type_:AnthropicRedactedThinkingContent' title: ChatMessageThinkingItem type_:ChatMessage: type: object properties: content: $ref: '#/components/schemas/type_:ChatMessageContent' description: The content of the message. name: type: string description: Optional name of the message author. tool_call_id: type: string description: Tool call that this message is responding to. role: $ref: '#/components/schemas/type_:ChatRole' description: Role of the message author. tool_calls: type: array items: $ref: '#/components/schemas/type_:ToolCall' description: A list of tool calls requested by the assistant. thinking: type: array items: $ref: '#/components/schemas/type_:ChatMessageThinkingItem' description: >- Model's chain-of-thought for providing the response. Present on assistant messages if model supports it. required: - role title: ChatMessage type_:PromptResponseTemplate: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: >- 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}}`. title: PromptResponseTemplate type_:TemplateLanguage: type: string enum: - default - jinja description: Template engine to use for rendering templates. title: TemplateLanguage type_:ModelProviders: type: string enum: - anthropic - bedrock - cohere - deepseek - google - groq - mock - openai - openai_azure - replicate description: Supported model providers. title: ModelProviders type_:PromptResponseStop: oneOf: - type: string - type: array items: type: string description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. title: PromptResponseStop type_:ResponseFormatType: type: string enum: - json_object - json_schema title: ResponseFormatType type_:ResponseFormat: type: object properties: type: $ref: '#/components/schemas/type_:ResponseFormatType' json_schema: type: object additionalProperties: description: Any type description: The JSON schema of the response format if type is json_schema. required: - type description: Response format of the model. title: ResponseFormat type_:OpenAiReasoningEffort: type: string enum: - high - medium - low description: Supported reasoning effort. title: OpenAiReasoningEffort type_:PromptResponseReasoningEffort: oneOf: - $ref: '#/components/schemas/type_:OpenAiReasoningEffort' - type: integer description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. title: PromptResponseReasoningEffort type_:ToolFunction: type: object properties: name: type: string description: Name for the tool referenced by the model. description: type: string description: Description of the tool referenced by the model strict: type: boolean default: false description: >- If true, forces the model to output json data in the structure of the parameters schema. parameters: type: object additionalProperties: description: Any type description: >- Parameters needed to run the Tool, defined in JSON Schema format: https://json-schema.org/ required: - name - description title: ToolFunction type_:LinkedToolResponse: type: object properties: name: type: string description: Name for the tool referenced by the model. description: type: string description: Description of the tool referenced by the model strict: type: boolean default: false description: >- If true, forces the model to output json data in the structure of the parameters schema. parameters: type: object additionalProperties: description: Any type description: >- Parameters needed to run the Tool, defined in JSON Schema format: https://json-schema.org/ id: type: string description: Unique identifier for the Tool linked. version_id: type: string description: Unique identifier for the Tool Version linked. required: - name - description - id - version_id title: LinkedToolResponse type_:EnvironmentTag: type: string enum: - default - other description: An enumeration. title: EnvironmentTag type_:EnvironmentResponse: type: object properties: id: type: string created_at: type: string format: date-time name: type: string tag: $ref: '#/components/schemas/type_:EnvironmentTag' required: - id - created_at - name - tag title: EnvironmentResponse type_:UserResponse: description: Any type title: UserResponse type_:InputResponse: type: object properties: name: type: string description: Type of input. required: - name title: InputResponse type_:FilesToolType: type: string enum: - pinecone_search - google - mock - snippet - json_schema - get_api_call - python description: Type of tool. title: FilesToolType type_:EvaluatorAggregate: type: object properties: value: type: number format: double description: The aggregated value of the evaluator. evaluator_id: type: string description: ID of the evaluator. evaluator_version_id: type: string description: ID of the evaluator version. created_at: type: string format: date-time updated_at: type: string format: date-time required: - value - evaluator_id - evaluator_version_id - created_at - updated_at title: EvaluatorAggregate type_:ToolResponse: type: object properties: path: type: string description: >- Path of the Tool, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Tool. directory_id: type: string description: ID of the directory that the file is in on Humanloop. function: $ref: '#/components/schemas/type_:ToolFunction' description: >- Callable function specification of the Tool shown to the model for tool calling. source_code: type: string description: Code source of the Tool. setup_values: type: object additionalProperties: description: Any type description: >- Values needed to setup the Tool, defined in JSON Schema format: https://json-schema.org/ attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Tool. Helpful to separate Tool versions from each other with details on how they were created or used. tool_type: $ref: '#/components/schemas/type_:FilesToolType' description: Type of Tool. version_name: type: string description: >- Unique identifier for this Tool version. Each Tool can only have one version with a given name. version_description: type: string description: Description of the Version. name: type: string description: Name of the Tool, which is used as a unique identifier. description: type: string description: Description of the Tool. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Tool Version. If no query params provided, the default deployed Tool Version is returned. type: type: string enum: - tool environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Tool Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Tool. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Tool Version total_logs_count: type: integer description: The number of logs that have been generated across all Tool Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Prompt. Inputs correspond to any of the variables used within the Tool template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Tool that are used for monitoring logs. signature: type: string description: Signature of the Tool. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Tool Version. required: - path - id - name - version_id - created_at - updated_at - last_used_at - version_logs_count - total_logs_count - inputs description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: ToolResponse type_:DatapointResponseTargetValue: oneOf: - type: string - type: integer - type: number format: double - type: boolean - type: array items: description: Any type - type: object additionalProperties: description: Any type title: DatapointResponseTargetValue type_:DatapointResponse: type: object properties: inputs: type: object additionalProperties: type: string description: The inputs to the prompt template. messages: type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: List of chat messages to provide to the model. target: type: object additionalProperties: $ref: '#/components/schemas/type_:DatapointResponseTargetValue' description: >- Object with criteria necessary to evaluate generations with this Datapoint. This is passed in as an argument to Evaluators when used in an Evaluation. id: type: string description: Unique identifier for the Datapoint. Starts with `dp_`. required: - id title: DatapointResponse type_:DatasetResponse: type: object properties: path: type: string description: >- Path of the Dataset, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Dataset. Starts with `ds_`. directory_id: type: string description: ID of the directory that the file is in on Humanloop. name: type: string description: Name of the Dataset, which is used as a unique identifier. description: type: string description: Description of the Dataset. schema: type: object additionalProperties: description: Any type description: The JSON schema for the File. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Dataset Version. If no query params provided, the default deployed Dataset Version is returned. Starts with `dsv_`. type: type: string enum: - dataset environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Dataset Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Dataset. last_used_at: type: string format: date-time version_name: type: string description: >- Unique name for the Dataset version. Version names must be unique for a given Dataset. version_description: type: string description: Description of the version, e.g., the changes made in this version. datapoints_count: type: integer description: The number of Datapoints in this Dataset version. datapoints: type: array items: $ref: '#/components/schemas/type_:DatapointResponse' description: >- The list of Datapoints in this Dataset version. Only provided if explicitly requested. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Dataset. Helpful to separate Dataset versions from each other with details on how they were created or used. required: - path - id - name - version_id - created_at - updated_at - last_used_at - datapoints_count description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: DatasetResponse type_:EvaluatorArgumentsType: type: string enum: - target_free - target_required description: Enum representing the possible argument types of an evaluator. title: EvaluatorArgumentsType type_:EvaluatorReturnTypeEnum: type: string enum: - boolean - number - select - multi_select - text description: Enum representing the possible return types of an evaluator. title: EvaluatorReturnTypeEnum type_:Valence: type: string enum: - positive - negative - neutral description: An enumeration. title: Valence type_:EvaluatorJudgmentOptionResponse: type: object properties: name: type: string description: The name of the option. valence: $ref: '#/components/schemas/type_:Valence' description: Whether this option should be considered positive or negative. required: - name title: EvaluatorJudgmentOptionResponse type_:EvaluatorJudgmentNumberLimit: type: object properties: min: type: number format: double description: The minimum value that can be selected. max: type: number format: double description: The maximum value that can be selected. step: type: number format: double description: The step size for the number input. title: EvaluatorJudgmentNumberLimit type_:PromptKernelRequestTemplate: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: >- 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}}`. title: PromptKernelRequestTemplate type_:PromptKernelRequestStop: oneOf: - type: string - type: array items: type: string description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. title: PromptKernelRequestStop type_:PromptKernelRequestReasoningEffort: oneOf: - $ref: '#/components/schemas/type_:OpenAiReasoningEffort' - type: integer description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. title: PromptKernelRequestReasoningEffort type_:PromptKernelRequest: type: object properties: model: type: string description: >- The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models) endpoint: $ref: '#/components/schemas/type_:ModelEndpoints' description: The provider model endpoint used. template: $ref: '#/components/schemas/type_:PromptKernelRequestTemplate' description: >- 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}}`. template_language: $ref: '#/components/schemas/type_:TemplateLanguage' description: The template language to use for rendering the template. provider: $ref: '#/components/schemas/type_:ModelProviders' description: The company providing the underlying model service. max_tokens: type: integer default: -1 description: >- 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 temperature: type: number format: double default: 1 description: >- What sampling temperature to use when making a generation. Higher values means the model will be more creative. top_p: type: number format: double default: 1 description: >- An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. stop: $ref: '#/components/schemas/type_:PromptKernelRequestStop' description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. presence_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far. frequency_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far. other: type: object additionalProperties: description: Any type description: Other parameter values to be passed to the provider call. seed: type: integer description: >- If specified, model will make a best effort to sample deterministically, but it is not guaranteed. response_format: $ref: '#/components/schemas/type_:ResponseFormat' description: >- The format of the response. Only `{"type": "json_object"}` is currently supported for chat. reasoning_effort: $ref: '#/components/schemas/type_:PromptKernelRequestReasoningEffort' description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. tools: type: array items: $ref: '#/components/schemas/type_:ToolFunction' description: >- The tool specification that the model can choose to call if Tool calling is supported. linked_tools: type: array items: type: string description: >- 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. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used. required: - model description: |- Base class used by both PromptKernelRequest and AgentKernelRequest. Contains the consistent Prompt-related fields. title: PromptKernelRequest type_:LlmEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:EvaluatorReturnTypeEnum' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: >- The options that can be applied as judgments. Only for Evaluators with `return_type` of 'boolean', 'select' or 'multi_select'. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - llm prompt: $ref: '#/components/schemas/type_:PromptKernelRequest' description: The prompt parameters used to generate. required: - arguments_type - return_type - evaluator_type title: LlmEvaluatorRequest type_:CodeEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:EvaluatorReturnTypeEnum' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: >- The options that can be applied as judgments. Only for Evaluators with `return_type` of 'boolean', 'select' or 'multi_select'. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - python code: type: string description: >- The code for the Evaluator. This code will be executed in a sandboxed environment. required: - arguments_type - return_type - evaluator_type - code title: CodeEvaluatorRequest type_:HumanEvaluatorRequestReturnType: type: string enum: - select - multi_select - text - number - boolean description: The type of the return value of the Evaluator. title: HumanEvaluatorRequestReturnType type_:HumanEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:HumanEvaluatorRequestReturnType' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: The options that can be applied as judgments. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - human instructions: type: string description: Instructions and guidelines for applying judgments. required: - arguments_type - return_type - evaluator_type title: HumanEvaluatorRequest type_:ExternalEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:EvaluatorReturnTypeEnum' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: >- The options that can be applied as judgments. Only for Evaluators with `return_type` of 'boolean', 'select' or 'multi_select'. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - external required: - arguments_type - return_type - evaluator_type title: ExternalEvaluatorRequest type_:EvaluatorResponseSpec: oneOf: - $ref: '#/components/schemas/type_:LlmEvaluatorRequest' - $ref: '#/components/schemas/type_:CodeEvaluatorRequest' - $ref: '#/components/schemas/type_:HumanEvaluatorRequest' - $ref: '#/components/schemas/type_:ExternalEvaluatorRequest' title: EvaluatorResponseSpec type_:EvaluatorResponse: type: object properties: path: type: string description: >- Path of the Evaluator including the Evaluator name, which is used as a unique identifier. id: type: string description: Unique identifier for the Evaluator. directory_id: type: string description: ID of the directory that the file is in on Humanloop. version_name: type: string description: >- Unique name for the Evaluator version. Version names must be unique for a given Evaluator. version_description: type: string description: Description of the version, e.g., the changes made in this version. spec: $ref: '#/components/schemas/type_:EvaluatorResponseSpec' name: type: string description: Name of the Evaluator, which is used as a unique identifier. description: type: string description: Description of the Evaluator. schema: type: object additionalProperties: description: Any type description: The JSON schema for the File. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Evaluator Version. If no query params provided, the default deployed Evaluator Version is returned. type: type: string enum: - evaluator environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Evaluator Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Evaluator. last_used_at: type: string format: date-time version_logs_count: type: integer description: >- The number of logs that have been generated for this Evaluator Version total_logs_count: type: integer description: >- The number of logs that have been generated across all Evaluator Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Evaluator. Inputs correspond to any of the variables used within the Evaluator template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Evaluator that are used for monitoring logs. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Evaluator Version. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. required: - path - id - spec - name - version_id - created_at - updated_at - last_used_at - version_logs_count - total_logs_count - inputs description: Version of the Evaluator used to provide judgments. title: EvaluatorResponse type_:FlowResponse: type: object properties: path: type: string description: >- Path of the Flow, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Flow. directory_id: type: string description: ID of the directory that the file is in on Humanloop. attributes: type: object additionalProperties: description: Any type description: A key-value object identifying the Flow Version. version_name: type: string description: >- Unique name for the Flow version. Version names must be unique for a given Flow. version_description: type: string description: Description of the Version. name: type: string description: Name of the Flow. description: type: string description: Description of the Flow. schema: type: object additionalProperties: description: Any type description: The JSON schema for the File. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Flow Version. If no query params provided, the default deployed Flow Version is returned. type: type: string enum: - flow environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Flow Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Flow. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Flow Version evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Flow Version. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: The list of Monitoring Evaluators associated with the Flow Version. required: - path - id - attributes - name - version_id - created_at - updated_at - last_used_at - version_logs_count description: Response model for a Flow. title: FlowResponse type_:AgentResponseTemplate: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: >- 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}}`. title: AgentResponseTemplate type_:AgentResponseStop: oneOf: - type: string - type: array items: type: string description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. title: AgentResponseStop type_:AgentResponseReasoningEffort: oneOf: - $ref: '#/components/schemas/type_:OpenAiReasoningEffort' - type: integer description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. title: AgentResponseReasoningEffort type_:LinkedFileRequest: type: object properties: file_id: type: string environment_id: type: string version_id: type: string required: - file_id title: LinkedFileRequest type_:OnAgentCallEnum: type: string enum: - stop - continue description: What an Agent should do when calling a Tool. title: OnAgentCallEnum type_:AgentLinkedFileResponseFile: oneOf: - $ref: '#/components/schemas/type_:PromptResponse' - $ref: '#/components/schemas/type_:ToolResponse' - $ref: '#/components/schemas/type_:DatasetResponse' - $ref: '#/components/schemas/type_:EvaluatorResponse' - $ref: '#/components/schemas/type_:FlowResponse' - $ref: '#/components/schemas/type_:AgentResponse' title: AgentLinkedFileResponseFile type_:AgentLinkedFileResponse: type: object properties: type: type: string enum: - file link: $ref: '#/components/schemas/type_:LinkedFileRequest' on_agent_call: $ref: '#/components/schemas/type_:OnAgentCallEnum' file: $ref: '#/components/schemas/type_:AgentLinkedFileResponseFile' required: - type - link title: AgentLinkedFileResponse type_:AgentInlineTool: type: object properties: type: type: string enum: - inline json_schema: $ref: '#/components/schemas/type_:ToolFunction' on_agent_call: $ref: '#/components/schemas/type_:OnAgentCallEnum' required: - type - json_schema title: AgentInlineTool type_:AgentResponseToolsItem: oneOf: - $ref: '#/components/schemas/type_:AgentLinkedFileResponse' - $ref: '#/components/schemas/type_:AgentInlineTool' title: AgentResponseToolsItem type_:VersionStatus: type: string enum: - uncommitted - committed - deleted description: An enumeration. title: VersionStatus type_:AgentResponse: type: object properties: path: type: string description: >- Path of the Agent, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Agent. directory_id: type: string description: ID of the directory that the file is in on Humanloop. model: type: string description: >- The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models) endpoint: $ref: '#/components/schemas/type_:ModelEndpoints' description: The provider model endpoint used. template: $ref: '#/components/schemas/type_:AgentResponseTemplate' description: >- 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}}`. template_language: $ref: '#/components/schemas/type_:TemplateLanguage' description: The template language to use for rendering the template. provider: $ref: '#/components/schemas/type_:ModelProviders' description: The company providing the underlying model service. max_tokens: type: integer default: -1 description: >- 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 temperature: type: number format: double default: 1 description: >- What sampling temperature to use when making a generation. Higher values means the model will be more creative. top_p: type: number format: double default: 1 description: >- An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. stop: $ref: '#/components/schemas/type_:AgentResponseStop' description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. presence_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far. frequency_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far. other: type: object additionalProperties: description: Any type description: Other parameter values to be passed to the provider call. seed: type: integer description: >- If specified, model will make a best effort to sample deterministically, but it is not guaranteed. response_format: $ref: '#/components/schemas/type_:ResponseFormat' description: >- The format of the response. Only `{"type": "json_object"}` is currently supported for chat. reasoning_effort: $ref: '#/components/schemas/type_:AgentResponseReasoningEffort' description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. tools: type: array items: $ref: '#/components/schemas/type_:AgentResponseToolsItem' description: >- List of tools that the Agent can call. These can be linked files or inline tools. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used. max_iterations: type: integer description: >- The maximum number of iterations the Agent can run. This is used to limit the number of times the Agent model is called. version_name: type: string description: >- Unique name for the Agent version. Version names must be unique for a given Agent. version_description: type: string description: Description of the version, e.g., the changes made in this version. description: type: string description: Description of the Agent. tags: type: array items: type: string description: List of tags associated with the file. readme: type: string description: Long description of the file. name: type: string description: Name of the Agent. schema: type: object additionalProperties: description: Any type description: The JSON schema for the Prompt. version_id: type: string description: >- Unique identifier for the specific Agent Version. If no query params provided, the default deployed Agent Version is returned. type: type: string enum: - agent environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Agent Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Agent. committed_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who committed the Agent Version. committed_at: type: string format: date-time description: The date and time the Agent Version was committed. status: $ref: '#/components/schemas/type_:VersionStatus' description: The status of the Agent Version. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Agent Version total_logs_count: type: integer description: >- The number of logs that have been generated across all Agent Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Agent. Inputs correspond to any of the variables used within the Agent template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Agent that are used for monitoring logs. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Agent Version. raw_file_content: type: string description: The raw content of the Agent. Corresponds to the .agent file. required: - path - id - model - tools - name - version_id - created_at - updated_at - status - last_used_at - version_logs_count - total_logs_count - inputs description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: AgentResponse type_:VersionDeploymentResponseFile: oneOf: - $ref: '#/components/schemas/type_:PromptResponse' - $ref: '#/components/schemas/type_:ToolResponse' - $ref: '#/components/schemas/type_:DatasetResponse' - $ref: '#/components/schemas/type_:EvaluatorResponse' - $ref: '#/components/schemas/type_:FlowResponse' - $ref: '#/components/schemas/type_:AgentResponse' description: The File that the deployed Version belongs to. title: VersionDeploymentResponseFile type_:VersionDeploymentResponse: type: object properties: file: $ref: '#/components/schemas/type_:VersionDeploymentResponseFile' description: The File that the deployed Version belongs to. environment: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The Environment that the Version is deployed to. type: type: string enum: - environment required: - file - environment - type description: A variable reference to the Version deployed to an Environment title: VersionDeploymentResponse type_:VersionIdResponseVersion: oneOf: - $ref: '#/components/schemas/type_:PromptResponse' - $ref: '#/components/schemas/type_:ToolResponse' - $ref: '#/components/schemas/type_:DatasetResponse' - $ref: '#/components/schemas/type_:EvaluatorResponse' - $ref: '#/components/schemas/type_:FlowResponse' - $ref: '#/components/schemas/type_:AgentResponse' description: The specific Version being referenced. title: VersionIdResponseVersion type_:VersionIdResponse: type: object properties: version: $ref: '#/components/schemas/type_:VersionIdResponseVersion' description: The specific Version being referenced. type: type: string enum: - version required: - version - type description: A reference to a specific Version by its ID title: VersionIdResponse type_:VersionReferenceResponse: oneOf: - $ref: '#/components/schemas/type_:VersionDeploymentResponse' - $ref: '#/components/schemas/type_:VersionIdResponse' title: VersionReferenceResponse type_:MonitoringEvaluatorState: type: string enum: - active - inactive description: State of an evaluator connected to a file title: MonitoringEvaluatorState type_:MonitoringEvaluatorResponse: type: object properties: version_reference: $ref: '#/components/schemas/type_:VersionReferenceResponse' description: >- The Evaluator Version used for monitoring. This can be a specific Version by ID, or a Version deployed to an Environment. version: $ref: '#/components/schemas/type_:EvaluatorResponse' description: The deployed Version. state: $ref: '#/components/schemas/type_:MonitoringEvaluatorState' description: The state of the Monitoring Evaluator. Either `active` or `inactive` created_at: type: string format: date-time updated_at: type: string format: date-time required: - version_reference - state - created_at - updated_at title: MonitoringEvaluatorResponse type_:PromptResponse: type: object properties: path: type: string description: >- Path of the Prompt, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Prompt. directory_id: type: string description: ID of the directory that the file is in on Humanloop. model: type: string description: >- The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models) endpoint: $ref: '#/components/schemas/type_:ModelEndpoints' description: The provider model endpoint used. template: $ref: '#/components/schemas/type_:PromptResponseTemplate' description: >- 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}}`. template_language: $ref: '#/components/schemas/type_:TemplateLanguage' description: The template language to use for rendering the template. provider: $ref: '#/components/schemas/type_:ModelProviders' description: The company providing the underlying model service. max_tokens: type: integer default: -1 description: >- 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 temperature: type: number format: double default: 1 description: >- What sampling temperature to use when making a generation. Higher values means the model will be more creative. top_p: type: number format: double default: 1 description: >- An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. stop: $ref: '#/components/schemas/type_:PromptResponseStop' description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. presence_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far. frequency_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far. other: type: object additionalProperties: description: Any type description: Other parameter values to be passed to the provider call. seed: type: integer description: >- If specified, model will make a best effort to sample deterministically, but it is not guaranteed. response_format: $ref: '#/components/schemas/type_:ResponseFormat' description: >- The format of the response. Only `{"type": "json_object"}` is currently supported for chat. reasoning_effort: $ref: '#/components/schemas/type_:PromptResponseReasoningEffort' description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. tools: type: array items: $ref: '#/components/schemas/type_:ToolFunction' description: >- The tool specification that the model can choose to call if Tool calling is supported. linked_tools: type: array items: $ref: '#/components/schemas/type_:LinkedToolResponse' description: The tools linked to your prompt that the model can call. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used. version_name: type: string description: >- Unique name for the Prompt version. Version names must be unique for a given Prompt. version_description: type: string description: Description of the version, e.g., the changes made in this version. description: type: string description: Description of the Prompt. tags: type: array items: type: string description: List of tags associated with the file. readme: type: string description: Long description of the file. name: type: string description: Name of the Prompt. schema: type: object additionalProperties: description: Any type description: The JSON schema for the Prompt. version_id: type: string description: >- Unique identifier for the specific Prompt Version. If no query params provided, the default deployed Prompt Version is returned. type: type: string enum: - prompt environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Prompt Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Prompt. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Prompt Version total_logs_count: type: integer description: >- The number of logs that have been generated across all Prompt Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Prompt. Inputs correspond to any of the variables used within the Prompt template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Prompt that are used for monitoring logs. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Prompt Version. raw_file_content: type: string description: The raw content of the Prompt. Corresponds to the .prompt file. required: - path - id - model - name - version_id - created_at - updated_at - last_used_at - version_logs_count - total_logs_count - inputs description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: PromptResponse type_:ValidationErrorLocItem: oneOf: - type: string - type: integer title: ValidationErrorLocItem type_:ValidationError: type: object properties: loc: type: array items: $ref: '#/components/schemas/type_:ValidationErrorLocItem' msg: type: string type: type: string required: - loc - msg - type title: ValidationError type_:HttpValidationError: type: object properties: detail: type: array items: $ref: '#/components/schemas/type_:ValidationError' title: HttpValidationError securitySchemes: default: type: apiKey in: header name: X-API-KEY ``` ## SDK Code Examples ```python import requests url = "https://api.humanloop.com/v5/prompts/id/versions/version_id" payload = {} headers = { "X-API-KEY": " ", "Content-Type": "application/json" } response = requests.patch(url, json=payload, headers=headers) print(response.json()) ``` ```typescript import { HumanloopClient, Humanloop } from "humanloop"; const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); await client.prompts.patchPromptVersion("id", "version_id", {}); ``` ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/prompts/id/versions/version_id" payload := strings.NewReader("{}") req, _ := http.NewRequest("PATCH", url, payload) req.Header.Add("X-API-KEY", " ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://api.humanloop.com/v5/prompts/id/versions/version_id") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Patch.new(url) request["X-API-KEY"] = ' ' request["Content-Type"] = 'application/json' request.body = "{}" response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.patch("https://api.humanloop.com/v5/prompts/id/versions/version_id") .header("X-API-KEY", " ") .header("Content-Type", "application/json") .body("{}") .asString(); ``` ```php request('PATCH', 'https://api.humanloop.com/v5/prompts/id/versions/version_id', [ 'body' => '{}', 'headers' => [ 'Content-Type' => 'application/json', 'X-API-KEY' => ' ', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/prompts/id/versions/version_id"); var request = new RestRequest(Method.PATCH); request.AddHeader("X-API-KEY", " "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "X-API-KEY": " ", "Content-Type": "application/json" ] let parameters = [] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/prompts/id/versions/version_id")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "PATCH" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. # Deploy Prompt POST https://api.humanloop.com/v5/prompts/{id}/environments/{environment_id} Deploy Prompt to an Environment. Set the deployed version for the specified Environment. This Prompt will be used for calls made to the Prompt in this Environment. Reference: https://humanloop.com/docs/api/prompts/set-deployment ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /prompts/{id}/environments/{environment_id}: post: operationId: set-deployment summary: Deploy Prompt description: |- Deploy Prompt to an Environment. Set the deployed version for the specified Environment. This Prompt will be used for calls made to the Prompt in this Environment. tags: - subpackage_prompts parameters: - name: id in: path description: Unique identifier for Prompt. required: true schema: type: string - name: environment_id in: path description: Unique identifier for the Environment to deploy the Version to. required: true schema: type: string - name: version_id in: query description: Unique identifier for the specific version of the Prompt. required: true schema: type: string - name: X-API-KEY in: header required: true schema: type: string responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/type_:PromptResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/type_:HttpValidationError' servers: - url: https://api.humanloop.com/v5 components: schemas: type_:ModelEndpoints: type: string enum: - complete - chat - edit description: Supported model provider endpoints. title: ModelEndpoints type_:TextChatContent: type: object properties: type: type: string enum: - text text: type: string description: The message's text content. required: - type - text title: TextChatContent type_:ImageUrlDetail: type: string enum: - high - low - auto description: >- Specify the detail level of the image provided to the model. For more details see: https://platform.openai.com/docs/guides/vision/low-or-high-fidelity-image-understanding title: ImageUrlDetail type_:ImageUrl: type: object properties: url: type: string description: Either a URL of the image or the base64 encoded image data. detail: $ref: '#/components/schemas/type_:ImageUrlDetail' description: >- Specify the detail level of the image provided to the model. For more details see: https://platform.openai.com/docs/guides/vision/low-or-high-fidelity-image-understanding required: - url title: ImageUrl type_:ImageChatContent: type: object properties: type: type: string enum: - image_url image_url: $ref: '#/components/schemas/type_:ImageUrl' description: The message's image content. required: - type - image_url title: ImageChatContent type_:ChatMessageContentItem: oneOf: - $ref: '#/components/schemas/type_:TextChatContent' - $ref: '#/components/schemas/type_:ImageChatContent' title: ChatMessageContentItem type_:ChatMessageContent: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessageContentItem' description: The content of the message. title: ChatMessageContent type_:ChatRole: type: string enum: - user - assistant - system - tool - developer description: An enumeration. title: ChatRole type_:ChatToolType: type: string enum: - function description: The type of tool to call. title: ChatToolType type_:FunctionTool: type: object properties: name: type: string arguments: type: string required: - name description: A function tool to be called by the model where user owns runtime. title: FunctionTool type_:ToolCall: type: object properties: id: type: string type: $ref: '#/components/schemas/type_:ChatToolType' function: $ref: '#/components/schemas/type_:FunctionTool' required: - id - type - function description: A tool call to be made. title: ToolCall type_:AnthropicThinkingContent: type: object properties: type: type: string enum: - thinking thinking: type: string description: Model's chain-of-thought for providing the response. signature: type: string description: >- Cryptographic signature that verifies the thinking block was generated by Anthropic. required: - type - thinking - signature title: AnthropicThinkingContent type_:AnthropicRedactedThinkingContent: type: object properties: type: type: string enum: - redacted_thinking data: type: string description: >- Thinking block Anthropic redacted for safety reasons. User is expected to pass the block back to Anthropic required: - type - data title: AnthropicRedactedThinkingContent type_:ChatMessageThinkingItem: oneOf: - $ref: '#/components/schemas/type_:AnthropicThinkingContent' - $ref: '#/components/schemas/type_:AnthropicRedactedThinkingContent' title: ChatMessageThinkingItem type_:ChatMessage: type: object properties: content: $ref: '#/components/schemas/type_:ChatMessageContent' description: The content of the message. name: type: string description: Optional name of the message author. tool_call_id: type: string description: Tool call that this message is responding to. role: $ref: '#/components/schemas/type_:ChatRole' description: Role of the message author. tool_calls: type: array items: $ref: '#/components/schemas/type_:ToolCall' description: A list of tool calls requested by the assistant. thinking: type: array items: $ref: '#/components/schemas/type_:ChatMessageThinkingItem' description: >- Model's chain-of-thought for providing the response. Present on assistant messages if model supports it. required: - role title: ChatMessage type_:PromptResponseTemplate: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: >- 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}}`. title: PromptResponseTemplate type_:TemplateLanguage: type: string enum: - default - jinja description: Template engine to use for rendering templates. title: TemplateLanguage type_:ModelProviders: type: string enum: - anthropic - bedrock - cohere - deepseek - google - groq - mock - openai - openai_azure - replicate description: Supported model providers. title: ModelProviders type_:PromptResponseStop: oneOf: - type: string - type: array items: type: string description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. title: PromptResponseStop type_:ResponseFormatType: type: string enum: - json_object - json_schema title: ResponseFormatType type_:ResponseFormat: type: object properties: type: $ref: '#/components/schemas/type_:ResponseFormatType' json_schema: type: object additionalProperties: description: Any type description: The JSON schema of the response format if type is json_schema. required: - type description: Response format of the model. title: ResponseFormat type_:OpenAiReasoningEffort: type: string enum: - high - medium - low description: Supported reasoning effort. title: OpenAiReasoningEffort type_:PromptResponseReasoningEffort: oneOf: - $ref: '#/components/schemas/type_:OpenAiReasoningEffort' - type: integer description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. title: PromptResponseReasoningEffort type_:ToolFunction: type: object properties: name: type: string description: Name for the tool referenced by the model. description: type: string description: Description of the tool referenced by the model strict: type: boolean default: false description: >- If true, forces the model to output json data in the structure of the parameters schema. parameters: type: object additionalProperties: description: Any type description: >- Parameters needed to run the Tool, defined in JSON Schema format: https://json-schema.org/ required: - name - description title: ToolFunction type_:LinkedToolResponse: type: object properties: name: type: string description: Name for the tool referenced by the model. description: type: string description: Description of the tool referenced by the model strict: type: boolean default: false description: >- If true, forces the model to output json data in the structure of the parameters schema. parameters: type: object additionalProperties: description: Any type description: >- Parameters needed to run the Tool, defined in JSON Schema format: https://json-schema.org/ id: type: string description: Unique identifier for the Tool linked. version_id: type: string description: Unique identifier for the Tool Version linked. required: - name - description - id - version_id title: LinkedToolResponse type_:EnvironmentTag: type: string enum: - default - other description: An enumeration. title: EnvironmentTag type_:EnvironmentResponse: type: object properties: id: type: string created_at: type: string format: date-time name: type: string tag: $ref: '#/components/schemas/type_:EnvironmentTag' required: - id - created_at - name - tag title: EnvironmentResponse type_:UserResponse: description: Any type title: UserResponse type_:InputResponse: type: object properties: name: type: string description: Type of input. required: - name title: InputResponse type_:FilesToolType: type: string enum: - pinecone_search - google - mock - snippet - json_schema - get_api_call - python description: Type of tool. title: FilesToolType type_:EvaluatorAggregate: type: object properties: value: type: number format: double description: The aggregated value of the evaluator. evaluator_id: type: string description: ID of the evaluator. evaluator_version_id: type: string description: ID of the evaluator version. created_at: type: string format: date-time updated_at: type: string format: date-time required: - value - evaluator_id - evaluator_version_id - created_at - updated_at title: EvaluatorAggregate type_:ToolResponse: type: object properties: path: type: string description: >- Path of the Tool, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Tool. directory_id: type: string description: ID of the directory that the file is in on Humanloop. function: $ref: '#/components/schemas/type_:ToolFunction' description: >- Callable function specification of the Tool shown to the model for tool calling. source_code: type: string description: Code source of the Tool. setup_values: type: object additionalProperties: description: Any type description: >- Values needed to setup the Tool, defined in JSON Schema format: https://json-schema.org/ attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Tool. Helpful to separate Tool versions from each other with details on how they were created or used. tool_type: $ref: '#/components/schemas/type_:FilesToolType' description: Type of Tool. version_name: type: string description: >- Unique identifier for this Tool version. Each Tool can only have one version with a given name. version_description: type: string description: Description of the Version. name: type: string description: Name of the Tool, which is used as a unique identifier. description: type: string description: Description of the Tool. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Tool Version. If no query params provided, the default deployed Tool Version is returned. type: type: string enum: - tool environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Tool Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Tool. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Tool Version total_logs_count: type: integer description: The number of logs that have been generated across all Tool Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Prompt. Inputs correspond to any of the variables used within the Tool template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Tool that are used for monitoring logs. signature: type: string description: Signature of the Tool. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Tool Version. required: - path - id - name - version_id - created_at - updated_at - last_used_at - version_logs_count - total_logs_count - inputs description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: ToolResponse type_:DatapointResponseTargetValue: oneOf: - type: string - type: integer - type: number format: double - type: boolean - type: array items: description: Any type - type: object additionalProperties: description: Any type title: DatapointResponseTargetValue type_:DatapointResponse: type: object properties: inputs: type: object additionalProperties: type: string description: The inputs to the prompt template. messages: type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: List of chat messages to provide to the model. target: type: object additionalProperties: $ref: '#/components/schemas/type_:DatapointResponseTargetValue' description: >- Object with criteria necessary to evaluate generations with this Datapoint. This is passed in as an argument to Evaluators when used in an Evaluation. id: type: string description: Unique identifier for the Datapoint. Starts with `dp_`. required: - id title: DatapointResponse type_:DatasetResponse: type: object properties: path: type: string description: >- Path of the Dataset, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Dataset. Starts with `ds_`. directory_id: type: string description: ID of the directory that the file is in on Humanloop. name: type: string description: Name of the Dataset, which is used as a unique identifier. description: type: string description: Description of the Dataset. schema: type: object additionalProperties: description: Any type description: The JSON schema for the File. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Dataset Version. If no query params provided, the default deployed Dataset Version is returned. Starts with `dsv_`. type: type: string enum: - dataset environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Dataset Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Dataset. last_used_at: type: string format: date-time version_name: type: string description: >- Unique name for the Dataset version. Version names must be unique for a given Dataset. version_description: type: string description: Description of the version, e.g., the changes made in this version. datapoints_count: type: integer description: The number of Datapoints in this Dataset version. datapoints: type: array items: $ref: '#/components/schemas/type_:DatapointResponse' description: >- The list of Datapoints in this Dataset version. Only provided if explicitly requested. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Dataset. Helpful to separate Dataset versions from each other with details on how they were created or used. required: - path - id - name - version_id - created_at - updated_at - last_used_at - datapoints_count description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: DatasetResponse type_:EvaluatorArgumentsType: type: string enum: - target_free - target_required description: Enum representing the possible argument types of an evaluator. title: EvaluatorArgumentsType type_:EvaluatorReturnTypeEnum: type: string enum: - boolean - number - select - multi_select - text description: Enum representing the possible return types of an evaluator. title: EvaluatorReturnTypeEnum type_:Valence: type: string enum: - positive - negative - neutral description: An enumeration. title: Valence type_:EvaluatorJudgmentOptionResponse: type: object properties: name: type: string description: The name of the option. valence: $ref: '#/components/schemas/type_:Valence' description: Whether this option should be considered positive or negative. required: - name title: EvaluatorJudgmentOptionResponse type_:EvaluatorJudgmentNumberLimit: type: object properties: min: type: number format: double description: The minimum value that can be selected. max: type: number format: double description: The maximum value that can be selected. step: type: number format: double description: The step size for the number input. title: EvaluatorJudgmentNumberLimit type_:PromptKernelRequestTemplate: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: >- 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}}`. title: PromptKernelRequestTemplate type_:PromptKernelRequestStop: oneOf: - type: string - type: array items: type: string description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. title: PromptKernelRequestStop type_:PromptKernelRequestReasoningEffort: oneOf: - $ref: '#/components/schemas/type_:OpenAiReasoningEffort' - type: integer description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. title: PromptKernelRequestReasoningEffort type_:PromptKernelRequest: type: object properties: model: type: string description: >- The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models) endpoint: $ref: '#/components/schemas/type_:ModelEndpoints' description: The provider model endpoint used. template: $ref: '#/components/schemas/type_:PromptKernelRequestTemplate' description: >- 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}}`. template_language: $ref: '#/components/schemas/type_:TemplateLanguage' description: The template language to use for rendering the template. provider: $ref: '#/components/schemas/type_:ModelProviders' description: The company providing the underlying model service. max_tokens: type: integer default: -1 description: >- 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 temperature: type: number format: double default: 1 description: >- What sampling temperature to use when making a generation. Higher values means the model will be more creative. top_p: type: number format: double default: 1 description: >- An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. stop: $ref: '#/components/schemas/type_:PromptKernelRequestStop' description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. presence_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far. frequency_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far. other: type: object additionalProperties: description: Any type description: Other parameter values to be passed to the provider call. seed: type: integer description: >- If specified, model will make a best effort to sample deterministically, but it is not guaranteed. response_format: $ref: '#/components/schemas/type_:ResponseFormat' description: >- The format of the response. Only `{"type": "json_object"}` is currently supported for chat. reasoning_effort: $ref: '#/components/schemas/type_:PromptKernelRequestReasoningEffort' description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. tools: type: array items: $ref: '#/components/schemas/type_:ToolFunction' description: >- The tool specification that the model can choose to call if Tool calling is supported. linked_tools: type: array items: type: string description: >- 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. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used. required: - model description: |- Base class used by both PromptKernelRequest and AgentKernelRequest. Contains the consistent Prompt-related fields. title: PromptKernelRequest type_:LlmEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:EvaluatorReturnTypeEnum' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: >- The options that can be applied as judgments. Only for Evaluators with `return_type` of 'boolean', 'select' or 'multi_select'. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - llm prompt: $ref: '#/components/schemas/type_:PromptKernelRequest' description: The prompt parameters used to generate. required: - arguments_type - return_type - evaluator_type title: LlmEvaluatorRequest type_:CodeEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:EvaluatorReturnTypeEnum' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: >- The options that can be applied as judgments. Only for Evaluators with `return_type` of 'boolean', 'select' or 'multi_select'. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - python code: type: string description: >- The code for the Evaluator. This code will be executed in a sandboxed environment. required: - arguments_type - return_type - evaluator_type - code title: CodeEvaluatorRequest type_:HumanEvaluatorRequestReturnType: type: string enum: - select - multi_select - text - number - boolean description: The type of the return value of the Evaluator. title: HumanEvaluatorRequestReturnType type_:HumanEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:HumanEvaluatorRequestReturnType' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: The options that can be applied as judgments. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - human instructions: type: string description: Instructions and guidelines for applying judgments. required: - arguments_type - return_type - evaluator_type title: HumanEvaluatorRequest type_:ExternalEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:EvaluatorReturnTypeEnum' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: >- The options that can be applied as judgments. Only for Evaluators with `return_type` of 'boolean', 'select' or 'multi_select'. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - external required: - arguments_type - return_type - evaluator_type title: ExternalEvaluatorRequest type_:EvaluatorResponseSpec: oneOf: - $ref: '#/components/schemas/type_:LlmEvaluatorRequest' - $ref: '#/components/schemas/type_:CodeEvaluatorRequest' - $ref: '#/components/schemas/type_:HumanEvaluatorRequest' - $ref: '#/components/schemas/type_:ExternalEvaluatorRequest' title: EvaluatorResponseSpec type_:EvaluatorResponse: type: object properties: path: type: string description: >- Path of the Evaluator including the Evaluator name, which is used as a unique identifier. id: type: string description: Unique identifier for the Evaluator. directory_id: type: string description: ID of the directory that the file is in on Humanloop. version_name: type: string description: >- Unique name for the Evaluator version. Version names must be unique for a given Evaluator. version_description: type: string description: Description of the version, e.g., the changes made in this version. spec: $ref: '#/components/schemas/type_:EvaluatorResponseSpec' name: type: string description: Name of the Evaluator, which is used as a unique identifier. description: type: string description: Description of the Evaluator. schema: type: object additionalProperties: description: Any type description: The JSON schema for the File. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Evaluator Version. If no query params provided, the default deployed Evaluator Version is returned. type: type: string enum: - evaluator environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Evaluator Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Evaluator. last_used_at: type: string format: date-time version_logs_count: type: integer description: >- The number of logs that have been generated for this Evaluator Version total_logs_count: type: integer description: >- The number of logs that have been generated across all Evaluator Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Evaluator. Inputs correspond to any of the variables used within the Evaluator template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Evaluator that are used for monitoring logs. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Evaluator Version. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. required: - path - id - spec - name - version_id - created_at - updated_at - last_used_at - version_logs_count - total_logs_count - inputs description: Version of the Evaluator used to provide judgments. title: EvaluatorResponse type_:FlowResponse: type: object properties: path: type: string description: >- Path of the Flow, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Flow. directory_id: type: string description: ID of the directory that the file is in on Humanloop. attributes: type: object additionalProperties: description: Any type description: A key-value object identifying the Flow Version. version_name: type: string description: >- Unique name for the Flow version. Version names must be unique for a given Flow. version_description: type: string description: Description of the Version. name: type: string description: Name of the Flow. description: type: string description: Description of the Flow. schema: type: object additionalProperties: description: Any type description: The JSON schema for the File. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Flow Version. If no query params provided, the default deployed Flow Version is returned. type: type: string enum: - flow environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Flow Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Flow. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Flow Version evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Flow Version. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: The list of Monitoring Evaluators associated with the Flow Version. required: - path - id - attributes - name - version_id - created_at - updated_at - last_used_at - version_logs_count description: Response model for a Flow. title: FlowResponse type_:AgentResponseTemplate: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: >- 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}}`. title: AgentResponseTemplate type_:AgentResponseStop: oneOf: - type: string - type: array items: type: string description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. title: AgentResponseStop type_:AgentResponseReasoningEffort: oneOf: - $ref: '#/components/schemas/type_:OpenAiReasoningEffort' - type: integer description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. title: AgentResponseReasoningEffort type_:LinkedFileRequest: type: object properties: file_id: type: string environment_id: type: string version_id: type: string required: - file_id title: LinkedFileRequest type_:OnAgentCallEnum: type: string enum: - stop - continue description: What an Agent should do when calling a Tool. title: OnAgentCallEnum type_:AgentLinkedFileResponseFile: oneOf: - $ref: '#/components/schemas/type_:PromptResponse' - $ref: '#/components/schemas/type_:ToolResponse' - $ref: '#/components/schemas/type_:DatasetResponse' - $ref: '#/components/schemas/type_:EvaluatorResponse' - $ref: '#/components/schemas/type_:FlowResponse' - $ref: '#/components/schemas/type_:AgentResponse' title: AgentLinkedFileResponseFile type_:AgentLinkedFileResponse: type: object properties: type: type: string enum: - file link: $ref: '#/components/schemas/type_:LinkedFileRequest' on_agent_call: $ref: '#/components/schemas/type_:OnAgentCallEnum' file: $ref: '#/components/schemas/type_:AgentLinkedFileResponseFile' required: - type - link title: AgentLinkedFileResponse type_:AgentInlineTool: type: object properties: type: type: string enum: - inline json_schema: $ref: '#/components/schemas/type_:ToolFunction' on_agent_call: $ref: '#/components/schemas/type_:OnAgentCallEnum' required: - type - json_schema title: AgentInlineTool type_:AgentResponseToolsItem: oneOf: - $ref: '#/components/schemas/type_:AgentLinkedFileResponse' - $ref: '#/components/schemas/type_:AgentInlineTool' title: AgentResponseToolsItem type_:VersionStatus: type: string enum: - uncommitted - committed - deleted description: An enumeration. title: VersionStatus type_:AgentResponse: type: object properties: path: type: string description: >- Path of the Agent, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Agent. directory_id: type: string description: ID of the directory that the file is in on Humanloop. model: type: string description: >- The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models) endpoint: $ref: '#/components/schemas/type_:ModelEndpoints' description: The provider model endpoint used. template: $ref: '#/components/schemas/type_:AgentResponseTemplate' description: >- 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}}`. template_language: $ref: '#/components/schemas/type_:TemplateLanguage' description: The template language to use for rendering the template. provider: $ref: '#/components/schemas/type_:ModelProviders' description: The company providing the underlying model service. max_tokens: type: integer default: -1 description: >- 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 temperature: type: number format: double default: 1 description: >- What sampling temperature to use when making a generation. Higher values means the model will be more creative. top_p: type: number format: double default: 1 description: >- An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. stop: $ref: '#/components/schemas/type_:AgentResponseStop' description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. presence_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far. frequency_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far. other: type: object additionalProperties: description: Any type description: Other parameter values to be passed to the provider call. seed: type: integer description: >- If specified, model will make a best effort to sample deterministically, but it is not guaranteed. response_format: $ref: '#/components/schemas/type_:ResponseFormat' description: >- The format of the response. Only `{"type": "json_object"}` is currently supported for chat. reasoning_effort: $ref: '#/components/schemas/type_:AgentResponseReasoningEffort' description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. tools: type: array items: $ref: '#/components/schemas/type_:AgentResponseToolsItem' description: >- List of tools that the Agent can call. These can be linked files or inline tools. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used. max_iterations: type: integer description: >- The maximum number of iterations the Agent can run. This is used to limit the number of times the Agent model is called. version_name: type: string description: >- Unique name for the Agent version. Version names must be unique for a given Agent. version_description: type: string description: Description of the version, e.g., the changes made in this version. description: type: string description: Description of the Agent. tags: type: array items: type: string description: List of tags associated with the file. readme: type: string description: Long description of the file. name: type: string description: Name of the Agent. schema: type: object additionalProperties: description: Any type description: The JSON schema for the Prompt. version_id: type: string description: >- Unique identifier for the specific Agent Version. If no query params provided, the default deployed Agent Version is returned. type: type: string enum: - agent environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Agent Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Agent. committed_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who committed the Agent Version. committed_at: type: string format: date-time description: The date and time the Agent Version was committed. status: $ref: '#/components/schemas/type_:VersionStatus' description: The status of the Agent Version. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Agent Version total_logs_count: type: integer description: >- The number of logs that have been generated across all Agent Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Agent. Inputs correspond to any of the variables used within the Agent template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Agent that are used for monitoring logs. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Agent Version. raw_file_content: type: string description: The raw content of the Agent. Corresponds to the .agent file. required: - path - id - model - tools - name - version_id - created_at - updated_at - status - last_used_at - version_logs_count - total_logs_count - inputs description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: AgentResponse type_:VersionDeploymentResponseFile: oneOf: - $ref: '#/components/schemas/type_:PromptResponse' - $ref: '#/components/schemas/type_:ToolResponse' - $ref: '#/components/schemas/type_:DatasetResponse' - $ref: '#/components/schemas/type_:EvaluatorResponse' - $ref: '#/components/schemas/type_:FlowResponse' - $ref: '#/components/schemas/type_:AgentResponse' description: The File that the deployed Version belongs to. title: VersionDeploymentResponseFile type_:VersionDeploymentResponse: type: object properties: file: $ref: '#/components/schemas/type_:VersionDeploymentResponseFile' description: The File that the deployed Version belongs to. environment: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The Environment that the Version is deployed to. type: type: string enum: - environment required: - file - environment - type description: A variable reference to the Version deployed to an Environment title: VersionDeploymentResponse type_:VersionIdResponseVersion: oneOf: - $ref: '#/components/schemas/type_:PromptResponse' - $ref: '#/components/schemas/type_:ToolResponse' - $ref: '#/components/schemas/type_:DatasetResponse' - $ref: '#/components/schemas/type_:EvaluatorResponse' - $ref: '#/components/schemas/type_:FlowResponse' - $ref: '#/components/schemas/type_:AgentResponse' description: The specific Version being referenced. title: VersionIdResponseVersion type_:VersionIdResponse: type: object properties: version: $ref: '#/components/schemas/type_:VersionIdResponseVersion' description: The specific Version being referenced. type: type: string enum: - version required: - version - type description: A reference to a specific Version by its ID title: VersionIdResponse type_:VersionReferenceResponse: oneOf: - $ref: '#/components/schemas/type_:VersionDeploymentResponse' - $ref: '#/components/schemas/type_:VersionIdResponse' title: VersionReferenceResponse type_:MonitoringEvaluatorState: type: string enum: - active - inactive description: State of an evaluator connected to a file title: MonitoringEvaluatorState type_:MonitoringEvaluatorResponse: type: object properties: version_reference: $ref: '#/components/schemas/type_:VersionReferenceResponse' description: >- The Evaluator Version used for monitoring. This can be a specific Version by ID, or a Version deployed to an Environment. version: $ref: '#/components/schemas/type_:EvaluatorResponse' description: The deployed Version. state: $ref: '#/components/schemas/type_:MonitoringEvaluatorState' description: The state of the Monitoring Evaluator. Either `active` or `inactive` created_at: type: string format: date-time updated_at: type: string format: date-time required: - version_reference - state - created_at - updated_at title: MonitoringEvaluatorResponse type_:PromptResponse: type: object properties: path: type: string description: >- Path of the Prompt, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Prompt. directory_id: type: string description: ID of the directory that the file is in on Humanloop. model: type: string description: >- The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models) endpoint: $ref: '#/components/schemas/type_:ModelEndpoints' description: The provider model endpoint used. template: $ref: '#/components/schemas/type_:PromptResponseTemplate' description: >- 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}}`. template_language: $ref: '#/components/schemas/type_:TemplateLanguage' description: The template language to use for rendering the template. provider: $ref: '#/components/schemas/type_:ModelProviders' description: The company providing the underlying model service. max_tokens: type: integer default: -1 description: >- 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 temperature: type: number format: double default: 1 description: >- What sampling temperature to use when making a generation. Higher values means the model will be more creative. top_p: type: number format: double default: 1 description: >- An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. stop: $ref: '#/components/schemas/type_:PromptResponseStop' description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. presence_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far. frequency_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far. other: type: object additionalProperties: description: Any type description: Other parameter values to be passed to the provider call. seed: type: integer description: >- If specified, model will make a best effort to sample deterministically, but it is not guaranteed. response_format: $ref: '#/components/schemas/type_:ResponseFormat' description: >- The format of the response. Only `{"type": "json_object"}` is currently supported for chat. reasoning_effort: $ref: '#/components/schemas/type_:PromptResponseReasoningEffort' description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. tools: type: array items: $ref: '#/components/schemas/type_:ToolFunction' description: >- The tool specification that the model can choose to call if Tool calling is supported. linked_tools: type: array items: $ref: '#/components/schemas/type_:LinkedToolResponse' description: The tools linked to your prompt that the model can call. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used. version_name: type: string description: >- Unique name for the Prompt version. Version names must be unique for a given Prompt. version_description: type: string description: Description of the version, e.g., the changes made in this version. description: type: string description: Description of the Prompt. tags: type: array items: type: string description: List of tags associated with the file. readme: type: string description: Long description of the file. name: type: string description: Name of the Prompt. schema: type: object additionalProperties: description: Any type description: The JSON schema for the Prompt. version_id: type: string description: >- Unique identifier for the specific Prompt Version. If no query params provided, the default deployed Prompt Version is returned. type: type: string enum: - prompt environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Prompt Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Prompt. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Prompt Version total_logs_count: type: integer description: >- The number of logs that have been generated across all Prompt Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Prompt. Inputs correspond to any of the variables used within the Prompt template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Prompt that are used for monitoring logs. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Prompt Version. raw_file_content: type: string description: The raw content of the Prompt. Corresponds to the .prompt file. required: - path - id - model - name - version_id - created_at - updated_at - last_used_at - version_logs_count - total_logs_count - inputs description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: PromptResponse type_:ValidationErrorLocItem: oneOf: - type: string - type: integer title: ValidationErrorLocItem type_:ValidationError: type: object properties: loc: type: array items: $ref: '#/components/schemas/type_:ValidationErrorLocItem' msg: type: string type: type: string required: - loc - msg - type title: ValidationError type_:HttpValidationError: type: object properties: detail: type: array items: $ref: '#/components/schemas/type_:ValidationError' title: HttpValidationError securitySchemes: default: type: apiKey in: header name: X-API-KEY ``` ## SDK Code Examples ```python import requests url = "https://api.humanloop.com/v5/prompts/id/environments/environment_id" querystring = {"version_id":"version_id"} headers = {"X-API-KEY": " "} response = requests.post(url, headers=headers, params=querystring) print(response.json()) ``` ```typescript import { HumanloopClient } from "humanloop"; const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); await client.prompts.setDeployment("id", "environment_id", { versionId: "version_id" }); ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/prompts/id/environments/environment_id?version_id=version_id" req, _ := http.NewRequest("POST", url, nil) req.Header.Add("X-API-KEY", " ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://api.humanloop.com/v5/prompts/id/environments/environment_id?version_id=version_id") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["X-API-KEY"] = ' ' response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.humanloop.com/v5/prompts/id/environments/environment_id?version_id=version_id") .header("X-API-KEY", " ") .asString(); ``` ```php request('POST', 'https://api.humanloop.com/v5/prompts/id/environments/environment_id?version_id=version_id', [ 'headers' => [ 'X-API-KEY' => ' ', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/prompts/id/environments/environment_id?version_id=version_id"); var request = new RestRequest(Method.POST); request.AddHeader("X-API-KEY", " "); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = ["X-API-KEY": " "] let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/prompts/id/environments/environment_id?version_id=version_id")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. # Remove Deployment DELETE https://api.humanloop.com/v5/prompts/{id}/environments/{environment_id} Remove deployed Prompt from the Environment. Remove the deployed version for the specified Environment. This Prompt will no longer be used for calls made to the Prompt in this Environment. Reference: https://humanloop.com/docs/api/prompts/remove-deployment ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /prompts/{id}/environments/{environment_id}: delete: operationId: remove-deployment summary: Remove Deployment description: |- Remove deployed Prompt from the Environment. Remove the deployed version for the specified Environment. This Prompt will no longer be used for calls made to the Prompt in this Environment. tags: - subpackage_prompts parameters: - name: id in: path description: Unique identifier for Prompt. required: true schema: type: string - name: environment_id in: path description: Unique identifier for the Environment to remove the deployment from. required: true schema: type: string - name: X-API-KEY in: header required: true schema: type: string responses: '200': description: Successful response '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/type_:HttpValidationError' servers: - url: https://api.humanloop.com/v5 components: schemas: type_:ValidationErrorLocItem: oneOf: - type: string - type: integer title: ValidationErrorLocItem type_:ValidationError: type: object properties: loc: type: array items: $ref: '#/components/schemas/type_:ValidationErrorLocItem' msg: type: string type: type: string required: - loc - msg - type title: ValidationError type_:HttpValidationError: type: object properties: detail: type: array items: $ref: '#/components/schemas/type_:ValidationError' title: HttpValidationError securitySchemes: default: type: apiKey in: header name: X-API-KEY ``` ## SDK Code Examples ```python import requests url = "https://api.humanloop.com/v5/prompts/id/environments/environment_id" headers = {"X-API-KEY": " "} response = requests.delete(url, headers=headers) print(response.json()) ``` ```typescript import { HumanloopClient } from "humanloop"; const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); await client.prompts.removeDeployment("id", "environment_id"); ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/prompts/id/environments/environment_id" req, _ := http.NewRequest("DELETE", url, nil) req.Header.Add("X-API-KEY", " ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://api.humanloop.com/v5/prompts/id/environments/environment_id") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Delete.new(url) request["X-API-KEY"] = ' ' response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.delete("https://api.humanloop.com/v5/prompts/id/environments/environment_id") .header("X-API-KEY", " ") .asString(); ``` ```php request('DELETE', 'https://api.humanloop.com/v5/prompts/id/environments/environment_id', [ 'headers' => [ 'X-API-KEY' => ' ', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/prompts/id/environments/environment_id"); var request = new RestRequest(Method.DELETE); request.AddHeader("X-API-KEY", " "); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = ["X-API-KEY": " "] let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/prompts/id/environments/environment_id")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "DELETE" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. # List a Prompt's Environments GET https://api.humanloop.com/v5/prompts/{id}/environments List all Environments and their deployed versions for the Prompt. Reference: https://humanloop.com/docs/api/prompts/list-environments ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /prompts/{id}/environments: get: operationId: list-environments summary: List a Prompt's Environments description: List all Environments and their deployed versions for the Prompt. tags: - subpackage_prompts parameters: - name: id in: path description: Unique identifier for Prompt. required: true schema: type: string - name: X-API-KEY in: header required: true schema: type: string responses: '200': description: Successful Response content: application/json: schema: type: array items: $ref: '#/components/schemas/type_:FileEnvironmentResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/type_:HttpValidationError' servers: - url: https://api.humanloop.com/v5 components: schemas: type_:EnvironmentTag: type: string enum: - default - other description: An enumeration. title: EnvironmentTag type_:ModelEndpoints: type: string enum: - complete - chat - edit description: Supported model provider endpoints. title: ModelEndpoints type_:TextChatContent: type: object properties: type: type: string enum: - text text: type: string description: The message's text content. required: - type - text title: TextChatContent type_:ImageUrlDetail: type: string enum: - high - low - auto description: >- Specify the detail level of the image provided to the model. For more details see: https://platform.openai.com/docs/guides/vision/low-or-high-fidelity-image-understanding title: ImageUrlDetail type_:ImageUrl: type: object properties: url: type: string description: Either a URL of the image or the base64 encoded image data. detail: $ref: '#/components/schemas/type_:ImageUrlDetail' description: >- Specify the detail level of the image provided to the model. For more details see: https://platform.openai.com/docs/guides/vision/low-or-high-fidelity-image-understanding required: - url title: ImageUrl type_:ImageChatContent: type: object properties: type: type: string enum: - image_url image_url: $ref: '#/components/schemas/type_:ImageUrl' description: The message's image content. required: - type - image_url title: ImageChatContent type_:ChatMessageContentItem: oneOf: - $ref: '#/components/schemas/type_:TextChatContent' - $ref: '#/components/schemas/type_:ImageChatContent' title: ChatMessageContentItem type_:ChatMessageContent: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessageContentItem' description: The content of the message. title: ChatMessageContent type_:ChatRole: type: string enum: - user - assistant - system - tool - developer description: An enumeration. title: ChatRole type_:ChatToolType: type: string enum: - function description: The type of tool to call. title: ChatToolType type_:FunctionTool: type: object properties: name: type: string arguments: type: string required: - name description: A function tool to be called by the model where user owns runtime. title: FunctionTool type_:ToolCall: type: object properties: id: type: string type: $ref: '#/components/schemas/type_:ChatToolType' function: $ref: '#/components/schemas/type_:FunctionTool' required: - id - type - function description: A tool call to be made. title: ToolCall type_:AnthropicThinkingContent: type: object properties: type: type: string enum: - thinking thinking: type: string description: Model's chain-of-thought for providing the response. signature: type: string description: >- Cryptographic signature that verifies the thinking block was generated by Anthropic. required: - type - thinking - signature title: AnthropicThinkingContent type_:AnthropicRedactedThinkingContent: type: object properties: type: type: string enum: - redacted_thinking data: type: string description: >- Thinking block Anthropic redacted for safety reasons. User is expected to pass the block back to Anthropic required: - type - data title: AnthropicRedactedThinkingContent type_:ChatMessageThinkingItem: oneOf: - $ref: '#/components/schemas/type_:AnthropicThinkingContent' - $ref: '#/components/schemas/type_:AnthropicRedactedThinkingContent' title: ChatMessageThinkingItem type_:ChatMessage: type: object properties: content: $ref: '#/components/schemas/type_:ChatMessageContent' description: The content of the message. name: type: string description: Optional name of the message author. tool_call_id: type: string description: Tool call that this message is responding to. role: $ref: '#/components/schemas/type_:ChatRole' description: Role of the message author. tool_calls: type: array items: $ref: '#/components/schemas/type_:ToolCall' description: A list of tool calls requested by the assistant. thinking: type: array items: $ref: '#/components/schemas/type_:ChatMessageThinkingItem' description: >- Model's chain-of-thought for providing the response. Present on assistant messages if model supports it. required: - role title: ChatMessage type_:PromptResponseTemplate: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: >- 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}}`. title: PromptResponseTemplate type_:TemplateLanguage: type: string enum: - default - jinja description: Template engine to use for rendering templates. title: TemplateLanguage type_:ModelProviders: type: string enum: - anthropic - bedrock - cohere - deepseek - google - groq - mock - openai - openai_azure - replicate description: Supported model providers. title: ModelProviders type_:PromptResponseStop: oneOf: - type: string - type: array items: type: string description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. title: PromptResponseStop type_:ResponseFormatType: type: string enum: - json_object - json_schema title: ResponseFormatType type_:ResponseFormat: type: object properties: type: $ref: '#/components/schemas/type_:ResponseFormatType' json_schema: type: object additionalProperties: description: Any type description: The JSON schema of the response format if type is json_schema. required: - type description: Response format of the model. title: ResponseFormat type_:OpenAiReasoningEffort: type: string enum: - high - medium - low description: Supported reasoning effort. title: OpenAiReasoningEffort type_:PromptResponseReasoningEffort: oneOf: - $ref: '#/components/schemas/type_:OpenAiReasoningEffort' - type: integer description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. title: PromptResponseReasoningEffort type_:ToolFunction: type: object properties: name: type: string description: Name for the tool referenced by the model. description: type: string description: Description of the tool referenced by the model strict: type: boolean default: false description: >- If true, forces the model to output json data in the structure of the parameters schema. parameters: type: object additionalProperties: description: Any type description: >- Parameters needed to run the Tool, defined in JSON Schema format: https://json-schema.org/ required: - name - description title: ToolFunction type_:LinkedToolResponse: type: object properties: name: type: string description: Name for the tool referenced by the model. description: type: string description: Description of the tool referenced by the model strict: type: boolean default: false description: >- If true, forces the model to output json data in the structure of the parameters schema. parameters: type: object additionalProperties: description: Any type description: >- Parameters needed to run the Tool, defined in JSON Schema format: https://json-schema.org/ id: type: string description: Unique identifier for the Tool linked. version_id: type: string description: Unique identifier for the Tool Version linked. required: - name - description - id - version_id title: LinkedToolResponse type_:EnvironmentResponse: type: object properties: id: type: string created_at: type: string format: date-time name: type: string tag: $ref: '#/components/schemas/type_:EnvironmentTag' required: - id - created_at - name - tag title: EnvironmentResponse type_:UserResponse: description: Any type title: UserResponse type_:InputResponse: type: object properties: name: type: string description: Type of input. required: - name title: InputResponse type_:FilesToolType: type: string enum: - pinecone_search - google - mock - snippet - json_schema - get_api_call - python description: Type of tool. title: FilesToolType type_:EvaluatorAggregate: type: object properties: value: type: number format: double description: The aggregated value of the evaluator. evaluator_id: type: string description: ID of the evaluator. evaluator_version_id: type: string description: ID of the evaluator version. created_at: type: string format: date-time updated_at: type: string format: date-time required: - value - evaluator_id - evaluator_version_id - created_at - updated_at title: EvaluatorAggregate type_:ToolResponse: type: object properties: path: type: string description: >- Path of the Tool, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Tool. directory_id: type: string description: ID of the directory that the file is in on Humanloop. function: $ref: '#/components/schemas/type_:ToolFunction' description: >- Callable function specification of the Tool shown to the model for tool calling. source_code: type: string description: Code source of the Tool. setup_values: type: object additionalProperties: description: Any type description: >- Values needed to setup the Tool, defined in JSON Schema format: https://json-schema.org/ attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Tool. Helpful to separate Tool versions from each other with details on how they were created or used. tool_type: $ref: '#/components/schemas/type_:FilesToolType' description: Type of Tool. version_name: type: string description: >- Unique identifier for this Tool version. Each Tool can only have one version with a given name. version_description: type: string description: Description of the Version. name: type: string description: Name of the Tool, which is used as a unique identifier. description: type: string description: Description of the Tool. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Tool Version. If no query params provided, the default deployed Tool Version is returned. type: type: string enum: - tool environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Tool Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Tool. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Tool Version total_logs_count: type: integer description: The number of logs that have been generated across all Tool Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Prompt. Inputs correspond to any of the variables used within the Tool template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Tool that are used for monitoring logs. signature: type: string description: Signature of the Tool. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Tool Version. required: - path - id - name - version_id - created_at - updated_at - last_used_at - version_logs_count - total_logs_count - inputs description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: ToolResponse type_:DatapointResponseTargetValue: oneOf: - type: string - type: integer - type: number format: double - type: boolean - type: array items: description: Any type - type: object additionalProperties: description: Any type title: DatapointResponseTargetValue type_:DatapointResponse: type: object properties: inputs: type: object additionalProperties: type: string description: The inputs to the prompt template. messages: type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: List of chat messages to provide to the model. target: type: object additionalProperties: $ref: '#/components/schemas/type_:DatapointResponseTargetValue' description: >- Object with criteria necessary to evaluate generations with this Datapoint. This is passed in as an argument to Evaluators when used in an Evaluation. id: type: string description: Unique identifier for the Datapoint. Starts with `dp_`. required: - id title: DatapointResponse type_:DatasetResponse: type: object properties: path: type: string description: >- Path of the Dataset, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Dataset. Starts with `ds_`. directory_id: type: string description: ID of the directory that the file is in on Humanloop. name: type: string description: Name of the Dataset, which is used as a unique identifier. description: type: string description: Description of the Dataset. schema: type: object additionalProperties: description: Any type description: The JSON schema for the File. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Dataset Version. If no query params provided, the default deployed Dataset Version is returned. Starts with `dsv_`. type: type: string enum: - dataset environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Dataset Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Dataset. last_used_at: type: string format: date-time version_name: type: string description: >- Unique name for the Dataset version. Version names must be unique for a given Dataset. version_description: type: string description: Description of the version, e.g., the changes made in this version. datapoints_count: type: integer description: The number of Datapoints in this Dataset version. datapoints: type: array items: $ref: '#/components/schemas/type_:DatapointResponse' description: >- The list of Datapoints in this Dataset version. Only provided if explicitly requested. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Dataset. Helpful to separate Dataset versions from each other with details on how they were created or used. required: - path - id - name - version_id - created_at - updated_at - last_used_at - datapoints_count description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: DatasetResponse type_:EvaluatorArgumentsType: type: string enum: - target_free - target_required description: Enum representing the possible argument types of an evaluator. title: EvaluatorArgumentsType type_:EvaluatorReturnTypeEnum: type: string enum: - boolean - number - select - multi_select - text description: Enum representing the possible return types of an evaluator. title: EvaluatorReturnTypeEnum type_:Valence: type: string enum: - positive - negative - neutral description: An enumeration. title: Valence type_:EvaluatorJudgmentOptionResponse: type: object properties: name: type: string description: The name of the option. valence: $ref: '#/components/schemas/type_:Valence' description: Whether this option should be considered positive or negative. required: - name title: EvaluatorJudgmentOptionResponse type_:EvaluatorJudgmentNumberLimit: type: object properties: min: type: number format: double description: The minimum value that can be selected. max: type: number format: double description: The maximum value that can be selected. step: type: number format: double description: The step size for the number input. title: EvaluatorJudgmentNumberLimit type_:PromptKernelRequestTemplate: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: >- 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}}`. title: PromptKernelRequestTemplate type_:PromptKernelRequestStop: oneOf: - type: string - type: array items: type: string description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. title: PromptKernelRequestStop type_:PromptKernelRequestReasoningEffort: oneOf: - $ref: '#/components/schemas/type_:OpenAiReasoningEffort' - type: integer description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. title: PromptKernelRequestReasoningEffort type_:PromptKernelRequest: type: object properties: model: type: string description: >- The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models) endpoint: $ref: '#/components/schemas/type_:ModelEndpoints' description: The provider model endpoint used. template: $ref: '#/components/schemas/type_:PromptKernelRequestTemplate' description: >- 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}}`. template_language: $ref: '#/components/schemas/type_:TemplateLanguage' description: The template language to use for rendering the template. provider: $ref: '#/components/schemas/type_:ModelProviders' description: The company providing the underlying model service. max_tokens: type: integer default: -1 description: >- 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 temperature: type: number format: double default: 1 description: >- What sampling temperature to use when making a generation. Higher values means the model will be more creative. top_p: type: number format: double default: 1 description: >- An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. stop: $ref: '#/components/schemas/type_:PromptKernelRequestStop' description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. presence_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far. frequency_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far. other: type: object additionalProperties: description: Any type description: Other parameter values to be passed to the provider call. seed: type: integer description: >- If specified, model will make a best effort to sample deterministically, but it is not guaranteed. response_format: $ref: '#/components/schemas/type_:ResponseFormat' description: >- The format of the response. Only `{"type": "json_object"}` is currently supported for chat. reasoning_effort: $ref: '#/components/schemas/type_:PromptKernelRequestReasoningEffort' description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. tools: type: array items: $ref: '#/components/schemas/type_:ToolFunction' description: >- The tool specification that the model can choose to call if Tool calling is supported. linked_tools: type: array items: type: string description: >- 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. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used. required: - model description: |- Base class used by both PromptKernelRequest and AgentKernelRequest. Contains the consistent Prompt-related fields. title: PromptKernelRequest type_:LlmEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:EvaluatorReturnTypeEnum' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: >- The options that can be applied as judgments. Only for Evaluators with `return_type` of 'boolean', 'select' or 'multi_select'. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - llm prompt: $ref: '#/components/schemas/type_:PromptKernelRequest' description: The prompt parameters used to generate. required: - arguments_type - return_type - evaluator_type title: LlmEvaluatorRequest type_:CodeEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:EvaluatorReturnTypeEnum' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: >- The options that can be applied as judgments. Only for Evaluators with `return_type` of 'boolean', 'select' or 'multi_select'. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - python code: type: string description: >- The code for the Evaluator. This code will be executed in a sandboxed environment. required: - arguments_type - return_type - evaluator_type - code title: CodeEvaluatorRequest type_:HumanEvaluatorRequestReturnType: type: string enum: - select - multi_select - text - number - boolean description: The type of the return value of the Evaluator. title: HumanEvaluatorRequestReturnType type_:HumanEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:HumanEvaluatorRequestReturnType' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: The options that can be applied as judgments. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - human instructions: type: string description: Instructions and guidelines for applying judgments. required: - arguments_type - return_type - evaluator_type title: HumanEvaluatorRequest type_:ExternalEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:EvaluatorReturnTypeEnum' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: >- The options that can be applied as judgments. Only for Evaluators with `return_type` of 'boolean', 'select' or 'multi_select'. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - external required: - arguments_type - return_type - evaluator_type title: ExternalEvaluatorRequest type_:EvaluatorResponseSpec: oneOf: - $ref: '#/components/schemas/type_:LlmEvaluatorRequest' - $ref: '#/components/schemas/type_:CodeEvaluatorRequest' - $ref: '#/components/schemas/type_:HumanEvaluatorRequest' - $ref: '#/components/schemas/type_:ExternalEvaluatorRequest' title: EvaluatorResponseSpec type_:EvaluatorResponse: type: object properties: path: type: string description: >- Path of the Evaluator including the Evaluator name, which is used as a unique identifier. id: type: string description: Unique identifier for the Evaluator. directory_id: type: string description: ID of the directory that the file is in on Humanloop. version_name: type: string description: >- Unique name for the Evaluator version. Version names must be unique for a given Evaluator. version_description: type: string description: Description of the version, e.g., the changes made in this version. spec: $ref: '#/components/schemas/type_:EvaluatorResponseSpec' name: type: string description: Name of the Evaluator, which is used as a unique identifier. description: type: string description: Description of the Evaluator. schema: type: object additionalProperties: description: Any type description: The JSON schema for the File. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Evaluator Version. If no query params provided, the default deployed Evaluator Version is returned. type: type: string enum: - evaluator environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Evaluator Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Evaluator. last_used_at: type: string format: date-time version_logs_count: type: integer description: >- The number of logs that have been generated for this Evaluator Version total_logs_count: type: integer description: >- The number of logs that have been generated across all Evaluator Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Evaluator. Inputs correspond to any of the variables used within the Evaluator template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Evaluator that are used for monitoring logs. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Evaluator Version. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. required: - path - id - spec - name - version_id - created_at - updated_at - last_used_at - version_logs_count - total_logs_count - inputs description: Version of the Evaluator used to provide judgments. title: EvaluatorResponse type_:FlowResponse: type: object properties: path: type: string description: >- Path of the Flow, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Flow. directory_id: type: string description: ID of the directory that the file is in on Humanloop. attributes: type: object additionalProperties: description: Any type description: A key-value object identifying the Flow Version. version_name: type: string description: >- Unique name for the Flow version. Version names must be unique for a given Flow. version_description: type: string description: Description of the Version. name: type: string description: Name of the Flow. description: type: string description: Description of the Flow. schema: type: object additionalProperties: description: Any type description: The JSON schema for the File. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Flow Version. If no query params provided, the default deployed Flow Version is returned. type: type: string enum: - flow environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Flow Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Flow. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Flow Version evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Flow Version. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: The list of Monitoring Evaluators associated with the Flow Version. required: - path - id - attributes - name - version_id - created_at - updated_at - last_used_at - version_logs_count description: Response model for a Flow. title: FlowResponse type_:AgentResponseTemplate: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: >- 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}}`. title: AgentResponseTemplate type_:AgentResponseStop: oneOf: - type: string - type: array items: type: string description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. title: AgentResponseStop type_:AgentResponseReasoningEffort: oneOf: - $ref: '#/components/schemas/type_:OpenAiReasoningEffort' - type: integer description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. title: AgentResponseReasoningEffort type_:LinkedFileRequest: type: object properties: file_id: type: string environment_id: type: string version_id: type: string required: - file_id title: LinkedFileRequest type_:OnAgentCallEnum: type: string enum: - stop - continue description: What an Agent should do when calling a Tool. title: OnAgentCallEnum type_:AgentLinkedFileResponseFile: oneOf: - $ref: '#/components/schemas/type_:PromptResponse' - $ref: '#/components/schemas/type_:ToolResponse' - $ref: '#/components/schemas/type_:DatasetResponse' - $ref: '#/components/schemas/type_:EvaluatorResponse' - $ref: '#/components/schemas/type_:FlowResponse' - $ref: '#/components/schemas/type_:AgentResponse' title: AgentLinkedFileResponseFile type_:AgentLinkedFileResponse: type: object properties: type: type: string enum: - file link: $ref: '#/components/schemas/type_:LinkedFileRequest' on_agent_call: $ref: '#/components/schemas/type_:OnAgentCallEnum' file: $ref: '#/components/schemas/type_:AgentLinkedFileResponseFile' required: - type - link title: AgentLinkedFileResponse type_:AgentInlineTool: type: object properties: type: type: string enum: - inline json_schema: $ref: '#/components/schemas/type_:ToolFunction' on_agent_call: $ref: '#/components/schemas/type_:OnAgentCallEnum' required: - type - json_schema title: AgentInlineTool type_:AgentResponseToolsItem: oneOf: - $ref: '#/components/schemas/type_:AgentLinkedFileResponse' - $ref: '#/components/schemas/type_:AgentInlineTool' title: AgentResponseToolsItem type_:VersionStatus: type: string enum: - uncommitted - committed - deleted description: An enumeration. title: VersionStatus type_:AgentResponse: type: object properties: path: type: string description: >- Path of the Agent, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Agent. directory_id: type: string description: ID of the directory that the file is in on Humanloop. model: type: string description: >- The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models) endpoint: $ref: '#/components/schemas/type_:ModelEndpoints' description: The provider model endpoint used. template: $ref: '#/components/schemas/type_:AgentResponseTemplate' description: >- 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}}`. template_language: $ref: '#/components/schemas/type_:TemplateLanguage' description: The template language to use for rendering the template. provider: $ref: '#/components/schemas/type_:ModelProviders' description: The company providing the underlying model service. max_tokens: type: integer default: -1 description: >- 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 temperature: type: number format: double default: 1 description: >- What sampling temperature to use when making a generation. Higher values means the model will be more creative. top_p: type: number format: double default: 1 description: >- An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. stop: $ref: '#/components/schemas/type_:AgentResponseStop' description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. presence_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far. frequency_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far. other: type: object additionalProperties: description: Any type description: Other parameter values to be passed to the provider call. seed: type: integer description: >- If specified, model will make a best effort to sample deterministically, but it is not guaranteed. response_format: $ref: '#/components/schemas/type_:ResponseFormat' description: >- The format of the response. Only `{"type": "json_object"}` is currently supported for chat. reasoning_effort: $ref: '#/components/schemas/type_:AgentResponseReasoningEffort' description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. tools: type: array items: $ref: '#/components/schemas/type_:AgentResponseToolsItem' description: >- List of tools that the Agent can call. These can be linked files or inline tools. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used. max_iterations: type: integer description: >- The maximum number of iterations the Agent can run. This is used to limit the number of times the Agent model is called. version_name: type: string description: >- Unique name for the Agent version. Version names must be unique for a given Agent. version_description: type: string description: Description of the version, e.g., the changes made in this version. description: type: string description: Description of the Agent. tags: type: array items: type: string description: List of tags associated with the file. readme: type: string description: Long description of the file. name: type: string description: Name of the Agent. schema: type: object additionalProperties: description: Any type description: The JSON schema for the Prompt. version_id: type: string description: >- Unique identifier for the specific Agent Version. If no query params provided, the default deployed Agent Version is returned. type: type: string enum: - agent environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Agent Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Agent. committed_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who committed the Agent Version. committed_at: type: string format: date-time description: The date and time the Agent Version was committed. status: $ref: '#/components/schemas/type_:VersionStatus' description: The status of the Agent Version. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Agent Version total_logs_count: type: integer description: >- The number of logs that have been generated across all Agent Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Agent. Inputs correspond to any of the variables used within the Agent template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Agent that are used for monitoring logs. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Agent Version. raw_file_content: type: string description: The raw content of the Agent. Corresponds to the .agent file. required: - path - id - model - tools - name - version_id - created_at - updated_at - status - last_used_at - version_logs_count - total_logs_count - inputs description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: AgentResponse type_:VersionDeploymentResponseFile: oneOf: - $ref: '#/components/schemas/type_:PromptResponse' - $ref: '#/components/schemas/type_:ToolResponse' - $ref: '#/components/schemas/type_:DatasetResponse' - $ref: '#/components/schemas/type_:EvaluatorResponse' - $ref: '#/components/schemas/type_:FlowResponse' - $ref: '#/components/schemas/type_:AgentResponse' description: The File that the deployed Version belongs to. title: VersionDeploymentResponseFile type_:VersionDeploymentResponse: type: object properties: file: $ref: '#/components/schemas/type_:VersionDeploymentResponseFile' description: The File that the deployed Version belongs to. environment: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The Environment that the Version is deployed to. type: type: string enum: - environment required: - file - environment - type description: A variable reference to the Version deployed to an Environment title: VersionDeploymentResponse type_:VersionIdResponseVersion: oneOf: - $ref: '#/components/schemas/type_:PromptResponse' - $ref: '#/components/schemas/type_:ToolResponse' - $ref: '#/components/schemas/type_:DatasetResponse' - $ref: '#/components/schemas/type_:EvaluatorResponse' - $ref: '#/components/schemas/type_:FlowResponse' - $ref: '#/components/schemas/type_:AgentResponse' description: The specific Version being referenced. title: VersionIdResponseVersion type_:VersionIdResponse: type: object properties: version: $ref: '#/components/schemas/type_:VersionIdResponseVersion' description: The specific Version being referenced. type: type: string enum: - version required: - version - type description: A reference to a specific Version by its ID title: VersionIdResponse type_:VersionReferenceResponse: oneOf: - $ref: '#/components/schemas/type_:VersionDeploymentResponse' - $ref: '#/components/schemas/type_:VersionIdResponse' title: VersionReferenceResponse type_:MonitoringEvaluatorState: type: string enum: - active - inactive description: State of an evaluator connected to a file title: MonitoringEvaluatorState type_:MonitoringEvaluatorResponse: type: object properties: version_reference: $ref: '#/components/schemas/type_:VersionReferenceResponse' description: >- The Evaluator Version used for monitoring. This can be a specific Version by ID, or a Version deployed to an Environment. version: $ref: '#/components/schemas/type_:EvaluatorResponse' description: The deployed Version. state: $ref: '#/components/schemas/type_:MonitoringEvaluatorState' description: The state of the Monitoring Evaluator. Either `active` or `inactive` created_at: type: string format: date-time updated_at: type: string format: date-time required: - version_reference - state - created_at - updated_at title: MonitoringEvaluatorResponse type_:PromptResponse: type: object properties: path: type: string description: >- Path of the Prompt, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Prompt. directory_id: type: string description: ID of the directory that the file is in on Humanloop. model: type: string description: >- The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models) endpoint: $ref: '#/components/schemas/type_:ModelEndpoints' description: The provider model endpoint used. template: $ref: '#/components/schemas/type_:PromptResponseTemplate' description: >- 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}}`. template_language: $ref: '#/components/schemas/type_:TemplateLanguage' description: The template language to use for rendering the template. provider: $ref: '#/components/schemas/type_:ModelProviders' description: The company providing the underlying model service. max_tokens: type: integer default: -1 description: >- 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 temperature: type: number format: double default: 1 description: >- What sampling temperature to use when making a generation. Higher values means the model will be more creative. top_p: type: number format: double default: 1 description: >- An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. stop: $ref: '#/components/schemas/type_:PromptResponseStop' description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. presence_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far. frequency_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far. other: type: object additionalProperties: description: Any type description: Other parameter values to be passed to the provider call. seed: type: integer description: >- If specified, model will make a best effort to sample deterministically, but it is not guaranteed. response_format: $ref: '#/components/schemas/type_:ResponseFormat' description: >- The format of the response. Only `{"type": "json_object"}` is currently supported for chat. reasoning_effort: $ref: '#/components/schemas/type_:PromptResponseReasoningEffort' description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. tools: type: array items: $ref: '#/components/schemas/type_:ToolFunction' description: >- The tool specification that the model can choose to call if Tool calling is supported. linked_tools: type: array items: $ref: '#/components/schemas/type_:LinkedToolResponse' description: The tools linked to your prompt that the model can call. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used. version_name: type: string description: >- Unique name for the Prompt version. Version names must be unique for a given Prompt. version_description: type: string description: Description of the version, e.g., the changes made in this version. description: type: string description: Description of the Prompt. tags: type: array items: type: string description: List of tags associated with the file. readme: type: string description: Long description of the file. name: type: string description: Name of the Prompt. schema: type: object additionalProperties: description: Any type description: The JSON schema for the Prompt. version_id: type: string description: >- Unique identifier for the specific Prompt Version. If no query params provided, the default deployed Prompt Version is returned. type: type: string enum: - prompt environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Prompt Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Prompt. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Prompt Version total_logs_count: type: integer description: >- The number of logs that have been generated across all Prompt Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Prompt. Inputs correspond to any of the variables used within the Prompt template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Prompt that are used for monitoring logs. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Prompt Version. raw_file_content: type: string description: The raw content of the Prompt. Corresponds to the .prompt file. required: - path - id - model - name - version_id - created_at - updated_at - last_used_at - version_logs_count - total_logs_count - inputs description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: PromptResponse type_:FileEnvironmentResponseFile: oneOf: - $ref: '#/components/schemas/type_:PromptResponse' - $ref: '#/components/schemas/type_:ToolResponse' - $ref: '#/components/schemas/type_:DatasetResponse' - $ref: '#/components/schemas/type_:EvaluatorResponse' - $ref: '#/components/schemas/type_:FlowResponse' - $ref: '#/components/schemas/type_:AgentResponse' description: >- The version of the File that is deployed to the Environment, if one is deployed. title: FileEnvironmentResponseFile type_:FileEnvironmentResponse: type: object properties: id: type: string created_at: type: string format: date-time name: type: string tag: $ref: '#/components/schemas/type_:EnvironmentTag' file: $ref: '#/components/schemas/type_:FileEnvironmentResponseFile' description: >- The version of the File that is deployed to the Environment, if one is deployed. required: - id - created_at - name - tag description: >- Response model for the List Environments endpoint under Files. Contains the deployed version of the File, if one is deployed to the Environment. title: FileEnvironmentResponse type_:ValidationErrorLocItem: oneOf: - type: string - type: integer title: ValidationErrorLocItem type_:ValidationError: type: object properties: loc: type: array items: $ref: '#/components/schemas/type_:ValidationErrorLocItem' msg: type: string type: type: string required: - loc - msg - type title: ValidationError type_:HttpValidationError: type: object properties: detail: type: array items: $ref: '#/components/schemas/type_:ValidationError' title: HttpValidationError securitySchemes: default: type: apiKey in: header name: X-API-KEY ``` ## SDK Code Examples ```python List environments import requests url = "https://api.humanloop.com/v5/prompts/pr_30gco7dx6JDq4200GVOHa/environments" headers = {"X-API-KEY": " "} response = requests.get(url, headers=headers) print(response.json()) ``` ```typescript List environments import { HumanloopClient } from "humanloop"; const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); await client.prompts.listEnvironments("pr_30gco7dx6JDq4200GVOHa"); ``` ```go List environments package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/prompts/pr_30gco7dx6JDq4200GVOHa/environments" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("X-API-KEY", " ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby List environments require 'uri' require 'net/http' url = URI("https://api.humanloop.com/v5/prompts/pr_30gco7dx6JDq4200GVOHa/environments") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["X-API-KEY"] = ' ' response = http.request(request) puts response.read_body ``` ```java List environments import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api.humanloop.com/v5/prompts/pr_30gco7dx6JDq4200GVOHa/environments") .header("X-API-KEY", " ") .asString(); ``` ```php List environments request('GET', 'https://api.humanloop.com/v5/prompts/pr_30gco7dx6JDq4200GVOHa/environments', [ 'headers' => [ 'X-API-KEY' => ' ', ], ]); echo $response->getBody(); ``` ```csharp List environments using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/prompts/pr_30gco7dx6JDq4200GVOHa/environments"); var request = new RestRequest(Method.GET); request.AddHeader("X-API-KEY", " "); IRestResponse response = client.Execute(request); ``` ```swift List environments import Foundation let headers = ["X-API-KEY": " "] let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/prompts/pr_30gco7dx6JDq4200GVOHa/environments")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. # Update Monitoring POST https://api.humanloop.com/v5/prompts/{id}/evaluators Content-Type: application/json Activate and deactivate Evaluators for monitoring the Prompt. An activated Evaluator will automatically be run on all new Logs within the Prompt for monitoring purposes. Reference: https://humanloop.com/docs/api/prompts/update-monitoring ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /prompts/{id}/evaluators: post: operationId: update-monitoring summary: Update Monitoring description: |- Activate and deactivate Evaluators for monitoring the Prompt. An activated Evaluator will automatically be run on all new Logs within the Prompt for monitoring purposes. tags: - subpackage_prompts parameters: - name: id in: path required: true schema: type: string - name: X-API-KEY in: header required: true schema: type: string responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/type_:PromptResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/type_:HttpValidationError' requestBody: content: application/json: schema: $ref: >- #/components/schemas/type_:EvaluatorActivationDeactivationRequest servers: - url: https://api.humanloop.com/v5 components: schemas: type_:MonitoringEvaluatorVersionRequest: type: object properties: evaluator_version_id: type: string description: >- Unique identifier for the Evaluator Version to be used for monitoring. required: - evaluator_version_id title: MonitoringEvaluatorVersionRequest type_:MonitoringEvaluatorEnvironmentRequest: type: object properties: evaluator_id: type: string description: Unique identifier for the Evaluator to be used for monitoring. environment_id: type: string description: >- Unique identifier for the Environment. The Evaluator Version deployed to this Environment will be used for monitoring. required: - evaluator_id - environment_id title: MonitoringEvaluatorEnvironmentRequest type_:EvaluatorActivationDeactivationRequestActivateItem: oneOf: - $ref: '#/components/schemas/type_:MonitoringEvaluatorVersionRequest' - $ref: '#/components/schemas/type_:MonitoringEvaluatorEnvironmentRequest' title: EvaluatorActivationDeactivationRequestActivateItem type_:EvaluatorActivationDeactivationRequestDeactivateItem: oneOf: - $ref: '#/components/schemas/type_:MonitoringEvaluatorVersionRequest' - $ref: '#/components/schemas/type_:MonitoringEvaluatorEnvironmentRequest' title: EvaluatorActivationDeactivationRequestDeactivateItem type_:EvaluatorActivationDeactivationRequest: type: object properties: activate: type: array items: $ref: >- #/components/schemas/type_:EvaluatorActivationDeactivationRequestActivateItem description: >- Evaluators to activate for Monitoring. These will be automatically run on new Logs. deactivate: type: array items: $ref: >- #/components/schemas/type_:EvaluatorActivationDeactivationRequestDeactivateItem description: Evaluators to deactivate. These will not be run on new Logs. title: EvaluatorActivationDeactivationRequest type_:ModelEndpoints: type: string enum: - complete - chat - edit description: Supported model provider endpoints. title: ModelEndpoints type_:TextChatContent: type: object properties: type: type: string enum: - text text: type: string description: The message's text content. required: - type - text title: TextChatContent type_:ImageUrlDetail: type: string enum: - high - low - auto description: >- Specify the detail level of the image provided to the model. For more details see: https://platform.openai.com/docs/guides/vision/low-or-high-fidelity-image-understanding title: ImageUrlDetail type_:ImageUrl: type: object properties: url: type: string description: Either a URL of the image or the base64 encoded image data. detail: $ref: '#/components/schemas/type_:ImageUrlDetail' description: >- Specify the detail level of the image provided to the model. For more details see: https://platform.openai.com/docs/guides/vision/low-or-high-fidelity-image-understanding required: - url title: ImageUrl type_:ImageChatContent: type: object properties: type: type: string enum: - image_url image_url: $ref: '#/components/schemas/type_:ImageUrl' description: The message's image content. required: - type - image_url title: ImageChatContent type_:ChatMessageContentItem: oneOf: - $ref: '#/components/schemas/type_:TextChatContent' - $ref: '#/components/schemas/type_:ImageChatContent' title: ChatMessageContentItem type_:ChatMessageContent: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessageContentItem' description: The content of the message. title: ChatMessageContent type_:ChatRole: type: string enum: - user - assistant - system - tool - developer description: An enumeration. title: ChatRole type_:ChatToolType: type: string enum: - function description: The type of tool to call. title: ChatToolType type_:FunctionTool: type: object properties: name: type: string arguments: type: string required: - name description: A function tool to be called by the model where user owns runtime. title: FunctionTool type_:ToolCall: type: object properties: id: type: string type: $ref: '#/components/schemas/type_:ChatToolType' function: $ref: '#/components/schemas/type_:FunctionTool' required: - id - type - function description: A tool call to be made. title: ToolCall type_:AnthropicThinkingContent: type: object properties: type: type: string enum: - thinking thinking: type: string description: Model's chain-of-thought for providing the response. signature: type: string description: >- Cryptographic signature that verifies the thinking block was generated by Anthropic. required: - type - thinking - signature title: AnthropicThinkingContent type_:AnthropicRedactedThinkingContent: type: object properties: type: type: string enum: - redacted_thinking data: type: string description: >- Thinking block Anthropic redacted for safety reasons. User is expected to pass the block back to Anthropic required: - type - data title: AnthropicRedactedThinkingContent type_:ChatMessageThinkingItem: oneOf: - $ref: '#/components/schemas/type_:AnthropicThinkingContent' - $ref: '#/components/schemas/type_:AnthropicRedactedThinkingContent' title: ChatMessageThinkingItem type_:ChatMessage: type: object properties: content: $ref: '#/components/schemas/type_:ChatMessageContent' description: The content of the message. name: type: string description: Optional name of the message author. tool_call_id: type: string description: Tool call that this message is responding to. role: $ref: '#/components/schemas/type_:ChatRole' description: Role of the message author. tool_calls: type: array items: $ref: '#/components/schemas/type_:ToolCall' description: A list of tool calls requested by the assistant. thinking: type: array items: $ref: '#/components/schemas/type_:ChatMessageThinkingItem' description: >- Model's chain-of-thought for providing the response. Present on assistant messages if model supports it. required: - role title: ChatMessage type_:PromptResponseTemplate: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: >- 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}}`. title: PromptResponseTemplate type_:TemplateLanguage: type: string enum: - default - jinja description: Template engine to use for rendering templates. title: TemplateLanguage type_:ModelProviders: type: string enum: - anthropic - bedrock - cohere - deepseek - google - groq - mock - openai - openai_azure - replicate description: Supported model providers. title: ModelProviders type_:PromptResponseStop: oneOf: - type: string - type: array items: type: string description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. title: PromptResponseStop type_:ResponseFormatType: type: string enum: - json_object - json_schema title: ResponseFormatType type_:ResponseFormat: type: object properties: type: $ref: '#/components/schemas/type_:ResponseFormatType' json_schema: type: object additionalProperties: description: Any type description: The JSON schema of the response format if type is json_schema. required: - type description: Response format of the model. title: ResponseFormat type_:OpenAiReasoningEffort: type: string enum: - high - medium - low description: Supported reasoning effort. title: OpenAiReasoningEffort type_:PromptResponseReasoningEffort: oneOf: - $ref: '#/components/schemas/type_:OpenAiReasoningEffort' - type: integer description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. title: PromptResponseReasoningEffort type_:ToolFunction: type: object properties: name: type: string description: Name for the tool referenced by the model. description: type: string description: Description of the tool referenced by the model strict: type: boolean default: false description: >- If true, forces the model to output json data in the structure of the parameters schema. parameters: type: object additionalProperties: description: Any type description: >- Parameters needed to run the Tool, defined in JSON Schema format: https://json-schema.org/ required: - name - description title: ToolFunction type_:LinkedToolResponse: type: object properties: name: type: string description: Name for the tool referenced by the model. description: type: string description: Description of the tool referenced by the model strict: type: boolean default: false description: >- If true, forces the model to output json data in the structure of the parameters schema. parameters: type: object additionalProperties: description: Any type description: >- Parameters needed to run the Tool, defined in JSON Schema format: https://json-schema.org/ id: type: string description: Unique identifier for the Tool linked. version_id: type: string description: Unique identifier for the Tool Version linked. required: - name - description - id - version_id title: LinkedToolResponse type_:EnvironmentTag: type: string enum: - default - other description: An enumeration. title: EnvironmentTag type_:EnvironmentResponse: type: object properties: id: type: string created_at: type: string format: date-time name: type: string tag: $ref: '#/components/schemas/type_:EnvironmentTag' required: - id - created_at - name - tag title: EnvironmentResponse type_:UserResponse: description: Any type title: UserResponse type_:InputResponse: type: object properties: name: type: string description: Type of input. required: - name title: InputResponse type_:FilesToolType: type: string enum: - pinecone_search - google - mock - snippet - json_schema - get_api_call - python description: Type of tool. title: FilesToolType type_:EvaluatorAggregate: type: object properties: value: type: number format: double description: The aggregated value of the evaluator. evaluator_id: type: string description: ID of the evaluator. evaluator_version_id: type: string description: ID of the evaluator version. created_at: type: string format: date-time updated_at: type: string format: date-time required: - value - evaluator_id - evaluator_version_id - created_at - updated_at title: EvaluatorAggregate type_:ToolResponse: type: object properties: path: type: string description: >- Path of the Tool, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Tool. directory_id: type: string description: ID of the directory that the file is in on Humanloop. function: $ref: '#/components/schemas/type_:ToolFunction' description: >- Callable function specification of the Tool shown to the model for tool calling. source_code: type: string description: Code source of the Tool. setup_values: type: object additionalProperties: description: Any type description: >- Values needed to setup the Tool, defined in JSON Schema format: https://json-schema.org/ attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Tool. Helpful to separate Tool versions from each other with details on how they were created or used. tool_type: $ref: '#/components/schemas/type_:FilesToolType' description: Type of Tool. version_name: type: string description: >- Unique identifier for this Tool version. Each Tool can only have one version with a given name. version_description: type: string description: Description of the Version. name: type: string description: Name of the Tool, which is used as a unique identifier. description: type: string description: Description of the Tool. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Tool Version. If no query params provided, the default deployed Tool Version is returned. type: type: string enum: - tool environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Tool Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Tool. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Tool Version total_logs_count: type: integer description: The number of logs that have been generated across all Tool Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Prompt. Inputs correspond to any of the variables used within the Tool template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Tool that are used for monitoring logs. signature: type: string description: Signature of the Tool. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Tool Version. required: - path - id - name - version_id - created_at - updated_at - last_used_at - version_logs_count - total_logs_count - inputs description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: ToolResponse type_:DatapointResponseTargetValue: oneOf: - type: string - type: integer - type: number format: double - type: boolean - type: array items: description: Any type - type: object additionalProperties: description: Any type title: DatapointResponseTargetValue type_:DatapointResponse: type: object properties: inputs: type: object additionalProperties: type: string description: The inputs to the prompt template. messages: type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: List of chat messages to provide to the model. target: type: object additionalProperties: $ref: '#/components/schemas/type_:DatapointResponseTargetValue' description: >- Object with criteria necessary to evaluate generations with this Datapoint. This is passed in as an argument to Evaluators when used in an Evaluation. id: type: string description: Unique identifier for the Datapoint. Starts with `dp_`. required: - id title: DatapointResponse type_:DatasetResponse: type: object properties: path: type: string description: >- Path of the Dataset, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Dataset. Starts with `ds_`. directory_id: type: string description: ID of the directory that the file is in on Humanloop. name: type: string description: Name of the Dataset, which is used as a unique identifier. description: type: string description: Description of the Dataset. schema: type: object additionalProperties: description: Any type description: The JSON schema for the File. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Dataset Version. If no query params provided, the default deployed Dataset Version is returned. Starts with `dsv_`. type: type: string enum: - dataset environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Dataset Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Dataset. last_used_at: type: string format: date-time version_name: type: string description: >- Unique name for the Dataset version. Version names must be unique for a given Dataset. version_description: type: string description: Description of the version, e.g., the changes made in this version. datapoints_count: type: integer description: The number of Datapoints in this Dataset version. datapoints: type: array items: $ref: '#/components/schemas/type_:DatapointResponse' description: >- The list of Datapoints in this Dataset version. Only provided if explicitly requested. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Dataset. Helpful to separate Dataset versions from each other with details on how they were created or used. required: - path - id - name - version_id - created_at - updated_at - last_used_at - datapoints_count description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: DatasetResponse type_:EvaluatorArgumentsType: type: string enum: - target_free - target_required description: Enum representing the possible argument types of an evaluator. title: EvaluatorArgumentsType type_:EvaluatorReturnTypeEnum: type: string enum: - boolean - number - select - multi_select - text description: Enum representing the possible return types of an evaluator. title: EvaluatorReturnTypeEnum type_:Valence: type: string enum: - positive - negative - neutral description: An enumeration. title: Valence type_:EvaluatorJudgmentOptionResponse: type: object properties: name: type: string description: The name of the option. valence: $ref: '#/components/schemas/type_:Valence' description: Whether this option should be considered positive or negative. required: - name title: EvaluatorJudgmentOptionResponse type_:EvaluatorJudgmentNumberLimit: type: object properties: min: type: number format: double description: The minimum value that can be selected. max: type: number format: double description: The maximum value that can be selected. step: type: number format: double description: The step size for the number input. title: EvaluatorJudgmentNumberLimit type_:PromptKernelRequestTemplate: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: >- 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}}`. title: PromptKernelRequestTemplate type_:PromptKernelRequestStop: oneOf: - type: string - type: array items: type: string description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. title: PromptKernelRequestStop type_:PromptKernelRequestReasoningEffort: oneOf: - $ref: '#/components/schemas/type_:OpenAiReasoningEffort' - type: integer description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. title: PromptKernelRequestReasoningEffort type_:PromptKernelRequest: type: object properties: model: type: string description: >- The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models) endpoint: $ref: '#/components/schemas/type_:ModelEndpoints' description: The provider model endpoint used. template: $ref: '#/components/schemas/type_:PromptKernelRequestTemplate' description: >- 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}}`. template_language: $ref: '#/components/schemas/type_:TemplateLanguage' description: The template language to use for rendering the template. provider: $ref: '#/components/schemas/type_:ModelProviders' description: The company providing the underlying model service. max_tokens: type: integer default: -1 description: >- 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 temperature: type: number format: double default: 1 description: >- What sampling temperature to use when making a generation. Higher values means the model will be more creative. top_p: type: number format: double default: 1 description: >- An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. stop: $ref: '#/components/schemas/type_:PromptKernelRequestStop' description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. presence_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far. frequency_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far. other: type: object additionalProperties: description: Any type description: Other parameter values to be passed to the provider call. seed: type: integer description: >- If specified, model will make a best effort to sample deterministically, but it is not guaranteed. response_format: $ref: '#/components/schemas/type_:ResponseFormat' description: >- The format of the response. Only `{"type": "json_object"}` is currently supported for chat. reasoning_effort: $ref: '#/components/schemas/type_:PromptKernelRequestReasoningEffort' description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. tools: type: array items: $ref: '#/components/schemas/type_:ToolFunction' description: >- The tool specification that the model can choose to call if Tool calling is supported. linked_tools: type: array items: type: string description: >- 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. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used. required: - model description: |- Base class used by both PromptKernelRequest and AgentKernelRequest. Contains the consistent Prompt-related fields. title: PromptKernelRequest type_:LlmEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:EvaluatorReturnTypeEnum' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: >- The options that can be applied as judgments. Only for Evaluators with `return_type` of 'boolean', 'select' or 'multi_select'. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - llm prompt: $ref: '#/components/schemas/type_:PromptKernelRequest' description: The prompt parameters used to generate. required: - arguments_type - return_type - evaluator_type title: LlmEvaluatorRequest type_:CodeEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:EvaluatorReturnTypeEnum' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: >- The options that can be applied as judgments. Only for Evaluators with `return_type` of 'boolean', 'select' or 'multi_select'. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - python code: type: string description: >- The code for the Evaluator. This code will be executed in a sandboxed environment. required: - arguments_type - return_type - evaluator_type - code title: CodeEvaluatorRequest type_:HumanEvaluatorRequestReturnType: type: string enum: - select - multi_select - text - number - boolean description: The type of the return value of the Evaluator. title: HumanEvaluatorRequestReturnType type_:HumanEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:HumanEvaluatorRequestReturnType' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: The options that can be applied as judgments. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - human instructions: type: string description: Instructions and guidelines for applying judgments. required: - arguments_type - return_type - evaluator_type title: HumanEvaluatorRequest type_:ExternalEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:EvaluatorReturnTypeEnum' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: >- The options that can be applied as judgments. Only for Evaluators with `return_type` of 'boolean', 'select' or 'multi_select'. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - external required: - arguments_type - return_type - evaluator_type title: ExternalEvaluatorRequest type_:EvaluatorResponseSpec: oneOf: - $ref: '#/components/schemas/type_:LlmEvaluatorRequest' - $ref: '#/components/schemas/type_:CodeEvaluatorRequest' - $ref: '#/components/schemas/type_:HumanEvaluatorRequest' - $ref: '#/components/schemas/type_:ExternalEvaluatorRequest' title: EvaluatorResponseSpec type_:EvaluatorResponse: type: object properties: path: type: string description: >- Path of the Evaluator including the Evaluator name, which is used as a unique identifier. id: type: string description: Unique identifier for the Evaluator. directory_id: type: string description: ID of the directory that the file is in on Humanloop. version_name: type: string description: >- Unique name for the Evaluator version. Version names must be unique for a given Evaluator. version_description: type: string description: Description of the version, e.g., the changes made in this version. spec: $ref: '#/components/schemas/type_:EvaluatorResponseSpec' name: type: string description: Name of the Evaluator, which is used as a unique identifier. description: type: string description: Description of the Evaluator. schema: type: object additionalProperties: description: Any type description: The JSON schema for the File. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Evaluator Version. If no query params provided, the default deployed Evaluator Version is returned. type: type: string enum: - evaluator environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Evaluator Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Evaluator. last_used_at: type: string format: date-time version_logs_count: type: integer description: >- The number of logs that have been generated for this Evaluator Version total_logs_count: type: integer description: >- The number of logs that have been generated across all Evaluator Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Evaluator. Inputs correspond to any of the variables used within the Evaluator template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Evaluator that are used for monitoring logs. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Evaluator Version. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. required: - path - id - spec - name - version_id - created_at - updated_at - last_used_at - version_logs_count - total_logs_count - inputs description: Version of the Evaluator used to provide judgments. title: EvaluatorResponse type_:FlowResponse: type: object properties: path: type: string description: >- Path of the Flow, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Flow. directory_id: type: string description: ID of the directory that the file is in on Humanloop. attributes: type: object additionalProperties: description: Any type description: A key-value object identifying the Flow Version. version_name: type: string description: >- Unique name for the Flow version. Version names must be unique for a given Flow. version_description: type: string description: Description of the Version. name: type: string description: Name of the Flow. description: type: string description: Description of the Flow. schema: type: object additionalProperties: description: Any type description: The JSON schema for the File. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Flow Version. If no query params provided, the default deployed Flow Version is returned. type: type: string enum: - flow environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Flow Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Flow. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Flow Version evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Flow Version. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: The list of Monitoring Evaluators associated with the Flow Version. required: - path - id - attributes - name - version_id - created_at - updated_at - last_used_at - version_logs_count description: Response model for a Flow. title: FlowResponse type_:AgentResponseTemplate: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: >- 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}}`. title: AgentResponseTemplate type_:AgentResponseStop: oneOf: - type: string - type: array items: type: string description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. title: AgentResponseStop type_:AgentResponseReasoningEffort: oneOf: - $ref: '#/components/schemas/type_:OpenAiReasoningEffort' - type: integer description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. title: AgentResponseReasoningEffort type_:LinkedFileRequest: type: object properties: file_id: type: string environment_id: type: string version_id: type: string required: - file_id title: LinkedFileRequest type_:OnAgentCallEnum: type: string enum: - stop - continue description: What an Agent should do when calling a Tool. title: OnAgentCallEnum type_:AgentLinkedFileResponseFile: oneOf: - $ref: '#/components/schemas/type_:PromptResponse' - $ref: '#/components/schemas/type_:ToolResponse' - $ref: '#/components/schemas/type_:DatasetResponse' - $ref: '#/components/schemas/type_:EvaluatorResponse' - $ref: '#/components/schemas/type_:FlowResponse' - $ref: '#/components/schemas/type_:AgentResponse' title: AgentLinkedFileResponseFile type_:AgentLinkedFileResponse: type: object properties: type: type: string enum: - file link: $ref: '#/components/schemas/type_:LinkedFileRequest' on_agent_call: $ref: '#/components/schemas/type_:OnAgentCallEnum' file: $ref: '#/components/schemas/type_:AgentLinkedFileResponseFile' required: - type - link title: AgentLinkedFileResponse type_:AgentInlineTool: type: object properties: type: type: string enum: - inline json_schema: $ref: '#/components/schemas/type_:ToolFunction' on_agent_call: $ref: '#/components/schemas/type_:OnAgentCallEnum' required: - type - json_schema title: AgentInlineTool type_:AgentResponseToolsItem: oneOf: - $ref: '#/components/schemas/type_:AgentLinkedFileResponse' - $ref: '#/components/schemas/type_:AgentInlineTool' title: AgentResponseToolsItem type_:VersionStatus: type: string enum: - uncommitted - committed - deleted description: An enumeration. title: VersionStatus type_:AgentResponse: type: object properties: path: type: string description: >- Path of the Agent, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Agent. directory_id: type: string description: ID of the directory that the file is in on Humanloop. model: type: string description: >- The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models) endpoint: $ref: '#/components/schemas/type_:ModelEndpoints' description: The provider model endpoint used. template: $ref: '#/components/schemas/type_:AgentResponseTemplate' description: >- 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}}`. template_language: $ref: '#/components/schemas/type_:TemplateLanguage' description: The template language to use for rendering the template. provider: $ref: '#/components/schemas/type_:ModelProviders' description: The company providing the underlying model service. max_tokens: type: integer default: -1 description: >- 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 temperature: type: number format: double default: 1 description: >- What sampling temperature to use when making a generation. Higher values means the model will be more creative. top_p: type: number format: double default: 1 description: >- An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. stop: $ref: '#/components/schemas/type_:AgentResponseStop' description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. presence_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far. frequency_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far. other: type: object additionalProperties: description: Any type description: Other parameter values to be passed to the provider call. seed: type: integer description: >- If specified, model will make a best effort to sample deterministically, but it is not guaranteed. response_format: $ref: '#/components/schemas/type_:ResponseFormat' description: >- The format of the response. Only `{"type": "json_object"}` is currently supported for chat. reasoning_effort: $ref: '#/components/schemas/type_:AgentResponseReasoningEffort' description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. tools: type: array items: $ref: '#/components/schemas/type_:AgentResponseToolsItem' description: >- List of tools that the Agent can call. These can be linked files or inline tools. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used. max_iterations: type: integer description: >- The maximum number of iterations the Agent can run. This is used to limit the number of times the Agent model is called. version_name: type: string description: >- Unique name for the Agent version. Version names must be unique for a given Agent. version_description: type: string description: Description of the version, e.g., the changes made in this version. description: type: string description: Description of the Agent. tags: type: array items: type: string description: List of tags associated with the file. readme: type: string description: Long description of the file. name: type: string description: Name of the Agent. schema: type: object additionalProperties: description: Any type description: The JSON schema for the Prompt. version_id: type: string description: >- Unique identifier for the specific Agent Version. If no query params provided, the default deployed Agent Version is returned. type: type: string enum: - agent environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Agent Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Agent. committed_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who committed the Agent Version. committed_at: type: string format: date-time description: The date and time the Agent Version was committed. status: $ref: '#/components/schemas/type_:VersionStatus' description: The status of the Agent Version. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Agent Version total_logs_count: type: integer description: >- The number of logs that have been generated across all Agent Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Agent. Inputs correspond to any of the variables used within the Agent template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Agent that are used for monitoring logs. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Agent Version. raw_file_content: type: string description: The raw content of the Agent. Corresponds to the .agent file. required: - path - id - model - tools - name - version_id - created_at - updated_at - status - last_used_at - version_logs_count - total_logs_count - inputs description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: AgentResponse type_:VersionDeploymentResponseFile: oneOf: - $ref: '#/components/schemas/type_:PromptResponse' - $ref: '#/components/schemas/type_:ToolResponse' - $ref: '#/components/schemas/type_:DatasetResponse' - $ref: '#/components/schemas/type_:EvaluatorResponse' - $ref: '#/components/schemas/type_:FlowResponse' - $ref: '#/components/schemas/type_:AgentResponse' description: The File that the deployed Version belongs to. title: VersionDeploymentResponseFile type_:VersionDeploymentResponse: type: object properties: file: $ref: '#/components/schemas/type_:VersionDeploymentResponseFile' description: The File that the deployed Version belongs to. environment: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The Environment that the Version is deployed to. type: type: string enum: - environment required: - file - environment - type description: A variable reference to the Version deployed to an Environment title: VersionDeploymentResponse type_:VersionIdResponseVersion: oneOf: - $ref: '#/components/schemas/type_:PromptResponse' - $ref: '#/components/schemas/type_:ToolResponse' - $ref: '#/components/schemas/type_:DatasetResponse' - $ref: '#/components/schemas/type_:EvaluatorResponse' - $ref: '#/components/schemas/type_:FlowResponse' - $ref: '#/components/schemas/type_:AgentResponse' description: The specific Version being referenced. title: VersionIdResponseVersion type_:VersionIdResponse: type: object properties: version: $ref: '#/components/schemas/type_:VersionIdResponseVersion' description: The specific Version being referenced. type: type: string enum: - version required: - version - type description: A reference to a specific Version by its ID title: VersionIdResponse type_:VersionReferenceResponse: oneOf: - $ref: '#/components/schemas/type_:VersionDeploymentResponse' - $ref: '#/components/schemas/type_:VersionIdResponse' title: VersionReferenceResponse type_:MonitoringEvaluatorState: type: string enum: - active - inactive description: State of an evaluator connected to a file title: MonitoringEvaluatorState type_:MonitoringEvaluatorResponse: type: object properties: version_reference: $ref: '#/components/schemas/type_:VersionReferenceResponse' description: >- The Evaluator Version used for monitoring. This can be a specific Version by ID, or a Version deployed to an Environment. version: $ref: '#/components/schemas/type_:EvaluatorResponse' description: The deployed Version. state: $ref: '#/components/schemas/type_:MonitoringEvaluatorState' description: The state of the Monitoring Evaluator. Either `active` or `inactive` created_at: type: string format: date-time updated_at: type: string format: date-time required: - version_reference - state - created_at - updated_at title: MonitoringEvaluatorResponse type_:PromptResponse: type: object properties: path: type: string description: >- Path of the Prompt, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Prompt. directory_id: type: string description: ID of the directory that the file is in on Humanloop. model: type: string description: >- The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models) endpoint: $ref: '#/components/schemas/type_:ModelEndpoints' description: The provider model endpoint used. template: $ref: '#/components/schemas/type_:PromptResponseTemplate' description: >- 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}}`. template_language: $ref: '#/components/schemas/type_:TemplateLanguage' description: The template language to use for rendering the template. provider: $ref: '#/components/schemas/type_:ModelProviders' description: The company providing the underlying model service. max_tokens: type: integer default: -1 description: >- 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 temperature: type: number format: double default: 1 description: >- What sampling temperature to use when making a generation. Higher values means the model will be more creative. top_p: type: number format: double default: 1 description: >- An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. stop: $ref: '#/components/schemas/type_:PromptResponseStop' description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. presence_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far. frequency_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far. other: type: object additionalProperties: description: Any type description: Other parameter values to be passed to the provider call. seed: type: integer description: >- If specified, model will make a best effort to sample deterministically, but it is not guaranteed. response_format: $ref: '#/components/schemas/type_:ResponseFormat' description: >- The format of the response. Only `{"type": "json_object"}` is currently supported for chat. reasoning_effort: $ref: '#/components/schemas/type_:PromptResponseReasoningEffort' description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. tools: type: array items: $ref: '#/components/schemas/type_:ToolFunction' description: >- The tool specification that the model can choose to call if Tool calling is supported. linked_tools: type: array items: $ref: '#/components/schemas/type_:LinkedToolResponse' description: The tools linked to your prompt that the model can call. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used. version_name: type: string description: >- Unique name for the Prompt version. Version names must be unique for a given Prompt. version_description: type: string description: Description of the version, e.g., the changes made in this version. description: type: string description: Description of the Prompt. tags: type: array items: type: string description: List of tags associated with the file. readme: type: string description: Long description of the file. name: type: string description: Name of the Prompt. schema: type: object additionalProperties: description: Any type description: The JSON schema for the Prompt. version_id: type: string description: >- Unique identifier for the specific Prompt Version. If no query params provided, the default deployed Prompt Version is returned. type: type: string enum: - prompt environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Prompt Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Prompt. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Prompt Version total_logs_count: type: integer description: >- The number of logs that have been generated across all Prompt Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Prompt. Inputs correspond to any of the variables used within the Prompt template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Prompt that are used for monitoring logs. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Prompt Version. raw_file_content: type: string description: The raw content of the Prompt. Corresponds to the .prompt file. required: - path - id - model - name - version_id - created_at - updated_at - last_used_at - version_logs_count - total_logs_count - inputs description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: PromptResponse type_:ValidationErrorLocItem: oneOf: - type: string - type: integer title: ValidationErrorLocItem type_:ValidationError: type: object properties: loc: type: array items: $ref: '#/components/schemas/type_:ValidationErrorLocItem' msg: type: string type: type: string required: - loc - msg - type title: ValidationError type_:HttpValidationError: type: object properties: detail: type: array items: $ref: '#/components/schemas/type_:ValidationError' title: HttpValidationError securitySchemes: default: type: apiKey in: header name: X-API-KEY ``` ## SDK Code Examples ```python Add evaluator import requests url = "https://api.humanloop.com/v5/prompts/pr_30gco7dx6JDq4200GVOHa/evaluators" payload = { "activate": [{ "evaluator_version_id": "evv_1abc4308abd" }] } headers = { "X-API-KEY": " ", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```typescript Add evaluator import { HumanloopClient } from "humanloop"; const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); await client.prompts.updateMonitoring("pr_30gco7dx6JDq4200GVOHa", { activate: [{ evaluatorVersionId: "evv_1abc4308abd" }] }); ``` ```go Add evaluator package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/prompts/pr_30gco7dx6JDq4200GVOHa/evaluators" payload := strings.NewReader("{\n \"activate\": [\n {\n \"evaluator_version_id\": \"evv_1abc4308abd\"\n }\n ]\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("X-API-KEY", " ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Add evaluator require 'uri' require 'net/http' url = URI("https://api.humanloop.com/v5/prompts/pr_30gco7dx6JDq4200GVOHa/evaluators") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["X-API-KEY"] = ' ' request["Content-Type"] = 'application/json' request.body = "{\n \"activate\": [\n {\n \"evaluator_version_id\": \"evv_1abc4308abd\"\n }\n ]\n}" response = http.request(request) puts response.read_body ``` ```java Add evaluator import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.humanloop.com/v5/prompts/pr_30gco7dx6JDq4200GVOHa/evaluators") .header("X-API-KEY", " ") .header("Content-Type", "application/json") .body("{\n \"activate\": [\n {\n \"evaluator_version_id\": \"evv_1abc4308abd\"\n }\n ]\n}") .asString(); ``` ```php Add evaluator request('POST', 'https://api.humanloop.com/v5/prompts/pr_30gco7dx6JDq4200GVOHa/evaluators', [ 'body' => '{ "activate": [ { "evaluator_version_id": "evv_1abc4308abd" } ] }', 'headers' => [ 'Content-Type' => 'application/json', 'X-API-KEY' => ' ', ], ]); echo $response->getBody(); ``` ```csharp Add evaluator using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/prompts/pr_30gco7dx6JDq4200GVOHa/evaluators"); var request = new RestRequest(Method.POST); request.AddHeader("X-API-KEY", " "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"activate\": [\n {\n \"evaluator_version_id\": \"evv_1abc4308abd\"\n }\n ]\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Add evaluator import Foundation let headers = [ "X-API-KEY": " ", "Content-Type": "application/json" ] let parameters = ["activate": [["evaluator_version_id": "evv_1abc4308abd"]]] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/prompts/pr_30gco7dx6JDq4200GVOHa/evaluators")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. # Serialize GET https://api.humanloop.com/v5/prompts/{id}/serialize Serialize a Prompt to the .prompt file format. Useful for storing the Prompt with your code in a version control system, or for editing with an AI tool. By default, the deployed version of the Prompt is returned. Use the query parameters `version_id` or `environment` to target a specific version of the Prompt. Reference: https://humanloop.com/docs/api/prompts/serialize ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /prompts/{id}/serialize: get: operationId: serialize summary: Serialize description: >- Serialize a Prompt to the .prompt file format. Useful for storing the Prompt with your code in a version control system, or for editing with an AI tool. By default, the deployed version of the Prompt is returned. Use the query parameters `version_id` or `environment` to target a specific version of the Prompt. tags: - subpackage_prompts parameters: - name: id in: path description: Unique identifier for Prompt. required: true schema: type: string - name: version_id in: query description: A specific Version ID of the Prompt to retrieve. required: false schema: type: string - name: environment in: query description: Name of the Environment to retrieve a deployed Version from. required: false schema: type: string - name: X-API-KEY in: header required: true schema: type: string responses: '200': description: Response with status 200 content: application/json: schema: type: object properties: {} '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/type_:HttpValidationError' servers: - url: https://api.humanloop.com/v5 components: schemas: type_:ValidationErrorLocItem: oneOf: - type: string - type: integer title: ValidationErrorLocItem type_:ValidationError: type: object properties: loc: type: array items: $ref: '#/components/schemas/type_:ValidationErrorLocItem' msg: type: string type: type: string required: - loc - msg - type title: ValidationError type_:HttpValidationError: type: object properties: detail: type: array items: $ref: '#/components/schemas/type_:ValidationError' title: HttpValidationError securitySchemes: default: type: apiKey in: header name: X-API-KEY ``` ## SDK Code Examples ```python import requests url = "https://api.humanloop.com/v5/prompts/id/serialize" headers = {"X-API-KEY": " "} response = requests.get(url, headers=headers) print(response.json()) ``` ```typescript import { HumanloopClient } from "humanloop"; const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); await client.prompts.serialize("id"); ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/prompts/id/serialize" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("X-API-KEY", " ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://api.humanloop.com/v5/prompts/id/serialize") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["X-API-KEY"] = ' ' response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api.humanloop.com/v5/prompts/id/serialize") .header("X-API-KEY", " ") .asString(); ``` ```php request('GET', 'https://api.humanloop.com/v5/prompts/id/serialize', [ 'headers' => [ 'X-API-KEY' => ' ', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/prompts/id/serialize"); var request = new RestRequest(Method.GET); request.AddHeader("X-API-KEY", " "); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = ["X-API-KEY": " "] let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/prompts/id/serialize")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. # Deserialize POST https://api.humanloop.com/v5/prompts/deserialize Content-Type: application/json Deserialize a Prompt from the .prompt file format. This returns a subset of the attributes required by a Prompt. This subset is the bit that defines the Prompt version (e.g. with `model` and `temperature` etc) Reference: https://humanloop.com/docs/api/prompts/deserialize ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /prompts/deserialize: post: operationId: deserialize summary: Deserialize description: >- Deserialize a Prompt from the .prompt file format. This returns a subset of the attributes required by a Prompt. This subset is the bit that defines the Prompt version (e.g. with `model` and `temperature` etc) tags: - subpackage_prompts parameters: - name: X-API-KEY in: header required: true schema: type: string responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/type_:PromptKernelRequest' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/type_:HttpValidationError' requestBody: content: application/json: schema: type: object properties: prompt: type: string required: - prompt servers: - url: https://api.humanloop.com/v5 components: schemas: type_:ModelEndpoints: type: string enum: - complete - chat - edit description: Supported model provider endpoints. title: ModelEndpoints type_:TextChatContent: type: object properties: type: type: string enum: - text text: type: string description: The message's text content. required: - type - text title: TextChatContent type_:ImageUrlDetail: type: string enum: - high - low - auto description: >- Specify the detail level of the image provided to the model. For more details see: https://platform.openai.com/docs/guides/vision/low-or-high-fidelity-image-understanding title: ImageUrlDetail type_:ImageUrl: type: object properties: url: type: string description: Either a URL of the image or the base64 encoded image data. detail: $ref: '#/components/schemas/type_:ImageUrlDetail' description: >- Specify the detail level of the image provided to the model. For more details see: https://platform.openai.com/docs/guides/vision/low-or-high-fidelity-image-understanding required: - url title: ImageUrl type_:ImageChatContent: type: object properties: type: type: string enum: - image_url image_url: $ref: '#/components/schemas/type_:ImageUrl' description: The message's image content. required: - type - image_url title: ImageChatContent type_:ChatMessageContentItem: oneOf: - $ref: '#/components/schemas/type_:TextChatContent' - $ref: '#/components/schemas/type_:ImageChatContent' title: ChatMessageContentItem type_:ChatMessageContent: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessageContentItem' description: The content of the message. title: ChatMessageContent type_:ChatRole: type: string enum: - user - assistant - system - tool - developer description: An enumeration. title: ChatRole type_:ChatToolType: type: string enum: - function description: The type of tool to call. title: ChatToolType type_:FunctionTool: type: object properties: name: type: string arguments: type: string required: - name description: A function tool to be called by the model where user owns runtime. title: FunctionTool type_:ToolCall: type: object properties: id: type: string type: $ref: '#/components/schemas/type_:ChatToolType' function: $ref: '#/components/schemas/type_:FunctionTool' required: - id - type - function description: A tool call to be made. title: ToolCall type_:AnthropicThinkingContent: type: object properties: type: type: string enum: - thinking thinking: type: string description: Model's chain-of-thought for providing the response. signature: type: string description: >- Cryptographic signature that verifies the thinking block was generated by Anthropic. required: - type - thinking - signature title: AnthropicThinkingContent type_:AnthropicRedactedThinkingContent: type: object properties: type: type: string enum: - redacted_thinking data: type: string description: >- Thinking block Anthropic redacted for safety reasons. User is expected to pass the block back to Anthropic required: - type - data title: AnthropicRedactedThinkingContent type_:ChatMessageThinkingItem: oneOf: - $ref: '#/components/schemas/type_:AnthropicThinkingContent' - $ref: '#/components/schemas/type_:AnthropicRedactedThinkingContent' title: ChatMessageThinkingItem type_:ChatMessage: type: object properties: content: $ref: '#/components/schemas/type_:ChatMessageContent' description: The content of the message. name: type: string description: Optional name of the message author. tool_call_id: type: string description: Tool call that this message is responding to. role: $ref: '#/components/schemas/type_:ChatRole' description: Role of the message author. tool_calls: type: array items: $ref: '#/components/schemas/type_:ToolCall' description: A list of tool calls requested by the assistant. thinking: type: array items: $ref: '#/components/schemas/type_:ChatMessageThinkingItem' description: >- Model's chain-of-thought for providing the response. Present on assistant messages if model supports it. required: - role title: ChatMessage type_:PromptKernelRequestTemplate: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: >- 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}}`. title: PromptKernelRequestTemplate type_:TemplateLanguage: type: string enum: - default - jinja description: Template engine to use for rendering templates. title: TemplateLanguage type_:ModelProviders: type: string enum: - anthropic - bedrock - cohere - deepseek - google - groq - mock - openai - openai_azure - replicate description: Supported model providers. title: ModelProviders type_:PromptKernelRequestStop: oneOf: - type: string - type: array items: type: string description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. title: PromptKernelRequestStop type_:ResponseFormatType: type: string enum: - json_object - json_schema title: ResponseFormatType type_:ResponseFormat: type: object properties: type: $ref: '#/components/schemas/type_:ResponseFormatType' json_schema: type: object additionalProperties: description: Any type description: The JSON schema of the response format if type is json_schema. required: - type description: Response format of the model. title: ResponseFormat type_:OpenAiReasoningEffort: type: string enum: - high - medium - low description: Supported reasoning effort. title: OpenAiReasoningEffort type_:PromptKernelRequestReasoningEffort: oneOf: - $ref: '#/components/schemas/type_:OpenAiReasoningEffort' - type: integer description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. title: PromptKernelRequestReasoningEffort type_:ToolFunction: type: object properties: name: type: string description: Name for the tool referenced by the model. description: type: string description: Description of the tool referenced by the model strict: type: boolean default: false description: >- If true, forces the model to output json data in the structure of the parameters schema. parameters: type: object additionalProperties: description: Any type description: >- Parameters needed to run the Tool, defined in JSON Schema format: https://json-schema.org/ required: - name - description title: ToolFunction type_:PromptKernelRequest: type: object properties: model: type: string description: >- The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models) endpoint: $ref: '#/components/schemas/type_:ModelEndpoints' description: The provider model endpoint used. template: $ref: '#/components/schemas/type_:PromptKernelRequestTemplate' description: >- 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}}`. template_language: $ref: '#/components/schemas/type_:TemplateLanguage' description: The template language to use for rendering the template. provider: $ref: '#/components/schemas/type_:ModelProviders' description: The company providing the underlying model service. max_tokens: type: integer default: -1 description: >- 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 temperature: type: number format: double default: 1 description: >- What sampling temperature to use when making a generation. Higher values means the model will be more creative. top_p: type: number format: double default: 1 description: >- An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. stop: $ref: '#/components/schemas/type_:PromptKernelRequestStop' description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. presence_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far. frequency_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far. other: type: object additionalProperties: description: Any type description: Other parameter values to be passed to the provider call. seed: type: integer description: >- If specified, model will make a best effort to sample deterministically, but it is not guaranteed. response_format: $ref: '#/components/schemas/type_:ResponseFormat' description: >- The format of the response. Only `{"type": "json_object"}` is currently supported for chat. reasoning_effort: $ref: '#/components/schemas/type_:PromptKernelRequestReasoningEffort' description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. tools: type: array items: $ref: '#/components/schemas/type_:ToolFunction' description: >- The tool specification that the model can choose to call if Tool calling is supported. linked_tools: type: array items: type: string description: >- 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. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used. required: - model description: |- Base class used by both PromptKernelRequest and AgentKernelRequest. Contains the consistent Prompt-related fields. title: PromptKernelRequest type_:ValidationErrorLocItem: oneOf: - type: string - type: integer title: ValidationErrorLocItem type_:ValidationError: type: object properties: loc: type: array items: $ref: '#/components/schemas/type_:ValidationErrorLocItem' msg: type: string type: type: string required: - loc - msg - type title: ValidationError type_:HttpValidationError: type: object properties: detail: type: array items: $ref: '#/components/schemas/type_:ValidationError' title: HttpValidationError securitySchemes: default: type: apiKey in: header name: X-API-KEY ``` ## SDK Code Examples ```python import requests url = "https://api.humanloop.com/v5/prompts/deserialize" payload = { "prompt": "prompt" } headers = { "X-API-KEY": " ", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```typescript import { HumanloopClient } from "humanloop"; const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); await client.prompts.deserialize({ prompt: "prompt" }); ``` ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/prompts/deserialize" payload := strings.NewReader("{\n \"prompt\": \"prompt\"\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("X-API-KEY", " ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://api.humanloop.com/v5/prompts/deserialize") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["X-API-KEY"] = ' ' request["Content-Type"] = 'application/json' request.body = "{\n \"prompt\": \"prompt\"\n}" response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.humanloop.com/v5/prompts/deserialize") .header("X-API-KEY", " ") .header("Content-Type", "application/json") .body("{\n \"prompt\": \"prompt\"\n}") .asString(); ``` ```php request('POST', 'https://api.humanloop.com/v5/prompts/deserialize', [ 'body' => '{ "prompt": "prompt" }', 'headers' => [ 'Content-Type' => 'application/json', 'X-API-KEY' => ' ', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/prompts/deserialize"); var request = new RestRequest(Method.POST); request.AddHeader("X-API-KEY", " "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"prompt\": \"prompt\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "X-API-KEY": " ", "Content-Type": "application/json" ] let parameters = ["prompt": "prompt"] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/prompts/deserialize")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. # Log to an Agent POST https://api.humanloop.com/v5/agents/log Content-Type: application/json Create an Agent Log. You can use query parameters `version_id`, or `environment`, to target an existing version of the Agent. Otherwise, the default deployed version will be chosen. If you create the Agent Log with a `log_status` of `incomplete`, you should later update it to `complete` in order to trigger Evaluators. Reference: https://humanloop.com/docs/api/agents/log ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /agents/log: post: operationId: log summary: Log to an Agent description: >- Create an Agent Log. You can use query parameters `version_id`, or `environment`, to target an existing version of the Agent. Otherwise, the default deployed version will be chosen. If you create the Agent Log with a `log_status` of `incomplete`, you should later update it to `complete` in order to trigger Evaluators. tags: - subpackage_agents parameters: - name: version_id in: query description: A specific Version ID of the Agent to log to. required: false schema: type: string - name: environment in: query description: Name of the Environment identifying a deployed version to log to. required: false schema: type: string - name: X-API-KEY in: header required: true schema: type: string responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/type_:CreateAgentLogResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/type_:HttpValidationError' requestBody: content: application/json: schema: type: object properties: run_id: type: string description: Unique identifier for the Run to associate the Log to. path: type: string description: >- Path of the Agent, including the name. This locates the Agent in the Humanloop filesystem and is used as as a unique identifier. For example: `folder/name` or just `name`. id: type: string description: ID for an existing Agent. output_message: $ref: '#/components/schemas/type_:ChatMessage' description: The message returned by the provider. prompt_tokens: type: integer description: Number of tokens in the prompt used to generate the output. reasoning_tokens: type: integer description: Number of reasoning tokens used to generate the output. output_tokens: type: integer description: Number of tokens in the output generated by the model. prompt_cost: type: number format: double description: Cost in dollars associated to the tokens in the prompt. output_cost: type: number format: double description: Cost in dollars associated to the tokens in the output. finish_reason: type: string description: Reason the generation finished. messages: type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: The messages passed to the to provider chat endpoint. tool_choice: $ref: '#/components/schemas/type_agents:AgentLogRequestToolChoice' description: >- Controls how the model uses tools. The following options are supported: - `'none'` means the model will not call any tool and instead generates a message; this is the default when no tools are provided as part of the Prompt. - `'auto'` means the model can decide to call one or more of the provided tools; this is the default when tools are provided as part of the Prompt. - `'required'` means the model must call one or more of the provided tools. - `{'type': 'function', 'function': {name': }}` forces the model to use the named function. agent: $ref: '#/components/schemas/type_agents:AgentLogRequestAgent' description: >- The Agent configuration to use. Two formats are supported: - An object representing the details of the Agent configuration - A string representing the raw contents of a .agent file A new Agent version will be created if the provided details do not match any existing version. start_time: type: string format: date-time description: When the logged event started. end_time: type: string format: date-time description: When the logged event ended. output: type: string description: >- Generated output from your model for the provided inputs. Can be `None` if logging an error, or if creating a parent Log with the intention to populate it later. created_at: type: string format: date-time description: 'User defined timestamp for when the log was created. ' error: type: string description: Error message if the log is an error. provider_latency: type: number format: double description: Duration of the logged event in seconds. stdout: type: string description: Captured log and debug statements. provider_request: type: object additionalProperties: description: Any type description: Raw request sent to provider. provider_response: type: object additionalProperties: description: Any type description: Raw response received the provider. inputs: type: object additionalProperties: description: Any type description: The inputs passed to the prompt template. source: type: string description: Identifies where the model was called from. metadata: type: object additionalProperties: description: Any type description: Any additional metadata to record. source_datapoint_id: type: string description: >- Unique identifier for the Datapoint that this Log is derived from. This can be used by Humanloop to associate Logs to Evaluations. If provided, Humanloop will automatically associate this Log to Evaluations that require a Log for this Datapoint-Version pair. trace_parent_id: type: string description: The ID of the parent Log to nest this Log under in a Trace. user: type: string description: End-user ID related to the Log. environment: type: string description: The name of the Environment the Log is associated to. save: type: boolean default: true description: >- Whether the request/response payloads will be stored on Humanloop. log_id: type: string description: >- This will identify a Log. If you don't provide a Log ID, Humanloop will generate one for you. servers: - url: https://api.humanloop.com/v5 components: schemas: type_:TextChatContent: type: object properties: type: type: string enum: - text text: type: string description: The message's text content. required: - type - text title: TextChatContent type_:ImageUrlDetail: type: string enum: - high - low - auto description: >- Specify the detail level of the image provided to the model. For more details see: https://platform.openai.com/docs/guides/vision/low-or-high-fidelity-image-understanding title: ImageUrlDetail type_:ImageUrl: type: object properties: url: type: string description: Either a URL of the image or the base64 encoded image data. detail: $ref: '#/components/schemas/type_:ImageUrlDetail' description: >- Specify the detail level of the image provided to the model. For more details see: https://platform.openai.com/docs/guides/vision/low-or-high-fidelity-image-understanding required: - url title: ImageUrl type_:ImageChatContent: type: object properties: type: type: string enum: - image_url image_url: $ref: '#/components/schemas/type_:ImageUrl' description: The message's image content. required: - type - image_url title: ImageChatContent type_:ChatMessageContentItem: oneOf: - $ref: '#/components/schemas/type_:TextChatContent' - $ref: '#/components/schemas/type_:ImageChatContent' title: ChatMessageContentItem type_:ChatMessageContent: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessageContentItem' description: The content of the message. title: ChatMessageContent type_:ChatRole: type: string enum: - user - assistant - system - tool - developer description: An enumeration. title: ChatRole type_:ChatToolType: type: string enum: - function description: The type of tool to call. title: ChatToolType type_:FunctionTool: type: object properties: name: type: string arguments: type: string required: - name description: A function tool to be called by the model where user owns runtime. title: FunctionTool type_:ToolCall: type: object properties: id: type: string type: $ref: '#/components/schemas/type_:ChatToolType' function: $ref: '#/components/schemas/type_:FunctionTool' required: - id - type - function description: A tool call to be made. title: ToolCall type_:AnthropicThinkingContent: type: object properties: type: type: string enum: - thinking thinking: type: string description: Model's chain-of-thought for providing the response. signature: type: string description: >- Cryptographic signature that verifies the thinking block was generated by Anthropic. required: - type - thinking - signature title: AnthropicThinkingContent type_:AnthropicRedactedThinkingContent: type: object properties: type: type: string enum: - redacted_thinking data: type: string description: >- Thinking block Anthropic redacted for safety reasons. User is expected to pass the block back to Anthropic required: - type - data title: AnthropicRedactedThinkingContent type_:ChatMessageThinkingItem: oneOf: - $ref: '#/components/schemas/type_:AnthropicThinkingContent' - $ref: '#/components/schemas/type_:AnthropicRedactedThinkingContent' title: ChatMessageThinkingItem type_:ChatMessage: type: object properties: content: $ref: '#/components/schemas/type_:ChatMessageContent' description: The content of the message. name: type: string description: Optional name of the message author. tool_call_id: type: string description: Tool call that this message is responding to. role: $ref: '#/components/schemas/type_:ChatRole' description: Role of the message author. tool_calls: type: array items: $ref: '#/components/schemas/type_:ToolCall' description: A list of tool calls requested by the assistant. thinking: type: array items: $ref: '#/components/schemas/type_:ChatMessageThinkingItem' description: >- Model's chain-of-thought for providing the response. Present on assistant messages if model supports it. required: - role title: ChatMessage type_:FunctionToolChoice: type: object properties: name: type: string required: - name description: A function tool to be called by the model where user owns runtime. title: FunctionToolChoice type_:ToolChoice: type: object properties: type: $ref: '#/components/schemas/type_:ChatToolType' function: $ref: '#/components/schemas/type_:FunctionToolChoice' required: - type - function description: Tool choice to force the model to use a tool. title: ToolChoice type_agents:AgentLogRequestToolChoice: oneOf: - type: string enum: - none - type: string enum: - auto - type: string enum: - required - $ref: '#/components/schemas/type_:ToolChoice' description: >- Controls how the model uses tools. The following options are supported: - `'none'` means the model will not call any tool and instead generates a message; this is the default when no tools are provided as part of the Prompt. - `'auto'` means the model can decide to call one or more of the provided tools; this is the default when tools are provided as part of the Prompt. - `'required'` means the model must call one or more of the provided tools. - `{'type': 'function', 'function': {name': }}` forces the model to use the named function. title: AgentLogRequestToolChoice type_:ModelEndpoints: type: string enum: - complete - chat - edit description: Supported model provider endpoints. title: ModelEndpoints type_:AgentKernelRequestTemplate: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: >- 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}}`. title: AgentKernelRequestTemplate type_:TemplateLanguage: type: string enum: - default - jinja description: Template engine to use for rendering templates. title: TemplateLanguage type_:ModelProviders: type: string enum: - anthropic - bedrock - cohere - deepseek - google - groq - mock - openai - openai_azure - replicate description: Supported model providers. title: ModelProviders type_:AgentKernelRequestStop: oneOf: - type: string - type: array items: type: string description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. title: AgentKernelRequestStop type_:ResponseFormatType: type: string enum: - json_object - json_schema title: ResponseFormatType type_:ResponseFormat: type: object properties: type: $ref: '#/components/schemas/type_:ResponseFormatType' json_schema: type: object additionalProperties: description: Any type description: The JSON schema of the response format if type is json_schema. required: - type description: Response format of the model. title: ResponseFormat type_:OpenAiReasoningEffort: type: string enum: - high - medium - low description: Supported reasoning effort. title: OpenAiReasoningEffort type_:AgentKernelRequestReasoningEffort: oneOf: - $ref: '#/components/schemas/type_:OpenAiReasoningEffort' - type: integer description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. title: AgentKernelRequestReasoningEffort type_:LinkedFileRequest: type: object properties: file_id: type: string environment_id: type: string version_id: type: string required: - file_id title: LinkedFileRequest type_:OnAgentCallEnum: type: string enum: - stop - continue description: What an Agent should do when calling a Tool. title: OnAgentCallEnum type_:AgentLinkedFileRequest: type: object properties: type: type: string enum: - file link: $ref: '#/components/schemas/type_:LinkedFileRequest' on_agent_call: $ref: '#/components/schemas/type_:OnAgentCallEnum' required: - type - link title: AgentLinkedFileRequest type_:ToolFunction: type: object properties: name: type: string description: Name for the tool referenced by the model. description: type: string description: Description of the tool referenced by the model strict: type: boolean default: false description: >- If true, forces the model to output json data in the structure of the parameters schema. parameters: type: object additionalProperties: description: Any type description: >- Parameters needed to run the Tool, defined in JSON Schema format: https://json-schema.org/ required: - name - description title: ToolFunction type_:AgentInlineTool: type: object properties: type: type: string enum: - inline json_schema: $ref: '#/components/schemas/type_:ToolFunction' on_agent_call: $ref: '#/components/schemas/type_:OnAgentCallEnum' required: - type - json_schema title: AgentInlineTool type_:AgentKernelRequestToolsItem: oneOf: - $ref: '#/components/schemas/type_:AgentLinkedFileRequest' - $ref: '#/components/schemas/type_:AgentInlineTool' title: AgentKernelRequestToolsItem type_:AgentKernelRequest: type: object properties: model: type: string description: >- The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models) endpoint: $ref: '#/components/schemas/type_:ModelEndpoints' description: The provider model endpoint used. template: $ref: '#/components/schemas/type_:AgentKernelRequestTemplate' description: >- 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}}`. template_language: $ref: '#/components/schemas/type_:TemplateLanguage' description: The template language to use for rendering the template. provider: $ref: '#/components/schemas/type_:ModelProviders' description: The company providing the underlying model service. max_tokens: type: integer default: -1 description: >- 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 temperature: type: number format: double default: 1 description: >- What sampling temperature to use when making a generation. Higher values means the model will be more creative. top_p: type: number format: double default: 1 description: >- An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. stop: $ref: '#/components/schemas/type_:AgentKernelRequestStop' description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. presence_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far. frequency_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far. other: type: object additionalProperties: description: Any type description: Other parameter values to be passed to the provider call. seed: type: integer description: >- If specified, model will make a best effort to sample deterministically, but it is not guaranteed. response_format: $ref: '#/components/schemas/type_:ResponseFormat' description: >- The format of the response. Only `{"type": "json_object"}` is currently supported for chat. reasoning_effort: $ref: '#/components/schemas/type_:AgentKernelRequestReasoningEffort' description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. tools: type: array items: $ref: '#/components/schemas/type_:AgentKernelRequestToolsItem' attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used. max_iterations: type: integer description: >- The maximum number of iterations the Agent can run. This is used to limit the number of times the Agent model is called. required: - model description: |- Base class used by both PromptKernelRequest and AgentKernelRequest. Contains the consistent Prompt-related fields. title: AgentKernelRequest type_agents:AgentLogRequestAgent: oneOf: - $ref: '#/components/schemas/type_:AgentKernelRequest' - type: string description: >- The Agent configuration to use. Two formats are supported: - An object representing the details of the Agent configuration - A string representing the raw contents of a .agent file A new Agent version will be created if the provided details do not match any existing version. title: AgentLogRequestAgent type_:LogStatus: type: string enum: - complete - incomplete description: An enumeration. title: LogStatus type_:CreateAgentLogResponse: type: object properties: id: type: string description: Unique identifier for the Log. agent_id: type: string description: Unique identifier for the Agent. version_id: type: string description: Unique identifier for the Agent Version. log_status: $ref: '#/components/schemas/type_:LogStatus' description: >- Status of the Agent Log. When a Agent Log is marked as `complete`, no more Logs can be added to it. required: - id - agent_id - version_id description: Response for an Agent Log. title: CreateAgentLogResponse type_:ValidationErrorLocItem: oneOf: - type: string - type: integer title: ValidationErrorLocItem type_:ValidationError: type: object properties: loc: type: array items: $ref: '#/components/schemas/type_:ValidationErrorLocItem' msg: type: string type: type: string required: - loc - msg - type title: ValidationError type_:HttpValidationError: type: object properties: detail: type: array items: $ref: '#/components/schemas/type_:ValidationError' title: HttpValidationError securitySchemes: default: type: apiKey in: header name: X-API-KEY ``` ## SDK Code Examples ```python Log agent import requests url = "https://api.humanloop.com/v5/agents/log" payload = { "path": "Banking/Teller Agent", "agent": { "provider": "anthropic", "endpoint": "chat", "model": "claude-3-7-sonnet-latest", "reasoning_effort": 1024, "template": [ { "role": "system", "content": "You are a helpful digital assistant, helping users navigate our digital banking platform." } ], "max_iterations": 3, "tools": [ { "type": "file", "link": { "file_id": "pr_1234567890", "version_id": "prv_1234567890" }, "on_agent_call": "continue" }, { "type": "inline", "json_schema": { "name": "stop", "description": "Call this tool when you have finished your task.", "parameters": { "type": "object", "properties": { "output": { "type": "string", "description": "The final output to return to the user." } }, "additionalProperties": False, "required": ["output"] }, "strict": True }, "on_agent_call": "stop" } ] } } headers = { "X-API-KEY": " ", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```typescript Log agent import { HumanloopClient } from "humanloop"; const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); await client.agents.log({ path: "Banking/Teller Agent", agent: { provider: "anthropic", endpoint: "chat", model: "claude-3-7-sonnet-latest", reasoningEffort: 1024, template: [{ role: "system", content: "You are a helpful digital assistant, helping users navigate our digital banking platform." }], maxIterations: 3, tools: [{ type: "file", link: { fileId: "pr_1234567890", versionId: "prv_1234567890" }, onAgentCall: "continue" }, { type: "inline", jsonSchema: { name: "stop", description: "Call this tool when you have finished your task.", parameters: { "type": "object", "properties": { "output": { "type": "string", "description": "The final output to return to the user." } }, "additionalProperties": false, "required": [ "output" ] }, strict: true }, onAgentCall: "stop" }] } }); ``` ```go Log agent package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/agents/log" payload := strings.NewReader("{\n \"path\": \"Banking/Teller Agent\",\n \"agent\": {\n \"provider\": \"anthropic\",\n \"endpoint\": \"chat\",\n \"model\": \"claude-3-7-sonnet-latest\",\n \"reasoning_effort\": 1024,\n \"template\": [\n {\n \"role\": \"system\",\n \"content\": \"You are a helpful digital assistant, helping users navigate our digital banking platform.\"\n }\n ],\n \"max_iterations\": 3,\n \"tools\": [\n {\n \"type\": \"file\",\n \"link\": {\n \"file_id\": \"pr_1234567890\",\n \"version_id\": \"prv_1234567890\"\n },\n \"on_agent_call\": \"continue\"\n },\n {\n \"type\": \"inline\",\n \"json_schema\": {\n \"name\": \"stop\",\n \"description\": \"Call this tool when you have finished your task.\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"output\": {\n \"type\": \"string\",\n \"description\": \"The final output to return to the user.\"\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"output\"\n ]\n },\n \"strict\": true\n },\n \"on_agent_call\": \"stop\"\n }\n ]\n }\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("X-API-KEY", " ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Log agent require 'uri' require 'net/http' url = URI("https://api.humanloop.com/v5/agents/log") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["X-API-KEY"] = ' ' request["Content-Type"] = 'application/json' request.body = "{\n \"path\": \"Banking/Teller Agent\",\n \"agent\": {\n \"provider\": \"anthropic\",\n \"endpoint\": \"chat\",\n \"model\": \"claude-3-7-sonnet-latest\",\n \"reasoning_effort\": 1024,\n \"template\": [\n {\n \"role\": \"system\",\n \"content\": \"You are a helpful digital assistant, helping users navigate our digital banking platform.\"\n }\n ],\n \"max_iterations\": 3,\n \"tools\": [\n {\n \"type\": \"file\",\n \"link\": {\n \"file_id\": \"pr_1234567890\",\n \"version_id\": \"prv_1234567890\"\n },\n \"on_agent_call\": \"continue\"\n },\n {\n \"type\": \"inline\",\n \"json_schema\": {\n \"name\": \"stop\",\n \"description\": \"Call this tool when you have finished your task.\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"output\": {\n \"type\": \"string\",\n \"description\": \"The final output to return to the user.\"\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"output\"\n ]\n },\n \"strict\": true\n },\n \"on_agent_call\": \"stop\"\n }\n ]\n }\n}" response = http.request(request) puts response.read_body ``` ```java Log agent import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.humanloop.com/v5/agents/log") .header("X-API-KEY", " ") .header("Content-Type", "application/json") .body("{\n \"path\": \"Banking/Teller Agent\",\n \"agent\": {\n \"provider\": \"anthropic\",\n \"endpoint\": \"chat\",\n \"model\": \"claude-3-7-sonnet-latest\",\n \"reasoning_effort\": 1024,\n \"template\": [\n {\n \"role\": \"system\",\n \"content\": \"You are a helpful digital assistant, helping users navigate our digital banking platform.\"\n }\n ],\n \"max_iterations\": 3,\n \"tools\": [\n {\n \"type\": \"file\",\n \"link\": {\n \"file_id\": \"pr_1234567890\",\n \"version_id\": \"prv_1234567890\"\n },\n \"on_agent_call\": \"continue\"\n },\n {\n \"type\": \"inline\",\n \"json_schema\": {\n \"name\": \"stop\",\n \"description\": \"Call this tool when you have finished your task.\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"output\": {\n \"type\": \"string\",\n \"description\": \"The final output to return to the user.\"\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"output\"\n ]\n },\n \"strict\": true\n },\n \"on_agent_call\": \"stop\"\n }\n ]\n }\n}") .asString(); ``` ```php Log agent request('POST', 'https://api.humanloop.com/v5/agents/log', [ 'body' => '{ "path": "Banking/Teller Agent", "agent": { "provider": "anthropic", "endpoint": "chat", "model": "claude-3-7-sonnet-latest", "reasoning_effort": 1024, "template": [ { "role": "system", "content": "You are a helpful digital assistant, helping users navigate our digital banking platform." } ], "max_iterations": 3, "tools": [ { "type": "file", "link": { "file_id": "pr_1234567890", "version_id": "prv_1234567890" }, "on_agent_call": "continue" }, { "type": "inline", "json_schema": { "name": "stop", "description": "Call this tool when you have finished your task.", "parameters": { "type": "object", "properties": { "output": { "type": "string", "description": "The final output to return to the user." } }, "additionalProperties": false, "required": [ "output" ] }, "strict": true }, "on_agent_call": "stop" } ] } }', 'headers' => [ 'Content-Type' => 'application/json', 'X-API-KEY' => ' ', ], ]); echo $response->getBody(); ``` ```csharp Log agent using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/agents/log"); var request = new RestRequest(Method.POST); request.AddHeader("X-API-KEY", " "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"path\": \"Banking/Teller Agent\",\n \"agent\": {\n \"provider\": \"anthropic\",\n \"endpoint\": \"chat\",\n \"model\": \"claude-3-7-sonnet-latest\",\n \"reasoning_effort\": 1024,\n \"template\": [\n {\n \"role\": \"system\",\n \"content\": \"You are a helpful digital assistant, helping users navigate our digital banking platform.\"\n }\n ],\n \"max_iterations\": 3,\n \"tools\": [\n {\n \"type\": \"file\",\n \"link\": {\n \"file_id\": \"pr_1234567890\",\n \"version_id\": \"prv_1234567890\"\n },\n \"on_agent_call\": \"continue\"\n },\n {\n \"type\": \"inline\",\n \"json_schema\": {\n \"name\": \"stop\",\n \"description\": \"Call this tool when you have finished your task.\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"output\": {\n \"type\": \"string\",\n \"description\": \"The final output to return to the user.\"\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"output\"\n ]\n },\n \"strict\": true\n },\n \"on_agent_call\": \"stop\"\n }\n ]\n }\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Log agent import Foundation let headers = [ "X-API-KEY": " ", "Content-Type": "application/json" ] let parameters = [ "path": "Banking/Teller Agent", "agent": [ "provider": "anthropic", "endpoint": "chat", "model": "claude-3-7-sonnet-latest", "reasoning_effort": 1024, "template": [ [ "role": "system", "content": "You are a helpful digital assistant, helping users navigate our digital banking platform." ] ], "max_iterations": 3, "tools": [ [ "type": "file", "link": [ "file_id": "pr_1234567890", "version_id": "prv_1234567890" ], "on_agent_call": "continue" ], [ "type": "inline", "json_schema": [ "name": "stop", "description": "Call this tool when you have finished your task.", "parameters": [ "type": "object", "properties": ["output": [ "type": "string", "description": "The final output to return to the user." ]], "additionalProperties": false, "required": ["output"] ], "strict": true ], "on_agent_call": "stop" ] ] ] ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/agents/log")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. # Update Agent Log PATCH https://api.humanloop.com/v5/agents/{id}/log/{log_id} Content-Type: application/json Update a Log. Update the details of a Log with the given ID. Reference: https://humanloop.com/docs/api/agents/update-log ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /agents/{id}/log/{log_id}: patch: operationId: update-log summary: Update Agent Log description: |- Update a Log. Update the details of a Log with the given ID. tags: - subpackage_agents parameters: - name: id in: path description: Unique identifier for Agent. required: true schema: type: string - name: log_id in: path description: Unique identifier for the Log. required: true schema: type: string - name: X-API-KEY in: header required: true schema: type: string responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/type_:AgentLogResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/type_:HttpValidationError' requestBody: content: application/json: schema: type: object properties: messages: type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: >- List of chat messages that were used as an input to the Flow. output_message: $ref: '#/components/schemas/type_:ChatMessage' description: The output message returned by this Flow. inputs: type: object additionalProperties: description: Any type description: The inputs passed to the Flow Log. output: type: string description: >- The output of the Flow Log. Provide None to unset existing `output` value. Provide either this, `output_message` or `error`. error: type: string description: >- The error message of the Flow Log. Provide None to unset existing `error` value. Provide either this, `output_message` or `output`. log_status: $ref: '#/components/schemas/type_:LogStatus' description: >- Status of the Flow Log. When a Flow Log is updated to `complete`, no more Logs can be added to it. You cannot update a Flow Log's status from `complete` to `incomplete`. servers: - url: https://api.humanloop.com/v5 components: schemas: type_:TextChatContent: type: object properties: type: type: string enum: - text text: type: string description: The message's text content. required: - type - text title: TextChatContent type_:ImageUrlDetail: type: string enum: - high - low - auto description: >- Specify the detail level of the image provided to the model. For more details see: https://platform.openai.com/docs/guides/vision/low-or-high-fidelity-image-understanding title: ImageUrlDetail type_:ImageUrl: type: object properties: url: type: string description: Either a URL of the image or the base64 encoded image data. detail: $ref: '#/components/schemas/type_:ImageUrlDetail' description: >- Specify the detail level of the image provided to the model. For more details see: https://platform.openai.com/docs/guides/vision/low-or-high-fidelity-image-understanding required: - url title: ImageUrl type_:ImageChatContent: type: object properties: type: type: string enum: - image_url image_url: $ref: '#/components/schemas/type_:ImageUrl' description: The message's image content. required: - type - image_url title: ImageChatContent type_:ChatMessageContentItem: oneOf: - $ref: '#/components/schemas/type_:TextChatContent' - $ref: '#/components/schemas/type_:ImageChatContent' title: ChatMessageContentItem type_:ChatMessageContent: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessageContentItem' description: The content of the message. title: ChatMessageContent type_:ChatRole: type: string enum: - user - assistant - system - tool - developer description: An enumeration. title: ChatRole type_:ChatToolType: type: string enum: - function description: The type of tool to call. title: ChatToolType type_:FunctionTool: type: object properties: name: type: string arguments: type: string required: - name description: A function tool to be called by the model where user owns runtime. title: FunctionTool type_:ToolCall: type: object properties: id: type: string type: $ref: '#/components/schemas/type_:ChatToolType' function: $ref: '#/components/schemas/type_:FunctionTool' required: - id - type - function description: A tool call to be made. title: ToolCall type_:AnthropicThinkingContent: type: object properties: type: type: string enum: - thinking thinking: type: string description: Model's chain-of-thought for providing the response. signature: type: string description: >- Cryptographic signature that verifies the thinking block was generated by Anthropic. required: - type - thinking - signature title: AnthropicThinkingContent type_:AnthropicRedactedThinkingContent: type: object properties: type: type: string enum: - redacted_thinking data: type: string description: >- Thinking block Anthropic redacted for safety reasons. User is expected to pass the block back to Anthropic required: - type - data title: AnthropicRedactedThinkingContent type_:ChatMessageThinkingItem: oneOf: - $ref: '#/components/schemas/type_:AnthropicThinkingContent' - $ref: '#/components/schemas/type_:AnthropicRedactedThinkingContent' title: ChatMessageThinkingItem type_:ChatMessage: type: object properties: content: $ref: '#/components/schemas/type_:ChatMessageContent' description: The content of the message. name: type: string description: Optional name of the message author. tool_call_id: type: string description: Tool call that this message is responding to. role: $ref: '#/components/schemas/type_:ChatRole' description: Role of the message author. tool_calls: type: array items: $ref: '#/components/schemas/type_:ToolCall' description: A list of tool calls requested by the assistant. thinking: type: array items: $ref: '#/components/schemas/type_:ChatMessageThinkingItem' description: >- Model's chain-of-thought for providing the response. Present on assistant messages if model supports it. required: - role title: ChatMessage type_:LogStatus: type: string enum: - complete - incomplete description: An enumeration. title: LogStatus type_:FunctionToolChoice: type: object properties: name: type: string required: - name description: A function tool to be called by the model where user owns runtime. title: FunctionToolChoice type_:ToolChoice: type: object properties: type: $ref: '#/components/schemas/type_:ChatToolType' function: $ref: '#/components/schemas/type_:FunctionToolChoice' required: - type - function description: Tool choice to force the model to use a tool. title: ToolChoice type_:AgentLogResponseToolChoice: oneOf: - type: string enum: - none - type: string enum: - auto - type: string enum: - required - $ref: '#/components/schemas/type_:ToolChoice' description: >- Controls how the model uses tools. The following options are supported: - `'none'` means the model will not call any tool and instead generates a message; this is the default when no tools are provided as part of the Prompt. - `'auto'` means the model can decide to call one or more of the provided tools; this is the default when tools are provided as part of the Prompt. - `'required'` means the model must call one or more of the provided tools. - `{'type': 'function', 'function': {name': }}` forces the model to use the named function. title: AgentLogResponseToolChoice type_:ModelEndpoints: type: string enum: - complete - chat - edit description: Supported model provider endpoints. title: ModelEndpoints type_:AgentResponseTemplate: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: >- 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}}`. title: AgentResponseTemplate type_:TemplateLanguage: type: string enum: - default - jinja description: Template engine to use for rendering templates. title: TemplateLanguage type_:ModelProviders: type: string enum: - anthropic - bedrock - cohere - deepseek - google - groq - mock - openai - openai_azure - replicate description: Supported model providers. title: ModelProviders type_:AgentResponseStop: oneOf: - type: string - type: array items: type: string description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. title: AgentResponseStop type_:ResponseFormatType: type: string enum: - json_object - json_schema title: ResponseFormatType type_:ResponseFormat: type: object properties: type: $ref: '#/components/schemas/type_:ResponseFormatType' json_schema: type: object additionalProperties: description: Any type description: The JSON schema of the response format if type is json_schema. required: - type description: Response format of the model. title: ResponseFormat type_:OpenAiReasoningEffort: type: string enum: - high - medium - low description: Supported reasoning effort. title: OpenAiReasoningEffort type_:AgentResponseReasoningEffort: oneOf: - $ref: '#/components/schemas/type_:OpenAiReasoningEffort' - type: integer description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. title: AgentResponseReasoningEffort type_:LinkedFileRequest: type: object properties: file_id: type: string environment_id: type: string version_id: type: string required: - file_id title: LinkedFileRequest type_:OnAgentCallEnum: type: string enum: - stop - continue description: What an Agent should do when calling a Tool. title: OnAgentCallEnum type_:PromptResponseTemplate: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: >- 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}}`. title: PromptResponseTemplate type_:PromptResponseStop: oneOf: - type: string - type: array items: type: string description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. title: PromptResponseStop type_:PromptResponseReasoningEffort: oneOf: - $ref: '#/components/schemas/type_:OpenAiReasoningEffort' - type: integer description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. title: PromptResponseReasoningEffort type_:ToolFunction: type: object properties: name: type: string description: Name for the tool referenced by the model. description: type: string description: Description of the tool referenced by the model strict: type: boolean default: false description: >- If true, forces the model to output json data in the structure of the parameters schema. parameters: type: object additionalProperties: description: Any type description: >- Parameters needed to run the Tool, defined in JSON Schema format: https://json-schema.org/ required: - name - description title: ToolFunction type_:LinkedToolResponse: type: object properties: name: type: string description: Name for the tool referenced by the model. description: type: string description: Description of the tool referenced by the model strict: type: boolean default: false description: >- If true, forces the model to output json data in the structure of the parameters schema. parameters: type: object additionalProperties: description: Any type description: >- Parameters needed to run the Tool, defined in JSON Schema format: https://json-schema.org/ id: type: string description: Unique identifier for the Tool linked. version_id: type: string description: Unique identifier for the Tool Version linked. required: - name - description - id - version_id title: LinkedToolResponse type_:EnvironmentTag: type: string enum: - default - other description: An enumeration. title: EnvironmentTag type_:EnvironmentResponse: type: object properties: id: type: string created_at: type: string format: date-time name: type: string tag: $ref: '#/components/schemas/type_:EnvironmentTag' required: - id - created_at - name - tag title: EnvironmentResponse type_:UserResponse: description: Any type title: UserResponse type_:InputResponse: type: object properties: name: type: string description: Type of input. required: - name title: InputResponse type_:FilesToolType: type: string enum: - pinecone_search - google - mock - snippet - json_schema - get_api_call - python description: Type of tool. title: FilesToolType type_:EvaluatorAggregate: type: object properties: value: type: number format: double description: The aggregated value of the evaluator. evaluator_id: type: string description: ID of the evaluator. evaluator_version_id: type: string description: ID of the evaluator version. created_at: type: string format: date-time updated_at: type: string format: date-time required: - value - evaluator_id - evaluator_version_id - created_at - updated_at title: EvaluatorAggregate type_:ToolResponse: type: object properties: path: type: string description: >- Path of the Tool, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Tool. directory_id: type: string description: ID of the directory that the file is in on Humanloop. function: $ref: '#/components/schemas/type_:ToolFunction' description: >- Callable function specification of the Tool shown to the model for tool calling. source_code: type: string description: Code source of the Tool. setup_values: type: object additionalProperties: description: Any type description: >- Values needed to setup the Tool, defined in JSON Schema format: https://json-schema.org/ attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Tool. Helpful to separate Tool versions from each other with details on how they were created or used. tool_type: $ref: '#/components/schemas/type_:FilesToolType' description: Type of Tool. version_name: type: string description: >- Unique identifier for this Tool version. Each Tool can only have one version with a given name. version_description: type: string description: Description of the Version. name: type: string description: Name of the Tool, which is used as a unique identifier. description: type: string description: Description of the Tool. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Tool Version. If no query params provided, the default deployed Tool Version is returned. type: type: string enum: - tool environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Tool Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Tool. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Tool Version total_logs_count: type: integer description: The number of logs that have been generated across all Tool Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Prompt. Inputs correspond to any of the variables used within the Tool template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Tool that are used for monitoring logs. signature: type: string description: Signature of the Tool. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Tool Version. required: - path - id - name - version_id - created_at - updated_at - last_used_at - version_logs_count - total_logs_count - inputs description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: ToolResponse type_:DatapointResponseTargetValue: oneOf: - type: string - type: integer - type: number format: double - type: boolean - type: array items: description: Any type - type: object additionalProperties: description: Any type title: DatapointResponseTargetValue type_:DatapointResponse: type: object properties: inputs: type: object additionalProperties: type: string description: The inputs to the prompt template. messages: type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: List of chat messages to provide to the model. target: type: object additionalProperties: $ref: '#/components/schemas/type_:DatapointResponseTargetValue' description: >- Object with criteria necessary to evaluate generations with this Datapoint. This is passed in as an argument to Evaluators when used in an Evaluation. id: type: string description: Unique identifier for the Datapoint. Starts with `dp_`. required: - id title: DatapointResponse type_:DatasetResponse: type: object properties: path: type: string description: >- Path of the Dataset, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Dataset. Starts with `ds_`. directory_id: type: string description: ID of the directory that the file is in on Humanloop. name: type: string description: Name of the Dataset, which is used as a unique identifier. description: type: string description: Description of the Dataset. schema: type: object additionalProperties: description: Any type description: The JSON schema for the File. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Dataset Version. If no query params provided, the default deployed Dataset Version is returned. Starts with `dsv_`. type: type: string enum: - dataset environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Dataset Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Dataset. last_used_at: type: string format: date-time version_name: type: string description: >- Unique name for the Dataset version. Version names must be unique for a given Dataset. version_description: type: string description: Description of the version, e.g., the changes made in this version. datapoints_count: type: integer description: The number of Datapoints in this Dataset version. datapoints: type: array items: $ref: '#/components/schemas/type_:DatapointResponse' description: >- The list of Datapoints in this Dataset version. Only provided if explicitly requested. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Dataset. Helpful to separate Dataset versions from each other with details on how they were created or used. required: - path - id - name - version_id - created_at - updated_at - last_used_at - datapoints_count description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: DatasetResponse type_:EvaluatorArgumentsType: type: string enum: - target_free - target_required description: Enum representing the possible argument types of an evaluator. title: EvaluatorArgumentsType type_:EvaluatorReturnTypeEnum: type: string enum: - boolean - number - select - multi_select - text description: Enum representing the possible return types of an evaluator. title: EvaluatorReturnTypeEnum type_:Valence: type: string enum: - positive - negative - neutral description: An enumeration. title: Valence type_:EvaluatorJudgmentOptionResponse: type: object properties: name: type: string description: The name of the option. valence: $ref: '#/components/schemas/type_:Valence' description: Whether this option should be considered positive or negative. required: - name title: EvaluatorJudgmentOptionResponse type_:EvaluatorJudgmentNumberLimit: type: object properties: min: type: number format: double description: The minimum value that can be selected. max: type: number format: double description: The maximum value that can be selected. step: type: number format: double description: The step size for the number input. title: EvaluatorJudgmentNumberLimit type_:PromptKernelRequestTemplate: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: >- 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}}`. title: PromptKernelRequestTemplate type_:PromptKernelRequestStop: oneOf: - type: string - type: array items: type: string description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. title: PromptKernelRequestStop type_:PromptKernelRequestReasoningEffort: oneOf: - $ref: '#/components/schemas/type_:OpenAiReasoningEffort' - type: integer description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. title: PromptKernelRequestReasoningEffort type_:PromptKernelRequest: type: object properties: model: type: string description: >- The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models) endpoint: $ref: '#/components/schemas/type_:ModelEndpoints' description: The provider model endpoint used. template: $ref: '#/components/schemas/type_:PromptKernelRequestTemplate' description: >- 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}}`. template_language: $ref: '#/components/schemas/type_:TemplateLanguage' description: The template language to use for rendering the template. provider: $ref: '#/components/schemas/type_:ModelProviders' description: The company providing the underlying model service. max_tokens: type: integer default: -1 description: >- 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 temperature: type: number format: double default: 1 description: >- What sampling temperature to use when making a generation. Higher values means the model will be more creative. top_p: type: number format: double default: 1 description: >- An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. stop: $ref: '#/components/schemas/type_:PromptKernelRequestStop' description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. presence_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far. frequency_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far. other: type: object additionalProperties: description: Any type description: Other parameter values to be passed to the provider call. seed: type: integer description: >- If specified, model will make a best effort to sample deterministically, but it is not guaranteed. response_format: $ref: '#/components/schemas/type_:ResponseFormat' description: >- The format of the response. Only `{"type": "json_object"}` is currently supported for chat. reasoning_effort: $ref: '#/components/schemas/type_:PromptKernelRequestReasoningEffort' description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. tools: type: array items: $ref: '#/components/schemas/type_:ToolFunction' description: >- The tool specification that the model can choose to call if Tool calling is supported. linked_tools: type: array items: type: string description: >- 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. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used. required: - model description: |- Base class used by both PromptKernelRequest and AgentKernelRequest. Contains the consistent Prompt-related fields. title: PromptKernelRequest type_:LlmEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:EvaluatorReturnTypeEnum' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: >- The options that can be applied as judgments. Only for Evaluators with `return_type` of 'boolean', 'select' or 'multi_select'. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - llm prompt: $ref: '#/components/schemas/type_:PromptKernelRequest' description: The prompt parameters used to generate. required: - arguments_type - return_type - evaluator_type title: LlmEvaluatorRequest type_:CodeEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:EvaluatorReturnTypeEnum' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: >- The options that can be applied as judgments. Only for Evaluators with `return_type` of 'boolean', 'select' or 'multi_select'. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - python code: type: string description: >- The code for the Evaluator. This code will be executed in a sandboxed environment. required: - arguments_type - return_type - evaluator_type - code title: CodeEvaluatorRequest type_:HumanEvaluatorRequestReturnType: type: string enum: - select - multi_select - text - number - boolean description: The type of the return value of the Evaluator. title: HumanEvaluatorRequestReturnType type_:HumanEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:HumanEvaluatorRequestReturnType' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: The options that can be applied as judgments. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - human instructions: type: string description: Instructions and guidelines for applying judgments. required: - arguments_type - return_type - evaluator_type title: HumanEvaluatorRequest type_:ExternalEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:EvaluatorReturnTypeEnum' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: >- The options that can be applied as judgments. Only for Evaluators with `return_type` of 'boolean', 'select' or 'multi_select'. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - external required: - arguments_type - return_type - evaluator_type title: ExternalEvaluatorRequest type_:EvaluatorResponseSpec: oneOf: - $ref: '#/components/schemas/type_:LlmEvaluatorRequest' - $ref: '#/components/schemas/type_:CodeEvaluatorRequest' - $ref: '#/components/schemas/type_:HumanEvaluatorRequest' - $ref: '#/components/schemas/type_:ExternalEvaluatorRequest' title: EvaluatorResponseSpec type_:EvaluatorResponse: type: object properties: path: type: string description: >- Path of the Evaluator including the Evaluator name, which is used as a unique identifier. id: type: string description: Unique identifier for the Evaluator. directory_id: type: string description: ID of the directory that the file is in on Humanloop. version_name: type: string description: >- Unique name for the Evaluator version. Version names must be unique for a given Evaluator. version_description: type: string description: Description of the version, e.g., the changes made in this version. spec: $ref: '#/components/schemas/type_:EvaluatorResponseSpec' name: type: string description: Name of the Evaluator, which is used as a unique identifier. description: type: string description: Description of the Evaluator. schema: type: object additionalProperties: description: Any type description: The JSON schema for the File. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Evaluator Version. If no query params provided, the default deployed Evaluator Version is returned. type: type: string enum: - evaluator environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Evaluator Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Evaluator. last_used_at: type: string format: date-time version_logs_count: type: integer description: >- The number of logs that have been generated for this Evaluator Version total_logs_count: type: integer description: >- The number of logs that have been generated across all Evaluator Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Evaluator. Inputs correspond to any of the variables used within the Evaluator template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Evaluator that are used for monitoring logs. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Evaluator Version. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. required: - path - id - spec - name - version_id - created_at - updated_at - last_used_at - version_logs_count - total_logs_count - inputs description: Version of the Evaluator used to provide judgments. title: EvaluatorResponse type_:FlowResponse: type: object properties: path: type: string description: >- Path of the Flow, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Flow. directory_id: type: string description: ID of the directory that the file is in on Humanloop. attributes: type: object additionalProperties: description: Any type description: A key-value object identifying the Flow Version. version_name: type: string description: >- Unique name for the Flow version. Version names must be unique for a given Flow. version_description: type: string description: Description of the Version. name: type: string description: Name of the Flow. description: type: string description: Description of the Flow. schema: type: object additionalProperties: description: Any type description: The JSON schema for the File. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Flow Version. If no query params provided, the default deployed Flow Version is returned. type: type: string enum: - flow environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Flow Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Flow. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Flow Version evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Flow Version. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: The list of Monitoring Evaluators associated with the Flow Version. required: - path - id - attributes - name - version_id - created_at - updated_at - last_used_at - version_logs_count description: Response model for a Flow. title: FlowResponse type_:VersionDeploymentResponseFile: oneOf: - $ref: '#/components/schemas/type_:PromptResponse' - $ref: '#/components/schemas/type_:ToolResponse' - $ref: '#/components/schemas/type_:DatasetResponse' - $ref: '#/components/schemas/type_:EvaluatorResponse' - $ref: '#/components/schemas/type_:FlowResponse' - $ref: '#/components/schemas/type_:AgentResponse' description: The File that the deployed Version belongs to. title: VersionDeploymentResponseFile type_:VersionDeploymentResponse: type: object properties: file: $ref: '#/components/schemas/type_:VersionDeploymentResponseFile' description: The File that the deployed Version belongs to. environment: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The Environment that the Version is deployed to. type: type: string enum: - environment required: - file - environment - type description: A variable reference to the Version deployed to an Environment title: VersionDeploymentResponse type_:VersionIdResponseVersion: oneOf: - $ref: '#/components/schemas/type_:PromptResponse' - $ref: '#/components/schemas/type_:ToolResponse' - $ref: '#/components/schemas/type_:DatasetResponse' - $ref: '#/components/schemas/type_:EvaluatorResponse' - $ref: '#/components/schemas/type_:FlowResponse' - $ref: '#/components/schemas/type_:AgentResponse' description: The specific Version being referenced. title: VersionIdResponseVersion type_:VersionIdResponse: type: object properties: version: $ref: '#/components/schemas/type_:VersionIdResponseVersion' description: The specific Version being referenced. type: type: string enum: - version required: - version - type description: A reference to a specific Version by its ID title: VersionIdResponse type_:VersionReferenceResponse: oneOf: - $ref: '#/components/schemas/type_:VersionDeploymentResponse' - $ref: '#/components/schemas/type_:VersionIdResponse' title: VersionReferenceResponse type_:MonitoringEvaluatorState: type: string enum: - active - inactive description: State of an evaluator connected to a file title: MonitoringEvaluatorState type_:MonitoringEvaluatorResponse: type: object properties: version_reference: $ref: '#/components/schemas/type_:VersionReferenceResponse' description: >- The Evaluator Version used for monitoring. This can be a specific Version by ID, or a Version deployed to an Environment. version: $ref: '#/components/schemas/type_:EvaluatorResponse' description: The deployed Version. state: $ref: '#/components/schemas/type_:MonitoringEvaluatorState' description: The state of the Monitoring Evaluator. Either `active` or `inactive` created_at: type: string format: date-time updated_at: type: string format: date-time required: - version_reference - state - created_at - updated_at title: MonitoringEvaluatorResponse type_:PromptResponse: type: object properties: path: type: string description: >- Path of the Prompt, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Prompt. directory_id: type: string description: ID of the directory that the file is in on Humanloop. model: type: string description: >- The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models) endpoint: $ref: '#/components/schemas/type_:ModelEndpoints' description: The provider model endpoint used. template: $ref: '#/components/schemas/type_:PromptResponseTemplate' description: >- 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}}`. template_language: $ref: '#/components/schemas/type_:TemplateLanguage' description: The template language to use for rendering the template. provider: $ref: '#/components/schemas/type_:ModelProviders' description: The company providing the underlying model service. max_tokens: type: integer default: -1 description: >- 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 temperature: type: number format: double default: 1 description: >- What sampling temperature to use when making a generation. Higher values means the model will be more creative. top_p: type: number format: double default: 1 description: >- An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. stop: $ref: '#/components/schemas/type_:PromptResponseStop' description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. presence_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far. frequency_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far. other: type: object additionalProperties: description: Any type description: Other parameter values to be passed to the provider call. seed: type: integer description: >- If specified, model will make a best effort to sample deterministically, but it is not guaranteed. response_format: $ref: '#/components/schemas/type_:ResponseFormat' description: >- The format of the response. Only `{"type": "json_object"}` is currently supported for chat. reasoning_effort: $ref: '#/components/schemas/type_:PromptResponseReasoningEffort' description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. tools: type: array items: $ref: '#/components/schemas/type_:ToolFunction' description: >- The tool specification that the model can choose to call if Tool calling is supported. linked_tools: type: array items: $ref: '#/components/schemas/type_:LinkedToolResponse' description: The tools linked to your prompt that the model can call. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used. version_name: type: string description: >- Unique name for the Prompt version. Version names must be unique for a given Prompt. version_description: type: string description: Description of the version, e.g., the changes made in this version. description: type: string description: Description of the Prompt. tags: type: array items: type: string description: List of tags associated with the file. readme: type: string description: Long description of the file. name: type: string description: Name of the Prompt. schema: type: object additionalProperties: description: Any type description: The JSON schema for the Prompt. version_id: type: string description: >- Unique identifier for the specific Prompt Version. If no query params provided, the default deployed Prompt Version is returned. type: type: string enum: - prompt environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Prompt Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Prompt. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Prompt Version total_logs_count: type: integer description: >- The number of logs that have been generated across all Prompt Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Prompt. Inputs correspond to any of the variables used within the Prompt template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Prompt that are used for monitoring logs. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Prompt Version. raw_file_content: type: string description: The raw content of the Prompt. Corresponds to the .prompt file. required: - path - id - model - name - version_id - created_at - updated_at - last_used_at - version_logs_count - total_logs_count - inputs description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: PromptResponse type_:AgentLinkedFileResponseFile: oneOf: - $ref: '#/components/schemas/type_:PromptResponse' - $ref: '#/components/schemas/type_:ToolResponse' - $ref: '#/components/schemas/type_:DatasetResponse' - $ref: '#/components/schemas/type_:EvaluatorResponse' - $ref: '#/components/schemas/type_:FlowResponse' - $ref: '#/components/schemas/type_:AgentResponse' title: AgentLinkedFileResponseFile type_:AgentLinkedFileResponse: type: object properties: type: type: string enum: - file link: $ref: '#/components/schemas/type_:LinkedFileRequest' on_agent_call: $ref: '#/components/schemas/type_:OnAgentCallEnum' file: $ref: '#/components/schemas/type_:AgentLinkedFileResponseFile' required: - type - link title: AgentLinkedFileResponse type_:AgentInlineTool: type: object properties: type: type: string enum: - inline json_schema: $ref: '#/components/schemas/type_:ToolFunction' on_agent_call: $ref: '#/components/schemas/type_:OnAgentCallEnum' required: - type - json_schema title: AgentInlineTool type_:AgentResponseToolsItem: oneOf: - $ref: '#/components/schemas/type_:AgentLinkedFileResponse' - $ref: '#/components/schemas/type_:AgentInlineTool' title: AgentResponseToolsItem type_:VersionStatus: type: string enum: - uncommitted - committed - deleted description: An enumeration. title: VersionStatus type_:AgentResponse: type: object properties: path: type: string description: >- Path of the Agent, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Agent. directory_id: type: string description: ID of the directory that the file is in on Humanloop. model: type: string description: >- The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models) endpoint: $ref: '#/components/schemas/type_:ModelEndpoints' description: The provider model endpoint used. template: $ref: '#/components/schemas/type_:AgentResponseTemplate' description: >- 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}}`. template_language: $ref: '#/components/schemas/type_:TemplateLanguage' description: The template language to use for rendering the template. provider: $ref: '#/components/schemas/type_:ModelProviders' description: The company providing the underlying model service. max_tokens: type: integer default: -1 description: >- 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 temperature: type: number format: double default: 1 description: >- What sampling temperature to use when making a generation. Higher values means the model will be more creative. top_p: type: number format: double default: 1 description: >- An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. stop: $ref: '#/components/schemas/type_:AgentResponseStop' description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. presence_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far. frequency_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far. other: type: object additionalProperties: description: Any type description: Other parameter values to be passed to the provider call. seed: type: integer description: >- If specified, model will make a best effort to sample deterministically, but it is not guaranteed. response_format: $ref: '#/components/schemas/type_:ResponseFormat' description: >- The format of the response. Only `{"type": "json_object"}` is currently supported for chat. reasoning_effort: $ref: '#/components/schemas/type_:AgentResponseReasoningEffort' description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. tools: type: array items: $ref: '#/components/schemas/type_:AgentResponseToolsItem' description: >- List of tools that the Agent can call. These can be linked files or inline tools. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used. max_iterations: type: integer description: >- The maximum number of iterations the Agent can run. This is used to limit the number of times the Agent model is called. version_name: type: string description: >- Unique name for the Agent version. Version names must be unique for a given Agent. version_description: type: string description: Description of the version, e.g., the changes made in this version. description: type: string description: Description of the Agent. tags: type: array items: type: string description: List of tags associated with the file. readme: type: string description: Long description of the file. name: type: string description: Name of the Agent. schema: type: object additionalProperties: description: Any type description: The JSON schema for the Prompt. version_id: type: string description: >- Unique identifier for the specific Agent Version. If no query params provided, the default deployed Agent Version is returned. type: type: string enum: - agent environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Agent Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Agent. committed_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who committed the Agent Version. committed_at: type: string format: date-time description: The date and time the Agent Version was committed. status: $ref: '#/components/schemas/type_:VersionStatus' description: The status of the Agent Version. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Agent Version total_logs_count: type: integer description: >- The number of logs that have been generated across all Agent Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Agent. Inputs correspond to any of the variables used within the Agent template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Agent that are used for monitoring logs. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Agent Version. raw_file_content: type: string description: The raw content of the Agent. Corresponds to the .agent file. required: - path - id - model - tools - name - version_id - created_at - updated_at - status - last_used_at - version_logs_count - total_logs_count - inputs description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: AgentResponse type_:EvaluatorLogResponseJudgment: oneOf: - type: boolean - type: string - type: array items: type: string - type: number format: double description: Evaluator assessment of the Log. title: EvaluatorLogResponseJudgment type_:PromptLogResponseToolChoice: oneOf: - type: string enum: - none - type: string enum: - auto - type: string enum: - required - $ref: '#/components/schemas/type_:ToolChoice' description: >- Controls how the model uses tools. The following options are supported: - `'none'` means the model will not call any tool and instead generates a message; this is the default when no tools are provided as part of the Prompt. - `'auto'` means the model can decide to call one or more of the provided tools; this is the default when tools are provided as part of the Prompt. - `'required'` means the model must call one or more of the provided tools. - `{'type': 'function', 'function': {name': }}` forces the model to use the named function. title: PromptLogResponseToolChoice type_:PromptLogResponse: type: object properties: output_message: $ref: '#/components/schemas/type_:ChatMessage' description: The message returned by the provider. prompt_tokens: type: integer description: Number of tokens in the prompt used to generate the output. reasoning_tokens: type: integer description: Number of reasoning tokens used to generate the output. output_tokens: type: integer description: Number of tokens in the output generated by the model. prompt_cost: type: number format: double description: Cost in dollars associated to the tokens in the prompt. output_cost: type: number format: double description: Cost in dollars associated to the tokens in the output. finish_reason: type: string description: Reason the generation finished. messages: type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: The messages passed to the to provider chat endpoint. tool_choice: $ref: '#/components/schemas/type_:PromptLogResponseToolChoice' description: >- Controls how the model uses tools. The following options are supported: - `'none'` means the model will not call any tool and instead generates a message; this is the default when no tools are provided as part of the Prompt. - `'auto'` means the model can decide to call one or more of the provided tools; this is the default when tools are provided as part of the Prompt. - `'required'` means the model must call one or more of the provided tools. - `{'type': 'function', 'function': {name': }}` forces the model to use the named function. prompt: $ref: '#/components/schemas/type_:PromptResponse' description: Prompt used to generate the Log. start_time: type: string format: date-time description: When the logged event started. end_time: type: string format: date-time description: When the logged event ended. output: type: string description: >- Generated output from your model for the provided inputs. Can be `None` if logging an error, or if creating a parent Log with the intention to populate it later. created_at: type: string format: date-time description: 'User defined timestamp for when the log was created. ' error: type: string description: Error message if the log is an error. provider_latency: type: number format: double description: Duration of the logged event in seconds. stdout: type: string description: Captured log and debug statements. provider_request: type: object additionalProperties: description: Any type description: Raw request sent to provider. provider_response: type: object additionalProperties: description: Any type description: Raw response received the provider. inputs: type: object additionalProperties: description: Any type description: The inputs passed to the prompt template. source: type: string description: Identifies where the model was called from. metadata: type: object additionalProperties: description: Any type description: Any additional metadata to record. source_datapoint_id: type: string description: >- Unique identifier for the Datapoint that this Log is derived from. This can be used by Humanloop to associate Logs to Evaluations. If provided, Humanloop will automatically associate this Log to Evaluations that require a Log for this Datapoint-Version pair. trace_parent_id: type: string description: The ID of the parent Log to nest this Log under in a Trace. batches: type: array items: type: string description: >- Array of Batch IDs that this Log is part of. Batches are used to group Logs together for offline Evaluations user: type: string description: End-user ID related to the Log. environment: type: string description: The name of the Environment the Log is associated to. save: type: boolean default: true description: Whether the request/response payloads will be stored on Humanloop. log_id: type: string description: >- This will identify a Log. If you don't provide a Log ID, Humanloop will generate one for you. id: type: string description: Unique identifier for the Log. evaluator_logs: type: array items: $ref: '#/components/schemas/type_:EvaluatorLogResponse' description: >- List of Evaluator Logs associated with the Log. These contain Evaluator judgments on the Log. trace_flow_id: type: string description: Identifier for the Flow that the Trace belongs to. trace_id: type: string description: Identifier for the Trace that the Log belongs to. trace_children: type: array items: $ref: '#/components/schemas/type_:LogResponse' description: Logs nested under this Log in the Trace. required: - prompt - id - evaluator_logs description: General request for creating a Log title: PromptLogResponse type_:ToolLogResponse: type: object properties: start_time: type: string format: date-time description: When the logged event started. end_time: type: string format: date-time description: When the logged event ended. output: type: string description: >- Generated output from your model for the provided inputs. Can be `None` if logging an error, or if creating a parent Log with the intention to populate it later. created_at: type: string format: date-time description: 'User defined timestamp for when the log was created. ' error: type: string description: Error message if the log is an error. provider_latency: type: number format: double description: Duration of the logged event in seconds. stdout: type: string description: Captured log and debug statements. provider_request: type: object additionalProperties: description: Any type description: Raw request sent to provider. provider_response: type: object additionalProperties: description: Any type description: Raw response received the provider. inputs: type: object additionalProperties: description: Any type description: The inputs passed to the prompt template. source: type: string description: Identifies where the model was called from. metadata: type: object additionalProperties: description: Any type description: Any additional metadata to record. source_datapoint_id: type: string description: >- Unique identifier for the Datapoint that this Log is derived from. This can be used by Humanloop to associate Logs to Evaluations. If provided, Humanloop will automatically associate this Log to Evaluations that require a Log for this Datapoint-Version pair. trace_parent_id: type: string description: The ID of the parent Log to nest this Log under in a Trace. batches: type: array items: type: string description: >- Array of Batch IDs that this Log is part of. Batches are used to group Logs together for offline Evaluations user: type: string description: End-user ID related to the Log. environment: type: string description: The name of the Environment the Log is associated to. save: type: boolean default: true description: Whether the request/response payloads will be stored on Humanloop. log_id: type: string description: >- This will identify a Log. If you don't provide a Log ID, Humanloop will generate one for you. id: type: string description: Unique identifier for the Log. evaluator_logs: type: array items: $ref: '#/components/schemas/type_:EvaluatorLogResponse' description: >- List of Evaluator Logs associated with the Log. These contain Evaluator judgments on the Log. trace_flow_id: type: string description: Identifier for the Flow that the Trace belongs to. trace_id: type: string description: Identifier for the Trace that the Log belongs to. trace_children: type: array items: $ref: '#/components/schemas/type_:LogResponse' description: Logs nested under this Log in the Trace. tool: $ref: '#/components/schemas/type_:ToolResponse' description: Tool used to generate the Log. output_message: $ref: '#/components/schemas/type_:ChatMessage' description: The message returned by the Tool. required: - id - evaluator_logs - tool description: General request for creating a Log title: ToolLogResponse type_:FlowLogResponse: type: object properties: messages: type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: List of chat messages that were used as an input to the Flow. output_message: $ref: '#/components/schemas/type_:ChatMessage' description: The output message returned by this Flow. start_time: type: string format: date-time description: When the logged event started. end_time: type: string format: date-time description: When the logged event ended. output: type: string description: >- Generated output from your model for the provided inputs. Can be `None` if logging an error, or if creating a parent Log with the intention to populate it later. created_at: type: string format: date-time description: 'User defined timestamp for when the log was created. ' error: type: string description: Error message if the log is an error. provider_latency: type: number format: double description: Duration of the logged event in seconds. stdout: type: string description: Captured log and debug statements. provider_request: type: object additionalProperties: description: Any type description: Raw request sent to provider. provider_response: type: object additionalProperties: description: Any type description: Raw response received the provider. inputs: type: object additionalProperties: description: Any type description: The inputs passed to the Flow Log. source: type: string description: Identifies where the model was called from. metadata: type: object additionalProperties: description: Any type description: Any additional metadata to record. log_status: $ref: '#/components/schemas/type_:LogStatus' description: >- Status of the Flow Log. When a Flow Log is updated to `complete`, no more Logs can be added to it. You cannot update a Flow Log's status from `complete` to `incomplete`. source_datapoint_id: type: string description: >- Unique identifier for the Datapoint that this Log is derived from. This can be used by Humanloop to associate Logs to Evaluations. If provided, Humanloop will automatically associate this Log to Evaluations that require a Log for this Datapoint-Version pair. trace_parent_id: type: string description: The ID of the parent Log to nest this Log under in a Trace. batches: type: array items: type: string description: >- Array of Batch IDs that this Log is part of. Batches are used to group Logs together for offline Evaluations user: type: string description: End-user ID related to the Log. environment: type: string description: The name of the Environment the Log is associated to. save: type: boolean default: true description: Whether the request/response payloads will be stored on Humanloop. log_id: type: string description: >- This will identify a Log. If you don't provide a Log ID, Humanloop will generate one for you. id: type: string description: Unique identifier for the Log. evaluator_logs: type: array items: $ref: '#/components/schemas/type_:EvaluatorLogResponse' description: >- List of Evaluator Logs associated with the Log. These contain Evaluator judgments on the Log. trace_flow_id: type: string description: Identifier for the Flow that the Trace belongs to. trace_id: type: string description: Identifier for the Trace that the Log belongs to. trace_children: type: array items: $ref: '#/components/schemas/type_:LogResponse' description: Logs nested under this Log in the Trace. flow: $ref: '#/components/schemas/type_:FlowResponse' description: Flow used to generate the Log. required: - id - evaluator_logs - flow description: General request for creating a Log title: FlowLogResponse type_:LogResponse: oneOf: - $ref: '#/components/schemas/type_:PromptLogResponse' - $ref: '#/components/schemas/type_:ToolLogResponse' - $ref: '#/components/schemas/type_:EvaluatorLogResponse' - $ref: '#/components/schemas/type_:FlowLogResponse' - $ref: '#/components/schemas/type_:AgentLogResponse' title: LogResponse type_:EvaluatorLogResponse: type: object properties: start_time: type: string format: date-time description: When the logged event started. end_time: type: string format: date-time description: When the logged event ended. output: type: string description: >- Generated output from your model for the provided inputs. Can be `None` if logging an error, or if creating a parent Log with the intention to populate it later. created_at: type: string format: date-time description: 'User defined timestamp for when the log was created. ' error: type: string description: Error message if the log is an error. provider_latency: type: number format: double description: Duration of the logged event in seconds. stdout: type: string description: Captured log and debug statements. provider_request: type: object additionalProperties: description: Any type description: Raw request sent to provider. provider_response: type: object additionalProperties: description: Any type description: Raw response received the provider. inputs: type: object additionalProperties: description: Any type description: The inputs passed to the prompt template. source: type: string description: Identifies where the model was called from. metadata: type: object additionalProperties: description: Any type description: Any additional metadata to record. parent_id: type: string description: >- Identifier of the evaluated Log. The newly created Log will have this one set as parent. source_datapoint_id: type: string description: >- Unique identifier for the Datapoint that this Log is derived from. This can be used by Humanloop to associate Logs to Evaluations. If provided, Humanloop will automatically associate this Log to Evaluations that require a Log for this Datapoint-Version pair. trace_parent_id: type: string description: The ID of the parent Log to nest this Log under in a Trace. batches: type: array items: type: string description: >- Array of Batch IDs that this Log is part of. Batches are used to group Logs together for offline Evaluations user: type: string description: End-user ID related to the Log. environment: type: string description: The name of the Environment the Log is associated to. save: type: boolean default: true description: Whether the request/response payloads will be stored on Humanloop. log_id: type: string description: >- This will identify a Log. If you don't provide a Log ID, Humanloop will generate one for you. output_message: $ref: '#/components/schemas/type_:ChatMessage' description: >- The message returned by the LLM. Only populated for LLM Evaluator Logs. judgment: $ref: '#/components/schemas/type_:EvaluatorLogResponseJudgment' description: Evaluator assessment of the Log. marked_completed: type: boolean description: Whether the Log has been manually marked as completed by a user. id: type: string description: Unique identifier for the Log. evaluator_logs: type: array items: $ref: '#/components/schemas/type_:EvaluatorLogResponse' description: >- List of Evaluator Logs associated with the Log. These contain Evaluator judgments on the Log. trace_flow_id: type: string description: Identifier for the Flow that the Trace belongs to. trace_id: type: string description: Identifier for the Trace that the Log belongs to. trace_children: type: array items: $ref: '#/components/schemas/type_:LogResponse' description: Logs nested under this Log in the Trace. evaluator: $ref: '#/components/schemas/type_:EvaluatorResponse' description: Evaluator used to generate the judgment. parent: $ref: '#/components/schemas/type_:LogResponse' description: >- The Log that was evaluated. Only provided if the ?include_parent query parameter is set for the required: - id - evaluator_logs - evaluator description: General request for creating a Log title: EvaluatorLogResponse type_:AgentLogResponse: type: object properties: output_message: $ref: '#/components/schemas/type_:ChatMessage' description: The message returned by the provider. prompt_tokens: type: integer description: Number of tokens in the prompt used to generate the output. reasoning_tokens: type: integer description: Number of reasoning tokens used to generate the output. output_tokens: type: integer description: Number of tokens in the output generated by the model. prompt_cost: type: number format: double description: Cost in dollars associated to the tokens in the prompt. output_cost: type: number format: double description: Cost in dollars associated to the tokens in the output. finish_reason: type: string description: Reason the generation finished. messages: type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: The messages passed to the to provider chat endpoint. tool_choice: $ref: '#/components/schemas/type_:AgentLogResponseToolChoice' description: >- Controls how the model uses tools. The following options are supported: - `'none'` means the model will not call any tool and instead generates a message; this is the default when no tools are provided as part of the Prompt. - `'auto'` means the model can decide to call one or more of the provided tools; this is the default when tools are provided as part of the Prompt. - `'required'` means the model must call one or more of the provided tools. - `{'type': 'function', 'function': {name': }}` forces the model to use the named function. agent: $ref: '#/components/schemas/type_:AgentResponse' description: Agent that generated the Log. start_time: type: string format: date-time description: When the logged event started. end_time: type: string format: date-time description: When the logged event ended. output: type: string description: >- Generated output from your model for the provided inputs. Can be `None` if logging an error, or if creating a parent Log with the intention to populate it later. created_at: type: string format: date-time description: 'User defined timestamp for when the log was created. ' error: type: string description: Error message if the log is an error. provider_latency: type: number format: double description: Duration of the logged event in seconds. stdout: type: string description: Captured log and debug statements. provider_request: type: object additionalProperties: description: Any type description: Raw request sent to provider. provider_response: type: object additionalProperties: description: Any type description: Raw response received the provider. inputs: type: object additionalProperties: description: Any type description: The inputs passed to the prompt template. source: type: string description: Identifies where the model was called from. metadata: type: object additionalProperties: description: Any type description: Any additional metadata to record. source_datapoint_id: type: string description: >- Unique identifier for the Datapoint that this Log is derived from. This can be used by Humanloop to associate Logs to Evaluations. If provided, Humanloop will automatically associate this Log to Evaluations that require a Log for this Datapoint-Version pair. trace_parent_id: type: string description: The ID of the parent Log to nest this Log under in a Trace. batches: type: array items: type: string description: >- Array of Batch IDs that this Log is part of. Batches are used to group Logs together for offline Evaluations user: type: string description: End-user ID related to the Log. environment: type: string description: The name of the Environment the Log is associated to. save: type: boolean default: true description: Whether the request/response payloads will be stored on Humanloop. log_id: type: string description: >- This will identify a Log. If you don't provide a Log ID, Humanloop will generate one for you. id: type: string description: Unique identifier for the Log. evaluator_logs: type: array items: $ref: '#/components/schemas/type_:EvaluatorLogResponse' description: >- List of Evaluator Logs associated with the Log. These contain Evaluator judgments on the Log. trace_flow_id: type: string description: Identifier for the Flow that the Trace belongs to. trace_id: type: string description: Identifier for the Trace that the Log belongs to. trace_children: type: array items: $ref: '#/components/schemas/type_:LogResponse' description: Logs nested under this Log in the Trace. required: - agent - id - evaluator_logs description: General request for creating a Log title: AgentLogResponse type_:ValidationErrorLocItem: oneOf: - type: string - type: integer title: ValidationErrorLocItem type_:ValidationError: type: object properties: loc: type: array items: $ref: '#/components/schemas/type_:ValidationErrorLocItem' msg: type: string type: type: string required: - loc - msg - type title: ValidationError type_:HttpValidationError: type: object properties: detail: type: array items: $ref: '#/components/schemas/type_:ValidationError' title: HttpValidationError securitySchemes: default: type: apiKey in: header name: X-API-KEY ``` ## SDK Code Examples ```python Patch Agent Log import requests url = "https://api.humanloop.com/v5/agents/ag_1234567890/log/log_1234567890" payload = { "messages": [ { "role": "user", "content": "I need to withdraw $1000" }, { "role": "assistant", "content": "Of course! Would you like to use your savings or checking account?" } ], "output_message": { "role": "assistant", "content": "I'm sorry, I can't help with that." }, "log_status": "complete" } headers = { "X-API-KEY": " ", "Content-Type": "application/json" } response = requests.patch(url, json=payload, headers=headers) print(response.json()) ``` ```typescript Patch Agent Log import { HumanloopClient } from "humanloop"; const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); await client.agents.updateLog("ag_1234567890", "log_1234567890", { messages: [{ role: "user", content: "I need to withdraw $1000" }, { role: "assistant", content: "Of course! Would you like to use your savings or checking account?" }], outputMessage: { role: "assistant", content: "I'm sorry, I can't help with that." }, logStatus: "complete" }); ``` ```go Patch Agent Log package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/agents/ag_1234567890/log/log_1234567890" payload := strings.NewReader("{\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"I need to withdraw $1000\"\n },\n {\n \"role\": \"assistant\",\n \"content\": \"Of course! Would you like to use your savings or checking account?\"\n }\n ],\n \"output_message\": {\n \"role\": \"assistant\",\n \"content\": \"I'm sorry, I can't help with that.\"\n },\n \"log_status\": \"complete\"\n}") req, _ := http.NewRequest("PATCH", url, payload) req.Header.Add("X-API-KEY", " ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Patch Agent Log require 'uri' require 'net/http' url = URI("https://api.humanloop.com/v5/agents/ag_1234567890/log/log_1234567890") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Patch.new(url) request["X-API-KEY"] = ' ' request["Content-Type"] = 'application/json' request.body = "{\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"I need to withdraw $1000\"\n },\n {\n \"role\": \"assistant\",\n \"content\": \"Of course! Would you like to use your savings or checking account?\"\n }\n ],\n \"output_message\": {\n \"role\": \"assistant\",\n \"content\": \"I'm sorry, I can't help with that.\"\n },\n \"log_status\": \"complete\"\n}" response = http.request(request) puts response.read_body ``` ```java Patch Agent Log import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.patch("https://api.humanloop.com/v5/agents/ag_1234567890/log/log_1234567890") .header("X-API-KEY", " ") .header("Content-Type", "application/json") .body("{\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"I need to withdraw $1000\"\n },\n {\n \"role\": \"assistant\",\n \"content\": \"Of course! Would you like to use your savings or checking account?\"\n }\n ],\n \"output_message\": {\n \"role\": \"assistant\",\n \"content\": \"I'm sorry, I can't help with that.\"\n },\n \"log_status\": \"complete\"\n}") .asString(); ``` ```php Patch Agent Log request('PATCH', 'https://api.humanloop.com/v5/agents/ag_1234567890/log/log_1234567890', [ 'body' => '{ "messages": [ { "role": "user", "content": "I need to withdraw $1000" }, { "role": "assistant", "content": "Of course! Would you like to use your savings or checking account?" } ], "output_message": { "role": "assistant", "content": "I\'m sorry, I can\'t help with that." }, "log_status": "complete" }', 'headers' => [ 'Content-Type' => 'application/json', 'X-API-KEY' => ' ', ], ]); echo $response->getBody(); ``` ```csharp Patch Agent Log using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/agents/ag_1234567890/log/log_1234567890"); var request = new RestRequest(Method.PATCH); request.AddHeader("X-API-KEY", " "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"I need to withdraw $1000\"\n },\n {\n \"role\": \"assistant\",\n \"content\": \"Of course! Would you like to use your savings or checking account?\"\n }\n ],\n \"output_message\": {\n \"role\": \"assistant\",\n \"content\": \"I'm sorry, I can't help with that.\"\n },\n \"log_status\": \"complete\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Patch Agent Log import Foundation let headers = [ "X-API-KEY": " ", "Content-Type": "application/json" ] let parameters = [ "messages": [ [ "role": "user", "content": "I need to withdraw $1000" ], [ "role": "assistant", "content": "Of course! Would you like to use your savings or checking account?" ] ], "output_message": [ "role": "assistant", "content": "I'm sorry, I can't help with that." ], "log_status": "complete" ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/agents/ag_1234567890/log/log_1234567890")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "PATCH" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. # Call Agent POST https://api.humanloop.com/v5/agents/call Content-Type: application/json Call an Agent. The Agent will run on the Humanloop runtime and return a completed Agent Log. If the Agent requires a tool call that cannot be ran by Humanloop, execution will halt. To continue, pass the ID of the incomplete Log and the required tool call to the /agents/continue endpoint. The agent will run for the maximum number of iterations, or until it encounters a stop condition, according to its configuration. You can use query parameters `version_id`, or `environment`, to target an existing version of the Agent. Otherwise the default deployed version will be chosen. Instead of targeting an existing version explicitly, you can instead pass in Agent details in the request body. A new version is created if it does not match any existing ones. This is helpful in the case where you are storing or deriving your Agent details in code. Reference: https://humanloop.com/docs/api/agents/call ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /agents/call: post: operationId: call summary: Call Agent description: >- Call an Agent. The Agent will run on the Humanloop runtime and return a completed Agent Log. If the Agent requires a tool call that cannot be ran by Humanloop, execution will halt. To continue, pass the ID of the incomplete Log and the required tool call to the /agents/continue endpoint. The agent will run for the maximum number of iterations, or until it encounters a stop condition, according to its configuration. You can use query parameters `version_id`, or `environment`, to target an existing version of the Agent. Otherwise the default deployed version will be chosen. Instead of targeting an existing version explicitly, you can instead pass in Agent details in the request body. A new version is created if it does not match any existing ones. This is helpful in the case where you are storing or deriving your Agent details in code. tags: - subpackage_agents parameters: - name: version_id in: query description: A specific Version ID of the Agent to log to. required: false schema: type: string - name: environment in: query description: Name of the Environment identifying a deployed version to log to. required: false schema: type: string - name: X-API-KEY in: header required: true schema: type: string responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/type_:AgentCallResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/type_:HttpValidationError' requestBody: content: application/json: schema: type: object properties: path: type: string description: >- Path of the Agent, including the name. This locates the Agent in the Humanloop filesystem and is used as as a unique identifier. For example: `folder/name` or just `name`. id: type: string description: ID for an existing Agent. messages: type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: The messages passed to the to provider chat endpoint. tool_choice: $ref: '#/components/schemas/type_agents:AgentsCallRequestToolChoice' description: >- Controls how the model uses tools. The following options are supported: - `'none'` means the model will not call any tool and instead generates a message; this is the default when no tools are provided as part of the Prompt. - `'auto'` means the model can decide to call one or more of the provided tools; this is the default when tools are provided as part of the Prompt. - `'required'` means the model must call one or more of the provided tools. - `{'type': 'function', 'function': {name': }}` forces the model to use the named function. agent: $ref: '#/components/schemas/type_agents:AgentsCallRequestAgent' description: >- The Agent configuration to use. Two formats are supported: - An object representing the details of the Agent configuration - A string representing the raw contents of a .agent file A new Agent version will be created if the provided details do not match any existing version. inputs: type: object additionalProperties: description: Any type description: The inputs passed to the prompt template. source: type: string description: Identifies where the model was called from. metadata: type: object additionalProperties: description: Any type description: Any additional metadata to record. start_time: type: string format: date-time description: When the logged event started. end_time: type: string format: date-time description: When the logged event ended. source_datapoint_id: type: string description: >- Unique identifier for the Datapoint that this Log is derived from. This can be used by Humanloop to associate Logs to Evaluations. If provided, Humanloop will automatically associate this Log to Evaluations that require a Log for this Datapoint-Version pair. trace_parent_id: type: string description: The ID of the parent Log to nest this Log under in a Trace. user: type: string description: End-user ID related to the Log. environment: type: string description: The name of the Environment the Log is associated to. save: type: boolean default: true description: >- Whether the request/response payloads will be stored on Humanloop. log_id: type: string description: >- This will identify a Log. If you don't provide a Log ID, Humanloop will generate one for you. provider_api_keys: $ref: '#/components/schemas/type_:ProviderApiKeys' description: >- API keys required by each provider to make API calls. The API keys provided here are not stored by Humanloop. If not specified here, Humanloop will fall back to the key saved to your organization. stream: type: boolean enum: - false description: >- If true, Agent events and tokens will be sent as data-only server-sent events. return_inputs: type: boolean default: true description: >- Whether to return the inputs in the response. If false, the response will contain an empty dictionary under inputs. This is useful for reducing the size of the response. Defaults to true. include_trace_children: type: boolean default: false description: >- If true, populate `trace_children` for the returned Agent Log. Only applies when not streaming. Defaults to false. required: - stream servers: - url: https://api.humanloop.com/v5 components: schemas: type_:TextChatContent: type: object properties: type: type: string enum: - text text: type: string description: The message's text content. required: - type - text title: TextChatContent type_:ImageUrlDetail: type: string enum: - high - low - auto description: >- Specify the detail level of the image provided to the model. For more details see: https://platform.openai.com/docs/guides/vision/low-or-high-fidelity-image-understanding title: ImageUrlDetail type_:ImageUrl: type: object properties: url: type: string description: Either a URL of the image or the base64 encoded image data. detail: $ref: '#/components/schemas/type_:ImageUrlDetail' description: >- Specify the detail level of the image provided to the model. For more details see: https://platform.openai.com/docs/guides/vision/low-or-high-fidelity-image-understanding required: - url title: ImageUrl type_:ImageChatContent: type: object properties: type: type: string enum: - image_url image_url: $ref: '#/components/schemas/type_:ImageUrl' description: The message's image content. required: - type - image_url title: ImageChatContent type_:ChatMessageContentItem: oneOf: - $ref: '#/components/schemas/type_:TextChatContent' - $ref: '#/components/schemas/type_:ImageChatContent' title: ChatMessageContentItem type_:ChatMessageContent: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessageContentItem' description: The content of the message. title: ChatMessageContent type_:ChatRole: type: string enum: - user - assistant - system - tool - developer description: An enumeration. title: ChatRole type_:ChatToolType: type: string enum: - function description: The type of tool to call. title: ChatToolType type_:FunctionTool: type: object properties: name: type: string arguments: type: string required: - name description: A function tool to be called by the model where user owns runtime. title: FunctionTool type_:ToolCall: type: object properties: id: type: string type: $ref: '#/components/schemas/type_:ChatToolType' function: $ref: '#/components/schemas/type_:FunctionTool' required: - id - type - function description: A tool call to be made. title: ToolCall type_:AnthropicThinkingContent: type: object properties: type: type: string enum: - thinking thinking: type: string description: Model's chain-of-thought for providing the response. signature: type: string description: >- Cryptographic signature that verifies the thinking block was generated by Anthropic. required: - type - thinking - signature title: AnthropicThinkingContent type_:AnthropicRedactedThinkingContent: type: object properties: type: type: string enum: - redacted_thinking data: type: string description: >- Thinking block Anthropic redacted for safety reasons. User is expected to pass the block back to Anthropic required: - type - data title: AnthropicRedactedThinkingContent type_:ChatMessageThinkingItem: oneOf: - $ref: '#/components/schemas/type_:AnthropicThinkingContent' - $ref: '#/components/schemas/type_:AnthropicRedactedThinkingContent' title: ChatMessageThinkingItem type_:ChatMessage: type: object properties: content: $ref: '#/components/schemas/type_:ChatMessageContent' description: The content of the message. name: type: string description: Optional name of the message author. tool_call_id: type: string description: Tool call that this message is responding to. role: $ref: '#/components/schemas/type_:ChatRole' description: Role of the message author. tool_calls: type: array items: $ref: '#/components/schemas/type_:ToolCall' description: A list of tool calls requested by the assistant. thinking: type: array items: $ref: '#/components/schemas/type_:ChatMessageThinkingItem' description: >- Model's chain-of-thought for providing the response. Present on assistant messages if model supports it. required: - role title: ChatMessage type_:FunctionToolChoice: type: object properties: name: type: string required: - name description: A function tool to be called by the model where user owns runtime. title: FunctionToolChoice type_:ToolChoice: type: object properties: type: $ref: '#/components/schemas/type_:ChatToolType' function: $ref: '#/components/schemas/type_:FunctionToolChoice' required: - type - function description: Tool choice to force the model to use a tool. title: ToolChoice type_agents:AgentsCallRequestToolChoice: oneOf: - type: string enum: - none - type: string enum: - auto - type: string enum: - required - $ref: '#/components/schemas/type_:ToolChoice' description: >- Controls how the model uses tools. The following options are supported: - `'none'` means the model will not call any tool and instead generates a message; this is the default when no tools are provided as part of the Prompt. - `'auto'` means the model can decide to call one or more of the provided tools; this is the default when tools are provided as part of the Prompt. - `'required'` means the model must call one or more of the provided tools. - `{'type': 'function', 'function': {name': }}` forces the model to use the named function. title: AgentsCallRequestToolChoice type_:ModelEndpoints: type: string enum: - complete - chat - edit description: Supported model provider endpoints. title: ModelEndpoints type_:AgentKernelRequestTemplate: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: >- 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}}`. title: AgentKernelRequestTemplate type_:TemplateLanguage: type: string enum: - default - jinja description: Template engine to use for rendering templates. title: TemplateLanguage type_:ModelProviders: type: string enum: - anthropic - bedrock - cohere - deepseek - google - groq - mock - openai - openai_azure - replicate description: Supported model providers. title: ModelProviders type_:AgentKernelRequestStop: oneOf: - type: string - type: array items: type: string description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. title: AgentKernelRequestStop type_:ResponseFormatType: type: string enum: - json_object - json_schema title: ResponseFormatType type_:ResponseFormat: type: object properties: type: $ref: '#/components/schemas/type_:ResponseFormatType' json_schema: type: object additionalProperties: description: Any type description: The JSON schema of the response format if type is json_schema. required: - type description: Response format of the model. title: ResponseFormat type_:OpenAiReasoningEffort: type: string enum: - high - medium - low description: Supported reasoning effort. title: OpenAiReasoningEffort type_:AgentKernelRequestReasoningEffort: oneOf: - $ref: '#/components/schemas/type_:OpenAiReasoningEffort' - type: integer description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. title: AgentKernelRequestReasoningEffort type_:LinkedFileRequest: type: object properties: file_id: type: string environment_id: type: string version_id: type: string required: - file_id title: LinkedFileRequest type_:OnAgentCallEnum: type: string enum: - stop - continue description: What an Agent should do when calling a Tool. title: OnAgentCallEnum type_:AgentLinkedFileRequest: type: object properties: type: type: string enum: - file link: $ref: '#/components/schemas/type_:LinkedFileRequest' on_agent_call: $ref: '#/components/schemas/type_:OnAgentCallEnum' required: - type - link title: AgentLinkedFileRequest type_:ToolFunction: type: object properties: name: type: string description: Name for the tool referenced by the model. description: type: string description: Description of the tool referenced by the model strict: type: boolean default: false description: >- If true, forces the model to output json data in the structure of the parameters schema. parameters: type: object additionalProperties: description: Any type description: >- Parameters needed to run the Tool, defined in JSON Schema format: https://json-schema.org/ required: - name - description title: ToolFunction type_:AgentInlineTool: type: object properties: type: type: string enum: - inline json_schema: $ref: '#/components/schemas/type_:ToolFunction' on_agent_call: $ref: '#/components/schemas/type_:OnAgentCallEnum' required: - type - json_schema title: AgentInlineTool type_:AgentKernelRequestToolsItem: oneOf: - $ref: '#/components/schemas/type_:AgentLinkedFileRequest' - $ref: '#/components/schemas/type_:AgentInlineTool' title: AgentKernelRequestToolsItem type_:AgentKernelRequest: type: object properties: model: type: string description: >- The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models) endpoint: $ref: '#/components/schemas/type_:ModelEndpoints' description: The provider model endpoint used. template: $ref: '#/components/schemas/type_:AgentKernelRequestTemplate' description: >- 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}}`. template_language: $ref: '#/components/schemas/type_:TemplateLanguage' description: The template language to use for rendering the template. provider: $ref: '#/components/schemas/type_:ModelProviders' description: The company providing the underlying model service. max_tokens: type: integer default: -1 description: >- 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 temperature: type: number format: double default: 1 description: >- What sampling temperature to use when making a generation. Higher values means the model will be more creative. top_p: type: number format: double default: 1 description: >- An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. stop: $ref: '#/components/schemas/type_:AgentKernelRequestStop' description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. presence_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far. frequency_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far. other: type: object additionalProperties: description: Any type description: Other parameter values to be passed to the provider call. seed: type: integer description: >- If specified, model will make a best effort to sample deterministically, but it is not guaranteed. response_format: $ref: '#/components/schemas/type_:ResponseFormat' description: >- The format of the response. Only `{"type": "json_object"}` is currently supported for chat. reasoning_effort: $ref: '#/components/schemas/type_:AgentKernelRequestReasoningEffort' description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. tools: type: array items: $ref: '#/components/schemas/type_:AgentKernelRequestToolsItem' attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used. max_iterations: type: integer description: >- The maximum number of iterations the Agent can run. This is used to limit the number of times the Agent model is called. required: - model description: |- Base class used by both PromptKernelRequest and AgentKernelRequest. Contains the consistent Prompt-related fields. title: AgentKernelRequest type_agents:AgentsCallRequestAgent: oneOf: - $ref: '#/components/schemas/type_:AgentKernelRequest' - type: string description: >- The Agent configuration to use. Two formats are supported: - An object representing the details of the Agent configuration - A string representing the raw contents of a .agent file A new Agent version will be created if the provided details do not match any existing version. title: AgentsCallRequestAgent type_:ProviderApiKeys: type: object properties: openai: type: string mock: type: string anthropic: type: string deepseek: type: string bedrock: type: string cohere: type: string openai_azure: type: string openai_azure_endpoint: type: string google: type: string title: ProviderApiKeys type_:AgentCallResponseToolChoice: oneOf: - type: string enum: - none - type: string enum: - auto - type: string enum: - required - $ref: '#/components/schemas/type_:ToolChoice' description: >- Controls how the model uses tools. The following options are supported: - `'none'` means the model will not call any tool and instead generates a message; this is the default when no tools are provided as part of the Prompt. - `'auto'` means the model can decide to call one or more of the provided tools; this is the default when tools are provided as part of the Prompt. - `'required'` means the model must call one or more of the provided tools. - `{'type': 'function', 'function': {name': }}` forces the model to use the named function. title: AgentCallResponseToolChoice type_:AgentResponseTemplate: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: >- 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}}`. title: AgentResponseTemplate type_:AgentResponseStop: oneOf: - type: string - type: array items: type: string description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. title: AgentResponseStop type_:AgentResponseReasoningEffort: oneOf: - $ref: '#/components/schemas/type_:OpenAiReasoningEffort' - type: integer description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. title: AgentResponseReasoningEffort type_:PromptResponseTemplate: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: >- 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}}`. title: PromptResponseTemplate type_:PromptResponseStop: oneOf: - type: string - type: array items: type: string description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. title: PromptResponseStop type_:PromptResponseReasoningEffort: oneOf: - $ref: '#/components/schemas/type_:OpenAiReasoningEffort' - type: integer description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. title: PromptResponseReasoningEffort type_:LinkedToolResponse: type: object properties: name: type: string description: Name for the tool referenced by the model. description: type: string description: Description of the tool referenced by the model strict: type: boolean default: false description: >- If true, forces the model to output json data in the structure of the parameters schema. parameters: type: object additionalProperties: description: Any type description: >- Parameters needed to run the Tool, defined in JSON Schema format: https://json-schema.org/ id: type: string description: Unique identifier for the Tool linked. version_id: type: string description: Unique identifier for the Tool Version linked. required: - name - description - id - version_id title: LinkedToolResponse type_:EnvironmentTag: type: string enum: - default - other description: An enumeration. title: EnvironmentTag type_:EnvironmentResponse: type: object properties: id: type: string created_at: type: string format: date-time name: type: string tag: $ref: '#/components/schemas/type_:EnvironmentTag' required: - id - created_at - name - tag title: EnvironmentResponse type_:UserResponse: description: Any type title: UserResponse type_:InputResponse: type: object properties: name: type: string description: Type of input. required: - name title: InputResponse type_:FilesToolType: type: string enum: - pinecone_search - google - mock - snippet - json_schema - get_api_call - python description: Type of tool. title: FilesToolType type_:EvaluatorAggregate: type: object properties: value: type: number format: double description: The aggregated value of the evaluator. evaluator_id: type: string description: ID of the evaluator. evaluator_version_id: type: string description: ID of the evaluator version. created_at: type: string format: date-time updated_at: type: string format: date-time required: - value - evaluator_id - evaluator_version_id - created_at - updated_at title: EvaluatorAggregate type_:ToolResponse: type: object properties: path: type: string description: >- Path of the Tool, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Tool. directory_id: type: string description: ID of the directory that the file is in on Humanloop. function: $ref: '#/components/schemas/type_:ToolFunction' description: >- Callable function specification of the Tool shown to the model for tool calling. source_code: type: string description: Code source of the Tool. setup_values: type: object additionalProperties: description: Any type description: >- Values needed to setup the Tool, defined in JSON Schema format: https://json-schema.org/ attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Tool. Helpful to separate Tool versions from each other with details on how they were created or used. tool_type: $ref: '#/components/schemas/type_:FilesToolType' description: Type of Tool. version_name: type: string description: >- Unique identifier for this Tool version. Each Tool can only have one version with a given name. version_description: type: string description: Description of the Version. name: type: string description: Name of the Tool, which is used as a unique identifier. description: type: string description: Description of the Tool. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Tool Version. If no query params provided, the default deployed Tool Version is returned. type: type: string enum: - tool environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Tool Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Tool. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Tool Version total_logs_count: type: integer description: The number of logs that have been generated across all Tool Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Prompt. Inputs correspond to any of the variables used within the Tool template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Tool that are used for monitoring logs. signature: type: string description: Signature of the Tool. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Tool Version. required: - path - id - name - version_id - created_at - updated_at - last_used_at - version_logs_count - total_logs_count - inputs description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: ToolResponse type_:DatapointResponseTargetValue: oneOf: - type: string - type: integer - type: number format: double - type: boolean - type: array items: description: Any type - type: object additionalProperties: description: Any type title: DatapointResponseTargetValue type_:DatapointResponse: type: object properties: inputs: type: object additionalProperties: type: string description: The inputs to the prompt template. messages: type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: List of chat messages to provide to the model. target: type: object additionalProperties: $ref: '#/components/schemas/type_:DatapointResponseTargetValue' description: >- Object with criteria necessary to evaluate generations with this Datapoint. This is passed in as an argument to Evaluators when used in an Evaluation. id: type: string description: Unique identifier for the Datapoint. Starts with `dp_`. required: - id title: DatapointResponse type_:DatasetResponse: type: object properties: path: type: string description: >- Path of the Dataset, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Dataset. Starts with `ds_`. directory_id: type: string description: ID of the directory that the file is in on Humanloop. name: type: string description: Name of the Dataset, which is used as a unique identifier. description: type: string description: Description of the Dataset. schema: type: object additionalProperties: description: Any type description: The JSON schema for the File. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Dataset Version. If no query params provided, the default deployed Dataset Version is returned. Starts with `dsv_`. type: type: string enum: - dataset environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Dataset Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Dataset. last_used_at: type: string format: date-time version_name: type: string description: >- Unique name for the Dataset version. Version names must be unique for a given Dataset. version_description: type: string description: Description of the version, e.g., the changes made in this version. datapoints_count: type: integer description: The number of Datapoints in this Dataset version. datapoints: type: array items: $ref: '#/components/schemas/type_:DatapointResponse' description: >- The list of Datapoints in this Dataset version. Only provided if explicitly requested. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Dataset. Helpful to separate Dataset versions from each other with details on how they were created or used. required: - path - id - name - version_id - created_at - updated_at - last_used_at - datapoints_count description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: DatasetResponse type_:EvaluatorArgumentsType: type: string enum: - target_free - target_required description: Enum representing the possible argument types of an evaluator. title: EvaluatorArgumentsType type_:EvaluatorReturnTypeEnum: type: string enum: - boolean - number - select - multi_select - text description: Enum representing the possible return types of an evaluator. title: EvaluatorReturnTypeEnum type_:Valence: type: string enum: - positive - negative - neutral description: An enumeration. title: Valence type_:EvaluatorJudgmentOptionResponse: type: object properties: name: type: string description: The name of the option. valence: $ref: '#/components/schemas/type_:Valence' description: Whether this option should be considered positive or negative. required: - name title: EvaluatorJudgmentOptionResponse type_:EvaluatorJudgmentNumberLimit: type: object properties: min: type: number format: double description: The minimum value that can be selected. max: type: number format: double description: The maximum value that can be selected. step: type: number format: double description: The step size for the number input. title: EvaluatorJudgmentNumberLimit type_:PromptKernelRequestTemplate: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: >- 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}}`. title: PromptKernelRequestTemplate type_:PromptKernelRequestStop: oneOf: - type: string - type: array items: type: string description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. title: PromptKernelRequestStop type_:PromptKernelRequestReasoningEffort: oneOf: - $ref: '#/components/schemas/type_:OpenAiReasoningEffort' - type: integer description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. title: PromptKernelRequestReasoningEffort type_:PromptKernelRequest: type: object properties: model: type: string description: >- The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models) endpoint: $ref: '#/components/schemas/type_:ModelEndpoints' description: The provider model endpoint used. template: $ref: '#/components/schemas/type_:PromptKernelRequestTemplate' description: >- 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}}`. template_language: $ref: '#/components/schemas/type_:TemplateLanguage' description: The template language to use for rendering the template. provider: $ref: '#/components/schemas/type_:ModelProviders' description: The company providing the underlying model service. max_tokens: type: integer default: -1 description: >- 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 temperature: type: number format: double default: 1 description: >- What sampling temperature to use when making a generation. Higher values means the model will be more creative. top_p: type: number format: double default: 1 description: >- An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. stop: $ref: '#/components/schemas/type_:PromptKernelRequestStop' description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. presence_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far. frequency_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far. other: type: object additionalProperties: description: Any type description: Other parameter values to be passed to the provider call. seed: type: integer description: >- If specified, model will make a best effort to sample deterministically, but it is not guaranteed. response_format: $ref: '#/components/schemas/type_:ResponseFormat' description: >- The format of the response. Only `{"type": "json_object"}` is currently supported for chat. reasoning_effort: $ref: '#/components/schemas/type_:PromptKernelRequestReasoningEffort' description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. tools: type: array items: $ref: '#/components/schemas/type_:ToolFunction' description: >- The tool specification that the model can choose to call if Tool calling is supported. linked_tools: type: array items: type: string description: >- 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. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used. required: - model description: |- Base class used by both PromptKernelRequest and AgentKernelRequest. Contains the consistent Prompt-related fields. title: PromptKernelRequest type_:LlmEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:EvaluatorReturnTypeEnum' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: >- The options that can be applied as judgments. Only for Evaluators with `return_type` of 'boolean', 'select' or 'multi_select'. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - llm prompt: $ref: '#/components/schemas/type_:PromptKernelRequest' description: The prompt parameters used to generate. required: - arguments_type - return_type - evaluator_type title: LlmEvaluatorRequest type_:CodeEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:EvaluatorReturnTypeEnum' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: >- The options that can be applied as judgments. Only for Evaluators with `return_type` of 'boolean', 'select' or 'multi_select'. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - python code: type: string description: >- The code for the Evaluator. This code will be executed in a sandboxed environment. required: - arguments_type - return_type - evaluator_type - code title: CodeEvaluatorRequest type_:HumanEvaluatorRequestReturnType: type: string enum: - select - multi_select - text - number - boolean description: The type of the return value of the Evaluator. title: HumanEvaluatorRequestReturnType type_:HumanEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:HumanEvaluatorRequestReturnType' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: The options that can be applied as judgments. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - human instructions: type: string description: Instructions and guidelines for applying judgments. required: - arguments_type - return_type - evaluator_type title: HumanEvaluatorRequest type_:ExternalEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:EvaluatorReturnTypeEnum' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: >- The options that can be applied as judgments. Only for Evaluators with `return_type` of 'boolean', 'select' or 'multi_select'. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - external required: - arguments_type - return_type - evaluator_type title: ExternalEvaluatorRequest type_:EvaluatorResponseSpec: oneOf: - $ref: '#/components/schemas/type_:LlmEvaluatorRequest' - $ref: '#/components/schemas/type_:CodeEvaluatorRequest' - $ref: '#/components/schemas/type_:HumanEvaluatorRequest' - $ref: '#/components/schemas/type_:ExternalEvaluatorRequest' title: EvaluatorResponseSpec type_:EvaluatorResponse: type: object properties: path: type: string description: >- Path of the Evaluator including the Evaluator name, which is used as a unique identifier. id: type: string description: Unique identifier for the Evaluator. directory_id: type: string description: ID of the directory that the file is in on Humanloop. version_name: type: string description: >- Unique name for the Evaluator version. Version names must be unique for a given Evaluator. version_description: type: string description: Description of the version, e.g., the changes made in this version. spec: $ref: '#/components/schemas/type_:EvaluatorResponseSpec' name: type: string description: Name of the Evaluator, which is used as a unique identifier. description: type: string description: Description of the Evaluator. schema: type: object additionalProperties: description: Any type description: The JSON schema for the File. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Evaluator Version. If no query params provided, the default deployed Evaluator Version is returned. type: type: string enum: - evaluator environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Evaluator Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Evaluator. last_used_at: type: string format: date-time version_logs_count: type: integer description: >- The number of logs that have been generated for this Evaluator Version total_logs_count: type: integer description: >- The number of logs that have been generated across all Evaluator Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Evaluator. Inputs correspond to any of the variables used within the Evaluator template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Evaluator that are used for monitoring logs. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Evaluator Version. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. required: - path - id - spec - name - version_id - created_at - updated_at - last_used_at - version_logs_count - total_logs_count - inputs description: Version of the Evaluator used to provide judgments. title: EvaluatorResponse type_:FlowResponse: type: object properties: path: type: string description: >- Path of the Flow, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Flow. directory_id: type: string description: ID of the directory that the file is in on Humanloop. attributes: type: object additionalProperties: description: Any type description: A key-value object identifying the Flow Version. version_name: type: string description: >- Unique name for the Flow version. Version names must be unique for a given Flow. version_description: type: string description: Description of the Version. name: type: string description: Name of the Flow. description: type: string description: Description of the Flow. schema: type: object additionalProperties: description: Any type description: The JSON schema for the File. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Flow Version. If no query params provided, the default deployed Flow Version is returned. type: type: string enum: - flow environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Flow Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Flow. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Flow Version evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Flow Version. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: The list of Monitoring Evaluators associated with the Flow Version. required: - path - id - attributes - name - version_id - created_at - updated_at - last_used_at - version_logs_count description: Response model for a Flow. title: FlowResponse type_:VersionDeploymentResponseFile: oneOf: - $ref: '#/components/schemas/type_:PromptResponse' - $ref: '#/components/schemas/type_:ToolResponse' - $ref: '#/components/schemas/type_:DatasetResponse' - $ref: '#/components/schemas/type_:EvaluatorResponse' - $ref: '#/components/schemas/type_:FlowResponse' - $ref: '#/components/schemas/type_:AgentResponse' description: The File that the deployed Version belongs to. title: VersionDeploymentResponseFile type_:VersionDeploymentResponse: type: object properties: file: $ref: '#/components/schemas/type_:VersionDeploymentResponseFile' description: The File that the deployed Version belongs to. environment: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The Environment that the Version is deployed to. type: type: string enum: - environment required: - file - environment - type description: A variable reference to the Version deployed to an Environment title: VersionDeploymentResponse type_:VersionIdResponseVersion: oneOf: - $ref: '#/components/schemas/type_:PromptResponse' - $ref: '#/components/schemas/type_:ToolResponse' - $ref: '#/components/schemas/type_:DatasetResponse' - $ref: '#/components/schemas/type_:EvaluatorResponse' - $ref: '#/components/schemas/type_:FlowResponse' - $ref: '#/components/schemas/type_:AgentResponse' description: The specific Version being referenced. title: VersionIdResponseVersion type_:VersionIdResponse: type: object properties: version: $ref: '#/components/schemas/type_:VersionIdResponseVersion' description: The specific Version being referenced. type: type: string enum: - version required: - version - type description: A reference to a specific Version by its ID title: VersionIdResponse type_:VersionReferenceResponse: oneOf: - $ref: '#/components/schemas/type_:VersionDeploymentResponse' - $ref: '#/components/schemas/type_:VersionIdResponse' title: VersionReferenceResponse type_:MonitoringEvaluatorState: type: string enum: - active - inactive description: State of an evaluator connected to a file title: MonitoringEvaluatorState type_:MonitoringEvaluatorResponse: type: object properties: version_reference: $ref: '#/components/schemas/type_:VersionReferenceResponse' description: >- The Evaluator Version used for monitoring. This can be a specific Version by ID, or a Version deployed to an Environment. version: $ref: '#/components/schemas/type_:EvaluatorResponse' description: The deployed Version. state: $ref: '#/components/schemas/type_:MonitoringEvaluatorState' description: The state of the Monitoring Evaluator. Either `active` or `inactive` created_at: type: string format: date-time updated_at: type: string format: date-time required: - version_reference - state - created_at - updated_at title: MonitoringEvaluatorResponse type_:PromptResponse: type: object properties: path: type: string description: >- Path of the Prompt, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Prompt. directory_id: type: string description: ID of the directory that the file is in on Humanloop. model: type: string description: >- The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models) endpoint: $ref: '#/components/schemas/type_:ModelEndpoints' description: The provider model endpoint used. template: $ref: '#/components/schemas/type_:PromptResponseTemplate' description: >- 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}}`. template_language: $ref: '#/components/schemas/type_:TemplateLanguage' description: The template language to use for rendering the template. provider: $ref: '#/components/schemas/type_:ModelProviders' description: The company providing the underlying model service. max_tokens: type: integer default: -1 description: >- 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 temperature: type: number format: double default: 1 description: >- What sampling temperature to use when making a generation. Higher values means the model will be more creative. top_p: type: number format: double default: 1 description: >- An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. stop: $ref: '#/components/schemas/type_:PromptResponseStop' description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. presence_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far. frequency_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far. other: type: object additionalProperties: description: Any type description: Other parameter values to be passed to the provider call. seed: type: integer description: >- If specified, model will make a best effort to sample deterministically, but it is not guaranteed. response_format: $ref: '#/components/schemas/type_:ResponseFormat' description: >- The format of the response. Only `{"type": "json_object"}` is currently supported for chat. reasoning_effort: $ref: '#/components/schemas/type_:PromptResponseReasoningEffort' description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. tools: type: array items: $ref: '#/components/schemas/type_:ToolFunction' description: >- The tool specification that the model can choose to call if Tool calling is supported. linked_tools: type: array items: $ref: '#/components/schemas/type_:LinkedToolResponse' description: The tools linked to your prompt that the model can call. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used. version_name: type: string description: >- Unique name for the Prompt version. Version names must be unique for a given Prompt. version_description: type: string description: Description of the version, e.g., the changes made in this version. description: type: string description: Description of the Prompt. tags: type: array items: type: string description: List of tags associated with the file. readme: type: string description: Long description of the file. name: type: string description: Name of the Prompt. schema: type: object additionalProperties: description: Any type description: The JSON schema for the Prompt. version_id: type: string description: >- Unique identifier for the specific Prompt Version. If no query params provided, the default deployed Prompt Version is returned. type: type: string enum: - prompt environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Prompt Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Prompt. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Prompt Version total_logs_count: type: integer description: >- The number of logs that have been generated across all Prompt Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Prompt. Inputs correspond to any of the variables used within the Prompt template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Prompt that are used for monitoring logs. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Prompt Version. raw_file_content: type: string description: The raw content of the Prompt. Corresponds to the .prompt file. required: - path - id - model - name - version_id - created_at - updated_at - last_used_at - version_logs_count - total_logs_count - inputs description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: PromptResponse type_:AgentLinkedFileResponseFile: oneOf: - $ref: '#/components/schemas/type_:PromptResponse' - $ref: '#/components/schemas/type_:ToolResponse' - $ref: '#/components/schemas/type_:DatasetResponse' - $ref: '#/components/schemas/type_:EvaluatorResponse' - $ref: '#/components/schemas/type_:FlowResponse' - $ref: '#/components/schemas/type_:AgentResponse' title: AgentLinkedFileResponseFile type_:AgentLinkedFileResponse: type: object properties: type: type: string enum: - file link: $ref: '#/components/schemas/type_:LinkedFileRequest' on_agent_call: $ref: '#/components/schemas/type_:OnAgentCallEnum' file: $ref: '#/components/schemas/type_:AgentLinkedFileResponseFile' required: - type - link title: AgentLinkedFileResponse type_:AgentResponseToolsItem: oneOf: - $ref: '#/components/schemas/type_:AgentLinkedFileResponse' - $ref: '#/components/schemas/type_:AgentInlineTool' title: AgentResponseToolsItem type_:VersionStatus: type: string enum: - uncommitted - committed - deleted description: An enumeration. title: VersionStatus type_:AgentResponse: type: object properties: path: type: string description: >- Path of the Agent, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Agent. directory_id: type: string description: ID of the directory that the file is in on Humanloop. model: type: string description: >- The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models) endpoint: $ref: '#/components/schemas/type_:ModelEndpoints' description: The provider model endpoint used. template: $ref: '#/components/schemas/type_:AgentResponseTemplate' description: >- 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}}`. template_language: $ref: '#/components/schemas/type_:TemplateLanguage' description: The template language to use for rendering the template. provider: $ref: '#/components/schemas/type_:ModelProviders' description: The company providing the underlying model service. max_tokens: type: integer default: -1 description: >- 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 temperature: type: number format: double default: 1 description: >- What sampling temperature to use when making a generation. Higher values means the model will be more creative. top_p: type: number format: double default: 1 description: >- An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. stop: $ref: '#/components/schemas/type_:AgentResponseStop' description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. presence_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far. frequency_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far. other: type: object additionalProperties: description: Any type description: Other parameter values to be passed to the provider call. seed: type: integer description: >- If specified, model will make a best effort to sample deterministically, but it is not guaranteed. response_format: $ref: '#/components/schemas/type_:ResponseFormat' description: >- The format of the response. Only `{"type": "json_object"}` is currently supported for chat. reasoning_effort: $ref: '#/components/schemas/type_:AgentResponseReasoningEffort' description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. tools: type: array items: $ref: '#/components/schemas/type_:AgentResponseToolsItem' description: >- List of tools that the Agent can call. These can be linked files or inline tools. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used. max_iterations: type: integer description: >- The maximum number of iterations the Agent can run. This is used to limit the number of times the Agent model is called. version_name: type: string description: >- Unique name for the Agent version. Version names must be unique for a given Agent. version_description: type: string description: Description of the version, e.g., the changes made in this version. description: type: string description: Description of the Agent. tags: type: array items: type: string description: List of tags associated with the file. readme: type: string description: Long description of the file. name: type: string description: Name of the Agent. schema: type: object additionalProperties: description: Any type description: The JSON schema for the Prompt. version_id: type: string description: >- Unique identifier for the specific Agent Version. If no query params provided, the default deployed Agent Version is returned. type: type: string enum: - agent environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Agent Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Agent. committed_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who committed the Agent Version. committed_at: type: string format: date-time description: The date and time the Agent Version was committed. status: $ref: '#/components/schemas/type_:VersionStatus' description: The status of the Agent Version. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Agent Version total_logs_count: type: integer description: >- The number of logs that have been generated across all Agent Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Agent. Inputs correspond to any of the variables used within the Agent template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Agent that are used for monitoring logs. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Agent Version. raw_file_content: type: string description: The raw content of the Agent. Corresponds to the .agent file. required: - path - id - model - tools - name - version_id - created_at - updated_at - status - last_used_at - version_logs_count - total_logs_count - inputs description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: AgentResponse type_:LogStatus: type: string enum: - complete - incomplete description: An enumeration. title: LogStatus type_:EvaluatorLogResponseJudgment: oneOf: - type: boolean - type: string - type: array items: type: string - type: number format: double description: Evaluator assessment of the Log. title: EvaluatorLogResponseJudgment type_:PromptLogResponseToolChoice: oneOf: - type: string enum: - none - type: string enum: - auto - type: string enum: - required - $ref: '#/components/schemas/type_:ToolChoice' description: >- Controls how the model uses tools. The following options are supported: - `'none'` means the model will not call any tool and instead generates a message; this is the default when no tools are provided as part of the Prompt. - `'auto'` means the model can decide to call one or more of the provided tools; this is the default when tools are provided as part of the Prompt. - `'required'` means the model must call one or more of the provided tools. - `{'type': 'function', 'function': {name': }}` forces the model to use the named function. title: PromptLogResponseToolChoice type_:PromptLogResponse: type: object properties: output_message: $ref: '#/components/schemas/type_:ChatMessage' description: The message returned by the provider. prompt_tokens: type: integer description: Number of tokens in the prompt used to generate the output. reasoning_tokens: type: integer description: Number of reasoning tokens used to generate the output. output_tokens: type: integer description: Number of tokens in the output generated by the model. prompt_cost: type: number format: double description: Cost in dollars associated to the tokens in the prompt. output_cost: type: number format: double description: Cost in dollars associated to the tokens in the output. finish_reason: type: string description: Reason the generation finished. messages: type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: The messages passed to the to provider chat endpoint. tool_choice: $ref: '#/components/schemas/type_:PromptLogResponseToolChoice' description: >- Controls how the model uses tools. The following options are supported: - `'none'` means the model will not call any tool and instead generates a message; this is the default when no tools are provided as part of the Prompt. - `'auto'` means the model can decide to call one or more of the provided tools; this is the default when tools are provided as part of the Prompt. - `'required'` means the model must call one or more of the provided tools. - `{'type': 'function', 'function': {name': }}` forces the model to use the named function. prompt: $ref: '#/components/schemas/type_:PromptResponse' description: Prompt used to generate the Log. start_time: type: string format: date-time description: When the logged event started. end_time: type: string format: date-time description: When the logged event ended. output: type: string description: >- Generated output from your model for the provided inputs. Can be `None` if logging an error, or if creating a parent Log with the intention to populate it later. created_at: type: string format: date-time description: 'User defined timestamp for when the log was created. ' error: type: string description: Error message if the log is an error. provider_latency: type: number format: double description: Duration of the logged event in seconds. stdout: type: string description: Captured log and debug statements. provider_request: type: object additionalProperties: description: Any type description: Raw request sent to provider. provider_response: type: object additionalProperties: description: Any type description: Raw response received the provider. inputs: type: object additionalProperties: description: Any type description: The inputs passed to the prompt template. source: type: string description: Identifies where the model was called from. metadata: type: object additionalProperties: description: Any type description: Any additional metadata to record. source_datapoint_id: type: string description: >- Unique identifier for the Datapoint that this Log is derived from. This can be used by Humanloop to associate Logs to Evaluations. If provided, Humanloop will automatically associate this Log to Evaluations that require a Log for this Datapoint-Version pair. trace_parent_id: type: string description: The ID of the parent Log to nest this Log under in a Trace. batches: type: array items: type: string description: >- Array of Batch IDs that this Log is part of. Batches are used to group Logs together for offline Evaluations user: type: string description: End-user ID related to the Log. environment: type: string description: The name of the Environment the Log is associated to. save: type: boolean default: true description: Whether the request/response payloads will be stored on Humanloop. log_id: type: string description: >- This will identify a Log. If you don't provide a Log ID, Humanloop will generate one for you. id: type: string description: Unique identifier for the Log. evaluator_logs: type: array items: $ref: '#/components/schemas/type_:EvaluatorLogResponse' description: >- List of Evaluator Logs associated with the Log. These contain Evaluator judgments on the Log. trace_flow_id: type: string description: Identifier for the Flow that the Trace belongs to. trace_id: type: string description: Identifier for the Trace that the Log belongs to. trace_children: type: array items: $ref: '#/components/schemas/type_:LogResponse' description: Logs nested under this Log in the Trace. required: - prompt - id - evaluator_logs description: General request for creating a Log title: PromptLogResponse type_:ToolLogResponse: type: object properties: start_time: type: string format: date-time description: When the logged event started. end_time: type: string format: date-time description: When the logged event ended. output: type: string description: >- Generated output from your model for the provided inputs. Can be `None` if logging an error, or if creating a parent Log with the intention to populate it later. created_at: type: string format: date-time description: 'User defined timestamp for when the log was created. ' error: type: string description: Error message if the log is an error. provider_latency: type: number format: double description: Duration of the logged event in seconds. stdout: type: string description: Captured log and debug statements. provider_request: type: object additionalProperties: description: Any type description: Raw request sent to provider. provider_response: type: object additionalProperties: description: Any type description: Raw response received the provider. inputs: type: object additionalProperties: description: Any type description: The inputs passed to the prompt template. source: type: string description: Identifies where the model was called from. metadata: type: object additionalProperties: description: Any type description: Any additional metadata to record. source_datapoint_id: type: string description: >- Unique identifier for the Datapoint that this Log is derived from. This can be used by Humanloop to associate Logs to Evaluations. If provided, Humanloop will automatically associate this Log to Evaluations that require a Log for this Datapoint-Version pair. trace_parent_id: type: string description: The ID of the parent Log to nest this Log under in a Trace. batches: type: array items: type: string description: >- Array of Batch IDs that this Log is part of. Batches are used to group Logs together for offline Evaluations user: type: string description: End-user ID related to the Log. environment: type: string description: The name of the Environment the Log is associated to. save: type: boolean default: true description: Whether the request/response payloads will be stored on Humanloop. log_id: type: string description: >- This will identify a Log. If you don't provide a Log ID, Humanloop will generate one for you. id: type: string description: Unique identifier for the Log. evaluator_logs: type: array items: $ref: '#/components/schemas/type_:EvaluatorLogResponse' description: >- List of Evaluator Logs associated with the Log. These contain Evaluator judgments on the Log. trace_flow_id: type: string description: Identifier for the Flow that the Trace belongs to. trace_id: type: string description: Identifier for the Trace that the Log belongs to. trace_children: type: array items: $ref: '#/components/schemas/type_:LogResponse' description: Logs nested under this Log in the Trace. tool: $ref: '#/components/schemas/type_:ToolResponse' description: Tool used to generate the Log. output_message: $ref: '#/components/schemas/type_:ChatMessage' description: The message returned by the Tool. required: - id - evaluator_logs - tool description: General request for creating a Log title: ToolLogResponse type_:FlowLogResponse: type: object properties: messages: type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: List of chat messages that were used as an input to the Flow. output_message: $ref: '#/components/schemas/type_:ChatMessage' description: The output message returned by this Flow. start_time: type: string format: date-time description: When the logged event started. end_time: type: string format: date-time description: When the logged event ended. output: type: string description: >- Generated output from your model for the provided inputs. Can be `None` if logging an error, or if creating a parent Log with the intention to populate it later. created_at: type: string format: date-time description: 'User defined timestamp for when the log was created. ' error: type: string description: Error message if the log is an error. provider_latency: type: number format: double description: Duration of the logged event in seconds. stdout: type: string description: Captured log and debug statements. provider_request: type: object additionalProperties: description: Any type description: Raw request sent to provider. provider_response: type: object additionalProperties: description: Any type description: Raw response received the provider. inputs: type: object additionalProperties: description: Any type description: The inputs passed to the Flow Log. source: type: string description: Identifies where the model was called from. metadata: type: object additionalProperties: description: Any type description: Any additional metadata to record. log_status: $ref: '#/components/schemas/type_:LogStatus' description: >- Status of the Flow Log. When a Flow Log is updated to `complete`, no more Logs can be added to it. You cannot update a Flow Log's status from `complete` to `incomplete`. source_datapoint_id: type: string description: >- Unique identifier for the Datapoint that this Log is derived from. This can be used by Humanloop to associate Logs to Evaluations. If provided, Humanloop will automatically associate this Log to Evaluations that require a Log for this Datapoint-Version pair. trace_parent_id: type: string description: The ID of the parent Log to nest this Log under in a Trace. batches: type: array items: type: string description: >- Array of Batch IDs that this Log is part of. Batches are used to group Logs together for offline Evaluations user: type: string description: End-user ID related to the Log. environment: type: string description: The name of the Environment the Log is associated to. save: type: boolean default: true description: Whether the request/response payloads will be stored on Humanloop. log_id: type: string description: >- This will identify a Log. If you don't provide a Log ID, Humanloop will generate one for you. id: type: string description: Unique identifier for the Log. evaluator_logs: type: array items: $ref: '#/components/schemas/type_:EvaluatorLogResponse' description: >- List of Evaluator Logs associated with the Log. These contain Evaluator judgments on the Log. trace_flow_id: type: string description: Identifier for the Flow that the Trace belongs to. trace_id: type: string description: Identifier for the Trace that the Log belongs to. trace_children: type: array items: $ref: '#/components/schemas/type_:LogResponse' description: Logs nested under this Log in the Trace. flow: $ref: '#/components/schemas/type_:FlowResponse' description: Flow used to generate the Log. required: - id - evaluator_logs - flow description: General request for creating a Log title: FlowLogResponse type_:AgentLogResponseToolChoice: oneOf: - type: string enum: - none - type: string enum: - auto - type: string enum: - required - $ref: '#/components/schemas/type_:ToolChoice' description: >- Controls how the model uses tools. The following options are supported: - `'none'` means the model will not call any tool and instead generates a message; this is the default when no tools are provided as part of the Prompt. - `'auto'` means the model can decide to call one or more of the provided tools; this is the default when tools are provided as part of the Prompt. - `'required'` means the model must call one or more of the provided tools. - `{'type': 'function', 'function': {name': }}` forces the model to use the named function. title: AgentLogResponseToolChoice type_:AgentLogResponse: type: object properties: output_message: $ref: '#/components/schemas/type_:ChatMessage' description: The message returned by the provider. prompt_tokens: type: integer description: Number of tokens in the prompt used to generate the output. reasoning_tokens: type: integer description: Number of reasoning tokens used to generate the output. output_tokens: type: integer description: Number of tokens in the output generated by the model. prompt_cost: type: number format: double description: Cost in dollars associated to the tokens in the prompt. output_cost: type: number format: double description: Cost in dollars associated to the tokens in the output. finish_reason: type: string description: Reason the generation finished. messages: type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: The messages passed to the to provider chat endpoint. tool_choice: $ref: '#/components/schemas/type_:AgentLogResponseToolChoice' description: >- Controls how the model uses tools. The following options are supported: - `'none'` means the model will not call any tool and instead generates a message; this is the default when no tools are provided as part of the Prompt. - `'auto'` means the model can decide to call one or more of the provided tools; this is the default when tools are provided as part of the Prompt. - `'required'` means the model must call one or more of the provided tools. - `{'type': 'function', 'function': {name': }}` forces the model to use the named function. agent: $ref: '#/components/schemas/type_:AgentResponse' description: Agent that generated the Log. start_time: type: string format: date-time description: When the logged event started. end_time: type: string format: date-time description: When the logged event ended. output: type: string description: >- Generated output from your model for the provided inputs. Can be `None` if logging an error, or if creating a parent Log with the intention to populate it later. created_at: type: string format: date-time description: 'User defined timestamp for when the log was created. ' error: type: string description: Error message if the log is an error. provider_latency: type: number format: double description: Duration of the logged event in seconds. stdout: type: string description: Captured log and debug statements. provider_request: type: object additionalProperties: description: Any type description: Raw request sent to provider. provider_response: type: object additionalProperties: description: Any type description: Raw response received the provider. inputs: type: object additionalProperties: description: Any type description: The inputs passed to the prompt template. source: type: string description: Identifies where the model was called from. metadata: type: object additionalProperties: description: Any type description: Any additional metadata to record. source_datapoint_id: type: string description: >- Unique identifier for the Datapoint that this Log is derived from. This can be used by Humanloop to associate Logs to Evaluations. If provided, Humanloop will automatically associate this Log to Evaluations that require a Log for this Datapoint-Version pair. trace_parent_id: type: string description: The ID of the parent Log to nest this Log under in a Trace. batches: type: array items: type: string description: >- Array of Batch IDs that this Log is part of. Batches are used to group Logs together for offline Evaluations user: type: string description: End-user ID related to the Log. environment: type: string description: The name of the Environment the Log is associated to. save: type: boolean default: true description: Whether the request/response payloads will be stored on Humanloop. log_id: type: string description: >- This will identify a Log. If you don't provide a Log ID, Humanloop will generate one for you. id: type: string description: Unique identifier for the Log. evaluator_logs: type: array items: $ref: '#/components/schemas/type_:EvaluatorLogResponse' description: >- List of Evaluator Logs associated with the Log. These contain Evaluator judgments on the Log. trace_flow_id: type: string description: Identifier for the Flow that the Trace belongs to. trace_id: type: string description: Identifier for the Trace that the Log belongs to. trace_children: type: array items: $ref: '#/components/schemas/type_:LogResponse' description: Logs nested under this Log in the Trace. required: - agent - id - evaluator_logs description: General request for creating a Log title: AgentLogResponse type_:LogResponse: oneOf: - $ref: '#/components/schemas/type_:PromptLogResponse' - $ref: '#/components/schemas/type_:ToolLogResponse' - $ref: '#/components/schemas/type_:EvaluatorLogResponse' - $ref: '#/components/schemas/type_:FlowLogResponse' - $ref: '#/components/schemas/type_:AgentLogResponse' title: LogResponse type_:EvaluatorLogResponse: type: object properties: start_time: type: string format: date-time description: When the logged event started. end_time: type: string format: date-time description: When the logged event ended. output: type: string description: >- Generated output from your model for the provided inputs. Can be `None` if logging an error, or if creating a parent Log with the intention to populate it later. created_at: type: string format: date-time description: 'User defined timestamp for when the log was created. ' error: type: string description: Error message if the log is an error. provider_latency: type: number format: double description: Duration of the logged event in seconds. stdout: type: string description: Captured log and debug statements. provider_request: type: object additionalProperties: description: Any type description: Raw request sent to provider. provider_response: type: object additionalProperties: description: Any type description: Raw response received the provider. inputs: type: object additionalProperties: description: Any type description: The inputs passed to the prompt template. source: type: string description: Identifies where the model was called from. metadata: type: object additionalProperties: description: Any type description: Any additional metadata to record. parent_id: type: string description: >- Identifier of the evaluated Log. The newly created Log will have this one set as parent. source_datapoint_id: type: string description: >- Unique identifier for the Datapoint that this Log is derived from. This can be used by Humanloop to associate Logs to Evaluations. If provided, Humanloop will automatically associate this Log to Evaluations that require a Log for this Datapoint-Version pair. trace_parent_id: type: string description: The ID of the parent Log to nest this Log under in a Trace. batches: type: array items: type: string description: >- Array of Batch IDs that this Log is part of. Batches are used to group Logs together for offline Evaluations user: type: string description: End-user ID related to the Log. environment: type: string description: The name of the Environment the Log is associated to. save: type: boolean default: true description: Whether the request/response payloads will be stored on Humanloop. log_id: type: string description: >- This will identify a Log. If you don't provide a Log ID, Humanloop will generate one for you. output_message: $ref: '#/components/schemas/type_:ChatMessage' description: >- The message returned by the LLM. Only populated for LLM Evaluator Logs. judgment: $ref: '#/components/schemas/type_:EvaluatorLogResponseJudgment' description: Evaluator assessment of the Log. marked_completed: type: boolean description: Whether the Log has been manually marked as completed by a user. id: type: string description: Unique identifier for the Log. evaluator_logs: type: array items: $ref: '#/components/schemas/type_:EvaluatorLogResponse' description: >- List of Evaluator Logs associated with the Log. These contain Evaluator judgments on the Log. trace_flow_id: type: string description: Identifier for the Flow that the Trace belongs to. trace_id: type: string description: Identifier for the Trace that the Log belongs to. trace_children: type: array items: $ref: '#/components/schemas/type_:LogResponse' description: Logs nested under this Log in the Trace. evaluator: $ref: '#/components/schemas/type_:EvaluatorResponse' description: Evaluator used to generate the judgment. parent: $ref: '#/components/schemas/type_:LogResponse' description: >- The Log that was evaluated. Only provided if the ?include_parent query parameter is set for the required: - id - evaluator_logs - evaluator description: General request for creating a Log title: EvaluatorLogResponse type_:AgentCallResponse: type: object properties: output_message: $ref: '#/components/schemas/type_:ChatMessage' description: The message returned by the provider. prompt_tokens: type: integer description: Number of tokens in the prompt used to generate the output. reasoning_tokens: type: integer description: Number of reasoning tokens used to generate the output. output_tokens: type: integer description: Number of tokens in the output generated by the model. prompt_cost: type: number format: double description: Cost in dollars associated to the tokens in the prompt. output_cost: type: number format: double description: Cost in dollars associated to the tokens in the output. finish_reason: type: string description: Reason the generation finished. messages: type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: The messages passed to the to provider chat endpoint. tool_choice: $ref: '#/components/schemas/type_:AgentCallResponseToolChoice' description: >- Controls how the model uses tools. The following options are supported: - `'none'` means the model will not call any tool and instead generates a message; this is the default when no tools are provided as part of the Prompt. - `'auto'` means the model can decide to call one or more of the provided tools; this is the default when tools are provided as part of the Prompt. - `'required'` means the model must call one or more of the provided tools. - `{'type': 'function', 'function': {name': }}` forces the model to use the named function. agent: $ref: '#/components/schemas/type_:AgentResponse' description: Agent that generated the Log. start_time: type: string format: date-time description: When the logged event started. end_time: type: string format: date-time description: When the logged event ended. output: type: string description: >- Generated output from your model for the provided inputs. Can be `None` if logging an error, or if creating a parent Log with the intention to populate it later. created_at: type: string format: date-time description: 'User defined timestamp for when the log was created. ' error: type: string description: Error message if the log is an error. provider_latency: type: number format: double description: Duration of the logged event in seconds. stdout: type: string description: Captured log and debug statements. provider_request: type: object additionalProperties: description: Any type description: Raw request sent to provider. provider_response: type: object additionalProperties: description: Any type description: Raw response received the provider. inputs: type: object additionalProperties: description: Any type description: The inputs passed to the prompt template. source: type: string description: Identifies where the model was called from. metadata: type: object additionalProperties: description: Any type description: Any additional metadata to record. log_status: $ref: '#/components/schemas/type_:LogStatus' description: >- Status of the Agent Log. If `incomplete`, the Agent turn was suspended due to a tool call and can be continued by calling /agents/continue with responses to the Agent's last message (which should contain tool calls). See the `previous_agent_message` field for easy access to the Agent's last message. source_datapoint_id: type: string description: >- Unique identifier for the Datapoint that this Log is derived from. This can be used by Humanloop to associate Logs to Evaluations. If provided, Humanloop will automatically associate this Log to Evaluations that require a Log for this Datapoint-Version pair. trace_parent_id: type: string description: The ID of the parent Log to nest this Log under in a Trace. batches: type: array items: type: string description: >- Array of Batch IDs that this Log is part of. Batches are used to group Logs together for offline Evaluations user: type: string description: End-user ID related to the Log. environment: type: string description: The name of the Environment the Log is associated to. save: type: boolean default: true description: Whether the request/response payloads will be stored on Humanloop. log_id: type: string description: >- This will identify a Log. If you don't provide a Log ID, Humanloop will generate one for you. id: type: string description: Unique identifier for the Log. evaluator_logs: type: array items: $ref: '#/components/schemas/type_:EvaluatorLogResponse' description: >- List of Evaluator Logs associated with the Log. These contain Evaluator judgments on the Log. trace_flow_id: type: string description: Identifier for the Flow that the Trace belongs to. trace_id: type: string description: Identifier for the Trace that the Log belongs to. trace_children: type: array items: $ref: '#/components/schemas/type_:LogResponse' description: Logs nested under this Log in the Trace. previous_agent_message: $ref: '#/components/schemas/type_:ChatMessage' description: >- The Agent's last message, which should contain tool calls. Only populated if the Log is incomplete due to a suspended Agent turn with tool calls. This is useful for continuing the Agent call by calling /agents/continue. required: - agent - id - evaluator_logs description: Response model for a Agent call. title: AgentCallResponse type_:ValidationErrorLocItem: oneOf: - type: string - type: integer title: ValidationErrorLocItem type_:ValidationError: type: object properties: loc: type: array items: $ref: '#/components/schemas/type_:ValidationErrorLocItem' msg: type: string type: type: string required: - loc - msg - type title: ValidationError type_:HttpValidationError: type: object properties: detail: type: array items: $ref: '#/components/schemas/type_:ValidationError' title: HttpValidationError securitySchemes: default: type: apiKey in: header name: X-API-KEY ``` ## SDK Code Examples ```python Call Agent import requests url = "https://api.humanloop.com/v5/agents/call" payload = { "path": "Banking/Teller Agent", "messages": [ { "role": "user", "content": "I'd like to deposit $1000 to my savings account from my checking account." } ] } headers = { "X-API-KEY": " ", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```typescript Call Agent import { HumanloopClient } from "humanloop"; const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); await client.agents.call({ path: "Banking/Teller Agent", messages: [{ role: "user", content: "I'd like to deposit $1000 to my savings account from my checking account." }] }); ``` ```go Call Agent package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/agents/call" payload := strings.NewReader("{\n \"path\": \"Banking/Teller Agent\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"I'd like to deposit $1000 to my savings account from my checking account.\"\n }\n ]\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("X-API-KEY", " ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Call Agent require 'uri' require 'net/http' url = URI("https://api.humanloop.com/v5/agents/call") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["X-API-KEY"] = ' ' request["Content-Type"] = 'application/json' request.body = "{\n \"path\": \"Banking/Teller Agent\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"I'd like to deposit $1000 to my savings account from my checking account.\"\n }\n ]\n}" response = http.request(request) puts response.read_body ``` ```java Call Agent import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.humanloop.com/v5/agents/call") .header("X-API-KEY", " ") .header("Content-Type", "application/json") .body("{\n \"path\": \"Banking/Teller Agent\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"I'd like to deposit $1000 to my savings account from my checking account.\"\n }\n ]\n}") .asString(); ``` ```php Call Agent request('POST', 'https://api.humanloop.com/v5/agents/call', [ 'body' => '{ "path": "Banking/Teller Agent", "messages": [ { "role": "user", "content": "I\'d like to deposit $1000 to my savings account from my checking account." } ] }', 'headers' => [ 'Content-Type' => 'application/json', 'X-API-KEY' => ' ', ], ]); echo $response->getBody(); ``` ```csharp Call Agent using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/agents/call"); var request = new RestRequest(Method.POST); request.AddHeader("X-API-KEY", " "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"path\": \"Banking/Teller Agent\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"I'd like to deposit $1000 to my savings account from my checking account.\"\n }\n ]\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Call Agent import Foundation let headers = [ "X-API-KEY": " ", "Content-Type": "application/json" ] let parameters = [ "path": "Banking/Teller Agent", "messages": [ [ "role": "user", "content": "I'd like to deposit $1000 to my savings account from my checking account." ] ] ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/agents/call")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. # Continue Agent Call POST https://api.humanloop.com/v5/agents/continue Content-Type: application/json Continue an incomplete Agent call. This endpoint allows continuing an existing incomplete Agent call, by passing the tool call requested by the Agent. The Agent will resume processing from where it left off. The messages in the request will be appended to the original messages in the Log. You do not have to provide the previous conversation history. The original log must be in an incomplete state to be continued. Reference: https://humanloop.com/docs/api/agents/continue-call ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /agents/continue: post: operationId: continue-call summary: Continue Agent Call description: >- Continue an incomplete Agent call. This endpoint allows continuing an existing incomplete Agent call, by passing the tool call requested by the Agent. The Agent will resume processing from where it left off. The messages in the request will be appended to the original messages in the Log. You do not have to provide the previous conversation history. The original log must be in an incomplete state to be continued. tags: - subpackage_agents parameters: - name: X-API-KEY in: header required: true schema: type: string responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/type_:AgentContinueCallResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/type_:HttpValidationError' requestBody: content: application/json: schema: type: object properties: log_id: type: string description: This identifies the Agent Log to continue. messages: type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: >- The additional messages with which to continue the Agent Log. Often, these should start with the Tool messages with results for the previous Assistant message's tool calls. provider_api_keys: $ref: '#/components/schemas/type_:ProviderApiKeys' description: >- API keys required by each provider to make API calls. The API keys provided here are not stored by Humanloop. If not specified here, Humanloop will fall back to the key saved to your organization. stream: type: boolean enum: - false description: >- If true, packets will be sent as data-only server-sent events. include_trace_children: type: boolean default: false description: >- If true, populate `trace_children` for the returned Agent Log. Defaults to false. required: - log_id - messages - stream servers: - url: https://api.humanloop.com/v5 components: schemas: type_:TextChatContent: type: object properties: type: type: string enum: - text text: type: string description: The message's text content. required: - type - text title: TextChatContent type_:ImageUrlDetail: type: string enum: - high - low - auto description: >- Specify the detail level of the image provided to the model. For more details see: https://platform.openai.com/docs/guides/vision/low-or-high-fidelity-image-understanding title: ImageUrlDetail type_:ImageUrl: type: object properties: url: type: string description: Either a URL of the image or the base64 encoded image data. detail: $ref: '#/components/schemas/type_:ImageUrlDetail' description: >- Specify the detail level of the image provided to the model. For more details see: https://platform.openai.com/docs/guides/vision/low-or-high-fidelity-image-understanding required: - url title: ImageUrl type_:ImageChatContent: type: object properties: type: type: string enum: - image_url image_url: $ref: '#/components/schemas/type_:ImageUrl' description: The message's image content. required: - type - image_url title: ImageChatContent type_:ChatMessageContentItem: oneOf: - $ref: '#/components/schemas/type_:TextChatContent' - $ref: '#/components/schemas/type_:ImageChatContent' title: ChatMessageContentItem type_:ChatMessageContent: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessageContentItem' description: The content of the message. title: ChatMessageContent type_:ChatRole: type: string enum: - user - assistant - system - tool - developer description: An enumeration. title: ChatRole type_:ChatToolType: type: string enum: - function description: The type of tool to call. title: ChatToolType type_:FunctionTool: type: object properties: name: type: string arguments: type: string required: - name description: A function tool to be called by the model where user owns runtime. title: FunctionTool type_:ToolCall: type: object properties: id: type: string type: $ref: '#/components/schemas/type_:ChatToolType' function: $ref: '#/components/schemas/type_:FunctionTool' required: - id - type - function description: A tool call to be made. title: ToolCall type_:AnthropicThinkingContent: type: object properties: type: type: string enum: - thinking thinking: type: string description: Model's chain-of-thought for providing the response. signature: type: string description: >- Cryptographic signature that verifies the thinking block was generated by Anthropic. required: - type - thinking - signature title: AnthropicThinkingContent type_:AnthropicRedactedThinkingContent: type: object properties: type: type: string enum: - redacted_thinking data: type: string description: >- Thinking block Anthropic redacted for safety reasons. User is expected to pass the block back to Anthropic required: - type - data title: AnthropicRedactedThinkingContent type_:ChatMessageThinkingItem: oneOf: - $ref: '#/components/schemas/type_:AnthropicThinkingContent' - $ref: '#/components/schemas/type_:AnthropicRedactedThinkingContent' title: ChatMessageThinkingItem type_:ChatMessage: type: object properties: content: $ref: '#/components/schemas/type_:ChatMessageContent' description: The content of the message. name: type: string description: Optional name of the message author. tool_call_id: type: string description: Tool call that this message is responding to. role: $ref: '#/components/schemas/type_:ChatRole' description: Role of the message author. tool_calls: type: array items: $ref: '#/components/schemas/type_:ToolCall' description: A list of tool calls requested by the assistant. thinking: type: array items: $ref: '#/components/schemas/type_:ChatMessageThinkingItem' description: >- Model's chain-of-thought for providing the response. Present on assistant messages if model supports it. required: - role title: ChatMessage type_:ProviderApiKeys: type: object properties: openai: type: string mock: type: string anthropic: type: string deepseek: type: string bedrock: type: string cohere: type: string openai_azure: type: string openai_azure_endpoint: type: string google: type: string title: ProviderApiKeys type_:FunctionToolChoice: type: object properties: name: type: string required: - name description: A function tool to be called by the model where user owns runtime. title: FunctionToolChoice type_:ToolChoice: type: object properties: type: $ref: '#/components/schemas/type_:ChatToolType' function: $ref: '#/components/schemas/type_:FunctionToolChoice' required: - type - function description: Tool choice to force the model to use a tool. title: ToolChoice type_:AgentContinueCallResponseToolChoice: oneOf: - type: string enum: - none - type: string enum: - auto - type: string enum: - required - $ref: '#/components/schemas/type_:ToolChoice' description: >- Controls how the model uses tools. The following options are supported: - `'none'` means the model will not call any tool and instead generates a message; this is the default when no tools are provided as part of the Prompt. - `'auto'` means the model can decide to call one or more of the provided tools; this is the default when tools are provided as part of the Prompt. - `'required'` means the model must call one or more of the provided tools. - `{'type': 'function', 'function': {name': }}` forces the model to use the named function. title: AgentContinueCallResponseToolChoice type_:ModelEndpoints: type: string enum: - complete - chat - edit description: Supported model provider endpoints. title: ModelEndpoints type_:AgentResponseTemplate: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: >- 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}}`. title: AgentResponseTemplate type_:TemplateLanguage: type: string enum: - default - jinja description: Template engine to use for rendering templates. title: TemplateLanguage type_:ModelProviders: type: string enum: - anthropic - bedrock - cohere - deepseek - google - groq - mock - openai - openai_azure - replicate description: Supported model providers. title: ModelProviders type_:AgentResponseStop: oneOf: - type: string - type: array items: type: string description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. title: AgentResponseStop type_:ResponseFormatType: type: string enum: - json_object - json_schema title: ResponseFormatType type_:ResponseFormat: type: object properties: type: $ref: '#/components/schemas/type_:ResponseFormatType' json_schema: type: object additionalProperties: description: Any type description: The JSON schema of the response format if type is json_schema. required: - type description: Response format of the model. title: ResponseFormat type_:OpenAiReasoningEffort: type: string enum: - high - medium - low description: Supported reasoning effort. title: OpenAiReasoningEffort type_:AgentResponseReasoningEffort: oneOf: - $ref: '#/components/schemas/type_:OpenAiReasoningEffort' - type: integer description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. title: AgentResponseReasoningEffort type_:LinkedFileRequest: type: object properties: file_id: type: string environment_id: type: string version_id: type: string required: - file_id title: LinkedFileRequest type_:OnAgentCallEnum: type: string enum: - stop - continue description: What an Agent should do when calling a Tool. title: OnAgentCallEnum type_:PromptResponseTemplate: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: >- 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}}`. title: PromptResponseTemplate type_:PromptResponseStop: oneOf: - type: string - type: array items: type: string description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. title: PromptResponseStop type_:PromptResponseReasoningEffort: oneOf: - $ref: '#/components/schemas/type_:OpenAiReasoningEffort' - type: integer description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. title: PromptResponseReasoningEffort type_:ToolFunction: type: object properties: name: type: string description: Name for the tool referenced by the model. description: type: string description: Description of the tool referenced by the model strict: type: boolean default: false description: >- If true, forces the model to output json data in the structure of the parameters schema. parameters: type: object additionalProperties: description: Any type description: >- Parameters needed to run the Tool, defined in JSON Schema format: https://json-schema.org/ required: - name - description title: ToolFunction type_:LinkedToolResponse: type: object properties: name: type: string description: Name for the tool referenced by the model. description: type: string description: Description of the tool referenced by the model strict: type: boolean default: false description: >- If true, forces the model to output json data in the structure of the parameters schema. parameters: type: object additionalProperties: description: Any type description: >- Parameters needed to run the Tool, defined in JSON Schema format: https://json-schema.org/ id: type: string description: Unique identifier for the Tool linked. version_id: type: string description: Unique identifier for the Tool Version linked. required: - name - description - id - version_id title: LinkedToolResponse type_:EnvironmentTag: type: string enum: - default - other description: An enumeration. title: EnvironmentTag type_:EnvironmentResponse: type: object properties: id: type: string created_at: type: string format: date-time name: type: string tag: $ref: '#/components/schemas/type_:EnvironmentTag' required: - id - created_at - name - tag title: EnvironmentResponse type_:UserResponse: description: Any type title: UserResponse type_:InputResponse: type: object properties: name: type: string description: Type of input. required: - name title: InputResponse type_:FilesToolType: type: string enum: - pinecone_search - google - mock - snippet - json_schema - get_api_call - python description: Type of tool. title: FilesToolType type_:EvaluatorAggregate: type: object properties: value: type: number format: double description: The aggregated value of the evaluator. evaluator_id: type: string description: ID of the evaluator. evaluator_version_id: type: string description: ID of the evaluator version. created_at: type: string format: date-time updated_at: type: string format: date-time required: - value - evaluator_id - evaluator_version_id - created_at - updated_at title: EvaluatorAggregate type_:ToolResponse: type: object properties: path: type: string description: >- Path of the Tool, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Tool. directory_id: type: string description: ID of the directory that the file is in on Humanloop. function: $ref: '#/components/schemas/type_:ToolFunction' description: >- Callable function specification of the Tool shown to the model for tool calling. source_code: type: string description: Code source of the Tool. setup_values: type: object additionalProperties: description: Any type description: >- Values needed to setup the Tool, defined in JSON Schema format: https://json-schema.org/ attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Tool. Helpful to separate Tool versions from each other with details on how they were created or used. tool_type: $ref: '#/components/schemas/type_:FilesToolType' description: Type of Tool. version_name: type: string description: >- Unique identifier for this Tool version. Each Tool can only have one version with a given name. version_description: type: string description: Description of the Version. name: type: string description: Name of the Tool, which is used as a unique identifier. description: type: string description: Description of the Tool. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Tool Version. If no query params provided, the default deployed Tool Version is returned. type: type: string enum: - tool environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Tool Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Tool. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Tool Version total_logs_count: type: integer description: The number of logs that have been generated across all Tool Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Prompt. Inputs correspond to any of the variables used within the Tool template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Tool that are used for monitoring logs. signature: type: string description: Signature of the Tool. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Tool Version. required: - path - id - name - version_id - created_at - updated_at - last_used_at - version_logs_count - total_logs_count - inputs description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: ToolResponse type_:DatapointResponseTargetValue: oneOf: - type: string - type: integer - type: number format: double - type: boolean - type: array items: description: Any type - type: object additionalProperties: description: Any type title: DatapointResponseTargetValue type_:DatapointResponse: type: object properties: inputs: type: object additionalProperties: type: string description: The inputs to the prompt template. messages: type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: List of chat messages to provide to the model. target: type: object additionalProperties: $ref: '#/components/schemas/type_:DatapointResponseTargetValue' description: >- Object with criteria necessary to evaluate generations with this Datapoint. This is passed in as an argument to Evaluators when used in an Evaluation. id: type: string description: Unique identifier for the Datapoint. Starts with `dp_`. required: - id title: DatapointResponse type_:DatasetResponse: type: object properties: path: type: string description: >- Path of the Dataset, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Dataset. Starts with `ds_`. directory_id: type: string description: ID of the directory that the file is in on Humanloop. name: type: string description: Name of the Dataset, which is used as a unique identifier. description: type: string description: Description of the Dataset. schema: type: object additionalProperties: description: Any type description: The JSON schema for the File. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Dataset Version. If no query params provided, the default deployed Dataset Version is returned. Starts with `dsv_`. type: type: string enum: - dataset environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Dataset Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Dataset. last_used_at: type: string format: date-time version_name: type: string description: >- Unique name for the Dataset version. Version names must be unique for a given Dataset. version_description: type: string description: Description of the version, e.g., the changes made in this version. datapoints_count: type: integer description: The number of Datapoints in this Dataset version. datapoints: type: array items: $ref: '#/components/schemas/type_:DatapointResponse' description: >- The list of Datapoints in this Dataset version. Only provided if explicitly requested. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Dataset. Helpful to separate Dataset versions from each other with details on how they were created or used. required: - path - id - name - version_id - created_at - updated_at - last_used_at - datapoints_count description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: DatasetResponse type_:EvaluatorArgumentsType: type: string enum: - target_free - target_required description: Enum representing the possible argument types of an evaluator. title: EvaluatorArgumentsType type_:EvaluatorReturnTypeEnum: type: string enum: - boolean - number - select - multi_select - text description: Enum representing the possible return types of an evaluator. title: EvaluatorReturnTypeEnum type_:Valence: type: string enum: - positive - negative - neutral description: An enumeration. title: Valence type_:EvaluatorJudgmentOptionResponse: type: object properties: name: type: string description: The name of the option. valence: $ref: '#/components/schemas/type_:Valence' description: Whether this option should be considered positive or negative. required: - name title: EvaluatorJudgmentOptionResponse type_:EvaluatorJudgmentNumberLimit: type: object properties: min: type: number format: double description: The minimum value that can be selected. max: type: number format: double description: The maximum value that can be selected. step: type: number format: double description: The step size for the number input. title: EvaluatorJudgmentNumberLimit type_:PromptKernelRequestTemplate: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: >- 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}}`. title: PromptKernelRequestTemplate type_:PromptKernelRequestStop: oneOf: - type: string - type: array items: type: string description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. title: PromptKernelRequestStop type_:PromptKernelRequestReasoningEffort: oneOf: - $ref: '#/components/schemas/type_:OpenAiReasoningEffort' - type: integer description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. title: PromptKernelRequestReasoningEffort type_:PromptKernelRequest: type: object properties: model: type: string description: >- The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models) endpoint: $ref: '#/components/schemas/type_:ModelEndpoints' description: The provider model endpoint used. template: $ref: '#/components/schemas/type_:PromptKernelRequestTemplate' description: >- 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}}`. template_language: $ref: '#/components/schemas/type_:TemplateLanguage' description: The template language to use for rendering the template. provider: $ref: '#/components/schemas/type_:ModelProviders' description: The company providing the underlying model service. max_tokens: type: integer default: -1 description: >- 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 temperature: type: number format: double default: 1 description: >- What sampling temperature to use when making a generation. Higher values means the model will be more creative. top_p: type: number format: double default: 1 description: >- An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. stop: $ref: '#/components/schemas/type_:PromptKernelRequestStop' description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. presence_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far. frequency_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far. other: type: object additionalProperties: description: Any type description: Other parameter values to be passed to the provider call. seed: type: integer description: >- If specified, model will make a best effort to sample deterministically, but it is not guaranteed. response_format: $ref: '#/components/schemas/type_:ResponseFormat' description: >- The format of the response. Only `{"type": "json_object"}` is currently supported for chat. reasoning_effort: $ref: '#/components/schemas/type_:PromptKernelRequestReasoningEffort' description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. tools: type: array items: $ref: '#/components/schemas/type_:ToolFunction' description: >- The tool specification that the model can choose to call if Tool calling is supported. linked_tools: type: array items: type: string description: >- 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. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used. required: - model description: |- Base class used by both PromptKernelRequest and AgentKernelRequest. Contains the consistent Prompt-related fields. title: PromptKernelRequest type_:LlmEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:EvaluatorReturnTypeEnum' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: >- The options that can be applied as judgments. Only for Evaluators with `return_type` of 'boolean', 'select' or 'multi_select'. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - llm prompt: $ref: '#/components/schemas/type_:PromptKernelRequest' description: The prompt parameters used to generate. required: - arguments_type - return_type - evaluator_type title: LlmEvaluatorRequest type_:CodeEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:EvaluatorReturnTypeEnum' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: >- The options that can be applied as judgments. Only for Evaluators with `return_type` of 'boolean', 'select' or 'multi_select'. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - python code: type: string description: >- The code for the Evaluator. This code will be executed in a sandboxed environment. required: - arguments_type - return_type - evaluator_type - code title: CodeEvaluatorRequest type_:HumanEvaluatorRequestReturnType: type: string enum: - select - multi_select - text - number - boolean description: The type of the return value of the Evaluator. title: HumanEvaluatorRequestReturnType type_:HumanEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:HumanEvaluatorRequestReturnType' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: The options that can be applied as judgments. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - human instructions: type: string description: Instructions and guidelines for applying judgments. required: - arguments_type - return_type - evaluator_type title: HumanEvaluatorRequest type_:ExternalEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:EvaluatorReturnTypeEnum' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: >- The options that can be applied as judgments. Only for Evaluators with `return_type` of 'boolean', 'select' or 'multi_select'. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - external required: - arguments_type - return_type - evaluator_type title: ExternalEvaluatorRequest type_:EvaluatorResponseSpec: oneOf: - $ref: '#/components/schemas/type_:LlmEvaluatorRequest' - $ref: '#/components/schemas/type_:CodeEvaluatorRequest' - $ref: '#/components/schemas/type_:HumanEvaluatorRequest' - $ref: '#/components/schemas/type_:ExternalEvaluatorRequest' title: EvaluatorResponseSpec type_:EvaluatorResponse: type: object properties: path: type: string description: >- Path of the Evaluator including the Evaluator name, which is used as a unique identifier. id: type: string description: Unique identifier for the Evaluator. directory_id: type: string description: ID of the directory that the file is in on Humanloop. version_name: type: string description: >- Unique name for the Evaluator version. Version names must be unique for a given Evaluator. version_description: type: string description: Description of the version, e.g., the changes made in this version. spec: $ref: '#/components/schemas/type_:EvaluatorResponseSpec' name: type: string description: Name of the Evaluator, which is used as a unique identifier. description: type: string description: Description of the Evaluator. schema: type: object additionalProperties: description: Any type description: The JSON schema for the File. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Evaluator Version. If no query params provided, the default deployed Evaluator Version is returned. type: type: string enum: - evaluator environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Evaluator Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Evaluator. last_used_at: type: string format: date-time version_logs_count: type: integer description: >- The number of logs that have been generated for this Evaluator Version total_logs_count: type: integer description: >- The number of logs that have been generated across all Evaluator Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Evaluator. Inputs correspond to any of the variables used within the Evaluator template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Evaluator that are used for monitoring logs. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Evaluator Version. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. required: - path - id - spec - name - version_id - created_at - updated_at - last_used_at - version_logs_count - total_logs_count - inputs description: Version of the Evaluator used to provide judgments. title: EvaluatorResponse type_:FlowResponse: type: object properties: path: type: string description: >- Path of the Flow, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Flow. directory_id: type: string description: ID of the directory that the file is in on Humanloop. attributes: type: object additionalProperties: description: Any type description: A key-value object identifying the Flow Version. version_name: type: string description: >- Unique name for the Flow version. Version names must be unique for a given Flow. version_description: type: string description: Description of the Version. name: type: string description: Name of the Flow. description: type: string description: Description of the Flow. schema: type: object additionalProperties: description: Any type description: The JSON schema for the File. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Flow Version. If no query params provided, the default deployed Flow Version is returned. type: type: string enum: - flow environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Flow Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Flow. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Flow Version evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Flow Version. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: The list of Monitoring Evaluators associated with the Flow Version. required: - path - id - attributes - name - version_id - created_at - updated_at - last_used_at - version_logs_count description: Response model for a Flow. title: FlowResponse type_:VersionDeploymentResponseFile: oneOf: - $ref: '#/components/schemas/type_:PromptResponse' - $ref: '#/components/schemas/type_:ToolResponse' - $ref: '#/components/schemas/type_:DatasetResponse' - $ref: '#/components/schemas/type_:EvaluatorResponse' - $ref: '#/components/schemas/type_:FlowResponse' - $ref: '#/components/schemas/type_:AgentResponse' description: The File that the deployed Version belongs to. title: VersionDeploymentResponseFile type_:VersionDeploymentResponse: type: object properties: file: $ref: '#/components/schemas/type_:VersionDeploymentResponseFile' description: The File that the deployed Version belongs to. environment: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The Environment that the Version is deployed to. type: type: string enum: - environment required: - file - environment - type description: A variable reference to the Version deployed to an Environment title: VersionDeploymentResponse type_:VersionIdResponseVersion: oneOf: - $ref: '#/components/schemas/type_:PromptResponse' - $ref: '#/components/schemas/type_:ToolResponse' - $ref: '#/components/schemas/type_:DatasetResponse' - $ref: '#/components/schemas/type_:EvaluatorResponse' - $ref: '#/components/schemas/type_:FlowResponse' - $ref: '#/components/schemas/type_:AgentResponse' description: The specific Version being referenced. title: VersionIdResponseVersion type_:VersionIdResponse: type: object properties: version: $ref: '#/components/schemas/type_:VersionIdResponseVersion' description: The specific Version being referenced. type: type: string enum: - version required: - version - type description: A reference to a specific Version by its ID title: VersionIdResponse type_:VersionReferenceResponse: oneOf: - $ref: '#/components/schemas/type_:VersionDeploymentResponse' - $ref: '#/components/schemas/type_:VersionIdResponse' title: VersionReferenceResponse type_:MonitoringEvaluatorState: type: string enum: - active - inactive description: State of an evaluator connected to a file title: MonitoringEvaluatorState type_:MonitoringEvaluatorResponse: type: object properties: version_reference: $ref: '#/components/schemas/type_:VersionReferenceResponse' description: >- The Evaluator Version used for monitoring. This can be a specific Version by ID, or a Version deployed to an Environment. version: $ref: '#/components/schemas/type_:EvaluatorResponse' description: The deployed Version. state: $ref: '#/components/schemas/type_:MonitoringEvaluatorState' description: The state of the Monitoring Evaluator. Either `active` or `inactive` created_at: type: string format: date-time updated_at: type: string format: date-time required: - version_reference - state - created_at - updated_at title: MonitoringEvaluatorResponse type_:PromptResponse: type: object properties: path: type: string description: >- Path of the Prompt, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Prompt. directory_id: type: string description: ID of the directory that the file is in on Humanloop. model: type: string description: >- The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models) endpoint: $ref: '#/components/schemas/type_:ModelEndpoints' description: The provider model endpoint used. template: $ref: '#/components/schemas/type_:PromptResponseTemplate' description: >- 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}}`. template_language: $ref: '#/components/schemas/type_:TemplateLanguage' description: The template language to use for rendering the template. provider: $ref: '#/components/schemas/type_:ModelProviders' description: The company providing the underlying model service. max_tokens: type: integer default: -1 description: >- 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 temperature: type: number format: double default: 1 description: >- What sampling temperature to use when making a generation. Higher values means the model will be more creative. top_p: type: number format: double default: 1 description: >- An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. stop: $ref: '#/components/schemas/type_:PromptResponseStop' description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. presence_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far. frequency_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far. other: type: object additionalProperties: description: Any type description: Other parameter values to be passed to the provider call. seed: type: integer description: >- If specified, model will make a best effort to sample deterministically, but it is not guaranteed. response_format: $ref: '#/components/schemas/type_:ResponseFormat' description: >- The format of the response. Only `{"type": "json_object"}` is currently supported for chat. reasoning_effort: $ref: '#/components/schemas/type_:PromptResponseReasoningEffort' description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. tools: type: array items: $ref: '#/components/schemas/type_:ToolFunction' description: >- The tool specification that the model can choose to call if Tool calling is supported. linked_tools: type: array items: $ref: '#/components/schemas/type_:LinkedToolResponse' description: The tools linked to your prompt that the model can call. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used. version_name: type: string description: >- Unique name for the Prompt version. Version names must be unique for a given Prompt. version_description: type: string description: Description of the version, e.g., the changes made in this version. description: type: string description: Description of the Prompt. tags: type: array items: type: string description: List of tags associated with the file. readme: type: string description: Long description of the file. name: type: string description: Name of the Prompt. schema: type: object additionalProperties: description: Any type description: The JSON schema for the Prompt. version_id: type: string description: >- Unique identifier for the specific Prompt Version. If no query params provided, the default deployed Prompt Version is returned. type: type: string enum: - prompt environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Prompt Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Prompt. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Prompt Version total_logs_count: type: integer description: >- The number of logs that have been generated across all Prompt Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Prompt. Inputs correspond to any of the variables used within the Prompt template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Prompt that are used for monitoring logs. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Prompt Version. raw_file_content: type: string description: The raw content of the Prompt. Corresponds to the .prompt file. required: - path - id - model - name - version_id - created_at - updated_at - last_used_at - version_logs_count - total_logs_count - inputs description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: PromptResponse type_:AgentLinkedFileResponseFile: oneOf: - $ref: '#/components/schemas/type_:PromptResponse' - $ref: '#/components/schemas/type_:ToolResponse' - $ref: '#/components/schemas/type_:DatasetResponse' - $ref: '#/components/schemas/type_:EvaluatorResponse' - $ref: '#/components/schemas/type_:FlowResponse' - $ref: '#/components/schemas/type_:AgentResponse' title: AgentLinkedFileResponseFile type_:AgentLinkedFileResponse: type: object properties: type: type: string enum: - file link: $ref: '#/components/schemas/type_:LinkedFileRequest' on_agent_call: $ref: '#/components/schemas/type_:OnAgentCallEnum' file: $ref: '#/components/schemas/type_:AgentLinkedFileResponseFile' required: - type - link title: AgentLinkedFileResponse type_:AgentInlineTool: type: object properties: type: type: string enum: - inline json_schema: $ref: '#/components/schemas/type_:ToolFunction' on_agent_call: $ref: '#/components/schemas/type_:OnAgentCallEnum' required: - type - json_schema title: AgentInlineTool type_:AgentResponseToolsItem: oneOf: - $ref: '#/components/schemas/type_:AgentLinkedFileResponse' - $ref: '#/components/schemas/type_:AgentInlineTool' title: AgentResponseToolsItem type_:VersionStatus: type: string enum: - uncommitted - committed - deleted description: An enumeration. title: VersionStatus type_:AgentResponse: type: object properties: path: type: string description: >- Path of the Agent, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Agent. directory_id: type: string description: ID of the directory that the file is in on Humanloop. model: type: string description: >- The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models) endpoint: $ref: '#/components/schemas/type_:ModelEndpoints' description: The provider model endpoint used. template: $ref: '#/components/schemas/type_:AgentResponseTemplate' description: >- 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}}`. template_language: $ref: '#/components/schemas/type_:TemplateLanguage' description: The template language to use for rendering the template. provider: $ref: '#/components/schemas/type_:ModelProviders' description: The company providing the underlying model service. max_tokens: type: integer default: -1 description: >- 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 temperature: type: number format: double default: 1 description: >- What sampling temperature to use when making a generation. Higher values means the model will be more creative. top_p: type: number format: double default: 1 description: >- An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. stop: $ref: '#/components/schemas/type_:AgentResponseStop' description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. presence_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far. frequency_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far. other: type: object additionalProperties: description: Any type description: Other parameter values to be passed to the provider call. seed: type: integer description: >- If specified, model will make a best effort to sample deterministically, but it is not guaranteed. response_format: $ref: '#/components/schemas/type_:ResponseFormat' description: >- The format of the response. Only `{"type": "json_object"}` is currently supported for chat. reasoning_effort: $ref: '#/components/schemas/type_:AgentResponseReasoningEffort' description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. tools: type: array items: $ref: '#/components/schemas/type_:AgentResponseToolsItem' description: >- List of tools that the Agent can call. These can be linked files or inline tools. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used. max_iterations: type: integer description: >- The maximum number of iterations the Agent can run. This is used to limit the number of times the Agent model is called. version_name: type: string description: >- Unique name for the Agent version. Version names must be unique for a given Agent. version_description: type: string description: Description of the version, e.g., the changes made in this version. description: type: string description: Description of the Agent. tags: type: array items: type: string description: List of tags associated with the file. readme: type: string description: Long description of the file. name: type: string description: Name of the Agent. schema: type: object additionalProperties: description: Any type description: The JSON schema for the Prompt. version_id: type: string description: >- Unique identifier for the specific Agent Version. If no query params provided, the default deployed Agent Version is returned. type: type: string enum: - agent environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Agent Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Agent. committed_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who committed the Agent Version. committed_at: type: string format: date-time description: The date and time the Agent Version was committed. status: $ref: '#/components/schemas/type_:VersionStatus' description: The status of the Agent Version. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Agent Version total_logs_count: type: integer description: >- The number of logs that have been generated across all Agent Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Agent. Inputs correspond to any of the variables used within the Agent template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Agent that are used for monitoring logs. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Agent Version. raw_file_content: type: string description: The raw content of the Agent. Corresponds to the .agent file. required: - path - id - model - tools - name - version_id - created_at - updated_at - status - last_used_at - version_logs_count - total_logs_count - inputs description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: AgentResponse type_:LogStatus: type: string enum: - complete - incomplete description: An enumeration. title: LogStatus type_:EvaluatorLogResponseJudgment: oneOf: - type: boolean - type: string - type: array items: type: string - type: number format: double description: Evaluator assessment of the Log. title: EvaluatorLogResponseJudgment type_:PromptLogResponseToolChoice: oneOf: - type: string enum: - none - type: string enum: - auto - type: string enum: - required - $ref: '#/components/schemas/type_:ToolChoice' description: >- Controls how the model uses tools. The following options are supported: - `'none'` means the model will not call any tool and instead generates a message; this is the default when no tools are provided as part of the Prompt. - `'auto'` means the model can decide to call one or more of the provided tools; this is the default when tools are provided as part of the Prompt. - `'required'` means the model must call one or more of the provided tools. - `{'type': 'function', 'function': {name': }}` forces the model to use the named function. title: PromptLogResponseToolChoice type_:PromptLogResponse: type: object properties: output_message: $ref: '#/components/schemas/type_:ChatMessage' description: The message returned by the provider. prompt_tokens: type: integer description: Number of tokens in the prompt used to generate the output. reasoning_tokens: type: integer description: Number of reasoning tokens used to generate the output. output_tokens: type: integer description: Number of tokens in the output generated by the model. prompt_cost: type: number format: double description: Cost in dollars associated to the tokens in the prompt. output_cost: type: number format: double description: Cost in dollars associated to the tokens in the output. finish_reason: type: string description: Reason the generation finished. messages: type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: The messages passed to the to provider chat endpoint. tool_choice: $ref: '#/components/schemas/type_:PromptLogResponseToolChoice' description: >- Controls how the model uses tools. The following options are supported: - `'none'` means the model will not call any tool and instead generates a message; this is the default when no tools are provided as part of the Prompt. - `'auto'` means the model can decide to call one or more of the provided tools; this is the default when tools are provided as part of the Prompt. - `'required'` means the model must call one or more of the provided tools. - `{'type': 'function', 'function': {name': }}` forces the model to use the named function. prompt: $ref: '#/components/schemas/type_:PromptResponse' description: Prompt used to generate the Log. start_time: type: string format: date-time description: When the logged event started. end_time: type: string format: date-time description: When the logged event ended. output: type: string description: >- Generated output from your model for the provided inputs. Can be `None` if logging an error, or if creating a parent Log with the intention to populate it later. created_at: type: string format: date-time description: 'User defined timestamp for when the log was created. ' error: type: string description: Error message if the log is an error. provider_latency: type: number format: double description: Duration of the logged event in seconds. stdout: type: string description: Captured log and debug statements. provider_request: type: object additionalProperties: description: Any type description: Raw request sent to provider. provider_response: type: object additionalProperties: description: Any type description: Raw response received the provider. inputs: type: object additionalProperties: description: Any type description: The inputs passed to the prompt template. source: type: string description: Identifies where the model was called from. metadata: type: object additionalProperties: description: Any type description: Any additional metadata to record. source_datapoint_id: type: string description: >- Unique identifier for the Datapoint that this Log is derived from. This can be used by Humanloop to associate Logs to Evaluations. If provided, Humanloop will automatically associate this Log to Evaluations that require a Log for this Datapoint-Version pair. trace_parent_id: type: string description: The ID of the parent Log to nest this Log under in a Trace. batches: type: array items: type: string description: >- Array of Batch IDs that this Log is part of. Batches are used to group Logs together for offline Evaluations user: type: string description: End-user ID related to the Log. environment: type: string description: The name of the Environment the Log is associated to. save: type: boolean default: true description: Whether the request/response payloads will be stored on Humanloop. log_id: type: string description: >- This will identify a Log. If you don't provide a Log ID, Humanloop will generate one for you. id: type: string description: Unique identifier for the Log. evaluator_logs: type: array items: $ref: '#/components/schemas/type_:EvaluatorLogResponse' description: >- List of Evaluator Logs associated with the Log. These contain Evaluator judgments on the Log. trace_flow_id: type: string description: Identifier for the Flow that the Trace belongs to. trace_id: type: string description: Identifier for the Trace that the Log belongs to. trace_children: type: array items: $ref: '#/components/schemas/type_:LogResponse' description: Logs nested under this Log in the Trace. required: - prompt - id - evaluator_logs description: General request for creating a Log title: PromptLogResponse type_:ToolLogResponse: type: object properties: start_time: type: string format: date-time description: When the logged event started. end_time: type: string format: date-time description: When the logged event ended. output: type: string description: >- Generated output from your model for the provided inputs. Can be `None` if logging an error, or if creating a parent Log with the intention to populate it later. created_at: type: string format: date-time description: 'User defined timestamp for when the log was created. ' error: type: string description: Error message if the log is an error. provider_latency: type: number format: double description: Duration of the logged event in seconds. stdout: type: string description: Captured log and debug statements. provider_request: type: object additionalProperties: description: Any type description: Raw request sent to provider. provider_response: type: object additionalProperties: description: Any type description: Raw response received the provider. inputs: type: object additionalProperties: description: Any type description: The inputs passed to the prompt template. source: type: string description: Identifies where the model was called from. metadata: type: object additionalProperties: description: Any type description: Any additional metadata to record. source_datapoint_id: type: string description: >- Unique identifier for the Datapoint that this Log is derived from. This can be used by Humanloop to associate Logs to Evaluations. If provided, Humanloop will automatically associate this Log to Evaluations that require a Log for this Datapoint-Version pair. trace_parent_id: type: string description: The ID of the parent Log to nest this Log under in a Trace. batches: type: array items: type: string description: >- Array of Batch IDs that this Log is part of. Batches are used to group Logs together for offline Evaluations user: type: string description: End-user ID related to the Log. environment: type: string description: The name of the Environment the Log is associated to. save: type: boolean default: true description: Whether the request/response payloads will be stored on Humanloop. log_id: type: string description: >- This will identify a Log. If you don't provide a Log ID, Humanloop will generate one for you. id: type: string description: Unique identifier for the Log. evaluator_logs: type: array items: $ref: '#/components/schemas/type_:EvaluatorLogResponse' description: >- List of Evaluator Logs associated with the Log. These contain Evaluator judgments on the Log. trace_flow_id: type: string description: Identifier for the Flow that the Trace belongs to. trace_id: type: string description: Identifier for the Trace that the Log belongs to. trace_children: type: array items: $ref: '#/components/schemas/type_:LogResponse' description: Logs nested under this Log in the Trace. tool: $ref: '#/components/schemas/type_:ToolResponse' description: Tool used to generate the Log. output_message: $ref: '#/components/schemas/type_:ChatMessage' description: The message returned by the Tool. required: - id - evaluator_logs - tool description: General request for creating a Log title: ToolLogResponse type_:FlowLogResponse: type: object properties: messages: type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: List of chat messages that were used as an input to the Flow. output_message: $ref: '#/components/schemas/type_:ChatMessage' description: The output message returned by this Flow. start_time: type: string format: date-time description: When the logged event started. end_time: type: string format: date-time description: When the logged event ended. output: type: string description: >- Generated output from your model for the provided inputs. Can be `None` if logging an error, or if creating a parent Log with the intention to populate it later. created_at: type: string format: date-time description: 'User defined timestamp for when the log was created. ' error: type: string description: Error message if the log is an error. provider_latency: type: number format: double description: Duration of the logged event in seconds. stdout: type: string description: Captured log and debug statements. provider_request: type: object additionalProperties: description: Any type description: Raw request sent to provider. provider_response: type: object additionalProperties: description: Any type description: Raw response received the provider. inputs: type: object additionalProperties: description: Any type description: The inputs passed to the Flow Log. source: type: string description: Identifies where the model was called from. metadata: type: object additionalProperties: description: Any type description: Any additional metadata to record. log_status: $ref: '#/components/schemas/type_:LogStatus' description: >- Status of the Flow Log. When a Flow Log is updated to `complete`, no more Logs can be added to it. You cannot update a Flow Log's status from `complete` to `incomplete`. source_datapoint_id: type: string description: >- Unique identifier for the Datapoint that this Log is derived from. This can be used by Humanloop to associate Logs to Evaluations. If provided, Humanloop will automatically associate this Log to Evaluations that require a Log for this Datapoint-Version pair. trace_parent_id: type: string description: The ID of the parent Log to nest this Log under in a Trace. batches: type: array items: type: string description: >- Array of Batch IDs that this Log is part of. Batches are used to group Logs together for offline Evaluations user: type: string description: End-user ID related to the Log. environment: type: string description: The name of the Environment the Log is associated to. save: type: boolean default: true description: Whether the request/response payloads will be stored on Humanloop. log_id: type: string description: >- This will identify a Log. If you don't provide a Log ID, Humanloop will generate one for you. id: type: string description: Unique identifier for the Log. evaluator_logs: type: array items: $ref: '#/components/schemas/type_:EvaluatorLogResponse' description: >- List of Evaluator Logs associated with the Log. These contain Evaluator judgments on the Log. trace_flow_id: type: string description: Identifier for the Flow that the Trace belongs to. trace_id: type: string description: Identifier for the Trace that the Log belongs to. trace_children: type: array items: $ref: '#/components/schemas/type_:LogResponse' description: Logs nested under this Log in the Trace. flow: $ref: '#/components/schemas/type_:FlowResponse' description: Flow used to generate the Log. required: - id - evaluator_logs - flow description: General request for creating a Log title: FlowLogResponse type_:AgentLogResponseToolChoice: oneOf: - type: string enum: - none - type: string enum: - auto - type: string enum: - required - $ref: '#/components/schemas/type_:ToolChoice' description: >- Controls how the model uses tools. The following options are supported: - `'none'` means the model will not call any tool and instead generates a message; this is the default when no tools are provided as part of the Prompt. - `'auto'` means the model can decide to call one or more of the provided tools; this is the default when tools are provided as part of the Prompt. - `'required'` means the model must call one or more of the provided tools. - `{'type': 'function', 'function': {name': }}` forces the model to use the named function. title: AgentLogResponseToolChoice type_:AgentLogResponse: type: object properties: output_message: $ref: '#/components/schemas/type_:ChatMessage' description: The message returned by the provider. prompt_tokens: type: integer description: Number of tokens in the prompt used to generate the output. reasoning_tokens: type: integer description: Number of reasoning tokens used to generate the output. output_tokens: type: integer description: Number of tokens in the output generated by the model. prompt_cost: type: number format: double description: Cost in dollars associated to the tokens in the prompt. output_cost: type: number format: double description: Cost in dollars associated to the tokens in the output. finish_reason: type: string description: Reason the generation finished. messages: type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: The messages passed to the to provider chat endpoint. tool_choice: $ref: '#/components/schemas/type_:AgentLogResponseToolChoice' description: >- Controls how the model uses tools. The following options are supported: - `'none'` means the model will not call any tool and instead generates a message; this is the default when no tools are provided as part of the Prompt. - `'auto'` means the model can decide to call one or more of the provided tools; this is the default when tools are provided as part of the Prompt. - `'required'` means the model must call one or more of the provided tools. - `{'type': 'function', 'function': {name': }}` forces the model to use the named function. agent: $ref: '#/components/schemas/type_:AgentResponse' description: Agent that generated the Log. start_time: type: string format: date-time description: When the logged event started. end_time: type: string format: date-time description: When the logged event ended. output: type: string description: >- Generated output from your model for the provided inputs. Can be `None` if logging an error, or if creating a parent Log with the intention to populate it later. created_at: type: string format: date-time description: 'User defined timestamp for when the log was created. ' error: type: string description: Error message if the log is an error. provider_latency: type: number format: double description: Duration of the logged event in seconds. stdout: type: string description: Captured log and debug statements. provider_request: type: object additionalProperties: description: Any type description: Raw request sent to provider. provider_response: type: object additionalProperties: description: Any type description: Raw response received the provider. inputs: type: object additionalProperties: description: Any type description: The inputs passed to the prompt template. source: type: string description: Identifies where the model was called from. metadata: type: object additionalProperties: description: Any type description: Any additional metadata to record. source_datapoint_id: type: string description: >- Unique identifier for the Datapoint that this Log is derived from. This can be used by Humanloop to associate Logs to Evaluations. If provided, Humanloop will automatically associate this Log to Evaluations that require a Log for this Datapoint-Version pair. trace_parent_id: type: string description: The ID of the parent Log to nest this Log under in a Trace. batches: type: array items: type: string description: >- Array of Batch IDs that this Log is part of. Batches are used to group Logs together for offline Evaluations user: type: string description: End-user ID related to the Log. environment: type: string description: The name of the Environment the Log is associated to. save: type: boolean default: true description: Whether the request/response payloads will be stored on Humanloop. log_id: type: string description: >- This will identify a Log. If you don't provide a Log ID, Humanloop will generate one for you. id: type: string description: Unique identifier for the Log. evaluator_logs: type: array items: $ref: '#/components/schemas/type_:EvaluatorLogResponse' description: >- List of Evaluator Logs associated with the Log. These contain Evaluator judgments on the Log. trace_flow_id: type: string description: Identifier for the Flow that the Trace belongs to. trace_id: type: string description: Identifier for the Trace that the Log belongs to. trace_children: type: array items: $ref: '#/components/schemas/type_:LogResponse' description: Logs nested under this Log in the Trace. required: - agent - id - evaluator_logs description: General request for creating a Log title: AgentLogResponse type_:LogResponse: oneOf: - $ref: '#/components/schemas/type_:PromptLogResponse' - $ref: '#/components/schemas/type_:ToolLogResponse' - $ref: '#/components/schemas/type_:EvaluatorLogResponse' - $ref: '#/components/schemas/type_:FlowLogResponse' - $ref: '#/components/schemas/type_:AgentLogResponse' title: LogResponse type_:EvaluatorLogResponse: type: object properties: start_time: type: string format: date-time description: When the logged event started. end_time: type: string format: date-time description: When the logged event ended. output: type: string description: >- Generated output from your model for the provided inputs. Can be `None` if logging an error, or if creating a parent Log with the intention to populate it later. created_at: type: string format: date-time description: 'User defined timestamp for when the log was created. ' error: type: string description: Error message if the log is an error. provider_latency: type: number format: double description: Duration of the logged event in seconds. stdout: type: string description: Captured log and debug statements. provider_request: type: object additionalProperties: description: Any type description: Raw request sent to provider. provider_response: type: object additionalProperties: description: Any type description: Raw response received the provider. inputs: type: object additionalProperties: description: Any type description: The inputs passed to the prompt template. source: type: string description: Identifies where the model was called from. metadata: type: object additionalProperties: description: Any type description: Any additional metadata to record. parent_id: type: string description: >- Identifier of the evaluated Log. The newly created Log will have this one set as parent. source_datapoint_id: type: string description: >- Unique identifier for the Datapoint that this Log is derived from. This can be used by Humanloop to associate Logs to Evaluations. If provided, Humanloop will automatically associate this Log to Evaluations that require a Log for this Datapoint-Version pair. trace_parent_id: type: string description: The ID of the parent Log to nest this Log under in a Trace. batches: type: array items: type: string description: >- Array of Batch IDs that this Log is part of. Batches are used to group Logs together for offline Evaluations user: type: string description: End-user ID related to the Log. environment: type: string description: The name of the Environment the Log is associated to. save: type: boolean default: true description: Whether the request/response payloads will be stored on Humanloop. log_id: type: string description: >- This will identify a Log. If you don't provide a Log ID, Humanloop will generate one for you. output_message: $ref: '#/components/schemas/type_:ChatMessage' description: >- The message returned by the LLM. Only populated for LLM Evaluator Logs. judgment: $ref: '#/components/schemas/type_:EvaluatorLogResponseJudgment' description: Evaluator assessment of the Log. marked_completed: type: boolean description: Whether the Log has been manually marked as completed by a user. id: type: string description: Unique identifier for the Log. evaluator_logs: type: array items: $ref: '#/components/schemas/type_:EvaluatorLogResponse' description: >- List of Evaluator Logs associated with the Log. These contain Evaluator judgments on the Log. trace_flow_id: type: string description: Identifier for the Flow that the Trace belongs to. trace_id: type: string description: Identifier for the Trace that the Log belongs to. trace_children: type: array items: $ref: '#/components/schemas/type_:LogResponse' description: Logs nested under this Log in the Trace. evaluator: $ref: '#/components/schemas/type_:EvaluatorResponse' description: Evaluator used to generate the judgment. parent: $ref: '#/components/schemas/type_:LogResponse' description: >- The Log that was evaluated. Only provided if the ?include_parent query parameter is set for the required: - id - evaluator_logs - evaluator description: General request for creating a Log title: EvaluatorLogResponse type_:AgentContinueCallResponse: type: object properties: output_message: $ref: '#/components/schemas/type_:ChatMessage' description: The message returned by the provider. prompt_tokens: type: integer description: Number of tokens in the prompt used to generate the output. reasoning_tokens: type: integer description: Number of reasoning tokens used to generate the output. output_tokens: type: integer description: Number of tokens in the output generated by the model. prompt_cost: type: number format: double description: Cost in dollars associated to the tokens in the prompt. output_cost: type: number format: double description: Cost in dollars associated to the tokens in the output. finish_reason: type: string description: Reason the generation finished. messages: type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: The messages passed to the to provider chat endpoint. tool_choice: $ref: '#/components/schemas/type_:AgentContinueCallResponseToolChoice' description: >- Controls how the model uses tools. The following options are supported: - `'none'` means the model will not call any tool and instead generates a message; this is the default when no tools are provided as part of the Prompt. - `'auto'` means the model can decide to call one or more of the provided tools; this is the default when tools are provided as part of the Prompt. - `'required'` means the model must call one or more of the provided tools. - `{'type': 'function', 'function': {name': }}` forces the model to use the named function. agent: $ref: '#/components/schemas/type_:AgentResponse' description: Agent that generated the Log. start_time: type: string format: date-time description: When the logged event started. end_time: type: string format: date-time description: When the logged event ended. output: type: string description: >- Generated output from your model for the provided inputs. Can be `None` if logging an error, or if creating a parent Log with the intention to populate it later. created_at: type: string format: date-time description: 'User defined timestamp for when the log was created. ' error: type: string description: Error message if the log is an error. provider_latency: type: number format: double description: Duration of the logged event in seconds. stdout: type: string description: Captured log and debug statements. provider_request: type: object additionalProperties: description: Any type description: Raw request sent to provider. provider_response: type: object additionalProperties: description: Any type description: Raw response received the provider. inputs: type: object additionalProperties: description: Any type description: The inputs passed to the prompt template. source: type: string description: Identifies where the model was called from. metadata: type: object additionalProperties: description: Any type description: Any additional metadata to record. log_status: $ref: '#/components/schemas/type_:LogStatus' description: >- Status of the Agent Log. If `incomplete`, the Agent turn was suspended due to a tool call and can be continued by calling /agents/continue with responses to the Agent's last message (which should contain tool calls). See the `previous_agent_message` field for easy access to the Agent's last message. source_datapoint_id: type: string description: >- Unique identifier for the Datapoint that this Log is derived from. This can be used by Humanloop to associate Logs to Evaluations. If provided, Humanloop will automatically associate this Log to Evaluations that require a Log for this Datapoint-Version pair. trace_parent_id: type: string description: The ID of the parent Log to nest this Log under in a Trace. batches: type: array items: type: string description: >- Array of Batch IDs that this Log is part of. Batches are used to group Logs together for offline Evaluations user: type: string description: End-user ID related to the Log. environment: type: string description: The name of the Environment the Log is associated to. save: type: boolean default: true description: Whether the request/response payloads will be stored on Humanloop. log_id: type: string description: >- This will identify a Log. If you don't provide a Log ID, Humanloop will generate one for you. id: type: string description: Unique identifier for the Log. evaluator_logs: type: array items: $ref: '#/components/schemas/type_:EvaluatorLogResponse' description: >- List of Evaluator Logs associated with the Log. These contain Evaluator judgments on the Log. trace_flow_id: type: string description: Identifier for the Flow that the Trace belongs to. trace_id: type: string description: Identifier for the Trace that the Log belongs to. trace_children: type: array items: $ref: '#/components/schemas/type_:LogResponse' description: Logs nested under this Log in the Trace. previous_agent_message: $ref: '#/components/schemas/type_:ChatMessage' description: >- The Agent's last message, which should contain tool calls. Only populated if the Log is incomplete due to a suspended Agent turn with tool calls. This is useful for continuing the Agent call by calling /agents/continue. required: - agent - id - evaluator_logs description: Response model for continuing an Agent call. title: AgentContinueCallResponse type_:ValidationErrorLocItem: oneOf: - type: string - type: integer title: ValidationErrorLocItem type_:ValidationError: type: object properties: loc: type: array items: $ref: '#/components/schemas/type_:ValidationErrorLocItem' msg: type: string type: type: string required: - loc - msg - type title: ValidationError type_:HttpValidationError: type: object properties: detail: type: array items: $ref: '#/components/schemas/type_:ValidationError' title: HttpValidationError securitySchemes: default: type: apiKey in: header name: X-API-KEY ``` ## SDK Code Examples ```python Continue Agent import requests url = "https://api.humanloop.com/v5/agents/continue" payload = { "log_id": "log_1234567890", "messages": [ { "role": "tool", "content": "{\"type\": \"checking\", \"balance\": 5200}", "tool_call_id": "tc_1234567890" } ] } headers = { "X-API-KEY": " ", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```typescript Continue Agent import { HumanloopClient } from "humanloop"; const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); await client.agents.continueCall({ logId: "log_1234567890", messages: [{ role: "tool", content: "{\"type\": \"checking\", \"balance\": 5200}", toolCallId: "tc_1234567890" }] }); ``` ```go Continue Agent package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/agents/continue" payload := strings.NewReader("{\n \"log_id\": \"log_1234567890\",\n \"messages\": [\n {\n \"role\": \"tool\",\n \"content\": \"{\\\"type\\\": \\\"checking\\\", \\\"balance\\\": 5200}\",\n \"tool_call_id\": \"tc_1234567890\"\n }\n ]\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("X-API-KEY", " ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Continue Agent require 'uri' require 'net/http' url = URI("https://api.humanloop.com/v5/agents/continue") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["X-API-KEY"] = ' ' request["Content-Type"] = 'application/json' request.body = "{\n \"log_id\": \"log_1234567890\",\n \"messages\": [\n {\n \"role\": \"tool\",\n \"content\": \"{\\\"type\\\": \\\"checking\\\", \\\"balance\\\": 5200}\",\n \"tool_call_id\": \"tc_1234567890\"\n }\n ]\n}" response = http.request(request) puts response.read_body ``` ```java Continue Agent import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.humanloop.com/v5/agents/continue") .header("X-API-KEY", " ") .header("Content-Type", "application/json") .body("{\n \"log_id\": \"log_1234567890\",\n \"messages\": [\n {\n \"role\": \"tool\",\n \"content\": \"{\\\"type\\\": \\\"checking\\\", \\\"balance\\\": 5200}\",\n \"tool_call_id\": \"tc_1234567890\"\n }\n ]\n}") .asString(); ``` ```php Continue Agent request('POST', 'https://api.humanloop.com/v5/agents/continue', [ 'body' => '{ "log_id": "log_1234567890", "messages": [ { "role": "tool", "content": "{\\"type\\": \\"checking\\", \\"balance\\": 5200}", "tool_call_id": "tc_1234567890" } ] }', 'headers' => [ 'Content-Type' => 'application/json', 'X-API-KEY' => ' ', ], ]); echo $response->getBody(); ``` ```csharp Continue Agent using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/agents/continue"); var request = new RestRequest(Method.POST); request.AddHeader("X-API-KEY", " "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"log_id\": \"log_1234567890\",\n \"messages\": [\n {\n \"role\": \"tool\",\n \"content\": \"{\\\"type\\\": \\\"checking\\\", \\\"balance\\\": 5200}\",\n \"tool_call_id\": \"tc_1234567890\"\n }\n ]\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Continue Agent import Foundation let headers = [ "X-API-KEY": " ", "Content-Type": "application/json" ] let parameters = [ "log_id": "log_1234567890", "messages": [ [ "role": "tool", "content": "{\"type\": \"checking\", \"balance\": 5200}", "tool_call_id": "tc_1234567890" ] ] ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/agents/continue")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. # List Agents GET https://api.humanloop.com/v5/agents Get a list of all Agents. Reference: https://humanloop.com/docs/api/agents/list ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /agents: get: operationId: list summary: List Agents description: Get a list of all Agents. tags: - subpackage_agents parameters: - name: page in: query description: Page number for pagination. required: false schema: type: integer default: 1 - name: size in: query description: Page size for pagination. Number of Agents to fetch. required: false schema: type: integer default: 10 - name: name in: query description: Case-insensitive filter for Agent name. required: false schema: type: string - name: user_filter in: query description: >- Case-insensitive filter for users in the Agent. This filter matches against both email address and name of users. required: false schema: type: string - name: sort_by in: query description: Field to sort Agents by required: false schema: $ref: '#/components/schemas/type_:FileSortBy' - name: order in: query description: Direction to sort by. required: false schema: $ref: '#/components/schemas/type_:SortOrder' - name: X-API-KEY in: header required: true schema: type: string responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/type_:PaginatedDataAgentResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/type_:HttpValidationError' servers: - url: https://api.humanloop.com/v5 components: schemas: type_:FileSortBy: type: string enum: - created_at - updated_at - name description: An enumeration. title: FileSortBy type_:SortOrder: type: string enum: - asc - desc description: An enumeration. title: SortOrder type_:ModelEndpoints: type: string enum: - complete - chat - edit description: Supported model provider endpoints. title: ModelEndpoints type_:TextChatContent: type: object properties: type: type: string enum: - text text: type: string description: The message's text content. required: - type - text title: TextChatContent type_:ImageUrlDetail: type: string enum: - high - low - auto description: >- Specify the detail level of the image provided to the model. For more details see: https://platform.openai.com/docs/guides/vision/low-or-high-fidelity-image-understanding title: ImageUrlDetail type_:ImageUrl: type: object properties: url: type: string description: Either a URL of the image or the base64 encoded image data. detail: $ref: '#/components/schemas/type_:ImageUrlDetail' description: >- Specify the detail level of the image provided to the model. For more details see: https://platform.openai.com/docs/guides/vision/low-or-high-fidelity-image-understanding required: - url title: ImageUrl type_:ImageChatContent: type: object properties: type: type: string enum: - image_url image_url: $ref: '#/components/schemas/type_:ImageUrl' description: The message's image content. required: - type - image_url title: ImageChatContent type_:ChatMessageContentItem: oneOf: - $ref: '#/components/schemas/type_:TextChatContent' - $ref: '#/components/schemas/type_:ImageChatContent' title: ChatMessageContentItem type_:ChatMessageContent: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessageContentItem' description: The content of the message. title: ChatMessageContent type_:ChatRole: type: string enum: - user - assistant - system - tool - developer description: An enumeration. title: ChatRole type_:ChatToolType: type: string enum: - function description: The type of tool to call. title: ChatToolType type_:FunctionTool: type: object properties: name: type: string arguments: type: string required: - name description: A function tool to be called by the model where user owns runtime. title: FunctionTool type_:ToolCall: type: object properties: id: type: string type: $ref: '#/components/schemas/type_:ChatToolType' function: $ref: '#/components/schemas/type_:FunctionTool' required: - id - type - function description: A tool call to be made. title: ToolCall type_:AnthropicThinkingContent: type: object properties: type: type: string enum: - thinking thinking: type: string description: Model's chain-of-thought for providing the response. signature: type: string description: >- Cryptographic signature that verifies the thinking block was generated by Anthropic. required: - type - thinking - signature title: AnthropicThinkingContent type_:AnthropicRedactedThinkingContent: type: object properties: type: type: string enum: - redacted_thinking data: type: string description: >- Thinking block Anthropic redacted for safety reasons. User is expected to pass the block back to Anthropic required: - type - data title: AnthropicRedactedThinkingContent type_:ChatMessageThinkingItem: oneOf: - $ref: '#/components/schemas/type_:AnthropicThinkingContent' - $ref: '#/components/schemas/type_:AnthropicRedactedThinkingContent' title: ChatMessageThinkingItem type_:ChatMessage: type: object properties: content: $ref: '#/components/schemas/type_:ChatMessageContent' description: The content of the message. name: type: string description: Optional name of the message author. tool_call_id: type: string description: Tool call that this message is responding to. role: $ref: '#/components/schemas/type_:ChatRole' description: Role of the message author. tool_calls: type: array items: $ref: '#/components/schemas/type_:ToolCall' description: A list of tool calls requested by the assistant. thinking: type: array items: $ref: '#/components/schemas/type_:ChatMessageThinkingItem' description: >- Model's chain-of-thought for providing the response. Present on assistant messages if model supports it. required: - role title: ChatMessage type_:AgentResponseTemplate: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: >- 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}}`. title: AgentResponseTemplate type_:TemplateLanguage: type: string enum: - default - jinja description: Template engine to use for rendering templates. title: TemplateLanguage type_:ModelProviders: type: string enum: - anthropic - bedrock - cohere - deepseek - google - groq - mock - openai - openai_azure - replicate description: Supported model providers. title: ModelProviders type_:AgentResponseStop: oneOf: - type: string - type: array items: type: string description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. title: AgentResponseStop type_:ResponseFormatType: type: string enum: - json_object - json_schema title: ResponseFormatType type_:ResponseFormat: type: object properties: type: $ref: '#/components/schemas/type_:ResponseFormatType' json_schema: type: object additionalProperties: description: Any type description: The JSON schema of the response format if type is json_schema. required: - type description: Response format of the model. title: ResponseFormat type_:OpenAiReasoningEffort: type: string enum: - high - medium - low description: Supported reasoning effort. title: OpenAiReasoningEffort type_:AgentResponseReasoningEffort: oneOf: - $ref: '#/components/schemas/type_:OpenAiReasoningEffort' - type: integer description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. title: AgentResponseReasoningEffort type_:LinkedFileRequest: type: object properties: file_id: type: string environment_id: type: string version_id: type: string required: - file_id title: LinkedFileRequest type_:OnAgentCallEnum: type: string enum: - stop - continue description: What an Agent should do when calling a Tool. title: OnAgentCallEnum type_:PromptResponseTemplate: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: >- 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}}`. title: PromptResponseTemplate type_:PromptResponseStop: oneOf: - type: string - type: array items: type: string description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. title: PromptResponseStop type_:PromptResponseReasoningEffort: oneOf: - $ref: '#/components/schemas/type_:OpenAiReasoningEffort' - type: integer description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. title: PromptResponseReasoningEffort type_:ToolFunction: type: object properties: name: type: string description: Name for the tool referenced by the model. description: type: string description: Description of the tool referenced by the model strict: type: boolean default: false description: >- If true, forces the model to output json data in the structure of the parameters schema. parameters: type: object additionalProperties: description: Any type description: >- Parameters needed to run the Tool, defined in JSON Schema format: https://json-schema.org/ required: - name - description title: ToolFunction type_:LinkedToolResponse: type: object properties: name: type: string description: Name for the tool referenced by the model. description: type: string description: Description of the tool referenced by the model strict: type: boolean default: false description: >- If true, forces the model to output json data in the structure of the parameters schema. parameters: type: object additionalProperties: description: Any type description: >- Parameters needed to run the Tool, defined in JSON Schema format: https://json-schema.org/ id: type: string description: Unique identifier for the Tool linked. version_id: type: string description: Unique identifier for the Tool Version linked. required: - name - description - id - version_id title: LinkedToolResponse type_:EnvironmentTag: type: string enum: - default - other description: An enumeration. title: EnvironmentTag type_:EnvironmentResponse: type: object properties: id: type: string created_at: type: string format: date-time name: type: string tag: $ref: '#/components/schemas/type_:EnvironmentTag' required: - id - created_at - name - tag title: EnvironmentResponse type_:UserResponse: description: Any type title: UserResponse type_:InputResponse: type: object properties: name: type: string description: Type of input. required: - name title: InputResponse type_:FilesToolType: type: string enum: - pinecone_search - google - mock - snippet - json_schema - get_api_call - python description: Type of tool. title: FilesToolType type_:EvaluatorAggregate: type: object properties: value: type: number format: double description: The aggregated value of the evaluator. evaluator_id: type: string description: ID of the evaluator. evaluator_version_id: type: string description: ID of the evaluator version. created_at: type: string format: date-time updated_at: type: string format: date-time required: - value - evaluator_id - evaluator_version_id - created_at - updated_at title: EvaluatorAggregate type_:ToolResponse: type: object properties: path: type: string description: >- Path of the Tool, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Tool. directory_id: type: string description: ID of the directory that the file is in on Humanloop. function: $ref: '#/components/schemas/type_:ToolFunction' description: >- Callable function specification of the Tool shown to the model for tool calling. source_code: type: string description: Code source of the Tool. setup_values: type: object additionalProperties: description: Any type description: >- Values needed to setup the Tool, defined in JSON Schema format: https://json-schema.org/ attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Tool. Helpful to separate Tool versions from each other with details on how they were created or used. tool_type: $ref: '#/components/schemas/type_:FilesToolType' description: Type of Tool. version_name: type: string description: >- Unique identifier for this Tool version. Each Tool can only have one version with a given name. version_description: type: string description: Description of the Version. name: type: string description: Name of the Tool, which is used as a unique identifier. description: type: string description: Description of the Tool. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Tool Version. If no query params provided, the default deployed Tool Version is returned. type: type: string enum: - tool environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Tool Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Tool. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Tool Version total_logs_count: type: integer description: The number of logs that have been generated across all Tool Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Prompt. Inputs correspond to any of the variables used within the Tool template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Tool that are used for monitoring logs. signature: type: string description: Signature of the Tool. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Tool Version. required: - path - id - name - version_id - created_at - updated_at - last_used_at - version_logs_count - total_logs_count - inputs description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: ToolResponse type_:DatapointResponseTargetValue: oneOf: - type: string - type: integer - type: number format: double - type: boolean - type: array items: description: Any type - type: object additionalProperties: description: Any type title: DatapointResponseTargetValue type_:DatapointResponse: type: object properties: inputs: type: object additionalProperties: type: string description: The inputs to the prompt template. messages: type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: List of chat messages to provide to the model. target: type: object additionalProperties: $ref: '#/components/schemas/type_:DatapointResponseTargetValue' description: >- Object with criteria necessary to evaluate generations with this Datapoint. This is passed in as an argument to Evaluators when used in an Evaluation. id: type: string description: Unique identifier for the Datapoint. Starts with `dp_`. required: - id title: DatapointResponse type_:DatasetResponse: type: object properties: path: type: string description: >- Path of the Dataset, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Dataset. Starts with `ds_`. directory_id: type: string description: ID of the directory that the file is in on Humanloop. name: type: string description: Name of the Dataset, which is used as a unique identifier. description: type: string description: Description of the Dataset. schema: type: object additionalProperties: description: Any type description: The JSON schema for the File. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Dataset Version. If no query params provided, the default deployed Dataset Version is returned. Starts with `dsv_`. type: type: string enum: - dataset environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Dataset Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Dataset. last_used_at: type: string format: date-time version_name: type: string description: >- Unique name for the Dataset version. Version names must be unique for a given Dataset. version_description: type: string description: Description of the version, e.g., the changes made in this version. datapoints_count: type: integer description: The number of Datapoints in this Dataset version. datapoints: type: array items: $ref: '#/components/schemas/type_:DatapointResponse' description: >- The list of Datapoints in this Dataset version. Only provided if explicitly requested. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Dataset. Helpful to separate Dataset versions from each other with details on how they were created or used. required: - path - id - name - version_id - created_at - updated_at - last_used_at - datapoints_count description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: DatasetResponse type_:EvaluatorArgumentsType: type: string enum: - target_free - target_required description: Enum representing the possible argument types of an evaluator. title: EvaluatorArgumentsType type_:EvaluatorReturnTypeEnum: type: string enum: - boolean - number - select - multi_select - text description: Enum representing the possible return types of an evaluator. title: EvaluatorReturnTypeEnum type_:Valence: type: string enum: - positive - negative - neutral description: An enumeration. title: Valence type_:EvaluatorJudgmentOptionResponse: type: object properties: name: type: string description: The name of the option. valence: $ref: '#/components/schemas/type_:Valence' description: Whether this option should be considered positive or negative. required: - name title: EvaluatorJudgmentOptionResponse type_:EvaluatorJudgmentNumberLimit: type: object properties: min: type: number format: double description: The minimum value that can be selected. max: type: number format: double description: The maximum value that can be selected. step: type: number format: double description: The step size for the number input. title: EvaluatorJudgmentNumberLimit type_:PromptKernelRequestTemplate: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: >- 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}}`. title: PromptKernelRequestTemplate type_:PromptKernelRequestStop: oneOf: - type: string - type: array items: type: string description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. title: PromptKernelRequestStop type_:PromptKernelRequestReasoningEffort: oneOf: - $ref: '#/components/schemas/type_:OpenAiReasoningEffort' - type: integer description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. title: PromptKernelRequestReasoningEffort type_:PromptKernelRequest: type: object properties: model: type: string description: >- The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models) endpoint: $ref: '#/components/schemas/type_:ModelEndpoints' description: The provider model endpoint used. template: $ref: '#/components/schemas/type_:PromptKernelRequestTemplate' description: >- 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}}`. template_language: $ref: '#/components/schemas/type_:TemplateLanguage' description: The template language to use for rendering the template. provider: $ref: '#/components/schemas/type_:ModelProviders' description: The company providing the underlying model service. max_tokens: type: integer default: -1 description: >- 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 temperature: type: number format: double default: 1 description: >- What sampling temperature to use when making a generation. Higher values means the model will be more creative. top_p: type: number format: double default: 1 description: >- An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. stop: $ref: '#/components/schemas/type_:PromptKernelRequestStop' description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. presence_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far. frequency_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far. other: type: object additionalProperties: description: Any type description: Other parameter values to be passed to the provider call. seed: type: integer description: >- If specified, model will make a best effort to sample deterministically, but it is not guaranteed. response_format: $ref: '#/components/schemas/type_:ResponseFormat' description: >- The format of the response. Only `{"type": "json_object"}` is currently supported for chat. reasoning_effort: $ref: '#/components/schemas/type_:PromptKernelRequestReasoningEffort' description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. tools: type: array items: $ref: '#/components/schemas/type_:ToolFunction' description: >- The tool specification that the model can choose to call if Tool calling is supported. linked_tools: type: array items: type: string description: >- 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. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used. required: - model description: |- Base class used by both PromptKernelRequest and AgentKernelRequest. Contains the consistent Prompt-related fields. title: PromptKernelRequest type_:LlmEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:EvaluatorReturnTypeEnum' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: >- The options that can be applied as judgments. Only for Evaluators with `return_type` of 'boolean', 'select' or 'multi_select'. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - llm prompt: $ref: '#/components/schemas/type_:PromptKernelRequest' description: The prompt parameters used to generate. required: - arguments_type - return_type - evaluator_type title: LlmEvaluatorRequest type_:CodeEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:EvaluatorReturnTypeEnum' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: >- The options that can be applied as judgments. Only for Evaluators with `return_type` of 'boolean', 'select' or 'multi_select'. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - python code: type: string description: >- The code for the Evaluator. This code will be executed in a sandboxed environment. required: - arguments_type - return_type - evaluator_type - code title: CodeEvaluatorRequest type_:HumanEvaluatorRequestReturnType: type: string enum: - select - multi_select - text - number - boolean description: The type of the return value of the Evaluator. title: HumanEvaluatorRequestReturnType type_:HumanEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:HumanEvaluatorRequestReturnType' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: The options that can be applied as judgments. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - human instructions: type: string description: Instructions and guidelines for applying judgments. required: - arguments_type - return_type - evaluator_type title: HumanEvaluatorRequest type_:ExternalEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:EvaluatorReturnTypeEnum' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: >- The options that can be applied as judgments. Only for Evaluators with `return_type` of 'boolean', 'select' or 'multi_select'. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - external required: - arguments_type - return_type - evaluator_type title: ExternalEvaluatorRequest type_:EvaluatorResponseSpec: oneOf: - $ref: '#/components/schemas/type_:LlmEvaluatorRequest' - $ref: '#/components/schemas/type_:CodeEvaluatorRequest' - $ref: '#/components/schemas/type_:HumanEvaluatorRequest' - $ref: '#/components/schemas/type_:ExternalEvaluatorRequest' title: EvaluatorResponseSpec type_:EvaluatorResponse: type: object properties: path: type: string description: >- Path of the Evaluator including the Evaluator name, which is used as a unique identifier. id: type: string description: Unique identifier for the Evaluator. directory_id: type: string description: ID of the directory that the file is in on Humanloop. version_name: type: string description: >- Unique name for the Evaluator version. Version names must be unique for a given Evaluator. version_description: type: string description: Description of the version, e.g., the changes made in this version. spec: $ref: '#/components/schemas/type_:EvaluatorResponseSpec' name: type: string description: Name of the Evaluator, which is used as a unique identifier. description: type: string description: Description of the Evaluator. schema: type: object additionalProperties: description: Any type description: The JSON schema for the File. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Evaluator Version. If no query params provided, the default deployed Evaluator Version is returned. type: type: string enum: - evaluator environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Evaluator Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Evaluator. last_used_at: type: string format: date-time version_logs_count: type: integer description: >- The number of logs that have been generated for this Evaluator Version total_logs_count: type: integer description: >- The number of logs that have been generated across all Evaluator Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Evaluator. Inputs correspond to any of the variables used within the Evaluator template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Evaluator that are used for monitoring logs. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Evaluator Version. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. required: - path - id - spec - name - version_id - created_at - updated_at - last_used_at - version_logs_count - total_logs_count - inputs description: Version of the Evaluator used to provide judgments. title: EvaluatorResponse type_:FlowResponse: type: object properties: path: type: string description: >- Path of the Flow, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Flow. directory_id: type: string description: ID of the directory that the file is in on Humanloop. attributes: type: object additionalProperties: description: Any type description: A key-value object identifying the Flow Version. version_name: type: string description: >- Unique name for the Flow version. Version names must be unique for a given Flow. version_description: type: string description: Description of the Version. name: type: string description: Name of the Flow. description: type: string description: Description of the Flow. schema: type: object additionalProperties: description: Any type description: The JSON schema for the File. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Flow Version. If no query params provided, the default deployed Flow Version is returned. type: type: string enum: - flow environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Flow Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Flow. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Flow Version evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Flow Version. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: The list of Monitoring Evaluators associated with the Flow Version. required: - path - id - attributes - name - version_id - created_at - updated_at - last_used_at - version_logs_count description: Response model for a Flow. title: FlowResponse type_:VersionDeploymentResponseFile: oneOf: - $ref: '#/components/schemas/type_:PromptResponse' - $ref: '#/components/schemas/type_:ToolResponse' - $ref: '#/components/schemas/type_:DatasetResponse' - $ref: '#/components/schemas/type_:EvaluatorResponse' - $ref: '#/components/schemas/type_:FlowResponse' - $ref: '#/components/schemas/type_:AgentResponse' description: The File that the deployed Version belongs to. title: VersionDeploymentResponseFile type_:VersionDeploymentResponse: type: object properties: file: $ref: '#/components/schemas/type_:VersionDeploymentResponseFile' description: The File that the deployed Version belongs to. environment: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The Environment that the Version is deployed to. type: type: string enum: - environment required: - file - environment - type description: A variable reference to the Version deployed to an Environment title: VersionDeploymentResponse type_:VersionIdResponseVersion: oneOf: - $ref: '#/components/schemas/type_:PromptResponse' - $ref: '#/components/schemas/type_:ToolResponse' - $ref: '#/components/schemas/type_:DatasetResponse' - $ref: '#/components/schemas/type_:EvaluatorResponse' - $ref: '#/components/schemas/type_:FlowResponse' - $ref: '#/components/schemas/type_:AgentResponse' description: The specific Version being referenced. title: VersionIdResponseVersion type_:VersionIdResponse: type: object properties: version: $ref: '#/components/schemas/type_:VersionIdResponseVersion' description: The specific Version being referenced. type: type: string enum: - version required: - version - type description: A reference to a specific Version by its ID title: VersionIdResponse type_:VersionReferenceResponse: oneOf: - $ref: '#/components/schemas/type_:VersionDeploymentResponse' - $ref: '#/components/schemas/type_:VersionIdResponse' title: VersionReferenceResponse type_:MonitoringEvaluatorState: type: string enum: - active - inactive description: State of an evaluator connected to a file title: MonitoringEvaluatorState type_:MonitoringEvaluatorResponse: type: object properties: version_reference: $ref: '#/components/schemas/type_:VersionReferenceResponse' description: >- The Evaluator Version used for monitoring. This can be a specific Version by ID, or a Version deployed to an Environment. version: $ref: '#/components/schemas/type_:EvaluatorResponse' description: The deployed Version. state: $ref: '#/components/schemas/type_:MonitoringEvaluatorState' description: The state of the Monitoring Evaluator. Either `active` or `inactive` created_at: type: string format: date-time updated_at: type: string format: date-time required: - version_reference - state - created_at - updated_at title: MonitoringEvaluatorResponse type_:PromptResponse: type: object properties: path: type: string description: >- Path of the Prompt, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Prompt. directory_id: type: string description: ID of the directory that the file is in on Humanloop. model: type: string description: >- The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models) endpoint: $ref: '#/components/schemas/type_:ModelEndpoints' description: The provider model endpoint used. template: $ref: '#/components/schemas/type_:PromptResponseTemplate' description: >- 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}}`. template_language: $ref: '#/components/schemas/type_:TemplateLanguage' description: The template language to use for rendering the template. provider: $ref: '#/components/schemas/type_:ModelProviders' description: The company providing the underlying model service. max_tokens: type: integer default: -1 description: >- 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 temperature: type: number format: double default: 1 description: >- What sampling temperature to use when making a generation. Higher values means the model will be more creative. top_p: type: number format: double default: 1 description: >- An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. stop: $ref: '#/components/schemas/type_:PromptResponseStop' description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. presence_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far. frequency_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far. other: type: object additionalProperties: description: Any type description: Other parameter values to be passed to the provider call. seed: type: integer description: >- If specified, model will make a best effort to sample deterministically, but it is not guaranteed. response_format: $ref: '#/components/schemas/type_:ResponseFormat' description: >- The format of the response. Only `{"type": "json_object"}` is currently supported for chat. reasoning_effort: $ref: '#/components/schemas/type_:PromptResponseReasoningEffort' description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. tools: type: array items: $ref: '#/components/schemas/type_:ToolFunction' description: >- The tool specification that the model can choose to call if Tool calling is supported. linked_tools: type: array items: $ref: '#/components/schemas/type_:LinkedToolResponse' description: The tools linked to your prompt that the model can call. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used. version_name: type: string description: >- Unique name for the Prompt version. Version names must be unique for a given Prompt. version_description: type: string description: Description of the version, e.g., the changes made in this version. description: type: string description: Description of the Prompt. tags: type: array items: type: string description: List of tags associated with the file. readme: type: string description: Long description of the file. name: type: string description: Name of the Prompt. schema: type: object additionalProperties: description: Any type description: The JSON schema for the Prompt. version_id: type: string description: >- Unique identifier for the specific Prompt Version. If no query params provided, the default deployed Prompt Version is returned. type: type: string enum: - prompt environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Prompt Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Prompt. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Prompt Version total_logs_count: type: integer description: >- The number of logs that have been generated across all Prompt Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Prompt. Inputs correspond to any of the variables used within the Prompt template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Prompt that are used for monitoring logs. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Prompt Version. raw_file_content: type: string description: The raw content of the Prompt. Corresponds to the .prompt file. required: - path - id - model - name - version_id - created_at - updated_at - last_used_at - version_logs_count - total_logs_count - inputs description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: PromptResponse type_:AgentLinkedFileResponseFile: oneOf: - $ref: '#/components/schemas/type_:PromptResponse' - $ref: '#/components/schemas/type_:ToolResponse' - $ref: '#/components/schemas/type_:DatasetResponse' - $ref: '#/components/schemas/type_:EvaluatorResponse' - $ref: '#/components/schemas/type_:FlowResponse' - $ref: '#/components/schemas/type_:AgentResponse' title: AgentLinkedFileResponseFile type_:AgentLinkedFileResponse: type: object properties: type: type: string enum: - file link: $ref: '#/components/schemas/type_:LinkedFileRequest' on_agent_call: $ref: '#/components/schemas/type_:OnAgentCallEnum' file: $ref: '#/components/schemas/type_:AgentLinkedFileResponseFile' required: - type - link title: AgentLinkedFileResponse type_:AgentInlineTool: type: object properties: type: type: string enum: - inline json_schema: $ref: '#/components/schemas/type_:ToolFunction' on_agent_call: $ref: '#/components/schemas/type_:OnAgentCallEnum' required: - type - json_schema title: AgentInlineTool type_:AgentResponseToolsItem: oneOf: - $ref: '#/components/schemas/type_:AgentLinkedFileResponse' - $ref: '#/components/schemas/type_:AgentInlineTool' title: AgentResponseToolsItem type_:VersionStatus: type: string enum: - uncommitted - committed - deleted description: An enumeration. title: VersionStatus type_:AgentResponse: type: object properties: path: type: string description: >- Path of the Agent, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Agent. directory_id: type: string description: ID of the directory that the file is in on Humanloop. model: type: string description: >- The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models) endpoint: $ref: '#/components/schemas/type_:ModelEndpoints' description: The provider model endpoint used. template: $ref: '#/components/schemas/type_:AgentResponseTemplate' description: >- 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}}`. template_language: $ref: '#/components/schemas/type_:TemplateLanguage' description: The template language to use for rendering the template. provider: $ref: '#/components/schemas/type_:ModelProviders' description: The company providing the underlying model service. max_tokens: type: integer default: -1 description: >- 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 temperature: type: number format: double default: 1 description: >- What sampling temperature to use when making a generation. Higher values means the model will be more creative. top_p: type: number format: double default: 1 description: >- An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. stop: $ref: '#/components/schemas/type_:AgentResponseStop' description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. presence_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far. frequency_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far. other: type: object additionalProperties: description: Any type description: Other parameter values to be passed to the provider call. seed: type: integer description: >- If specified, model will make a best effort to sample deterministically, but it is not guaranteed. response_format: $ref: '#/components/schemas/type_:ResponseFormat' description: >- The format of the response. Only `{"type": "json_object"}` is currently supported for chat. reasoning_effort: $ref: '#/components/schemas/type_:AgentResponseReasoningEffort' description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. tools: type: array items: $ref: '#/components/schemas/type_:AgentResponseToolsItem' description: >- List of tools that the Agent can call. These can be linked files or inline tools. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used. max_iterations: type: integer description: >- The maximum number of iterations the Agent can run. This is used to limit the number of times the Agent model is called. version_name: type: string description: >- Unique name for the Agent version. Version names must be unique for a given Agent. version_description: type: string description: Description of the version, e.g., the changes made in this version. description: type: string description: Description of the Agent. tags: type: array items: type: string description: List of tags associated with the file. readme: type: string description: Long description of the file. name: type: string description: Name of the Agent. schema: type: object additionalProperties: description: Any type description: The JSON schema for the Prompt. version_id: type: string description: >- Unique identifier for the specific Agent Version. If no query params provided, the default deployed Agent Version is returned. type: type: string enum: - agent environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Agent Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Agent. committed_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who committed the Agent Version. committed_at: type: string format: date-time description: The date and time the Agent Version was committed. status: $ref: '#/components/schemas/type_:VersionStatus' description: The status of the Agent Version. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Agent Version total_logs_count: type: integer description: >- The number of logs that have been generated across all Agent Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Agent. Inputs correspond to any of the variables used within the Agent template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Agent that are used for monitoring logs. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Agent Version. raw_file_content: type: string description: The raw content of the Agent. Corresponds to the .agent file. required: - path - id - model - tools - name - version_id - created_at - updated_at - status - last_used_at - version_logs_count - total_logs_count - inputs description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: AgentResponse type_:PaginatedDataAgentResponse: type: object properties: records: type: array items: $ref: '#/components/schemas/type_:AgentResponse' page: type: integer size: type: integer total: type: integer required: - records - page - size - total title: PaginatedDataAgentResponse type_:ValidationErrorLocItem: oneOf: - type: string - type: integer title: ValidationErrorLocItem type_:ValidationError: type: object properties: loc: type: array items: $ref: '#/components/schemas/type_:ValidationErrorLocItem' msg: type: string type: type: string required: - loc - msg - type title: ValidationError type_:HttpValidationError: type: object properties: detail: type: array items: $ref: '#/components/schemas/type_:ValidationError' title: HttpValidationError securitySchemes: default: type: apiKey in: header name: X-API-KEY ``` ## SDK Code Examples ```python import requests url = "https://api.humanloop.com/v5/agents" querystring = {"size":"1"} headers = {"X-API-KEY": " "} response = requests.get(url, headers=headers, params=querystring) print(response.json()) ``` ```typescript import { HumanloopClient } from "humanloop"; const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); const response = await client.agents.list({ size: 1 }); for await (const item of response) { console.log(item); } // Or you can manually iterate page-by-page const page = await client.agents.list({ size: 1 }); while (page.hasNextPage()) { page = page.getNextPage(); } ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/agents?size=1" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("X-API-KEY", " ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://api.humanloop.com/v5/agents?size=1") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["X-API-KEY"] = ' ' response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api.humanloop.com/v5/agents?size=1") .header("X-API-KEY", " ") .asString(); ``` ```php request('GET', 'https://api.humanloop.com/v5/agents?size=1', [ 'headers' => [ 'X-API-KEY' => ' ', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/agents?size=1"); var request = new RestRequest(Method.GET); request.AddHeader("X-API-KEY", " "); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = ["X-API-KEY": " "] let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/agents?size=1")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. # Upsert Agent POST https://api.humanloop.com/v5/agents Content-Type: application/json Create an Agent or update it with a new version if it already exists. Agents are identified by the `ID` or their `path`. The parameters (i.e. the template, temperature, model etc.) and tools determine the versions of the Agent. You can provide `version_name` and `version_description` to identify and describe your versions. Version names must be unique within an Agent - attempting to create a version with a name that already exists will result in a 409 Conflict error. Reference: https://humanloop.com/docs/api/agents/upsert ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /agents: post: operationId: upsert summary: Upsert Agent description: >- Create an Agent or update it with a new version if it already exists. Agents are identified by the `ID` or their `path`. The parameters (i.e. the template, temperature, model etc.) and tools determine the versions of the Agent. You can provide `version_name` and `version_description` to identify and describe your versions. Version names must be unique within an Agent - attempting to create a version with a name that already exists will result in a 409 Conflict error. tags: - subpackage_agents parameters: - name: X-API-KEY in: header required: true schema: type: string responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/type_:AgentResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/type_:HttpValidationError' requestBody: content: application/json: schema: type: object properties: path: type: string description: >- Path of the Agent, including the name. This locates the Agent in the Humanloop filesystem and is used as as a unique identifier. For example: `folder/name` or just `name`. id: type: string description: ID for an existing Agent. model: type: string description: >- The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models) endpoint: $ref: '#/components/schemas/type_:ModelEndpoints' description: The provider model endpoint used. template: $ref: '#/components/schemas/type_agents:AgentRequestTemplate' description: >- 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}}`. template_language: $ref: '#/components/schemas/type_:TemplateLanguage' description: The template language to use for rendering the template. provider: $ref: '#/components/schemas/type_:ModelProviders' description: The company providing the underlying model service. max_tokens: type: integer default: -1 description: >- 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 temperature: type: number format: double default: 1 description: >- What sampling temperature to use when making a generation. Higher values means the model will be more creative. top_p: type: number format: double default: 1 description: >- An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. stop: $ref: '#/components/schemas/type_agents:AgentRequestStop' description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. presence_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far. frequency_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far. other: type: object additionalProperties: description: Any type description: Other parameter values to be passed to the provider call. seed: type: integer description: >- If specified, model will make a best effort to sample deterministically, but it is not guaranteed. response_format: $ref: '#/components/schemas/type_:ResponseFormat' description: >- The format of the response. Only `{"type": "json_object"}` is currently supported for chat. reasoning_effort: $ref: '#/components/schemas/type_agents:AgentRequestReasoningEffort' description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. tools: type: array items: $ref: '#/components/schemas/type_agents:AgentRequestToolsItem' attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used. max_iterations: type: integer description: >- The maximum number of iterations the Agent can run. This is used to limit the number of times the Agent model is called. version_name: type: string description: >- Unique name for the Prompt version. Each Prompt can only have one version with a given name. version_description: type: string description: Description of the Version. description: type: string description: Description of the Prompt. tags: type: array items: type: string description: List of tags associated with this prompt. readme: type: string description: Long description of the Prompt. required: - model servers: - url: https://api.humanloop.com/v5 components: schemas: type_:ModelEndpoints: type: string enum: - complete - chat - edit description: Supported model provider endpoints. title: ModelEndpoints type_:TextChatContent: type: object properties: type: type: string enum: - text text: type: string description: The message's text content. required: - type - text title: TextChatContent type_:ImageUrlDetail: type: string enum: - high - low - auto description: >- Specify the detail level of the image provided to the model. For more details see: https://platform.openai.com/docs/guides/vision/low-or-high-fidelity-image-understanding title: ImageUrlDetail type_:ImageUrl: type: object properties: url: type: string description: Either a URL of the image or the base64 encoded image data. detail: $ref: '#/components/schemas/type_:ImageUrlDetail' description: >- Specify the detail level of the image provided to the model. For more details see: https://platform.openai.com/docs/guides/vision/low-or-high-fidelity-image-understanding required: - url title: ImageUrl type_:ImageChatContent: type: object properties: type: type: string enum: - image_url image_url: $ref: '#/components/schemas/type_:ImageUrl' description: The message's image content. required: - type - image_url title: ImageChatContent type_:ChatMessageContentItem: oneOf: - $ref: '#/components/schemas/type_:TextChatContent' - $ref: '#/components/schemas/type_:ImageChatContent' title: ChatMessageContentItem type_:ChatMessageContent: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessageContentItem' description: The content of the message. title: ChatMessageContent type_:ChatRole: type: string enum: - user - assistant - system - tool - developer description: An enumeration. title: ChatRole type_:ChatToolType: type: string enum: - function description: The type of tool to call. title: ChatToolType type_:FunctionTool: type: object properties: name: type: string arguments: type: string required: - name description: A function tool to be called by the model where user owns runtime. title: FunctionTool type_:ToolCall: type: object properties: id: type: string type: $ref: '#/components/schemas/type_:ChatToolType' function: $ref: '#/components/schemas/type_:FunctionTool' required: - id - type - function description: A tool call to be made. title: ToolCall type_:AnthropicThinkingContent: type: object properties: type: type: string enum: - thinking thinking: type: string description: Model's chain-of-thought for providing the response. signature: type: string description: >- Cryptographic signature that verifies the thinking block was generated by Anthropic. required: - type - thinking - signature title: AnthropicThinkingContent type_:AnthropicRedactedThinkingContent: type: object properties: type: type: string enum: - redacted_thinking data: type: string description: >- Thinking block Anthropic redacted for safety reasons. User is expected to pass the block back to Anthropic required: - type - data title: AnthropicRedactedThinkingContent type_:ChatMessageThinkingItem: oneOf: - $ref: '#/components/schemas/type_:AnthropicThinkingContent' - $ref: '#/components/schemas/type_:AnthropicRedactedThinkingContent' title: ChatMessageThinkingItem type_:ChatMessage: type: object properties: content: $ref: '#/components/schemas/type_:ChatMessageContent' description: The content of the message. name: type: string description: Optional name of the message author. tool_call_id: type: string description: Tool call that this message is responding to. role: $ref: '#/components/schemas/type_:ChatRole' description: Role of the message author. tool_calls: type: array items: $ref: '#/components/schemas/type_:ToolCall' description: A list of tool calls requested by the assistant. thinking: type: array items: $ref: '#/components/schemas/type_:ChatMessageThinkingItem' description: >- Model's chain-of-thought for providing the response. Present on assistant messages if model supports it. required: - role title: ChatMessage type_agents:AgentRequestTemplate: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: >- 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}}`. title: AgentRequestTemplate type_:TemplateLanguage: type: string enum: - default - jinja description: Template engine to use for rendering templates. title: TemplateLanguage type_:ModelProviders: type: string enum: - anthropic - bedrock - cohere - deepseek - google - groq - mock - openai - openai_azure - replicate description: Supported model providers. title: ModelProviders type_agents:AgentRequestStop: oneOf: - type: string - type: array items: type: string description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. title: AgentRequestStop type_:ResponseFormatType: type: string enum: - json_object - json_schema title: ResponseFormatType type_:ResponseFormat: type: object properties: type: $ref: '#/components/schemas/type_:ResponseFormatType' json_schema: type: object additionalProperties: description: Any type description: The JSON schema of the response format if type is json_schema. required: - type description: Response format of the model. title: ResponseFormat type_:OpenAiReasoningEffort: type: string enum: - high - medium - low description: Supported reasoning effort. title: OpenAiReasoningEffort type_agents:AgentRequestReasoningEffort: oneOf: - $ref: '#/components/schemas/type_:OpenAiReasoningEffort' - type: integer description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. title: AgentRequestReasoningEffort type_:LinkedFileRequest: type: object properties: file_id: type: string environment_id: type: string version_id: type: string required: - file_id title: LinkedFileRequest type_:OnAgentCallEnum: type: string enum: - stop - continue description: What an Agent should do when calling a Tool. title: OnAgentCallEnum type_:AgentLinkedFileRequest: type: object properties: type: type: string enum: - file link: $ref: '#/components/schemas/type_:LinkedFileRequest' on_agent_call: $ref: '#/components/schemas/type_:OnAgentCallEnum' required: - type - link title: AgentLinkedFileRequest type_:ToolFunction: type: object properties: name: type: string description: Name for the tool referenced by the model. description: type: string description: Description of the tool referenced by the model strict: type: boolean default: false description: >- If true, forces the model to output json data in the structure of the parameters schema. parameters: type: object additionalProperties: description: Any type description: >- Parameters needed to run the Tool, defined in JSON Schema format: https://json-schema.org/ required: - name - description title: ToolFunction type_:AgentInlineTool: type: object properties: type: type: string enum: - inline json_schema: $ref: '#/components/schemas/type_:ToolFunction' on_agent_call: $ref: '#/components/schemas/type_:OnAgentCallEnum' required: - type - json_schema title: AgentInlineTool type_agents:AgentRequestToolsItem: oneOf: - $ref: '#/components/schemas/type_:AgentLinkedFileRequest' - $ref: '#/components/schemas/type_:AgentInlineTool' title: AgentRequestToolsItem type_:AgentResponseTemplate: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: >- 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}}`. title: AgentResponseTemplate type_:AgentResponseStop: oneOf: - type: string - type: array items: type: string description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. title: AgentResponseStop type_:AgentResponseReasoningEffort: oneOf: - $ref: '#/components/schemas/type_:OpenAiReasoningEffort' - type: integer description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. title: AgentResponseReasoningEffort type_:PromptResponseTemplate: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: >- 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}}`. title: PromptResponseTemplate type_:PromptResponseStop: oneOf: - type: string - type: array items: type: string description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. title: PromptResponseStop type_:PromptResponseReasoningEffort: oneOf: - $ref: '#/components/schemas/type_:OpenAiReasoningEffort' - type: integer description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. title: PromptResponseReasoningEffort type_:LinkedToolResponse: type: object properties: name: type: string description: Name for the tool referenced by the model. description: type: string description: Description of the tool referenced by the model strict: type: boolean default: false description: >- If true, forces the model to output json data in the structure of the parameters schema. parameters: type: object additionalProperties: description: Any type description: >- Parameters needed to run the Tool, defined in JSON Schema format: https://json-schema.org/ id: type: string description: Unique identifier for the Tool linked. version_id: type: string description: Unique identifier for the Tool Version linked. required: - name - description - id - version_id title: LinkedToolResponse type_:EnvironmentTag: type: string enum: - default - other description: An enumeration. title: EnvironmentTag type_:EnvironmentResponse: type: object properties: id: type: string created_at: type: string format: date-time name: type: string tag: $ref: '#/components/schemas/type_:EnvironmentTag' required: - id - created_at - name - tag title: EnvironmentResponse type_:UserResponse: description: Any type title: UserResponse type_:InputResponse: type: object properties: name: type: string description: Type of input. required: - name title: InputResponse type_:FilesToolType: type: string enum: - pinecone_search - google - mock - snippet - json_schema - get_api_call - python description: Type of tool. title: FilesToolType type_:EvaluatorAggregate: type: object properties: value: type: number format: double description: The aggregated value of the evaluator. evaluator_id: type: string description: ID of the evaluator. evaluator_version_id: type: string description: ID of the evaluator version. created_at: type: string format: date-time updated_at: type: string format: date-time required: - value - evaluator_id - evaluator_version_id - created_at - updated_at title: EvaluatorAggregate type_:ToolResponse: type: object properties: path: type: string description: >- Path of the Tool, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Tool. directory_id: type: string description: ID of the directory that the file is in on Humanloop. function: $ref: '#/components/schemas/type_:ToolFunction' description: >- Callable function specification of the Tool shown to the model for tool calling. source_code: type: string description: Code source of the Tool. setup_values: type: object additionalProperties: description: Any type description: >- Values needed to setup the Tool, defined in JSON Schema format: https://json-schema.org/ attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Tool. Helpful to separate Tool versions from each other with details on how they were created or used. tool_type: $ref: '#/components/schemas/type_:FilesToolType' description: Type of Tool. version_name: type: string description: >- Unique identifier for this Tool version. Each Tool can only have one version with a given name. version_description: type: string description: Description of the Version. name: type: string description: Name of the Tool, which is used as a unique identifier. description: type: string description: Description of the Tool. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Tool Version. If no query params provided, the default deployed Tool Version is returned. type: type: string enum: - tool environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Tool Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Tool. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Tool Version total_logs_count: type: integer description: The number of logs that have been generated across all Tool Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Prompt. Inputs correspond to any of the variables used within the Tool template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Tool that are used for monitoring logs. signature: type: string description: Signature of the Tool. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Tool Version. required: - path - id - name - version_id - created_at - updated_at - last_used_at - version_logs_count - total_logs_count - inputs description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: ToolResponse type_:DatapointResponseTargetValue: oneOf: - type: string - type: integer - type: number format: double - type: boolean - type: array items: description: Any type - type: object additionalProperties: description: Any type title: DatapointResponseTargetValue type_:DatapointResponse: type: object properties: inputs: type: object additionalProperties: type: string description: The inputs to the prompt template. messages: type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: List of chat messages to provide to the model. target: type: object additionalProperties: $ref: '#/components/schemas/type_:DatapointResponseTargetValue' description: >- Object with criteria necessary to evaluate generations with this Datapoint. This is passed in as an argument to Evaluators when used in an Evaluation. id: type: string description: Unique identifier for the Datapoint. Starts with `dp_`. required: - id title: DatapointResponse type_:DatasetResponse: type: object properties: path: type: string description: >- Path of the Dataset, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Dataset. Starts with `ds_`. directory_id: type: string description: ID of the directory that the file is in on Humanloop. name: type: string description: Name of the Dataset, which is used as a unique identifier. description: type: string description: Description of the Dataset. schema: type: object additionalProperties: description: Any type description: The JSON schema for the File. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Dataset Version. If no query params provided, the default deployed Dataset Version is returned. Starts with `dsv_`. type: type: string enum: - dataset environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Dataset Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Dataset. last_used_at: type: string format: date-time version_name: type: string description: >- Unique name for the Dataset version. Version names must be unique for a given Dataset. version_description: type: string description: Description of the version, e.g., the changes made in this version. datapoints_count: type: integer description: The number of Datapoints in this Dataset version. datapoints: type: array items: $ref: '#/components/schemas/type_:DatapointResponse' description: >- The list of Datapoints in this Dataset version. Only provided if explicitly requested. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Dataset. Helpful to separate Dataset versions from each other with details on how they were created or used. required: - path - id - name - version_id - created_at - updated_at - last_used_at - datapoints_count description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: DatasetResponse type_:EvaluatorArgumentsType: type: string enum: - target_free - target_required description: Enum representing the possible argument types of an evaluator. title: EvaluatorArgumentsType type_:EvaluatorReturnTypeEnum: type: string enum: - boolean - number - select - multi_select - text description: Enum representing the possible return types of an evaluator. title: EvaluatorReturnTypeEnum type_:Valence: type: string enum: - positive - negative - neutral description: An enumeration. title: Valence type_:EvaluatorJudgmentOptionResponse: type: object properties: name: type: string description: The name of the option. valence: $ref: '#/components/schemas/type_:Valence' description: Whether this option should be considered positive or negative. required: - name title: EvaluatorJudgmentOptionResponse type_:EvaluatorJudgmentNumberLimit: type: object properties: min: type: number format: double description: The minimum value that can be selected. max: type: number format: double description: The maximum value that can be selected. step: type: number format: double description: The step size for the number input. title: EvaluatorJudgmentNumberLimit type_:PromptKernelRequestTemplate: oneOf: - type: string - type: array items: $ref: '#/components/schemas/type_:ChatMessage' description: >- 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}}`. title: PromptKernelRequestTemplate type_:PromptKernelRequestStop: oneOf: - type: string - type: array items: type: string description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. title: PromptKernelRequestStop type_:PromptKernelRequestReasoningEffort: oneOf: - $ref: '#/components/schemas/type_:OpenAiReasoningEffort' - type: integer description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. title: PromptKernelRequestReasoningEffort type_:PromptKernelRequest: type: object properties: model: type: string description: >- The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models) endpoint: $ref: '#/components/schemas/type_:ModelEndpoints' description: The provider model endpoint used. template: $ref: '#/components/schemas/type_:PromptKernelRequestTemplate' description: >- 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}}`. template_language: $ref: '#/components/schemas/type_:TemplateLanguage' description: The template language to use for rendering the template. provider: $ref: '#/components/schemas/type_:ModelProviders' description: The company providing the underlying model service. max_tokens: type: integer default: -1 description: >- 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 temperature: type: number format: double default: 1 description: >- What sampling temperature to use when making a generation. Higher values means the model will be more creative. top_p: type: number format: double default: 1 description: >- An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. stop: $ref: '#/components/schemas/type_:PromptKernelRequestStop' description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. presence_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far. frequency_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far. other: type: object additionalProperties: description: Any type description: Other parameter values to be passed to the provider call. seed: type: integer description: >- If specified, model will make a best effort to sample deterministically, but it is not guaranteed. response_format: $ref: '#/components/schemas/type_:ResponseFormat' description: >- The format of the response. Only `{"type": "json_object"}` is currently supported for chat. reasoning_effort: $ref: '#/components/schemas/type_:PromptKernelRequestReasoningEffort' description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. tools: type: array items: $ref: '#/components/schemas/type_:ToolFunction' description: >- The tool specification that the model can choose to call if Tool calling is supported. linked_tools: type: array items: type: string description: >- 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. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used. required: - model description: |- Base class used by both PromptKernelRequest and AgentKernelRequest. Contains the consistent Prompt-related fields. title: PromptKernelRequest type_:LlmEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:EvaluatorReturnTypeEnum' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: >- The options that can be applied as judgments. Only for Evaluators with `return_type` of 'boolean', 'select' or 'multi_select'. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - llm prompt: $ref: '#/components/schemas/type_:PromptKernelRequest' description: The prompt parameters used to generate. required: - arguments_type - return_type - evaluator_type title: LlmEvaluatorRequest type_:CodeEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:EvaluatorReturnTypeEnum' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: >- The options that can be applied as judgments. Only for Evaluators with `return_type` of 'boolean', 'select' or 'multi_select'. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - python code: type: string description: >- The code for the Evaluator. This code will be executed in a sandboxed environment. required: - arguments_type - return_type - evaluator_type - code title: CodeEvaluatorRequest type_:HumanEvaluatorRequestReturnType: type: string enum: - select - multi_select - text - number - boolean description: The type of the return value of the Evaluator. title: HumanEvaluatorRequestReturnType type_:HumanEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:HumanEvaluatorRequestReturnType' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: The options that can be applied as judgments. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - human instructions: type: string description: Instructions and guidelines for applying judgments. required: - arguments_type - return_type - evaluator_type title: HumanEvaluatorRequest type_:ExternalEvaluatorRequest: type: object properties: arguments_type: $ref: '#/components/schemas/type_:EvaluatorArgumentsType' description: Whether this Evaluator is target-free or target-required. return_type: $ref: '#/components/schemas/type_:EvaluatorReturnTypeEnum' description: The type of the return value of the Evaluator. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. options: type: array items: $ref: '#/components/schemas/type_:EvaluatorJudgmentOptionResponse' description: >- The options that can be applied as judgments. Only for Evaluators with `return_type` of 'boolean', 'select' or 'multi_select'. number_limits: $ref: '#/components/schemas/type_:EvaluatorJudgmentNumberLimit' description: >- Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'. number_valence: $ref: '#/components/schemas/type_:Valence' description: >- The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better. evaluator_type: type: string enum: - external required: - arguments_type - return_type - evaluator_type title: ExternalEvaluatorRequest type_:EvaluatorResponseSpec: oneOf: - $ref: '#/components/schemas/type_:LlmEvaluatorRequest' - $ref: '#/components/schemas/type_:CodeEvaluatorRequest' - $ref: '#/components/schemas/type_:HumanEvaluatorRequest' - $ref: '#/components/schemas/type_:ExternalEvaluatorRequest' title: EvaluatorResponseSpec type_:EvaluatorResponse: type: object properties: path: type: string description: >- Path of the Evaluator including the Evaluator name, which is used as a unique identifier. id: type: string description: Unique identifier for the Evaluator. directory_id: type: string description: ID of the directory that the file is in on Humanloop. version_name: type: string description: >- Unique name for the Evaluator version. Version names must be unique for a given Evaluator. version_description: type: string description: Description of the version, e.g., the changes made in this version. spec: $ref: '#/components/schemas/type_:EvaluatorResponseSpec' name: type: string description: Name of the Evaluator, which is used as a unique identifier. description: type: string description: Description of the Evaluator. schema: type: object additionalProperties: description: Any type description: The JSON schema for the File. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Evaluator Version. If no query params provided, the default deployed Evaluator Version is returned. type: type: string enum: - evaluator environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Evaluator Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Evaluator. last_used_at: type: string format: date-time version_logs_count: type: integer description: >- The number of logs that have been generated for this Evaluator Version total_logs_count: type: integer description: >- The number of logs that have been generated across all Evaluator Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Evaluator. Inputs correspond to any of the variables used within the Evaluator template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Evaluator that are used for monitoring logs. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Evaluator Version. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used. required: - path - id - spec - name - version_id - created_at - updated_at - last_used_at - version_logs_count - total_logs_count - inputs description: Version of the Evaluator used to provide judgments. title: EvaluatorResponse type_:FlowResponse: type: object properties: path: type: string description: >- Path of the Flow, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Flow. directory_id: type: string description: ID of the directory that the file is in on Humanloop. attributes: type: object additionalProperties: description: Any type description: A key-value object identifying the Flow Version. version_name: type: string description: >- Unique name for the Flow version. Version names must be unique for a given Flow. version_description: type: string description: Description of the Version. name: type: string description: Name of the Flow. description: type: string description: Description of the Flow. schema: type: object additionalProperties: description: Any type description: The JSON schema for the File. readme: type: string description: Long description of the file. tags: type: array items: type: string description: List of tags associated with the file. version_id: type: string description: >- Unique identifier for the specific Flow Version. If no query params provided, the default deployed Flow Version is returned. type: type: string enum: - flow environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Flow Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Flow. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Flow Version evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Flow Version. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: The list of Monitoring Evaluators associated with the Flow Version. required: - path - id - attributes - name - version_id - created_at - updated_at - last_used_at - version_logs_count description: Response model for a Flow. title: FlowResponse type_:VersionDeploymentResponseFile: oneOf: - $ref: '#/components/schemas/type_:PromptResponse' - $ref: '#/components/schemas/type_:ToolResponse' - $ref: '#/components/schemas/type_:DatasetResponse' - $ref: '#/components/schemas/type_:EvaluatorResponse' - $ref: '#/components/schemas/type_:FlowResponse' - $ref: '#/components/schemas/type_:AgentResponse' description: The File that the deployed Version belongs to. title: VersionDeploymentResponseFile type_:VersionDeploymentResponse: type: object properties: file: $ref: '#/components/schemas/type_:VersionDeploymentResponseFile' description: The File that the deployed Version belongs to. environment: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The Environment that the Version is deployed to. type: type: string enum: - environment required: - file - environment - type description: A variable reference to the Version deployed to an Environment title: VersionDeploymentResponse type_:VersionIdResponseVersion: oneOf: - $ref: '#/components/schemas/type_:PromptResponse' - $ref: '#/components/schemas/type_:ToolResponse' - $ref: '#/components/schemas/type_:DatasetResponse' - $ref: '#/components/schemas/type_:EvaluatorResponse' - $ref: '#/components/schemas/type_:FlowResponse' - $ref: '#/components/schemas/type_:AgentResponse' description: The specific Version being referenced. title: VersionIdResponseVersion type_:VersionIdResponse: type: object properties: version: $ref: '#/components/schemas/type_:VersionIdResponseVersion' description: The specific Version being referenced. type: type: string enum: - version required: - version - type description: A reference to a specific Version by its ID title: VersionIdResponse type_:VersionReferenceResponse: oneOf: - $ref: '#/components/schemas/type_:VersionDeploymentResponse' - $ref: '#/components/schemas/type_:VersionIdResponse' title: VersionReferenceResponse type_:MonitoringEvaluatorState: type: string enum: - active - inactive description: State of an evaluator connected to a file title: MonitoringEvaluatorState type_:MonitoringEvaluatorResponse: type: object properties: version_reference: $ref: '#/components/schemas/type_:VersionReferenceResponse' description: >- The Evaluator Version used for monitoring. This can be a specific Version by ID, or a Version deployed to an Environment. version: $ref: '#/components/schemas/type_:EvaluatorResponse' description: The deployed Version. state: $ref: '#/components/schemas/type_:MonitoringEvaluatorState' description: The state of the Monitoring Evaluator. Either `active` or `inactive` created_at: type: string format: date-time updated_at: type: string format: date-time required: - version_reference - state - created_at - updated_at title: MonitoringEvaluatorResponse type_:PromptResponse: type: object properties: path: type: string description: >- Path of the Prompt, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Prompt. directory_id: type: string description: ID of the directory that the file is in on Humanloop. model: type: string description: >- The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models) endpoint: $ref: '#/components/schemas/type_:ModelEndpoints' description: The provider model endpoint used. template: $ref: '#/components/schemas/type_:PromptResponseTemplate' description: >- 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}}`. template_language: $ref: '#/components/schemas/type_:TemplateLanguage' description: The template language to use for rendering the template. provider: $ref: '#/components/schemas/type_:ModelProviders' description: The company providing the underlying model service. max_tokens: type: integer default: -1 description: >- 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 temperature: type: number format: double default: 1 description: >- What sampling temperature to use when making a generation. Higher values means the model will be more creative. top_p: type: number format: double default: 1 description: >- An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. stop: $ref: '#/components/schemas/type_:PromptResponseStop' description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. presence_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far. frequency_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far. other: type: object additionalProperties: description: Any type description: Other parameter values to be passed to the provider call. seed: type: integer description: >- If specified, model will make a best effort to sample deterministically, but it is not guaranteed. response_format: $ref: '#/components/schemas/type_:ResponseFormat' description: >- The format of the response. Only `{"type": "json_object"}` is currently supported for chat. reasoning_effort: $ref: '#/components/schemas/type_:PromptResponseReasoningEffort' description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. tools: type: array items: $ref: '#/components/schemas/type_:ToolFunction' description: >- The tool specification that the model can choose to call if Tool calling is supported. linked_tools: type: array items: $ref: '#/components/schemas/type_:LinkedToolResponse' description: The tools linked to your prompt that the model can call. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used. version_name: type: string description: >- Unique name for the Prompt version. Version names must be unique for a given Prompt. version_description: type: string description: Description of the version, e.g., the changes made in this version. description: type: string description: Description of the Prompt. tags: type: array items: type: string description: List of tags associated with the file. readme: type: string description: Long description of the file. name: type: string description: Name of the Prompt. schema: type: object additionalProperties: description: Any type description: The JSON schema for the Prompt. version_id: type: string description: >- Unique identifier for the specific Prompt Version. If no query params provided, the default deployed Prompt Version is returned. type: type: string enum: - prompt environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Prompt Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Prompt. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Prompt Version total_logs_count: type: integer description: >- The number of logs that have been generated across all Prompt Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Prompt. Inputs correspond to any of the variables used within the Prompt template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Prompt that are used for monitoring logs. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Prompt Version. raw_file_content: type: string description: The raw content of the Prompt. Corresponds to the .prompt file. required: - path - id - model - name - version_id - created_at - updated_at - last_used_at - version_logs_count - total_logs_count - inputs description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: PromptResponse type_:AgentLinkedFileResponseFile: oneOf: - $ref: '#/components/schemas/type_:PromptResponse' - $ref: '#/components/schemas/type_:ToolResponse' - $ref: '#/components/schemas/type_:DatasetResponse' - $ref: '#/components/schemas/type_:EvaluatorResponse' - $ref: '#/components/schemas/type_:FlowResponse' - $ref: '#/components/schemas/type_:AgentResponse' title: AgentLinkedFileResponseFile type_:AgentLinkedFileResponse: type: object properties: type: type: string enum: - file link: $ref: '#/components/schemas/type_:LinkedFileRequest' on_agent_call: $ref: '#/components/schemas/type_:OnAgentCallEnum' file: $ref: '#/components/schemas/type_:AgentLinkedFileResponseFile' required: - type - link title: AgentLinkedFileResponse type_:AgentResponseToolsItem: oneOf: - $ref: '#/components/schemas/type_:AgentLinkedFileResponse' - $ref: '#/components/schemas/type_:AgentInlineTool' title: AgentResponseToolsItem type_:VersionStatus: type: string enum: - uncommitted - committed - deleted description: An enumeration. title: VersionStatus type_:AgentResponse: type: object properties: path: type: string description: >- Path of the Agent, including the name, which is used as a unique identifier. id: type: string description: Unique identifier for the Agent. directory_id: type: string description: ID of the directory that the file is in on Humanloop. model: type: string description: >- The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models) endpoint: $ref: '#/components/schemas/type_:ModelEndpoints' description: The provider model endpoint used. template: $ref: '#/components/schemas/type_:AgentResponseTemplate' description: >- 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}}`. template_language: $ref: '#/components/schemas/type_:TemplateLanguage' description: The template language to use for rendering the template. provider: $ref: '#/components/schemas/type_:ModelProviders' description: The company providing the underlying model service. max_tokens: type: integer default: -1 description: >- 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 temperature: type: number format: double default: 1 description: >- What sampling temperature to use when making a generation. Higher values means the model will be more creative. top_p: type: number format: double default: 1 description: >- An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. stop: $ref: '#/components/schemas/type_:AgentResponseStop' description: >- The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence. presence_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far. frequency_penalty: type: number format: double default: 0 description: >- Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far. other: type: object additionalProperties: description: Any type description: Other parameter values to be passed to the provider call. seed: type: integer description: >- If specified, model will make a best effort to sample deterministically, but it is not guaranteed. response_format: $ref: '#/components/schemas/type_:ResponseFormat' description: >- The format of the response. Only `{"type": "json_object"}` is currently supported for chat. reasoning_effort: $ref: '#/components/schemas/type_:AgentResponseReasoningEffort' description: >- Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget. tools: type: array items: $ref: '#/components/schemas/type_:AgentResponseToolsItem' description: >- List of tools that the Agent can call. These can be linked files or inline tools. attributes: type: object additionalProperties: description: Any type description: >- Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used. max_iterations: type: integer description: >- The maximum number of iterations the Agent can run. This is used to limit the number of times the Agent model is called. version_name: type: string description: >- Unique name for the Agent version. Version names must be unique for a given Agent. version_description: type: string description: Description of the version, e.g., the changes made in this version. description: type: string description: Description of the Agent. tags: type: array items: type: string description: List of tags associated with the file. readme: type: string description: Long description of the file. name: type: string description: Name of the Agent. schema: type: object additionalProperties: description: Any type description: The JSON schema for the Prompt. version_id: type: string description: >- Unique identifier for the specific Agent Version. If no query params provided, the default deployed Agent Version is returned. type: type: string enum: - agent environments: type: array items: $ref: '#/components/schemas/type_:EnvironmentResponse' description: The list of environments the Agent Version is deployed to. created_at: type: string format: date-time updated_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who created the Agent. committed_by: $ref: '#/components/schemas/type_:UserResponse' description: The user who committed the Agent Version. committed_at: type: string format: date-time description: The date and time the Agent Version was committed. status: $ref: '#/components/schemas/type_:VersionStatus' description: The status of the Agent Version. last_used_at: type: string format: date-time version_logs_count: type: integer description: The number of logs that have been generated for this Agent Version total_logs_count: type: integer description: >- The number of logs that have been generated across all Agent Versions inputs: type: array items: $ref: '#/components/schemas/type_:InputResponse' description: >- Inputs associated to the Agent. Inputs correspond to any of the variables used within the Agent template. evaluators: type: array items: $ref: '#/components/schemas/type_:MonitoringEvaluatorResponse' description: >- Evaluators that have been attached to this Agent that are used for monitoring logs. evaluator_aggregates: type: array items: $ref: '#/components/schemas/type_:EvaluatorAggregate' description: Aggregation of Evaluator results for the Agent Version. raw_file_content: type: string description: The raw content of the Agent. Corresponds to the .agent file. required: - path - id - model - tools - name - version_id - created_at - updated_at - status - last_used_at - version_logs_count - total_logs_count - inputs description: >- Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions. title: AgentResponse type_:ValidationErrorLocItem: oneOf: - type: string - type: integer title: ValidationErrorLocItem type_:ValidationError: type: object properties: loc: type: array items: $ref: '#/components/schemas/type_:ValidationErrorLocItem' msg: type: string type: type: string required: - loc - msg - type title: ValidationError type_:HttpValidationError: type: object properties: detail: type: array items: $ref: '#/components/schemas/type_:ValidationError' title: HttpValidationError securitySchemes: default: type: apiKey in: header name: X-API-KEY ``` ## SDK Code Examples ```python Create agent import requests url = "https://api.humanloop.com/v5/agents" payload = { "model": "claude-3-7-sonnet-latest", "path": "Banking/Teller Agent", "endpoint": "chat", "template": [ { "role": "system", "content": "You are a helpful digital assistant, helping users navigate our digital banking platform." } ], "provider": "anthropic", "reasoning_effort": 1024, "tools": [ { "type": "inline", "json_schema": { "name": "stop", "description": "Call this tool when you have finished your task.", "parameters": { "type": "object", "properties": { "output": { "type": "string", "description": "The final output to return to the user." } }, "additionalProperties": False, "required": ["output"] }, "strict": True }, "on_agent_call": "stop" } ], "max_iterations": 3, "version_name": "teller-agent-v1", "version_description": "Initial version" } headers = { "X-API-KEY": " ", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```typescript Create agent import { HumanloopClient } from "humanloop"; const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); await client.agents.upsert({ path: "Banking/Teller Agent", provider: "anthropic", endpoint: "chat", model: "claude-3-7-sonnet-latest", reasoningEffort: 1024, template: [{ role: "system", content: "You are a helpful digital assistant, helping users navigate our digital banking platform." }], maxIterations: 3, tools: [{ type: "inline", jsonSchema: { name: "stop", description: "Call this tool when you have finished your task.", parameters: { "type": "object", "properties": { "output": { "type": "string", "description": "The final output to return to the user." } }, "additionalProperties": false, "required": [ "output" ] }, strict: true }, onAgentCall: "stop" }], versionName: "teller-agent-v1", versionDescription: "Initial version" }); ``` ```go Create agent package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/agents" payload := strings.NewReader("{\n \"model\": \"claude-3-7-sonnet-latest\",\n \"path\": \"Banking/Teller Agent\",\n \"endpoint\": \"chat\",\n \"template\": [\n {\n \"role\": \"system\",\n \"content\": \"You are a helpful digital assistant, helping users navigate our digital banking platform.\"\n }\n ],\n \"provider\": \"anthropic\",\n \"reasoning_effort\": 1024,\n \"tools\": [\n {\n \"type\": \"inline\",\n \"json_schema\": {\n \"name\": \"stop\",\n \"description\": \"Call this tool when you have finished your task.\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"output\": {\n \"type\": \"string\",\n \"description\": \"The final output to return to the user.\"\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"output\"\n ]\n },\n \"strict\": true\n },\n \"on_agent_call\": \"stop\"\n }\n ],\n \"max_iterations\": 3,\n \"version_name\": \"teller-agent-v1\",\n \"version_description\": \"Initial version\"\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("X-API-KEY", " ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Create agent require 'uri' require 'net/http' url = URI("https://api.humanloop.com/v5/agents") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["X-API-KEY"] = ' ' request["Content-Type"] = 'application/json' request.body = "{\n \"model\": \"claude-3-7-sonnet-latest\",\n \"path\": \"Banking/Teller Agent\",\n \"endpoint\": \"chat\",\n \"template\": [\n {\n \"role\": \"system\",\n \"content\": \"You are a helpful digital assistant, helping users navigate our digital banking platform.\"\n }\n ],\n \"provider\": \"anthropic\",\n \"reasoning_effort\": 1024,\n \"tools\": [\n {\n \"type\": \"inline\",\n \"json_schema\": {\n \"name\": \"stop\",\n \"description\": \"Call this tool when you have finished your task.\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"output\": {\n \"type\": \"string\",\n \"description\": \"The final output to return to the user.\"\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"output\"\n ]\n },\n \"strict\": true\n },\n \"on_agent_call\": \"stop\"\n }\n ],\n \"max_iterations\": 3,\n \"version_name\": \"teller-agent-v1\",\n \"version_description\": \"Initial version\"\n}" response = http.request(request) puts response.read_body ``` ```java Create agent import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.humanloop.com/v5/agents") .header("X-API-KEY", " ") .header("Content-Type", "application/json") .body("{\n \"model\": \"claude-3-7-sonnet-latest\",\n \"path\": \"Banking/Teller Agent\",\n \"endpoint\": \"chat\",\n \"template\": [\n {\n \"role\": \"system\",\n \"content\": \"You are a helpful digital assistant, helping users navigate our digital banking platform.\"\n }\n ],\n \"provider\": \"anthropic\",\n \"reasoning_effort\": 1024,\n \"tools\": [\n {\n \"type\": \"inline\",\n \"json_schema\": {\n \"name\": \"stop\",\n \"description\": \"Call this tool when you have finished your task.\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"output\": {\n \"type\": \"string\",\n \"description\": \"The final output to return to the user.\"\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"output\"\n ]\n },\n \"strict\": true\n },\n \"on_agent_call\": \"stop\"\n }\n ],\n \"max_iterations\": 3,\n \"version_name\": \"teller-agent-v1\",\n \"version_description\": \"Initial version\"\n}") .asString(); ``` ```php Create agent request('POST', 'https://api.humanloop.com/v5/agents', [ 'body' => '{ "model": "claude-3-7-sonnet-latest", "path": "Banking/Teller Agent", "endpoint": "chat", "template": [ { "role": "system", "content": "You are a helpful digital assistant, helping users navigate our digital banking platform." } ], "provider": "anthropic", "reasoning_effort": 1024, "tools": [ { "type": "inline", "json_schema": { "name": "stop", "description": "Call this tool when you have finished your task.", "parameters": { "type": "object", "properties": { "output": { "type": "string", "description": "The final output to return to the user." } }, "additionalProperties": false, "required": [ "output" ] }, "strict": true }, "on_agent_call": "stop" } ], "max_iterations": 3, "version_name": "teller-agent-v1", "version_description": "Initial version" }', 'headers' => [ 'Content-Type' => 'application/json', 'X-API-KEY' => ' ', ], ]); echo $response->getBody(); ``` ```csharp Create agent using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/agents"); var request = new RestRequest(Method.POST); request.AddHeader("X-API-KEY", " "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"model\": \"claude-3-7-sonnet-latest\",\n \"path\": \"Banking/Teller Agent\",\n \"endpoint\": \"chat\",\n \"template\": [\n {\n \"role\": \"system\",\n \"content\": \"You are a helpful digital assistant, helping users navigate our digital banking platform.\"\n }\n ],\n \"provider\": \"anthropic\",\n \"reasoning_effort\": 1024,\n \"tools\": [\n {\n \"type\": \"inline\",\n \"json_schema\": {\n \"name\": \"stop\",\n \"description\": \"Call this tool when you have finished your task.\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"output\": {\n \"type\": \"string\",\n \"description\": \"The final output to return to the user.\"\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"output\"\n ]\n },\n \"strict\": true\n },\n \"on_agent_call\": \"stop\"\n }\n ],\n \"max_iterations\": 3,\n \"version_name\": \"teller-agent-v1\",\n \"version_description\": \"Initial version\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Create agent import Foundation let headers = [ "X-API-KEY": " ", "Content-Type": "application/json" ] let parameters = [ "model": "claude-3-7-sonnet-latest", "path": "Banking/Teller Agent", "endpoint": "chat", "template": [ [ "role": "system", "content": "You are a helpful digital assistant, helping users navigate our digital banking platform." ] ], "provider": "anthropic", "reasoning_effort": 1024, "tools": [ [ "type": "inline", "json_schema": [ "name": "stop", "description": "Call this tool when you have finished your task.", "parameters": [ "type": "object", "properties": ["output": [ "type": "string", "description": "The final output to return to the user." ]], "additionalProperties": false, "required": ["output"] ], "strict": true ], "on_agent_call": "stop" ] ], "max_iterations": 3, "version_name": "teller-agent-v1", "version_description": "Initial version" ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/agents")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://humanloop.com/docs/llms.txt. For full documentation content, see https://humanloop.com/docs/llms-full.txt. # Delete Agent Version DELETE https://api.humanloop.com/v5/agents/{id}/versions/{version_id} Delete a version of the Agent. Reference: https://humanloop.com/docs/api/agents/delete-agent-version ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /agents/{id}/versions/{version_id}: delete: operationId: delete-agent-version summary: Delete Agent Version description: Delete a version of the Agent. tags: - subpackage_agents parameters: - name: id in: path description: Unique identifier for Agent. required: true schema: type: string - name: version_id in: path description: Unique identifier for the specific version of the Agent. required: true schema: type: string - name: X-API-KEY in: header required: true schema: type: string responses: '200': description: Successful response '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/type_:HttpValidationError' servers: - url: https://api.humanloop.com/v5 components: schemas: type_:ValidationErrorLocItem: oneOf: - type: string - type: integer title: ValidationErrorLocItem type_:ValidationError: type: object properties: loc: type: array items: $ref: '#/components/schemas/type_:ValidationErrorLocItem' msg: type: string type: type: string required: - loc - msg - type title: ValidationError type_:HttpValidationError: type: object properties: detail: type: array items: $ref: '#/components/schemas/type_:ValidationError' title: HttpValidationError securitySchemes: default: type: apiKey in: header name: X-API-KEY ``` ## SDK Code Examples ```python Delete version import requests url = "https://api.humanloop.com/v5/agents/ag_1234567890/versions/agv_1234567890" headers = {"X-API-KEY": " "} response = requests.delete(url, headers=headers) print(response.json()) ``` ```typescript Delete version import { HumanloopClient } from "humanloop"; const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); await client.agents.deleteAgentVersion("ag_1234567890", "agv_1234567890"); ``` ```go Delete version package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/agents/ag_1234567890/versions/agv_1234567890" req, _ := http.NewRequest("DELETE", url, nil) req.Header.Add("X-API-KEY", " ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Delete version require 'uri' require 'net/http' url = URI("https://api.humanloop.com/v5/agents/ag_1234567890/versions/agv_1234567890") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Delete.new(url) request["X-API-KEY"] = ' ' response = http.request(request) puts response.read_body ``` ```java Delete version import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse