POST
/
evaluate
/
{id}
/
generate
Generate a completion for a list of messages for a given use case
curl --request POST \
  --url https://app.happyrobot.ai/api/v1/evaluate/{id}/generate \
  --header 'Content-Type: application/json' \
  --header 'authorization: <authorization>' \
  --data '{
  "agent_id": "<string>",
  "messages": [
    {
      "id": "<string>",
      "role": "system",
      "content": "<string>",
      "tool_calls": [
        {
          "type": "<string>",
          "id": "<string>",
          "function": {
            "name": "<string>",
            "arguments": "<string>"
          }
        }
      ],
      "name": "<string>",
      "tool_call_id": "<string>",
      "start": 123,
      "end": 123,
      "unpreferred_messages": [
        {
          "id": "<string>",
          "content": "<string>",
          "tool_calls": [
            {
              "type": "<string>",
              "id": "<string>",
              "function": {
                "name": "<string>",
                "arguments": "<string>"
              }
            }
          ]
        }
      ],
      "interrupted_thoughts": "<string>",
      "is_filler": true,
      "discard": false,
      "transfer_contact": {
        "type": "Sales Rep",
        "name": "<string>",
        "email": "<string>",
        "phone": {
          "number": "<string>",
          "extension": "<string>"
        },
        "contact_id": "<string>",
        "slack_channel_id": "<string>"
      }
    }
  ],
  "model": "<string>",
  "temperature": 0.1,
  "date": "<string>",
  "params": {},
  "language": "en-US",
  "selectedRootNodeId": "<string>"
}'
{
  "id": "<string>",
  "role": "system",
  "content": "<string>",
  "tool_calls": [
    {
      "type": "<string>",
      "id": "<string>",
      "function": {
        "name": "<string>",
        "arguments": "<string>"
      }
    }
  ],
  "name": "<string>",
  "tool_call_id": "<string>",
  "start": 123,
  "end": 123,
  "unpreferred_messages": [
    {
      "id": "<string>",
      "content": "<string>",
      "tool_calls": [
        {
          "type": "<string>",
          "id": "<string>",
          "function": {
            "name": "<string>",
            "arguments": "<string>"
          }
        }
      ]
    }
  ],
  "interrupted_thoughts": "<string>",
  "is_filler": true,
  "discard": false,
  "transfer_contact": {
    "type": "Sales Rep",
    "name": "<string>",
    "email": "<string>",
    "phone": {
      "number": "<string>",
      "extension": "<string>"
    },
    "contact_id": "<string>",
    "slack_channel_id": "<string>"
  }
}

Headers

authorization
string
required

Your API key for authentication. Use Bearer format.

Example:

"Bearer API_KEY"

Path Parameters

id
string
required
Required string length: 24

Body

application/json

Body

agent_id
string
required
Required string length: 24
messages
object[]
required
model
string
required
language
enum<string>
required
Available options:
en-US,
en-GB,
es-MX,
es-ES,
es-CO,
pt-PT,
de-DE,
fr-FR,
pl-PL,
ro-RO,
it-IT,
zh-CN,
hi-IN,
ja-JP,
sv-SE
temperature
number
default:0.1
date
string
params
object | null
selectedRootNodeId
string

Response

200

id
string
required

Unique identifier for the message.

role
enum<string>
required

Role of the message.

Available options:
system,
assistant,
user,
tool
start
number
required

Start time in seconds.

content
string

Content of the message.

tool_calls
object[]

Tool calls made by the assistant.

name
string

Name of the tool.

tool_call_id
string

ID of the tool call.

end
number

End time in seconds.

unpreferred_messages
object[]

Unpreferred messages.

interrupted_thoughts
string | null

Thoughts that the assistant was going to speak when the user interrupted.

is_filler
boolean

Whether the message is a filler acknowledgement.

discard
boolean
default:false

Whether the message should be discarded when generating a dataset.

transfer_contact
object

Contact information for the transfer.