Log to a Flow

POST

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.

Query parameters

version_idstringOptional

A specific Version ID of the Flow to log to.

environmentstringOptional

Name of the Environment identifying a deployed version to log to.

Request

This endpoint expects an object.
evaluation_idstringOptional

Unique identifier for the Evaluation Report to associate the Log to.

pathstringOptional

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.

idstringOptional

ID for an existing Flow.

start_timedatetimeOptional

The start time of the Trace. Will be updated if a child Log with an earlier start time is added.

end_timedatetimeOptional

The end time of the Trace. Will be updated if a child Log with a later end time is added.

outputstringOptional

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_atdatetimeOptional

User defined timestamp for when the log was created.

errorstringOptional

Error message if the log is an error.

provider_latencydoubleOptional

Duration of the logged event in seconds.

stdoutstringOptional

Captured log and debug statements.

provider_requestmap from strings to anyOptional

Raw request sent to provider.

provider_responsemap from strings to anyOptional

Raw response received the provider.

inputsmap from strings to anyOptional

The inputs passed to the prompt template.

sourcestringOptional

Identifies where the model was called from.

metadatamap from strings to anyOptional

Any additional metadata to record.

source_datapoint_idstringOptional

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_idstringOptional

The ID of the parent Log to nest this Log under in a Trace.

batch_idstringOptional

Unique identifier for the Batch to add this Batch to. Batches are used to group Logs together for Evaluations. A Batch will be created if one with the given ID does not exist.

userstringOptional

End-user ID related to the Log.

environmentstringOptional

The name of the Environment the Log is associated to.

savebooleanOptional

Whether the request/response payloads will be stored on Humanloop.

log_idstringOptional

The identifier for the Log. If not specified, a default ID will be generated. This allows additional Logs to be appended to the trace without waiting for Humanloop to return an ID.

flowobjectOptional

Flow used to generate the Trace.

trace_status"complete" or "incomplete"Optional
Allowed values: completeincomplete

Status of the Trace. When a Trace is marked as complete, no more Logs can be added to it. Monitoring Evaluators will only run on complete Traces. If you do not intend to add more Logs to the Trace after creation, set this to complete.

Response

This endpoint returns an object.
idstring

Unique identifier for the Log.

flow_idstring

Unique identifier for the Flow.

version_idstring

Unique identifier for the Flow Version.

trace_status"complete" or "incomplete"Optional
Allowed values: completeincomplete

Status of the Trace. When a Trace is marked as complete, no more Logs can be added to it. Monitoring Evaluators will only run on complete Traces.

Errors