feat: add capability to track LLM calls by task and agent (#3087)

* feat: add capability to track LLM calls by task and agent

This makes it possible to filter or scope LLM events by specific agents or tasks, which can be very useful for debugging or analytics in real-time application

* feat: add docs about LLM tracking by Agents and Tasks

* fix incompatible BaseLLM.call method signature

* feat: support to filter LLM Events from Lite Agent
This commit is contained in:
Lucas Gomide
2025-07-01 10:30:16 -03:00
committed by GitHub
parent af9c01f5d3
commit b7bf15681e
14 changed files with 788 additions and 44 deletions

View File

@@ -1,5 +1,4 @@
from typing import Any, Dict, List, Optional, Union
from unittest.mock import Mock
import pytest
@@ -31,6 +30,8 @@ class CustomLLM(BaseLLM):
tools=None,
callbacks=None,
available_functions=None,
from_task=None,
from_agent=None,
):
"""
Mock LLM call that returns a predefined response.