*** title: Humanloop is the LLM Evals Platform for Enterprises description: Learn how to use Humanloop for prompt engineering, evaluation and monitoring. Comprehensive guides and tutorials for LLMOps. hide-toc: true --------------------- 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 will be sunset on **September 8th, 2025**. If you need to export your data, please see our [Migration Guide](/docs/guides/migrating-from-humanloop). Humanloop enables product teams to build robust AI features with LLMs, using best-in-class tooling for **Evaluation**, **Prompt Management**, and **Observability**. Humanloop The most successful AI teams focus on two best practices: **Evals-driven development**
They put evals at the heart of product development, continuously refining and enhancing AI features through feedback and iteration. **Collaborative development**
They enable non-technical domain experts and PMs to work seamlessly with engineers on prompt engineering and evaluation. ### Get started with Humanloop Humanloop enables you to adopt these best practices. Our evals, prompt engineering and observability are designed to work together in a fast feedback loop. It works both UI-first and code-first so that the experience is great for developers and subject matter experts (SMEs). Get started with evals in code Get started with prompt engineering in our UI Get started with the guides above or learn more about Humanloop's [key concepts](/docs/explanation/files) and [customer stories](https://humanloop.com/customers). *** subtitle: Quickly evaluate your LLM apps and improve them. description: Quickstart guides for evaluating and instrumenting your LLM apps. --------------------- 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. **If you're technical**, get started by evaluating or logging an AI application in code: Create an Eval in code Log your existing app
**Or, if you don't want to touch code**, get started by creating a Prompt or an Eval in the UI: Create a Prompt in the UI Create an Eval in the UI *** 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. ## Prerequisites 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: ```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()); ``` This quickstart will take you through running your first Eval with Humanloop. You'll learn how to trigger an evaluation from code, interpret an eval-report on Humanloop and use it to improve your AI features. ## Create an evals script Add the following code in a file: ```python maxLines=100 from humanloop import Humanloop humanloop = Humanloop(api_key="") checks = humanloop.evaluations.run( name="Initial Test", file={ "path": "Scifi/App", # Replace with your AI model "callable": lambda messages: ( "I'm sorry, Dave. I'm afraid I can't do that." if messages[-1]["content"].lower() == "hal" else "Beep boop!" ) }, # Replace with your test dataset dataset={ "path": "Scifi/Tests", "datapoints": [ { "messages": [ { "role": "system", "content": "You are an AI that responds like famous sci-fi AIs." }, { "role": "user", "content": "HAL" } ], "target": { "output": "I'm sorry, Dave. I'm afraid I can't do that." } }, { "messages": [ { "role": "system", "content": "You are an AI that responds like famous sci-fi AIs." }, { "role": "user", "content": "R2D2" } ], "target": { "output": "Beep boop beep!" } } ] }, evaluators=[ {"path": "Example Evaluators/Code/Exact match"}, {"path": "Example Evaluators/Code/Latency"}, {"path": "Example Evaluators/AI/Semantic similarity"}, ], ) ``` ```typescript maxLines=100 import { HumanloopClient } from "humanloop"; const humanloop = new HumanloopClient({ apiKey: "", }); const checks = humanloop.evaluations.run({ name: "Initial Test", file: { path: "Scifi/App", // Replace with your AI model callable: (inputs, messages) => messages && messages[messages.length - 1].content.toLowerCase() === "hal" ? "I'm sorry, Dave. I'm afraid I can't do that." : "Beep boop!", }, // Replace with your test dataset dataset: { path: "Scifi/Tests", datapoints: [ { messages: [ { role: "system", content: "You are an AI that responds like famous sci-fi AIs.", }, { role: "user", content: "HAL", }, ], target: { output: "I'm sorry, Dave. I'm afraid I can't do that." }, }, { messages: [ { role: "system", content: "You are an AI that responds like famous sci-fi AIs.", }, { role: "user", content: "R2D2", }, ], target: { output: "Beep boop beep!" }, }, ], }, evaluators: [ { path: "Example Evaluators/Code/Exact match" }, { path: "Example Evaluators/Code/Latency" }, { path: "Example Evaluators/AI/Semantic similarity" }, ], }); ``` This sets up the basic structure of an [Evaluation](/docs/guides/evals/overview): 1. A **callable** function that you want to evaluate. The callable should take your inputs and/or messages and returns a string. The `file` argument defines the callable as well as the location of where the evaluation results will appear on Humanloop. 2. A test [Dataset](/docs/explanation/datasets) of inputs and/or messages to run your function over and optional expected targets to evaluate against. 3. A set of [Evaluators](/docs/explanation/evaluators) to provide judgments on the output of your function. This example uses default evaluators that come with every Humanloop workspace. Evaluators can also be defined locally and pushed to the Humanloop runtime. It returns a `checks` object that contains the results of the eval per Evaluator. ## Run your script Run your script with the following command: ```python python main.py ``` ```typescript npx tsx index.ts ``` You will see a URL to view your evals on Humanloop. A summary of progress and the final results will be displayed directly in your terminal: Eval progress and url in terminal Eval results in terminal ## 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. Eval results in terminal ## 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. Re-run eval results in terminal Re-run eval results in UI ## 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 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. 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.
## Running an Evaluation ### Clone an Agent In this quickstart, we will use a pre-configured Agent from the Humanloop Library. Navigate to the Library by clicking the Library button in the upper-left corner. Select the **Outreach Agent** and click the **Clone to Workspace** button in the upper-right corner. 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. The evaluation is most useful when you iteratively improve the Agent, as it allows you to compare several versions side by side. Follow our [tutorial](/docs/v5/tutorials/evaluate-agent-in-ui) where we add the **Google Search Tool** to this Agent and compare the results with this version. In this quick guide, you've created an Agent that can help your organization compose personalized messages to your leads. You've evaluated the initial version to see how this Agent performs across multiple inputs. ## Next steps Now that you've successfully run your first Eval, you can explore how you can make your Agent more powerful: * Add **Google Search** Tool to the Outbound Agent and compare two versions side by side. We explain the steps in our [Evaluate an Agent tutorial](/docs/v5/tutorials/evaluate-agent-in-ui) * Learn how your subject-matter experts (such as your sales team) can [review and evaluate model outputs](/docs/evaluation/guides/manage-multiple-reviewers) in Humanloop to help improve your AI product. *** title: Create a Prompt in the UI subtitle: Create your first Prompt in the Humanloop UI and view the Logs it generates. description: This guide will show you how you can use Humanloop to quickly create a new prompt and experiment with it. --------------------- 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 quickstart you'll create a prompt in the UI, experiment with it and then see logs from your experimentation. {/* This is just a taste of what you can do through the UI in Humanloop. Once you've got started, check out our guides on how to use production logs and evaluators to [systematically improve your products](../tutorials/systematically-improve.mdx). */} #### 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. 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. ## Get Started ### Create a Prompt File When you first open Humanloop you’ll see your File navigation on the left. Click ‘**+ New**’ and create a **Prompt**. 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. ## Next Steps Well done! You've now created your first Prompt. *** subtitle: Log an AI project to Humanloop. description: Use Humanloop to add logging to an AI project. --------------------- 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 quickstart takes a chat agent and adds Humanloop logging to it so you can observe and reason about its behavior. ## Prerequisites

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 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. 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.
```python pip install humanloop openai ``` ```typescript npm install humanloop openai ```
## Create the chat agent To demonstrate how to add logging, we will start with a chat agent that answers math and science questions. Create a script and add the following: ```python maxLines=30 import json from humanloop import Humanloop from openai import OpenAI openai = OpenAI(api_key="") humanloop = Humanloop(api_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" def call_model(messages: list[str]) -> str: output = openai.chat.completions.create( messages=messages, model="gpt-4o-mini", tools=[{ "type": "function", "function": { '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 }, }, }], 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() ``` ```typescript maxLines=30 import * as readline from "readline/promises"; import { HumanloopClient } from "humanloop"; import OpenAI from "openai"; type MessageType = { content: string; role: "system" | "user" | "assistant"; }; const humanloop = new HumanloopClient({apiKey: ""}); const openAIClient = new OpenAI({apiKey: ""}); // Passed to the LLM to enable function calling const CALCULATOR_JSON_SCHEMA = { name: "calculator", description: "Perform arithmetic operations on two numbers", strict: true, parameters: { type: "object", properties: { operation: { type: "string", description: "The operation to perform", enum: ["add", "subtract", "multiply", "divide"], }, num1: { type: "number", description: "The first number", }, num2: { type: "number", description: "The second number", }, }, required: ["operation", "num1", "num2"], additionalProperties: false, }, }; const calculator = ({ operation, num1, num2 }: { operation: string; num1: number; num2: number; }) => { switch (operation) { case "add": return num1 + num2; case "subtract": return num1 - num2; case "multiply": return num1 * num2; case "divide": if (num2 === 0) { throw new Error("Cannot divide by zero"); } return num1 / num2; default: throw new Error("Invalid operation"); } }; const callModel = async (traceId: string, messages: MessageType[]) => { const output = await openAIClient.chat.completions.create({ messages: messages, model: "gpt-4o-mini", temperature: 0.8, tools: [ { type: "function", function: CALCULATOR_JSON_SCHEMA, } as OpenAI.ChatCompletionTool, ], }); let llmResponse = ""; // Check if the agent made a tool call if (output.choices[0].message.tool_calls) { for (const toolCall of output.choices[0].message.tool_calls) { const toolCallArgs = JSON.parse(toolCall.function.arguments); const result = calculator(toolCallArgs); // Log the tool call humanloop.tools.log({ path: "Chat Agent/Calculator", inputs: toolCallArgs, output: JSON.stringify(result), traceParentId: traceId, }); llmResponse = `[${toolCall.function.name}] ${result}`; } } else { llmResponse = output.choices[0].message.content || ""; } // Log the model call await humanloop.prompts.log({ path: "Chat Agent/Call Model", prompt: { model: "gpt-4o", temperature: 0.8, tools: [CALCULATOR_JSON_SCHEMA], }, traceParentId: traceId, messages: [...messages, { role: "assistant", content: llmResponse }], }); return llmResponse; }; const conversation = async () => { const messages: MessageType[] = [ { 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, }); // Create the Flow trace // Each conversation will have a unique trace const traceId = ( await humanloop.flows.log({ path: "Chat Agent/Conversation", startTime: new Date(), }) ).id; 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); console.log("Assistant:", response); messages.push({ role: "assistant", content: response, }); } // Close the Flow trace when the conversation is done await humanloop.flows.updateLog(traceId, { traceStatus: "complete", output: JSON.stringify(messages), }); }; await conversation(); ``` ## Log to Humanloop 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. Use the SDK decorators to enable logging. At runtime, every call to a decorated function will create a [Log](/docs/v5/explanations/logs) on Humanloop. ```python maxLines=50 highlight={1,5,10} @humanloop.tool(path="Logging Quickstart/Calculator") def calculator(operation: str, num1: int, num2: int) -> str: ... @humanloop.prompt(path="Logging Quickstart/QA Prompt") def call_model(messages: list[str]) -> str: ... @humanloop.flow(path="Logging Quickstart/QA Agent") def conversation(): ... if __name__ == "__main__": conversation() ``` ```typescript maxLines=50 highlight={1-12, 17-20, 25-28} const calculator = humanloop.tool({ path: "Chat Agent/Calculator", version: {function: CALCULATOR_JSON_SCHEMA}, callable: ({ operation, num1, num2, }: { operation: string; num1: number; num2: number; }) => { ... }, }); const callModel = (messages: MessageType[]) => humanloop.prompt({ path: "Chat Agent/Call Model", callable: async (inputs: any, messages: MessageType[]) => { ... }, })(undefined, messages); const conversation = () => humanloop.flow({ path: "Chat Agent/Conversation", callable: async () => { ... }, })(undefined, undefined); ``` ## Run the code Have a conversation with the agent. When you're done, type `exit` to close the program. ```python > python main.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 ``` ```typescript > npx tsx index.ts 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 ``` ## 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). ## Change the agent and rerun Modify the `call_model` function to use a different model and temperature. ```python maxLines=30 highlight={6-11} @humanloop.prompt(path="Logging Quickstart/QA Prompt") def call_model(messages: list[str]) -> str: output = openai.chat.completions.create( messages=messages, model="gpt-4o-mini", tools=[ # The @tool utility adds a .json_schema attribute # to avoid redefining the schema calculator.json_schema ], temperature=0.2, ) # 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 ``` ```typescript maxLines=30 highlight={8-14} const callModel = (messages: MessageType[]) => humanloop.prompt({ path: "Chat Agent/Call Model", callable: async (inputs: any, messages: MessageType[]) => { const output = await openAIClient.chat.completions.create({ messages: messages, model: "gpt-4o-mini", tools: [ // The tool utility adds a .jsonSchema attribute // to avoid redefining the schema { type: "function", function: calculator.jsonSchema, } as OpenAI.ChatCompletionTool, ], temperature: 0.2, }); let llmResponse = ""; // Check if the agent made a tool call if (output.choices[0].message.tool_calls) { for (const toolCall of output.choices[0].message.tool_calls) { const toolCallArgs = JSON.parse(toolCall.function.arguments); const result = await calculator(toolCallArgs); llmResponse = `[${toolCall.function.name}] ${result}`; } } else { llmResponse = output.choices[0].message.content || ""; } return llmResponse; }, })(undefined, messages); ``` 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. ## 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. Instrument a Vercel AI SDK chat agent in Next.js Instrument a Vercel AI SDK chat agent in Node.js For a full reference, see our [Vercel AI SDK API reference](/docs/v5/reference/vercel-ai-sdk). *** subtitle: Add logging to your Vercel AI SDK application with Humanloop. 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. Add Humanloop observability to a chat agent by calling the tool built with Vercel AI SDK. It builds on the AI SDK's [Next.js example](https://sdk.vercel.ai/docs/getting-started/nextjs-app-router). Looking for Node.js? See the [guide here](/docs/v5/integrations/vercel-ai-sdk/agent-nodejs-observability). ## Prerequisites

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. 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.
Create a new Next.js project. This command will create a new directory named `my-ai-app` and set up a basic Next.js application inside of it. ```bash title="npm" npx create-next-app@latest my-ai-app ``` ```bash title="pnpm" pnpm create next-app@latest my-ai-app ``` ```bash title="yarn" yarn create next-app@latest my-ai-app ``` Navigate to the newly created directory: ```bash cd my-ai-app ``` To follow this guide, you'll also need Node.js 18+ installed on your machine. Install `ai`, '@ai-sdk/react', and `@ai-sdk/openai`, along with other necessary dependencies. ```bash title="npm" npm install ai @ai-sdk/react @ai-sdk/openai zod npm install -D @types/node tsx typescript ``` ```bash title="pnpm" pnpm add ai @ai-sdk/react @ai-sdk/openai zod pnpm add -D @types/node tsx typescript ``` ```bash title="yarn" yarn add ai @ai-sdk/react @ai-sdk/openai zod yarn add -D @types/node tsx typescript ``` Add a `.env.local` file to your project with your Humanloop and OpenAI API keys. ```bash touch .env.local ``` ``` HUMANLOOP_API_KEY= OPENAI_API_KEY= ```
## Full code If you'd like to immediately try out the full example, you can copy and paste the code below and run the app. ```bash title="npm" wordWrap npm install ai @ai-sdk/react @ai-sdk/openai zod npm install -D @types/node tsx typescript npm install @vercel/otel @opentelemetry/api @opentelemetry/sdk-logs @opentelemetry/api-logs @opentelemetry/instrumentation ``` ```bash title="pnpm" wordWrap pnpm add ai @ai-sdk/react @ai-sdk/openai zod pnpm add -D @types/node tsx typescript pnpm add @vercel/otel @opentelemetry/api @opentelemetry/sdk-logs @opentelemetry/api-logs @opentelemetry/instrumentation ``` ```bash title="yarn" wordWrap yarn add ai @ai-sdk/react @ai-sdk/openai zod yarn add -D @types/node tsx typescript yarn add @vercel/otel @opentelemetry/api @opentelemetry/sdk-logs @opentelemetry/api-logs @opentelemetry/instrumentation ``` ```plaintext title=".env.local" wordWrap highlight={4-6} HUMANLOOP_API_KEY= OPENAI_API_KEY= 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 ``` ```typescript title="instrumentation.ts" import { registerOTel } from "@vercel/otel"; export function register() { registerOTel({ serviceName: "humanloop-ai-sdk-agent", }); } ``` ```typescript title="app/api/chat/route.ts" maxLines=20 import { openai } from "@ai-sdk/openai"; import { streamText, tool } from "ai"; import { z } from "zod"; export const maxDuration = 30; export async function POST(req: Request) { const { messages } = await req.json(); const result = streamText({ model: openai("gpt-4o"), messages, experimental_telemetry: { isEnabled: true, metadata: { "humanloop.directoryPath": "path/to/directory", }, }, tools: { weather: tool({ description: "Get the weather in a location (fahrenheit)", parameters: z.object({ location: z.string().describe("The location to get the weather for"), }), execute: async ({ location }) => { const temperature = Math.round(Math.random() * (90 - 32) + 32); return { location, temperature, }; }, }), }, }); return result.toDataStreamResponse(); } ``` ```typescript title="app/page.tsx" maxLines=50 'use client'; import { useChat } from '@ai-sdk/react'; export default function Chat() { const { messages, input, handleInputChange, handleSubmit } = useChat({ maxSteps: 5, }); return (
{messages.map(m => (
{m.role === 'user' ? 'User: ' : 'AI: '} {m.parts.map((p, idx) => p.type === "tool-invocation" || p.type === "source" ? (
{JSON.stringify(p, null, 2)}
) : p.type === "text" ? (

{p.text}

) : (

{p.reasoning}

) )}
))}
); } ```
```bash title="npm" npm run dev ``` ```bash title="pnpm" pnpm run dev ``` ```bash title="yarn" yarn dev ``` ## Create the agent ### Create a Route Handler We start with a backend route that handles a chat request and streams back a response from a model. This model can call a function to get the weather in a given location. ```typescript title="app/api/chat/route.ts" maxLines=50 import { openai } from "@ai-sdk/openai"; import { streamText, tool } from "ai"; import { z } from "zod"; export const maxDuration = 30; export async function POST(req: Request) { const { messages } = await req.json(); const result = streamText({ model: openai("gpt-4o"), messages, tools: { weather: tool({ description: "Get the weather in a location (fahrenheit)", parameters: z.object({ location: z.string().describe("The location to get the weather for"), }), execute: async ({ location }) => { const temperature = Math.round(Math.random() * (90 - 32) + 32); return { location, temperature, }; }, }), }, }); return result.toDataStreamResponse(); } ``` ### Wire up the UI Now that you have a Route Handler that can query an LLM, it's time to setup your frontend. The AI SDK's [UI](https://sdk.vercel.ai/docs/ai-sdk-ui) package abstracts the complexity of a chat interface into one hook, `useChat`. Update your root page to show a chat interface and provide a user message input. The `maxSteps` prop allows the model to take multiple "steps" for a given generation, using tool calls to refine its response. ```typescript title="app/page.tsx" maxLines=50 'use client'; import { useChat } from '@ai-sdk/react'; export default function Chat() { const { messages, input, handleInputChange, handleSubmit } = useChat({ maxSteps: 5, }); return (
{messages.map(m => (
{m.role === 'user' ? 'User: ' : 'AI: '} {m.parts.map((p, idx) => p.type === "tool-invocation" || p.type === "source" ? (
{JSON.stringify(p, null, 2)}
) : p.type === "text" ? (

{p.text}

) : (

{p.reasoning}

) )}
))}
); } ``` ### Run the agent Start your app and give the agent a try. ```bash title="npm" npm run dev ``` ```bash title="pnpm" pnpm run dev ``` ```bash title="yarn" yarn dev ```
## 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. We'll use Vercel AI SDK's built-in OpenTelemetry tracing to log to Humanloop. ### Set up OpenTelemetry Install dependencies. ```bash wordWrap title="npm" npm install @vercel/otel @opentelemetry/sdk-logs @opentelemetry/api-logs @opentelemetry/instrumentation ``` ```bash wordWrap title="pnpm" pnpm add @vercel/otel @opentelemetry/sdk-logs @opentelemetry/api-logs @opentelemetry/instrumentation ``` ```bash wordWrap title="yarn" 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 code: ```typescript title="instrumentation.ts" import { registerOTel } from "@vercel/otel"; export function register() { registerOTel({ serviceName: "humanloop-ai-sdk-agent", }); } ``` Configure the [OpenTelemetry exporter](https://opentelemetry.io/docs/specs/otel/protocol/exporter/) to forward logs to Humanloop. ```plaintext highlight={4-6} title=".env.local" wordWrap HUMANLOOP_API_KEY= OPENAI_API_KEY= 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 The telemetry metadata associates Logs with your Files on Humanloop. We will use a Humanloop [Prompt](/docs/explanation/prompts) to log LLM calls, and a Humanloop [Flow](/docs/explanation/flows) to group related generation calls into a trace. The `humanloop.directoryPath` specifies the path to a Directory where your Files and Logs will be located. ```typescript title="app/api/chat/route.ts" highlight={13-19} maxLines=50 import { openai } from "@ai-sdk/openai"; import { streamText, tool } from "ai"; import { z } from "zod"; export const maxDuration = 30; export async function POST(req: Request) { const { messages } = await req.json(); const result = streamText({ model: openai("gpt-4o"), messages, experimental_telemetry: { isEnabled: true, metadata: { "humanloop.directoryPath": "path/to/directory", }, }, tools: { weather: tool({ description: "Get the weather in a location (fahrenheit)", parameters: z.object({ location: z.string().describe("The location to get the weather for"), }), execute: async ({ location }) => { const temperature = Math.round(Math.random() * (90 - 32) + 32); return { location, temperature, }; }, }), }, }); return result.toDataStreamResponse(); } ``` Restart your app, and have a conversation with the agent. ### Explore logs on Humanloop Now you can explore your logs on the [Humanloop platform](https://app.humanloop.com), and see the steps taken by the agent during your conversation. ## Debugging If you run into any issues, add OpenTelemetry debug logging to ensure the Exporter is working correctly. ```bash title="npm" npm install @opentelemetry/api ``` ```bash title="pnpm" pnpm add @opentelemetry/api ``` ```bash title="yarn" yarn add @opentelemetry/api ``` ```typescript title="instrumentation.ts" import { registerOTel } from "@vercel/otel"; import { diag, DiagConsoleLogger, DiagLogLevel } from "@opentelemetry/api"; diag.setLogger(new DiagConsoleLogger(), DiagLogLevel.DEBUG); export function register() { registerOTel({ serviceName: "humanloop-ai-sdk-agent", }); } ``` ## 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: 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. Add Humanloop observability to a chat agent by calling the tool built with Vercel AI SDK. It builds on the AI SDK's [Node.js example](https://sdk.vercel.ai/docs/getting-started/nodejs). Looking for Next.js? See the [guide here](/docs/v5/integrations/vercel-ai-sdk/agent-nextjs-observability). ## Prerequisites

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. 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.
Start by creating a new directory for your project and initializing it: ```bash title="npm" mkdir my-ai-agent cd my-ai-agent npm init -y ``` ```bash title="pnpm" mkdir my-ai-agent cd my-ai-agent pnpm init ``` ```bash title="yarn" mkdir my-ai-agent cd my-ai-agent yarn init -y ``` To follow this guide, you'll also need Node.js 18+ installed on your machine. Install `humanloop`, `ai`, and `@ai-sdk/openai`, the AI SDK's OpenAI provider, along with other necessary dependencies. ```bash title="npm" npm install humanloop ai @ai-sdk/openai zod dotenv npm install -D @types/node tsx typescript ``` ```bash title="pnpm" pnpm add humanloop ai @ai-sdk/openai zod dotenv pnpm add -D @types/node tsx typescript ``` ```bash title="yarn" yarn add humanloop ai @ai-sdk/openai zod dotenv yarn add -D @types/node tsx typescript ``` Add a `.env` file to your project with your Humanloop and OpenAI API keys. ```bash touch .env ``` ``` HUMANLOOP_API_KEY= OPENAI_API_KEY= ```
## Full code If you'd like to immediately try out the full example, you can copy and paste the code below and run the file. ```bash title="npm" wordWrap npm install humanloop ai @ai-sdk/openai zod dotenv npm install -D @types/node tsx typescript npm install dotenv @opentelemetry/sdk-node @opentelemetry/auto-instrumentations-node ``` ```bash title="pnpm" wordWrap pnpm add humanloop ai @ai-sdk/openai zod dotenv pnpm add -D @types/node tsx typescript pnpm add dotenv @opentelemetry/sdk-node @opentelemetry/auto-instrumentations-node ``` ```bash title="yarn" wordWrap yarn add humanloop ai @ai-sdk/openai zod dotenv yarn add -D @types/node tsx typescript yarn add dotenv @opentelemetry/sdk-node @opentelemetry/auto-instrumentations-node ``` ```plaintext highlight={4-6} title=".env" wordWrap HUMANLOOP_API_KEY= OPENAI_API_KEY= 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 ``` ```typescript title="agent.ts" maxLines=20 import { openai } from "@ai-sdk/openai"; import { CoreMessage, streamText, tool } from "ai"; import { z } from "zod"; import * as readline from "node:readline/promises"; import { NodeSDK } from "@opentelemetry/sdk-node"; import { getNodeAutoInstrumentations } from "@opentelemetry/auto-instrumentations-node"; import dotenv from "dotenv"; dotenv.config(); const sdk = new NodeSDK({ instrumentations: [getNodeAutoInstrumentations()], }); sdk.start(); async function exit() { console.log("Assistant: Shutting down..."); await sdk.shutdown(); process.exit(0); } const terminal = readline.createInterface({ input: process.stdin, output: process.stdout, }); const messages: CoreMessage[] = [ { role: "system", content: "You are a helpful assistant. If the user asks you to exit, you should exit the program.", }, ]; async function main() { while (true) { const userInput = await terminal.question("You: "); if (userInput === "exit") { break; } messages.push({ role: "user", content: userInput }); const result = streamText({ model: openai("gpt-4o"), messages, maxSteps: 5, experimental_telemetry: { isEnabled: true, metadata: { "humanloop.directoryPath": "Vercel AI/Weather", }, }, tools: { weather: tool({ description: "Get the weather in a location (in Celsius)", parameters: z.object({ location: z .string() .describe("The location to get the weather for"), }), execute: async ({ location }) => ({ location, temperature: Math.round((Math.random() * 30 + 5) * 10) / 10, // Random temp between 5°C and 35°C }), }), }, }); let fullResponse = ""; process.stdout.write("\nAssistant: "); for await (const delta of result.textStream) { fullResponse += delta; process.stdout.write(delta); } process.stdout.write("\n\n"); messages.push({ role: "assistant", content: fullResponse }); } await exit(); } main().catch(console.error); ``` ```bash title="npm" npx tsx agent.ts ``` ```bash title="pnpm" pnpm tsx agent.ts ``` ```bash title="yarn" yarn tsx agent.ts ``` ## Create the agent We start with a simple chat agent capable of function calling. ```typescript title="agent.ts" maxLines=50 import { openai } from "@ai-sdk/openai"; import { CoreMessage, streamText, tool } from "ai"; import { z } from "zod"; import * as readline from "node:readline/promises"; async function exit() { console.log("Assistant: Shutting down..."); process.exit(0); } const terminal = readline.createInterface({ input: process.stdin, output: process.stdout, }); const messages: CoreMessage[] = [ { role: "system", content: "You are a helpful assistant. If the user asks you to exit, you should exit the program.", }, ]; async function main() { while (true) { const userInput = await terminal.question("You: "); if (userInput === "exit") { break; } messages.push({ role: "user", content: userInput }); const result = streamText({ model: openai("gpt-4o"), messages, maxSteps: 5, tools: { weather: tool({ description: "Get the weather in a location (in Celsius)", parameters: z.object({ location: z .string() .describe("The location to get the weather for"), }), execute: async ({ location }) => ({ location, temperature: Math.round((Math.random() * 30 + 5) * 10) / 10, // Random temp between 5°C and 35°C }), }), }, }); let fullResponse = ""; process.stdout.write("\nAssistant: "); for await (const delta of result.textStream) { fullResponse += delta; process.stdout.write(delta); } process.stdout.write("\n\n"); messages.push({ role: "assistant", content: fullResponse }); } await exit(); } main().catch(console.error); ``` This agent can provide weather updates for a user-provided location. ```plaintext $ npx tsx agent.ts You: What's the weather like in London? Assistant: The current temperature in London is 20°C. You: exit Assistant: Shutting down... ``` ## 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. We'll use Vercel AI SDK's built-in OpenTelemetry tracing to log to Humanloop. ### Set up OpenTelemetry Install dependencies. ```bash title="npm" npm install dotenv @opentelemetry/sdk-node @opentelemetry/auto-instrumentations-node ``` ```bash title="pnpm" pnpm add dotenv @opentelemetry/sdk-node @opentelemetry/auto-instrumentations-node ``` ```bash title="yarn" yarn add dotenv @opentelemetry/sdk-node @opentelemetry/auto-instrumentations-node ``` Configure the [OpenTelemetry exporter](https://opentelemetry.io/docs/specs/otel/protocol/exporter/) to forward logs to Humanloop. ```plaintext highlight={4-6} title=".env" wordWrap HUMANLOOP_API_KEY= OPENAI_API_KEY= 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 Vercel AI SDK will now forward OpenTelemetry logs to Humanloop. The telemetry metadata associates Logs with your Files on Humanloop. The `humanloop.directoryPath` specifies the path to a Directory where your Files and Logs will be located. ```typescript title="agent.ts" maxLines=50 highlight={6-16,20,51-57} import { openai } from "@ai-sdk/openai"; import { CoreMessage, streamText, tool } from "ai"; import { z } from "zod"; import * as readline from "node:readline/promises"; import { NodeSDK } from "@opentelemetry/sdk-node"; import { getNodeAutoInstrumentations } from "@opentelemetry/auto-instrumentations-node"; import dotenv from "dotenv"; dotenv.config(); const sdk = new NodeSDK({ instrumentations: [getNodeAutoInstrumentations()], }); sdk.start(); async function exit() { console.log("Assistant: Shutting down..."); await sdk.shutdown(); process.exit(0); } const terminal = readline.createInterface({ input: process.stdin, output: process.stdout, }); const messages: CoreMessage[] = [ { role: "system", content: "You are a helpful assistant. If the user asks you to exit, you should exit the program.", }, ]; async function main() { while (true) { const userInput = await terminal.question("You: "); if (userInput === "exit") { break; } messages.push({ role: "user", content: userInput }); const result = streamText({ model: openai("gpt-4o"), messages, maxSteps: 5, experimental_telemetry: { isEnabled: true, metadata: { "humanloop.directoryPath": "Vercel AI/Weather", }, }, tools: { weather: tool({ description: "Get the weather in a location (in Celsius)", parameters: z.object({ location: z .string() .describe("The location to get the weather for"), }), execute: async ({ location }) => ({ location, temperature: Math.round((Math.random() * 30 + 5) * 10) / 10, // Random temp between 5°C and 35°C }), }), }, }); let fullResponse = ""; process.stdout.write("\nAssistant: "); for await (const delta of result.textStream) { fullResponse += delta; process.stdout.write(delta); } process.stdout.write("\n\n"); messages.push({ role: "assistant", content: fullResponse }); } await exit(); } main().catch(console.error); ``` ### Run the agent ```bash title="npm" npx tsx agent.ts ``` ```bash title="pnpm" pnpm tsx agent.ts ``` ```bash title="yarn" yarn tsx agent.ts ``` Have a conversation with the agent, and try asking about the weather in a city (in Celsius or Fahrenheit). When you're done, type `exit` to close the program. ### Explore logs on Humanloop Now you can explore your logs on the [Humanloop platform](https://app.humanloop.com), and see the steps taken by the agent during your conversation. You can see below the full trace of prompts and tool calls that were made. ## Debugging If you run into any issues, add OpenTelemetry debug logging to ensure your Exporter is working correctly. ```bash title="npm" npm install @opentelemetry/api ``` ```bash title="pnpm" pnpm add @opentelemetry/api ``` ```bash title="yarn" yarn add @opentelemetry/api ``` ```typescript title="agent.ts" import { diag, DiagConsoleLogger, DiagLogLevel } from "@opentelemetry/api"; diag.setLogger(new DiagConsoleLogger(), DiagLogLevel.DEBUG); ``` ## 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). *** title: Integrating Humanloop description: Best practices for integrating Humanloop into your software development life cycle subtitle: How to integrate Humanloop into your development workflow, while facilitating collaboration with non-technical team members. --------------------- 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 the central registry for your AI features. It versions the key artifacts — the Prompts, Tools, Flows, and Datasets — while capturing logs to enable you to run evals and monitor performance to make reliable AI applications. Humanloop is flexible on how you integrate it into your applications, you can: * Store the artifacts in your codebase or within Humanloop * Execute AI logic in code or on Humanloop * Run evals in your runtime or on Humanloop This facilitates collaboration on AI features with non-technical subject matter experts while maintaining your software development practices. ## Choosing an integration approach Your integration approach will depend on the complexity of your project, the structure of your team, and your deployment requirements. ### UI vs Code Prompt Management You should choose one of two ways for managing prompts and AI artifacts: "UI first" or "code first". You’ll likely want to use UI-first approach if your domain experts are involved in prompt development. You create and iterate on your Prompts, Tools, Flows and Datasets in the Humanloop UI. Prompts can be synced back to your codebase or called directly via the API. This is ideal for situations where you have subject matter experts or project managers who are primarily responsible for the "how it works" of your AI features. **Benefits:** * ✅ Faster iteration which can be decoupled from code releases * ✅ Easier collaboration with subject matter experts **Drawbacks:** * ❌ Does not support complex prompt chains or flows You define and maintain prompts, tools and agents in code and then log to Humanloop. **Benefits:** * ✅ Full flexibility of code for developing your prompts or complex agents * ✅ Maintains a point-in-time snapshot of both code and prompts * ✅ Maintains your existing CI/CD practices **Drawbacks:** * ❌ Harder for domain experts to collaborate * ❌ Less convenient for iterating on prompts and running evaluations * ❌ Tightly coupled to code releases, means slower iteration ### Proxy vs Direct Calls You have two options for calling your Prompts: "Proxy via Humanloop" or "Direct Calls + Logging". You'll likely want to use the proxy approach if you want to centralize your logging and versioning and the direct call approach if you want to minimize latency. Your calls to large language models go via Humanloop, which forwards requests to model providers and logs the results automatically. **Benefits:** * ✅ Simplifies integration * ✅ Centralized logging and versioning * ✅ Easier hot-swapping of Prompts **Drawbacks:** * ❌ Adds a slight latency overhead * ❌ Adds Humanloop as a dependency to your critical path Your app calls the model provider directly, then logs results to Humanloop. **Benefits:** * ✅ No extra latency * ✅ Can call custom providers and services **Drawbacks:** * ❌ Requires additional logging logic The rest of this guide gives more details on the different approaches. ## Prompt Management Prompt management is the process of creating, updating, and versioning your Prompts, Tools, Flows and Datasets. AI artifacts should be version-controlled just like application code, however unlike application code, often the people that best understand how they should work are domain experts, not developers. Humanloop provides a UI-based environment for domain expert involvement, while still being able to sync the back to your codebase and version control. ### Versioning Humanloop automatically tracks all versions of your Tools, Flows, Agents and Datasets, whether created in the UI or in code. Each version is uniquely identified by hashing its parameters. Humanloop computes this hash based on the template, the temperature and other parameters and logs accordingly. Every time a Prompt is called or an LLM response is logged, the resulting [Log](/docs/explanation/logs) is associated with a specific version. This versioning allows you to: * **Evaluate:** compare the performance of different versions * **Auditability:** review changes over time * **Deployment control:** manage rollbacks and staged releases ## Create and manage your Prompts in code or in the UI Humanloop supports both UI and code-based prompt management, giving you flexibility for your team's needs. You can always mix both approaches — starting in the UI and syncing to code, or vice versa. ### Use code-first management if: * **You are creating a complex agent or workflow** If an LLM call is embedded within a structured workflow with dependencies on the schemas before and after the step, managing it in code is usually more practical. * **You are creating your Prompts dynamically** For example, if you are dynamically setting the template or available tools based on app state or user inputs, you’ll find it easier to set this in code. Note that with template variables (`{{ variable }}`) and jinja syntax, you should put the dynamic state as inputs into the template. ### Use the UI for AI development if: * **Your domain experts are responsible for prompt iteration.** The UI enables non-technical team members to contribute effectively. * **You want an interactive environment for prompt engineering** Your domain experts can load in examples, replay interesting datapoints, and run evaluations with ease. * **You’re iterating on existing Prompts** Even if the Prompt was initially developed in code, the UI is a more convenient place to iterate on it ## Syncing Humanloop to your codebase If Humanloop is the **source of truth**, and you wish to have the state of your Prompts in your codebase, you can sync the latest versions back to your codebase. Each file can be serialised and stored in version control. The [`.prompt` format](/docs/v5/reference/serialized-files#prompt-format) is a human-readable representation of your Prompts that can be stored in git, and all other files can be serialised as JSON. You can use the [List Files](/docs/api/files/list-files) API to fetch the latest versions of your files and store them in your codebase. {/* TODO: add some guides on how to sync */} {/* ### How to Sync */} {/* **Export from Humanloop:** You can manually download or programmatically fetch the latest `.prompt` files using the API. */} {/* **Use the CLI (Coming Soon):** Humanloop will offer a CLI tool to fetch and sync the latest state of your files effortlessly. */} {/* For detailed instructions, refer to Guide */} ## Decoupling AI updates from your software lifecycle For many applications you want to update your AI behavior faster than your traditional software release process. Humanloop allows you to iterate on prompts separately while maintaining control over which versions are used in production. ### Environment labels Humanloop supports **environment labels** (e.g., `"development"`, `"staging"`, `"production"`) that allow you to deploy specific prompt versions without modifying code. How it works: 1. When calling/fetching your Prompts in code, specify the environment e.g. `production` instead of a fixed version ID. 2. In the UI (or via API), promote a new version to the desired environment. 3. Your application now uses the updated Prompt without any code changes ✨ ## Calling your Prompts, Agents and Flows You have two options for calling LLMs with your prompts in production: ### 1. Use the Humanloop Proxy for simplicity Proxying your LLM calls via Humanloop simplifies logging, versioning, and provider management. Humanloop provides a **unified API** that forwards requests to the LLM provider and automatically logs the results. **How it works:** 1. You call the Humanloop API (e.g.`Prompts.call()`) instead of each model provider. 2. Humanloop fetches/creates the prompt, calls the provider and logs and returns the result. ✅ **Easier integration** – fetches latest version, calls provider and logs result in one call
✅ **Unified interface** – easy swapping between model providers
✅ **Automatic versioning** – ensures all interactions are versioned
⚠️ **Adds slight latency** – due to the extra network hop
⚠️ **Adds to the critical path** - for uptime critical applications you may want an enterprise SLA Using the Humanloop proxy can accelerate development since you can swap out models or adjust prompt templates on the platform side without changing code. ### 2. Direct call and logging With this you call the model provider directly and log results manually to Humanloop. This minimizes latency and allows custom models. **How it works:** 1. You fetch the latest version of the prompt from Humanloop (or have it in code) 2. You send the requests to OpenAI, Anthropic, etc. 3. You log responses separately to Humanloop. {/* TODO: add a link to the logging docs */} {/* You can use the decorators [TODO: link] in the SDK to simplify the logging */} {/* TODO: I'd like here to be able to explain how we can make this convenient with fetching the latest version of the prompt */} * ✅ **No extra network hop** – ideal for latency-sensitive use cases
* ✅ **Supports proprietary/custom models**
* ⚠️ **Requires manual logging** – you must track metadata yourself ### Choosing the Right Approach For most teams, **proxying via Humanloop is the easiest choice**. If performance is critical, use **direct calls** but ensure proper logging. | **Use Case** | **Best Approach** | | ------------------------------------ | -------------------------- | | Fast iteration & centralized logging | **Proxy via Humanloop** | | Low-latency, mission-critical apps | **Direct calls + logging** | | Using a custom/proprietary model | **Direct calls + logging** | ## Running Evals Given the non-deterministic nature of LLMs and the challenging subjective tasks they're applied to, evaluation is integral to the development of AI features. Evaluations are where [Evaluators](/docs/concepts/evaluators) are run on the Logs of your Prompts, Flows and Agents. The Logs can be production data, or created by running a [Dataset](/docs/concepts/datasets) through the application you're testing. ### Evaluators in Humanloop runtime versus your runtime Evaluators are used to evaluate the performance of your Prompts, Flows and Agents. They can be defined on Humanloop as a Python function, an LLM call, or as a “human" feedback. Your Evaluators and Datasets can be stored in code, or in Humanloop. Evaluations can be run in code or through the UI. 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. Our recommendation is to store them on Humanloop where possible so that you can benefit from: * ✅ Parallel execution * ✅ Automatic logging of results * ✅ Versioning of evaluators * ✅ Integration with your existing CI/CD * ✅ Easy triggering of evals from the UI or from your CI/CD * ✅ Re-use of your evaluators as online monitoring evaluators {/* TODO! */} {/* ## CI/CD Automation */} {/* Humanloop can be integrated into CI/CD to ensure **AI regressions are caught before deployment**. This helps teams continuously improve prompts and models. */} {/* For a detailed guide, see [**Humanloop CI/CD Setup**](https://www.notion.so/Doc-Integrating-Humanloop-1a0b02063acd80efa2e3fae864e1aafb?pvs=21). */} ## What's Next? You should now have an understanding of the flexibility of Humanloop’s integration patterns, that can cater for subject matter experts and developers to collaborate on AI features. {/* This guide covers: */} {/* - **Prompt Management:** Where to store your AI artifacts and sync with git */} {/* - **Runtime:** how to call models and log results */} {/* - **Evaluations:** How to run evals on your prompts */} {/* - **CI/CD automation**: how to automate your testing and deployment workflows */} *** title: Humanloop Files subtitle: Humanloop provides a simple set of building blocks for your AI applications and avoids complex abstractions. description: Discover how Humanloop manages datasets, with version control and collaboration to enable you to evaluate and fine-tune your 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. 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)
Prompts define a task for a Large Language Model. [**Agents**](./agents)
Agents are multi-step AI systems that leverage an LLM, external information sources and tool calling to accomplish complex tasks automatically. [**Evaluators**](./evaluators)
Evaluators judge the output of Prompts, Tools, Flows, or other Evaluators. [**Tools**](./tools)
Tools extend Prompts and Agents with access to external data sources and enable them to take action. [**Flows**](./flows)
Flows are orchestrations of Prompts, Tools, and other code — enabling evaluation and improvement of complete AI pipelines. ### Static Files [**Datasets**](/docs/v4/datasets)
Datasets are collections of Datapoints used for evaluation and fine-tuning. *** ## File properties ### Files are managed in the UI or code Files can be managed in the [Humanloop UI](https://app.humanloop.com/), or via the [API](/docs/api). Product teams and their Subject Matter Experts (SMEs) may prefer using the UI for convenience, whereas AI Teams and Engineers may prefer to use the API for greater control and customization. ### Files are version-controlled Files have immutable Versions that are uniquely determined by their parameters that characterise the behavior of the system. For example, a Prompt Version is determined by the prompt template, base model, and hyperparameters. Within the Humanloop Editor and via the API, you can save new Versions of a File, view the history of changes, and revert to a previous version via deployments. ### Files have a serialized form All Files can be exported and imported in a serialized form. For example, Prompts and Agents are serialized to our [.prompt and .agent file formats](/docs/reference/serialized-files). This allows technical teams to maintain the source of truth within their existing version control systems, such as Git. ### Files support deployments You can tag File Versions with specific Environments and target these Environments via the UI and API to facilitate robust deployment workflows. ### Function Files are callable Function Files can be called when using the Humanloop runtime. Or logged to when using your own runtime. *Example:* When a Prompt is called, Humanloop acts as a proxy to the [model provider](/docs/reference/models#providers), logs and returns the output. If you manage the model calls yourself, the results can be logged to the Prompt File. Using the Humanloop runtime is easier and lets you run files directly in the UI, while managing your own runtime gives you more control. ### Function Files have Logs Every time a Function File is called, a [Log](/docs/explanation/logs) is created. Logs can also be posted via the API. *** | File | Versioned | Callable | Logs | | ------------------------------------------ | --------- | -------- | ---- | | [Prompts](/docs/explanation/prompts) | ✅ | ✅ | ✅ | | [Agents](/docs/explanation/agents) | ✅ | ✅ | ✅ | | [Evaluators](/docs/explanation/evaluators) | ✅ | ✅ | ✅ | | [Tools](/docs/explanation/tools) | ✅ | ✅ | ✅ | | [Flows](/docs/explanation/flows) | ✅ | ✅ | ✅ | | [Datasets](/docs/explanation/datasets) | ✅ | ❌ | ❌ | *** subtitle: Prompts define a task for a Large Language Model. description: Discover how Humanloop manages prompts, 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. 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}}`.
For chat models, the template contains an array of messages * the **model** e.g. `gpt-4o` * the **parameters** to the model such as `temperature`, `max_tokens`, `top_p` * any **tools** available to the model A Prompt is callable in that if you supply the necessary inputs, it will return a response from the model. Inputs are defined in the template through the double-curly bracket syntax e.g. `{{topic}}` and the value of the variable will need to be supplied when you call the Prompt to create a generation. This separation of concerns, keeping configuration separate from the query time data, is crucial for enabling you to experiment with different configurations and evaluate any changes. The Prompt stores the configuration and the query time data in [Logs](./logs), which can then be used to create Datasets for evaluation purposes. Note that we use a capitalized "[Prompt](/docs/explanation/prompts)" to refer to the entity in Humanloop, and a lowercase "prompt" to refer to the general concept of input to the model. ```jsx --- model: gpt-4o temperature: 1.0 max_tokens: -1 provider: openai endpoint: chat --- Write a song about {{topic}} ``` ## Versioning Versioning your Prompts enables you to track how adjustments to the template or parameters influence the model's responses. This is crucial for iterative development, as you can pinpoint which configuration produces the most relevant or accurate outputs for your use cases. A Prompt File will have multiple Versions as you iterate on different models, templates, or parameters, but each version should perform the same task and generally be interchangeable with one another. ### When to create a new Prompt File You should create a new Prompt File for each different 'task to be done' with an LLM. Each of these tasks can have its own separate Prompt File: *Writing Copilot*, *Personal Assistant*, *Summarizer*, etc. Many users find value in creating a 'playground' Prompt where they can freely experiment without risking damage to their other Prompts or creating disorder. ## Using Prompts Prompts are callable as an API, allowing you to provide query-time data such as input values or user messages, and receive the model's text output in response. Prompts can also be used without proxying through Humanloop to the model provider. Instead, you can call the model directly and explicitly log the results to your Prompt. ## Serialization The [.prompt file format](/docs/reference/serialized-files#prompt-format) is a serialized representation of a Prompt Version, designed to be human-readable and suitable for integration into version control systems alongside code. The format is heavily inspired by [MDX](https://mdxjs.com/), with model and parameters specified in a YAML header alongside a JSX-inspired syntax for chat templates. ```jsx Chat --- model: gpt-4o temperature: 1.0 max_tokens: -1 provider: openai endpoint: chat --- You are a friendly assistant. ``` ```jsx Completion --- model: claude-2 temperature: 0.7 max_tokens: 256 top_p: 1.0 provider: anthropic endpoint: complete --- Autocomplete the sentence. Context: {{context}} {{sentence}} ``` ``` ``` *** subtitle: Create and evaluate autonomous AI systems. description: Humanloop Agents enable you to build and monitor complex AI workflows, from simple tool calling to sophisticated multi-step processes. Create, test, and deploy Agents through our UI or 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. Agents are currently in beta and subject to change. ## Overview A Humanloop Agent is a multi-step AI system that leverages an LLM, external information sources and tool calling to accomplish complex tasks automatically. It comprises a main orchestrator LLM that utilizes tools to accomplish its task. An Agent is composed primarily of: * A **template** that instructs the Agent model how to process tasks * Model **parameters** such as `temperature`, `max_tokens`, and `reasoning_effort` * The **workflow configuration** that defines how the Agent processes tasks, such as `max_iterations` and `stopping_tools` * The available **tools** the Agent can use, including [Tools](/docs/v5/explanation/tools) and [Prompts](/docs/v5/explanation/prompts) An Agent executes on the Humanloop platform: for a given Agent version, if you supply the necessary inputs, it will execute until it reaches a stopping condition. Humanloop will return a [Log](/docs/v5/explanation/logs) with an `output` or `output_message`, along with the full trace of the Agent's execution. Inputs are defined through **variables** in the Agent template. The values of these variables will need to be supplied when you call the Agent to create a generation. The Agent configuration and runtime data will be stored in Logs, which can then be used to create Datasets for evaluation purposes. ## Basics You can create and configure Agents through the Humanloop UI or programmatically via our SDK. ### Agents in the UI To create an Agent, create a new file and select the **Agent** option. 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" }, ] --- You are a helpful a digital bank teller, you help users navigate our digital banking platform. In your interactions, follow these guidelines: {{personality}}. Notify them about the following policies: {{policies}}. ``` ## Next steps You now understand the role of Agents in the Humanloop ecosystem. Explore the following resources to apply Agents to your AI project: * See our tutorials to learn how to evaluate your Agent [via UI](/docs/guides/evals/run-evaluation-ui) or [via code](/docs/guides/evals/run-evaluation-api). * Explore our [Tools documentation](/docs/v5/explanation/tools) to understand what capabilities you can give your Agents. *** subtitle: Evaluators judge the output of Prompts, Tools, Flows, or other Evaluators. description: Learn about LLM Evaluation using Evaluators. Evaluators are functions that can be used to judge the output of Prompts, Tools or other Evaluators. --------------------- 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 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. Editor for a Python Tool showing a `calculate` function and a calculation output. ### 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 Editor for a Snippet Tool showing a `humanloop_context` Tool with various key-value pairs. ### 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. Agent Editor with a Calculator Tool linked. The Tool is called by the Agent and the results are shown. ## 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. ```python maxLines=50 @humanloop.flow(path="QA Agent/Answer Question") def call_agent(question: str) -> str: # A simple question answering agent ... return answer ``` ```typescript maxLines=50 const callAgent = humanloop.flow({ path: "QA Agent/Answer Question", callable: async (question: string) => { // A simple question answering agent ... return answer } }) ``` The decorator will capture the inputs and output of the agent on Humanloop. You can then start evaluating the system's performance through [code](/docs/v5/guides/evals/run-evaluation-api) or through the [platform UI](/docs/v5/guides/evals/run-evaluation-ui). ## Tracing Additional Logs can be added to the trace to provide further insight into the system's behavior. On Humanloop, a trace is the collection of Logs associated with a Flow Log. ```python maxLines=50 title="Question answering agent" @humanloop.tool(path="QA Agent/Search Wikipedia") def search_wikipedia(query: str) -> dict: """LLM function calls this to search Wikipedia.""" ... @humanloop.prompt(path="QA Agent/Call Model") def call_model(messages: list[dict]) -> dict: """Interact with the LLM model.""" ... @humanloop.flow( path="QA Agent/Answer Question", attributes={"version": "v1", "wikipedia": True} ) def call_agent(question: str) -> str: """A simple question answering agent.""" ... ``` The agent makes multiple provider calls to refine the response to the question. It makes function calls to `search_wikipedia` to retrieve additional information from an external source. Calling the other functions inside `call_agent` creates Logs and adds them to the trace created by `call_agent`. ```typescript maxLines=50 title="Question answering agent" const searchWikipedia = humanloop.tool({ path: "QA Agent/Search Wikipedia", callable: async (query: string) => { // LLM function calls this to search Wikipedia ... } }) const callModel = humanloop.prompt({ path: "QA Agent/Call Model", callable: async (messages: string[]) => { // Interact with the LLM model ... } }) const callAgent = humanloop.flow({ path: "QA Agent/Answer Question", attributes: { version: "v1", wikipedia: true }, callable: async (question: string) => { // A simple question answering agent ... } }) ``` The agent makes multiple provider calls to refine the response to the question. It makes function calls to `searchWikipedia` to retrieve additional information from an external source. Calling the other functions inside `callAgent` creates Logs and adds them to the trace created by `callAgent`. ### 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. ```python title="Tracing via API" maxLines=50 highlight={17,22-26} def call_agent(question: str) -> str: trace_id = humanloop.flows.log( name="QA Agent/Answer Question", flow={ "attributes": { "version": "v1", "wikipedia": True } }, inputs={"question": question} ).id llm_output = humanloop.prompts.call( name="QA Agent/Answer", prompt={...}, messages=[...], parent_trace_id=trace_id ) ... humanloop.flows.update_log( log_id=trace_id, output=answer log_status="complete" ) ``` ```typescript title="Tracing via API" maxLines=50 highlight={17,22-25} async function callAgent(question: string) { const traceId = (await humanloop.flows.log({ name: "QA Agent/Answer Question", flow: { attributes: { version: "v1", wikipedia: true } }, inputs: { question } })).id; const llmOutput = await humanloop.prompts.call({ name: "QA Agent/Answer", prompt: {...}, messages: [...], parentTraceId: traceId }); ... await humanloop.flows.updateLog(traceId, { output: answer, logStatus: "complete" }); } ``` ## Versioning Any data you pass into `attributes` will contribute to the version of the Flow. If you pass in a new value, the version will be updated. ```python maxLines=50 title="Question answering agent" highlight={3} @humanloop.flow( path="QA Agent/Answer Question", attributes={"version": "v1", "wikipedia": True} ) def call_agent(question: str) -> str: """A simple question answering agent.""" ... ``` ```typescript maxLines=50 title="Question answering agent" highlight={3} const callAgent = humanloop.flow({ path: "QA Agent/Answer Question", attributes: { version: "v1", wikipedia: true }, callable: async (question: string) => { // A simple question answering agent ... } }) ``` ## Completing Flow Logs Flow Logs can be marked as complete in order to prevent further Logs from being added to the trace. The flow decorator will mark a trace as complete when the function returns. ```python title="Monitoring Evaluator on Humanloop" def count_logs_evaluator(log): """Count the number of Logs in a trace.""" if log["children"]: # Use the `children` attribute to access all Logs in the trace return 1 + sum([count_logs_evaluator(child) for child in log["children"]]) return 1 ``` A Flow Log's metrics, such as cost, latency and tokens, are computed as Logs are added to the trace. A Flow Log's `start_time` and `end_time` are computed automatically to span the earliest start and latest end of the Logs in its trace. If `start_time` and `end_time` already span the Logs' timestamps, they are kept as they are. If you don't want to use the decorator, you can complete the Flow Log via the SDK directly. ```python humanloop.flows.update_log( log_id=trace_id, log_status="complete" ) ``` ```typescript humanloop.flows.updateLog(traceId, { logStatus: "complete" }) ``` ## Evaluation Unlike [Prompts](/docs/v5/explanation/prompts), which can be evaluated via the Humanloop UI, you must run evaluations on your Flows through code. To do this, provide a `callable` argument to the `evaluations.run` SDK method. Unlike other Logs, Evaluators added to Flows can access all Logs inside a trace: ```python maxLines=50 title="Evaluating a Flow" highlight={5} humanloop.evaluations.run( name="Comprehensiveness Evaluation", file={ "path": "QA Agent/Answer Question", "callable": call_agent, }, evaluators=[ {"path": "QA Agent/Answer Comprehensiveness"}, ], dataset={"path": "QA Agent/Simple Answers"}, ) ``` ```typescript maxLines=50 title="Evaluating a Flow" highlight={5} humanloop.evaluations.run( name="Comprehensiveness Evaluation", file={ "path": "QA Agent/Answer Question", "callable": callAgent, }, evaluators=[ { "path": "QA Agent/Answer Comprehensiveness" }, ], dataset={ "path": "QA Agent/Simple Answers" }, ) ``` Every time a Log is added to a Flow trace, monitoring Evaluators and Evaluations re-evaluate the Log. This behaviour is throttled, so adding multiple Logs in quick succession will result in a single re-evaluation. ## Next steps You now understand the role of Flows in the Humanloop ecosystem. Explore the following resources to apply Flows to your AI project: * Check out our [logging quickstart](/docs/v5/quickstart/set-up-logging) for an example project instrumented with Flows. * Learn how to evaluate an AI agent [in UI](/docs/tutorials/evaluate-agent-in-ui) or [in code](/docs/tutorials/agent-evaluation-code). *** subtitle: Datasets are collections of Datapoints used for evaluation and fine-tuning. description: Discover how Humanloop manages datasets, with version control and collaboration to enable you to evaluate and fine-tune your 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. 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. Get started with using Datasets for Evaluation via UI Get started with using Datasets for Evaluation via code *** subtitle: Logs contain the inputs and outputs of each time a Function File is called. description: Logs contain the inputs and output of each time a Function Files is called. --------------------- 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. Logs in Humanloop are records of each execution of a [Function File](/docs/explanation/files#function-files) (*Prompt*, *Agent*, *Tool*, *Evaluator*, or *Flow*). They capture the complete context of the execution, including `inputs`, `output`, and metadata like which [Version](/docs/explanation/files#files-are-version-controlled) was used. ## External logging When you are not using Humanloop to run Prompts (or other Function Files), but use your own infrastructure — for instance in a production setting — you can still collect and store the Logs on Humanloop. This enables you to collect interesting cases and lets you leverage Humanloop's monitoring and evaluation capabilities. Monitoring Evaluators run every time a Log is patched. If the Log is part of a trace, the Evaluators re-run and the stats of the Log are updated. *** 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. We recommend to always refer to Files by their `id` to avoid issues related to changing paths when Files or Directories are moved. For more information on how to create and manage directories, see our [Create a Directory](/docs/development/guides/create-directory) guide. *** subtitle: Deployment environments enable you to control the deployment lifecycle of your Prompts and other files between development and production environments. description: Deployment environments enable you to control the deployment lifecycle of your Prompts and other files between development and production environments. --------------------- 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 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). Only Enterprise customers can create more than one environment The environments you define for your organisation will be available for each file and can be viewed in the file's dashboard once created. ![](https://files.buildwithfern.com/https://humanloop.docs.buildwithfern.com/docs/2025-08-13T04:13:40.157Z/assets/images/environments.png) #### The default environment By default, the production environment is marked as the Default environment. This means that all API calls that don't explicitly target a specific environment will use this environment. You can rename the default environment on the [organisation's environments](https://app.humanloop.com/account/environments) page. Renaming the environments will take immediate effect, so ensure that this change is planned and does not disrupt your production workflows. ### Using environments Once created on the environments page, environments can be used for each file and are visible in the respective dashboards. You can deploy directly to a specific environment by selecting it in the **Deployments** section. ![](https://files.buildwithfern.com/https://humanloop.docs.buildwithfern.com/docs/2025-08-13T04:13:40.157Z/assets/images/environments-change-deployments.png) Alternatively, you can deploy to multiple environments simultaneously by deploying a version from either the Editor or the Versions table. ### Using environments via API ![](https://files.buildwithfern.com/https://humanloop.docs.buildwithfern.com/docs/2025-08-13T04:13:40.157Z/assets/images/environments-deploy-version.png) You can now call the version deployed in a specific environment by including an optional additional `environment` field. An example of this field can be seen in the v5 [Prompt Call](/docs/api/prompts/call-stream#request.query.environment) documentation. *** subtitle: Evaluate and improve your Agent by running Evals in the Humanloop UI. description: This tutorial will explain how to set up evaluations through the Humanloop UI and use them to iteratively improve your Agent. --------------------- 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 expands on the Agent we created in the [Quickstart Guide](/docs/v5/quickstart/agent-evals-in-ui). If you've already completed the Quickstart, you can jump directly to the [Run second Evaluation](/docs/v5/tutorials/evaluate-agent-in-ui#run-second-evaluation) section. If you haven't completed the Quickstart yet, please begin with the first step below. For this tutorial, 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'll show how to assess the quality of the Agent and compare two Agent versions side by side.

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 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. 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 an Agent ### Clone Outreach Agent from Library In this quickstart, we will use a pre-configured Agent from the Humanloop Library. Navigate to the Library by clicking the Library button in the upper-left corner. Select the **Outreach Agent** and click the **Clone to Workspace** button in the upper-right corner. 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. ## Run second Evaluation ### Iterate on the Agent HackerNews is a limited resource because it lacks background information about potential customers and does not include all recent news articles related to them. To enhance the search phase, connect Google Search Tool that enables our Agent to traverse through more sophisticated Google search results. Additionally, add a dedicated Write Personalized Message Prompt that is solely responsible for writing outbound messages. This approach allows for separate iteration on the writing block and the use of different LLM parameters specifically for the writing step. ### Clone new Tools Navigate back to **Library** and clone the **Google Search** Tool and the **Write Personalized Message** Prompt. ### Setup Google Search tool To use the Google Search tool, you need to obtain an API key from the third-party Serper. Connecting the Agent to a third party makes the Agent much more powerful. Serper offers a free API tier that you can use for this tutorial - to obtain an API key, sign up at [https://serper.dev/](https://serper.dev/) Click on Google Search file inside Outreach Agent folder Add the API key: 1. Open the **Google Search** Tool in your workspace. 2. Click the **Environment Variables** button in the upper-right corner. 3. In the **Name** field, enter: `SERPER_API_KEY` 4. In the **Value** field, paste your API key. ### 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. In this tutorial, you've created an Agent that can help your organization compose personalized messages for your prospects. You've evaluated the initial version, made changes to the Agent, and compared the newly created version with the initial one. ## Next steps Now that you've successfully run your first Eval, you can explore customizing it for your use case: * Learn how your subject-matter experts (such as your sales team) can [review and evaluate model outputs](/docs/evaluation/guides/manage-multiple-reviewers) in Humanloop to help improve your AI product. * Explore how you can set up [Human Evaluators](/docs/evaluation/guides/human-evaluators) to get human feedback on your Agent outputs. *** subtitle: Evaluate and improve the performance of an LLM agent using Humanloop. description: Learn how to use Humanloop to systematically test and improve your LLM agent systems. --------------------- 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 first-class support for agents on its runtime. This tutorial provides guidance on how to instrument existing code-based agentic systems with Humanloop. Check out our [Evaluating Agents in UI](/docs/v5/tutorials/evaluate-agent-in-ui) tutorial for a more streamlined experience, including tool calling on the Humanloop runtime, and autonomous agents. Working with LLMs is daunting: you are dealing with a black box that outputs unpredictable results. Humanloop provides tools to make your development process systematic, bringing it closer to traditional software testing and quality assurance. In this tutorial, we’ll build an agentic question-and-answer system and use Humanloop to iterate on its performance. The agent will provide simple, child-friendly answers using Wikipedia as its source of factual information. ## Prerequisites

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 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. 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.
Install the project's dependencies: ```python pip install humanloop openai wikipedia ``` Humanloop SDK requires Python 3.9 or higher. Optionally, create a virtual environment to keep dependencies tidy. {/* TODO: Add a disclaimer for TS */} Install the project's dependencies: ```typescript npm install humanloop openai wikipedia ```
## Initial agent code Let's build the first iteration of the agent. We'll use OpenAI's function calling to connect the agent to the Wikipedia API. The agent will also be allowed to refine its answer through multiple iterations if the initial tool call doesn't yield relevant information. ```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: "" }); 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(); ``` Run the agent and check that it works as expected: ```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! ``` ## Add Humanloop to the agent Humanloop offers first-class support for agentic systems, plus the ability to effortlessly switch between providers. ## Evaluate the agent 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). Let's check if the agent respects the requirement of providing easy-to-understand answers. We will create an [Evaluation](/docs/v5/guides/evals/run-evaluation-ui) to benchmark the performance of the agent. An Evaluation requires a [Dataset](/docs/v5/guides/explanations/datasets) and at least one [Evaluator](/docs/v5/guides/explanations/evaluators). ### Create LLM judge We will use an LLM judge to automatically evaluate the agent's responses. We will define the Evaluator in code, but you can also [manage Evaluators in the UI](/docs/v5/guides/evals/llm-as-a-judge). Replace your `main` function with the following: ```python title="main.py" maxLines=50 if __name__ == "__main__": humanloop.evaluators.upsert( path="QA Agent/Comprehension", spec={ "arguments_type": "target_free", "return_type": "number", "evaluator_type": "llm", "prompt": { "model": "gpt-4o", "endpoint": "complete", "template": ( "You must decide if an explanation is simple " "enough to be understood by a 5-year old. " "A better explanation is shorter and uses less jargon. " "Rate the answer from 1 to 10, where 10 is the best.\n" "\n\n{{log.inputs.question}}\n\n\n" "\n\n{{log.output}}\n\n" "First provide your rationale, then on a newline, " "output your judgment." ), "provider": "openai", "temperature": 0, }, }, ) ``` ```typescript title="main.ts" maxLines=50 const main = async () => { await humanloop.evaluators.upsert({ path: "QA Agent/Comprehension", spec: { argumentsType: "target_free", returnType: "number", evaluatorType: "llm", prompt: { model: "gpt-4o", endpoint: "complete", template: "You must decide if an explanation is simple " + "enough to be understood by a 5-year old. " + "A better explanation is shorter and uses less jargon. " + "Rate the answer from 1 to 10, where 10 is the best.\n" + "\n\n{{log.inputs.question}}\n\n\n" + "\n\n{{log.output}}\n\n" + "First provide your rationale, then on a newline, " + "output your judgment.", provider: "openai", temperature: 0, }, }, }); } ``` ### 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?"}} ``` ### Run an Evaluation Add this to your `main` function: ```python title="main.py" maxLines=100 highlight={4-24} if __name__ == "__main__": # ... # 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 Check", file={ "path": "QA Agent/Agent", "callable": call_agent, }, evaluators=[{"path": "QA Agent/Comprehension"}], dataset={ "path": "QA Agent/Dataset", "datapoints": dataset, }, workers=8, ) ``` ```typescript title="main.ts" maxLines=100 highlight={4-29} const main = async () => { // ... // Read the evaluation dataset const dataset: any[] = []; const fileStream = fs.createReadStream("dataset.jsonl"); const rl = readline.createInterface({ input: fileStream, crlfDelay: Infinity, }); for await (const line of rl) { dataset.push(JSON.parse(line)); } // Run the evaluation await humanloop.evaluations.run({ name: "QA Agent Answer Check", file: { path: "QA Agent/Agent", callable: callAgent, }, evaluators: [{ path: "QA Agent/Comprehension" }], dataset: { path: "QA Agent/Dataset", datapoints: dataset, }, concurrency: 8, }); } ``` Run your file and let the Evaluation finish: ```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 | +------------------------+---------------------+ ``` ## Iterate and evaluate again The score of the initial setup is quite low. Click the Evaluation link from the terminal and switch to the Logs view. You will see that the model tends to provide elaborate answers. Let's modify the LLM prompt inside `call_model`: ```python title="main.py" maxLines=100 highlight={11-12} def call_model(messages: list[Message]) -> Message: """Calls the model with the given messages""" system_message = { "role": "system", "content": ( "You are an assistant that help 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. " "Formulate the response so that it is easy to understand " "for a 5 year old." ) } 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) ``` Run the agent again and let the Evaluation finish: ```bash python main.py ``` Let's modify the LLM prompt inside `callModel`: ```typescript title="main.ts" maxLines=100 highlight={10-11} 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. "+ "Formulate the response so that it is easy to understand " + "for a 5 year old.", }; 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; } ``` Run the agent again and let the Evaluation finish: ```typescript npx tsx main.ts ``` ```bash title="Terminal" maxLines=50 Flow Version ID: flv_9ECTrfeZYno2OIj9KAqlz Run ID: rn_WnIwPSI7JFKEtwTS0l3mj Navigate to your Evaluation: https://app.humanloop.com/project/fl_9CCIoTzySPfUFeIxfYE6g/evaluations/rn_WnIwPSI7JFKEtwTS0l3mj/stats Running 'Agent' over the Dataset 'Children Questions' using 8 workers [######################------------------] 34/50 (68.00%) | ETA: 14 ... +------------------------+---------------------+---------------------+ | | Control | Latest | +------------------------+---------------------+---------------------+ | Run ID | 67tEc | WnIwP | +------------------------+---------------------+---------------------+ | Version ID | 9ECTr | 9ECTr | +------------------------+---------------------+---------------------+ | Added | 2024-11-19 22:05:17 | 2024-11-19 22:24:13 | +------------------------+---------------------+---------------------+ | Evaluators | | | +------------------------+---------------------+---------------------+ | QA Agent/Comprehension | 3.24 | 8.04 | +------------------------+---------------------+---------------------+ Change of [4.80] for Evaluator QA Agent/Comprehension ``` Click the Evaluation link again. The agent's performance has improved significantly. ## Add detailed logging 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. 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: "", instrumentProviders: { // Pass the OpenAI module, not the initialized client OpenAI } }); ``` 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 }) => { ... }, }); ``` 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. 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. ![Eval runs](https://files.buildwithfern.com/https://humanloop.docs.buildwithfern.com/docs/2025-08-13T04:13:40.157Z/assets/images/evaluate_rag_flow_stats.png) 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. ![Eval Logs table](https://files.buildwithfern.com/https://humanloop.docs.buildwithfern.com/docs/2025-08-13T04:13:40.157Z/assets/images/evaluate_rag_flow_logs.png) 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

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 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. 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.
## 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) ### 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. Chat Agent 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. Chat Agent ### 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 (
{message.role}
{message.content ? (
{message.content as string}
) : (
...
)} {logId && (
)}
); ``` 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. Chat Agent 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 👎). Chat Agent
## 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. Run Evals with Dataset on Humanloop. 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. Run Evals with Dataset on Humanloop. 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 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/) ## 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 **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. Prompt Evaluations Run tab. ### 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. In progress Evaluation run 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**. Evaluation Spider plot * Below the spider plot, you can see the breakdown of performance per Evaluator. Evaluation Evaluator stats breakdown * 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. Drill down to Evaluatoin Logs. ### 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. 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. ```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); ``` Drill down to Evaluatoin Logs. 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. Drill down to Evaluatoin Logs. # 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 # 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. An example Prompt with a variable `{{query}}`. ## 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. A CSV file in Google Sheets defining query and target pairs for our Classifier Prompt. ### 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*. Create a new File from the sidebar on Humanloop. ### 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...**. Uploading a CSV file to create a dataset. ### 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** Mapping columns of a CSV into specific values of a 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. Inspect the Dataset created from the CSV file. ### 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. Save a Dataset. 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: ```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()); ``` ## 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. ### 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: ### 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. Inspect the Dataset uploaded via API. ## 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: ### 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: Navigate to the Logs table of your Prompt. ### 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**. Filter and select logs of interest. ### 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. Create a new dataset from logs. You will then see the new Dataset appear at the same level in the filesystem as your Prompt. ## 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. An example Prompt with a variable `{{query}}`. ## 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**. Create code evaluator. * 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. The debug console for testing the code. * 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**. Inspect evaluator log in debug console. ### 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. Evaluator logs table. ## 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. ### 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**. Select Evaluator for monitoring. 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. See the results of monitoring on your logs. ## 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. Support agent base prompt. ## 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. ``` 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. The debug console for testing the Evaluator 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**. Inspect evaluator log in debug console. ### 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. Evaluator logs table. ## 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. ### Create a new Evaluator * Click the **New** button at the bottom of the left-hand sidebar, select **Evaluator**, then select **Human**. ![New Evaluator dialog](https://files.buildwithfern.com/https://humanloop.docs.buildwithfern.com/docs/2025-08-13T04:13:40.157Z/assets/images/evaluators/human/1-new-evaluator-dialog.png) * Give the Evaluator a name when prompted in the sidebar, for example "Tone". ![Created Human Evaluator being renamed to "Tone"](https://files.buildwithfern.com/https://humanloop.docs.buildwithfern.com/docs/2025-08-13T04:13:40.157Z/assets/images/evaluators/human/2-rename-evaluator.png) ### 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." ![Tone evaluator set up with options and instructions](https://files.buildwithfern.com/https://humanloop.docs.buildwithfern.com/docs/2025-08-13T04:13:40.157Z/assets/images/evaluators/human/3-evaluator-editor.png) ### 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**. ![Save dialog over the "Tone" Evaluator](https://files.buildwithfern.com/https://humanloop.docs.buildwithfern.com/docs/2025-08-13T04:13:40.157Z/assets/images/evaluators/human/4-save-version-dialog.png) * Press **Deploy** in the next dialog. * Select your default Environment (usually "production"). * Confirm your deployment. ![Dialog deploying the "Tone" Evaluator to the "production" Environment](https://files.buildwithfern.com/https://humanloop.docs.buildwithfern.com/docs/2025-08-13T04:13:40.157Z/assets/images/evaluators/human/5-deploy-tone-evaluator.png) :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. ### 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. ## 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. Run Evals with Dataset on Humanloop. 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. Upload CSV as dataset to Humanloop. 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. Run Evals with Dataset on Humanloop. ### 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. Focus mode on. ### 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. ## 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. Completed evaluations. 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. Support agent base prompt. ### 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`. Support agent change model 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). Support agent add panel Then press the *Load* button in the new panel and select another version of your Prompt to compare. Support agent load version ### 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. Support agent compare version ## 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. ### 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. Support agent dashboard ### 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. Support agent diff view 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 ### Create a GitHub Actions Workflow In your GitHub repository, create a new file `.github/workflows/humanloop-eval.yml` with the following content: This content is currently under development. Please refer to our [V4 documentation](https://docs.humanloop.com/v4) for the current docs. ```yaml ``` *** 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). 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: ```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()); ``` ## Set up an Evaluation ### 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. ![Evaluation Run with Logs attached](https://files.buildwithfern.com/https://humanloop.docs.buildwithfern.com/docs/2025-08-13T04:13:40.157Z/assets/images/spot-check-runs.png) ## 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). ![Logs review](https://files.buildwithfern.com/https://humanloop.docs.buildwithfern.com/docs/2025-08-13T04:13:40.157Z/assets/images/spot-check-review.png) After your Logs have been reviewed, go to the **Stats** tab to view aggregate stats. ![Aggregate run stats](https://files.buildwithfern.com/https://humanloop.docs.buildwithfern.com/docs/2025-08-13T04:13:40.157Z/assets/images/spot-check-rating.png) ## 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: "" }); 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(); ``` Run the agent and check that it works as expected: ```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! ``` ## Evaluate the agent 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 ```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 | +------------------------+---------------------+ ``` Click on the link to see the results when the Evaluation is complete. ## Add detailed logging 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. 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: "", instrumentProviders: { // Pass the OpenAI module, not the initialized client OpenAI } }); ``` 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 }) => { ... }, }); ``` 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. 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: ```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()); ``` 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. ### Upload logs to Humanloop 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. ![Flow Logs](https://files.buildwithfern.com/https://humanloop.docs.buildwithfern.com/docs/2025-08-13T04:13:40.157Z/assets/images/external_logs_flow_logs.png) 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. ![Evaluation on Humanloop](https://files.buildwithfern.com/https://humanloop.docs.buildwithfern.com/docs/2025-08-13T04:13:40.157Z/assets/images/external_logs_evaluations.png) 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. ![Logs tab of Evaluation](https://files.buildwithfern.com/https://humanloop.docs.buildwithfern.com/docs/2025-08-13T04:13:40.157Z/assets/images/external_logs_logs_a.png) The following steps will guide you through adding a different set of logs to a new Run for comparison. ### Upload new logs If 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. ![Evaluation with two Runs on Humanloop](https://files.buildwithfern.com/https://humanloop.docs.buildwithfern.com/docs/2025-08-13T04:13:40.157Z/assets/images/external_logs_runs_b.png) ![Stats tab showing box plots for the two Runs](https://files.buildwithfern.com/https://humanloop.docs.buildwithfern.com/docs/2025-08-13T04:13:40.157Z/assets/images/external_logs_stats_b.png) ## 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). **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. 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. ## Get Started ### Create a Prompt File When you first open Humanloop you’ll see your File navigation on the left. Click ‘**+ New**’ and create a **Prompt**. 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 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 Prompt **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: ```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()); ``` After initializing the SDK client, you can call the Prompt creation endpoint. ### 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: ### Go to the App Go to the [Humanloop app](https://app.humanloop.com) and you will see your Prompt in your list of files. 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 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: ```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()); ``` ## 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. ### 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 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. ## 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. ## 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: ```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()); ``` ## 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. ### 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. Here's how to do this in code: ```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", }); ``` ### Call your Prompt This can be your own model, or any other LLM provider. Here is an example of calling OpenAI: ```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, }); ``` ### Log the result Finally, log the result to your project: ```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, }); ``` *** 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) 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. ``` ![Deploying the welcome-email Prompt](https://files.buildwithfern.com/https://humanloop.docs.buildwithfern.com/docs/2025-08-13T04:13:40.157Z/assets/images/syncing-files/welcome-email-prompt-creation.png) 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 ``` ## 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: ![Example Prompt and other Files in the Humanloop workspace](https://files.buildwithfern.com/https://humanloop.docs.buildwithfern.com/docs/2025-08-13T04:13:40.157Z/assets/images/syncing-files/01-humanloop-workspace-files.png) Now you can pull this Prompt from Humanloop to your local environment by running: ```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. ![Pulling Files from Humanloop](https://files.buildwithfern.com/https://humanloop.docs.buildwithfern.com/docs/2025-08-13T04:13:40.157Z/assets/images/syncing-files/02-local-pulled-files.png) `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: ```bash Python for="Python" humanloop pull --help ``` ```bash TypeScript for="TypeScript" npx humanloop pull --help ``` ## 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. ```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. ![Calling a local Prompt](https://files.buildwithfern.com/https://humanloop.docs.buildwithfern.com/docs/2025-08-13T04:13:40.157Z/assets/images/syncing-files/03-local-prompt-log.png) 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: ![Git diff showing Prompt changes](https://files.buildwithfern.com/https://humanloop.docs.buildwithfern.com/docs/2025-08-13T04:13:40.157Z/assets/images/syncing-files/04-git-prompt-diff.png) 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. ```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); ``` ## 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 ### **Open the Editor** Go to a Prompt and open the Editor. ### **Select a model that supports Tool Calling** 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. ## 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. 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. ### 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. *** 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. **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 can call files and directories anything you want. Capital letters, spaces are all ok! Creating a new directory ### (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 Moving a file into a directory 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: ### 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. After 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. We now have a `get_current_weather` Tool that our Prompt can call. ## Link the Tool ### 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`. 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`. 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. ### Open the Prompt's monitoring dialog Go to your Prompt's dashboard. Click **Monitoring** in the top right to open the monitoring dialog. ![Dashboard showing Monitoring dialog](https://files.buildwithfern.com/https://humanloop.docs.buildwithfern.com/docs/2025-08-13T04:13:40.157Z/assets/images/monitoring-monitoring-dialog.png) ### 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. ![Graphs on Dashboard showing the average Evaluator results over time.](https://files.buildwithfern.com/https://humanloop.docs.buildwithfern.com/docs/2025-08-13T04:13:40.157Z/assets/images/monitoring-dashboard.png) ### 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. ![The Logs table includes a column for each monitoring Evaluator.](https://files.buildwithfern.com/https://humanloop.docs.buildwithfern.com/docs/2025-08-13T04:13:40.157Z/assets/images/monitoring-logs-table.png) 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: ```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()); ``` ## 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. 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. ![Prompt dashboard showing Monitoring dialog](https://files.buildwithfern.com/https://humanloop.docs.buildwithfern.com/docs/2025-08-13T04:13:40.157Z/assets/images/impersonator-dashboard.png) ### Connect your Evaluator Click **Connect Evaluators** and select the Human Evaluator you created. ![Dialog connecting the "Tweet Issues" Evaluator as a Monitoring Evaluator](https://files.buildwithfern.com/https://humanloop.docs.buildwithfern.com/docs/2025-08-13T04:13:40.157Z/assets/images/impersonator-connect-monitoring-evaluator.png) You should now see the selected Human Evaluator attached to the Prompt in the Monitoring dialog. ![Monitoring dialog showing the "Tweet Issues" Evaluator attached to the Prompt](https://files.buildwithfern.com/https://humanloop.docs.buildwithfern.com/docs/2025-08-13T04:13:40.157Z/assets/images/impersonator-monitoring-evaluator-attached.png) ## 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"], ) ``` The "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, ) ``` ## 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. ![Logs table showing feedback applied to Logs](https://files.buildwithfern.com/https://humanloop.docs.buildwithfern.com/docs/2025-08-13T04:13:40.157Z/assets/images/impersonator-logs-feedback.png) Your internal users can also apply feedback to the Logs directly through the Humanloop app. ![Log drawer showing feedback section](https://files.buildwithfern.com/https://humanloop.docs.buildwithfern.com/docs/2025-08-13T04:13:40.157Z/assets/images/impersonator-logs-drawer-feedback.png) ### 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. ![Logs table for "Tweet Issues" Evaluator showing feedback](https://files.buildwithfern.com/https://humanloop.docs.buildwithfern.com/docs/2025-08-13T04:13:40.157Z/assets/images/impersonator-tweet-issues-evaluator-logs.png) ## 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). ## Prerequisites

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 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. 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 */}
## Create the chat agent We start with a simple chat agent that answers math and science questions. 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(); ``` ## 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. ### 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. ```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}`); } } ``` ### Add logging We add log statements that will create the Logs contained in the trace. ```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", }); } ``` ### 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={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", }); } ``` ## Run the code Have a conversation with the agent. When you're done, type `exit` to close the program. ```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 ``` ## 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). ## Change the agent and rerun Modify the `call_model` function to use a different model and temperature. ```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(), }); ... ``` 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. ## 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. ### 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. 🎉 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 ### 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**. ### Copy the generated API key Save it in a secure location. You will not be shown the full API key again. ## Revoke an API key You can revoke an existing API key if it is no longer needed. 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. Template Library 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. 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), }; } }, }, }); } ``` ## 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. File formats 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.
* **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
### The full content of the Humanloop docs The llms-full.txt file contains the full content of the Humanloop docs and API reference. /llms-full.txt for the full content of the Humanloop docs and API reference
* **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 docs
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. Example of the raw markdown for the Call Prompt page
Add **`.md`** to the end of the URL to get the raw markdown content of the 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. ### Usage Examples ```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()) ``` *** 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: 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. ## 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. 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 => { 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} ])); }); ``` ### Tracing SDK Calls Logs created through the Humanloop SDK are added to the trace. ```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 => { // 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; }, }); ``` ## Behavior 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. ## Definition ```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. 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 - 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. ## Error Handling - 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`. ## 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 ```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 ``` ### Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `path` | string | Yes | Path on Humanloop workspace for the Prompt | ### Usage ```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 => { return openai.chat.completions.create({ model: "gpt-4o-mini", messages: [{ role: "user", content: text }] }).choices[0].message.content; } }); ``` ## 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: | 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 | ## Error Handling - 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. ## 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. 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. ### Definition ```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. ### 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(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 }] }); ``` ## Behavior ### Schema Definition 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; } ``` ### Log Creation Each function call creates a Tool Log with the following fields: | 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 | ## Error Handling - 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. ## Best Practices 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()` ## 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). 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 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. ## 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. ```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: ```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()); ``` 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': }}` 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 response = Unirest.delete("https://api.humanloop.com/v5/agents/ag_1234567890/versions/agv_1234567890") .header("X-API-KEY", "") .asString(); ``` ```php Delete version request('DELETE', 'https://api.humanloop.com/v5/agents/ag_1234567890/versions/agv_1234567890', [ 'headers' => [ 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp Delete version using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/agents/ag_1234567890/versions/agv_1234567890"); var request = new RestRequest(Method.DELETE); request.AddHeader("X-API-KEY", ""); IRestResponse response = client.Execute(request); ``` ```swift Delete version import Foundation let headers = ["X-API-KEY": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/agents/ag_1234567890/versions/agv_1234567890")! 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 Agent Version PATCH https://api.humanloop.com/v5/agents/{id}/versions/{version_id} Content-Type: application/json Update the name or description of the Agent version. Reference: https://humanloop.com/docs/api/agents/patch-agent-version ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /agents/{id}/versions/{version_id}: patch: operationId: patch-agent-version summary: Update Agent Version description: Update the name or description of the Agent version. 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 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: $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_: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_: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 Update version import requests url = "https://api.humanloop.com/v5/agents/ag_1234567890/versions/agv_1234567890" payload = { "name": "teller-agent-v2", "description": "Updated version" } headers = { "X-API-KEY": "", "Content-Type": "application/json" } response = requests.patch(url, json=payload, headers=headers) print(response.json()) ``` ```typescript Update version import { HumanloopClient } from "humanloop"; const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); await client.agents.patchAgentVersion("ag_1234567890", "agv_1234567890", { name: "teller-agent-v2", description: "Updated version" }); ``` ```go Update version package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/agents/ag_1234567890/versions/agv_1234567890" payload := strings.NewReader("{\n \"name\": \"teller-agent-v2\",\n \"description\": \"Updated version\"\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 Update 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::Patch.new(url) request["X-API-KEY"] = '' request["Content-Type"] = 'application/json' request.body = "{\n \"name\": \"teller-agent-v2\",\n \"description\": \"Updated version\"\n}" response = http.request(request) puts response.read_body ``` ```java Update version import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.patch("https://api.humanloop.com/v5/agents/ag_1234567890/versions/agv_1234567890") .header("X-API-KEY", "") .header("Content-Type", "application/json") .body("{\n \"name\": \"teller-agent-v2\",\n \"description\": \"Updated version\"\n}") .asString(); ``` ```php Update version request('PATCH', 'https://api.humanloop.com/v5/agents/ag_1234567890/versions/agv_1234567890', [ 'body' => '{ "name": "teller-agent-v2", "description": "Updated version" }', 'headers' => [ 'Content-Type' => 'application/json', 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp Update version using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/agents/ag_1234567890/versions/agv_1234567890"); var request = new RestRequest(Method.PATCH); request.AddHeader("X-API-KEY", ""); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"name\": \"teller-agent-v2\",\n \"description\": \"Updated version\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Update version import Foundation let headers = [ "X-API-KEY": "", "Content-Type": "application/json" ] let parameters = [ "name": "teller-agent-v2", "description": "Updated version" ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/agents/ag_1234567890/versions/agv_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. # Get Agent GET https://api.humanloop.com/v5/agents/{id} Retrieve the Agent with the given ID. By default, the deployed version of the Agent is returned. Use the query parameters `version_id` or `environment` to target a specific version of the Agent. Reference: https://humanloop.com/docs/api/agents/get ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /agents/{id}: get: operationId: get summary: Get Agent description: >- Retrieve the Agent with the given ID. By default, the deployed version of the Agent is returned. Use the query parameters `version_id` or `environment` to target a specific 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: query description: A specific Version ID of the Agent 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_:AgentResponse' '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_: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_: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 agent import requests url = "https://api.humanloop.com/v5/agents/ag_1234567890" headers = {"X-API-KEY": ""} response = requests.get(url, headers=headers) print(response.json()) ``` ```typescript Get specific agent import { HumanloopClient } from "humanloop"; const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); await client.agents.get("ag_1234567890"); ``` ```go Get specific agent package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/agents/ag_1234567890" 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 agent require 'uri' require 'net/http' url = URI("https://api.humanloop.com/v5/agents/ag_1234567890") 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 agent import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api.humanloop.com/v5/agents/ag_1234567890") .header("X-API-KEY", "") .asString(); ``` ```php Get specific agent request('GET', 'https://api.humanloop.com/v5/agents/ag_1234567890', [ 'headers' => [ 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp Get specific agent using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/agents/ag_1234567890"); var request = new RestRequest(Method.GET); request.AddHeader("X-API-KEY", ""); IRestResponse response = client.Execute(request); ``` ```swift Get specific agent import Foundation let headers = ["X-API-KEY": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/agents/ag_1234567890")! 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 Agent DELETE https://api.humanloop.com/v5/agents/{id} Delete the Agent with the given ID. Reference: https://humanloop.com/docs/api/agents/delete ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /agents/{id}: delete: operationId: delete summary: Delete Agent description: Delete the Agent with the given ID. tags: - subpackage_agents parameters: - name: id in: path description: Unique identifier for 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 agent import requests url = "https://api.humanloop.com/v5/agents/ag_1234567890" headers = {"X-API-KEY": ""} response = requests.delete(url, headers=headers) print(response.json()) ``` ```typescript Delete agent import { HumanloopClient } from "humanloop"; const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); await client.agents.delete("ag_1234567890"); ``` ```go Delete agent package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/agents/ag_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 agent require 'uri' require 'net/http' url = URI("https://api.humanloop.com/v5/agents/ag_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 agent import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.delete("https://api.humanloop.com/v5/agents/ag_1234567890") .header("X-API-KEY", "") .asString(); ``` ```php Delete agent request('DELETE', 'https://api.humanloop.com/v5/agents/ag_1234567890', [ 'headers' => [ 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp Delete agent using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/agents/ag_1234567890"); var request = new RestRequest(Method.DELETE); request.AddHeader("X-API-KEY", ""); IRestResponse response = client.Execute(request); ``` ```swift Delete agent import Foundation let headers = ["X-API-KEY": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/agents/ag_1234567890")! 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 Agent PATCH https://api.humanloop.com/v5/agents/{id} Content-Type: application/json Move the Agent to a different path or change the name. Reference: https://humanloop.com/docs/api/agents/move ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /agents/{id}: patch: operationId: move summary: Move Agent description: Move the Agent to a different path or change the name. tags: - subpackage_agents parameters: - name: id in: path description: Unique identifier for Agent. 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_: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 Flow including the Flow name, which is used as a unique identifier. name: type: string description: Name of the Flow. directory_id: type: string description: >- Unique identifier for the Directory to move Flow to. Starts with `dir_`. 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_: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_: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 agent import requests url = "https://api.humanloop.com/v5/agents/ag_1234567890" 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 agent import { HumanloopClient } from "humanloop"; const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); await client.agents.move("ag_1234567890", { path: "new directory/new name" }); ``` ```go Move agent package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/agents/ag_1234567890" 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 agent require 'uri' require 'net/http' url = URI("https://api.humanloop.com/v5/agents/ag_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 \"path\": \"new directory/new name\"\n}" response = http.request(request) puts response.read_body ``` ```java Move agent import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.patch("https://api.humanloop.com/v5/agents/ag_1234567890") .header("X-API-KEY", "") .header("Content-Type", "application/json") .body("{\n \"path\": \"new directory/new name\"\n}") .asString(); ``` ```php Move agent request('PATCH', 'https://api.humanloop.com/v5/agents/ag_1234567890', [ 'body' => '{ "path": "new directory/new name" }', 'headers' => [ 'Content-Type' => 'application/json', 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp Move agent using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/agents/ag_1234567890"); 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 agent 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/agents/ag_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. # List Versions of a Agent GET https://api.humanloop.com/v5/agents/{id}/versions Get a list of all the versions of a Agent. Reference: https://humanloop.com/docs/api/agents/list-versions ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /agents/{id}/versions: get: operationId: list-versions summary: List Versions of a Agent description: Get a list of all the versions of a Agent. tags: - subpackage_agents parameters: - name: id in: path description: Unique identifier for Agent. 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_:ListAgents' '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_: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_:ListAgents: type: object properties: records: type: array items: $ref: '#/components/schemas/type_:AgentResponse' description: The list of Agents. required: - records title: ListAgents 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/agents/ag_1234567890/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.agents.listVersions("ag_1234567890"); ``` ```go List versions package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/agents/ag_1234567890/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/agents/ag_1234567890/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/agents/ag_1234567890/versions") .header("X-API-KEY", "") .asString(); ``` ```php List versions request('GET', 'https://api.humanloop.com/v5/agents/ag_1234567890/versions', [ 'headers' => [ 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp List versions using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/agents/ag_1234567890/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/agents/ag_1234567890/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. # Deploy Agent POST https://api.humanloop.com/v5/agents/{id}/environments/{environment_id} Deploy Agent to an Environment. Set the deployed version for the specified Environment. This Agent will be used for calls made to the Agent in this Environment. Reference: https://humanloop.com/docs/api/agents/set-deployment ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /agents/{id}/environments/{environment_id}: post: operationId: set-deployment summary: Deploy Agent description: |- Deploy Agent to an Environment. Set the deployed version for the specified Environment. This Agent will be used for calls made to the Agent in this Environment. tags: - subpackage_agents parameters: - name: id in: path description: Unique identifier for Agent. 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 Agent. 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_:AgentResponse' '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_: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_: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/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.agents.setDeployment("id", "environment_id", { versionId: "version_id" }); ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/agents/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/agents/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/agents/id/environments/environment_id?version_id=version_id") .header("X-API-KEY", "") .asString(); ``` ```php request('POST', 'https://api.humanloop.com/v5/agents/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/agents/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/agents/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/agents/{id}/environments/{environment_id} Remove deployed Agent from the Environment. Remove the deployed version for the specified Environment. This Agent will no longer be used for calls made to the Agent in this Environment. Reference: https://humanloop.com/docs/api/agents/remove-deployment ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /agents/{id}/environments/{environment_id}: delete: operationId: remove-deployment summary: Remove Deployment description: |- Remove deployed Agent from the Environment. Remove the deployed version for the specified Environment. This Agent will no longer be used for calls made to the Agent in this Environment. tags: - subpackage_agents parameters: - name: id in: path description: Unique identifier for Agent. 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/agents/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.agents.removeDeployment("id", "environment_id"); ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/agents/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/agents/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/agents/id/environments/environment_id") .header("X-API-KEY", "") .asString(); ``` ```php request('DELETE', 'https://api.humanloop.com/v5/agents/id/environments/environment_id', [ 'headers' => [ 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/agents/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/agents/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 an Agent's Environments GET https://api.humanloop.com/v5/agents/{id}/environments List all Environments and their deployed versions for the Agent. Reference: https://humanloop.com/docs/api/agents/list-environments ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /agents/{id}/environments: get: operationId: list-environments summary: List an Agent's Environments description: List all Environments and their deployed versions for the Agent. tags: - subpackage_agents parameters: - name: id in: path description: Unique identifier for Agent. 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/agents/ag_1234567890/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.agents.listEnvironments("ag_1234567890"); ``` ```go List environments package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/agents/ag_1234567890/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/agents/ag_1234567890/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/agents/ag_1234567890/environments") .header("X-API-KEY", "") .asString(); ``` ```php List environments request('GET', 'https://api.humanloop.com/v5/agents/ag_1234567890/environments', [ 'headers' => [ 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp List environments using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/agents/ag_1234567890/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/agents/ag_1234567890/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/agents/{id}/evaluators Content-Type: application/json Activate and deactivate Evaluators for monitoring the Agent. An activated Evaluator will automatically be run on all new Logs within the Agent for monitoring purposes. Reference: https://humanloop.com/docs/api/agents/update-monitoring ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /agents/{id}/evaluators: post: operationId: update-monitoring summary: Update Monitoring description: |- Activate and deactivate Evaluators for monitoring the Agent. An activated Evaluator will automatically be run on all new Logs within the Agent for monitoring purposes. tags: - subpackage_agents 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_:AgentResponse' '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_: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_: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 Update Agent Monitoring import requests url = "https://api.humanloop.com/v5/agents/ag_1234567890/evaluators" payload = { "activate": [ { "evaluator_version_id": "ev_1234567890" }, { "evaluator_id": "ev_2345678901", "environment_id": "env_1234567890" } ], "deactivate": [{ "evaluator_version_id": "ev_0987654321" }] } headers = { "X-API-KEY": "", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```typescript Update Agent Monitoring import { HumanloopClient } from "humanloop"; const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); await client.agents.updateMonitoring("ag_1234567890", { activate: [{ evaluatorVersionId: "ev_1234567890" }, { evaluatorId: "ev_2345678901", environmentId: "env_1234567890" }], deactivate: [{ evaluatorVersionId: "ev_0987654321" }] }); ``` ```go Update Agent Monitoring package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/agents/ag_1234567890/evaluators" payload := strings.NewReader("{\n \"activate\": [\n {\n \"evaluator_version_id\": \"ev_1234567890\"\n },\n {\n \"evaluator_id\": \"ev_2345678901\",\n \"environment_id\": \"env_1234567890\"\n }\n ],\n \"deactivate\": [\n {\n \"evaluator_version_id\": \"ev_0987654321\"\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 Update Agent Monitoring require 'uri' require 'net/http' url = URI("https://api.humanloop.com/v5/agents/ag_1234567890/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\": \"ev_1234567890\"\n },\n {\n \"evaluator_id\": \"ev_2345678901\",\n \"environment_id\": \"env_1234567890\"\n }\n ],\n \"deactivate\": [\n {\n \"evaluator_version_id\": \"ev_0987654321\"\n }\n ]\n}" response = http.request(request) puts response.read_body ``` ```java Update Agent Monitoring import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.humanloop.com/v5/agents/ag_1234567890/evaluators") .header("X-API-KEY", "") .header("Content-Type", "application/json") .body("{\n \"activate\": [\n {\n \"evaluator_version_id\": \"ev_1234567890\"\n },\n {\n \"evaluator_id\": \"ev_2345678901\",\n \"environment_id\": \"env_1234567890\"\n }\n ],\n \"deactivate\": [\n {\n \"evaluator_version_id\": \"ev_0987654321\"\n }\n ]\n}") .asString(); ``` ```php Update Agent Monitoring request('POST', 'https://api.humanloop.com/v5/agents/ag_1234567890/evaluators', [ 'body' => '{ "activate": [ { "evaluator_version_id": "ev_1234567890" }, { "evaluator_id": "ev_2345678901", "environment_id": "env_1234567890" } ], "deactivate": [ { "evaluator_version_id": "ev_0987654321" } ] }', 'headers' => [ 'Content-Type' => 'application/json', 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp Update Agent Monitoring using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/agents/ag_1234567890/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\": \"ev_1234567890\"\n },\n {\n \"evaluator_id\": \"ev_2345678901\",\n \"environment_id\": \"env_1234567890\"\n }\n ],\n \"deactivate\": [\n {\n \"evaluator_version_id\": \"ev_0987654321\"\n }\n ]\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Update Agent Monitoring import Foundation let headers = [ "X-API-KEY": "", "Content-Type": "application/json" ] let parameters = [ "activate": [ ["evaluator_version_id": "ev_1234567890"], [ "evaluator_id": "ev_2345678901", "environment_id": "env_1234567890" ] ], "deactivate": [["evaluator_version_id": "ev_0987654321"]] ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/agents/ag_1234567890/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/agents/{id}/serialize Serialize an Agent to the .agent file format. Useful for storing the Agent with your code in a version control system, or for editing with an AI tool. By default, the deployed version of the Agent is returned. Use the query parameters `version_id` or `environment` to target a specific version of the Agent. Reference: https://humanloop.com/docs/api/agents/serialize ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /agents/{id}/serialize: get: operationId: serialize summary: Serialize description: >- Serialize an Agent to the .agent file format. Useful for storing the Agent with your code in a version control system, or for editing with an AI tool. By default, the deployed version of the Agent is returned. Use the query parameters `version_id` or `environment` to target a specific 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: query description: A specific Version ID of the Agent 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/agents/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.agents.serialize("id"); ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/agents/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/agents/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/agents/id/serialize") .header("X-API-KEY", "") .asString(); ``` ```php request('GET', 'https://api.humanloop.com/v5/agents/id/serialize', [ 'headers' => [ 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/agents/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/agents/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/agents/deserialize Content-Type: application/json Deserialize an Agent from the .agent file format. This returns a subset of the attributes required by an Agent. This subset is the bit that defines the Agent version (e.g. with `model` and `temperature` etc) Reference: https://humanloop.com/docs/api/agents/deserialize ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /agents/deserialize: post: operationId: deserialize summary: Deserialize description: >- Deserialize an Agent from the .agent file format. This returns a subset of the attributes required by an Agent. This subset is the bit that defines the Agent version (e.g. with `model` and `temperature` etc) 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_:AgentKernelRequest' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/type_:HttpValidationError' requestBody: content: application/json: schema: type: object properties: agent: type: string required: - agent 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_: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_: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/deserialize" payload = { "agent": "agent" } 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.agents.deserialize({ agent: "agent" }); ``` ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/agents/deserialize" payload := strings.NewReader("{\n \"agent\": \"agent\"\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/agents/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 \"agent\": \"agent\"\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/agents/deserialize") .header("X-API-KEY", "") .header("Content-Type", "application/json") .body("{\n \"agent\": \"agent\"\n}") .asString(); ``` ```php request('POST', 'https://api.humanloop.com/v5/agents/deserialize', [ 'body' => '{ "agent": "agent" }', 'headers' => [ 'Content-Type' => 'application/json', 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/agents/deserialize"); var request = new RestRequest(Method.POST); request.AddHeader("X-API-KEY", ""); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"agent\": \"agent\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "X-API-KEY": "", "Content-Type": "application/json" ] let parameters = ["agent": "agent"] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/agents/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 a Flow POST https://api.humanloop.com/v5/flows/log Content-Type: application/json Log to a Flow. You can use query parameters `version_id`, or `environment`, to target an existing version of the Flow. Otherwise, the default deployed version will be chosen. Reference: https://humanloop.com/docs/api/flows/log ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /flows/log: post: operationId: log summary: Log to a Flow description: >- Log to a Flow. You can use query parameters `version_id`, or `environment`, to target an existing version of the Flow. Otherwise, the default deployed version will be chosen. tags: - subpackage_flows parameters: - name: version_id in: query description: A specific Version ID of the Flow 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_:CreateFlowLogResponse' '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. run_id: type: string description: Unique identifier for the Run to associate the Log to. path: type: string description: >- Path of the Flow, including the name. This locates the Flow 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 Flow. start_time: type: string format: date-time description: >- The start time of the Trace. Will be updated if a child Log with an earlier start time is added. end_time: type: string format: date-time description: >- The end time of the Trace. Will be updated if a child Log with a later end time is added. 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 Flow Log. When a Log is updated from `incomplete` to `complete`, no more Logs can be added to it. 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. flow: $ref: '#/components/schemas/type_:FlowKernelRequest' description: Flow used to generate the Trace. 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_:FlowKernelRequest: type: object properties: attributes: type: object additionalProperties: description: Any type description: A key-value object identifying the Flow Version. required: - attributes title: FlowKernelRequest type_:CreateFlowLogResponse: type: object properties: id: type: string description: Unique identifier for the Log. flow_id: type: string description: Unique identifier for the Flow. version_id: type: string description: Unique identifier for the Flow Version. log_status: $ref: '#/components/schemas/type_:LogStatus' description: >- Status of the Flow Log. When a Flow Log is marked as `complete`, no more Logs can be added to it. required: - id - flow_id - version_id description: Response for a Flow Log. title: CreateFlowLogResponse 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 flow import requests url = "https://api.humanloop.com/v5/flows/log" payload = { "id": "fl_6o701g4jmcanPVHxdqD0O", "start_time": "2024-07-08T22:40:35", "end_time": "2024-07-08T22:40:39", "output": "The patient is likely experiencing a myocardial infarction. Immediate medical attention is required.", "inputs": { "question": "Patient with a history of diabetes and hypertension presents with chest pain and shortness of breath." }, "log_status": "incomplete", "flow": { "attributes": { "prompt": { "template": "You are a helpful assistant helping with medical anamnesis", "model": "gpt-4o", "temperature": 0.8 }, "tool": { "name": "retrieval_tool_v3", "description": "Retrieval tool for MedQA.", "source_code": "def retrieval_tool(question: str) -> str: pass " } } } } headers = { "X-API-KEY": "", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```typescript Log flow import { HumanloopClient } from "humanloop"; const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); await client.flows.log({ id: "fl_6o701g4jmcanPVHxdqD0O", flow: { attributes: { "prompt": { "template": "You are a helpful assistant helping with medical anamnesis", "model": "gpt-4o", "temperature": 0.8 }, "tool": { "name": "retrieval_tool_v3", "description": "Retrieval tool for MedQA.", "source_code": "def retrieval_tool(question: str) -> str:\n pass\n" } } }, inputs: { "question": "Patient with a history of diabetes and hypertension presents with chest pain and shortness of breath." }, output: "The patient is likely experiencing a myocardial infarction. Immediate medical attention is required.", logStatus: "incomplete", startTime: "2024-07-08T22:40:35", endTime: "2024-07-08T22:40:39" }); ``` ```go Log flow package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/flows/log" payload := strings.NewReader("{\n \"id\": \"fl_6o701g4jmcanPVHxdqD0O\",\n \"start_time\": \"2024-07-08T22:40:35\",\n \"end_time\": \"2024-07-08T22:40:39\",\n \"output\": \"The patient is likely experiencing a myocardial infarction. Immediate medical attention is required.\",\n \"inputs\": {\n \"question\": \"Patient with a history of diabetes and hypertension presents with chest pain and shortness of breath.\"\n },\n \"log_status\": \"incomplete\",\n \"flow\": {\n \"attributes\": {\n \"prompt\": {\n \"template\": \"You are a helpful assistant helping with medical anamnesis\",\n \"model\": \"gpt-4o\",\n \"temperature\": 0.8\n },\n \"tool\": {\n \"name\": \"retrieval_tool_v3\",\n \"description\": \"Retrieval tool for MedQA.\",\n \"source_code\": \"def retrieval_tool(question: str) -> str:\\n pass\\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 Log flow require 'uri' require 'net/http' url = URI("https://api.humanloop.com/v5/flows/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 \"id\": \"fl_6o701g4jmcanPVHxdqD0O\",\n \"start_time\": \"2024-07-08T22:40:35\",\n \"end_time\": \"2024-07-08T22:40:39\",\n \"output\": \"The patient is likely experiencing a myocardial infarction. Immediate medical attention is required.\",\n \"inputs\": {\n \"question\": \"Patient with a history of diabetes and hypertension presents with chest pain and shortness of breath.\"\n },\n \"log_status\": \"incomplete\",\n \"flow\": {\n \"attributes\": {\n \"prompt\": {\n \"template\": \"You are a helpful assistant helping with medical anamnesis\",\n \"model\": \"gpt-4o\",\n \"temperature\": 0.8\n },\n \"tool\": {\n \"name\": \"retrieval_tool_v3\",\n \"description\": \"Retrieval tool for MedQA.\",\n \"source_code\": \"def retrieval_tool(question: str) -> str:\\n pass\\n\"\n }\n }\n }\n}" response = http.request(request) puts response.read_body ``` ```java Log flow import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.humanloop.com/v5/flows/log") .header("X-API-KEY", "") .header("Content-Type", "application/json") .body("{\n \"id\": \"fl_6o701g4jmcanPVHxdqD0O\",\n \"start_time\": \"2024-07-08T22:40:35\",\n \"end_time\": \"2024-07-08T22:40:39\",\n \"output\": \"The patient is likely experiencing a myocardial infarction. Immediate medical attention is required.\",\n \"inputs\": {\n \"question\": \"Patient with a history of diabetes and hypertension presents with chest pain and shortness of breath.\"\n },\n \"log_status\": \"incomplete\",\n \"flow\": {\n \"attributes\": {\n \"prompt\": {\n \"template\": \"You are a helpful assistant helping with medical anamnesis\",\n \"model\": \"gpt-4o\",\n \"temperature\": 0.8\n },\n \"tool\": {\n \"name\": \"retrieval_tool_v3\",\n \"description\": \"Retrieval tool for MedQA.\",\n \"source_code\": \"def retrieval_tool(question: str) -> str:\\n pass\\n\"\n }\n }\n }\n}") .asString(); ``` ```php Log flow request('POST', 'https://api.humanloop.com/v5/flows/log', [ 'body' => '{ "id": "fl_6o701g4jmcanPVHxdqD0O", "start_time": "2024-07-08T22:40:35", "end_time": "2024-07-08T22:40:39", "output": "The patient is likely experiencing a myocardial infarction. Immediate medical attention is required.", "inputs": { "question": "Patient with a history of diabetes and hypertension presents with chest pain and shortness of breath." }, "log_status": "incomplete", "flow": { "attributes": { "prompt": { "template": "You are a helpful assistant helping with medical anamnesis", "model": "gpt-4o", "temperature": 0.8 }, "tool": { "name": "retrieval_tool_v3", "description": "Retrieval tool for MedQA.", "source_code": "def retrieval_tool(question: str) -> str:\\n pass\\n" } } } }', 'headers' => [ 'Content-Type' => 'application/json', 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp Log flow using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/flows/log"); var request = new RestRequest(Method.POST); request.AddHeader("X-API-KEY", ""); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"id\": \"fl_6o701g4jmcanPVHxdqD0O\",\n \"start_time\": \"2024-07-08T22:40:35\",\n \"end_time\": \"2024-07-08T22:40:39\",\n \"output\": \"The patient is likely experiencing a myocardial infarction. Immediate medical attention is required.\",\n \"inputs\": {\n \"question\": \"Patient with a history of diabetes and hypertension presents with chest pain and shortness of breath.\"\n },\n \"log_status\": \"incomplete\",\n \"flow\": {\n \"attributes\": {\n \"prompt\": {\n \"template\": \"You are a helpful assistant helping with medical anamnesis\",\n \"model\": \"gpt-4o\",\n \"temperature\": 0.8\n },\n \"tool\": {\n \"name\": \"retrieval_tool_v3\",\n \"description\": \"Retrieval tool for MedQA.\",\n \"source_code\": \"def retrieval_tool(question: str) -> str:\\n pass\\n\"\n }\n }\n }\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Log flow import Foundation let headers = [ "X-API-KEY": "", "Content-Type": "application/json" ] let parameters = [ "id": "fl_6o701g4jmcanPVHxdqD0O", "start_time": "2024-07-08T22:40:35", "end_time": "2024-07-08T22:40:39", "output": "The patient is likely experiencing a myocardial infarction. Immediate medical attention is required.", "inputs": ["question": "Patient with a history of diabetes and hypertension presents with chest pain and shortness of breath."], "log_status": "incomplete", "flow": ["attributes": [ "prompt": [ "template": "You are a helpful assistant helping with medical anamnesis", "model": "gpt-4o", "temperature": 0.8 ], "tool": [ "name": "retrieval_tool_v3", "description": "Retrieval tool for MedQA.", "source_code": "def retrieval_tool(question: str) -> str: pass " ] ]] ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/flows/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 Flow Log PATCH https://api.humanloop.com/v5/flows/logs/{log_id} Content-Type: application/json Update the status, inputs, output of a Flow Log. Marking a Flow Log as complete will trigger any monitoring Evaluators to run. Inputs and output (or error) must be provided in order to mark it as complete. The end_time log attribute will be set to match the time the log is marked as complete. Reference: https://humanloop.com/docs/api/flows/update-log ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /flows/logs/{log_id}: patch: operationId: update-log summary: Update Flow Log description: >- Update the status, inputs, output of a Flow Log. Marking a Flow Log as complete will trigger any monitoring Evaluators to run. Inputs and output (or error) must be provided in order to mark it as complete. The end_time log attribute will be set to match the time the log is marked as complete. tags: - subpackage_flows parameters: - name: log_id in: path description: Unique identifier of the Flow 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_:FlowLogResponse' '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_:EvaluatorLogResponseJudgment: oneOf: - type: boolean - type: string - type: array items: type: string - type: number format: double description: Evaluator assessment of the Log. title: EvaluatorLogResponseJudgment 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_: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_: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_: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_: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_: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 Update log import requests url = "https://api.humanloop.com/v5/flows/logs/medqa_experiment_0001" payload = { "inputs": { "question": "Patient with a history of diabetes and normal tension presents with chest pain and shortness of breath." }, "output": "The patient is likely experiencing a myocardial infarction. Immediate medical attention is required.", "error": None, "log_status": "complete" } headers = { "X-API-KEY": "", "Content-Type": "application/json" } response = requests.patch(url, json=payload, headers=headers) print(response.json()) ``` ```typescript Update log import { HumanloopClient } from "humanloop"; const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); await client.flows.updateLog("medqa_experiment_0001", { inputs: { "question": "Patient with a history of diabetes and normal tension presents with chest pain and shortness of breath." }, output: "The patient is likely experiencing a myocardial infarction. Immediate medical attention is required.", logStatus: "complete", error: undefined }); ``` ```go Update log package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/flows/logs/medqa_experiment_0001" payload := strings.NewReader("{\n \"inputs\": {\n \"question\": \"Patient with a history of diabetes and normal tension presents with chest pain and shortness of breath.\"\n },\n \"output\": \"The patient is likely experiencing a myocardial infarction. Immediate medical attention is required.\",\n \"error\": null,\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 Update log require 'uri' require 'net/http' url = URI("https://api.humanloop.com/v5/flows/logs/medqa_experiment_0001") 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 \"inputs\": {\n \"question\": \"Patient with a history of diabetes and normal tension presents with chest pain and shortness of breath.\"\n },\n \"output\": \"The patient is likely experiencing a myocardial infarction. Immediate medical attention is required.\",\n \"error\": null,\n \"log_status\": \"complete\"\n}" response = http.request(request) puts response.read_body ``` ```java Update log import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.patch("https://api.humanloop.com/v5/flows/logs/medqa_experiment_0001") .header("X-API-KEY", "") .header("Content-Type", "application/json") .body("{\n \"inputs\": {\n \"question\": \"Patient with a history of diabetes and normal tension presents with chest pain and shortness of breath.\"\n },\n \"output\": \"The patient is likely experiencing a myocardial infarction. Immediate medical attention is required.\",\n \"error\": null,\n \"log_status\": \"complete\"\n}") .asString(); ``` ```php Update log request('PATCH', 'https://api.humanloop.com/v5/flows/logs/medqa_experiment_0001', [ 'body' => '{ "inputs": { "question": "Patient with a history of diabetes and normal tension presents with chest pain and shortness of breath." }, "output": "The patient is likely experiencing a myocardial infarction. Immediate medical attention is required.", "error": null, "log_status": "complete" }', 'headers' => [ 'Content-Type' => 'application/json', 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp Update log using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/flows/logs/medqa_experiment_0001"); var request = new RestRequest(Method.PATCH); request.AddHeader("X-API-KEY", ""); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"inputs\": {\n \"question\": \"Patient with a history of diabetes and normal tension presents with chest pain and shortness of breath.\"\n },\n \"output\": \"The patient is likely experiencing a myocardial infarction. Immediate medical attention is required.\",\n \"error\": null,\n \"log_status\": \"complete\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Update log import Foundation let headers = [ "X-API-KEY": "", "Content-Type": "application/json" ] let parameters = [ "inputs": ["question": "Patient with a history of diabetes and normal tension presents with chest pain and shortness of breath."], "output": "The patient is likely experiencing a myocardial infarction. Immediate medical attention is required.", "error": , "log_status": "complete" ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/flows/logs/medqa_experiment_0001")! 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. # Get Flow GET https://api.humanloop.com/v5/flows/{id} Retrieve the Flow with the given ID. By default, the deployed version of the Flow is returned. Use the query parameters `version_id` or `environment` to target a specific version of the Flow. Reference: https://humanloop.com/docs/api/flows/get ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /flows/{id}: get: operationId: get summary: Get Flow description: >- Retrieve the Flow with the given ID. By default, the deployed version of the Flow is returned. Use the query parameters `version_id` or `environment` to target a specific version of the Flow. tags: - subpackage_flows parameters: - name: id in: path description: Unique identifier for Flow. required: true schema: type: string - name: version_id in: query description: A specific Version ID of the Flow 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_:FlowResponse' '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_: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_: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_: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_:InputResponse: type: object properties: name: type: string description: Type of input. required: - name title: InputResponse 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_: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_: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_: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 flow import requests url = "https://api.humanloop.com/v5/flows/fl_6o701g4jmcanPVHxdqD0O" headers = {"X-API-KEY": ""} response = requests.get(url, headers=headers) print(response.json()) ``` ```typescript Get specific flow import { HumanloopClient } from "humanloop"; const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); await client.flows.get("fl_6o701g4jmcanPVHxdqD0O"); ``` ```go Get specific flow package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/flows/fl_6o701g4jmcanPVHxdqD0O" 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 flow require 'uri' require 'net/http' url = URI("https://api.humanloop.com/v5/flows/fl_6o701g4jmcanPVHxdqD0O") 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 flow import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api.humanloop.com/v5/flows/fl_6o701g4jmcanPVHxdqD0O") .header("X-API-KEY", "") .asString(); ``` ```php Get specific flow request('GET', 'https://api.humanloop.com/v5/flows/fl_6o701g4jmcanPVHxdqD0O', [ 'headers' => [ 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp Get specific flow using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/flows/fl_6o701g4jmcanPVHxdqD0O"); var request = new RestRequest(Method.GET); request.AddHeader("X-API-KEY", ""); IRestResponse response = client.Execute(request); ``` ```swift Get specific flow import Foundation let headers = ["X-API-KEY": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/flows/fl_6o701g4jmcanPVHxdqD0O")! 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 Flow DELETE https://api.humanloop.com/v5/flows/{id} Delete the Flow with the given ID. Reference: https://humanloop.com/docs/api/flows/delete ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /flows/{id}: delete: operationId: delete summary: Delete Flow description: Delete the Flow with the given ID. tags: - subpackage_flows parameters: - name: id in: path description: Unique identifier for Flow. 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 flow import requests url = "https://api.humanloop.com/v5/flows/fl_6o701g4jmcanPVHxdqD0O" headers = {"X-API-KEY": ""} response = requests.delete(url, headers=headers) print(response.json()) ``` ```typescript Delete flow import { HumanloopClient } from "humanloop"; const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); await client.flows.delete("fl_6o701g4jmcanPVHxdqD0O"); ``` ```go Delete flow package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/flows/fl_6o701g4jmcanPVHxdqD0O" 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 flow require 'uri' require 'net/http' url = URI("https://api.humanloop.com/v5/flows/fl_6o701g4jmcanPVHxdqD0O") 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 flow import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.delete("https://api.humanloop.com/v5/flows/fl_6o701g4jmcanPVHxdqD0O") .header("X-API-KEY", "") .asString(); ``` ```php Delete flow request('DELETE', 'https://api.humanloop.com/v5/flows/fl_6o701g4jmcanPVHxdqD0O', [ 'headers' => [ 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp Delete flow using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/flows/fl_6o701g4jmcanPVHxdqD0O"); var request = new RestRequest(Method.DELETE); request.AddHeader("X-API-KEY", ""); IRestResponse response = client.Execute(request); ``` ```swift Delete flow import Foundation let headers = ["X-API-KEY": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/flows/fl_6o701g4jmcanPVHxdqD0O")! 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 Flow PATCH https://api.humanloop.com/v5/flows/{id} Content-Type: application/json Move the Flow to a different path or change the name. Reference: https://humanloop.com/docs/api/flows/move ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /flows/{id}: patch: operationId: move summary: Move Flow description: Move the Flow to a different path or change the name. tags: - subpackage_flows parameters: - name: id in: path description: Unique identifier for Flow. 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_:FlowResponse' '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 Flow including the Flow name, which is used as a unique identifier. name: type: string description: Name of the Flow. directory_id: type: string description: >- Unique identifier for the Directory to move Flow to. Starts with `dir_`. servers: - url: https://api.humanloop.com/v5 components: schemas: 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_: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_: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_:InputResponse: type: object properties: name: type: string description: Type of input. required: - name title: InputResponse 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_: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_: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_: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 flow import requests url = "https://api.humanloop.com/v5/flows/fl_6o701g4jmcanPVHxdqD0O" 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 flow import { HumanloopClient } from "humanloop"; const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); await client.flows.move("fl_6o701g4jmcanPVHxdqD0O", { path: "new directory/new name" }); ``` ```go Move flow package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/flows/fl_6o701g4jmcanPVHxdqD0O" 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 flow require 'uri' require 'net/http' url = URI("https://api.humanloop.com/v5/flows/fl_6o701g4jmcanPVHxdqD0O") 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 flow import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.patch("https://api.humanloop.com/v5/flows/fl_6o701g4jmcanPVHxdqD0O") .header("X-API-KEY", "") .header("Content-Type", "application/json") .body("{\n \"path\": \"new directory/new name\"\n}") .asString(); ``` ```php Move flow request('PATCH', 'https://api.humanloop.com/v5/flows/fl_6o701g4jmcanPVHxdqD0O', [ 'body' => '{ "path": "new directory/new name" }', 'headers' => [ 'Content-Type' => 'application/json', 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp Move flow using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/flows/fl_6o701g4jmcanPVHxdqD0O"); 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 flow 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/flows/fl_6o701g4jmcanPVHxdqD0O")! 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. # List Flows GET https://api.humanloop.com/v5/flows Get a list of Flows. Reference: https://humanloop.com/docs/api/flows/list ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /flows: get: operationId: list summary: List Flows description: Get a list of Flows. tags: - subpackage_flows 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 Flows to fetch. required: false schema: type: integer default: 10 - name: name in: query description: Case-insensitive filter for Flow name. required: false schema: type: string - name: user_filter in: query description: >- Case-insensitive filter for users in the Flow. 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 Flows 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_:PaginatedDataFlowResponse' '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_: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_: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_: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_:InputResponse: type: object properties: name: type: string description: Type of input. required: - name title: InputResponse 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_: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_: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_:PaginatedDataFlowResponse: type: object properties: records: type: array items: $ref: '#/components/schemas/type_:FlowResponse' page: type: integer size: type: integer total: type: integer required: - records - page - size - total title: PaginatedDataFlowResponse 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/flows" 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.flows.list({ size: 1 }); for await (const item of response) { console.log(item); } // Or you can manually iterate page-by-page const page = await client.flows.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/flows?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/flows?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/flows?size=1") .header("X-API-KEY", "") .asString(); ``` ```php request('GET', 'https://api.humanloop.com/v5/flows?size=1', [ 'headers' => [ 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/flows?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/flows?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 Flow POST https://api.humanloop.com/v5/flows Content-Type: application/json Create or update a Flow. Flows can also be identified by the `ID` or their `path`. You can provide `version_name` and `version_description` to identify and describe your versions. Version names must be unique within a Flow - attempting to create a version with a name that already exists will result in a 409 Conflict error. Reference: https://humanloop.com/docs/api/flows/upsert ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /flows: post: operationId: upsert summary: Upsert Flow description: >- Create or update a Flow. Flows can also be identified by the `ID` or their `path`. You can provide `version_name` and `version_description` to identify and describe your versions. Version names must be unique within a Flow - attempting to create a version with a name that already exists will result in a 409 Conflict error. tags: - subpackage_flows 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_:FlowResponse' '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 Flow, including the name. This locates the Flow 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 Flow. 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, e.g., the changes made in this version. required: - attributes servers: - url: https://api.humanloop.com/v5 components: schemas: 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_: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_: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_:InputResponse: type: object properties: name: type: string description: Type of input. required: - name title: InputResponse 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_: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_: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_: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 flow import requests url = "https://api.humanloop.com/v5/flows" payload = { "attributes": { "prompt": { "template": "You are a helpful medical assistant helping with medical anamnesis. Answer {{question}}", "model": "gpt-4o", "temperature": 0.8 }, "tool": { "name": "retrieval_tool_v3", "description": "Retrieval tool for MedQA.", "source_code": "def retrieval_tool(question: str) -> str: pass " }, "version_name": "medqa-flow-v1", "version_description": "Initial version" }, "path": "Personal Projects/MedQA Flow" } headers = { "X-API-KEY": "", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```typescript Upsert flow import { HumanloopClient } from "humanloop"; const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); await client.flows.upsert({ path: "Personal Projects/MedQA Flow", attributes: { "prompt": { "template": "You are a helpful medical assistant helping with medical anamnesis. Answer {{question}}", "model": "gpt-4o", "temperature": 0.8 }, "tool": { "name": "retrieval_tool_v3", "description": "Retrieval tool for MedQA.", "source_code": "def retrieval_tool(question: str) -> str:\n pass\n" }, "version_name": "medqa-flow-v1", "version_description": "Initial version" } }); ``` ```go Upsert flow package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/flows" payload := strings.NewReader("{\n \"attributes\": {\n \"prompt\": {\n \"template\": \"You are a helpful medical assistant helping with medical anamnesis. Answer {{question}}\",\n \"model\": \"gpt-4o\",\n \"temperature\": 0.8\n },\n \"tool\": {\n \"name\": \"retrieval_tool_v3\",\n \"description\": \"Retrieval tool for MedQA.\",\n \"source_code\": \"def retrieval_tool(question: str) -> str:\\n pass\\n\"\n },\n \"version_name\": \"medqa-flow-v1\",\n \"version_description\": \"Initial version\"\n },\n \"path\": \"Personal Projects/MedQA Flow\"\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 flow require 'uri' require 'net/http' url = URI("https://api.humanloop.com/v5/flows") 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 \"attributes\": {\n \"prompt\": {\n \"template\": \"You are a helpful medical assistant helping with medical anamnesis. Answer {{question}}\",\n \"model\": \"gpt-4o\",\n \"temperature\": 0.8\n },\n \"tool\": {\n \"name\": \"retrieval_tool_v3\",\n \"description\": \"Retrieval tool for MedQA.\",\n \"source_code\": \"def retrieval_tool(question: str) -> str:\\n pass\\n\"\n },\n \"version_name\": \"medqa-flow-v1\",\n \"version_description\": \"Initial version\"\n },\n \"path\": \"Personal Projects/MedQA Flow\"\n}" response = http.request(request) puts response.read_body ``` ```java Upsert flow import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.humanloop.com/v5/flows") .header("X-API-KEY", "") .header("Content-Type", "application/json") .body("{\n \"attributes\": {\n \"prompt\": {\n \"template\": \"You are a helpful medical assistant helping with medical anamnesis. Answer {{question}}\",\n \"model\": \"gpt-4o\",\n \"temperature\": 0.8\n },\n \"tool\": {\n \"name\": \"retrieval_tool_v3\",\n \"description\": \"Retrieval tool for MedQA.\",\n \"source_code\": \"def retrieval_tool(question: str) -> str:\\n pass\\n\"\n },\n \"version_name\": \"medqa-flow-v1\",\n \"version_description\": \"Initial version\"\n },\n \"path\": \"Personal Projects/MedQA Flow\"\n}") .asString(); ``` ```php Upsert flow request('POST', 'https://api.humanloop.com/v5/flows', [ 'body' => '{ "attributes": { "prompt": { "template": "You are a helpful medical assistant helping with medical anamnesis. Answer {{question}}", "model": "gpt-4o", "temperature": 0.8 }, "tool": { "name": "retrieval_tool_v3", "description": "Retrieval tool for MedQA.", "source_code": "def retrieval_tool(question: str) -> str:\\n pass\\n" }, "version_name": "medqa-flow-v1", "version_description": "Initial version" }, "path": "Personal Projects/MedQA Flow" }', 'headers' => [ 'Content-Type' => 'application/json', 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp Upsert flow using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/flows"); var request = new RestRequest(Method.POST); request.AddHeader("X-API-KEY", ""); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"attributes\": {\n \"prompt\": {\n \"template\": \"You are a helpful medical assistant helping with medical anamnesis. Answer {{question}}\",\n \"model\": \"gpt-4o\",\n \"temperature\": 0.8\n },\n \"tool\": {\n \"name\": \"retrieval_tool_v3\",\n \"description\": \"Retrieval tool for MedQA.\",\n \"source_code\": \"def retrieval_tool(question: str) -> str:\\n pass\\n\"\n },\n \"version_name\": \"medqa-flow-v1\",\n \"version_description\": \"Initial version\"\n },\n \"path\": \"Personal Projects/MedQA Flow\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Upsert flow import Foundation let headers = [ "X-API-KEY": "", "Content-Type": "application/json" ] let parameters = [ "attributes": [ "prompt": [ "template": "You are a helpful medical assistant helping with medical anamnesis. Answer {{question}}", "model": "gpt-4o", "temperature": 0.8 ], "tool": [ "name": "retrieval_tool_v3", "description": "Retrieval tool for MedQA.", "source_code": "def retrieval_tool(question: str) -> str: pass " ], "version_name": "medqa-flow-v1", "version_description": "Initial version" ], "path": "Personal Projects/MedQA Flow" ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/flows")! 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 Flow GET https://api.humanloop.com/v5/flows/{id}/versions Get a list of all the versions of a Flow. Reference: https://humanloop.com/docs/api/flows/list-versions ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /flows/{id}/versions: get: operationId: list-versions summary: List Versions of a Flow description: Get a list of all the versions of a Flow. tags: - subpackage_flows parameters: - name: id in: path description: Unique identifier for Flow. 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_:ListFlows' '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_: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_: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_: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_:InputResponse: type: object properties: name: type: string description: Type of input. required: - name title: InputResponse 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_: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_: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_:ListFlows: type: object properties: records: type: array items: $ref: '#/components/schemas/type_:FlowResponse' description: The list of Flows. required: - records title: ListFlows 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/flows/fl_6o701g4jmcanPVHxdqD0O/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.flows.listVersions("fl_6o701g4jmcanPVHxdqD0O"); ``` ```go List versions package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/flows/fl_6o701g4jmcanPVHxdqD0O/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/flows/fl_6o701g4jmcanPVHxdqD0O/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/flows/fl_6o701g4jmcanPVHxdqD0O/versions") .header("X-API-KEY", "") .asString(); ``` ```php List versions request('GET', 'https://api.humanloop.com/v5/flows/fl_6o701g4jmcanPVHxdqD0O/versions', [ 'headers' => [ 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp List versions using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/flows/fl_6o701g4jmcanPVHxdqD0O/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/flows/fl_6o701g4jmcanPVHxdqD0O/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 Flow Version DELETE https://api.humanloop.com/v5/flows/{id}/versions/{version_id} Delete a version of the Flow. Reference: https://humanloop.com/docs/api/flows/delete-flow-version ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /flows/{id}/versions/{version_id}: delete: operationId: delete-flow-version summary: Delete Flow Version description: Delete a version of the Flow. tags: - subpackage_flows parameters: - name: id in: path description: Unique identifier for Flow. required: true schema: type: string - name: version_id in: path description: Unique identifier for the specific version of the Flow. 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/flows/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.flows.deleteFlowVersion("id", "version_id"); ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/flows/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/flows/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/flows/id/versions/version_id") .header("X-API-KEY", "") .asString(); ``` ```php request('DELETE', 'https://api.humanloop.com/v5/flows/id/versions/version_id', [ 'headers' => [ 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/flows/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/flows/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 Flow Version PATCH https://api.humanloop.com/v5/flows/{id}/versions/{version_id} Content-Type: application/json Update the name or description of the Flow version. Reference: https://humanloop.com/docs/api/flows/update-flow-version ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /flows/{id}/versions/{version_id}: patch: operationId: update-flow-version summary: Update Flow Version description: Update the name or description of the Flow version. tags: - subpackage_flows parameters: - name: id in: path description: Unique identifier for Flow. required: true schema: type: string - name: version_id in: path description: Unique identifier for the specific version of the Flow. 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_:FlowResponse' '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_: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_: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_: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_:InputResponse: type: object properties: name: type: string description: Type of input. required: - name title: InputResponse 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_: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_: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_: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/flows/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.flows.updateFlowVersion("id", "version_id", {}); ``` ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/flows/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/flows/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/flows/id/versions/version_id") .header("X-API-KEY", "") .header("Content-Type", "application/json") .body("{}") .asString(); ``` ```php request('PATCH', 'https://api.humanloop.com/v5/flows/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/flows/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/flows/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 Flow POST https://api.humanloop.com/v5/flows/{id}/environments/{environment_id} Deploy Flow to an Environment. Set the deployed version for the specified Environment. This Flow will be used for calls made to the Flow in this Environment. Reference: https://humanloop.com/docs/api/flows/set-deployment ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /flows/{id}/environments/{environment_id}: post: operationId: set-deployment summary: Deploy Flow description: |- Deploy Flow to an Environment. Set the deployed version for the specified Environment. This Flow will be used for calls made to the Flow in this Environment. tags: - subpackage_flows parameters: - name: id in: path description: Unique identifier for Flow. 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 Flow. 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_:FlowResponse' '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_: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_: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_: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_:InputResponse: type: object properties: name: type: string description: Type of input. required: - name title: InputResponse 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_: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_: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_: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 Deploy import requests url = "https://api.humanloop.com/v5/flows/fl_6o701g4jmcanPVHxdqD0O/environments/staging" querystring = {"version_id":"flv_6o701g4jmcanPVHxdqD0O"} headers = {"X-API-KEY": ""} response = requests.post(url, headers=headers, params=querystring) print(response.json()) ``` ```typescript Deploy import { HumanloopClient } from "humanloop"; const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); await client.flows.setDeployment("fl_6o701g4jmcanPVHxdqD0O", "staging", { versionId: "flv_6o701g4jmcanPVHxdqD0O" }); ``` ```go Deploy package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/flows/fl_6o701g4jmcanPVHxdqD0O/environments/staging?version_id=flv_6o701g4jmcanPVHxdqD0O" 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 Deploy require 'uri' require 'net/http' url = URI("https://api.humanloop.com/v5/flows/fl_6o701g4jmcanPVHxdqD0O/environments/staging?version_id=flv_6o701g4jmcanPVHxdqD0O") 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 Deploy import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.humanloop.com/v5/flows/fl_6o701g4jmcanPVHxdqD0O/environments/staging?version_id=flv_6o701g4jmcanPVHxdqD0O") .header("X-API-KEY", "") .asString(); ``` ```php Deploy request('POST', 'https://api.humanloop.com/v5/flows/fl_6o701g4jmcanPVHxdqD0O/environments/staging?version_id=flv_6o701g4jmcanPVHxdqD0O', [ 'headers' => [ 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp Deploy using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/flows/fl_6o701g4jmcanPVHxdqD0O/environments/staging?version_id=flv_6o701g4jmcanPVHxdqD0O"); var request = new RestRequest(Method.POST); request.AddHeader("X-API-KEY", ""); IRestResponse response = client.Execute(request); ``` ```swift Deploy import Foundation let headers = ["X-API-KEY": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/flows/fl_6o701g4jmcanPVHxdqD0O/environments/staging?version_id=flv_6o701g4jmcanPVHxdqD0O")! 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/flows/{id}/environments/{environment_id} Remove deployed Flow from the Environment. Remove the deployed version for the specified Environment. This Flow will no longer be used for calls made to the Flow in this Environment. Reference: https://humanloop.com/docs/api/flows/remove-deployment ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /flows/{id}/environments/{environment_id}: delete: operationId: remove-deployment summary: Remove Deployment description: |- Remove deployed Flow from the Environment. Remove the deployed version for the specified Environment. This Flow will no longer be used for calls made to the Flow in this Environment. tags: - subpackage_flows parameters: - name: id in: path description: Unique identifier for Flow. 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 Delete environment import requests url = "https://api.humanloop.com/v5/flows/fl_6o701g4jmcanPVHxdqD0O/environments/staging" headers = {"X-API-KEY": ""} response = requests.delete(url, headers=headers) print(response.json()) ``` ```typescript Delete environment import { HumanloopClient } from "humanloop"; const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); await client.flows.removeDeployment("fl_6o701g4jmcanPVHxdqD0O", "staging"); ``` ```go Delete environment package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/flows/fl_6o701g4jmcanPVHxdqD0O/environments/staging" 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 environment require 'uri' require 'net/http' url = URI("https://api.humanloop.com/v5/flows/fl_6o701g4jmcanPVHxdqD0O/environments/staging") 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 environment import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.delete("https://api.humanloop.com/v5/flows/fl_6o701g4jmcanPVHxdqD0O/environments/staging") .header("X-API-KEY", "") .asString(); ``` ```php Delete environment request('DELETE', 'https://api.humanloop.com/v5/flows/fl_6o701g4jmcanPVHxdqD0O/environments/staging', [ 'headers' => [ 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp Delete environment using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/flows/fl_6o701g4jmcanPVHxdqD0O/environments/staging"); var request = new RestRequest(Method.DELETE); request.AddHeader("X-API-KEY", ""); IRestResponse response = client.Execute(request); ``` ```swift Delete environment import Foundation let headers = ["X-API-KEY": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/flows/fl_6o701g4jmcanPVHxdqD0O/environments/staging")! 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 Flow's Environments GET https://api.humanloop.com/v5/flows/{id}/environments List all Environments and their deployed versions for the Flow. Reference: https://humanloop.com/docs/api/flows/list-environments ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /flows/{id}/environments: get: operationId: list-environments summary: List a Flow's Environments description: List all Environments and their deployed versions for the Flow. tags: - subpackage_flows parameters: - name: id in: path description: Unique identifier for Flow. 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/flows/fl_6o701g4jmcanPVHxdqD0O/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.flows.listEnvironments("fl_6o701g4jmcanPVHxdqD0O"); ``` ```go List environments package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/flows/fl_6o701g4jmcanPVHxdqD0O/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/flows/fl_6o701g4jmcanPVHxdqD0O/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/flows/fl_6o701g4jmcanPVHxdqD0O/environments") .header("X-API-KEY", "") .asString(); ``` ```php List environments request('GET', 'https://api.humanloop.com/v5/flows/fl_6o701g4jmcanPVHxdqD0O/environments', [ 'headers' => [ 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp List environments using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/flows/fl_6o701g4jmcanPVHxdqD0O/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/flows/fl_6o701g4jmcanPVHxdqD0O/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/flows/{id}/evaluators Content-Type: application/json Activate and deactivate Evaluators for monitoring the Flow. An activated Evaluator will automatically be run on all new "completed" Logs within the Flow for monitoring purposes. Reference: https://humanloop.com/docs/api/flows/update-monitoring ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /flows/{id}/evaluators: post: operationId: update-monitoring summary: Update Monitoring description: >- Activate and deactivate Evaluators for monitoring the Flow. An activated Evaluator will automatically be run on all new "completed" Logs within the Flow for monitoring purposes. tags: - subpackage_flows 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_:FlowResponse' '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_: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_: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_: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_:InputResponse: type: object properties: name: type: string description: Type of input. required: - name title: InputResponse 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_: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_: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_: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/flows/fl_6o701g4jmcanPVHxdqD0O/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.flows.updateMonitoring("fl_6o701g4jmcanPVHxdqD0O", { activate: [{ evaluatorVersionId: "evv_1abc4308abd" }] }); ``` ```go Add evaluator package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/flows/fl_6o701g4jmcanPVHxdqD0O/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/flows/fl_6o701g4jmcanPVHxdqD0O/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/flows/fl_6o701g4jmcanPVHxdqD0O/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/flows/fl_6o701g4jmcanPVHxdqD0O/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/flows/fl_6o701g4jmcanPVHxdqD0O/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/flows/fl_6o701g4jmcanPVHxdqD0O/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. # Submit Evaluator Judgment POST https://api.humanloop.com/v5/evaluators/log Content-Type: application/json Submit Evaluator judgment for an existing Log. Creates a new Log. The evaluated Log will be set as the parent of the created Log. Reference: https://humanloop.com/docs/api/evaluators/log ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /evaluators/log: post: operationId: log summary: Submit Evaluator Judgment description: >- Submit Evaluator judgment for an existing Log. Creates a new Log. The evaluated Log will be set as the parent of the created Log. tags: - subpackage_evaluators parameters: - name: version_id in: query description: ID of the Evaluator version to log against. 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_:CreateEvaluatorLogResponse' '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 Evaluator, including the name. This locates the Evaluator 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 Evaluator. 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 the LLM. Only populated for LLM Evaluator Logs. 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. Only populated for LLM Evaluator Logs. provider_response: type: object additionalProperties: description: Any type description: >- Raw response received the provider. Only populated for LLM Evaluator Logs. 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. 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_evaluators:CreateEvaluatorLogRequestJudgment description: Evaluator assessment of the Log. marked_completed: type: boolean description: >- Whether the Log has been manually marked as completed by a user. spec: $ref: >- #/components/schemas/type_evaluators:CreateEvaluatorLogRequestSpec required: - parent_id 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_evaluators:CreateEvaluatorLogRequestJudgment: oneOf: - type: boolean - type: string - type: array items: type: string - type: number format: double description: Evaluator assessment of the Log. title: CreateEvaluatorLogRequestJudgment 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_: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_: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_evaluators:CreateEvaluatorLogRequestSpec: oneOf: - $ref: '#/components/schemas/type_:LlmEvaluatorRequest' - $ref: '#/components/schemas/type_:CodeEvaluatorRequest' - $ref: '#/components/schemas/type_:HumanEvaluatorRequest' - $ref: '#/components/schemas/type_:ExternalEvaluatorRequest' title: CreateEvaluatorLogRequestSpec type_:CreateEvaluatorLogResponse: type: object properties: id: type: string description: String identifier of the new Log. parent_id: type: string description: Identifier of the evaluated parent Log. session_id: type: string description: >- Identifier of the Session containing both the parent and the new child Log. If the parent Log does not belong to a Session, a new Session is created with this ID. version_id: type: string description: Identifier of Evaluator Version for which the Log was registered. required: - id - parent_id - version_id title: CreateEvaluatorLogResponse 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/evaluators/log" payload = { "parent_id": "parent_id" } 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.evaluators.log({ parentId: "parent_id" }); ``` ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/evaluators/log" payload := strings.NewReader("{\n \"parent_id\": \"parent_id\"\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/evaluators/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 \"parent_id\": \"parent_id\"\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/evaluators/log") .header("X-API-KEY", "") .header("Content-Type", "application/json") .body("{\n \"parent_id\": \"parent_id\"\n}") .asString(); ``` ```php request('POST', 'https://api.humanloop.com/v5/evaluators/log', [ 'body' => '{ "parent_id": "parent_id" }', 'headers' => [ 'Content-Type' => 'application/json', 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/evaluators/log"); var request = new RestRequest(Method.POST); request.AddHeader("X-API-KEY", ""); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"parent_id\": \"parent_id\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "X-API-KEY": "", "Content-Type": "application/json" ] let parameters = ["parent_id": "parent_id"] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/evaluators/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. # List Evaluators GET https://api.humanloop.com/v5/evaluators Get a list of all Evaluators. Reference: https://humanloop.com/docs/api/evaluators/list ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /evaluators: get: operationId: list summary: List Evaluators description: Get a list of all Evaluators. tags: - subpackage_evaluators parameters: - name: page in: query description: Page offset for pagination. required: false schema: type: integer default: 1 - name: size in: query description: Page size for pagination. Number of Evaluators to fetch. required: false schema: type: integer default: 10 - name: name in: query description: Case-insensitive filter for Evaluator name. required: false schema: type: string - name: user_filter in: query description: >- Case-insensitive filter for users in the Evaluator. 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 Evaluators 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_:PaginatedDataEvaluatorResponse' '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_: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_: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_: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_: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_: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_: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_: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_: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_:PaginatedDataEvaluatorResponse: type: object properties: records: type: array items: $ref: '#/components/schemas/type_:EvaluatorResponse' page: type: integer size: type: integer total: type: integer required: - records - page - size - total title: PaginatedDataEvaluatorResponse 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 evaluators import requests url = "https://api.humanloop.com/v5/evaluators" querystring = {"size":"1"} headers = {"X-API-KEY": ""} response = requests.get(url, headers=headers, params=querystring) print(response.json()) ``` ```typescript List evaluators import { HumanloopClient } from "humanloop"; const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); const response = await client.evaluators.list({ size: 1 }); for await (const item of response) { console.log(item); } // Or you can manually iterate page-by-page const page = await client.evaluators.list({ size: 1 }); while (page.hasNextPage()) { page = page.getNextPage(); } ``` ```go List evaluators package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/evaluators?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 List evaluators require 'uri' require 'net/http' url = URI("https://api.humanloop.com/v5/evaluators?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 List evaluators import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api.humanloop.com/v5/evaluators?size=1") .header("X-API-KEY", "") .asString(); ``` ```php List evaluators request('GET', 'https://api.humanloop.com/v5/evaluators?size=1', [ 'headers' => [ 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp List evaluators using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/evaluators?size=1"); var request = new RestRequest(Method.GET); request.AddHeader("X-API-KEY", ""); IRestResponse response = client.Execute(request); ``` ```swift List evaluators import Foundation let headers = ["X-API-KEY": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/evaluators?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 Evaluator POST https://api.humanloop.com/v5/evaluators Content-Type: application/json Create an Evaluator or update it with a new version if it already exists. Evaluators are identified by the `ID` or their `path`. The spec provided determines the version of the Evaluator. You can provide `version_name` and `version_description` to identify and describe your versions. Version names must be unique within an Evaluator - attempting to create a version with a name that already exists will result in a 409 Conflict error. Reference: https://humanloop.com/docs/api/evaluators/upsert ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /evaluators: post: operationId: upsert summary: Upsert Evaluator description: >- Create an Evaluator or update it with a new version if it already exists. Evaluators are identified by the `ID` or their `path`. The spec provided determines the version of the Evaluator. You can provide `version_name` and `version_description` to identify and describe your versions. Version names must be unique within an Evaluator - attempting to create a version with a name that already exists will result in a 409 Conflict error. tags: - subpackage_evaluators 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_:EvaluatorResponse' '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 Evaluator, including the name. This locates the Evaluator 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 Evaluator. 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_evaluators:EvaluatorRequestSpec' required: - spec servers: - url: https://api.humanloop.com/v5 components: schemas: 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_: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_: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_evaluators:EvaluatorRequestSpec: oneOf: - $ref: '#/components/schemas/type_:LlmEvaluatorRequest' - $ref: '#/components/schemas/type_:CodeEvaluatorRequest' - $ref: '#/components/schemas/type_:HumanEvaluatorRequest' - $ref: '#/components/schemas/type_:ExternalEvaluatorRequest' title: EvaluatorRequestSpec 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_: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_: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_: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_: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_: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_: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 evaluator import requests url = "https://api.humanloop.com/v5/evaluators" payload = { "spec": { "arguments_type": "target_required", "return_type": "number", "evaluator_type": "python", "code": "def evaluate(answer, target): return 0.5" }, "path": "Shared Evaluators/Accuracy Evaluator", "version_name": "simple-evaluator", "version_description": "Simple evaluator that returns 0.5" } headers = { "X-API-KEY": "", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```typescript Create evaluator import { HumanloopClient } from "humanloop"; const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); await client.evaluators.upsert({ path: "Shared Evaluators/Accuracy Evaluator", spec: { argumentsType: "target_required", returnType: "number", evaluatorType: "python", code: "def evaluate(answer, target):\n return 0.5" }, versionName: "simple-evaluator", versionDescription: "Simple evaluator that returns 0.5" }); ``` ```go Create evaluator package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/evaluators" payload := strings.NewReader("{\n \"spec\": {\n \"arguments_type\": \"target_required\",\n \"return_type\": \"number\",\n \"evaluator_type\": \"python\",\n \"code\": \"def evaluate(answer, target):\\n return 0.5\"\n },\n \"path\": \"Shared Evaluators/Accuracy Evaluator\",\n \"version_name\": \"simple-evaluator\",\n \"version_description\": \"Simple evaluator that returns 0.5\"\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 evaluator require 'uri' require 'net/http' url = URI("https://api.humanloop.com/v5/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 \"spec\": {\n \"arguments_type\": \"target_required\",\n \"return_type\": \"number\",\n \"evaluator_type\": \"python\",\n \"code\": \"def evaluate(answer, target):\\n return 0.5\"\n },\n \"path\": \"Shared Evaluators/Accuracy Evaluator\",\n \"version_name\": \"simple-evaluator\",\n \"version_description\": \"Simple evaluator that returns 0.5\"\n}" response = http.request(request) puts response.read_body ``` ```java Create evaluator import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.humanloop.com/v5/evaluators") .header("X-API-KEY", "") .header("Content-Type", "application/json") .body("{\n \"spec\": {\n \"arguments_type\": \"target_required\",\n \"return_type\": \"number\",\n \"evaluator_type\": \"python\",\n \"code\": \"def evaluate(answer, target):\\n return 0.5\"\n },\n \"path\": \"Shared Evaluators/Accuracy Evaluator\",\n \"version_name\": \"simple-evaluator\",\n \"version_description\": \"Simple evaluator that returns 0.5\"\n}") .asString(); ``` ```php Create evaluator request('POST', 'https://api.humanloop.com/v5/evaluators', [ 'body' => '{ "spec": { "arguments_type": "target_required", "return_type": "number", "evaluator_type": "python", "code": "def evaluate(answer, target):\\n return 0.5" }, "path": "Shared Evaluators/Accuracy Evaluator", "version_name": "simple-evaluator", "version_description": "Simple evaluator that returns 0.5" }', 'headers' => [ 'Content-Type' => 'application/json', 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp Create evaluator using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/evaluators"); var request = new RestRequest(Method.POST); request.AddHeader("X-API-KEY", ""); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"spec\": {\n \"arguments_type\": \"target_required\",\n \"return_type\": \"number\",\n \"evaluator_type\": \"python\",\n \"code\": \"def evaluate(answer, target):\\n return 0.5\"\n },\n \"path\": \"Shared Evaluators/Accuracy Evaluator\",\n \"version_name\": \"simple-evaluator\",\n \"version_description\": \"Simple evaluator that returns 0.5\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Create evaluator import Foundation let headers = [ "X-API-KEY": "", "Content-Type": "application/json" ] let parameters = [ "spec": [ "arguments_type": "target_required", "return_type": "number", "evaluator_type": "python", "code": "def evaluate(answer, target): return 0.5" ], "path": "Shared Evaluators/Accuracy Evaluator", "version_name": "simple-evaluator", "version_description": "Simple evaluator that returns 0.5" ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/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. # Get Evaluator GET https://api.humanloop.com/v5/evaluators/{id} Retrieve the Evaluator with the given ID. By default, the deployed version of the Evaluator is returned. Use the query parameters `version_id` or `environment` to target a specific version of the Evaluator. Reference: https://humanloop.com/docs/api/evaluators/get ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /evaluators/{id}: get: operationId: get summary: Get Evaluator description: >- Retrieve the Evaluator with the given ID. By default, the deployed version of the Evaluator is returned. Use the query parameters `version_id` or `environment` to target a specific version of the Evaluator. tags: - subpackage_evaluators parameters: - name: id in: path description: Unique identifier for Evaluator. required: true schema: type: string - name: version_id in: query description: A specific Version ID of the Evaluator 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_:EvaluatorResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/type_:HttpValidationError' servers: - url: https://api.humanloop.com/v5 components: schemas: 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_: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_: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_: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_: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_: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_: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_: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_: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 evaluator import requests url = "https://api.humanloop.com/v5/evaluators/ev_890bcd" headers = {"X-API-KEY": ""} response = requests.get(url, headers=headers) print(response.json()) ``` ```typescript Get specific evaluator import { HumanloopClient } from "humanloop"; const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); await client.evaluators.get("ev_890bcd"); ``` ```go Get specific evaluator package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/evaluators/ev_890bcd" 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 evaluator require 'uri' require 'net/http' url = URI("https://api.humanloop.com/v5/evaluators/ev_890bcd") 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 evaluator import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api.humanloop.com/v5/evaluators/ev_890bcd") .header("X-API-KEY", "") .asString(); ``` ```php Get specific evaluator request('GET', 'https://api.humanloop.com/v5/evaluators/ev_890bcd', [ 'headers' => [ 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp Get specific evaluator using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/evaluators/ev_890bcd"); var request = new RestRequest(Method.GET); request.AddHeader("X-API-KEY", ""); IRestResponse response = client.Execute(request); ``` ```swift Get specific evaluator import Foundation let headers = ["X-API-KEY": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/evaluators/ev_890bcd")! 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 Evaluator DELETE https://api.humanloop.com/v5/evaluators/{id} Delete the Evaluator with the given ID. Reference: https://humanloop.com/docs/api/evaluators/delete ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /evaluators/{id}: delete: operationId: delete summary: Delete Evaluator description: Delete the Evaluator with the given ID. tags: - subpackage_evaluators parameters: - name: id in: path description: Unique identifier for Evaluator. 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 evaluator import requests url = "https://api.humanloop.com/v5/evaluators/ev_890bcd" headers = {"X-API-KEY": ""} response = requests.delete(url, headers=headers) print(response.json()) ``` ```typescript Delete evaluator import { HumanloopClient } from "humanloop"; const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); await client.evaluators.delete("ev_890bcd"); ``` ```go Delete evaluator package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/evaluators/ev_890bcd" 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 evaluator require 'uri' require 'net/http' url = URI("https://api.humanloop.com/v5/evaluators/ev_890bcd") 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 evaluator import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.delete("https://api.humanloop.com/v5/evaluators/ev_890bcd") .header("X-API-KEY", "") .asString(); ``` ```php Delete evaluator request('DELETE', 'https://api.humanloop.com/v5/evaluators/ev_890bcd', [ 'headers' => [ 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp Delete evaluator using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/evaluators/ev_890bcd"); var request = new RestRequest(Method.DELETE); request.AddHeader("X-API-KEY", ""); IRestResponse response = client.Execute(request); ``` ```swift Delete evaluator import Foundation let headers = ["X-API-KEY": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/evaluators/ev_890bcd")! 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 Evaluator PATCH https://api.humanloop.com/v5/evaluators/{id} Content-Type: application/json Move the Evaluator to a different path or change the name. Reference: https://humanloop.com/docs/api/evaluators/move ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /evaluators/{id}: patch: operationId: move summary: Move Evaluator description: Move the Evaluator to a different path or change the name. tags: - subpackage_evaluators parameters: - name: id in: path description: Unique identifier for Evaluator. 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_:EvaluatorResponse' '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 Evaluator including the Evaluator name, which is used as a unique identifier. name: type: string description: Name of the Evaluator, which is used as a unique identifier. servers: - url: https://api.humanloop.com/v5 components: schemas: 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_: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_: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_: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_: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_: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_: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_: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_: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 evaluator import requests url = "https://api.humanloop.com/v5/evaluators/ev_890bcd" 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 evaluator import { HumanloopClient } from "humanloop"; const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); await client.evaluators.move("ev_890bcd", { path: "new directory/new name" }); ``` ```go Move evaluator package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/evaluators/ev_890bcd" 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 evaluator require 'uri' require 'net/http' url = URI("https://api.humanloop.com/v5/evaluators/ev_890bcd") 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 evaluator import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.patch("https://api.humanloop.com/v5/evaluators/ev_890bcd") .header("X-API-KEY", "") .header("Content-Type", "application/json") .body("{\n \"path\": \"new directory/new name\"\n}") .asString(); ``` ```php Move evaluator request('PATCH', 'https://api.humanloop.com/v5/evaluators/ev_890bcd', [ 'body' => '{ "path": "new directory/new name" }', 'headers' => [ 'Content-Type' => 'application/json', 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp Move evaluator using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/evaluators/ev_890bcd"); 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 evaluator 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/evaluators/ev_890bcd")! 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. # List Versions of an Evaluator GET https://api.humanloop.com/v5/evaluators/{id}/versions Get a list of all the versions of an Evaluator. Reference: https://humanloop.com/docs/api/evaluators/list-versions ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /evaluators/{id}/versions: get: operationId: list-versions summary: List Versions of an Evaluator description: Get a list of all the versions of an Evaluator. tags: - subpackage_evaluators parameters: - name: id in: path description: Unique identifier for the Evaluator. 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_:ListEvaluators' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/type_:HttpValidationError' servers: - url: https://api.humanloop.com/v5 components: schemas: 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_: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_: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_: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_: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_: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_: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_: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_:ListEvaluators: type: object properties: records: type: array items: $ref: '#/components/schemas/type_:EvaluatorResponse' description: The list of Evaluators. required: - records title: ListEvaluators 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/evaluators/ev_890bcd/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.evaluators.listVersions("ev_890bcd"); ``` ```go List versions package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/evaluators/ev_890bcd/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/evaluators/ev_890bcd/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/evaluators/ev_890bcd/versions") .header("X-API-KEY", "") .asString(); ``` ```php List versions request('GET', 'https://api.humanloop.com/v5/evaluators/ev_890bcd/versions', [ 'headers' => [ 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp List versions using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/evaluators/ev_890bcd/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/evaluators/ev_890bcd/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 Evaluator Version DELETE https://api.humanloop.com/v5/evaluators/{id}/versions/{version_id} Delete a version of the Evaluator. Reference: https://humanloop.com/docs/api/evaluators/delete-evaluator-version ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /evaluators/{id}/versions/{version_id}: delete: operationId: delete-evaluator-version summary: Delete Evaluator Version description: Delete a version of the Evaluator. tags: - subpackage_evaluators parameters: - name: id in: path description: Unique identifier for Evaluator. required: true schema: type: string - name: version_id in: path description: Unique identifier for the specific version of the Evaluator. 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/evaluators/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.evaluators.deleteEvaluatorVersion("id", "version_id"); ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/evaluators/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/evaluators/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/evaluators/id/versions/version_id") .header("X-API-KEY", "") .asString(); ``` ```php request('DELETE', 'https://api.humanloop.com/v5/evaluators/id/versions/version_id', [ 'headers' => [ 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/evaluators/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/evaluators/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 Evaluator Version PATCH https://api.humanloop.com/v5/evaluators/{id}/versions/{version_id} Content-Type: application/json Update the name or description of the Evaluator version. Reference: https://humanloop.com/docs/api/evaluators/update-evaluator-version ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /evaluators/{id}/versions/{version_id}: patch: operationId: update-evaluator-version summary: Update Evaluator Version description: Update the name or description of the Evaluator version. tags: - subpackage_evaluators parameters: - name: id in: path description: Unique identifier for Evaluator. required: true schema: type: string - name: version_id in: path description: Unique identifier for the specific version of the Evaluator. 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_:EvaluatorResponse' '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_: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_: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_: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_: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_: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_: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_: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_: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_: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/evaluators/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.evaluators.updateEvaluatorVersion("id", "version_id", {}); ``` ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/evaluators/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/evaluators/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/evaluators/id/versions/version_id") .header("X-API-KEY", "") .header("Content-Type", "application/json") .body("{}") .asString(); ``` ```php request('PATCH', 'https://api.humanloop.com/v5/evaluators/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/evaluators/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/evaluators/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 Evaluator POST https://api.humanloop.com/v5/evaluators/{id}/environments/{environment_id} Deploy Evaluator to an Environment. Set the deployed version for the specified Environment. This Evaluator will be used for calls made to the Evaluator in this Environment. Reference: https://humanloop.com/docs/api/evaluators/set-deployment ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /evaluators/{id}/environments/{environment_id}: post: operationId: set-deployment summary: Deploy Evaluator description: |- Deploy Evaluator to an Environment. Set the deployed version for the specified Environment. This Evaluator will be used for calls made to the Evaluator in this Environment. tags: - subpackage_evaluators parameters: - name: id in: path description: Unique identifier for Evaluator. 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 Evaluator. 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_:EvaluatorResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/type_:HttpValidationError' servers: - url: https://api.humanloop.com/v5 components: schemas: 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_: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_: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_: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_: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_: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_: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_: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_: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 Deploy import requests url = "https://api.humanloop.com/v5/evaluators/ev_890bcd/environments/staging" querystring = {"version_id":"evv_012def"} headers = {"X-API-KEY": ""} response = requests.post(url, headers=headers, params=querystring) print(response.json()) ``` ```typescript Deploy import { HumanloopClient } from "humanloop"; const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); await client.evaluators.setDeployment("ev_890bcd", "staging", { versionId: "evv_012def" }); ``` ```go Deploy package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/evaluators/ev_890bcd/environments/staging?version_id=evv_012def" 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 Deploy require 'uri' require 'net/http' url = URI("https://api.humanloop.com/v5/evaluators/ev_890bcd/environments/staging?version_id=evv_012def") 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 Deploy import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.humanloop.com/v5/evaluators/ev_890bcd/environments/staging?version_id=evv_012def") .header("X-API-KEY", "") .asString(); ``` ```php Deploy request('POST', 'https://api.humanloop.com/v5/evaluators/ev_890bcd/environments/staging?version_id=evv_012def', [ 'headers' => [ 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp Deploy using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/evaluators/ev_890bcd/environments/staging?version_id=evv_012def"); var request = new RestRequest(Method.POST); request.AddHeader("X-API-KEY", ""); IRestResponse response = client.Execute(request); ``` ```swift Deploy import Foundation let headers = ["X-API-KEY": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/evaluators/ev_890bcd/environments/staging?version_id=evv_012def")! 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/evaluators/{id}/environments/{environment_id} Remove deployed Evaluator from the Environment. Remove the deployed version for the specified Environment. This Evaluator will no longer be used for calls made to the Evaluator in this Environment. Reference: https://humanloop.com/docs/api/evaluators/remove-deployment ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /evaluators/{id}/environments/{environment_id}: delete: operationId: remove-deployment summary: Remove Deployment description: >- Remove deployed Evaluator from the Environment. Remove the deployed version for the specified Environment. This Evaluator will no longer be used for calls made to the Evaluator in this Environment. tags: - subpackage_evaluators parameters: - name: id in: path description: Unique identifier for Evaluator. 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 Delete environment import requests url = "https://api.humanloop.com/v5/evaluators/ev_890bcd/environments/staging" headers = {"X-API-KEY": ""} response = requests.delete(url, headers=headers) print(response.json()) ``` ```typescript Delete environment import { HumanloopClient } from "humanloop"; const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); await client.evaluators.removeDeployment("ev_890bcd", "staging"); ``` ```go Delete environment package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/evaluators/ev_890bcd/environments/staging" 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 environment require 'uri' require 'net/http' url = URI("https://api.humanloop.com/v5/evaluators/ev_890bcd/environments/staging") 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 environment import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.delete("https://api.humanloop.com/v5/evaluators/ev_890bcd/environments/staging") .header("X-API-KEY", "") .asString(); ``` ```php Delete environment request('DELETE', 'https://api.humanloop.com/v5/evaluators/ev_890bcd/environments/staging', [ 'headers' => [ 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp Delete environment using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/evaluators/ev_890bcd/environments/staging"); var request = new RestRequest(Method.DELETE); request.AddHeader("X-API-KEY", ""); IRestResponse response = client.Execute(request); ``` ```swift Delete environment import Foundation let headers = ["X-API-KEY": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/evaluators/ev_890bcd/environments/staging")! 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 an Evaluator's Environments GET https://api.humanloop.com/v5/evaluators/{id}/environments List all Environments and their deployed versions for the Evaluator. Reference: https://humanloop.com/docs/api/evaluators/list-environments ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /evaluators/{id}/environments: get: operationId: list-environments summary: List an Evaluator's Environments description: List all Environments and their deployed versions for the Evaluator. tags: - subpackage_evaluators parameters: - name: id in: path description: Unique identifier for Evaluator. 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/evaluators/ev_890bcd/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.evaluators.listEnvironments("ev_890bcd"); ``` ```go List environments package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/evaluators/ev_890bcd/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/evaluators/ev_890bcd/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/evaluators/ev_890bcd/environments") .header("X-API-KEY", "") .asString(); ``` ```php List environments request('GET', 'https://api.humanloop.com/v5/evaluators/ev_890bcd/environments', [ 'headers' => [ 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp List environments using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/evaluators/ev_890bcd/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/evaluators/ev_890bcd/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/evaluators/{id}/evaluators Content-Type: application/json Activate and deactivate Evaluators for monitoring the Evaluator. An activated Evaluator will automatically be run on all new Logs within the Evaluator for monitoring purposes. Reference: https://humanloop.com/docs/api/evaluators/update-monitoring ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /evaluators/{id}/evaluators: post: operationId: update-monitoring summary: Update Monitoring description: |- Activate and deactivate Evaluators for monitoring the Evaluator. An activated Evaluator will automatically be run on all new Logs within the Evaluator for monitoring purposes. tags: - subpackage_evaluators 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_:EvaluatorResponse' '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_: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_: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_: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_: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_: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_: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_: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_: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_: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/evaluators/id/evaluators" payload = {} headers = { "X-API-KEY": "", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```typescript import { HumanloopClient, Humanloop } from "humanloop"; const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); await client.evaluators.updateMonitoring("id", {}); ``` ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/evaluators/id/evaluators" payload := strings.NewReader("{}") 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/evaluators/id/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 = "{}" 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/evaluators/id/evaluators") .header("X-API-KEY", "") .header("Content-Type", "application/json") .body("{}") .asString(); ``` ```php request('POST', 'https://api.humanloop.com/v5/evaluators/id/evaluators', [ 'body' => '{}', 'headers' => [ 'Content-Type' => 'application/json', 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/evaluators/id/evaluators"); var request = new RestRequest(Method.POST); 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/evaluators/id/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. # List Datasets GET https://api.humanloop.com/v5/datasets List all Datasets. Reference: https://humanloop.com/docs/api/datasets/list ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /datasets: get: operationId: list summary: List Datasets description: List all Datasets. tags: - subpackage_datasets parameters: - name: page in: query description: Page offset for pagination. required: false schema: type: integer default: 1 - name: size in: query description: Page size for pagination. Number of Datasets to fetch. required: false schema: type: integer default: 10 - name: name in: query description: Case-insensitive filter for Dataset name. required: false schema: type: string - name: user_filter in: query description: >- Case-insensitive filter for users in the Dataset. 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 Datasets 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_:PaginatedDatasetResponse' '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_: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_: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_: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_:PaginatedDatasetResponse: type: object properties: records: type: array items: $ref: '#/components/schemas/type_:DatasetResponse' page: type: integer size: type: integer total: type: integer required: - records - page - size - total title: PaginatedDatasetResponse 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 datasets import requests url = "https://api.humanloop.com/v5/datasets" querystring = {"size":"1"} headers = {"X-API-KEY": ""} response = requests.get(url, headers=headers, params=querystring) print(response.json()) ``` ```typescript List datasets import { HumanloopClient } from "humanloop"; const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); const response = await client.datasets.list({ size: 1 }); for await (const item of response) { console.log(item); } // Or you can manually iterate page-by-page const page = await client.datasets.list({ size: 1 }); while (page.hasNextPage()) { page = page.getNextPage(); } ``` ```go List datasets package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/datasets?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 List datasets require 'uri' require 'net/http' url = URI("https://api.humanloop.com/v5/datasets?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 List datasets import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api.humanloop.com/v5/datasets?size=1") .header("X-API-KEY", "") .asString(); ``` ```php List datasets request('GET', 'https://api.humanloop.com/v5/datasets?size=1', [ 'headers' => [ 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp List datasets using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/datasets?size=1"); var request = new RestRequest(Method.GET); request.AddHeader("X-API-KEY", ""); IRestResponse response = client.Execute(request); ``` ```swift List datasets import Foundation let headers = ["X-API-KEY": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/datasets?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 Dataset POST https://api.humanloop.com/v5/datasets Content-Type: application/json Create a Dataset or update it with a new version if it already exists. Datasets are identified by the `ID` or their `path`. The datapoints determine the versions of the Dataset. By default, the new Dataset version will be set to the list of Datapoints provided in the request. You can also create a new version by adding or removing Datapoints from an existing version by specifying `action` as `add` or `remove` respectively. In this case, you may specify the `version_id` or `environment` query parameters to identify the existing version to base the new version on. If neither is provided, the latest created version will be used. You can provide `version_name` and `version_description` to identify and describe your versions. Version names must be unique within a Dataset - attempting to create a version with a name that already exists will result in a 409 Conflict error. Humanloop also deduplicates Datapoints. If you try to add a Datapoint that already exists, it will be ignored. If you intentionally want to add a duplicate Datapoint, you can add a unique identifier to the Datapoint's inputs such as `{_dedupe_id: }`. Reference: https://humanloop.com/docs/api/datasets/upsert ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /datasets: post: operationId: upsert summary: Upsert Dataset description: >- Create a Dataset or update it with a new version if it already exists. Datasets are identified by the `ID` or their `path`. The datapoints determine the versions of the Dataset. By default, the new Dataset version will be set to the list of Datapoints provided in the request. You can also create a new version by adding or removing Datapoints from an existing version by specifying `action` as `add` or `remove` respectively. In this case, you may specify the `version_id` or `environment` query parameters to identify the existing version to base the new version on. If neither is provided, the latest created version will be used. You can provide `version_name` and `version_description` to identify and describe your versions. Version names must be unique within a Dataset - attempting to create a version with a name that already exists will result in a 409 Conflict error. Humanloop also deduplicates Datapoints. If you try to add a Datapoint that already exists, it will be ignored. If you intentionally want to add a duplicate Datapoint, you can add a unique identifier to the Datapoint's inputs such as `{_dedupe_id: }`. tags: - subpackage_datasets parameters: - name: version_id in: query description: >- ID of the specific Dataset version to base the created Version on. Only used when `action` is `"add"` or `"remove"`. required: false schema: type: string - name: environment in: query description: >- Name of the Environment identifying a deployed Version to base the created Version on. Only used when `action` is `"add"` or `"remove"`. required: false schema: type: string - name: include_datapoints in: query description: >- If set to `true`, include all Datapoints in the response. Defaults to `false`. Consider using the paginated List Datapoints endpoint instead. required: false schema: type: boolean default: false - name: X-API-KEY in: header required: true schema: type: string responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/type_:DatasetResponse' '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 Dataset, including the name. This locates the Dataset 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 Dataset. datapoints: type: array items: $ref: '#/components/schemas/type_:CreateDatapointRequest' description: >- The Datapoints to create this Dataset version with. Modify the `action` field to determine how these Datapoints are used. action: $ref: '#/components/schemas/type_:UpdateDatesetAction' description: >- The action to take with the provided Datapoints. - If `"set"`, the created version will only contain the Datapoints provided in this request. - If `"add"`, the created version will contain the Datapoints provided in this request in addition to the Datapoints in the target version. - If `"remove"`, the created version will contain the Datapoints in the target version except for the Datapoints provided in this request. If `"add"` or `"remove"`, one of the `version_id` or `environment` query parameters may be provided. 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. 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. required: - datapoints 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_:CreateDatapointRequestTargetValue: oneOf: - type: string - type: integer - type: number format: double - type: boolean - type: array items: description: Any type - type: object additionalProperties: description: Any type title: CreateDatapointRequestTargetValue type_:CreateDatapointRequest: 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_:CreateDatapointRequestTargetValue' 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. title: CreateDatapointRequest type_:UpdateDatesetAction: type: string enum: - set - add - remove description: An enumeration. title: UpdateDatesetAction 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_: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_: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 AddToDataset import requests url = "https://api.humanloop.com/v5/datasets" payload = { "datapoints": [ { "inputs": { "question": "What is the capital of France?" }, "target": { "answer": "Paris" } }, { "inputs": { "question": "Who wrote Hamlet?" }, "target": { "answer": "William Shakespeare" } } ], "path": "test-questions", "action": "set", "version_name": "test-questions-v1", "version_description": "Add two new questions and answers" } headers = { "X-API-KEY": "", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```typescript AddToDataset import { HumanloopClient } from "humanloop"; const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); await client.datasets.upsert({ path: "test-questions", datapoints: [{ inputs: { "question": "What is the capital of France?" }, target: { "answer": "Paris" } }, { inputs: { "question": "Who wrote Hamlet?" }, target: { "answer": "William Shakespeare" } }], action: "set", versionName: "test-questions-v1", versionDescription: "Add two new questions and answers" }); ``` ```go AddToDataset package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/datasets" payload := strings.NewReader("{\n \"datapoints\": [\n {\n \"inputs\": {\n \"question\": \"What is the capital of France?\"\n },\n \"target\": {\n \"answer\": \"Paris\"\n }\n },\n {\n \"inputs\": {\n \"question\": \"Who wrote Hamlet?\"\n },\n \"target\": {\n \"answer\": \"William Shakespeare\"\n }\n }\n ],\n \"path\": \"test-questions\",\n \"action\": \"set\",\n \"version_name\": \"test-questions-v1\",\n \"version_description\": \"Add two new questions and answers\"\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 AddToDataset require 'uri' require 'net/http' url = URI("https://api.humanloop.com/v5/datasets") 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 \"datapoints\": [\n {\n \"inputs\": {\n \"question\": \"What is the capital of France?\"\n },\n \"target\": {\n \"answer\": \"Paris\"\n }\n },\n {\n \"inputs\": {\n \"question\": \"Who wrote Hamlet?\"\n },\n \"target\": {\n \"answer\": \"William Shakespeare\"\n }\n }\n ],\n \"path\": \"test-questions\",\n \"action\": \"set\",\n \"version_name\": \"test-questions-v1\",\n \"version_description\": \"Add two new questions and answers\"\n}" response = http.request(request) puts response.read_body ``` ```java AddToDataset import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.humanloop.com/v5/datasets") .header("X-API-KEY", "") .header("Content-Type", "application/json") .body("{\n \"datapoints\": [\n {\n \"inputs\": {\n \"question\": \"What is the capital of France?\"\n },\n \"target\": {\n \"answer\": \"Paris\"\n }\n },\n {\n \"inputs\": {\n \"question\": \"Who wrote Hamlet?\"\n },\n \"target\": {\n \"answer\": \"William Shakespeare\"\n }\n }\n ],\n \"path\": \"test-questions\",\n \"action\": \"set\",\n \"version_name\": \"test-questions-v1\",\n \"version_description\": \"Add two new questions and answers\"\n}") .asString(); ``` ```php AddToDataset request('POST', 'https://api.humanloop.com/v5/datasets', [ 'body' => '{ "datapoints": [ { "inputs": { "question": "What is the capital of France?" }, "target": { "answer": "Paris" } }, { "inputs": { "question": "Who wrote Hamlet?" }, "target": { "answer": "William Shakespeare" } } ], "path": "test-questions", "action": "set", "version_name": "test-questions-v1", "version_description": "Add two new questions and answers" }', 'headers' => [ 'Content-Type' => 'application/json', 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp AddToDataset using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/datasets"); var request = new RestRequest(Method.POST); request.AddHeader("X-API-KEY", ""); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"datapoints\": [\n {\n \"inputs\": {\n \"question\": \"What is the capital of France?\"\n },\n \"target\": {\n \"answer\": \"Paris\"\n }\n },\n {\n \"inputs\": {\n \"question\": \"Who wrote Hamlet?\"\n },\n \"target\": {\n \"answer\": \"William Shakespeare\"\n }\n }\n ],\n \"path\": \"test-questions\",\n \"action\": \"set\",\n \"version_name\": \"test-questions-v1\",\n \"version_description\": \"Add two new questions and answers\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift AddToDataset import Foundation let headers = [ "X-API-KEY": "", "Content-Type": "application/json" ] let parameters = [ "datapoints": [ [ "inputs": ["question": "What is the capital of France?"], "target": ["answer": "Paris"] ], [ "inputs": ["question": "Who wrote Hamlet?"], "target": ["answer": "William Shakespeare"] ] ], "path": "test-questions", "action": "set", "version_name": "test-questions-v1", "version_description": "Add two new questions and answers" ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/datasets")! 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 CreateSupportDataset import requests url = "https://api.humanloop.com/v5/datasets" payload = { "datapoints": [ { "messages": [ { "role": "user", "content": "How do i manage my organizations API keys? " } ], "target": { "response": "Hey, thanks for your questions. Here are steps for how to achieve: 1. Log in to the Humanloop Dashboard 2. Click on \"Organization Settings.\" If you do not see this option, you might need to contact your organization admin to gain the necessary permissions. 3. 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. 4. You will see a list of existing API keys. You can perform various actions, such as: - **Generate New API Key:** Click on the \"Generate New Key\" button if you need a new API key. - **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. - **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. 5. **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. If 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. Would 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": { "response": "Hey, thanks for your questions. Here are steps for how to achieve: 1. Navigate to your Prompt dashboard. 2. Select the `Monitoring` button on the top right of the Prompt dashboard 3. Within the model select the Version of the Evaluator you want to turn on for monitoring. Would you need help with anything else?" } } ], "path": "datasets/support-queries", "version_name": "Initial version", "version_description": "Add two new questions and answers" } headers = { "X-API-KEY": "", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```typescript CreateSupportDataset import { HumanloopClient } from "humanloop"; const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); await client.datasets.upsert({ path: "datasets/support-queries", datapoints: [{ messages: [{ role: "user", content: "How do i manage my organizations API keys?\n" }], target: { "response": "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: { "response": "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?" } }], versionName: "Initial version", versionDescription: "Add two new questions and answers" }); ``` ```go CreateSupportDataset package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/datasets" payload := strings.NewReader("{\n \"datapoints\": [\n {\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"How do i manage my organizations API keys?\\n\"\n }\n ],\n \"target\": {\n \"response\": \"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?\"\n }\n },\n {\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hey, can do I use my code evaluator for monitoring my legal-copilot prompt?\"\n }\n ],\n \"target\": {\n \"response\": \"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?\"\n }\n }\n ],\n \"path\": \"datasets/support-queries\",\n \"version_name\": \"Initial version\",\n \"version_description\": \"Add two new questions and answers\"\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 CreateSupportDataset require 'uri' require 'net/http' url = URI("https://api.humanloop.com/v5/datasets") 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 \"datapoints\": [\n {\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"How do i manage my organizations API keys?\\n\"\n }\n ],\n \"target\": {\n \"response\": \"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?\"\n }\n },\n {\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hey, can do I use my code evaluator for monitoring my legal-copilot prompt?\"\n }\n ],\n \"target\": {\n \"response\": \"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?\"\n }\n }\n ],\n \"path\": \"datasets/support-queries\",\n \"version_name\": \"Initial version\",\n \"version_description\": \"Add two new questions and answers\"\n}" response = http.request(request) puts response.read_body ``` ```java CreateSupportDataset import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.humanloop.com/v5/datasets") .header("X-API-KEY", "") .header("Content-Type", "application/json") .body("{\n \"datapoints\": [\n {\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"How do i manage my organizations API keys?\\n\"\n }\n ],\n \"target\": {\n \"response\": \"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?\"\n }\n },\n {\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hey, can do I use my code evaluator for monitoring my legal-copilot prompt?\"\n }\n ],\n \"target\": {\n \"response\": \"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?\"\n }\n }\n ],\n \"path\": \"datasets/support-queries\",\n \"version_name\": \"Initial version\",\n \"version_description\": \"Add two new questions and answers\"\n}") .asString(); ``` ```php CreateSupportDataset request('POST', 'https://api.humanloop.com/v5/datasets', [ 'body' => '{ "datapoints": [ { "messages": [ { "role": "user", "content": "How do i manage my organizations API keys?\\n" } ], "target": { "response": "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": { "response": "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?" } } ], "path": "datasets/support-queries", "version_name": "Initial version", "version_description": "Add two new questions and answers" }', 'headers' => [ 'Content-Type' => 'application/json', 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp CreateSupportDataset using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/datasets"); var request = new RestRequest(Method.POST); request.AddHeader("X-API-KEY", ""); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"datapoints\": [\n {\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"How do i manage my organizations API keys?\\n\"\n }\n ],\n \"target\": {\n \"response\": \"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?\"\n }\n },\n {\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hey, can do I use my code evaluator for monitoring my legal-copilot prompt?\"\n }\n ],\n \"target\": {\n \"response\": \"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?\"\n }\n }\n ],\n \"path\": \"datasets/support-queries\",\n \"version_name\": \"Initial version\",\n \"version_description\": \"Add two new questions and answers\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift CreateSupportDataset import Foundation let headers = [ "X-API-KEY": "", "Content-Type": "application/json" ] let parameters = [ "datapoints": [ [ "messages": [ [ "role": "user", "content": "How do i manage my organizations API keys? " ] ], "target": ["response": "Hey, thanks for your questions. Here are steps for how to achieve: 1. Log in to the Humanloop Dashboard 2. Click on \"Organization Settings.\" If you do not see this option, you might need to contact your organization admin to gain the necessary permissions. 3. 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. 4. You will see a list of existing API keys. You can perform various actions, such as: - **Generate New API Key:** Click on the \"Generate New Key\" button if you need a new API key. - **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. - **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. 5. **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. If 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. Would 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": ["response": "Hey, thanks for your questions. Here are steps for how to achieve: 1. Navigate to your Prompt dashboard. 2. Select the `Monitoring` button on the top right of the Prompt dashboard 3. Within the model select the Version of the Evaluator you want to turn on for monitoring. Would you need help with anything else?"] ] ], "path": "datasets/support-queries", "version_name": "Initial version", "version_description": "Add two new questions and answers" ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/datasets")! 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 Dataset GET https://api.humanloop.com/v5/datasets/{id} Retrieve the Dataset with the given ID. Unless `include_datapoints` is set to `true`, the response will not include the Datapoints. Use the List Datapoints endpoint (`GET /{id}/datapoints`) to efficiently retrieve Datapoints for a large Dataset. By default, the deployed version of the Dataset is returned. Use the query parameters `version_id` or `environment` to target a specific version of the Dataset. Reference: https://humanloop.com/docs/api/datasets/get ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /datasets/{id}: get: operationId: get summary: Get Dataset description: >- Retrieve the Dataset with the given ID. Unless `include_datapoints` is set to `true`, the response will not include the Datapoints. Use the List Datapoints endpoint (`GET /{id}/datapoints`) to efficiently retrieve Datapoints for a large Dataset. By default, the deployed version of the Dataset is returned. Use the query parameters `version_id` or `environment` to target a specific version of the Dataset. tags: - subpackage_datasets parameters: - name: id in: path description: Unique identifier for Dataset. required: true schema: type: string - name: version_id in: query description: A specific Version ID of the Dataset 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: include_datapoints in: query description: >- If set to `true`, include all Datapoints in the response. Defaults to `false`. Consider using the paginated List Datapoints endpoint instead. required: false schema: type: boolean default: false - name: X-API-KEY in: header required: true schema: type: string responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/type_:DatasetResponse' '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_: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_: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_: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_: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 dataset import requests url = "https://api.humanloop.com/v5/datasets/ds_b0baF1ca7652" querystring = {"version_id":"dsv_6L78pqrdFi2xa","include_datapoints":"true"} headers = {"X-API-KEY": ""} response = requests.get(url, headers=headers, params=querystring) print(response.json()) ``` ```typescript Get dataset import { HumanloopClient } from "humanloop"; const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); await client.datasets.get("ds_b0baF1ca7652", { versionId: "dsv_6L78pqrdFi2xa", includeDatapoints: true }); ``` ```go Get dataset package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/datasets/ds_b0baF1ca7652?version_id=dsv_6L78pqrdFi2xa&include_datapoints=true" 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 dataset require 'uri' require 'net/http' url = URI("https://api.humanloop.com/v5/datasets/ds_b0baF1ca7652?version_id=dsv_6L78pqrdFi2xa&include_datapoints=true") 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 dataset import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api.humanloop.com/v5/datasets/ds_b0baF1ca7652?version_id=dsv_6L78pqrdFi2xa&include_datapoints=true") .header("X-API-KEY", "") .asString(); ``` ```php Get dataset request('GET', 'https://api.humanloop.com/v5/datasets/ds_b0baF1ca7652?version_id=dsv_6L78pqrdFi2xa&include_datapoints=true', [ 'headers' => [ 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp Get dataset using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/datasets/ds_b0baF1ca7652?version_id=dsv_6L78pqrdFi2xa&include_datapoints=true"); var request = new RestRequest(Method.GET); request.AddHeader("X-API-KEY", ""); IRestResponse response = client.Execute(request); ``` ```swift Get dataset import Foundation let headers = ["X-API-KEY": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/datasets/ds_b0baF1ca7652?version_id=dsv_6L78pqrdFi2xa&include_datapoints=true")! 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 Dataset DELETE https://api.humanloop.com/v5/datasets/{id} Delete the Dataset with the given ID. Reference: https://humanloop.com/docs/api/datasets/delete ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /datasets/{id}: delete: operationId: delete summary: Delete Dataset description: Delete the Dataset with the given ID. tags: - subpackage_datasets parameters: - name: id in: path description: Unique identifier for Dataset. 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/datasets/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.datasets.delete("id"); ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/datasets/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/datasets/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/datasets/id") .header("X-API-KEY", "") .asString(); ``` ```php request('DELETE', 'https://api.humanloop.com/v5/datasets/id', [ 'headers' => [ 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/datasets/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/datasets/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. # Move Dataset PATCH https://api.humanloop.com/v5/datasets/{id} Content-Type: application/json Move the Dataset to a different path or change the name. Reference: https://humanloop.com/docs/api/datasets/move ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /datasets/{id}: patch: operationId: move summary: Move Dataset description: Move the Dataset to a different path or change the name. tags: - subpackage_datasets parameters: - name: id in: path description: Unique identifier for Dataset. 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_:DatasetResponse' '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 Dataset including the Dataset name, which is used as a unique identifier. name: type: string description: Name of the Dataset, which is used as a unique identifier. servers: - url: https://api.humanloop.com/v5 components: schemas: 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_: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_: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_: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/datasets/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.datasets.move("id"); ``` ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/datasets/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/datasets/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/datasets/id") .header("X-API-KEY", "") .header("Content-Type", "application/json") .body("{}") .asString(); ``` ```php request('PATCH', 'https://api.humanloop.com/v5/datasets/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/datasets/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/datasets/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. # List Datapoints GET https://api.humanloop.com/v5/datasets/{id}/datapoints List all Datapoints for the Dataset with the given ID. Reference: https://humanloop.com/docs/api/datasets/list-datapoints ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /datasets/{id}/datapoints: get: operationId: list-datapoints summary: List Datapoints description: List all Datapoints for the Dataset with the given ID. tags: - subpackage_datasets parameters: - name: id in: path description: Unique identifier for Dataset. required: true schema: type: string - name: version_id in: query description: A specific Version ID of the Dataset 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: 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 Datapoints to fetch. required: false schema: type: integer default: 50 - name: X-API-KEY in: header required: true schema: type: string responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/type_:PaginatedDatapointResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/type_:HttpValidationError' 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_: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_:PaginatedDatapointResponse: type: object properties: records: type: array items: $ref: '#/components/schemas/type_:DatapointResponse' page: type: integer size: type: integer total: type: integer required: - records - page - size - total title: PaginatedDatapointResponse 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 datapoints import requests url = "https://api.humanloop.com/v5/datasets/ds_b0baF1ca7652/datapoints" querystring = {"size":"1"} headers = {"X-API-KEY": ""} response = requests.get(url, headers=headers, params=querystring) print(response.json()) ``` ```typescript List datapoints import { HumanloopClient } from "humanloop"; const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); const response = await client.datasets.listDatapoints("ds_b0baF1ca7652", { size: 1 }); for await (const item of response) { console.log(item); } // Or you can manually iterate page-by-page const page = await client.datasets.listDatapoints("ds_b0baF1ca7652", { size: 1 }); while (page.hasNextPage()) { page = page.getNextPage(); } ``` ```go List datapoints package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/datasets/ds_b0baF1ca7652/datapoints?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 List datapoints require 'uri' require 'net/http' url = URI("https://api.humanloop.com/v5/datasets/ds_b0baF1ca7652/datapoints?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 List datapoints import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api.humanloop.com/v5/datasets/ds_b0baF1ca7652/datapoints?size=1") .header("X-API-KEY", "") .asString(); ``` ```php List datapoints request('GET', 'https://api.humanloop.com/v5/datasets/ds_b0baF1ca7652/datapoints?size=1', [ 'headers' => [ 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp List datapoints using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/datasets/ds_b0baF1ca7652/datapoints?size=1"); var request = new RestRequest(Method.GET); request.AddHeader("X-API-KEY", ""); IRestResponse response = client.Execute(request); ``` ```swift List datapoints import Foundation let headers = ["X-API-KEY": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/datasets/ds_b0baF1ca7652/datapoints?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. # List Versions of a Dataset GET https://api.humanloop.com/v5/datasets/{id}/versions Get a list of the versions for a Dataset. Reference: https://humanloop.com/docs/api/datasets/list-versions ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /datasets/{id}/versions: get: operationId: list-versions summary: List Versions of a Dataset description: Get a list of the versions for a Dataset. tags: - subpackage_datasets parameters: - name: id in: path description: Unique identifier for Dataset. required: true schema: type: string - name: include_datapoints in: query description: >- If set to 'latest_saved', include datapoints for the latest saved version. Alternatively, 'latest_committed' (deprecated) includes datapoints for the latest committed version only. required: false schema: $ref: >- #/components/schemas/type_datasets:ListVersionsDatasetsIdVersionsGetRequestIncludeDatapoints - name: X-API-KEY in: header required: true schema: type: string responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/type_:ListDatasets' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/type_:HttpValidationError' servers: - url: https://api.humanloop.com/v5 components: schemas: type_datasets:ListVersionsDatasetsIdVersionsGetRequestIncludeDatapoints: type: string enum: - latest_committed - latest_saved description: >- If set to 'latest_saved', include datapoints for the latest saved version. Alternatively, 'latest_committed' (deprecated) includes datapoints for the latest committed version only. title: ListVersionsDatasetsIdVersionsGetRequestIncludeDatapoints 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_: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_: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_:ListDatasets: type: object properties: records: type: array items: $ref: '#/components/schemas/type_:DatasetResponse' description: The list of Datasets. required: - records title: ListDatasets 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/datasets/ds_b0baF1ca7652/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.datasets.listVersions("ds_b0baF1ca7652"); ``` ```go List versions package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/datasets/ds_b0baF1ca7652/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/datasets/ds_b0baF1ca7652/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/datasets/ds_b0baF1ca7652/versions") .header("X-API-KEY", "") .asString(); ``` ```php List versions request('GET', 'https://api.humanloop.com/v5/datasets/ds_b0baF1ca7652/versions', [ 'headers' => [ 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp List versions using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/datasets/ds_b0baF1ca7652/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/datasets/ds_b0baF1ca7652/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 Dataset Version DELETE https://api.humanloop.com/v5/datasets/{id}/versions/{version_id} Delete a version of the Dataset. Reference: https://humanloop.com/docs/api/datasets/delete-dataset-version ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /datasets/{id}/versions/{version_id}: delete: operationId: delete-dataset-version summary: Delete Dataset Version description: Delete a version of the Dataset. tags: - subpackage_datasets parameters: - name: id in: path description: Unique identifier for Dataset. required: true schema: type: string - name: version_id in: path description: Unique identifier for the specific version of the Dataset. 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/datasets/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.datasets.deleteDatasetVersion("id", "version_id"); ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/datasets/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/datasets/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/datasets/id/versions/version_id") .header("X-API-KEY", "") .asString(); ``` ```php request('DELETE', 'https://api.humanloop.com/v5/datasets/id/versions/version_id', [ 'headers' => [ 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/datasets/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/datasets/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 Dataset Version PATCH https://api.humanloop.com/v5/datasets/{id}/versions/{version_id} Content-Type: application/json Update the name or description of the Dataset version. Reference: https://humanloop.com/docs/api/datasets/update-dataset-version ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /datasets/{id}/versions/{version_id}: patch: operationId: update-dataset-version summary: Update Dataset Version description: Update the name or description of the Dataset version. tags: - subpackage_datasets parameters: - name: id in: path description: Unique identifier for Dataset. required: true schema: type: string - name: version_id in: path description: Unique identifier for the specific version of the Dataset. 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_:DatasetResponse' '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_: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_: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_: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_: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/datasets/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.datasets.updateDatasetVersion("id", "version_id", {}); ``` ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/datasets/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/datasets/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/datasets/id/versions/version_id") .header("X-API-KEY", "") .header("Content-Type", "application/json") .body("{}") .asString(); ``` ```php request('PATCH', 'https://api.humanloop.com/v5/datasets/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/datasets/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/datasets/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. # Upload CSV POST https://api.humanloop.com/v5/datasets/{id}/datapoints/csv Content-Type: multipart/form-data Add Datapoints from a CSV file to a Dataset. This will create a new version of the Dataset with the Datapoints from the CSV file. If either `version_id` or `environment` is provided, the new version will be based on the specified version, with the Datapoints from the CSV file added to the existing Datapoints in the version. If neither `version_id` nor `environment` is provided, the new version will be based on the version of the Dataset that is deployed to the default Environment. You can optionally provide a name and description for the new version using `version_name` and `version_description` parameters. Reference: https://humanloop.com/docs/api/datasets/upload-csv ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /datasets/{id}/datapoints/csv: post: operationId: upload-csv summary: Upload CSV description: >- Add Datapoints from a CSV file to a Dataset. This will create a new version of the Dataset with the Datapoints from the CSV file. If either `version_id` or `environment` is provided, the new version will be based on the specified version, with the Datapoints from the CSV file added to the existing Datapoints in the version. If neither `version_id` nor `environment` is provided, the new version will be based on the version of the Dataset that is deployed to the default Environment. You can optionally provide a name and description for the new version using `version_name` and `version_description` parameters. tags: - subpackage_datasets parameters: - name: id in: path description: Unique identifier for the Dataset required: true schema: type: string - name: version_id in: query description: ID of the specific Dataset version to base the created Version on. required: false schema: type: string - name: environment in: query description: >- Name of the Environment identifying a deployed Version to base the created Version on. 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_:DatasetResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/type_:HttpValidationError' requestBody: content: multipart/form-data: schema: type: object properties: file: type: string format: binary description: A CSV file containing Datapoints to be added to the Dataset. version_name: type: string description: Name for the new Dataset version. version_description: type: string description: Description for the new Dataset version. required: - file servers: - url: https://api.humanloop.com/v5 components: schemas: 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_: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_: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_: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/datasets/id/datapoints/csv" files = { "file": "open('', 'rb')" } payload = { "version_name": , "version_description": } headers = {"X-API-KEY": ""} response = requests.post(url, data=payload, files=files, headers=headers) print(response.json()) ``` ```typescript import { HumanloopClient } from "humanloop"; import * as fs from "fs"; const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); await client.datasets.uploadCsv(fs.createReadStream("/path/to/your/file"), "id", {}); ``` ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/datasets/id/datapoints/csv" payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"version_name\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"version_description\"\r\n\r\n\r\n-----011000010111000001101001--\r\n") req, _ := http.NewRequest("POST", url, payload) 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/datasets/id/datapoints/csv") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["X-API-KEY"] = '' request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"version_name\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"version_description\"\r\n\r\n\r\n-----011000010111000001101001--\r\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/datasets/id/datapoints/csv") .header("X-API-KEY", "") .body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"version_name\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"version_description\"\r\n\r\n\r\n-----011000010111000001101001--\r\n") .asString(); ``` ```php request('POST', 'https://api.humanloop.com/v5/datasets/id/datapoints/csv', [ 'multipart' => [ [ 'name' => 'file', 'filename' => '', 'contents' => null ] ] 'headers' => [ 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/datasets/id/datapoints/csv"); var request = new RestRequest(Method.POST); request.AddHeader("X-API-KEY", ""); request.AddParameter("undefined", "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"version_name\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"version_description\"\r\n\r\n\r\n-----011000010111000001101001--\r\n", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = ["X-API-KEY": ""] let parameters = [ [ "name": "file", "fileName": "" ], [ "name": "version_name", "value": ], [ "name": "version_description", "value": ] ] let boundary = "---011000010111000001101001" var body = "" var error: NSError? = nil for param in parameters { let paramName = param["name"]! body += "--\(boundary)\r\n" body += "Content-Disposition:form-data; name=\"\(paramName)\"" if let filename = param["fileName"] { let contentType = param["content-type"]! let fileContent = String(contentsOfFile: filename, encoding: String.Encoding.utf8) if (error != nil) { print(error as Any) } body += "; filename=\"\(filename)\"\r\n" body += "Content-Type: \(contentType)\r\n\r\n" body += fileContent } else if let paramValue = param["value"] { body += "\r\n\r\n\(paramValue)" } } let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/datasets/id/datapoints/csv")! 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. # Deploy Dataset POST https://api.humanloop.com/v5/datasets/{id}/environments/{environment_id} Deploy Dataset to Environment. Set the deployed version for the specified Environment. Reference: https://humanloop.com/docs/api/datasets/set-deployment ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /datasets/{id}/environments/{environment_id}: post: operationId: set-deployment summary: Deploy Dataset description: |- Deploy Dataset to Environment. Set the deployed version for the specified Environment. tags: - subpackage_datasets parameters: - name: id in: path description: Unique identifier for Dataset. 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 Dataset. 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_:DatasetResponse' '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_: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_: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_: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_: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 Deploy import requests url = "https://api.humanloop.com/v5/datasets/ds_b0baF1ca7652/environments/staging" querystring = {"version_id":"dsv_6L78pqrdFi2xa"} headers = {"X-API-KEY": ""} response = requests.post(url, headers=headers, params=querystring) print(response.json()) ``` ```typescript Deploy import { HumanloopClient } from "humanloop"; const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); await client.datasets.setDeployment("ds_b0baF1ca7652", "staging", { versionId: "dsv_6L78pqrdFi2xa" }); ``` ```go Deploy package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/datasets/ds_b0baF1ca7652/environments/staging?version_id=dsv_6L78pqrdFi2xa" 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 Deploy require 'uri' require 'net/http' url = URI("https://api.humanloop.com/v5/datasets/ds_b0baF1ca7652/environments/staging?version_id=dsv_6L78pqrdFi2xa") 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 Deploy import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.humanloop.com/v5/datasets/ds_b0baF1ca7652/environments/staging?version_id=dsv_6L78pqrdFi2xa") .header("X-API-KEY", "") .asString(); ``` ```php Deploy request('POST', 'https://api.humanloop.com/v5/datasets/ds_b0baF1ca7652/environments/staging?version_id=dsv_6L78pqrdFi2xa', [ 'headers' => [ 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp Deploy using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/datasets/ds_b0baF1ca7652/environments/staging?version_id=dsv_6L78pqrdFi2xa"); var request = new RestRequest(Method.POST); request.AddHeader("X-API-KEY", ""); IRestResponse response = client.Execute(request); ``` ```swift Deploy import Foundation let headers = ["X-API-KEY": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/datasets/ds_b0baF1ca7652/environments/staging?version_id=dsv_6L78pqrdFi2xa")! 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/datasets/{id}/environments/{environment_id} Remove deployed Dataset from Environment. Remove the deployed version for the specified Environment. Reference: https://humanloop.com/docs/api/datasets/remove-deployment ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /datasets/{id}/environments/{environment_id}: delete: operationId: remove-deployment summary: Remove Deployment description: |- Remove deployed Dataset from Environment. Remove the deployed version for the specified Environment. tags: - subpackage_datasets parameters: - name: id in: path description: Unique identifier for Dataset. 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 Delete environment import requests url = "https://api.humanloop.com/v5/datasets/ds_b0baF1ca7652/environments/staging" headers = {"X-API-KEY": ""} response = requests.delete(url, headers=headers) print(response.json()) ``` ```typescript Delete environment import { HumanloopClient } from "humanloop"; const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); await client.datasets.removeDeployment("ds_b0baF1ca7652", "staging"); ``` ```go Delete environment package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/datasets/ds_b0baF1ca7652/environments/staging" 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 environment require 'uri' require 'net/http' url = URI("https://api.humanloop.com/v5/datasets/ds_b0baF1ca7652/environments/staging") 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 environment import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.delete("https://api.humanloop.com/v5/datasets/ds_b0baF1ca7652/environments/staging") .header("X-API-KEY", "") .asString(); ``` ```php Delete environment request('DELETE', 'https://api.humanloop.com/v5/datasets/ds_b0baF1ca7652/environments/staging', [ 'headers' => [ 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp Delete environment using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/datasets/ds_b0baF1ca7652/environments/staging"); var request = new RestRequest(Method.DELETE); request.AddHeader("X-API-KEY", ""); IRestResponse response = client.Execute(request); ``` ```swift Delete environment import Foundation let headers = ["X-API-KEY": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/datasets/ds_b0baF1ca7652/environments/staging")! 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 Dataset's Environments GET https://api.humanloop.com/v5/datasets/{id}/environments List all Environments and their deployed versions for the Dataset. Reference: https://humanloop.com/docs/api/datasets/list-environments ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /datasets/{id}/environments: get: operationId: list-environments summary: List a Dataset's Environments description: List all Environments and their deployed versions for the Dataset. tags: - subpackage_datasets parameters: - name: id in: path description: Unique identifier for Dataset. 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 import requests url = "https://api.humanloop.com/v5/datasets/id/environments" 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.datasets.listEnvironments("id"); ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/datasets/id/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 require 'uri' require 'net/http' url = URI("https://api.humanloop.com/v5/datasets/id/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 import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api.humanloop.com/v5/datasets/id/environments") .header("X-API-KEY", "") .asString(); ``` ```php request('GET', 'https://api.humanloop.com/v5/datasets/id/environments', [ 'headers' => [ 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/datasets/id/environments"); 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/datasets/id/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. # List Evaluations GET https://api.humanloop.com/v5/evaluations Retrieve a list of Evaluations for the specified File. Reference: https://humanloop.com/docs/api/evaluations/list ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /evaluations: get: operationId: list summary: List Evaluations description: Retrieve a list of Evaluations for the specified File. tags: - subpackage_evaluations parameters: - name: file_id in: query description: >- Filter by File ID. Only Evaluations for the specified File will be returned. required: true schema: type: string - 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 Evaluations to fetch. required: false schema: type: integer default: 10 - name: X-API-KEY in: header required: true schema: type: string responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/type_:PaginatedEvaluationResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/type_:HttpValidationError' servers: - url: https://api.humanloop.com/v5 components: schemas: 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_: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_: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_: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_: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_: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_: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_: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_:EvaluationEvaluatorResponse: type: object properties: version: $ref: '#/components/schemas/type_:EvaluatorResponse' orchestrated: type: boolean description: >- Whether the Evaluator is orchestrated by Humanloop. Default is `True`. If `False`, a log for the Evaluator should be submitted by the user via the API. added_at: type: string format: date-time description: When the Evaluator was added to the Evaluation. required: - version - orchestrated - added_at title: EvaluationEvaluatorResponse type_:EvaluationResponse: type: object properties: id: type: string description: Unique identifier for the Evaluation. Starts with `evr`. runs_count: type: integer description: The total number of Runs in the Evaluation. evaluators: type: array items: $ref: '#/components/schemas/type_:EvaluationEvaluatorResponse' description: The Evaluator Versions used to evaluate. name: type: string description: >- Name of the Evaluation to help identify it. Must be unique among Evaluations associated with File. file_id: type: string description: Unique identifier for the File associated with the Evaluation. created_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' updated_at: type: string format: date-time url: type: string description: URL to view the Evaluation on the Humanloop. required: - id - runs_count - evaluators - created_at - updated_at title: EvaluationResponse type_:PaginatedEvaluationResponse: type: object properties: records: type: array items: $ref: '#/components/schemas/type_:EvaluationResponse' page: type: integer size: type: integer total: type: integer required: - records - page - size - total title: PaginatedEvaluationResponse 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 evaluations for file import requests url = "https://api.humanloop.com/v5/evaluations" querystring = {"file_id":"pr_30gco7dx6JDq4200GVOHa","size":"1"} headers = {"X-API-KEY": ""} response = requests.get(url, headers=headers, params=querystring) print(response.json()) ``` ```typescript List evaluations for file import { HumanloopClient } from "humanloop"; const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); const response = await client.evaluations.list({ fileId: "pr_30gco7dx6JDq4200GVOHa", size: 1 }); for await (const item of response) { console.log(item); } // Or you can manually iterate page-by-page const page = await client.evaluations.list({ fileId: "pr_30gco7dx6JDq4200GVOHa", size: 1 }); while (page.hasNextPage()) { page = page.getNextPage(); } ``` ```go List evaluations for file package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/evaluations?file_id=pr_30gco7dx6JDq4200GVOHa&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 List evaluations for file require 'uri' require 'net/http' url = URI("https://api.humanloop.com/v5/evaluations?file_id=pr_30gco7dx6JDq4200GVOHa&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 List evaluations for file import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api.humanloop.com/v5/evaluations?file_id=pr_30gco7dx6JDq4200GVOHa&size=1") .header("X-API-KEY", "") .asString(); ``` ```php List evaluations for file request('GET', 'https://api.humanloop.com/v5/evaluations?file_id=pr_30gco7dx6JDq4200GVOHa&size=1', [ 'headers' => [ 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp List evaluations for file using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/evaluations?file_id=pr_30gco7dx6JDq4200GVOHa&size=1"); var request = new RestRequest(Method.GET); request.AddHeader("X-API-KEY", ""); IRestResponse response = client.Execute(request); ``` ```swift List evaluations for file import Foundation let headers = ["X-API-KEY": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/evaluations?file_id=pr_30gco7dx6JDq4200GVOHa&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. # Create Evaluation POST https://api.humanloop.com/v5/evaluations Content-Type: application/json Create an Evaluation. Create a new Evaluation by specifying the File to evaluate, and a name for the Evaluation. You can then add Runs to this Evaluation using the `POST /evaluations/{id}/runs` endpoint. Reference: https://humanloop.com/docs/api/evaluations/create ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /evaluations: post: operationId: create summary: Create Evaluation description: >- Create an Evaluation. Create a new Evaluation by specifying the File to evaluate, and a name for the Evaluation. You can then add Runs to this Evaluation using the `POST /evaluations/{id}/runs` endpoint. tags: - subpackage_evaluations parameters: - name: X-API-KEY in: header required: true schema: type: string responses: '201': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/type_:EvaluationResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/type_:HttpValidationError' requestBody: content: application/json: schema: type: object properties: file: $ref: '#/components/schemas/type_:FileRequest' description: >- The File to associate with the Evaluation. This File contains the Logs you're evaluating. name: type: string description: >- Name of the Evaluation to help identify it. Must be unique within the associated File. evaluators: type: array items: $ref: >- #/components/schemas/type_evaluations:CreateEvaluationRequestEvaluatorsItem description: The Evaluators used to evaluate. required: - evaluators servers: - url: https://api.humanloop.com/v5 components: schemas: type_:FileRequest: type: object properties: id: type: string description: ID for an existing File. path: type: string description: >- Path of the File, including the name. This locates the File in the Humanloop filesystem and is used as as a unique identifier. For example: `folder/name` or just `name`. title: FileRequest type_:EvaluatorVersionId: type: object properties: version_id: type: string description: Unique identifier for the Version. orchestrated: type: boolean default: true description: >- Whether the Evaluator is orchestrated by Humanloop. Default is `True`. If `False`, a log for the Evaluator should be submitted by the user via the API. required: - version_id description: Base model for specifying an Evaluator for an Evaluation. title: EvaluatorVersionId type_:EvaluatorFileId: type: object properties: environment: type: string description: >- If provided, the Version deployed to this Environment is used. If not provided, the Version deployed to the default Environment is used. id: type: string description: Unique identifier for the File. orchestrated: type: boolean default: true description: >- Whether the Evaluator is orchestrated by Humanloop. Default is `True`. If `False`, a log for the Evaluator should be submitted by the user via the API. required: - id description: Base model for specifying an Evaluator for an Evaluation. title: EvaluatorFileId type_:EvaluatorFilePath: type: object properties: environment: type: string description: >- If provided, the Version deployed to this Environment is used. If not provided, the Version deployed to the default Environment is used. path: type: string description: Path identifying a File. Provide this to specify a File. orchestrated: type: boolean default: true description: >- Whether the Evaluator is orchestrated by Humanloop. Default is `True`. If `False`, a log for the Evaluator should be submitted by the user via the API. required: - path description: Base model for specifying an Evaluator for an Evaluation. title: EvaluatorFilePath type_evaluations:CreateEvaluationRequestEvaluatorsItem: oneOf: - $ref: '#/components/schemas/type_:EvaluatorVersionId' - $ref: '#/components/schemas/type_:EvaluatorFileId' - $ref: '#/components/schemas/type_:EvaluatorFilePath' title: CreateEvaluationRequestEvaluatorsItem 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_: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_: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_: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_: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_: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_: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_: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_:EvaluationEvaluatorResponse: type: object properties: version: $ref: '#/components/schemas/type_:EvaluatorResponse' orchestrated: type: boolean description: >- Whether the Evaluator is orchestrated by Humanloop. Default is `True`. If `False`, a log for the Evaluator should be submitted by the user via the API. added_at: type: string format: date-time description: When the Evaluator was added to the Evaluation. required: - version - orchestrated - added_at title: EvaluationEvaluatorResponse type_:EvaluationResponse: type: object properties: id: type: string description: Unique identifier for the Evaluation. Starts with `evr`. runs_count: type: integer description: The total number of Runs in the Evaluation. evaluators: type: array items: $ref: '#/components/schemas/type_:EvaluationEvaluatorResponse' description: The Evaluator Versions used to evaluate. name: type: string description: >- Name of the Evaluation to help identify it. Must be unique among Evaluations associated with File. file_id: type: string description: Unique identifier for the File associated with the Evaluation. created_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' updated_at: type: string format: date-time url: type: string description: URL to view the Evaluation on the Humanloop. required: - id - runs_count - evaluators - created_at - updated_at title: EvaluationResponse 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/evaluations" payload = { "evaluators": [{ "version_id": "version_id" }] } 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.evaluations.create({ evaluators: [{ versionId: "version_id" }] }); ``` ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/evaluations" payload := strings.NewReader("{\n \"evaluators\": [\n {\n \"version_id\": \"version_id\"\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 require 'uri' require 'net/http' url = URI("https://api.humanloop.com/v5/evaluations") 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 \"evaluators\": [\n {\n \"version_id\": \"version_id\"\n }\n ]\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/evaluations") .header("X-API-KEY", "") .header("Content-Type", "application/json") .body("{\n \"evaluators\": [\n {\n \"version_id\": \"version_id\"\n }\n ]\n}") .asString(); ``` ```php request('POST', 'https://api.humanloop.com/v5/evaluations', [ 'body' => '{ "evaluators": [ { "version_id": "version_id" } ] }', 'headers' => [ 'Content-Type' => 'application/json', 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/evaluations"); var request = new RestRequest(Method.POST); request.AddHeader("X-API-KEY", ""); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"evaluators\": [\n {\n \"version_id\": \"version_id\"\n }\n ]\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "X-API-KEY": "", "Content-Type": "application/json" ] let parameters = ["evaluators": [["version_id": "version_id"]]] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/evaluations")! 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. # Add Evaluators POST https://api.humanloop.com/v5/evaluations/{id}/evaluators Content-Type: application/json Add Evaluators to an Evaluation. The Evaluators will be run on the Logs generated for the Evaluation. Reference: https://humanloop.com/docs/api/evaluations/add-evaluators ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /evaluations/{id}/evaluators: post: operationId: add-evaluators summary: Add Evaluators description: |- Add Evaluators to an Evaluation. The Evaluators will be run on the Logs generated for the Evaluation. tags: - subpackage_evaluations parameters: - name: id in: path description: Unique identifier for Evaluation. 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_:EvaluationResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/type_:HttpValidationError' requestBody: content: application/json: schema: type: object properties: evaluators: type: array items: $ref: >- #/components/schemas/type_evaluations:AddEvaluatorsRequestEvaluatorsItem description: The Evaluators to add to this Evaluation. required: - evaluators servers: - url: https://api.humanloop.com/v5 components: schemas: type_:EvaluatorVersionId: type: object properties: version_id: type: string description: Unique identifier for the Version. orchestrated: type: boolean default: true description: >- Whether the Evaluator is orchestrated by Humanloop. Default is `True`. If `False`, a log for the Evaluator should be submitted by the user via the API. required: - version_id description: Base model for specifying an Evaluator for an Evaluation. title: EvaluatorVersionId type_:EvaluatorFileId: type: object properties: environment: type: string description: >- If provided, the Version deployed to this Environment is used. If not provided, the Version deployed to the default Environment is used. id: type: string description: Unique identifier for the File. orchestrated: type: boolean default: true description: >- Whether the Evaluator is orchestrated by Humanloop. Default is `True`. If `False`, a log for the Evaluator should be submitted by the user via the API. required: - id description: Base model for specifying an Evaluator for an Evaluation. title: EvaluatorFileId type_:EvaluatorFilePath: type: object properties: environment: type: string description: >- If provided, the Version deployed to this Environment is used. If not provided, the Version deployed to the default Environment is used. path: type: string description: Path identifying a File. Provide this to specify a File. orchestrated: type: boolean default: true description: >- Whether the Evaluator is orchestrated by Humanloop. Default is `True`. If `False`, a log for the Evaluator should be submitted by the user via the API. required: - path description: Base model for specifying an Evaluator for an Evaluation. title: EvaluatorFilePath type_evaluations:AddEvaluatorsRequestEvaluatorsItem: oneOf: - $ref: '#/components/schemas/type_:EvaluatorVersionId' - $ref: '#/components/schemas/type_:EvaluatorFileId' - $ref: '#/components/schemas/type_:EvaluatorFilePath' title: AddEvaluatorsRequestEvaluatorsItem 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_: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_: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_: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_: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_: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_: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_: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_:EvaluationEvaluatorResponse: type: object properties: version: $ref: '#/components/schemas/type_:EvaluatorResponse' orchestrated: type: boolean description: >- Whether the Evaluator is orchestrated by Humanloop. Default is `True`. If `False`, a log for the Evaluator should be submitted by the user via the API. added_at: type: string format: date-time description: When the Evaluator was added to the Evaluation. required: - version - orchestrated - added_at title: EvaluationEvaluatorResponse type_:EvaluationResponse: type: object properties: id: type: string description: Unique identifier for the Evaluation. Starts with `evr`. runs_count: type: integer description: The total number of Runs in the Evaluation. evaluators: type: array items: $ref: '#/components/schemas/type_:EvaluationEvaluatorResponse' description: The Evaluator Versions used to evaluate. name: type: string description: >- Name of the Evaluation to help identify it. Must be unique among Evaluations associated with File. file_id: type: string description: Unique identifier for the File associated with the Evaluation. created_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' updated_at: type: string format: date-time url: type: string description: URL to view the Evaluation on the Humanloop. required: - id - runs_count - evaluators - created_at - updated_at title: EvaluationResponse 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/evaluations/id/evaluators" payload = { "evaluators": [{ "version_id": "version_id" }] } 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.evaluations.addEvaluators("id", { evaluators: [{ versionId: "version_id" }] }); ``` ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/evaluations/id/evaluators" payload := strings.NewReader("{\n \"evaluators\": [\n {\n \"version_id\": \"version_id\"\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 require 'uri' require 'net/http' url = URI("https://api.humanloop.com/v5/evaluations/id/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 \"evaluators\": [\n {\n \"version_id\": \"version_id\"\n }\n ]\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/evaluations/id/evaluators") .header("X-API-KEY", "") .header("Content-Type", "application/json") .body("{\n \"evaluators\": [\n {\n \"version_id\": \"version_id\"\n }\n ]\n}") .asString(); ``` ```php request('POST', 'https://api.humanloop.com/v5/evaluations/id/evaluators', [ 'body' => '{ "evaluators": [ { "version_id": "version_id" } ] }', 'headers' => [ 'Content-Type' => 'application/json', 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/evaluations/id/evaluators"); var request = new RestRequest(Method.POST); request.AddHeader("X-API-KEY", ""); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"evaluators\": [\n {\n \"version_id\": \"version_id\"\n }\n ]\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "X-API-KEY": "", "Content-Type": "application/json" ] let parameters = ["evaluators": [["version_id": "version_id"]]] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/evaluations/id/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. # Remove Evaluator DELETE https://api.humanloop.com/v5/evaluations/{id}/evaluators/{evaluator_version_id} Remove an Evaluator from an Evaluation. The Evaluator will no longer be run on the Logs in the Evaluation. Reference: https://humanloop.com/docs/api/evaluations/remove-evaluator ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /evaluations/{id}/evaluators/{evaluator_version_id}: delete: operationId: remove-evaluator summary: Remove Evaluator description: |- Remove an Evaluator from an Evaluation. The Evaluator will no longer be run on the Logs in the Evaluation. tags: - subpackage_evaluations parameters: - name: id in: path description: Unique identifier for Evaluation. required: true schema: type: string - name: evaluator_version_id in: path description: Unique identifier for Evaluator Version. 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_:EvaluationResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/type_:HttpValidationError' servers: - url: https://api.humanloop.com/v5 components: schemas: 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_: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_: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_: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_: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_: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_: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_: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_:EvaluationEvaluatorResponse: type: object properties: version: $ref: '#/components/schemas/type_:EvaluatorResponse' orchestrated: type: boolean description: >- Whether the Evaluator is orchestrated by Humanloop. Default is `True`. If `False`, a log for the Evaluator should be submitted by the user via the API. added_at: type: string format: date-time description: When the Evaluator was added to the Evaluation. required: - version - orchestrated - added_at title: EvaluationEvaluatorResponse type_:EvaluationResponse: type: object properties: id: type: string description: Unique identifier for the Evaluation. Starts with `evr`. runs_count: type: integer description: The total number of Runs in the Evaluation. evaluators: type: array items: $ref: '#/components/schemas/type_:EvaluationEvaluatorResponse' description: The Evaluator Versions used to evaluate. name: type: string description: >- Name of the Evaluation to help identify it. Must be unique among Evaluations associated with File. file_id: type: string description: Unique identifier for the File associated with the Evaluation. created_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' updated_at: type: string format: date-time url: type: string description: URL to view the Evaluation on the Humanloop. required: - id - runs_count - evaluators - created_at - updated_at title: EvaluationResponse 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/evaluations/id/evaluators/evaluator_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.evaluations.removeEvaluator("id", "evaluator_version_id"); ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/evaluations/id/evaluators/evaluator_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/evaluations/id/evaluators/evaluator_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/evaluations/id/evaluators/evaluator_version_id") .header("X-API-KEY", "") .asString(); ``` ```php request('DELETE', 'https://api.humanloop.com/v5/evaluations/id/evaluators/evaluator_version_id', [ 'headers' => [ 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/evaluations/id/evaluators/evaluator_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/evaluations/id/evaluators/evaluator_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. # Get Evaluation GET https://api.humanloop.com/v5/evaluations/{id} Get an Evaluation. This includes the Evaluators associated with the Evaluation and metadata about the Evaluation, such as its name. To get the Runs associated with the Evaluation, use the `GET /evaluations/{id}/runs` endpoint. To retrieve stats for the Evaluation, use the `GET /evaluations/{id}/stats` endpoint. Reference: https://humanloop.com/docs/api/evaluations/get ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /evaluations/{id}: get: operationId: get summary: Get Evaluation description: >- Get an Evaluation. This includes the Evaluators associated with the Evaluation and metadata about the Evaluation, such as its name. To get the Runs associated with the Evaluation, use the `GET /evaluations/{id}/runs` endpoint. To retrieve stats for the Evaluation, use the `GET /evaluations/{id}/stats` endpoint. tags: - subpackage_evaluations parameters: - name: id in: path description: Unique identifier for Evaluation. 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_:EvaluationResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/type_:HttpValidationError' servers: - url: https://api.humanloop.com/v5 components: schemas: 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_: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_: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_: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_: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_: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_: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_: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_:EvaluationEvaluatorResponse: type: object properties: version: $ref: '#/components/schemas/type_:EvaluatorResponse' orchestrated: type: boolean description: >- Whether the Evaluator is orchestrated by Humanloop. Default is `True`. If `False`, a log for the Evaluator should be submitted by the user via the API. added_at: type: string format: date-time description: When the Evaluator was added to the Evaluation. required: - version - orchestrated - added_at title: EvaluationEvaluatorResponse type_:EvaluationResponse: type: object properties: id: type: string description: Unique identifier for the Evaluation. Starts with `evr`. runs_count: type: integer description: The total number of Runs in the Evaluation. evaluators: type: array items: $ref: '#/components/schemas/type_:EvaluationEvaluatorResponse' description: The Evaluator Versions used to evaluate. name: type: string description: >- Name of the Evaluation to help identify it. Must be unique among Evaluations associated with File. file_id: type: string description: Unique identifier for the File associated with the Evaluation. created_at: type: string format: date-time created_by: $ref: '#/components/schemas/type_:UserResponse' updated_at: type: string format: date-time url: type: string description: URL to view the Evaluation on the Humanloop. required: - id - runs_count - evaluators - created_at - updated_at title: EvaluationResponse 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 evaluation import requests url = "https://api.humanloop.com/v5/evaluations/ev_567yza" headers = {"X-API-KEY": ""} response = requests.get(url, headers=headers) print(response.json()) ``` ```typescript Get evaluation import { HumanloopClient } from "humanloop"; const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); await client.evaluations.get("ev_567yza"); ``` ```go Get evaluation package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/evaluations/ev_567yza" 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 evaluation require 'uri' require 'net/http' url = URI("https://api.humanloop.com/v5/evaluations/ev_567yza") 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 evaluation import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api.humanloop.com/v5/evaluations/ev_567yza") .header("X-API-KEY", "") .asString(); ``` ```php Get evaluation request('GET', 'https://api.humanloop.com/v5/evaluations/ev_567yza', [ 'headers' => [ 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp Get evaluation using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/evaluations/ev_567yza"); var request = new RestRequest(Method.GET); request.AddHeader("X-API-KEY", ""); IRestResponse response = client.Execute(request); ``` ```swift Get evaluation import Foundation let headers = ["X-API-KEY": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/evaluations/ev_567yza")! 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 Evaluation DELETE https://api.humanloop.com/v5/evaluations/{id} Delete an Evaluation. The Runs and Evaluators in the Evaluation will not be deleted. Reference: https://humanloop.com/docs/api/evaluations/delete ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /evaluations/{id}: delete: operationId: delete summary: Delete Evaluation description: |- Delete an Evaluation. The Runs and Evaluators in the Evaluation will not be deleted. tags: - subpackage_evaluations parameters: - name: id in: path description: Unique identifier for Evaluation. 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 evaluation import requests url = "https://api.humanloop.com/v5/evaluations/ev_567yza" headers = {"X-API-KEY": ""} response = requests.delete(url, headers=headers) print(response.json()) ``` ```typescript Delete evaluation import { HumanloopClient } from "humanloop"; const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); await client.evaluations.delete("ev_567yza"); ``` ```go Delete evaluation package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/evaluations/ev_567yza" 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 evaluation require 'uri' require 'net/http' url = URI("https://api.humanloop.com/v5/evaluations/ev_567yza") 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 evaluation import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.delete("https://api.humanloop.com/v5/evaluations/ev_567yza") .header("X-API-KEY", "") .asString(); ``` ```php Delete evaluation request('DELETE', 'https://api.humanloop.com/v5/evaluations/ev_567yza', [ 'headers' => [ 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp Delete evaluation using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/evaluations/ev_567yza"); var request = new RestRequest(Method.DELETE); request.AddHeader("X-API-KEY", ""); IRestResponse response = client.Execute(request); ``` ```swift Delete evaluation import Foundation let headers = ["X-API-KEY": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/evaluations/ev_567yza")! 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 Runs for Evaluation GET https://api.humanloop.com/v5/evaluations/{id}/runs List all Runs for an Evaluation. Reference: https://humanloop.com/docs/api/evaluations/list-runs-for-evaluation ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /evaluations/{id}/runs: get: operationId: list-runs-for-evaluation summary: List Runs for Evaluation description: List all Runs for an Evaluation. tags: - subpackage_evaluations parameters: - name: id in: path description: Unique identifier for Evaluation. 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_:EvaluationRunsResponse' '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_: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_: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_: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_: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_: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_: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_:RunVersionResponse: oneOf: - $ref: '#/components/schemas/type_:PromptResponse' - $ref: '#/components/schemas/type_:ToolResponse' - $ref: '#/components/schemas/type_:EvaluatorResponse' - $ref: '#/components/schemas/type_:FlowResponse' - $ref: '#/components/schemas/type_:AgentResponse' title: RunVersionResponse type_:EvaluationStatus: type: string enum: - pending - running - completed - cancelled description: Status of an evaluation. title: EvaluationStatus type_:EvaluationRunResponse: type: object properties: id: type: string description: Unique identifier for the Run. dataset: $ref: '#/components/schemas/type_:DatasetResponse' description: The Dataset used in the Run. version: $ref: '#/components/schemas/type_:RunVersionResponse' description: The version used in the Run. orchestrated: type: boolean description: Whether the Run is orchestrated by Humanloop. added_at: type: string format: date-time description: When the Run was added to the Evaluation. created_at: type: string format: date-time description: When the Run was created. created_by: $ref: '#/components/schemas/type_:UserResponse' description: The User who created the Run. status: $ref: '#/components/schemas/type_:EvaluationStatus' description: The status of the Run. control: type: boolean description: >- Stats for other Runs will be displayed in comparison to the control Run. required: - id - orchestrated - added_at - created_at - status - control title: EvaluationRunResponse type_:EvaluationRunsResponse: type: object properties: runs: type: array items: $ref: '#/components/schemas/type_:EvaluationRunResponse' description: The Runs in the Evaluation. required: - runs title: EvaluationRunsResponse 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/evaluations/id/runs" 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.evaluations.listRunsForEvaluation("id"); ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/evaluations/id/runs" 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/evaluations/id/runs") 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/evaluations/id/runs") .header("X-API-KEY", "") .asString(); ``` ```php request('GET', 'https://api.humanloop.com/v5/evaluations/id/runs', [ 'headers' => [ 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/evaluations/id/runs"); 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/evaluations/id/runs")! 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. # Create Run POST https://api.humanloop.com/v5/evaluations/{id}/runs Content-Type: application/json Create an Evaluation Run. Optionally specify the Dataset and version to be evaluated. Humanloop will automatically start generating Logs and running Evaluators where `orchestrated=true`. If you are generating Logs yourself, you can set `orchestrated=false` and then generate and submit the required Logs via the API. If `dataset` and `version` are provided, you can set `use_existing_logs=True` to reuse existing Logs, avoiding generating new Logs unnecessarily. Logs that are associated with the specified Version and have `source_datapoint_id` referencing a datapoint in the specified Dataset will be associated with the Run. To keep updated on the progress of the Run, you can poll the Run using the `GET /evaluations/{id}/runs` endpoint and check its status. Reference: https://humanloop.com/docs/api/evaluations/create-run ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /evaluations/{id}/runs: post: operationId: create-run summary: Create Run description: >- Create an Evaluation Run. Optionally specify the Dataset and version to be evaluated. Humanloop will automatically start generating Logs and running Evaluators where `orchestrated=true`. If you are generating Logs yourself, you can set `orchestrated=false` and then generate and submit the required Logs via the API. If `dataset` and `version` are provided, you can set `use_existing_logs=True` to reuse existing Logs, avoiding generating new Logs unnecessarily. Logs that are associated with the specified Version and have `source_datapoint_id` referencing a datapoint in the specified Dataset will be associated with the Run. To keep updated on the progress of the Run, you can poll the Run using the `GET /evaluations/{id}/runs` endpoint and check its status. tags: - subpackage_evaluations parameters: - name: id in: path description: Unique identifier for Evaluation. 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_:EvaluationRunResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/type_:HttpValidationError' requestBody: content: application/json: schema: type: object properties: dataset: $ref: >- #/components/schemas/type_evaluations:CreateRunRequestDataset description: Dataset to use in this Run. version: $ref: >- #/components/schemas/type_evaluations:CreateRunRequestVersion description: Version to use in this Run. orchestrated: type: boolean default: true description: >- Whether the Run is orchestrated by Humanloop. If `True`, Humanloop will generate Logs for the Run; `dataset` and `version` must be provided. If `False`, a log for the Prompt/Tool should be submitted by the user via the API. use_existing_logs: type: boolean default: false description: >- If `True`, the Run will be initialized with existing Logs associated with the Dataset and Version. If `False`, the Run will be initialized with no Logs. Can only be set to `True` when both `dataset` and `version` are provided. servers: - url: https://api.humanloop.com/v5 components: schemas: type_:VersionId: type: object properties: version_id: type: string description: Unique identifier for the Version. required: - version_id title: VersionId type_:FileId: type: object properties: environment: type: string description: >- If provided, the Version deployed to this Environment is used. If not provided, the Version deployed to the default Environment is used. id: type: string description: Unique identifier for the File. required: - id description: Specification of a File by its ID. title: FileId type_:FilePath: type: object properties: environment: type: string description: >- If provided, the Version deployed to this Environment is used. If not provided, the Version deployed to the default Environment is used. path: type: string description: Path identifying a File. Provide this to specify a File. required: - path description: Specification of a File by its path. title: FilePath type_evaluations:CreateRunRequestDataset: oneOf: - $ref: '#/components/schemas/type_:VersionId' - $ref: '#/components/schemas/type_:FileId' - $ref: '#/components/schemas/type_:FilePath' description: Dataset to use in this Run. title: CreateRunRequestDataset type_evaluations:CreateRunRequestVersion: oneOf: - $ref: '#/components/schemas/type_:VersionId' - $ref: '#/components/schemas/type_:FileId' - $ref: '#/components/schemas/type_:FilePath' description: Version to use in this Run. title: CreateRunRequestVersion 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_: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_: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_: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_: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_: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_:RunVersionResponse: oneOf: - $ref: '#/components/schemas/type_:PromptResponse' - $ref: '#/components/schemas/type_:ToolResponse' - $ref: '#/components/schemas/type_:EvaluatorResponse' - $ref: '#/components/schemas/type_:FlowResponse' - $ref: '#/components/schemas/type_:AgentResponse' title: RunVersionResponse type_:EvaluationStatus: type: string enum: - pending - running - completed - cancelled description: Status of an evaluation. title: EvaluationStatus type_:EvaluationRunResponse: type: object properties: id: type: string description: Unique identifier for the Run. dataset: $ref: '#/components/schemas/type_:DatasetResponse' description: The Dataset used in the Run. version: $ref: '#/components/schemas/type_:RunVersionResponse' description: The version used in the Run. orchestrated: type: boolean description: Whether the Run is orchestrated by Humanloop. added_at: type: string format: date-time description: When the Run was added to the Evaluation. created_at: type: string format: date-time description: When the Run was created. created_by: $ref: '#/components/schemas/type_:UserResponse' description: The User who created the Run. status: $ref: '#/components/schemas/type_:EvaluationStatus' description: The status of the Run. control: type: boolean description: >- Stats for other Runs will be displayed in comparison to the control Run. required: - id - orchestrated - added_at - created_at - status - control title: EvaluationRunResponse 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/evaluations/id/runs" payload = {} 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.evaluations.createRun("id"); ``` ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/evaluations/id/runs" payload := strings.NewReader("{}") 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/evaluations/id/runs") 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 = "{}" 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/evaluations/id/runs") .header("X-API-KEY", "") .header("Content-Type", "application/json") .body("{}") .asString(); ``` ```php request('POST', 'https://api.humanloop.com/v5/evaluations/id/runs', [ 'body' => '{}', 'headers' => [ 'Content-Type' => 'application/json', 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/evaluations/id/runs"); var request = new RestRequest(Method.POST); 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/evaluations/id/runs")! 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. # Add Existing Run POST https://api.humanloop.com/v5/evaluations/{id}/runs/{run_id} Add an existing Run to the specified Evaluation. This is useful if you want to compare the Runs in this Evaluation with an existing Run that exists within another Evaluation. Reference: https://humanloop.com/docs/api/evaluations/add-existing-run ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /evaluations/{id}/runs/{run_id}: post: operationId: add-existing-run summary: Add Existing Run description: >- Add an existing Run to the specified Evaluation. This is useful if you want to compare the Runs in this Evaluation with an existing Run that exists within another Evaluation. tags: - subpackage_evaluations parameters: - name: id in: path description: Unique identifier for Evaluation. required: true schema: type: string - name: run_id in: path description: Unique identifier for Run. 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: description: Any type '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/evaluations/id/runs/run_id" headers = {"X-API-KEY": ""} response = requests.post(url, headers=headers) print(response.json()) ``` ```typescript import { HumanloopClient } from "humanloop"; const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" }); await client.evaluations.addExistingRun("id", "run_id"); ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/evaluations/id/runs/run_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/evaluations/id/runs/run_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/evaluations/id/runs/run_id") .header("X-API-KEY", "") .asString(); ``` ```php request('POST', 'https://api.humanloop.com/v5/evaluations/id/runs/run_id', [ 'headers' => [ 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/evaluations/id/runs/run_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/evaluations/id/runs/run_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 Run DELETE https://api.humanloop.com/v5/evaluations/{id}/runs/{run_id} Remove a Run from an Evaluation. The Logs and Versions used in the Run will not be deleted. If this Run is used in any other Evaluations, it will still be available in those Evaluations. Reference: https://humanloop.com/docs/api/evaluations/remove-run ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /evaluations/{id}/runs/{run_id}: delete: operationId: remove-run summary: Remove Run description: >- Remove a Run from an Evaluation. The Logs and Versions used in the Run will not be deleted. If this Run is used in any other Evaluations, it will still be available in those Evaluations. tags: - subpackage_evaluations parameters: - name: id in: path description: Unique identifier for Evaluation. required: true schema: type: string - name: run_id in: path description: Unique identifier for Run. 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/evaluations/id/runs/run_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.evaluations.removeRun("id", "run_id"); ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v5/evaluations/id/runs/run_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/evaluations/id/runs/run_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/evaluations/id/runs/run_id") .header("X-API-KEY", "") .asString(); ``` ```php request('DELETE', 'https://api.humanloop.com/v5/evaluations/id/runs/run_id', [ 'headers' => [ 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.humanloop.com/v5/evaluations/id/runs/run_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/evaluations/id/runs/run_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 Evaluation Run PATCH https://api.humanloop.com/v5/evaluations/{id}/runs/{run_id} Content-Type: application/json Update an Evaluation Run. Specify `control=true` to use this Run as the control Run for the Evaluation. You can cancel a running/pending Run, or mark a Run that uses external or human Evaluators as completed. Reference: https://humanloop.com/docs/api/evaluations/update-evaluation-run ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /evaluations/{id}/runs/{run_id}: patch: operationId: update-evaluation-run summary: Update Evaluation Run description: >- Update an Evaluation Run. Specify `control=true` to use this Run as the control Run for the Evaluation. You can cancel a running/pending Run, or mark a Run that uses external or human Evaluators as completed. tags: - subpackage_evaluations parameters: - name: id in: path description: Unique identifier for Evaluation. required: true schema: type: string - name: run_id in: path description: Unique identifier for Run. 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_:EvaluationRunResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/type_:HttpValidationError' requestBody: content: application/json: schema: type: object properties: control: type: boolean description: >- If `True`, this Run will be used as the control in the Evaluation. Stats for other Runs will be compared to this Run. This will replace any existing control Run. status: $ref: '#/components/schemas/type_:EvaluationStatus' description: >- Used to set the Run to `cancelled` or `completed`. Can only be used if the Run is currently `pending` or `running`. servers: - url: https://api.humanloop.com/v5 components: schemas: type_:EvaluationStatus: type: string enum: - pending - running - completed - cancelled description: Status of an evaluation. title: EvaluationStatus 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_: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_: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_: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_: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_: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 v