> 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 AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://humanloop.com/docs/_mcp/server.

# 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

## Authentication

- `X-API-KEY` header (required) — API Key authentication via header

## Request

### Path parameters

- `log_id` (string, required) — Unique identifier of the Flow Log.

### Body (application/json)

This endpoint expects an object.

- `messages` (list of ChatMessage, optional) — List of chat messages that were used as an input to the Flow.
- `output_message` (ChatMessage, optional) — The output message returned by this Flow.
- `inputs` (map from string to any, optional) — The inputs passed to the Flow Log.
- `output` (string, optional) — The output of the Flow Log. Provide None to unset existing `output` value. Provide either this, `output_message` or `error`.
- `error` (string, optional) — The error message of the Flow Log. Provide None to unset existing `error` value. Provide either this, `output_message` or `output`.
- `log_status` (enum, optional) — 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`.
  - Allowed values: `complete`, `incomplete`

## Response

### 200

Successful Response

- `id` (string, required) — Unique identifier for the Log.
- `evaluator_logs` (list of EvaluatorLogResponse, required) — List of Evaluator Logs associated with the Log. These contain Evaluator judgments on the Log.
- `flow` (FlowResponse, required) — Flow used to generate the Log.
- `messages` (list of ChatMessage, optional) — List of chat messages that were used as an input to the Flow.
- `output_message` (ChatMessage, optional) — The output message returned by this Flow.
- `start_time` (datetime, optional) — When the logged event started.
- `end_time` (datetime, optional) — When the logged event ended.
- `output` (string, optional) — 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` (datetime, optional) — User defined timestamp for when the log was created.
- `error` (string, optional) — Error message if the log is an error.
- `provider_latency` (double, optional) — Duration of the logged event in seconds.
- `stdout` (string, optional) — Captured log and debug statements.
- `provider_request` (map from string to any, optional) — Raw request sent to provider.
- `provider_response` (map from string to any, optional) — Raw response received the provider.
- `inputs` (map from string to any, optional) — The inputs passed to the Flow Log.
- `source` (string, optional) — Identifies where the model was called from.
- `metadata` (map from string to any, optional) — Any additional metadata to record.
- `log_status` (enum, optional) — 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`.
  - Allowed values: `complete`, `incomplete`
- `source_datapoint_id` (string, optional) — 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` (string, optional) — The ID of the parent Log to nest this Log under in a Trace.
- `batches` (list of string, optional) — Array of Batch IDs that this Log is part of. Batches are used to group Logs together for offline Evaluations
- `user` (string, optional) — End-user ID related to the Log.
- `environment` (string, optional) — The name of the Environment the Log is associated to.
- `save` (boolean, optional, default: true) — Whether the request/response payloads will be stored on Humanloop.
- `log_id` (string, optional) — This will identify a Log. If you don't provide a Log ID, Humanloop will generate one for you.
- `trace_flow_id` (string, optional) — Identifier for the Flow that the Trace belongs to.
- `trace_id` (string, optional) — Identifier for the Trace that the Log belongs to.
- `trace_children` (list of LogResponse, optional) — Logs nested under this Log in the Trace.

## Errors

### 422 Update Log Flows Logs Log ID Patch Request Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

## Types

### ChatMessage

- `role` (enum, required) — Role of the message author.
  - Allowed values: `user`, `assistant`, `system`, `tool`, `developer`
- `content` (ChatMessageContent, optional) — The content of the message.
- `name` (string, optional) — Optional name of the message author.
- `tool_call_id` (string, optional) — Tool call that this message is responding to.
- `tool_calls` (list of ToolCall, optional) — A list of tool calls requested by the assistant.
- `thinking` (list of ChatMessageThinkingItem, optional) — Model's chain-of-thought for providing the response. Present on assistant messages if model supports it.

### EvaluatorLogResponse

General request for creating a Log

- `id` (string, required) — Unique identifier for the Log.
- `evaluator_logs` (list of EvaluatorLogResponse, required) — List of Evaluator Logs associated with the Log. These contain Evaluator judgments on the Log.
- `evaluator` (EvaluatorResponse, required) — Evaluator used to generate the judgment.
- `start_time` (datetime, optional) — When the logged event started.
- `end_time` (datetime, optional) — When the logged event ended.
- `output` (string, optional) — 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` (datetime, optional) — User defined timestamp for when the log was created.
- `error` (string, optional) — Error message if the log is an error.
- `provider_latency` (double, optional) — Duration of the logged event in seconds.
- `stdout` (string, optional) — Captured log and debug statements.
- `provider_request` (map from string to any, optional) — Raw request sent to provider.
- `provider_response` (map from string to any, optional) — Raw response received the provider.
- `inputs` (map from string to any, optional) — The inputs passed to the prompt template.
- `source` (string, optional) — Identifies where the model was called from.
- `metadata` (map from string to any, optional) — Any additional metadata to record.
- `parent_id` (string, optional) — Identifier of the evaluated Log. The newly created Log will have this one set as parent.
- `source_datapoint_id` (string, optional) — 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` (string, optional) — The ID of the parent Log to nest this Log under in a Trace.
- `batches` (list of string, optional) — Array of Batch IDs that this Log is part of. Batches are used to group Logs together for offline Evaluations
- `user` (string, optional) — End-user ID related to the Log.
- `environment` (string, optional) — The name of the Environment the Log is associated to.
- `save` (boolean, optional, default: true) — Whether the request/response payloads will be stored on Humanloop.
- `log_id` (string, optional) — This will identify a Log. If you don't provide a Log ID, Humanloop will generate one for you.
- `output_message` (ChatMessage, optional) — The message returned by the LLM. Only populated for LLM Evaluator Logs.
- `judgment` (EvaluatorLogResponseJudgment, optional) — Evaluator assessment of the Log.
- `marked_completed` (boolean, optional) — Whether the Log has been manually marked as completed by a user.
- `trace_flow_id` (string, optional) — Identifier for the Flow that the Trace belongs to.
- `trace_id` (string, optional) — Identifier for the Trace that the Log belongs to.
- `trace_children` (list of LogResponse, optional) — Logs nested under this Log in the Trace.
- `parent` (LogResponse, optional) — The Log that was evaluated. Only provided if the ?include_parent query parameter is set for the

### FlowResponse

Response model for a Flow.

- `path` (string, required) — Path of the Flow, including the name, which is used as a unique identifier.
- `id` (string, required) — Unique identifier for the Flow.
- `attributes` (map from string to any, required) — A key-value object identifying the Flow Version.
- `name` (string, required) — Name of the Flow.
- `version_id` (string, required) — Unique identifier for the specific Flow Version. If no query params provided, the default deployed Flow Version is returned.
- `created_at` (datetime, required)
- `updated_at` (datetime, required)
- `last_used_at` (datetime, required)
- `version_logs_count` (integer, required) — The number of logs that have been generated for this Flow Version
- `directory_id` (string, optional) — ID of the directory that the file is in on Humanloop.
- `version_name` (string, optional) — Unique name for the Flow version. Version names must be unique for a given Flow.
- `version_description` (string, optional) — Description of the Version.
- `description` (string, optional) — Description of the Flow.
- `schema` (map from string to any, optional) — The JSON schema for the File.
- `readme` (string, optional) — Long description of the file.
- `tags` (list of string, optional) — List of tags associated with the file.
- `type` ("flow", optional)
- `environments` (list of EnvironmentResponse, optional) — The list of environments the Flow Version is deployed to.
- `created_by` (any, optional) — The user who created the Flow.
- `evaluator_aggregates` (list of EvaluatorAggregate, optional) — Aggregation of Evaluator results for the Flow Version.
- `evaluators` (list of MonitoringEvaluatorResponse, optional) — The list of Monitoring Evaluators associated with the Flow Version.

### LogResponse

### ValidationError

- `loc` (list of ValidationErrorLocItem, required)
- `msg` (string, required)
- `type` (string, required)

### ChatMessageContent

The content of the message.

### ToolCall

A tool call to be made.

- `id` (string, required)
- `type` ("function", required) — The type of tool to call.
- `function` (FunctionTool, required) — A function tool to be called by the model where user owns runtime.

### ChatMessageThinkingItem

### EvaluatorResponse

Version of the Evaluator used to provide judgments.

- `path` (string, required) — Path of the Evaluator including the Evaluator name, which is used as a unique identifier.
- `id` (string, required) — Unique identifier for the Evaluator.
- `spec` (EvaluatorResponseSpec, required)
- `name` (string, required) — Name of the Evaluator, which is used as a unique identifier.
- `version_id` (string, required) — Unique identifier for the specific Evaluator Version. If no query params provided, the default deployed Evaluator Version is returned.
- `created_at` (datetime, required)
- `updated_at` (datetime, required)
- `last_used_at` (datetime, required)
- `version_logs_count` (integer, required) — The number of logs that have been generated for this Evaluator Version
- `total_logs_count` (integer, required) — The number of logs that have been generated across all Evaluator Versions
- `inputs` (list of InputResponse, required) — Inputs associated to the Evaluator. Inputs correspond to any of the variables used within the Evaluator template.
- `directory_id` (string, optional) — ID of the directory that the file is in on Humanloop.
- `version_name` (string, optional) — Unique name for the Evaluator version. Version names must be unique for a given Evaluator.
- `version_description` (string, optional) — Description of the version, e.g., the changes made in this version.
- `description` (string, optional) — Description of the Evaluator.
- `schema` (map from string to any, optional) — The JSON schema for the File.
- `readme` (string, optional) — Long description of the file.
- `tags` (list of string, optional) — List of tags associated with the file.
- `type` ("evaluator", optional)
- `environments` (list of EnvironmentResponse, optional) — The list of environments the Evaluator Version is deployed to.
- `created_by` (any, optional) — The user who created the Evaluator.
- `evaluators` (list of MonitoringEvaluatorResponse, optional) — Evaluators that have been attached to this Evaluator that are used for monitoring logs.
- `evaluator_aggregates` (list of EvaluatorAggregate, optional) — Aggregation of Evaluator results for the Evaluator Version.
- `attributes` (map from string to any, optional) — Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used.

### EvaluatorLogResponseJudgment

Evaluator assessment of the Log.

### EnvironmentResponse

- `id` (string, required)
- `created_at` (datetime, required)
- `name` (string, required)
- `tag` (enum, required) — An enumeration.
  - Allowed values: `default`, `other`

### EvaluatorAggregate

- `value` (double, required) — The aggregated value of the evaluator.
- `evaluator_id` (string, required) — ID of the evaluator.
- `evaluator_version_id` (string, required) — ID of the evaluator version.
- `created_at` (datetime, required)
- `updated_at` (datetime, required)

### MonitoringEvaluatorResponse

- `version_reference` (VersionReferenceResponse, required) — The Evaluator Version used for monitoring. This can be a specific Version by ID, or a Version deployed to an Environment.
- `state` (enum, required) — The state of the Monitoring Evaluator. Either `active` or `inactive`
  - Allowed values: `active`, `inactive`
- `created_at` (datetime, required)
- `updated_at` (datetime, required)
- `version` (EvaluatorResponse, optional) — The deployed Version.

### PromptLogResponse

General request for creating a Log

- `prompt` (PromptResponse, required) — Prompt used to generate the Log.
- `id` (string, required) — Unique identifier for the Log.
- `evaluator_logs` (list of EvaluatorLogResponse, required) — List of Evaluator Logs associated with the Log. These contain Evaluator judgments on the Log.
- `output_message` (ChatMessage, optional) — The message returned by the provider.
- `prompt_tokens` (integer, optional) — Number of tokens in the prompt used to generate the output.
- `reasoning_tokens` (integer, optional) — Number of reasoning tokens used to generate the output.
- `output_tokens` (integer, optional) — Number of tokens in the output generated by the model.
- `prompt_cost` (double, optional) — Cost in dollars associated to the tokens in the prompt.
- `output_cost` (double, optional) — Cost in dollars associated to the tokens in the output.
- `finish_reason` (string, optional) — Reason the generation finished.
- `messages` (list of ChatMessage, optional) — The messages passed to the to provider chat endpoint.
- `tool_choice` (PromptLogResponseToolChoice, optional) — 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': <TOOL_NAME>}}` forces the model to use the named function.
- `start_time` (datetime, optional) — When the logged event started.
- `end_time` (datetime, optional) — When the logged event ended.
- `output` (string, optional) — 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` (datetime, optional) — User defined timestamp for when the log was created.
- `error` (string, optional) — Error message if the log is an error.
- `provider_latency` (double, optional) — Duration of the logged event in seconds.
- `stdout` (string, optional) — Captured log and debug statements.
- `provider_request` (map from string to any, optional) — Raw request sent to provider.
- `provider_response` (map from string to any, optional) — Raw response received the provider.
- `inputs` (map from string to any, optional) — The inputs passed to the prompt template.
- `source` (string, optional) — Identifies where the model was called from.
- `metadata` (map from string to any, optional) — Any additional metadata to record.
- `source_datapoint_id` (string, optional) — 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` (string, optional) — The ID of the parent Log to nest this Log under in a Trace.
- `batches` (list of string, optional) — Array of Batch IDs that this Log is part of. Batches are used to group Logs together for offline Evaluations
- `user` (string, optional) — End-user ID related to the Log.
- `environment` (string, optional) — The name of the Environment the Log is associated to.
- `save` (boolean, optional, default: true) — Whether the request/response payloads will be stored on Humanloop.
- `log_id` (string, optional) — This will identify a Log. If you don't provide a Log ID, Humanloop will generate one for you.
- `trace_flow_id` (string, optional) — Identifier for the Flow that the Trace belongs to.
- `trace_id` (string, optional) — Identifier for the Trace that the Log belongs to.
- `trace_children` (list of LogResponse, optional) — Logs nested under this Log in the Trace.

### ToolLogResponse

General request for creating a Log

- `id` (string, required) — Unique identifier for the Log.
- `evaluator_logs` (list of EvaluatorLogResponse, required) — List of Evaluator Logs associated with the Log. These contain Evaluator judgments on the Log.
- `tool` (ToolResponse, required) — Tool used to generate the Log.
- `start_time` (datetime, optional) — When the logged event started.
- `end_time` (datetime, optional) — When the logged event ended.
- `output` (string, optional) — 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` (datetime, optional) — User defined timestamp for when the log was created.
- `error` (string, optional) — Error message if the log is an error.
- `provider_latency` (double, optional) — Duration of the logged event in seconds.
- `stdout` (string, optional) — Captured log and debug statements.
- `provider_request` (map from string to any, optional) — Raw request sent to provider.
- `provider_response` (map from string to any, optional) — Raw response received the provider.
- `inputs` (map from string to any, optional) — The inputs passed to the prompt template.
- `source` (string, optional) — Identifies where the model was called from.
- `metadata` (map from string to any, optional) — Any additional metadata to record.
- `source_datapoint_id` (string, optional) — 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` (string, optional) — The ID of the parent Log to nest this Log under in a Trace.
- `batches` (list of string, optional) — Array of Batch IDs that this Log is part of. Batches are used to group Logs together for offline Evaluations
- `user` (string, optional) — End-user ID related to the Log.
- `environment` (string, optional) — The name of the Environment the Log is associated to.
- `save` (boolean, optional, default: true) — Whether the request/response payloads will be stored on Humanloop.
- `log_id` (string, optional) — This will identify a Log. If you don't provide a Log ID, Humanloop will generate one for you.
- `trace_flow_id` (string, optional) — Identifier for the Flow that the Trace belongs to.
- `trace_id` (string, optional) — Identifier for the Trace that the Log belongs to.
- `trace_children` (list of LogResponse, optional) — Logs nested under this Log in the Trace.
- `output_message` (ChatMessage, optional) — The message returned by the Tool.

### FlowLogResponse

General request for creating a Log

- `id` (string, required) — Unique identifier for the Log.
- `evaluator_logs` (list of EvaluatorLogResponse, required) — List of Evaluator Logs associated with the Log. These contain Evaluator judgments on the Log.
- `flow` (FlowResponse, required) — Flow used to generate the Log.
- `messages` (list of ChatMessage, optional) — List of chat messages that were used as an input to the Flow.
- `output_message` (ChatMessage, optional) — The output message returned by this Flow.
- `start_time` (datetime, optional) — When the logged event started.
- `end_time` (datetime, optional) — When the logged event ended.
- `output` (string, optional) — 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` (datetime, optional) — User defined timestamp for when the log was created.
- `error` (string, optional) — Error message if the log is an error.
- `provider_latency` (double, optional) — Duration of the logged event in seconds.
- `stdout` (string, optional) — Captured log and debug statements.
- `provider_request` (map from string to any, optional) — Raw request sent to provider.
- `provider_response` (map from string to any, optional) — Raw response received the provider.
- `inputs` (map from string to any, optional) — The inputs passed to the Flow Log.
- `source` (string, optional) — Identifies where the model was called from.
- `metadata` (map from string to any, optional) — Any additional metadata to record.
- `log_status` (enum, optional) — 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`.
  - Allowed values: `complete`, `incomplete`
- `source_datapoint_id` (string, optional) — 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` (string, optional) — The ID of the parent Log to nest this Log under in a Trace.
- `batches` (list of string, optional) — Array of Batch IDs that this Log is part of. Batches are used to group Logs together for offline Evaluations
- `user` (string, optional) — End-user ID related to the Log.
- `environment` (string, optional) — The name of the Environment the Log is associated to.
- `save` (boolean, optional, default: true) — Whether the request/response payloads will be stored on Humanloop.
- `log_id` (string, optional) — This will identify a Log. If you don't provide a Log ID, Humanloop will generate one for you.
- `trace_flow_id` (string, optional) — Identifier for the Flow that the Trace belongs to.
- `trace_id` (string, optional) — Identifier for the Trace that the Log belongs to.
- `trace_children` (list of LogResponse, optional) — Logs nested under this Log in the Trace.

### AgentLogResponse

General request for creating a Log

- `agent` (AgentResponse, required) — Agent that generated the Log.
- `id` (string, required) — Unique identifier for the Log.
- `evaluator_logs` (list of EvaluatorLogResponse, required) — List of Evaluator Logs associated with the Log. These contain Evaluator judgments on the Log.
- `output_message` (ChatMessage, optional) — The message returned by the provider.
- `prompt_tokens` (integer, optional) — Number of tokens in the prompt used to generate the output.
- `reasoning_tokens` (integer, optional) — Number of reasoning tokens used to generate the output.
- `output_tokens` (integer, optional) — Number of tokens in the output generated by the model.
- `prompt_cost` (double, optional) — Cost in dollars associated to the tokens in the prompt.
- `output_cost` (double, optional) — Cost in dollars associated to the tokens in the output.
- `finish_reason` (string, optional) — Reason the generation finished.
- `messages` (list of ChatMessage, optional) — The messages passed to the to provider chat endpoint.
- `tool_choice` (AgentLogResponseToolChoice, optional) — 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': <TOOL_NAME>}}` forces the model to use the named function.
- `start_time` (datetime, optional) — When the logged event started.
- `end_time` (datetime, optional) — When the logged event ended.
- `output` (string, optional) — 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` (datetime, optional) — User defined timestamp for when the log was created.
- `error` (string, optional) — Error message if the log is an error.
- `provider_latency` (double, optional) — Duration of the logged event in seconds.
- `stdout` (string, optional) — Captured log and debug statements.
- `provider_request` (map from string to any, optional) — Raw request sent to provider.
- `provider_response` (map from string to any, optional) — Raw response received the provider.
- `inputs` (map from string to any, optional) — The inputs passed to the prompt template.
- `source` (string, optional) — Identifies where the model was called from.
- `metadata` (map from string to any, optional) — Any additional metadata to record.
- `source_datapoint_id` (string, optional) — 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` (string, optional) — The ID of the parent Log to nest this Log under in a Trace.
- `batches` (list of string, optional) — Array of Batch IDs that this Log is part of. Batches are used to group Logs together for offline Evaluations
- `user` (string, optional) — End-user ID related to the Log.
- `environment` (string, optional) — The name of the Environment the Log is associated to.
- `save` (boolean, optional, default: true) — Whether the request/response payloads will be stored on Humanloop.
- `log_id` (string, optional) — This will identify a Log. If you don't provide a Log ID, Humanloop will generate one for you.
- `trace_flow_id` (string, optional) — Identifier for the Flow that the Trace belongs to.
- `trace_id` (string, optional) — Identifier for the Trace that the Log belongs to.
- `trace_children` (list of LogResponse, optional) — Logs nested under this Log in the Trace.

### ValidationErrorLocItem

### FunctionTool

A function tool to be called by the model where user owns runtime.

- `name` (string, required)
- `arguments` (string, optional)

### AnthropicThinkingContent

- `type` ("thinking", required)
- `thinking` (string, required) — Model's chain-of-thought for providing the response.
- `signature` (string, required) — Cryptographic signature that verifies the thinking block was generated by Anthropic.

### AnthropicRedactedThinkingContent

- `type` ("redacted_thinking", required)
- `data` (string, required) — Thinking block Anthropic redacted for safety reasons. User is expected to pass the block back to Anthropic

### EvaluatorResponseSpec

### InputResponse

- `name` (string, required) — Type of input.

### VersionReferenceResponse

### PromptResponse

Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions.

- `path` (string, required) — Path of the Prompt, including the name, which is used as a unique identifier.
- `id` (string, required) — Unique identifier for the Prompt.
- `model` (string, required) — The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models)
- `name` (string, required) — Name of the Prompt.
- `version_id` (string, required) — Unique identifier for the specific Prompt Version. If no query params provided, the default deployed Prompt Version is returned.
- `created_at` (datetime, required)
- `updated_at` (datetime, required)
- `last_used_at` (datetime, required)
- `version_logs_count` (integer, required) — The number of logs that have been generated for this Prompt Version
- `total_logs_count` (integer, required) — The number of logs that have been generated across all Prompt Versions
- `inputs` (list of InputResponse, required) — Inputs associated to the Prompt. Inputs correspond to any of the variables used within the Prompt template.
- `directory_id` (string, optional) — ID of the directory that the file is in on Humanloop.
- `endpoint` (enum, optional) — The provider model endpoint used.
  - Allowed values: `complete`, `chat`, `edit`
- `template` (PromptResponseTemplate, optional) — The template contains the main structure and instructions for the model, including input variables for dynamic values. For chat models, provide the template as a ChatTemplate (a list of messages), e.g. a system message, followed by a user message with an 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` (enum, optional) — The template language to use for rendering the template.
  - Allowed values: `default`, `jinja`
- `provider` (enum, optional) — The company providing the underlying model service.
  - Allowed values: `anthropic`, `bedrock`, `cohere`, `deepseek`, `google`, `groq`, `mock`, `openai`, `openai_azure`, `replicate`
- `max_tokens` (integer, optional, default: -1) — 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` (double, optional, default: 1) — What sampling temperature to use when making a generation. Higher values means the model will be more creative.
- `top_p` (double, optional, default: 1) — An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass.
- `stop` (PromptResponseStop, optional) — The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence.
- `presence_penalty` (double, optional, default: 0) — Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far.
- `frequency_penalty` (double, optional, default: 0) — Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far.
- `other` (map from string to any, optional) — Other parameter values to be passed to the provider call.
- `seed` (integer, optional) — If specified, model will make a best effort to sample deterministically, but it is not guaranteed.
- `response_format` (ResponseFormat, optional) — The format of the response. Only `{"type": "json_object"}` is currently supported for chat.
- `reasoning_effort` (PromptResponseReasoningEffort, optional) — Guidance on how many reasoning tokens it should generate before creating a response to 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` (list of ToolFunction, optional) — The tool specification that the model can choose to call if Tool calling is supported.
- `linked_tools` (list of LinkedToolResponse, optional) — The tools linked to your prompt that the model can call.
- `attributes` (map from string to any, optional) — 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` (string, optional) — Unique name for the Prompt version. Version names must be unique for a given Prompt.
- `version_description` (string, optional) — Description of the version, e.g., the changes made in this version.
- `description` (string, optional) — Description of the Prompt.
- `tags` (list of string, optional) — List of tags associated with the file.
- `readme` (string, optional) — Long description of the file.
- `schema` (map from string to any, optional) — The JSON schema for the Prompt.
- `type` ("prompt", optional)
- `environments` (list of EnvironmentResponse, optional) — The list of environments the Prompt Version is deployed to.
- `created_by` (any, optional) — The user who created the Prompt.
- `evaluators` (list of MonitoringEvaluatorResponse, optional) — Evaluators that have been attached to this Prompt that are used for monitoring logs.
- `evaluator_aggregates` (list of EvaluatorAggregate, optional) — Aggregation of Evaluator results for the Prompt Version.
- `raw_file_content` (string, optional) — The raw content of the Prompt. Corresponds to the .prompt file.

### PromptLogResponseToolChoice

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': <TOOL_NAME>}}` forces the model to use the named function.

### ToolResponse

Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions.

- `path` (string, required) — Path of the Tool, including the name, which is used as a unique identifier.
- `id` (string, required) — Unique identifier for the Tool.
- `name` (string, required) — Name of the Tool, which is used as a unique identifier.
- `version_id` (string, required) — Unique identifier for the specific Tool Version. If no query params provided, the default deployed Tool Version is returned.
- `created_at` (datetime, required)
- `updated_at` (datetime, required)
- `last_used_at` (datetime, required)
- `version_logs_count` (integer, required) — The number of logs that have been generated for this Tool Version
- `total_logs_count` (integer, required) — The number of logs that have been generated across all Tool Versions
- `inputs` (list of InputResponse, required) — Inputs associated to the Prompt. Inputs correspond to any of the variables used within the Tool template.
- `directory_id` (string, optional) — ID of the directory that the file is in on Humanloop.
- `function` (ToolFunction, optional) — Callable function specification of the Tool shown to the model for tool calling.
- `source_code` (string, optional) — Code source of the Tool.
- `setup_values` (map from string to any, optional) — Values needed to setup the Tool, defined in JSON Schema format: https://json-schema.org/
- `attributes` (map from string to any, optional) — 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` (enum, optional) — Type of Tool.
  - Allowed values: `pinecone_search`, `google`, `mock`, `snippet`, `json_schema`, `get_api_call`, `python`
- `version_name` (string, optional) — Unique identifier for this Tool version. Each Tool can only have one version with a given name.
- `version_description` (string, optional) — Description of the Version.
- `description` (string, optional) — Description of the Tool.
- `readme` (string, optional) — Long description of the file.
- `tags` (list of string, optional) — List of tags associated with the file.
- `type` ("tool", optional)
- `environments` (list of EnvironmentResponse, optional) — The list of environments the Tool Version is deployed to.
- `created_by` (any, optional) — The user who created the Tool.
- `evaluators` (list of MonitoringEvaluatorResponse, optional) — Evaluators that have been attached to this Tool that are used for monitoring logs.
- `signature` (string, optional) — Signature of the Tool.
- `evaluator_aggregates` (list of EvaluatorAggregate, optional) — Aggregation of Evaluator results for the Tool Version.

### AgentResponse

Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions.

- `path` (string, required) — Path of the Agent, including the name, which is used as a unique identifier.
- `id` (string, required) — Unique identifier for the Agent.
- `model` (string, required) — The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models)
- `tools` (list of AgentResponseToolsItem, required) — List of tools that the Agent can call. These can be linked files or inline tools.
- `name` (string, required) — Name of the Agent.
- `version_id` (string, required) — Unique identifier for the specific Agent Version. If no query params provided, the default deployed Agent Version is returned.
- `created_at` (datetime, required)
- `updated_at` (datetime, required)
- `status` (enum, required) — The status of the Agent Version.
  - Allowed values: `uncommitted`, `committed`, `deleted`
- `last_used_at` (datetime, required)
- `version_logs_count` (integer, required) — The number of logs that have been generated for this Agent Version
- `total_logs_count` (integer, required) — The number of logs that have been generated across all Agent Versions
- `inputs` (list of InputResponse, required) — Inputs associated to the Agent. Inputs correspond to any of the variables used within the Agent template.
- `directory_id` (string, optional) — ID of the directory that the file is in on Humanloop.
- `endpoint` (enum, optional) — The provider model endpoint used.
  - Allowed values: `complete`, `chat`, `edit`
- `template` (AgentResponseTemplate, optional) — The template contains the main structure and instructions for the model, including input variables for dynamic values. For chat models, provide the template as a ChatTemplate (a list of messages), e.g. a system message, followed by a user message with an 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` (enum, optional) — The template language to use for rendering the template.
  - Allowed values: `default`, `jinja`
- `provider` (enum, optional) — The company providing the underlying model service.
  - Allowed values: `anthropic`, `bedrock`, `cohere`, `deepseek`, `google`, `groq`, `mock`, `openai`, `openai_azure`, `replicate`
- `max_tokens` (integer, optional, default: -1) — 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` (double, optional, default: 1) — What sampling temperature to use when making a generation. Higher values means the model will be more creative.
- `top_p` (double, optional, default: 1) — An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass.
- `stop` (AgentResponseStop, optional) — The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence.
- `presence_penalty` (double, optional, default: 0) — Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far.
- `frequency_penalty` (double, optional, default: 0) — Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far.
- `other` (map from string to any, optional) — Other parameter values to be passed to the provider call.
- `seed` (integer, optional) — If specified, model will make a best effort to sample deterministically, but it is not guaranteed.
- `response_format` (ResponseFormat, optional) — The format of the response. Only `{"type": "json_object"}` is currently supported for chat.
- `reasoning_effort` (AgentResponseReasoningEffort, optional) — Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget.
- `attributes` (map from string to any, optional) — 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` (integer, optional) — 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` (string, optional) — Unique name for the Agent version. Version names must be unique for a given Agent.
- `version_description` (string, optional) — Description of the version, e.g., the changes made in this version.
- `description` (string, optional) — Description of the Agent.
- `tags` (list of string, optional) — List of tags associated with the file.
- `readme` (string, optional) — Long description of the file.
- `schema` (map from string to any, optional) — The JSON schema for the Prompt.
- `type` ("agent", optional)
- `environments` (list of EnvironmentResponse, optional) — The list of environments the Agent Version is deployed to.
- `created_by` (any, optional) — The user who created the Agent.
- `committed_by` (any, optional) — The user who committed the Agent Version.
- `committed_at` (datetime, optional) — The date and time the Agent Version was committed.
- `evaluators` (list of MonitoringEvaluatorResponse, optional) — Evaluators that have been attached to this Agent that are used for monitoring logs.
- `evaluator_aggregates` (list of EvaluatorAggregate, optional) — Aggregation of Evaluator results for the Agent Version.
- `raw_file_content` (string, optional) — The raw content of the Agent. Corresponds to the .agent file.

### AgentLogResponseToolChoice

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': <TOOL_NAME>}}` forces the model to use the named function.

### LlmEvaluatorRequest

- `arguments_type` (enum, required) — Whether this Evaluator is target-free or target-required.
  - Allowed values: `target_free`, `target_required`
- `return_type` (enum, required) — The type of the return value of the Evaluator.
  - Allowed values: `boolean`, `number`, `select`, `multi_select`, `text`
- `evaluator_type` ("llm", required)
- `attributes` (map from string to any, optional) — Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used.
- `options` (list of EvaluatorJudgmentOptionResponse, optional) — The options that can be applied as judgments. Only for Evaluators with `return_type` of 'boolean', 'select' or 'multi_select'.
- `number_limits` (EvaluatorJudgmentNumberLimit, optional) — Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'.
- `number_valence` (enum, optional) — The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better.
  - Allowed values: `positive`, `negative`, `neutral`
- `prompt` (PromptKernelRequest, optional) — The prompt parameters used to generate.

### CodeEvaluatorRequest

- `arguments_type` (enum, required) — Whether this Evaluator is target-free or target-required.
  - Allowed values: `target_free`, `target_required`
- `return_type` (enum, required) — The type of the return value of the Evaluator.
  - Allowed values: `boolean`, `number`, `select`, `multi_select`, `text`
- `evaluator_type` ("python", required)
- `code` (string, required) — The code for the Evaluator. This code will be executed in a sandboxed environment.
- `attributes` (map from string to any, optional) — Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used.
- `options` (list of EvaluatorJudgmentOptionResponse, optional) — The options that can be applied as judgments. Only for Evaluators with `return_type` of 'boolean', 'select' or 'multi_select'.
- `number_limits` (EvaluatorJudgmentNumberLimit, optional) — Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'.
- `number_valence` (enum, optional) — The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better.
  - Allowed values: `positive`, `negative`, `neutral`

### HumanEvaluatorRequest

- `arguments_type` (enum, required) — Whether this Evaluator is target-free or target-required.
  - Allowed values: `target_free`, `target_required`
- `return_type` (enum, required) — The type of the return value of the Evaluator.
  - Allowed values: `select`, `multi_select`, `text`, `number`, `boolean`
- `evaluator_type` ("human", required)
- `attributes` (map from string to any, optional) — Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used.
- `options` (list of EvaluatorJudgmentOptionResponse, optional) — The options that can be applied as judgments.
- `number_limits` (EvaluatorJudgmentNumberLimit, optional) — Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'.
- `number_valence` (enum, optional) — The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better.
  - Allowed values: `positive`, `negative`, `neutral`
- `instructions` (string, optional) — Instructions and guidelines for applying judgments.

### ExternalEvaluatorRequest

- `arguments_type` (enum, required) — Whether this Evaluator is target-free or target-required.
  - Allowed values: `target_free`, `target_required`
- `return_type` (enum, required) — The type of the return value of the Evaluator.
  - Allowed values: `boolean`, `number`, `select`, `multi_select`, `text`
- `evaluator_type` ("external", required)
- `attributes` (map from string to any, optional) — Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used.
- `options` (list of EvaluatorJudgmentOptionResponse, optional) — The options that can be applied as judgments. Only for Evaluators with `return_type` of 'boolean', 'select' or 'multi_select'.
- `number_limits` (EvaluatorJudgmentNumberLimit, optional) — Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'.
- `number_valence` (enum, optional) — The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better.
  - Allowed values: `positive`, `negative`, `neutral`

### VersionDeploymentResponse

A variable reference to the Version deployed to an Environment

- `file` (VersionDeploymentResponseFile, required) — The File that the deployed Version belongs to.
- `environment` (EnvironmentResponse, required) — The Environment that the Version is deployed to.
- `type` ("environment", required)

### VersionIdResponse

A reference to a specific Version by its ID

- `version` (VersionIdResponseVersion, required) — The specific Version being referenced.
- `type` ("version", required)

### PromptResponseTemplate

The template contains the main structure and instructions for the model, including input variables for dynamic values. For chat models, provide the template as a ChatTemplate (a list of messages), e.g. a system message, followed by a user message with an input variable. For completion models, provide a prompt template as a string. Input variables should be specified with double curly bracket syntax: `{{input_name}}`.

### PromptResponseStop

The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence.

### ResponseFormat

Response format of the model.

- `type` (enum, required)
  - Allowed values: `json_object`, `json_schema`
- `json_schema` (map from string to any, optional) — The JSON schema of the response format if type is json_schema.

### PromptResponseReasoningEffort

Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget.

### ToolFunction

- `name` (string, required) — Name for the tool referenced by the model.
- `description` (string, required) — Description of the tool referenced by the model
- `strict` (boolean, optional, default: false) — If true, forces the model to output json data in the structure of the parameters schema.
- `parameters` (map from string to any, optional) — Parameters needed to run the Tool, defined in JSON Schema format: https://json-schema.org/

### LinkedToolResponse

- `name` (string, required) — Name for the tool referenced by the model.
- `description` (string, required) — Description of the tool referenced by the model
- `id` (string, required) — Unique identifier for the Tool linked.
- `version_id` (string, required) — Unique identifier for the Tool Version linked.
- `strict` (boolean, optional, default: false) — If true, forces the model to output json data in the structure of the parameters schema.
- `parameters` (map from string to any, optional) — Parameters needed to run the Tool, defined in JSON Schema format: https://json-schema.org/

### ToolChoice

Tool choice to force the model to use a tool.

- `type` ("function", required) — The type of tool to call.
- `function` (FunctionToolChoice, required) — A function tool to be called by the model where user owns runtime.

### AgentResponseToolsItem

### AgentResponseTemplate

The template contains the main structure and instructions for the model, including input variables for dynamic values. For chat models, provide the template as a ChatTemplate (a list of messages), e.g. a system message, followed by a user message with an input variable. For completion models, provide a prompt template as a string. Input variables should be specified with double curly bracket syntax: `{{input_name}}`.

### AgentResponseStop

The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence.

### AgentResponseReasoningEffort

Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget.

### EvaluatorJudgmentOptionResponse

- `name` (string, required) — The name of the option.
- `valence` (enum, optional) — Whether this option should be considered positive or negative.
  - Allowed values: `positive`, `negative`, `neutral`

### EvaluatorJudgmentNumberLimit

- `min` (double, optional) — The minimum value that can be selected.
- `max` (double, optional) — The maximum value that can be selected.
- `step` (double, optional) — The step size for the number input.

### PromptKernelRequest

Base class used by both PromptKernelRequest and AgentKernelRequest. Contains the consistent Prompt-related fields.

- `model` (string, required) — The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models)
- `endpoint` (enum, optional) — The provider model endpoint used.
  - Allowed values: `complete`, `chat`, `edit`
- `template` (PromptKernelRequestTemplate, optional) — The template contains the main structure and instructions for the model, including input variables for dynamic values. For chat models, provide the template as a ChatTemplate (a list of messages), e.g. a system message, followed by a user message with an 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` (enum, optional) — The template language to use for rendering the template.
  - Allowed values: `default`, `jinja`
- `provider` (enum, optional) — The company providing the underlying model service.
  - Allowed values: `anthropic`, `bedrock`, `cohere`, `deepseek`, `google`, `groq`, `mock`, `openai`, `openai_azure`, `replicate`
- `max_tokens` (integer, optional, default: -1) — 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` (double, optional, default: 1) — What sampling temperature to use when making a generation. Higher values means the model will be more creative.
- `top_p` (double, optional, default: 1) — An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass.
- `stop` (PromptKernelRequestStop, optional) — The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence.
- `presence_penalty` (double, optional, default: 0) — Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far.
- `frequency_penalty` (double, optional, default: 0) — Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far.
- `other` (map from string to any, optional) — Other parameter values to be passed to the provider call.
- `seed` (integer, optional) — If specified, model will make a best effort to sample deterministically, but it is not guaranteed.
- `response_format` (ResponseFormat, optional) — The format of the response. Only `{"type": "json_object"}` is currently supported for chat.
- `reasoning_effort` (PromptKernelRequestReasoningEffort, optional) — Guidance on how many reasoning tokens it should generate before creating a response to 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` (list of ToolFunction, optional) — The tool specification that the model can choose to call if Tool calling is supported.
- `linked_tools` (list of string, optional) — 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` (map from string to any, optional) — Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used.

### VersionDeploymentResponseFile

The File that the deployed Version belongs to.

### VersionIdResponseVersion

The specific Version being referenced.

### FunctionToolChoice

A function tool to be called by the model where user owns runtime.

- `name` (string, required)

### AgentLinkedFileResponse

- `type` ("file", required)
- `link` (LinkedFileRequest, required)
- `on_agent_call` (enum, optional) — What an Agent should do when calling a Tool.
  - Allowed values: `stop`, `continue`
- `file` (AgentLinkedFileResponseFile, optional)

### AgentInlineTool

- `type` ("inline", required)
- `json_schema` (ToolFunction, required)
- `on_agent_call` (enum, optional) — What an Agent should do when calling a Tool.
  - Allowed values: `stop`, `continue`

### PromptKernelRequestTemplate

The template contains the main structure and instructions for the model, including input variables for dynamic values. For chat models, provide the template as a ChatTemplate (a list of messages), e.g. a system message, followed by a user message with an input variable. For completion models, provide a prompt template as a string. Input variables should be specified with double curly bracket syntax: `{{input_name}}`.

### PromptKernelRequestStop

The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence.

### PromptKernelRequestReasoningEffort

Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget.

### DatasetResponse

Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions.

- `path` (string, required) — Path of the Dataset, including the name, which is used as a unique identifier.
- `id` (string, required) — Unique identifier for the Dataset. Starts with `ds_`.
- `name` (string, required) — Name of the Dataset, which is used as a unique identifier.
- `version_id` (string, required) — Unique identifier for the specific Dataset Version. If no query params provided, the default deployed Dataset Version is returned. Starts with `dsv_`.
- `created_at` (datetime, required)
- `updated_at` (datetime, required)
- `last_used_at` (datetime, required)
- `datapoints_count` (integer, required) — The number of Datapoints in this Dataset version.
- `directory_id` (string, optional) — ID of the directory that the file is in on Humanloop.
- `description` (string, optional) — Description of the Dataset.
- `schema` (map from string to any, optional) — The JSON schema for the File.
- `readme` (string, optional) — Long description of the file.
- `tags` (list of string, optional) — List of tags associated with the file.
- `type` ("dataset", optional)
- `environments` (list of EnvironmentResponse, optional) — The list of environments the Dataset Version is deployed to.
- `created_by` (any, optional) — The user who created the Dataset.
- `version_name` (string, optional) — Unique name for the Dataset version. Version names must be unique for a given Dataset.
- `version_description` (string, optional) — Description of the version, e.g., the changes made in this version.
- `datapoints` (list of DatapointResponse, optional) — The list of Datapoints in this Dataset version. Only provided if explicitly requested.
- `attributes` (map from string to any, optional) — Additional fields to describe the Dataset. Helpful to separate Dataset versions from each other with details on how they were created or used.

### LinkedFileRequest

- `file_id` (string, required)
- `environment_id` (string, optional)
- `version_id` (string, optional)

### AgentLinkedFileResponseFile

### DatapointResponse

- `id` (string, required) — Unique identifier for the Datapoint. Starts with `dp_`.
- `inputs` (map from string to string, optional) — The inputs to the prompt template.
- `messages` (list of ChatMessage, optional) — List of chat messages to provide to the model.
- `target` (map from string to DatapointResponseTargetValue, optional) — Object with criteria necessary to evaluate generations with this Datapoint. This is passed in as an argument to Evaluators when used in an Evaluation.

### DatapointResponseTargetValue

## Examples

**Request**

```json
{
  "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"
}
```

**Response**

```json
{
  "id": "medqa_experiment_0001",
  "evaluator_logs": [],
  "flow": {
    "path": "Personal Projects/MedQA",
    "id": "fl_6o701g4jmcanPVHxdqD0O",
    "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"
      }
    },
    "name": "MedQA Flow",
    "version_id": "flv_7ZNQREaScH0JkhUwtXrLN",
    "created_at": "2024-07-08T22:40:39",
    "updated_at": "2024-07-08T22:40:39",
    "last_used_at": "2024-07-08T22:40:35",
    "version_logs_count": 10
  },
  "output": "The patient is likely experiencing a myocardial infarction. Immediate medical attention is required.",
  "error": null,
  "inputs": {
    "question": "Patient with a history of diabetes and normal tension presents with chest pain and shortness of breath."
  },
  "log_status": "complete"
}
```

**SDK Code**

```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": "<apiKey>",
    "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", "<apiKey>")
	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"] = '<apiKey>'
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<String> response = Unirest.patch("https://api.humanloop.com/v5/flows/logs/medqa_experiment_0001")
  .header("X-API-KEY", "<apiKey>")
  .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
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->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' => '<apiKey>',
  ],
]);

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", "<apiKey>");
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": "<apiKey>",
  "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()
```