Events
Datapoints
Datasets
Projects
Experiments
Create a batch of events
Please refer to our instrumentation guide for detailed information
curl --request POST \
--url https://api.honeyhive.ai/events/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"events": [
{
"project": "Simple RAG",
"event_type": "model",
"event_name": "Model Completion",
"source": "playground",
"session_id": "caf77ace-3417-4da4-944d-f4a0688f3c23",
"event_id": "7f22137a-6911-4ed3-bc36-110f1dde6b66",
"parent_id": "caf77ace-3417-4da4-944d-f4a0688f3c23",
"children_ids": [],
"config": {
"model": "gpt-3.5-turbo",
"version": "v0.1",
"provider": "openai",
"hyperparameters": {
"temperature": 0,
"top_p": 1,
"max_tokens": 1000,
"presence_penalty": 0,
"frequency_penalty": 0,
"stop": [],
"n": 1
},
"template": [
{
"role": "system",
"content": "Answer the user'\''s question only using provided context. Context: {{ context }}"
},
{
"role": "user",
"content": "{{question}}"
}
],
"type": "chat"
},
"inputs": {
"context": "Hello world",
"question": "What is in the context?",
"chat_history": [
{
"role": "system",
"content": "Answer the user'\''s question only using provided context. Context: Hello world"
},
{
"role": "user",
"content": "What is in the context?"
}
]
},
"outputs": {
"role": "assistant",
"content": "Hello world"
},
"error": null,
"start_time": 1714978764301,
"end_time": 1714978765301,
"duration": 999.8056,
"metadata": {
"cost": 0.00008,
"completion_tokens": 23,
"prompt_tokens": 35,
"total_tokens": 58
},
"feedback": {},
"metrics": {
"Answer Faithfulness": 5,
"Answer Faithfulness_explanation": "The AI assistant'\''s answer is a concise and accurate description of Ramp'\''s API. It provides a clear explanation of what the API does and how developers can use it to integrate Ramp'\''s financial services into their own applications. The answer is faithful to the provided context.",
"Number of words": 18
},
"user_properties": {
"user": "google-oauth2|111840237613341303366"
}
}
],
"is_single_session": true,
"session_properties": {
"source": "playground",
"session_name": "Playground Session",
"session_id": "caf77ace-3417-4da4-944d-f4a0688f3c23",
"inputs": {
"context": "Hello world",
"question": "What is in the context?",
"chat_history": [
{
"role": "system",
"content": "Answer the user'\''s question only using provided context. Context: Hello world"
},
{
"role": "user",
"content": "What is in the context?"
}
]
},
"outputs": {
"role": "assistant",
"content": "Hello world"
},
"error": null,
"metrics": {},
"feedback": {},
"metadata": {},
"user_properties": {
"user": "google-oauth2|111840237613341303366"
}
}
}'
{
"event_ids": [
"7f22137a-6911-4ed3-bc36-110f1dde6b66",
"7f22137a-6911-4ed3-bc36-110f1dde6b67"
],
"session_id": "caf77ace-3417-4da4-944d-f4a0688f3c23",
"success": true
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Body
Project associated with the event
Source of the event - production, staging, etc
Name of the event
Specify whether the event is of "model", "tool" or "chain" type
model
, tool
, chain
Associated configuration JSON for the event - model name, vector index name, etc
Input JSON given to the event - prompt, chunks, etc
How long the event took in milliseconds
Unique id of the event, if not set, it will be auto-generated
Unique id of the session associated with the event, if not set, it will be auto-generated
Id of the parent event if nested
Id of events that are nested within the event
Final output JSON of the event
Any error description if event failed
UTC timestamp (in milliseconds) for the event start
UTC timestamp (in milliseconds) for the event end
Any system or application metadata associated with the event
Any user feedback provided for the event output
Any values computed over the output of the event
Any user properties associated with the event
Default is false. If true, all events will be associated with the same session
Name of the session
Source of the session - production, staging, etc
Unique id of the session, if not set, it will be auto-generated
Associated configuration for the session
Input object passed to the session - user query, text blob, etc
Final output of the session - completion, chunks, etc
Any error description if session failed
Any user properties associated with the session
Any values computed over the output of the session
Any user feedback provided for the session output
Any system or application metadata associated with the session
{
"source": "playground",
"session_name": "Playground Session",
"session_id": "caf77ace-3417-4da4-944d-f4a0688f3c23",
"inputs": {
"context": "Hello world",
"question": "What is in the context?",
"chat_history": [
{
"role": "system",
"content": "Answer the user's question only using provided context. Context: Hello world"
},
{
"role": "user",
"content": "What is in the context?"
}
]
},
"outputs": {
"role": "assistant",
"content": "Hello world"
},
"error": null,
"metrics": {},
"feedback": {},
"metadata": {},
"user_properties": {
"user": "google-oauth2|111840237613341303366"
}
}
curl --request POST \
--url https://api.honeyhive.ai/events/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"events": [
{
"project": "Simple RAG",
"event_type": "model",
"event_name": "Model Completion",
"source": "playground",
"session_id": "caf77ace-3417-4da4-944d-f4a0688f3c23",
"event_id": "7f22137a-6911-4ed3-bc36-110f1dde6b66",
"parent_id": "caf77ace-3417-4da4-944d-f4a0688f3c23",
"children_ids": [],
"config": {
"model": "gpt-3.5-turbo",
"version": "v0.1",
"provider": "openai",
"hyperparameters": {
"temperature": 0,
"top_p": 1,
"max_tokens": 1000,
"presence_penalty": 0,
"frequency_penalty": 0,
"stop": [],
"n": 1
},
"template": [
{
"role": "system",
"content": "Answer the user'\''s question only using provided context. Context: {{ context }}"
},
{
"role": "user",
"content": "{{question}}"
}
],
"type": "chat"
},
"inputs": {
"context": "Hello world",
"question": "What is in the context?",
"chat_history": [
{
"role": "system",
"content": "Answer the user'\''s question only using provided context. Context: Hello world"
},
{
"role": "user",
"content": "What is in the context?"
}
]
},
"outputs": {
"role": "assistant",
"content": "Hello world"
},
"error": null,
"start_time": 1714978764301,
"end_time": 1714978765301,
"duration": 999.8056,
"metadata": {
"cost": 0.00008,
"completion_tokens": 23,
"prompt_tokens": 35,
"total_tokens": 58
},
"feedback": {},
"metrics": {
"Answer Faithfulness": 5,
"Answer Faithfulness_explanation": "The AI assistant'\''s answer is a concise and accurate description of Ramp'\''s API. It provides a clear explanation of what the API does and how developers can use it to integrate Ramp'\''s financial services into their own applications. The answer is faithful to the provided context.",
"Number of words": 18
},
"user_properties": {
"user": "google-oauth2|111840237613341303366"
}
}
],
"is_single_session": true,
"session_properties": {
"source": "playground",
"session_name": "Playground Session",
"session_id": "caf77ace-3417-4da4-944d-f4a0688f3c23",
"inputs": {
"context": "Hello world",
"question": "What is in the context?",
"chat_history": [
{
"role": "system",
"content": "Answer the user'\''s question only using provided context. Context: Hello world"
},
{
"role": "user",
"content": "What is in the context?"
}
]
},
"outputs": {
"role": "assistant",
"content": "Hello world"
},
"error": null,
"metrics": {},
"feedback": {},
"metadata": {},
"user_properties": {
"user": "google-oauth2|111840237613341303366"
}
}
}'
{
"event_ids": [
"7f22137a-6911-4ed3-bc36-110f1dde6b66",
"7f22137a-6911-4ed3-bc36-110f1dde6b67"
],
"session_id": "caf77ace-3417-4da4-944d-f4a0688f3c23",
"success": true
}