Serves as a record of a single interaction within Scoopika. This interaction can be either a user request initiating a conversation or an agent’s response to that request.

There are two primary types of RunHistory objects:

UserRequest: This represents the initial input or request sent by the user to kick off a conversation or send a new message.

AgentResponse: This represents the response generated by an agent after processing the user’s request. It includes the agent’s output, along with information about any tools the agent utilized during the interaction.

Props

UserRequest

at
number

Indicates the timestamp (in milliseconds) of when the user request was made (when the run started).

role
string, always "user"

The role of the participant in the interaction, which will always be "user" for a user request.

run_id
string

The ID assigned to the entire interaction (run). a finished request will also have an AgentResponse with the same run_id.

session_id
string

Specifies the ID of the chat session within which the interaction took place.

user_id
string | undefined

The user ID associated with the request, if available in the session.

request
Inputs

Represents the user’s input that initiated the interaction

Reference to Inputs

AgentResponse

at
number

The date of when the run was finished.

role
string, always "agent"

The role of the participant in the interaction, which will always be "agent" for an agent response.

run_id
string

The ID assigned to the entire interaction (run). the response’s request will have the same run_id.

session_id
string

Specifies the ID of the chat session within which the interaction took place.

agent_id
string

The ID of the agent that handled the interaction.

agent_name
string

The name of the agent that handled the interaction.

response
LLMResponse

The agent’s response to a user’s request

Reference to LLMResponse

tools
ToolHistory[]

An array containing information about any external tools or functions that the agent called during the interaction.

Reference to ToolHistory

All calls listed in tools were validated and executed successfully