chats

Chat

Get a chat response by providing details of the model configuration in the request.

post/chat

Request

  • Base URL: https://api.humanloop.com/v4
  • URL: https://api.humanloop.com/v4/chat
  • Auth: API key in header X-API-KEY

Request body

projectstring

Unique project name. If no project exists with this name, a new project will be created.

project_idstring

Unique ID of a project to associate to the log. Either this or project must be provided.

session_idstring

ID of the session to associate the datapoint.

session_reference_idstring

A unique string identifying the session to associate the datapoint to. Allows you to log multiple datapoints to a session (using an ID kept by your internal systems) by passing the same session_reference_id in subsequent log requests. Specify at most one of this or session_id.

parent_idstring

ID associated to the parent datapoint in a session.

parent_reference_idstring

A unique string identifying the previously-logged parent datapoint in a session. Allows you to log nested datapoints with your internal system IDs by passing the same reference ID as parent_id in a prior log request. Specify at most one of this or parent_id. Note that this cannot refer to a datapoint being logged in the same request.

inputsobject

The inputs passed to the prompt template.

sourcestring

Identifies where the model was called from.

metadataobject

Any additional metadata to record.

saveboolean

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

source_datapoint_idstring

ID of the source datapoint if this is a log derived from a datapoint in a dataset.

num_samplesinteger

The number of generations.

streamtrue required

If true, tokens will be sent as data-only server-sent events. If num_samples > 1, samples are streamed back independently.

template_language'default' | 'jinja'

Template engine to use for rendering templates.

userstring

End-user ID passed through to provider call.

seedinteger

Deprecated field: the seed is instead set as part of the request.config object.

return_inputsboolean

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.

Changes

No recorded changes to this operation across all 1 revision of this API.