motleycrew.tracking.callbacks

The module contains callback handlers for sending data to the Lunary service

Functions

event_delegate_decorator(f)

Decorator of llamaindex event handlers

Classes

LlamaIndexLunaryCallbackHandler(app_id[, ...])

motleycrew.tracking.callbacks.event_delegate_decorator(f)

Decorator of llamaindex event handlers

It is used to transfer event data to a specific handler

Parameters:

f (callable)

class motleycrew.tracking.callbacks.LlamaIndexLunaryCallbackHandler(app_id: str, event_starts_to_ignore: List[None] = None, event_ends_to_ignore: List[None] = None)

Bases: object

AGENT_NAME = 'LlamaIndexAgent'
__init__(app_id: str, event_starts_to_ignore: List[None] = None, event_ends_to_ignore: List[None] = None)

Lamaindex event handler class for sending data to lunary

Parameters:
  • app_id (str) – lunary app id

  • event_starts_to_ignore (List[CBEventType]) – List of events for which the start of the event is ignored

  • event_ends_to_ignore (List[CBEventType]) – List of events for which event completion processing is ignored

start_trace(trace_id: str | None = None) None

Run when an overall trace is launched.

end_trace(trace_id: str | None = None, trace_map: Dict[str, List[str]] | None = None) None

Run when an overall trace is exited.

on_event_start(*args, **kwargs)
on_event_end(*args, **kwargs)
static check_parent_id(parent_id: str) str | None

Checking the occurrence of a value in the ignored list

Parameters:

parent_id (str) – parent id (uuid)

Returns:

return parent id or None

Return type:

str