record_action
Decorator
To make AgentOps easier to integrate, we also provide a function decorator to automatically creates
and records an event for your function.
python
- event_type (str): Type of the event
- tags (List[str], optional): Any tags associated with the event. Defaults to None.
record()
Method
From this point, simply call the .record() method in the AgentOps client:
python
- event_type (str): Type of the event, e.g., “API Call”. Required.
- params (str, optional): The parameters passed to the operation.
- returns (str, optional): The output of the operation.
- result (EventState, optional): Result of the operation, Enum: “Success”, “Fail”, “Indeterminate”.
- action_type (ActionType, optional): Type of action of the event e.g. ‘action’, ‘llm’, ‘api’
- model (Models, optional): The model used during the event if an LLM is used (i.e. GPT-4). For models, see the types available in the Models enum. If a model is set but an action_type is not, the action_type will be coerced to ‘llm’. Defaults to None.
- prompt (str, optional): The input prompt for an LLM call when an LLM is being used.
- tags (List[str], optional): Tags that can be used for grouping or sorting later. e.g. [“my_tag”].
- timestamp (float): The timestamp for when the event was created, represented as seconds since the epoch.