wrap
helpers, you can use the trackEvent
method directly.
The trackEvent
method is used to track and log runs in your application. It takes three parameters: type
, event
, and data
.
Parameter | Type | Description |
---|---|---|
type | agent , tool , llm or chain | The type of the run |
event | start , end , error or feedback | The name of the event. |
data | Partial<RunEvent> | Data associated with the run. |
RunEvent
type is composed of the following properties:
Field | Type | Description | Required |
---|---|---|---|
runId | string | Unique identifier | Yes |
input | JSON | Input data | No |
output | JSON | Output data | No |
tokensUsage | { completion: number, prompt: number } | Number of tokens used in the run. | No |
userId | string | The user ID. | No |
userProps | JSON | The user properties. | No |
parentRunId | string | The parent run ID. | No |
extra | JSON | Any extra data associated with the event. | No |
tags | string[] | Tags associated with the event. | No |
error | { message: string, stack?: string } | Error object if an error occurred. | No |
parentRunId
parameterparentRunId
parameter to link child runs.