Skip to content

Conversation

@TLSDC
Copy link
Collaborator

@TLSDC TLSDC commented Dec 3, 2024

No description provided.

@TLSDC
Copy link
Collaborator Author

TLSDC commented Dec 3, 2024

updating the decorator behavior would be tedious, and not as convenient as i wanted it to be, ie it would need the partial decorator:

@partial(tracker, suffix='main')
def get_action(...

which is a one liner but still uses fancy stuff

on the other hand the current approach is more lines but more simple:

with set_tracker('main') as main_tracker:
    # do llm stuff
    with set_tracker('sub_agent') as sub_tracker:
        # do other llm stuff
stats = main_tracker.get_stats()
stats.update(sub_tracker.get_stats())

more stuff to keep track of but also so much easier to implement and the decorator still works for one level scope :)

@TLSDC TLSDC requested a review from recursix December 3, 2024 16:36
Copy link
Collaborator

@recursix recursix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very simple.

Does the main_tracker cost report sub_tracker + other_usager or it just report Other_usage i.e. everything tracked under sub_tracker is not seen by the main tracker?

@TLSDC
Copy link
Collaborator Author

TLSDC commented Dec 3, 2024

main_tracker trasks everything inside its scope following this test

def test_imbricate_trackers():

@TLSDC TLSDC merged commit e411f7d into main Dec 3, 2024
6 checks passed
@TLSDC TLSDC deleted the tlsdc/tracker_update branch December 3, 2024 20:10
@TLSDC TLSDC mentioned this pull request Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants